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

#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 ()
 
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)
 

Detailed Description

PXL_Raster crazily stores 2 channel rasters as 3 channel rasters. All assumptions about 2 channel rasters are incorrect. So, we have to use our own class here. When we sweep PXL_Raster to have proper semantics, we might be able to switch back.

Definition at line 32 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 37 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 42 of file BRAY_Raster.h.

BRAY_Raster::~BRAY_Raster ( )
inline

Definition at line 51 of file BRAY_Raster.h.

Member Function Documentation

bool BRAY_Raster::checkpoint ( UT_JSONWriter w) const
void BRAY_Raster::copyDataFrom ( const BRAY_Raster rp)
inline

Definition at line 90 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 80 of file BRAY_Raster.h.

void BRAY_Raster::createFrom ( const BRAY_Raster rp)
inline

Definition at line 74 of file BRAY_Raster.h.

PXL_DataFormat BRAY_Raster::dataFormat ( ) const
inline

Definition at line 197 of file BRAY_Raster.h.

void BRAY_Raster::dump ( ) const
void BRAY_Raster::dump ( UT_JSONWriter w) const
void BRAY_Raster::freeRaster ( )

Clear storage.

exint BRAY_Raster::imageBytes ( ) const
inline

Definition at line 204 of file BRAY_Raster.h.

bool BRAY_Raster::isValid ( ) const
inline

Definition at line 193 of file BRAY_Raster.h.

bool BRAY_Raster::isWritable ( ) const
inline

Definition at line 194 of file BRAY_Raster.h.

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

Definition at line 199 of file BRAY_Raster.h.

exint BRAY_Raster::npixels ( ) const
inline

Definition at line 198 of file BRAY_Raster.h.

PXL_Packing BRAY_Raster::packing ( ) const
inline

Definition at line 196 of file BRAY_Raster.h.

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

Read access to a given pixel.

Definition at line 134 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 138 of file BRAY_Raster.h.

exint BRAY_Raster::pixelBytes ( ) const
inline

Definition at line 202 of file BRAY_Raster.h.

const void* BRAY_Raster::raster ( ) const
inline

Read access to the raster.

Definition at line 107 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 110 of file BRAY_Raster.h.

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

Definition at line 62 of file BRAY_Raster.h.

exint BRAY_Raster::scanBytes ( ) const
inline

Definition at line 203 of file BRAY_Raster.h.

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

Read access to a given scanline.

Definition at line 131 of file BRAY_Raster.h.

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

Definition at line 206 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 145 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 152 of file BRAY_Raster.h.

void* BRAY_Raster::writeRaster ( )
inline

Write access to the raster.

Definition at line 116 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 123 of file BRAY_Raster.h.

exint BRAY_Raster::xres ( ) const
inline

Definition at line 200 of file BRAY_Raster.h.

exint BRAY_Raster::yres ( ) const
inline

Definition at line 201 of file BRAY_Raster.h.

void BRAY_Raster::zeroPixels ( )
inline

Definition at line 100 of file BRAY_Raster.h.


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