HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TIL_Raster Class Reference

#include <TIL_Raster.h>

+ Inheritance diagram for TIL_Raster:

Public Member Functions

 TIL_Raster ()
 
 TIL_Raster (const TIL_Raster &)
 
 TIL_Raster (const PXL_Raster &)
 
 TIL_Raster (const IMG_Raster &, bool copy=true)
 
 TIL_Raster (const TIL_Raster &, exint x1, exint y1, exint x2, exint y2)
 
 TIL_Raster (TIL_Packing p, TIL_DataFormat f, exint xres=0, exint yres=0, int clear=0, int alloc=1)
 
 ~TIL_Raster () override
 
int64 getMemoryUsage (bool inclusive) const override
 
void setID (UT_TokenString *token)
 
const UT_TokenStringgetID () const
 
void copy (const PXL_Raster &src) override
 
void copyProperties (const PXL_Raster &src) override
 
void reset (int full=0) override
 
void scaleFromRasterToSize (TIL_Raster *scaled, exint xres, exint yres, UT_FilterType flt=UT_FILTER_BOX) const
 
void scaleFromRasterToScale (TIL_Raster *scaled, float xsc, float ysc, UT_FilterType flt=UT_FILTER_BOX) const
 
void scaledInsertFromRaster (const PXL_Raster *source, UT_FilterType ftype, exint fromx, exint fromy, exint fromsizex, exint fromsizey, exint tox, exint toy, exint tosizex, exint tosizey)
 
void applyEmulation (const TIL_Raster *src, float black, float white, float scale, float shift, float gamma, exint comp=-1)
 
void adjustGamma (float gamma, bool red=true, bool green=true, bool blue=true, bool alpha=false)
 
void splitHRaster (const TIL_Raster *r1, const TIL_Raster *r2, float fract)
 
void splitVRaster (const TIL_Raster *r1, const TIL_Raster *r2, float fract)
 
void blendRaster (const TIL_Raster *r1, const TIL_Raster *r2, float fract)
 
void diffRaster (const TIL_Raster *r1, const TIL_Raster *r2)
 
void subRaster (const TIL_Raster *r1, const TIL_Raster *r2)
 
void highlightRaster (const TIL_Raster *r1, const TIL_Raster *r2, float threshold)
 
void setUserData (void *data)
 
voidgetUserData ()
 
bool getClosestEdge (exint &x, exint &y, exint distance, float tolerance=0.1f, UT_Vector2 *pos=0, UT_Vector2 *dir=0)
 
void setIncomplete (int inc=1)
 
int isIncomplete () const
 
- Public Member Functions inherited from PXL_Raster
 PXL_Raster ()
 
 PXL_Raster (const PXL_Raster &)
 
 PXL_Raster (const PXL_Raster &, exint x1, exint y1, exint x2, exint y2)
 
 PXL_Raster (PXL_Packing p, PXL_DataFormat f, exint xres=0, exint yres=0, int clear=0, int alloc=1)
 
virtual ~PXL_Raster ()
 
PXL_Rasteroperator= (const PXL_Raster &)=delete
 Assignment disallowed, use copy() instead. More...
 
void setPacking (PXL_Packing p)
 
void setFormat (PXL_DataFormat f)
 
void setRes (exint x, exint y)
 
void setBWPoints (float black, float white)
 
void setVisualization (Visualization vis)
 
Visualization getVisualization () const
 
void setColorSpace (PXL_ColorSpace space, fpreal custom_gamma=0.0)
 
void setOCIOColorSpace (const UT_StringHolder &space)
 
void setOCIODisplayView (const UT_StringHolder &baked_display, const UT_StringHolder &baked_view)
 
void setOCIOParms (const UT_StringHolder &color_space, const UT_StringHolder &baked_display, const UT_StringHolder &baked_view)
 
void init ()
 
void setRaster (void *r, bool give_ownership=true, bool use_offset=false)
 
voidsteal ()
 
int isValid () const
 
exint getXres () const
 
exint getYres () const
 
exint getNumPixels () const
 
int64 getStride () const
 
int64 getSize () const
 
PXL_DataFormat getFormat () const
 
PXL_Packing getPacking () const
 
void getBWPoints (float &black, float &white) const
 
int getNumChannels () const
 
void setRotation (int rotation)
 
int getRotation () const
 
bool isRotated () const
 
exint getCorrectedXres () const
 
exint getCorrectedYres () const
 
PXL_ColorSpace getColorSpace () const
 Colorspace this raster requires for correct display. More...
 
fpreal getColorSpaceGamma () const
 
const UT_StringHoldergetColorSpaceName () const
 OCIO colorspace name, valid for PXL_CS_OCIO. More...
 
const UT_StringHoldergetOCIODisplay () const
 
const UT_StringHoldergetOCIOView () const
 
void setDataWindow (const UT_DimRect &new_rect)
 
const UT_DimRectgetDataWindow () const
 
