13 #ifndef __TIL_PixelFilter__
14 #define __TIL_PixelFilter__
32 virtual
void filterPlaneVirtual(
36 int plane_src_components)
const = 0;
44 virtual
void combineSample(
46 exint nexisting_samples,
49 const
float *new_sample)
const
51 UT_ASSERT_MSG(0,
"Either this should be overridden by the subclass, or it shouldn't be called. Check vetsSamples().");
53 for (
int i = 0; i < ncomponents; ++i)
54 existing[i] += new_sample[i];
63 return myNeedsSquares;
72 return myNeedsWeights;
94 : myNeedsSquares(false)
95 , myVetsSamples(false)
96 , myNeedsWeights(false)
102 : myNeedsSquares(needs_squares)
103 , myVetsSamples(vets_samples)
104 , myNeedsWeights(needs_weights)
108 const bool myNeedsSquares:1;
109 const bool myNeedsWeights:1;
110 const bool myVetsSamples:1;
129 template<
typename SUBCLASS>
141 int plane_src_components)
const override;
145 bool needs_squares=
false,
146 bool vets_samples=
false,
147 bool needs_weights=
false)
152 template<
int NSRCCOMPONENTS,
int NDSTCOMPONENTS,
bool INTERLEAVED>
153 void filterPlanePart(
162 template<
int NSRCCOMPONENTS,
typename T,
int NDSTCOMPONENTS,
bool INTERLEAVED>
179 template<
int NSRCCOMPONENTS,
typename T,
int NDSTCOMPONENTS,
bool INTERLEAVED>
196 template<
int NSRCCOMPONENTS,
typename T,
int NDSTCOMPONENTS,
bool INTERLEAVED>
210 template<
bool IS_MAX>
219 template<
int NSRCCOMPONENTS,
typename T,
int NDSTCOMPONENTS,
bool INTERLEAVED>
227 exint nexisting_samples,
230 const float *new_sample)
const override
232 if (nnew_samples == 0)
235 if (nexisting_samples == 0)
237 for (
int i = 0; i < ncomponents; ++i)
238 existing[i] = new_sample[i];
244 for (
int i = 0; i < ncomponents; ++i)
246 float v = new_sample[i];
254 for (
int i = 0; i < ncomponents; ++i)
256 float v = new_sample[i];
271 template<
bool LEVEL_INTERP>
278 :
Base(false,false,true)
282 template<
int NSRCCOMPONENTS,
typename T,
int NDSTCOMPONENTS,
bool INTERLEAVED>
299 , myThresholdSquared(threshold*threshold)
302 template<
int NSRCCOMPONENTS,
typename T,
int NDSTCOMPONENTS,
bool INTERLEAVED>
309 float myThresholdSquared;
virtual bool ownedBySingleton() const
SYS_FORCE_INLINE bool needsSquares() const
virtual void filterPlaneVirtual(const TIL_AdaptiveImage &src, TIL_Raster &dest, int planei, int plane_src_components) const =0
TIL_PixelFilterT(bool needs_squares=false, bool vets_samples=false, bool needs_weights=false)
TIL_PixelFilterDebug(int level)
NOTE: This does not need its own plane's squares, just the adaptivity plane's weights.
bool ownedBySingleton() const override
This is the super-duper-class for all pixel filters in TIL.
#define UT_ASSERT_MSG(ZZ,...)
static TIL_PixelFilterPower2Block theInstance
TIL_PixelFilter(bool needs_squares, bool vets_samples, bool needs_weights)
bool ownedBySingleton() const override
virtual ~TIL_PixelFilter()
#define UT_NON_COPYABLE(CLASS)
Define deleted copy constructor and assignment operator inside a class.
SYS_FORCE_INLINE bool vetsSamples() const
TIL_PixelFilterBlurThreshold(float threshold)
static TIL_PixelFilterPixelLevel theInstance
bool ownedBySingleton() const override
static TIL_PixelFilterMinMax< IS_MAX > theInstance
~TIL_PixelFilterT() override
SYS_FORCE_INLINE bool needsWeights() const
bool ownedBySingleton() const override
static TIL_PixelFilterSampleCount theInstance
void combineSample(int ncomponents, exint nexisting_samples, float *existing, exint nnew_samples, const float *new_sample) const override