37 UT_SMALLOBJECT_CLEANPAGES_OFF, 250,
38 UT_SMALLOBJECT_THREADSAFE_ON>
50 virtual int64 getMemoryUsage(
bool inclusive)
const;
62 virtual void copyProperties(
const PXL_Raster &src);
69 void setBWPoints(
float black,
float white);
75 fpreal custom_gamma = 0.0);
87 void setRaster(
void *
r,
bool give_ownership =
true,
88 bool use_offset =
false);
95 int isValid()
const {
return myRaster ? 1 : 0; }
104 void getBWPoints(
float &black,
float &white)
const;
114 exint getCorrectedXres()
const;
115 exint getCorrectedYres()
const;
129 void setDataWindow(
const UT_DimRect &new_rect);
131 {
return myDataWindow; }
133 {
return !myDataWindow.isEmpty(); }
139 void getRange(
float &
min,
float &
max,
140 float black = 0.0f,
float white = 1.0f,
142 bool ignore_farthest =
false)
const;
146 {
return (
unsigned char *)myRaster+myRasterOffset; }
149 {
return (
unsigned char *)myRaster+myRasterOffset; }
159 void setPixelValue(
exint x,
exint y,
const float *vals);
160 void getPixelValue(
exint x,
exint y,
float *vals)
const;
163 bool isInterleaved()
const;
166 int areComponentsRenderable()
const;
169 int64 getNonInterleavedSize()
const;
176 void clear(
const void *
color = 0);
177 void clearNormal(
const float *
color,
184 void readFromRow(
exint y,
void *
data)
const;
188 void writeToRow(
exint y,
const void *
data);
193 void writeToColumn(
exint x,
const void *
data);
197 virtual void reset(
int full = 0);
211 void applyLUT(
const PXL_Raster *src,
float *lptr[4],
212 exint comp,
float lstart,
float lend);
217 void convert8Bit(
unsigned b,
unsigned w);
219 void adjustSaturation(
float sat);
225 int save(std::ostream &os,
int binary = 1)
const;
230 { myWriteFlag = written; }
234 void *getTextureID()
const;
235 void clearTextureID();
237 { myManagesOwnTextureID = manages_own; }
239 {
return myManagesOwnTextureID; }
247 bool premultiply(
PXL_Raster *other =
nullptr);
248 bool unpremultiply(
PXL_Raster *other =
nullptr);
250 bool hasAlpha()
const;
254 void addInterest(
void *callerData,
256 void removeInterest();
260 bool allocRaster(
int alloc_mem = 1);
263 void applyLUT8(
const PXL_Raster *src,
float *lptr[4],
264 exint comp,
float lscale,
float lshift,
266 void applyLUT16(
const PXL_Raster *src,
float *lptr[4],
267 exint comp,
float lscale,
float lshift,
300 template<
typename T,
int NCOMPONENTS,
bool INTERLEAVED,
bool READ_ONLY>
363 offset = x*
sizeof(
T) + y * stride;
364 else if (INTERLEAVED)
365 offset = (comp+x*NCOMPONENTS)*
sizeof(
T) + y *
stride;
367 offset = x *
sizeof(
T) + (y + comp*yres) *
stride;
378 offset = x*
sizeof(
T) + y * stride;
379 else if (INTERLEAVED)
380 offset = (x*NCOMPONENTS)*
sizeof(
T) + y *
stride;
382 offset = x *
sizeof(
T) + (y ) *
stride;
390 if (INTERLEAVED || NCOMPONENTS==1)
392 for (
int i = 0; i < NCOMPONENTS; ++i)
397 vals[i] =
float(data[i]);
403 for (
int i = 0; i < NCOMPONENTS; ++i,
404 data = (
const DataType *)(((
const unsigned char *)data) + yres_stride))
409 vals[i] =
float(*data);
419 if (INTERLEAVED || NCOMPONENTS==1)
421 for (
int i = 0; i < NCOMPONENTS; ++i)
427 for (
int i = 0; i < NCOMPONENTS; ++i,
448 if (INTERLEAVED || NCOMPONENTS==1)
450 for (
int i = 0; i < NCOMPONENTS; ++i)
456 for (
int i = 0; i < NCOMPONENTS; ++i,
SYS_FORCE_INLINE DataType * getPixelFast(void *pixels, exint x, exint y) const
SYS_FORCE_INLINE void getPixelValueFast(const void *pixels, exint x, exint y, float *vals) const
int PXLpackingComponents(PXL_Packing p)
UT_ASSERT_COMPILETIME(BRAY_EVENT_MAXFLAGS<=32)
SYS_FORCE_INLINE exint getYres() const
bool myManagesOwnTextureID
int getNumChannels() const
void setTextureID(void *id)
OIIO_UTIL_API bool copy(string_view from, string_view to, std::string &err)
const GLuint GLenum const void * binary
UT_StringHolder myColorSpaceName
PXL_ColorSpace getColorSpace() const
Colorspace this raster requires for correct display.
const void * getRawPixels() const
fpreal getColorSpaceGamma() const
const UT_StringHolder & getOCIODisplay() const
const UT_StringHolder & getOCIOView() const
ImageBuf OIIO_API min(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
GLint GLint GLsizei GLint GLenum GLenum const void * pixels
OIIO_FORCEINLINE vbool4 insert(const vbool4 &a, bool val)
Helper: substitute val for a[i].
bool getDataWritten() const
SYS_FORCE_INLINE PXL_RasterWrapper< T, NCOMPONENTS, INTERLEAVED, true > makeConstant() const
PXL_DataFormat getFormat() const
#define UT_ASSERT_MSG(ZZ,...)
OIIO_FORCEINLINE bool extract(const vbool4 &a)
SYS_FORCE_INLINE exint getXres() const
PXL_ColorSpace myColorSpace
PXL_Packing getPacking() const
exint getNumPixels() const
SYS_FORCE_INLINE void setRaster(RasterType *raster)
GLint GLenum GLboolean GLsizei stride
SYS_ConstType< T, READ_ONLY >::type DataType
bool isInterleaved() const
HUSD_API const char * raster()
UT_StringHolder myOCIOView
bool managesOwnTextureID() const
GLfloat GLfloat GLfloat alpha
SIM_API const UT_StringHolder rotation
OPENVDB_API void initialize()
Global registration of native Grid, Transform, Metadata and Point attribute types. Also initializes blosc (if enabled).
bool hasDataWindow() const
static SYS_FORCE_INLINE T convertFromFloat(const float val)
GLboolean GLboolean GLboolean b
const UT_DimRect & getDataWindow() const
const void * getPixels() const
SYS_FORCE_INLINE RasterType * getRaster() const
const UT_StringHolder & getColorSpaceName() const
OCIO colorspace name, valid for PXL_CS_OCIO.
ImageBuf OIIO_API max(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
int PXLformatDepth(PXL_DataFormat d)
GLubyte GLubyte GLubyte GLubyte w
int getProxyIndex() const
void setDataWritten(bool written=true)
GLdouble GLdouble GLdouble y2
void setManagesOwnTextureID(bool manages_own)
ImageBuf OIIO_API crop(const ImageBuf &src, ROI roi={}, int nthreads=0)
SYS_ConstType< PXL_Raster, READ_ONLY >::type RasterType
SYS_FORCE_INLINE void zeroPixelValueFast(void *pixels, exint x, exint y) const
DataType * getPixel(exint x, exint y, exint comp=0) const
SYS_FORCE_INLINE PXL_RasterWrapper(RasterType *raster=nullptr)
UT_StringHolder myOCIODisplay
SYS_FORCE_INLINE void setPixelValueFast(void *pixels, exint x, exint y, const T *vals) const