bool hasDataWindow () const
 
void getRange (float &min, float &max, float black=0.0f, float white=1.0f, exint comp=-1, bool ignore_farthest=false) const
 
voidgetPixels ()
 
const voidgetPixels () const
 
const voidgetRawPixels () const
 
voidgetPixel (exint x, exint y, exint comp=0)
 
const voidgetPixel (exint x, exint y, exint comp=0) const
 
void setPixelValue (exint x, exint y, const float *vals)
 
void setPixelValueI (exint x, exint y, exint val)
 
void getPixelValue (exint x, exint y, float *vals) const
 
bool isInterleaved () const
 
int areComponentsRenderable () const
 
int64 getNonInterleavedSize () const
 
void clear (const void *color=0)
 
void clearNormal (const float *color, unsigned ib=0, unsigned iw=0)
 
void readFromRow (exint y, void *data) const
 
void writeToRow (exint y, const void *data)
 
void writeToColumn (exint x, const void *data)
 
void extract (const PXL_Raster &from, exint x1, exint y1, exint x2, exint y2)
 
void insert (const PXL_Raster &from, exint x, exint y)
 
void promoteRGBToRGBA (fpreal alpha=1.0)
 
bool promoteRGBToRGBA (UT_UniquePtr< PXL_Raster > &dest, fpreal alpha=1.0) const
 
void applyLUT (const PXL_Raster *src, float *lptr[4], exint comp, float lstart, float lend)
 
void streakEdges (exint x1, exint y1, exint x2, exint y2, PXL_StreakComponents streak_comps=PXL_STREAK_ALL)
 
void convert8Bit (unsigned b, unsigned w)
 
void adjustSaturation (float sat)
 
void flipVertical ()
 
bool load (UT_IStream &is)
 
int save (std::ostream &os, int binary=1) const
 
int getProxyIndex () const
 
void setDataWritten (bool written=true)
 
bool getDataWritten () const
 
void setTextureID (void *id)
 
voidgetTextureID () const
 
void clearTextureID ()
 
void setManagesOwnTextureID (bool manages_own)
 
bool managesOwnTextureID () const
 
void dither (const UT_DimRect &crop)
 
void dither ()
 
bool premultiply (const PXL_Raster *other=nullptr)
 
bool unpremultiply (const PXL_Raster *other=nullptr)
 
bool hasAlpha () const
 
bool clampAlpha ()
 
void addInterest (void *callerData, void(*changeCB)(PXL_Raster *, void *))
 
void removeInterest ()
 

Static Public Member Functions

static void scaleRasterToSize (PXL_Raster *scaled, const PXL_Raster *source, exint xres, exint yres, UT_FilterType flt=UT_FILTER_BOX)
 
static void scaleRasterToScale (PXL_Raster *scaled, const PXL_Raster *source, float xsc, float ysc, UT_FilterType flt=UT_FILTER_BOX)
 
- Static Public Member Functions inherited from UT_SmallObject< PXL_Raster, UT_SMALLOBJECT_CLEANPAGES_OFF, 250, UT_SMALLOBJECT_THREADSAFE_ON >
static voidoperator new (size_t size)
 Regular new/delete operators. More...
 
static void operator delete (void *p, size_t size)
 Regular new/delete operators. More...
 
static voidoperator new (size_t, void *p)
 
static void operator delete (void *, void *)
 

Protected Member Functions

void attemptRealloc (int64 size) override
 
void initialize () override
 
- Protected Member Functions inherited from PXL_Raster
bool allocRaster (int alloc_mem=1)
 
void freeRaster ()
 
void applyLUT8 (const PXL_Raster *src, float *lptr[4], exint comp, float lscale, float lshift, exint size)
 
void applyLUT16 (const PXL_Raster *src, float *lptr[4], exint comp, float lscale, float lshift, exint size)
 

Additional Inherited Members

- Public Types inherited from PXL_Raster
enum  Visualization {
  Visualization::NONE, Visualization::SDF, Visualization::RANDOMID, Visualization::IMAGECOORD,
  Visualization::HUENML, Visualization::HUEVEL
}
 
- Protected Attributes inherited from PXL_Raster
PXL_DataFormat myFormat
 
PXL_Packing myPacking
 
PXL_ColorSpace myColorSpace
 
fpreal myColorSpaceGamma
 
Visualization myVis
 
UT_StringHolder myColorSpaceName
 
UT_StringHolder myOCIODisplay
 
UT_StringHolder myOCIOView
 
exint myRasterOffset
 
exint myXres
 
exint myYres
 
int64 myStride
 
int64 myRasterSize
 
float myBlack
 
float myWhite
 
int myRotation
 
voidmyRaster
 
bool myAmOwner
 
int myProxyIndex
 
bool myWriteFlag
 
bool myManagesOwnTextureID
 
voidmyTextureID
 
void(* myChangeCB )(PXL_Raster *, void *)
 
voidmyCallerData
 
UT_DimRect myDataWindow
 

