13 #ifndef __TIL_AdaptiveImage__
14 #define __TIL_AdaptiveImage__
29 int nplanes,
const int *num_plane_components,
30 int adaptivity_plane = -1,
31 int levels_below_pixel = 0,
32 int min_samples_per_pixel = 1,
33 int max_samples_per_pixel = 1024,
34 float relative_noise_threshold = 0.005
f);
36 bool sample(
uint64 seed,
int &chosen_x,
int &chosen_y,
int &pixel_sample);
38 void insert(
int x,
int y,
int pixel_sample,
const float *
data);
79 return (myRootPowerOf2+1) - 1 - myLevelsBelowPixel;
83 return myLevels[leveli];
88 return myPriorityCircleOn;
92 x = myPriorityCircleX;
93 y = myPriorityCircleY;
94 radius = myPriorityCircleRadius;
98 myPriorityCircleX =
x;
99 myPriorityCircleY =
y;
102 myPriorityCircleRadius = radius;
103 myPriorityCircleOn =
true;
107 myPriorityCircleOn =
false;
110 static exint pixelArea(
111 int x,
int y,
int level_width,
int level_height,
int leveli,
112 int pixel_width,
int pixel_height,
int pixel_leveli);
119 return myInsertedCount;
129 UT_ASSERT(planei >= 0 && planei < myNumPlanes);
130 if (myPixelFilters && planei >= 0 && planei < myNumPlanes)
131 return myPixelFilters[planei];
137 if (myNumPlanes <= 0)
140 for (
int i = 0; i < myNumPlanes; ++i)
141 myPixelFilters[i] =
nullptr;
146 void updateVarianceEntry(
147 const int cur_x,
const int cur_y,
148 const exint cur_i,
const int leveli);
151 exint mySampledCount;
152 exint myInsertedCount;
153 int myAdaptivityPlane;
162 int myLevelsBelowPixel;
171 int myMinSamplesPerPixel;
180 int myMaxSamplesPerPixel;
187 float myRelativeNoiseThreshold;
192 bool myPriorityCircleOn;
193 float myPriorityCircleX;
194 float myPriorityCircleY;
195 float myPriorityCircleRadius;
UT_UniquePtr< float[]> myWeights
void clearPriorityCircle()
const Level & getLevel(int leveli) const
UT_UniquePtr< exint[]> mySampledCounts
void setPriorityCircle(float x, float y, float radius)
const TIL_PixelFilter * getPixelFilter(int planei) const
int myWidth
Width of this level in pixels.
unsigned long long uint64
exint getInsertedCount() const
OIIO_FORCEINLINE vbool4 insert(const vbool4 &a, bool val)
Helper: substitute val for a[i].
UT_Array< UT_UniquePtr< float[]> > mySumsOfSquares
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
This is the super-duper-class for all pixel filters in TIL.
GLint GLsizei GLsizei height
void initPixelFilterArray()
HUSD_API const char * raster()
void getPriorityCircle(float &x, float &y, float &radius) const
bool isPriorityCircleOn() const
UT_Array< UT_UniquePtr< float[]> > myComponentSums
int myHeight
Height of this level in pixels.
UT_UniquePtr< float[]> myAdjustedVariances
UT_UniquePtr< exint[]> myCounts
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
int getPixelLevelNum() const