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

#include <PXL_Raster.h>

+ Inheritance diagram for PXL_Raster:

Public Member Functions

 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 ()
 
virtual int64 getMemoryUsage (bool inclusive) const
 
virtual void copy (const PXL_Raster &src)
 
virtual void copyProperties (const PXL_Raster &src)
 
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)
 
virtual void reset (int full=0)
 
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 ()
 

Protected Member Functions

virtual void initialize ()
 
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)
 
virtual void attemptRealloc (int64 size)
 

Protected Attributes

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
 

Additional Inherited Members

- 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 *)
 

Detailed Description

Definition at line 35 of file PXL_Raster.h.

Constructor & Destructor Documentation

PXL_Raster::PXL_Raster ( )
PXL_Raster::PXL_Raster ( const PXL_Raster )
PXL_Raster::PXL_Raster ( const PXL_Raster ,
exint  x1,
exint  y1,
exint  x2,
exint  y2 
)
PXL_Raster::PXL_Raster ( PXL_Packing  p,
PXL_DataFormat  f,
exint  xres = 0,
exint  yres = 0,
int  clear = 0,
int  alloc = 1 
)
virtual PXL_Raster::~PXL_Raster ( )
virtual

Member Function Documentation

void PXL_Raster::addInterest ( void callerData,
void(*)(PXL_Raster *, void *)  changeCB 
)
void PXL_Raster::adjustSaturation ( float  sat)
bool PXL_Raster::allocRaster ( int  alloc_mem = 1)
protected
void PXL_Raster::applyLUT ( const PXL_Raster src,
float *  lptr[4],
exint  comp,
float  lstart,
float  lend 
)
void PXL_Raster::applyLUT16 ( const PXL_Raster src,
float *  lptr[4],
exint  comp,
float  lscale,
float  lshift,
exint  size 
)
protected
void PXL_Raster::applyLUT8 ( const PXL_Raster src,
float *  lptr[4],
exint  comp,
float  lscale,
float  lshift,
exint  size 
)
protected
int PXL_Raster::areComponentsRenderable ( ) const
virtual void PXL_Raster::attemptRealloc ( int64  size)
protectedvirtual

Reimplemented in TIL_Raster.

bool PXL_Raster::clampAlpha ( )
void PXL_Raster::clear ( void color = 0)
void PXL_Raster::clearNormal ( float *  color,
unsigned  ib = 0,
unsigned  iw = 0 
)
void PXL_Raster::clearTextureID ( )
void PXL_Raster::convert8Bit ( unsigned  b,
unsigned  w 
)
virtual void PXL_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 in TIL_Raster.

virtual void PXL_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 in TIL_Raster.

void PXL_Raster::dither ( const UT_DimRect crop)
void PXL_Raster::dither ( )
void PXL_Raster::extract ( const PXL_Raster from,
exint  x1,
exint  y1,
exint  x2,
exint  y2 
)
void PXL_Raster::getBWPoints ( float &  black,
float &  white 
) const
PXL_ColorSpace PXL_Raster::getColorSpace ( ) const
inline

Colorspace this raster requires for correct display.

Definition at line 98 of file PXL_Raster.h.

fpreal PXL_Raster::getColorSpaceGamma ( ) const
inline

Gamma that must be applied to this raster to get accurate color. Only valid for PXL_CS_LINEAR, PXL_CS_GAMMA2_2, and PXL_CS_CUSTOM_GAMMA.

Definition at line 102 of file PXL_Raster.h.

const UT_StringHolder& PXL_Raster::getColorSpaceName ( ) const
inline

OCIO colorspace name, valid for PXL_CS_OCIO.

Definition at line 104 of file PXL_Raster.h.

const UT_DimRect& PXL_Raster::getDataWindow ( ) const
inline

Definition at line 108 of file PXL_Raster.h.

bool PXL_Raster::getDataWritten ( ) const
inline

Definition at line 203 of file PXL_Raster.h.

PXL_DataFormat PXL_Raster::getFormat ( ) const
inline

Definition at line 93 of file PXL_Raster.h.

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

Reimplemented in TIL_Raster.

int64 PXL_Raster::getNonInterleavedSize ( ) const
exint PXL_Raster::getNumPixels ( ) const
inline

Definition at line 90 of file PXL_Raster.h.

PXL_Packing PXL_Raster::getPacking ( ) const
inline

Definition at line 94 of file PXL_Raster.h.

void* PXL_Raster::getPixel ( exint  x,
exint  y,
exint  comp = 0 
)
const void* PXL_Raster::getPixel ( exint  x,
exint  y,
exint  comp = 0 
) const
void* PXL_Raster::getPixels ( )
inline
Examples:
SOP/SOP_CopRaster.C.

Definition at line 123 of file PXL_Raster.h.

const void* PXL_Raster::getPixels ( ) const
inline

Definition at line 126 of file PXL_Raster.h.

void PXL_Raster::getPixelValue ( exint  x,
exint  y,
float *  vals 
) const
int PXL_Raster::getProxyIndex ( ) const
inline

Definition at line 199 of file PXL_Raster.h.

void PXL_Raster::getRange ( float &  min,
float &  max,
float  black = 0.0f,
float  white = 1.0f,
exint  comp = -1,
bool  ignore_farthest = false 
) const
const void* PXL_Raster::getRawPixels ( ) const
inline

Definition at line 130 of file PXL_Raster.h.

