HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PXL_Raster.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: PXL_Raster.h (Pixel Library, C++)
7  *
8  * COMMENTS:
9  * Defines a more generic raster for texture maps & display.
10  *
11  */
12 #ifndef PXL_RASTER_H
13 #define PXL_RASTER_H
14 
15 #include "PXL_API.h"
16 #include "PXL_Common.h"
17 #include <UT/UT_Rect.h>
18 #include <UT/UT_SmallObject.h>
19 #include <UT/UT_StringHolder.h>
20 #include <UT/UT_SharedPtr.h>
21 #include <UT/UT_UniquePtr.h>
22 #include <SYS/fpreal16Limits.h>
23 #include <SYS/SYS_TypeTraits.h>
24 #include <iosfwd>
25 #include <limits>
26 
27 class UT_IStream;
28 
29 #define PXL_ROFF 0
30 
31 class IMX_Layer;
32 
33 class PXL_Raster;
34 
35 /**
36  * For Copernicus OpenGL support some PXL_Rasters will have their
37  * actual pixel data kept in an IMX_Layer (kept on the GPU), which
38  * can be obtained from the PXL_Raster. You can then either get
39  * to the IMX_Layer itself, or, if you want the data on the CPU,
40  * use fetchRater() to copy it over. All calls on PXL_Raster
41  * that get pixel pointers or such, should do that copy themselves.
42  */
44 {
45 public:
47  PXL_RasterFetcher(const PXL_RasterFetcher &) = delete;
49  virtual const IMX_Layer* getLayer() = 0;
50  virtual bool isValid() const = 0;
51  virtual void fetchRaster(PXL_Raster *raster) = 0;
52  virtual size_t getMemoryUsage(bool inclusive) const = 0;
53  virtual ~PXL_RasterFetcher();
54 };
55 
60 };
61 
63  : public UT_SmallObject<PXL_Raster,
64  UT_SMALLOBJECT_CLEANPAGES_OFF, 250,
65  UT_SMALLOBJECT_THREADSAFE_ON>
66 {
67 public:
68  PXL_Raster();
69  PXL_Raster(bool dont_alloc);
71  PXL_Raster(const PXL_Raster &raster,
72  exint x1, exint y1, exint x2, exint y2);
74  exint xres = 0, exint yres = 0, int clear = 0,
75  int alloc = 1);
76  virtual ~PXL_Raster();
77 
78  virtual int64 getMemoryUsage(bool inclusive) const;
79 
81 
82  /// Assignment disallowed, use copy() instead. @see copyProperties()
83  PXL_Raster& operator=(const PXL_Raster &) = delete;
84 
85  /// Copy over all the information and data from the src. This allocates a
86  /// new raster (rather than doing a shallow copy).
87  virtual void copy(const PXL_Raster &src);
88 
89  /// copies only the raster properties (res, type, etc), not the data, nor
90  /// does this method allocate memory for a raster.
91  virtual void copyProperties(const PXL_Raster &src);
92 
93  // initializes the raster (destroys any previous image data). If you call
94  // any of these methods, call init() after to reallocate the raster.
95  void setPacking(PXL_Packing p);
96  void setFormat(PXL_DataFormat f);
97  void setRes(exint x, exint y);
98  void setBWPoints(float black, float white);
99 
100  /// Visualization of the raster, which does not affect the raster
101  /// but is hint for how to display it.
102  void setVisualization(Visualization vis) { myVis = vis; }
103  Visualization getVisualization() const { return myVis; }
104 
105  /// Colorspace that this raster is in. Changing the color space does not
106  /// affect the image values stored in this raster, only how they are
107  /// interpreted. custom_gamma must be specified for PXL_CS_CUSTOM_GAMMA.
108  void setColorSpace(PXL_ColorSpace space,
109  fpreal custom_gamma = 0.0);
110  void setOCIOColorSpace(const UT_StringHolder &space);
111  void setOCIODisplayView(const UT_StringHolder &baked_display,
112  const UT_StringHolder &baked_view);
113  void setOCIOParms(const UT_StringHolder &color_space,
114  const UT_StringHolder &baked_display,
115  const UT_StringHolder &baked_view);
116 
117  void init(bool do_alloc = true);
118 
119  // sets the raster data to r, optionally giving this class ownership of it.
120  // make sure it's the right packing type, res & format!
121  void setRaster(void *r, bool give_ownership = true,
122  bool use_offset = false);
123 
124  // steals ownership from this raster. Returns NULL if this raster doesn't
125  // own the image.
126  void * steal();
127 
128  // "harden" the raster. If this was a reference, it will now own the pixel data.
129  void harden();
130 
131  void fetchIfNeeded() const;
132 
133  // packing, format & xres/yres must be set for the raster to be valid.
134  int isValid() const {
135  return (myRaster || (myRasterFetcher && myRasterFetcher->isValid())) ? 1 : 0;
136  }
137  // accessers.
138  exint getXres() const { return myXres; }
139  exint getYres() const { return myYres; }
140  exint getNumPixels() const { return myXres * myYres; }
141  int64 getStride() const { return myStride; }
142  int64 getSize() const { return myRasterSize; } // bytes
143  PXL_DataFormat getFormat() const { return myFormat; }
144  PXL_Packing getPacking() const { return myPacking; }
145  void getBWPoints(float &black, float &white) const;
146  int getNumChannels() const
147  { return PXLpackingComponents(myPacking); }
148 
149  // Rotation of the raster. Must be between [-360, 360] in 90 degree increments
150  void setRotation(int rotation);
151  int getRotation() const { return myRotation; }
152  bool isRotated() const { return myRotation != 0; }
153 
154  // Raster width and height taking the rotation into consideration
155  exint getCorrectedXres() const;
156  exint getCorrectedYres() const;
157 
158  /// Colorspace this raster requires for correct display
159  PXL_ColorSpace getColorSpace() const { return myColorSpace; }
160 
161  /// Gamma that must be applied to this raster to get accurate color. Only
162  /// valid for PXL_CS_LINEAR, PXL_CS_GAMMA2_2, and PXL_CS_CUSTOM_GAMMA.
163  fpreal getColorSpaceGamma() const { return myColorSpaceGamma; }
164  /// OCIO colorspace name, valid for PXL_CS_OCIO
165  const UT_StringHolder &getColorSpaceName() const { return myColorSpaceName;}
166  const UT_StringHolder &getOCIODisplay() const { return myOCIODisplay;}
167  const UT_StringHolder &getOCIOView() const { return myOCIOView; }
168 
169  // data window
170  void setDataWindow(const UT_DimRect &new_rect);
171  const UT_DimRect & getDataWindow() const
172  { return myDataWindow; }
173  bool hasDataWindow() const
174  { return !myDataWindow.isEmpty(); }
175 
176  // returns the min/max values. black & white specify the black & white
177  // of the raster, comp specifies an optional component to get the range
178  // from. If ignore_farthest is true, 'max' will contain the 2nd largest
179  // value. Good for ignoring the background.
180  void getRange(float &min, float &max,
181  float black = 0.0f, float white = 1.0f,
182  exint comp = -1,
183  bool ignore_farthest = false) const;
184 
185  // leave 2 pixels to draw grey single channels (R,G,B)
186  void *getPixels() { fetchIfNeeded(); return (unsigned char *)myRaster+myRasterOffset; }
187 
188  const void *getPixels() const { fetchIfNeeded(); return (unsigned char *)myRaster+myRasterOffset; }
189 
190  // this is for drawing single greyscale R,G,B images.
191  const void *getRawPixels(bool fetch = true) const { if (fetch) fetchIfNeeded(); return myRaster; }
192 
193  // x/y coords, + comp# for Non-interleaved data (0-2 for RGB, 0-3 RGBA).
194  void * getPixel(exint x, exint y, exint comp = 0);
195  const void * getPixel(exint x, exint y, exint comp = 0) const;
196 
197  void setPixelValue(exint x, exint y, const float *vals);
198  void setPixelValueI(exint x, exint y, exint val);
199  void getPixelValue(exint x, exint y, float *vals) const;
200 
201  // returns 1 if interleaved (RGBRGB), 0 otherwise.
202  bool isInterleaved() const;
203 
204  // returns 1 if this raster can have its components rendered separately.
205  int areComponentsRenderable() const;
206 
207  // if not interleaved, returbs the size of 1 channel's data.
208  int64 getNonInterleavedSize() const;
209 
210  // simple operations.
211 
212  // clears the raster to 0, unless color is not null; it assumes it points
213  // to 8/16/32 bit int or float single/triple/quad value, depending on
214  // packing type & data format.
215  void clear(const void *color = 0);
216  void clearNormal(const float *color,
217  unsigned ib = 0,
218  unsigned iw = 0);
219 
220 
221  // reads a scanline from the raster. THe buffer must be big enough to
222  // hold a single scanline at the data format and packing of the raster.
223  void readFromRow(exint y, void *data) const;
224 
225  // Writes a scanline to the raster. The data format and packing are
226  // assumed to match the raster's.
227  void writeToRow(exint y, const void *data);
228 
229  // instead of writing a scanline, this writes a column of data. The
230  // data format and packing are assumed to match the raster's, and
231  // have yres pixels. Useful for flopping images.
232  void writeToColumn(exint x, const void *data);
233 
234  // deletes the image memory. If full = 1, everything is reset - xres/yres
235  // to 0, packing and format to invalid.
236  virtual void reset(int full = 0);
237 
238  // Extracts a portion of the image 'from' into this raster, setting the
239  // res, data format and packing if needed.
240  void extract(const PXL_Raster &from,
241  exint x1, exint y1, exint x2, exint y2);
242 
243  // Inserts a portion of the image 'from' into this raster. The res,
244  // data format and packing must match.
245  void insert(const PXL_Raster &from,exint x, exint y);
246 
247  // If RGB, add an Alpha channel to this raster.
248  void promoteRGBToRGBA(fpreal alpha = 1.0);
249  // If RGB, add an Alpha channel to dest, or create dest if it doesn't exist.
250  // returns false if no conversion was needed.
251  bool promoteRGBToRGBA(UT_UniquePtr<PXL_Raster> &dest,
252  fpreal alpha = 1.0) const;
253 
254  void applyLUT(const PXL_Raster *src, float *lptr[4],
255  exint comp, float lstart, float lend);
256 
257  // of the raster. The rectangle can go outside of the raster.
258  void streakEdges(exint x1,exint y1, exint x2,exint y2,
259  PXL_StreakComponents streak_comps = PXL_STREAK_ALL);
260  void convert8Bit(unsigned b, unsigned w);
261 
262  void adjustSaturation(float sat);
263 
264  // flip the raster in-place
265  void flipVertical();
266 
267  bool load(UT_IStream &is);
268  int save(std::ostream &os, int binary = 1) const;
269 
270  int getProxyIndex() const { return myProxyIndex; }
271 
272  void setDataWritten(bool written = true)
273  { myWriteFlag = written; }
274  bool getDataWritten() const { return myWriteFlag; }
275 
276  void setTextureID(void *id) { myTextureID = id; }
277  void *getTextureID() const;
278  void clearTextureID();
279  void setManagesOwnTextureID(bool manages_own)
280  { myManagesOwnTextureID = manages_own; }
281  bool managesOwnTextureID() const
282  { return myManagesOwnTextureID; }
283 
284  // dither the image in a subdued way for mplay's render over previous.
285  // If a crop region is provided, only pixels inside the crop will be
286  // dimmed.
287  void dither(const UT_DimRect &crop);
288  void dither();
289 
290  bool premultiply(const PXL_Raster *other = nullptr);
291  bool unpremultiply(const PXL_Raster *other = nullptr);
292 
293  bool hasAlpha() const;
294 
295  bool clampAlpha();
296 
297  void addInterest(void *callerData,
298  void (*changeCB)(PXL_Raster *, void *));
299  void removeInterest();
300 
302  { myRasterFetcher = extra; }
303 
305  { return myRasterFetcher; }
306 
307  bool allocRaster(bool alloc_mem = true);
308 
309 protected:
310  virtual void initialize();
311  void freeRaster();
312 
313  void applyLUT8(const PXL_Raster *src, float *lptr[4],
314  exint comp, float lscale, float lshift,
315  exint size);
316  void applyLUT16(const PXL_Raster *src, float *lptr[4],
317  exint comp, float lscale, float lshift,
318  exint size);
319 
320  virtual void attemptRealloc(int64 size);
321 
331  exint myXres, myYres;
334  float myBlack, myWhite;
336  void *myRaster;
337  bool myAmOwner;
341  void *myTextureID;
342  void (*myChangeCB)(PXL_Raster *, void *);
344 
345  UT_DimRect myDataWindow; // (0,0) is lower-left corner
346 
348 };
349 
350 /// This is a wrapper for when the PXL_DataFormat and PXL_Packing are known
351 /// at compile-time, e.g. constructing this inside a branch of a switch
352 /// statement over all types.
353 template<typename T, int NCOMPONENTS, bool INTERLEAVED, bool READ_ONLY>
355 {
356 public:
359 
361  {
362  UT_ASSERT_COMPILETIME(NCOMPONENTS >= 1 && NCOMPONENTS <= 4);
364 
365  setRaster(raster);
366  }
367 
369  {
371  }
372 
374  {
375  return myRaster;
376  }
377 
379  {
380  return myRaster->getXres();
381  }
383  {
384  return myRaster->getYres();
385  }
386 
388  {
389  myRaster = raster;
390  if (!raster)
391  return;
392 
393  UT_ASSERT(PXLpackingComponents(raster->getPacking()) == NCOMPONENTS);
394  UT_ASSERT(NCOMPONENTS==1 || raster->isInterleaved() == INTERLEAVED);
395  UT_ASSERT(sizeof(T) == PXLformatDepth(raster->getFormat()));
397  raster->getFormat() == PXL_INT8 ||
398  raster->getFormat() == PXL_INT16 ||
399  raster->getFormat() == PXL_INT32));
400  UT_ASSERT(raster->getRawPixels() != nullptr);
401  }
402 
403  DataType *getPixel(exint x, exint y, exint comp = 0) const
404  {
405  UT_ASSERT_P(myRaster);
406  if (!myRaster)
407  return nullptr;
408  const exint xres = myRaster->getXres();
409  const exint yres = myRaster->getYres();
410  if (x < 0 || y < 0 || x >= xres || y >= yres || !myRaster->getRawPixels())
411  return nullptr;
412 
413  const exint stride = myRaster->getStride();
414  int64 offset;
415  if (NCOMPONENTS==1)
416  offset = x*sizeof(T) + y * stride;
417  else if (INTERLEAVED)
418  offset = (comp+x*NCOMPONENTS)*sizeof(T) + y * stride;
419  else
420  offset = x *sizeof(T) + (y + comp*yres) * stride;
421 
422  return (DataType *)(((typename SYS_ConstType<unsigned char,READ_ONLY>::type *)myRaster->getPixels()) + offset);
423  }
424 
425  SYS_FORCE_INLINE DataType *getPixelFast(void *pixels, exint x, exint y/*, exint comp = 0*/) const
426  {
427  UT_ASSERT_P(myRaster);
428  const exint stride = myRaster->getStride();
429  int64 offset;
430  if (NCOMPONENTS==1)
431  offset = x*sizeof(T) + y * stride;
432  else if (INTERLEAVED)
433  offset = (/*comp+*/x*NCOMPONENTS)*sizeof(T) + y * stride;
434  else
435  offset = x *sizeof(T) + (y /*+ comp*myRaster->getYres()*/) * stride;
436  return (DataType *)(((typename SYS_ConstType<unsigned char,READ_ONLY>::type *)pixels) + offset);
437  }
438 
439  SYS_FORCE_INLINE void getPixelValueFast(const void *pixels, exint x, exint y, float *vals) const
440  {
441  // const even if READ_ONLY is false
442  const DataType *data = getPixelFast(pixels, x, y);
443  if (INTERLEAVED || NCOMPONENTS==1)
444  {
445  for (int i = 0; i < NCOMPONENTS; ++i)
446  {
448  vals[i] = float(data[i])/float(std::numeric_limits<T>::max());
449  else
450  vals[i] = float(data[i]);
451  }
452  }
453  else
454  {
455  const exint yres_stride = myRaster->getYres()*myRaster->getStride();
456  for (int i = 0; i < NCOMPONENTS; ++i,
457  data = (const DataType *)(((const unsigned char *)data) + yres_stride))
458  {
460  vals[i] = float(*data)/float(std::numeric_limits<T>::max());
461  else
462  vals[i] = float(*data);
463  }
464  }
465  }
466 
468  {
469  UT_ASSERT_P(!READ_ONLY);
470 
471  DataType *data = getPixelFast(pixels, x, y);
472  if (INTERLEAVED || NCOMPONENTS==1)
473  {
474  for (int i = 0; i < NCOMPONENTS; ++i)
475  data[i] = T(0);
476  }
477  else
478  {
479  const exint yres_stride = myRaster->getYres()*myRaster->getStride();
480  for (int i = 0; i < NCOMPONENTS; ++i,
481  data = (DataType *)(((typename SYS_ConstType<unsigned char,READ_ONLY>::type *)data) + yres_stride))
482  {
483  *data = T(0);
484  }
485  }
486  }
487 
489  {
491  return T(val * std::numeric_limits<T>::max());
492  else
493  return T(val);
494  }
495 
496  SYS_FORCE_INLINE void setPixelValueFast(void *pixels, exint x, exint y, const T *vals) const
497  {
498  UT_ASSERT_P(!READ_ONLY);
499 
500  DataType *data = getPixelFast(pixels, x, y);
501  if (INTERLEAVED || NCOMPONENTS==1)
502  {
503  for (int i = 0; i < NCOMPONENTS; ++i)
504  data[i] = vals[i];
505  }
506  else
507  {
508  const exint yres_stride = myRaster->getYres()*myRaster->getStride();
509  for (int i = 0; i < NCOMPONENTS; ++i,
510  data = (DataType *)(((typename SYS_ConstType<unsigned char,READ_ONLY>::type *)data) + yres_stride))
511  {
512  *data = vals[i];
513  }
514  }
515  }
516 
517 private:
518  RasterType *myRaster;
519 };
520 
521 #endif
SYS_FORCE_INLINE DataType * getPixelFast(void *pixels, exint x, exint y) const
Definition: PXL_Raster.h:425
void * getPixels()
Definition: PXL_Raster.h:186
SYS_FORCE_INLINE void getPixelValueFast(const void *pixels, exint x, exint y, float *vals) const
Definition: PXL_Raster.h:439
void setRasterFetcher(UT_SharedPtr< PXL_RasterFetcher > extra)
Definition: PXL_Raster.h:301
int PXLpackingComponents(PXL_Packing p)
Definition: PXL_Common.h:126
fpreal myColorSpaceGamma
Definition: PXL_Raster.h:325
UT_ASSERT_COMPILETIME(BRAY_EVENT_MAXFLAGS<=32)
SYS_FORCE_INLINE exint getYres() const
Definition: PXL_Raster.h:382
const UT_SharedPtr< PXL_RasterFetcher > & getRasterFetcher() const
Definition: PXL_Raster.h:304
void * myTextureID
Definition: PXL_Raster.h:341
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
Definition: format.h:824
bool myManagesOwnTextureID
Definition: PXL_Raster.h:340
exint getYres() const
Definition: PXL_Raster.h:139
int getNumChannels() const
Definition: PXL_Raster.h:146
int getRotation() const
Definition: PXL_Raster.h:151
void setTextureID(void *id)
Definition: PXL_Raster.h:276
void
Definition: png.h:1083
OIIO_UTIL_API bool copy(string_view from, string_view to, std::string &err)
PXL_DataFormat myFormat
Definition: PXL_Raster.h:322
exint myRasterOffset
Definition: PXL_Raster.h:330
const GLuint GLenum const void * binary
Definition: glcorearb.h:1924
UT_StringHolder myColorSpaceName
Definition: PXL_Raster.h:327
PXL_ColorSpace getColorSpace() const
Colorspace this raster requires for correct display.
Definition: PXL_Raster.h:159
int64 exint
Definition: SYS_Types.h:125
fpreal getColorSpaceGamma() const
Definition: PXL_Raster.h:163
const UT_StringHolder & getOCIODisplay() const
Definition: PXL_Raster.h:166
const UT_StringHolder & getOCIOView() const
Definition: PXL_Raster.h:167
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
Definition: glcorearb.h:108
GLint y
Definition: glcorearb.h:103
bool myWriteFlag
Definition: PXL_Raster.h:339
OIIO_FORCEINLINE vbool4 insert(const vbool4 &a, bool val)
Helper: substitute val for a[i].
Definition: simd.h:3556
bool getDataWritten() const
Definition: PXL_Raster.h:274
SYS_FORCE_INLINE PXL_RasterWrapper< T, NCOMPONENTS, INTERLEAVED, true > makeConstant() const
Definition: PXL_Raster.h:368
#define PXL_API
Definition: PXL_API.h:10
void * myRaster
Definition: PXL_Raster.h:336
GLdouble GLdouble x2
Definition: glad.h:2349
PXL_DataFormat getFormat() const
Definition: PXL_Raster.h:143
int64 myStride
Definition: PXL_Raster.h:332
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
Definition: UT_UniquePtr.h:39
#define UT_ASSERT_MSG(ZZ,...)
Definition: UT_Assert.h:159
OIIO_FORCEINLINE bool extract(const vbool4 &a)
Definition: simd.h:3542
PXL_Visualization Visualization
Definition: PXL_Raster.h:80
SYS_FORCE_INLINE exint getXres() const
Definition: PXL_Raster.h:378
GLfloat f
Definition: glcorearb.h:1926
GLintptr offset
Definition: glcorearb.h:665
PXL_ColorSpace myColorSpace
Definition: PXL_Raster.h:324
PXL_Packing getPacking() const
Definition: PXL_Raster.h:144
GLboolean reset
Definition: glad.h:5138
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
Definition: UT_SharedPtr.h:36
bool myAmOwner
Definition: PXL_Raster.h:337
exint getNumPixels() const
Definition: PXL_Raster.h:140
#define UT_ASSERT_P(ZZ)
Definition: UT_Assert.h:155
SYS_FORCE_INLINE void setRaster(RasterType *raster)
Definition: PXL_Raster.h:387
int isValid() const
Definition: PXL_Raster.h:134
bool isRotated() const
Definition: PXL_Raster.h:152
#define SYS_FORCE_INLINE
Definition: SYS_Inline.h:45
GLint GLenum GLboolean GLsizei stride
Definition: glcorearb.h:872
GLdouble y1
Definition: glad.h:2349
SYS_ConstType< T, READ_ONLY >::type DataType
Definition: PXL_Raster.h:358
float myWhite
Definition: PXL_Raster.h:334
PXL_Packing
Definition: PXL_Common.h:32
bool isInterleaved() const
HUSD_API const char * raster()
UT_StringHolder myOCIOView
Definition: PXL_Raster.h:329
long long int64
Definition: SYS_Types.h:116
GLuint id
Definition: glcorearb.h:655
bool managesOwnTextureID() const
Definition: PXL_Raster.h:281
GLfloat GLfloat GLfloat alpha
Definition: glcorearb.h:112
SIM_API const UT_StringHolder rotation
int myProxyIndex
Definition: PXL_Raster.h:338
OPENVDB_API void initialize()
Global registration of native Grid, Transform, Metadata and Point attribute types. Also initializes blosc (if enabled).
Definition: logging.h:294
bool hasDataWindow() const
Definition: PXL_Raster.h:173
int64 myRasterSize
Definition: PXL_Raster.h:333
PXL_DataFormat
Definition: PXL_Common.h:20
Visualization myVis
Definition: PXL_Raster.h:326
static SYS_FORCE_INLINE T convertFromFloat(const float val)
Definition: PXL_Raster.h:488
GLboolean GLboolean GLboolean b
Definition: glcorearb.h:1222
const UT_DimRect & getDataWindow() const
Definition: PXL_Raster.h:171
GLint GLenum GLint x
Definition: glcorearb.h:409
const void * getPixels() const
Definition: PXL_Raster.h:188
SYS_FORCE_INLINE RasterType * getRaster() const
Definition: PXL_Raster.h:373
exint myYres
Definition: PXL_Raster.h:331
const UT_StringHolder & getColorSpaceName() const
OCIO colorspace name, valid for PXL_CS_OCIO.
Definition: PXL_Raster.h:165
int64 getStride() const
Definition: PXL_Raster.h:141
GLsizeiptr size
Definition: glcorearb.h:664
std::integral_constant< bool, std::numeric_limits< T >::is_signed||std::is_same< T, int128_opt >::value > is_signed
Definition: format.h:818
IMATH_NAMESPACE::V2f IMATH_NAMESPACE::Box2i std::string this attribute is obsolete as of OpenEXR v3 float
Visualization getVisualization() const
Definition: PXL_Raster.h:103
const void * getRawPixels(bool fetch=true) const
Definition: PXL_Raster.h:191
GLuint color
Definition: glcorearb.h:1261
fpreal64 fpreal
Definition: SYS_Types.h:278
LeafData & operator=(const LeafData &)=delete
int64 getSize() const
Definition: PXL_Raster.h:142
void * myCallerData
Definition: PXL_Raster.h:343
PXL_ColorSpace
Definition: PXL_Common.h:72
GLuint GLfloat * val
Definition: glcorearb.h:1608
ImageBuf OIIO_API max(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
int PXLformatDepth(PXL_DataFormat d)
Definition: PXL_Common.h:123
void setVisualization(Visualization vis)
Definition: PXL_Raster.h:102
int myRotation
Definition: PXL_Raster.h:335
PXL_Packing myPacking
Definition: PXL_Raster.h:323
GLubyte GLubyte GLubyte GLubyte w
Definition: glcorearb.h:857
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
int getProxyIndex() const
Definition: PXL_Raster.h:270
void setDataWritten(bool written=true)
Definition: PXL_Raster.h:272
GLboolean r
Definition: glcorearb.h:1222
GLdouble GLdouble GLdouble y2
Definition: glad.h:2349
void setManagesOwnTextureID(bool manages_own)
Definition: PXL_Raster.h:279
ImageBuf OIIO_API crop(const ImageBuf &src, ROI roi={}, int nthreads=0)
SYS_ConstType< PXL_Raster, READ_ONLY >::type RasterType
Definition: PXL_Raster.h:357
PXL_StreakComponents
Definition: PXL_Raster.h:56
SYS_FORCE_INLINE void zeroPixelValueFast(void *pixels, exint x, exint y) const
Definition: PXL_Raster.h:467
exint getXres() const
Definition: PXL_Raster.h:138
DataType * getPixel(exint x, exint y, exint comp=0) const
Definition: PXL_Raster.h:403
SYS_FORCE_INLINE PXL_RasterWrapper(RasterType *raster=nullptr)
Definition: PXL_Raster.h:360
UT_StringHolder myOCIODisplay
Definition: PXL_Raster.h:328
Definition: format.h:1821
SYS_FORCE_INLINE void setPixelValueFast(void *pixels, exint x, exint y, const T *vals) const
Definition: PXL_Raster.h:496
UT_DimRect myDataWindow
Definition: PXL_Raster.h:345
PXL_Visualization
Definition: PXL_Common.h:165
GLenum src
Definition: glcorearb.h:1793
UT_SharedPtr< PXL_RasterFetcher > myRasterFetcher
Definition: PXL_Raster.h:347