HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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
 
PXL_Rasteroperator= (const PXL_Raster &)=delete
 Assignment disallowed, use copy() instead. More...
 
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 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 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)
 
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 promoteRGBToRGBA (fpreal alpha=1.0)
 
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 (PXL_Raster *other=nullptr)
 
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 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)
 
virtual void attemptRealloc (int64 size)
 

Protected Attributes

PXL_DataFormat myFormat
 
PXL_Packing myPacking
 
PXL_ColorSpace myColorSpace
 
fpreal myColorSpaceGamma
 
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
 

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

Examples:
IMG/TIL_NullFilter.C, and IMG/TIL_NullFilter.h.

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 ( const void color = 0)
void PXL_Raster::clearNormal ( const 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::flipVertical ( )
void PXL_Raster::freeRaster ( )
protected
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 118 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 122 of file PXL_Raster.h.

const UT_StringHolder& PXL_Raster::getColorSpaceName ( ) const
inline

OCIO colorspace name, valid for PXL_CS_OCIO.

Definition at line 124 of file PXL_Raster.h.

exint PXL_Raster::getCorrectedXres ( ) const
exint PXL_Raster::getCorrectedYres ( ) const
const UT_DimRect& PXL_Raster::getDataWindow ( ) const
inline

Definition at line 130 of file PXL_Raster.h.

bool PXL_Raster::getDataWritten ( ) const
inline

Definition at line 231 of file PXL_Raster.h.

PXL_DataFormat PXL_Raster::getFormat ( ) const
inline
Examples:
IMG/TIL_NullFilter.C.

Definition at line 102 of file PXL_Raster.h.

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

Reimplemented in TIL_Raster.

int64 PXL_Raster::getNonInterleavedSize ( ) const
int PXL_Raster::getNumChannels ( ) const
inline

Definition at line 105 of file PXL_Raster.h.

exint PXL_Raster::getNumPixels ( ) const
inline

Definition at line 99 of file PXL_Raster.h.

const UT_StringHolder& PXL_Raster::getOCIODisplay ( ) const
inline

Definition at line 125 of file PXL_Raster.h.

const UT_StringHolder& PXL_Raster::getOCIOView ( ) const
inline

Definition at line 126 of file PXL_Raster.h.

PXL_Packing PXL_Raster::getPacking ( ) const
inline
Examples:
IMG/TIL_NullFilter.C.

Definition at line 103 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_Cop2Raster.C.

Definition at line 145 of file PXL_Raster.h.

const void* PXL_Raster::getPixels ( ) const
inline

Definition at line 148 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 227 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 152 of file PXL_Raster.h.

int PXL_Raster::getRotation ( ) const
inline

Definition at line 110 of file PXL_Raster.h.

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

Definition at line 101 of file PXL_Raster.h.

int64 PXL_Raster::getStride ( ) const
inline

Definition at line 100 of file PXL_Raster.h.

void* PXL_Raster::getTextureID ( ) const
exint PXL_Raster::getXres ( ) const
inline
Examples:
IMG/TIL_NullFilter.C, and SOP/SOP_Cop2Raster.C.

Definition at line 97 of file PXL_Raster.h.

exint PXL_Raster::getYres ( ) const
inline
Examples:
IMG/TIL_NullFilter.C, and SOP/SOP_Cop2Raster.C.

Definition at line 98 of file PXL_Raster.h.

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

Definition at line 132 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
bool PXL_Raster::isRotated ( ) const
inline

Definition at line 111 of file PXL_Raster.h.

int PXL_Raster::isValid ( ) const
inline

Definition at line 95 of file PXL_Raster.h.

bool PXL_Raster::load ( UT_IStream is)
bool PXL_Raster::managesOwnTextureID ( ) const
inline

Definition at line 238 of file PXL_Raster.h.

PXL_Raster& PXL_Raster::operator= ( const PXL_Raster )
delete

Assignment disallowed, use copy() instead.

See Also
copyProperties()
bool PXL_Raster::premultiply ( PXL_Raster other = nullptr)
void PXL_Raster::promoteRGBToRGBA ( fpreal  alpha = 1.0)
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 229 of file PXL_Raster.h.

void PXL_Raster::setFormat ( PXL_DataFormat  f)
void PXL_Raster::setManagesOwnTextureID ( bool  manages_own)
inline

Definition at line 236 of file PXL_Raster.h.

void PXL_Raster::setOCIOColorSpace ( const UT_StringHolder space)
void PXL_Raster::setOCIODisplayView ( const UT_StringHolder baked_display,
const UT_StringHolder baked_view 
)
void PXL_Raster::setOCIOParms ( const UT_StringHolder color_space,
const UT_StringHolder baked_display,
const UT_StringHolder baked_view 
)
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::setRotation ( int  rotation)
void PXL_Raster::setTextureID ( void id)
inline

Definition at line 233 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 286 of file PXL_Raster.h.

float PXL_Raster::myBlack
protected

Definition at line 283 of file PXL_Raster.h.

void* PXL_Raster::myCallerData
protected

Definition at line 292 of file PXL_Raster.h.

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

Definition at line 291 of file PXL_Raster.h.

PXL_ColorSpace PXL_Raster::myColorSpace
protected

Definition at line 274 of file PXL_Raster.h.

fpreal PXL_Raster::myColorSpaceGamma
protected

Definition at line 275 of file PXL_Raster.h.

UT_StringHolder PXL_Raster::myColorSpaceName
protected

Definition at line 276 of file PXL_Raster.h.

UT_DimRect PXL_Raster::myDataWindow
protected

Definition at line 294 of file PXL_Raster.h.

PXL_DataFormat PXL_Raster::myFormat
protected

Definition at line 272 of file PXL_Raster.h.

bool PXL_Raster::myManagesOwnTextureID
protected

Definition at line 289 of file PXL_Raster.h.

UT_StringHolder PXL_Raster::myOCIODisplay
protected

Definition at line 277 of file PXL_Raster.h.

UT_StringHolder PXL_Raster::myOCIOView
protected

Definition at line 278 of file PXL_Raster.h.

PXL_Packing PXL_Raster::myPacking
protected

Definition at line 273 of file PXL_Raster.h.

int PXL_Raster::myProxyIndex
protected

Definition at line 287 of file PXL_Raster.h.

void* PXL_Raster::myRaster
protected

Definition at line 285 of file PXL_Raster.h.

exint PXL_Raster::myRasterOffset
protected

Definition at line 279 of file PXL_Raster.h.

int64 PXL_Raster::myRasterSize
protected

Definition at line 282 of file PXL_Raster.h.

int PXL_Raster::myRotation
protected

Definition at line 284 of file PXL_Raster.h.

int64 PXL_Raster::myStride
protected

Definition at line 281 of file PXL_Raster.h.

void* PXL_Raster::myTextureID
protected

Definition at line 290 of file PXL_Raster.h.

float PXL_Raster::myWhite
protected

Definition at line 283 of file PXL_Raster.h.

bool PXL_Raster::myWriteFlag
protected

Definition at line 288 of file PXL_Raster.h.

exint PXL_Raster::myXres
protected

Definition at line 280 of file PXL_Raster.h.

exint PXL_Raster::myYres
protected

Definition at line 280 of file PXL_Raster.h.


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