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)
 
virtual ~TIL_Raster ()
 
virtual int64 getMemoryUsage (bool inclusive) const
 
void setID (UT_TokenString *token)
 
const UT_TokenStringgetID () const
 
virtual void copy (const PXL_Raster &src)
 
virtual void copyProperties (const PXL_Raster &src)
 
virtual void reset (int full=0)
 
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 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 ()
 
void setPacking (PXL_Packing p)
 
void setFormat (PXL_DataFormat f)
 
void setRes (exint x, exint y)
 
void setBWPoints (float black, float white)
 
void setColorSpace (PXL_ColorSpace space, fpreal custom_gamma=0.0)
 
void setOCIOColorSpace (const UT_StringHolder &space)
 
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
 
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...
 
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 getPixelValue (exint x, exint y, float *vals) const
 
bool isInterleaved () const
 
int areComponentsRenderable () const
 
int64 getNonInterleavedSize () const
 
void clear (void *color=0)
 
void clearNormal (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 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)
 
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 dither (const UT_DimRect &crop)
 
void dither ()
 
bool unpremultiply (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

virtual void attemptRealloc (int64 size)
 
virtual void initialize ()
 
- Protected Member Functions inherited from PXL_Raster
bool allocRaster (int alloc_mem=1)
 
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

- Protected Attributes inherited from PXL_Raster
PXL_DataFormat myFormat
 
PXL_Packing myPacking
 
PXL_ColorSpace myColorSpace
 
fpreal myColorSpaceGamma
 
UT_StringHolder myColorSpaceName
 
exint myRasterOffset
 
exint myXres
 
exint myYres
 
int64 myStride
 
int64 myRasterSize
 
float myBlack
 
float myWhite
 
voidmyRaster
 
bool myAmOwner
 
int myProxyIndex
 
bool myWriteFlag
 
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 
)
virtual TIL_Raster::~TIL_Raster ( )
virtual

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 
)
virtual void TIL_Raster::attemptRealloc ( int64  size)
protectedvirtual

Reimplemented from PXL_Raster.

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

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.

virtual void TIL_Raster::copyProperties ( const PXL_Raster src)
virtual

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.

virtual int64 TIL_Raster::getMemoryUsage ( bool  inclusive) const
virtual

Reimplemented from PXL_Raster.

void* TIL_Raster::getUserData ( )
inline

Definition at line 109 of file TIL_Raster.h.

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

Reimplemented from PXL_Raster.

int TIL_Raster::isIncomplete ( ) const
inline

Definition at line 123 of file TIL_Raster.h.

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

Reimplemented from PXL_Raster.

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 108 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: