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 Types

typedef PXL_Visualization Visualization
 

Public Member Functions

 PXL_Raster ()
 
 PXL_Raster (bool dont_alloc)
 
 PXL_Raster (const PXL_Raster &raster)
 
 PXL_Raster (const PXL_Raster &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 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 (bool do_alloc=true)
 
void setRaster (void *r, bool give_ownership=true, bool use_offset=false)
 
voidsteal ()
 
void harden ()
 
void fetchIfNeeded () const
 
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 (bool fetch=true) 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)
 
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)
 
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 ()
 
void setRasterFetcher (UT_SharedPtr< PXL_RasterFetcher > extra)
 
const UT_SharedPtr
< PXL_RasterFetcher > & 
getRasterFetcher () const
 
bool allocRaster (bool alloc_mem=true)
 

Protected Member Functions

virtual void initialize ()
 
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
 
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
 
UT_SharedPtr< PXL_RasterFetchermyRasterFetcher
 

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 62 of file PXL_Raster.h.

Member Typedef Documentation

Definition at line 80 of file PXL_Raster.h.

Constructor & Destructor Documentation

PXL_Raster::PXL_Raster ( )
PXL_Raster::PXL_Raster ( bool  dont_alloc)
PXL_Raster::PXL_Raster ( const PXL_Raster raster)
PXL_Raster::PXL_Raster ( const PXL_Raster 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 ( bool  alloc_mem = true)
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::fetchIfNeeded ( ) const
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 159 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 163 of file PXL_Raster.h.

const UT_StringHolder& PXL_Raster::getColorSpaceName ( ) const
inline

OCIO colorspace name, valid for PXL_CS_OCIO.

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

bool PXL_Raster::getDataWritten ( ) const
inline

Definition at line 274 of file PXL_Raster.h.

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

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

exint PXL_Raster::getNumPixels ( ) const
inline

Definition at line 140 of file PXL_Raster.h.

const UT_StringHolder& PXL_Raster::getOCIODisplay ( ) const
inline

Definition at line 166 of file PXL_Raster.h.

const UT_StringHolder& PXL_Raster::getOCIOView ( ) const
inline

Definition at line 167 of file PXL_Raster.h.

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

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

const void* PXL_Raster::getPixels ( ) const
inline

Definition at line 188 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 270 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 UT_SharedPtr<PXL_RasterFetcher>& PXL_Raster::getRasterFetcher ( ) const
inline

Definition at line 304 of file PXL_Raster.h.

const void* PXL_Raster::getRawPixels ( bool  fetch = true) const
inline

Definition at line 191 of file PXL_Raster.h.

int PXL_Raster::getRotation ( ) const
inline

Definition at line 151 of file PXL_Raster.h.

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

Definition at line 142 of file PXL_Raster.h.

int64 PXL_Raster::getStride ( ) const
inline

Definition at line 141 of file PXL_Raster.h.

void* PXL_Raster::getTextureID ( ) const
Visualization PXL_Raster::getVisualization ( ) const
inline

Definition at line 103 of file PXL_Raster.h.

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

Definition at line 138 of file PXL_Raster.h.

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

Definition at line 139 of file PXL_Raster.h.

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

Definition at line 173 of file PXL_Raster.h.

void PXL_Raster::init ( bool  do_alloc = true)
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 152 of file PXL_Raster.h.

int PXL_Raster::isValid ( ) const
inline

Definition at line 134 of file PXL_Raster.h.

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

Definition at line 281 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 ( const PXL_Raster other = nullptr)
void PXL_Raster::promoteRGBToRGBA ( fpreal  alpha = 1.0)
bool PXL_Raster::promoteRGBToRGBA ( UT_UniquePtr< PXL_Raster > &  dest,
fpreal  alpha = 1.0 
) const
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 272 of file PXL_Raster.h.

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

Definition at line 279 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::setPixelValueI ( exint  x,
exint  y,
exint  val 
)
void PXL_Raster::setRaster ( void r,
bool  give_ownership = true,
bool  use_offset = false 
)
void PXL_Raster::setRasterFetcher ( UT_SharedPtr< PXL_RasterFetcher extra)
inline

Definition at line 301 of file PXL_Raster.h.

void PXL_Raster::setRes ( exint  x,
exint  y 
)
void PXL_Raster::setRotation ( int  rotation)
void PXL_Raster::setTextureID ( void id)
inline

Definition at line 276 of file PXL_Raster.h.

void PXL_Raster::setVisualization ( Visualization  vis)
inline

Visualization of the raster, which does not affect the raster but is hint for how to display it.

Definition at line 102 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 ( const 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 337 of file PXL_Raster.h.

float PXL_Raster::myBlack
protected

Definition at line 334 of file PXL_Raster.h.

void* PXL_Raster::myCallerData
protected

Definition at line 343 of file PXL_Raster.h.

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

Definition at line 342 of file PXL_Raster.h.

PXL_ColorSpace PXL_Raster::myColorSpace
protected

Definition at line 324 of file PXL_Raster.h.

fpreal PXL_Raster::myColorSpaceGamma
protected

Definition at line 325 of file PXL_Raster.h.

UT_StringHolder PXL_Raster::myColorSpaceName
protected

Definition at line 327 of file PXL_Raster.h.

UT_DimRect PXL_Raster::myDataWindow
protected

Definition at line 345 of file PXL_Raster.h.

PXL_DataFormat PXL_Raster::myFormat
protected

Definition at line 322 of file PXL_Raster.h.

bool PXL_Raster::myManagesOwnTextureID
protected

Definition at line 340 of file PXL_Raster.h.

UT_StringHolder PXL_Raster::myOCIODisplay
protected

Definition at line 328 of file PXL_Raster.h.

UT_StringHolder PXL_Raster::myOCIOView
protected

Definition at line 329 of file PXL_Raster.h.

PXL_Packing PXL_Raster::myPacking
protected

Definition at line 323 of file PXL_Raster.h.

int PXL_Raster::myProxyIndex
protected

Definition at line 338 of file PXL_Raster.h.

void* PXL_Raster::myRaster
protected

Definition at line 336 of file PXL_Raster.h.

UT_SharedPtr<PXL_RasterFetcher> PXL_Raster::myRasterFetcher
protected

Definition at line 347 of file PXL_Raster.h.

exint PXL_Raster::myRasterOffset
protected

Definition at line 330 of file PXL_Raster.h.

int64 PXL_Raster::myRasterSize
protected

Definition at line 333 of file PXL_Raster.h.

int PXL_Raster::myRotation
protected

Definition at line 335 of file PXL_Raster.h.

int64 PXL_Raster::myStride
protected

Definition at line 332 of file PXL_Raster.h.

void* PXL_Raster::myTextureID
protected

Definition at line 341 of file PXL_Raster.h.

Visualization PXL_Raster::myVis
protected

Definition at line 326 of file PXL_Raster.h.

float PXL_Raster::myWhite
protected

Definition at line 334 of file PXL_Raster.h.

bool PXL_Raster::myWriteFlag
protected

Definition at line 339 of file PXL_Raster.h.

exint PXL_Raster::myXres
protected

Definition at line 331 of file PXL_Raster.h.

exint PXL_Raster::myYres
protected

Definition at line 331 of file PXL_Raster.h.


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