Detailed Description

Examples:
SOP/SOP_CopRaster.C.

Definition at line 29 of file TIL_Raster.h.

Constructor & Destructor Documentation

TIL_Raster::TIL_Raster ( )
TIL_Raster::TIL_Raster ( const TIL_Raster )
TIL_Raster::TIL_Raster ( const PXL_Raster )
TIL_Raster::TIL_Raster ( const IMG_Raster ,
bool  copy = true 
)
TIL_Raster::TIL_Raster ( const TIL_Raster ,
exint  x1,
exint  y1,
exint  x2,
exint  y2 
)
TIL_Raster::TIL_Raster ( TIL_Packing  p,
TIL_DataFormat  f,
exint  xres = 0,
exint  yres = 0,
int  clear = 0,
int  alloc = 1 
)
TIL_Raster::~TIL_Raster ( )
override

Member Function Documentation

void TIL_Raster::adjustGamma ( float  gamma,
bool  red = true,
bool  green = true,
bool  blue = true,
bool  alpha = false 
)
void TIL_Raster::applyEmulation ( const TIL_Raster src,
float  black,
float  white,
float  scale,
float  shift,
float  gamma,
exint  comp = -1 
)
void TIL_Raster::attemptRealloc ( int64  size)
overrideprotectedvirtual

Reimplemented from PXL_Raster.

void TIL_Raster::blendRaster ( const TIL_Raster r1,
const TIL_Raster r2,
float  fract 
)
void TIL_Raster::copy ( const PXL_Raster src)
overridevirtual

Copy over all the information and data from the src. This allocates a new raster (rather than doing a shallow copy).

Reimplemented from PXL_Raster.

void TIL_Raster::copyProperties ( const PXL_Raster src)
overridevirtual

copies only the raster properties (res, type, etc), not the data, nor does this method allocate memory for a raster.

Reimplemented from PXL_Raster.

void TIL_Raster::diffRaster ( const TIL_Raster r1,
const TIL_Raster r2 
)
bool TIL_Raster::getClosestEdge ( exint x,
exint y,
exint  distance,
float  tolerance = 0.1f,
UT_Vector2 pos = 0,
UT_Vector2 dir = 0 
)
const UT_TokenString* TIL_Raster::getID ( ) const
inline

Definition at line 47 of file TIL_Raster.h.

int64 TIL_Raster::getMemoryUsage ( bool  inclusive) const
overridevirtual

Reimplemented from PXL_Raster.

void* TIL_Raster::getUserData ( )
inline

Definition at line 122 of file TIL_Raster.h.

void TIL_Raster::highlightRaster ( const TIL_Raster r1,
const TIL_Raster r2,
float  threshold 
)
void TIL_Raster::initialize ( )
overrideprotectedvirtual

Reimplemented from PXL_Raster.

int TIL_Raster::isIncomplete ( ) const
inline

Definition at line 136 of file TIL_Raster.h.

void TIL_Raster::reset ( int  full = 0)
overridevirtual

Reimplemented from PXL_Raster.

void TIL_Raster::scaledInsertFromRaster ( const PXL_Raster source,
UT_FilterType  ftype,
exint  fromx,
exint  fromy,
exint  fromsizex,
exint  fromsizey,
exint  tox,
exint  toy,
exint  tosizex,
exint  tosizey 
)

Scales the source raster window to the destination window size and inserts the result at (tox, toy) location of this raster. Incoming coordinates and sizes should be compatible with the respective rasters. You can't do format conversions here.

void TIL_Raster::scaleFromRasterToScale ( TIL_Raster scaled,
float  xsc,
float  ysc,
UT_FilterType  flt = UT_FILTER_BOX 
) const
void TIL_Raster::scaleFromRasterToSize ( TIL_Raster scaled,
exint  xres,
exint  yres,
UT_FilterType  flt = UT_FILTER_BOX 
) const
static void TIL_Raster::scaleRasterToScale ( PXL_Raster scaled,
const PXL_Raster source,
float  xsc,
float  ysc,
UT_FilterType  flt = UT_FILTER_BOX 
)
static
static void TIL_Raster::scaleRasterToSize ( PXL_Raster scaled,
const PXL_Raster source,
exint  xres,
exint  yres,
UT_FilterType  flt = UT_FILTER_BOX 
)
static
void TIL_Raster::setID ( UT_TokenString token)
void TIL_Raster::setIncomplete ( int  inc = 1)
void TIL_Raster::setUserData ( void data)
inline

Definition at line 121 of file TIL_Raster.h.

void TIL_Raster::splitHRaster ( const TIL_Raster r1,
const TIL_Raster r2,
float  fract 
)
void TIL_Raster::splitVRaster ( const TIL_Raster r1,
const TIL_Raster r2,
float  fract 
)
void TIL_Raster::subRaster ( const TIL_Raster r1,
const TIL_Raster r2 
)

The documentation for this class was generated from the following file: