DD::Image::BufferIopTile Class Reference

List of all members.

Classes

class  LinePointers

Public Types

typedef const float * RowPtr

Public Member Functions

 BufferIopTile (Iop &input, const Box &box, const ChannelSet &chans, bool forceUnpacked=false, bool mt=false, InterestRatchet *ir=NULL)
 BufferIopTile (Iop &input, int x, int y, int r, int t, const ChannelSet &chans, bool mt=false, InterestRatchet *ir=NULL)
 BufferIopTile (Iop &input, const ChannelSet &chans, bool mt=false, InterestRatchet *ir=NULL)
 ~BufferIopTile ()
int x () const
int y () const
int r () const
int t () const
int w () const
int h () const
int clampy (int y) const
int clampx (int x) const
 operator const Box & () const
const DD::Image::Boxbox () const
const ChannelSetchannels () const
bool valid () const
float at (int x, int y, Channel z) const
const float * address (int x, int y, Channel z) const
LinePointers operator[] (Channel z) const
bool is_zero (Channel z, int y) const

Static Public Member Functions

static const float * NilRow ()

Protected Member Functions

void makeTile (Iop &input, const Box &box, const ChannelSet &chans)

Protected Attributes

BufferIop_bufferIop
Box _box
ChannelSet _channels
bool _valid

Detailed Description

BufferIopTile is a Tile-like API for access to image data, that can use both the traditional row-based Tile API and can access ImagePlane data stored inside a BufferIop.

Accessing the Tile will return data from from inside the ImagePlane, to avoid this data being duplicated inside the row cache. Since BufferIops are utilised to provide top-down execution, it is assumed that the ImagePlane already contains data when the Tile is created. If this is not the case, the returned Tile will not be valid. If there is any doubt about whether the data is available, you should check the valid() state before attempting to access the tile.

Unlike Interest/Tile this isn't a Box. Some Box methods are provided for source-compatibility, but it's probably best to use getBox() to get the box instead.


Member Typedef Documentation

typedef const float* DD::Image::BufferIopTile::RowPtr

pointer to within an individual row


Constructor & Destructor Documentation

DD::Image::BufferIopTile::BufferIopTile ( Iop input,
const Box box,
const ChannelSet chans,
bool  forceUnpacked = false,
bool  mt = false,
InterestRatchet ir = NULL 
)

Construct. All image data will be available after this call, unless the BufferIop did not contain an image plane with valid data. Please check the valid() state after construction and do not use the pixel data if this is set.

These constructors are provided for compatibility with other Tiles. Note that the values of forceUnpacked, mt and InterestRatchet will be ignored for this tile type.

DD::Image::BufferIopTile::~BufferIopTile ( )

destructor


Member Function Documentation

int DD::Image::BufferIopTile::x ( ) const [inline]

accessor for the box's x value (provided for compatibility with DD::Image::RowCacheTile)

int DD::Image::BufferIopTile::y ( ) const [inline]

accessor for the box's y value (provided for compatibility with DD::Image::RowCacheTile)

int DD::Image::BufferIopTile::r ( ) const [inline]

accessor for the box's r value (provided for compatibility with DD::Image::RowCacheTile)

int DD::Image::BufferIopTile::t ( ) const [inline]

accessor for the box's t value (provided for compatibility with DD::Image::RowCacheTile)

int DD::Image::BufferIopTile::w ( ) const [inline]

accessor for the box's width (provided for compatibility with DD::Image::RowCacheTile)

int DD::Image::BufferIopTile::h ( ) const [inline]

accessor for the box's height (provided for compatibility with DD::Image::RowCacheTile)

int DD::Image::BufferIopTile::clampy ( int  y) const [inline]

clamp a y value to within the box (provided for compatibility with DD::Image::RowCacheTile)

int DD::Image::BufferIopTile::clampx ( int  x) const [inline]

clamp a x value to within the box (provided for compatibility with DD::Image::RowCacheTile)

DD::Image::BufferIopTile::operator const Box & ( ) const [inline]

cast operator for the box (provided for compatibility with DD::Image::RowCacheTile)

const DD::Image::Box& DD::Image::BufferIopTile::box ( ) const [inline]

return the box for the tile

Referenced by makeTile().

const ChannelSet& DD::Image::BufferIopTile::channels ( ) const [inline]

get the channels for the tile

bool DD::Image::BufferIopTile::valid ( ) const [inline]

whether the BufferIopTile is accessible, or could not be created (e.g. because the BufferIop's image plane has not been set yet)

float DD::Image::BufferIopTile::at ( int  x,
int  y,
Channel  z 
) const

get the data at a particular pixel. Clamps to the tile bounds.

References _box, _bufferIop, _valid, DD::Image::Box::clampx(), and DD::Image::Box::clampy().

BufferIopTile::LinePointers DD::Image::BufferIopTile::operator[] ( Channel  z) const [inline]

given a channel, return something that acts like an array of pointers to all the loaded lines.

static const float* DD::Image::BufferIopTile::NilRow ( ) [inline, static]

return an empty row pointer

bool DD::Image::BufferIopTile::is_zero ( Channel  z,
int  y 
) const [inline]

is this channel/row pair 'zero' (i.e. is it mapped to no data, rather than checking explicitly whether it is full of zeroes)

this is here for compatibility with RowCacheTile; it returns false always to match the behaviour of GeneralTile for non-row-cache tiles.

void DD::Image::BufferIopTile::makeTile ( Iop input,
const Box box,
const ChannelSet chans 
) [protected]

Member Data Documentation

the BufferIop for this tile

Referenced by at(), and makeTile().

bounding box for the available data in the tile

Referenced by at(), and makeTile().

channels available from this tile

Referenced by makeTile().

whether or not this Tile contains valid data

Referenced by at(), and makeTile().