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