38 UT_SMALLOBJECT_CLEANPAGES_OFF, 250,
39 UT_SMALLOBJECT_THREADSAFE_ON>
51 virtual int64 getMemoryUsage(
bool inclusive)
const;
80 void setBWPoints(
float black,
float white);
92 fpreal custom_gamma = 0.0);
104 void setRaster(
void *
r,
bool give_ownership =
true,
105 bool use_offset =
false);
112 int isValid()
const {
return myRaster ? 1 : 0; }
121 void getBWPoints(
float &black,
float &white)
const;
131 exint getCorrectedXres()
const;
132 exint getCorrectedYres()
const;
146 void setDataWindow(
const UT_DimRect &new_rect);
148 {
return myDataWindow; }
150 {
return !myDataWindow.isEmpty(); }
156 void getRange(
float &
min,
float &
max,
157 float black = 0.0f,
float white = 1.0f,
159 bool ignore_farthest =
false)
const;
163 {
return (
unsigned char *)myRaster+myRasterOffset; }
166 {
return (
unsigned char *)myRaster+myRasterOffset; }
176 void setPixelValue(
exint x,
exint y,
const float *vals);
178 void getPixelValue(
exint x,
exint y,
float *vals)
const;
181 bool isInterleaved()
const;
184 int areComponentsRenderable()
const;
187 int64 getNonInterleavedSize()
const;
194 void clear(
const void *
color = 0);
195 void clearNormal(
const float *
color,
211 void writeToColumn(
exint x,
const void *
data);
215 virtual void reset(
int full = 0);
234 exint comp,
float lstart,
float lend);
239 void convert8Bit(
unsigned b,
unsigned w);
241 void adjustSaturation(
float sat);
247 int save(std::ostream &os,
int binary = 1)
const;
252 { myWriteFlag = written; }
256 void *getTextureID()
const;
257 void clearTextureID();
259 { myManagesOwnTextureID = manages_own; }
261 {
return myManagesOwnTextureID; }
269 bool premultiply(
const PXL_Raster *other =
nullptr);
270 bool unpremultiply(
const PXL_Raster *other =
nullptr);
272 bool hasAlpha()
const;
276 void addInterest(
void *callerData,
278 void removeInterest();
282 bool allocRaster(
int alloc_mem = 1);
286 exint comp,
float lscale,
float lshift,
289 exint comp,
float lscale,
float lshift,
323 template<
typename T,
int NCOMPONENTS,
bool INTERLEAVED,
bool READ_ONLY>
386 offset = x*
sizeof(
T) + y * stride;
387 else if (INTERLEAVED)
388 offset = (comp+x*NCOMPONENTS)*
sizeof(
T) + y *
stride;
390 offset = x *
sizeof(
T) + (y + comp*yres) *
stride;
401 offset = x*
sizeof(
T) + y * stride;
402 else if (INTERLEAVED)
403 offset = (x*NCOMPONENTS)*
sizeof(
T) + y *
stride;
405 offset = x *
sizeof(
T) + (y ) *
stride;
413 if (INTERLEAVED || NCOMPONENTS==1)
415 for (
int i = 0; i < NCOMPONENTS; ++i)
420 vals[i] =
float(data[i]);
426 for (
int i = 0; i < NCOMPONENTS; ++i,
427 data = (
const DataType *)(((
const unsigned char *)data) + yres_stride))
432 vals[i] =
float(*data);
442 if (INTERLEAVED || NCOMPONENTS==1)
444 for (
int i = 0; i < NCOMPONENTS; ++i)
450 for (
int i = 0; i < NCOMPONENTS; ++i,
471 if (INTERLEAVED || NCOMPONENTS==1)
473 for (
int i = 0; i < NCOMPONENTS; ++i)
479 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
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
#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
IMATH_NAMESPACE::V2f float
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.
Visualization getVisualization() const
LeafData & operator=(const LeafData &)=delete
ImageBuf OIIO_API max(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
int PXLformatDepth(PXL_DataFormat d)
void setVisualization(Visualization vis)
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