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

Simple raster container. More...

#include <BRAY_Raster.h>

Public Member Functions

 BRAY_Raster ()
 
 BRAY_Raster (exint xres, exint yres, PXL_Packing pack, PXL_DataFormat fmt, const void *raster=nullptr)
 
 ~BRAY_Raster ()
 
void setupReference (PXL_Raster &rp, bool for_write) const
 
void freeRaster ()
 Clear storage. More...
 
void resize (exint xres, exint yres, PXL_Packing pack, PXL_DataFormat fmt)
 
void createFrom (const BRAY_Raster &rp)
 
void copyPropertiesFrom (const BRAY_Raster &rp)
 
void copyDataFrom (const BRAY_Raster &rp)
 
void copyDataFrom (const PXL_Raster &rp)
 
void zeroPixels ()
 
void clearToFloat (float val)
 
const voidraster () const
 Read access to the raster. More...
 
template<typename T >
const TrasterAs () const
 Read access to the raster as a given type. More...
 
voidwriteRaster ()
 Write access to the raster. More...
 
template<typename T >
TwriteRasterAs ()
 Write access to the raster as a given type. More...
 
const voidscanline (exint y) const
 Read access to a given scanline. More...
 
const voidpixel (exint x, exint y) const
 Read access to a given pixel. More...
 
template<typename T >
const TpixelAs (exint x, exint y) const
 Read access to a given pixel as a given type. More...
 
voidwritePixel (exint x, exint y) const
 Write access to a given pixel. More...
 
template<typename T >
TwritePixelAs (exint x, exint y) const
 Write access to a given pixel as a given type. More...
 
bool isValid () const
 
bool isWritable () const
 
PXL_Packing packing () const
 
PXL_DataFormat dataFormat () const
 
exint npixels () const
 
exint nchannels () const
 
exint xres () const
 
exint yres () const
 
exint pixelBytes () const
 
exint scanBytes () const
 
exint imageBytes () const
 
void setStorage (PXL_Packing pack, PXL_DataFormat fmt)
 
void dump () const
 
void dump (UT_JSONWriter &w) const
 
bool checkpoint (UT_JSONWriter &w) const
 
bool loadCheckpoint (UT_JSONParser &p)
 
UT_InclusiveRect findDataWindow () const
 Find the window where non-zero data exists. More...
 
int64 getMemoryUsage () const
 

Static Public Member Functions

static int64 memoryUsed ()
 
static int64 peakMemoryUsed ()
 

Detailed Description

Simple raster container.

Definition at line 30 of file BRAY_Raster.h.

Constructor & Destructor Documentation

BRAY_Raster::BRAY_Raster ( )
inline

Construct a raster. It's possible to have a reference to external raster data instead of allocating a raster.

Definition at line 35 of file BRAY_Raster.h.

BRAY_Raster::BRAY_Raster ( exint  xres,
exint  yres,
PXL_Packing  pack,
PXL_DataFormat  fmt,
const void raster = nullptr 
)
inline

Definition at line 40 of file BRAY_Raster.h.

BRAY_Raster::~BRAY_Raster ( )
inline

Definition at line 49 of file BRAY_Raster.h.

Member Function Documentation

bool BRAY_Raster::checkpoint ( UT_JSONWriter w) const
void BRAY_Raster::clearToFloat ( float  val)
inline

Definition at line 109 of file BRAY_Raster.h.

void BRAY_Raster::copyDataFrom ( const BRAY_Raster rp)
inline

Definition at line 91 of file BRAY_Raster.h.

void BRAY_Raster::copyDataFrom ( const PXL_Raster rp)
void BRAY_Raster::copyPropertiesFrom ( const BRAY_Raster rp)
inline

Definition at line 81 of file BRAY_Raster.h.

void BRAY_Raster::createFrom ( const BRAY_Raster rp)
inline

Definition at line 75 of file BRAY_Raster.h.

PXL_DataFormat BRAY_Raster::dataFormat ( ) const
inline

Definition at line 232 of file BRAY_Raster.h.

