13 #ifndef __PXL_DeepSampleList__
14 #define __PXL_DeepSampleList__
77 int size()
const {
return mySampleCount; }
89 void setSampleCount(
int nsamples);
97 #define GET_SCALAR(TYPE, VMETHOD) \
100 return *VMETHOD(&value, sample, sample+1); \
102 #define GET_VECTOR(TYPE, VMETHOD) \
104 if (end == -1) end = sampleCount(); \
105 return VMETHOD(storage, start, end); \
131 {
return 0.5f*(zfront(sample) + zback(sample)); }
138 {
return (
flags(sample) & VOLUME_SAMPLE)
139 && (zfront(sample) < zback(sample)); }
142 {
return flags(sample) & MATTE_SURFACE; }
160 {
return fillChannel(channel, storage, sample, sample+1); }
168 return fillChannel(channel, storage,
start,
end);
194 void dump(
const char *msg=
"",
205 {
return myZfront +
start; }
209 {
return myZback +
start; }
213 {
return myFlags +
start; }
217 {
return myCoverage +
start; }
221 {
return myChannelData[ch] + start*myChannels->tupleSize(ch); }
249 int findFullOpacity(
int of_channel,
float opacity_thresh=1.0)
const;
293 myList.zeroData(myIndex);
304 myList.copySample(myIndex, s, sidx, weight*myScale);
308 myList.addSample(myIndex, s, sidx, weight*myScale);
312 myList.setConditional(myIndex, s, sidx);
319 float zinterp,
bool beerlambert=
false)
321 if (sidx > 0 && zinterp < 1)
326 int index()
const {
return myIndex; }
346 float zf,
float zb,
float scale=1);
361 void zeroData(
int sample);
364 void composite(
int of_channel,
bool force =
false);
367 void uncomposite(
int of_channel,
bool force =
false);
372 int mySampleCapacity;
377 float **myChannelData;
378 bool myPreComposited;
uint64 * coverageBuffer()
Get write-able array of coverage.
const uint8 * fillSampleFlags(uint8 *storage, int start, int end) const
const float * fillZfront(float *storage, int start, int end) const
getFileOption("OpenEXR:storage") storage
float totalWeight() const
uint8 flags(int sample) const
Return flags for a given sample (see SampleFlag enum)
float zback(int sample) const
Return z-back for a given sample.
#define GET_VECTOR(TYPE, VMETHOD)
GLboolean GLboolean GLboolean GLboolean a
bool isVolume(int sample) const
Check to see whether a sample is a volume.
void add(const PXL_DeepSampleList &s, int sidx, float weight=1)
JSON reader class which handles parsing of JSON or bJSON files.
const PXL_DeepChannelListPtr & channels() const
Accessors.
Class which writes ASCII or binary JSON streams.
const float * zback(float *storage, int start=0, int end=-1) const
unsigned long long uint64
A reference counter base class for use with UT_IntrusivePtr.
const float * fillZback(float *storage, int start, int end) const
float * channelBuffer(int i)
Get write-able array of data for a given channel.
UT_IntrusiveRefCounter & operator=(const UT_IntrusiveRefCounter &) noexcept
Assignment operator: Does not modify counter.
GA_API const UT_StringHolder scale
void copyZ(const PXL_DeepSampleList &s)
int sampleCapacity() const
Return the maximum number of samples.
float zmid(int sample) const
Return the z midpoint for a given sample.
int & sampleCount(char *base, int xStride, int yStride, int x, int y)
void trimLength(int nrecords)
Trim the list to the number of records specified.
#define UT_NON_COPYABLE(CLASS)
Define deleted copy constructor and assignment operator inside a class.
const uint8 * flags(uint8 *storage, int start=0, int end=-1) const
const uint64 * fillCoverage(uint64 *storage, int start, int end) const
GLboolean GLboolean GLboolean b
const uint64 * coverage(uint64 *storage, int start=0, int end=-1) const
const float * channelData(int channel, float *storage, int start=0, int end=-1) const
SIM_API const UT_StringHolder force
const float * channelData(int channel, int sample, float *storage) const
const uint64 * coverageBuffer() const
Get read-only array of coverages.
void addVolume(const PXL_DeepSampleList &s, int sidx, float zinterp, bool beerlambert=false)
const float * zfront(float *storage, int start=0, int end=-1) const
float zfront(int sample) const
Return z-back for given sample.
const float * fillChannel(int ch, float *storage, int start, int end) const
const uint8 * flagBuffer() const
const float * zfrontBuffer() const
Sum(PXL_DeepSampleList &list, int idx, float scale)
void setPreComposited(bool c)
Set the pre-composited state.
ImageBuf OIIO_API add(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
const float * channelBuffer(int i) const
Get read-only array of data for a given channel.
bool preComposited() const
Class to help with weighted sums of pixels.
#define GET_SCALAR(TYPE, VMETHOD)
const float * zbackBuffer() const
uint64 coverage(int sample) const
Return the sub-sample pixel location for a given sample.
ImageBuf OIIO_API channels(const ImageBuf &src, int nchannels, cspan< int > channelorder, cspan< float > channelvalues={}, cspan< std::string > newchannelnames={}, bool shuffle_channel_names=false, int nthreads=0)
bool isMatte(int sample) const
Check to see whether a sample is a matte sample.