int64 PXL_Raster::getSize ( ) const
inline
Examples:
SOP/SOP_CopRaster.C.

Definition at line 92 of file PXL_Raster.h.

int64 PXL_Raster::getStride ( ) const
inline

Definition at line 91 of file PXL_Raster.h.

void* PXL_Raster::getTextureID ( ) const
exint PXL_Raster::getXres ( ) const
inline
Examples:
SOP/SOP_CopRaster.C.

Definition at line 88 of file PXL_Raster.h.

exint PXL_Raster::getYres ( ) const
inline
Examples:
SOP/SOP_CopRaster.C.

Definition at line 89 of file PXL_Raster.h.

bool PXL_Raster::hasAlpha ( ) const
bool PXL_Raster::hasDataWindow ( ) const
inline

Definition at line 110 of file PXL_Raster.h.

void PXL_Raster::init ( )
virtual void PXL_Raster::initialize ( )
protectedvirtual

Reimplemented in TIL_Raster.

void PXL_Raster::insert ( const PXL_Raster from,
exint  x,
exint  y 
)
bool PXL_Raster::isInterleaved ( ) const
int PXL_Raster::isValid ( void  ) const
inline

Definition at line 86 of file PXL_Raster.h.

bool PXL_Raster::load ( UT_IStream is)
void PXL_Raster::readFromRow ( exint  y,
void data 
) const
void PXL_Raster::removeInterest ( )
virtual void PXL_Raster::reset ( int  full = 0)
virtual

Reimplemented in TIL_Raster.

int PXL_Raster::save ( std::ostream &  os,
int  binary = 1 
) const
void PXL_Raster::setBWPoints ( float  black,
float  white 
)
void PXL_Raster::setColorSpace ( PXL_ColorSpace  space,
fpreal  custom_gamma = 0.0 
)

Colorspace that this raster is in. Changing the color space does not affect the image values stored in this raster, only how they are interpreted. custom_gamma must be specified for PXL_CS_CUSTOM_GAMMA.

void PXL_Raster::setDataWindow ( const UT_DimRect new_rect)
void PXL_Raster::setDataWritten ( bool  written = true)
inline

Definition at line 201 of file PXL_Raster.h.

void PXL_Raster::setFormat ( PXL_DataFormat  f)
void PXL_Raster::setOCIOColorSpace ( const UT_StringHolder space)
void PXL_Raster::setPacking ( PXL_Packing  p)
void PXL_Raster::setPixelValue ( exint  x,
exint  y,
const float *  vals 
)
void PXL_Raster::setRaster ( void r,
bool  give_ownership = true,
bool  use_offset = false 
)
void PXL_Raster::setRes ( exint  x,
exint  y 
)
void PXL_Raster::setTextureID ( void id)
inline

Definition at line 205 of file PXL_Raster.h.

void* PXL_Raster::steal ( )
void PXL_Raster::streakEdges ( exint  x1,
exint  y1,
exint  x2,
exint  y2,
PXL_StreakComponents  streak_comps = PXL_STREAK_ALL 
)
bool PXL_Raster::unpremultiply ( PXL_Raster other = nullptr)
void PXL_Raster::writeToColumn ( exint  x,
const void data 
)
void PXL_Raster::writeToRow ( exint  y,
const void data 
)

Member Data Documentation

bool PXL_Raster::myAmOwner
protected

Definition at line 249 of file PXL_Raster.h.

float PXL_Raster::myBlack
protected

Definition at line 247 of file PXL_Raster.h.

void* PXL_Raster::myCallerData
protected

Definition at line 254 of file PXL_Raster.h.

void(* PXL_Raster::myChangeCB)(PXL_Raster *, void *)
protected

Definition at line 253 of file PXL_Raster.h.

PXL_ColorSpace PXL_Raster::myColorSpace
protected

Definition at line 240 of file PXL_Raster.h.

fpreal PXL_Raster::myColorSpaceGamma
protected

Definition at line 241 of file PXL_Raster.h.

UT_StringHolder PXL_Raster::myColorSpaceName
protected

Definition at line 242 of file PXL_Raster.h.

UT_DimRect PXL_Raster::myDataWindow
protected

Definition at line 256 of file PXL_Raster.h.

PXL_DataFormat PXL_Raster::myFormat
protected

Definition at line 238 of file PXL_Raster.h.

PXL_Packing PXL_Raster::myPacking
protected

Definition at line 239 of file PXL_Raster.h.

int PXL_Raster::myProxyIndex
protected

Definition at line 250 of file PXL_Raster.h.

void* PXL_Raster::myRaster
protected

Definition at line 248 of file PXL_Raster.h.

exint PXL_Raster::myRasterOffset
protected

Definition at line 243 of file PXL_Raster.h.

int64 PXL_Raster::myRasterSize
protected

Definition at line 246 of file PXL_Raster.h.

int64 PXL_Raster::myStride
protected

Definition at line 245 of file PXL_Raster.h.

void* PXL_Raster::myTextureID
protected

Definition at line 252 of file PXL_Raster.h.

float PXL_Raster::myWhite
protected

Definition at line 247 of file PXL_Raster.h.

bool PXL_Raster::myWriteFlag
protected

Definition at line 251 of file PXL_Raster.h.

exint PXL_Raster::myXres
protected

Definition at line 244 of file PXL_Raster.h.

exint PXL_Raster::myYres
protected

Definition at line 244 of file PXL_Raster.h.


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