void BRAY_Raster::dump ( ) const
void BRAY_Raster::dump ( UT_JSONWriter w) const
UT_InclusiveRect BRAY_Raster::findDataWindow ( ) const

Find the window where non-zero data exists.

void BRAY_Raster::freeRaster ( )

Clear storage.

int64 BRAY_Raster::getMemoryUsage ( ) const
inline

Definition at line 256 of file BRAY_Raster.h.

exint BRAY_Raster::imageBytes ( ) const
inline

Definition at line 239 of file BRAY_Raster.h.

bool BRAY_Raster::isValid ( ) const
inline

Definition at line 228 of file BRAY_Raster.h.

bool BRAY_Raster::isWritable ( ) const
inline

Definition at line 229 of file BRAY_Raster.h.

bool BRAY_Raster::loadCheckpoint ( UT_JSONParser p)
static int64 BRAY_Raster::memoryUsed ( )
static
exint BRAY_Raster::nchannels ( ) const
inline

Definition at line 234 of file BRAY_Raster.h.

exint BRAY_Raster::npixels ( ) const
inline

Definition at line 233 of file BRAY_Raster.h.

PXL_Packing BRAY_Raster::packing ( ) const
inline

Definition at line 231 of file BRAY_Raster.h.

static int64 BRAY_Raster::peakMemoryUsed ( )
static
const void* BRAY_Raster::pixel ( exint  x,
exint  y 
) const
inline

Read access to a given pixel.

Definition at line 169 of file BRAY_Raster.h.

template<typename T >
const T* BRAY_Raster::pixelAs ( exint  x,
exint  y 
) const
inline

Read access to a given pixel as a given type.

Definition at line 173 of file BRAY_Raster.h.

exint BRAY_Raster::pixelBytes ( ) const
inline

Definition at line 237 of file BRAY_Raster.h.

const void* BRAY_Raster::raster ( ) const
inline

Read access to the raster.

Definition at line 142 of file BRAY_Raster.h.

template<typename T >
const T* BRAY_Raster::rasterAs ( ) const
inline

Read access to the raster as a given type.

Definition at line 145 of file BRAY_Raster.h.

void BRAY_Raster::resize ( exint  xres,
exint  yres,
PXL_Packing  pack,
PXL_DataFormat  fmt 
)
inline

Definition at line 63 of file BRAY_Raster.h.

exint BRAY_Raster::scanBytes ( ) const
inline

Definition at line 238 of file BRAY_Raster.h.

const void* BRAY_Raster::scanline ( exint  y) const
inline

Read access to a given scanline.

Definition at line 166 of file BRAY_Raster.h.

void BRAY_Raster::setStorage ( PXL_Packing  pack,
PXL_DataFormat  fmt 
)
inline

Definition at line 241 of file BRAY_Raster.h.

void BRAY_Raster::setupReference ( PXL_Raster rp,
bool  for_write 
) const

Set up a PXL_Raster to reference the data in this raster. If you need to write to the PXL_Raster, for_write should be true. This will assert that isWritable() is also true.

void* BRAY_Raster::writePixel ( exint  x,
exint  y 
) const
inline

Write access to a given pixel.

Definition at line 180 of file BRAY_Raster.h.

template<typename T >
T* BRAY_Raster::writePixelAs ( exint  x,
exint  y 
) const
inline

Write access to a given pixel as a given type.

Definition at line 187 of file BRAY_Raster.h.

void* BRAY_Raster::writeRaster ( )
inline

Write access to the raster.

Definition at line 151 of file BRAY_Raster.h.

template<typename T >
T* BRAY_Raster::writeRasterAs ( )
inline

Write access to the raster as a given type.

Definition at line 158 of file BRAY_Raster.h.

exint BRAY_Raster::xres ( ) const
inline

Definition at line 235 of file BRAY_Raster.h.

exint BRAY_Raster::yres ( ) const
inline

Definition at line 236 of file BRAY_Raster.h.

void BRAY_Raster::zeroPixels ( )
inline

Definition at line 101 of file BRAY_Raster.h.


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