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;
118 void setDataWindow(
const UT_DimRect &new_rect);
120 {
return myDataWindow; }
122 {
return !myDataWindow.isEmpty(); }
128 void getRange(
float &
min,
float &
max,
129 float black = 0.0f,
float white = 1.0f,
131 bool ignore_farthest =
false)
const;
135 {
return (
unsigned char *)myRaster+myRasterOffset; }
138 {
return (
unsigned char *)myRaster+myRasterOffset; }
148 void setPixelValue(
exint x,
exint y,
const float *vals);
149 void getPixelValue(
exint x,
exint y,
float *vals)
const;
152 bool isInterleaved()
const;
155 int areComponentsRenderable()
const;
158 int64 getNonInterleavedSize()
const;
165 void clear(
const void *
color = 0);
166 void clearNormal(
const float *
color,
173 void readFromRow(
exint y,
void *
data)
const;
177 void writeToRow(
exint y,
const void *
data);
182 void writeToColumn(
exint x,
const void *
data);
186 virtual void reset(
int full = 0);
197 void applyLUT(
const PXL_Raster *src,
float *lptr[4],
198 exint comp,
float lstart,
float lend);
203 void convert8Bit(
unsigned b,
unsigned w);
205 void adjustSaturation(
float sat);
208 int save(std::ostream &os,
int binary = 1)
const;
213 { myWriteFlag = written; }
217 void *getTextureID()
const;
218 void clearTextureID();
220 { myManagesOwnTextureID = manages_own; }
222 {
return myManagesOwnTextureID; }
230 bool unpremultiply(
PXL_Raster *other =
nullptr);
232 bool hasAlpha()
const;
236 void addInterest(
void *callerData,
238 void removeInterest();
242 bool allocRaster(
int alloc_mem = 1);
245 void applyLUT8(
const PXL_Raster *src,
float *lptr[4],
246 exint comp,
float lscale,
float lshift,
248 void applyLUT16(
const PXL_Raster *src,
float *lptr[4],
249 exint comp,
float lscale,
float lshift,
281 template<
typename T,
int NCOMPONENTS,
bool INTERLEAVED,
bool READ_ONLY>
344 offset = x*
sizeof(
T) + y * stride;
345 else if (INTERLEAVED)
346 offset = (comp+x*NCOMPONENTS)*
sizeof(
T) + y *
stride;
348 offset = x *
sizeof(
T) + (y + comp*yres) *
stride;
359 offset = x*
sizeof(
T) + y * stride;
360 else if (INTERLEAVED)
361 offset = (x*NCOMPONENTS)*
sizeof(
T) + y *
stride;
363 offset = x *
sizeof(
T) + (y ) *
stride;
371 if (INTERLEAVED || NCOMPONENTS==1)
373 for (
int i = 0; i < NCOMPONENTS; ++i)
378 vals[i] = float(data[i]);
384 for (
int i = 0; i < NCOMPONENTS; ++i,
385 data = (
const DataType *)(((
const unsigned char *)data) + yres_stride))
390 vals[i] = float(*data);
400 if (INTERLEAVED || NCOMPONENTS==1)
402 for (
int i = 0; i < NCOMPONENTS; ++i)
408 for (
int i = 0; i < NCOMPONENTS; ++i,
429 if (INTERLEAVED || NCOMPONENTS==1)
431 for (
int i = 0; i < NCOMPONENTS; ++i)
437 for (
int i = 0; i < NCOMPONENTS; ++i,
SYS_FORCE_INLINE DataType * getPixelFast(void *pixels, exint x, exint y) const
vbool4 insert(const vbool4 &a, bool val)
Helper: substitute val for a[i].
SYS_FORCE_INLINE void getPixelValueFast(const void *pixels, exint x, exint y, float *vals) const
GLboolean GLboolean GLboolean b
int PXLpackingComponents(PXL_Packing p)
UT_ASSERT_COMPILETIME(BRAY_EVENT_MAXFLAGS<=32)
SYS_FORCE_INLINE exint getYres() const
bool_constant< is_integral< T >::value &&!std::is_same< T, bool >::value &&!std::is_same< T, char >::value &&!std::is_same< T, wchar_t >::value > is_integer
bool myManagesOwnTextureID
void setTextureID(void *id)
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
std::integral_constant< bool, std::numeric_limits< T >::is_signed||std::is_same< T, int128_t >::value > is_signed
bool getDataWritten() const
SYS_FORCE_INLINE PXL_RasterWrapper< T, NCOMPONENTS, INTERLEAVED, true > makeConstant() const
PXL_DataFormat getFormat() const
GLubyte GLubyte GLubyte GLubyte w
#define UT_ASSERT_MSG(ZZ,...)
SYS_FORCE_INLINE exint getXres() const
PXL_ColorSpace myColorSpace
PXL_Packing getPacking() const
ImageBuf OIIO_API min(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
GLuint GLfloat GLfloat GLfloat x1
exint getNumPixels() const
bool extract(const vbool4 &a)
SYS_FORCE_INLINE void setRaster(RasterType *raster)
ImageBuf OIIO_API max(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
SYS_ConstType< T, READ_ONLY >::type DataType
bool isInterleaved() const
HUSD_API const char * raster()
UT_StringHolder myOCIOView
bool managesOwnTextureID() const
OPENVDB_API void initialize()
Global registration of basic types.
bool hasDataWindow() const
static SYS_FORCE_INLINE T convertFromFloat(const float val)
const UT_DimRect & getDataWindow() const
GLuint GLfloat GLfloat GLfloat GLfloat y1
const void * getPixels() const
SYS_FORCE_INLINE RasterType * getRaster() const
const UT_StringHolder & getColorSpaceName() const
OCIO colorspace name, valid for PXL_CS_OCIO.
OIIO_API bool copy(string_view from, string_view to, std::string &err)
int PXLformatDepth(PXL_DataFormat d)
int getProxyIndex() const
void setDataWritten(bool written=true)
GLint GLenum GLboolean GLsizei stride
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
GLint GLint GLsizei GLint GLenum GLenum const void * pixels
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