Nuke binary plugins 15.0.5
 
Loading...
Searching...
No Matches
DD::Image::BufferIopTile Class Reference

#include <BufferIopTile.h>

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=nullptr)
 
 BufferIopTile (Iop &input, int x, int y, int r, int t, const ChannelSet &chans, bool mt=false, InterestRatchet *ir=nullptr)
 
 BufferIopTile (Iop &input, const ChannelSet &chans, bool mt=false, InterestRatchet *ir=nullptr)
 
 ~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
 
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

◆ RowPtr

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

pointer to within an individual row

Constructor & Destructor Documentation

◆ BufferIopTile()

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

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.

References box(), and makeTile().

◆ ~BufferIopTile()

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

destructor

Member Function Documentation

◆ x()

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

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

Referenced by at().

◆ y()

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

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

Referenced by at(), and DD::Image::BufferIopTile::LinePointers::operator[]().

◆ r()

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

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

◆ t()

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

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

◆ w()

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

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

◆ h()

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

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

◆ clampy()

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

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

◆ clampx()

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

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

◆ operator const Box &()

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

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

◆ box()

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

return the box for the tile

Referenced by BufferIopTile(), and makeTile().

◆ channels()

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

get the channels for the tile

Referenced by makeTile().

◆ valid()

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)

◆ at()

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(), DD::Image::Box::clampy(), DD::Image::BufferIop::getReadableAddress(), x(), and y().

◆ operator[]()

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.

◆ NilRow()

static const float * DD::Image::BufferIopTile::NilRow ( )
inlinestatic

return an empty row pointer

◆ is_zero()

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.

◆ makeTile()

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

Member Data Documentation

◆ _bufferIop

BufferIop* DD::Image::BufferIopTile::_bufferIop
protected

◆ _box

Box DD::Image::BufferIopTile::_box
protected

bounding box for the available data in the tile

Referenced by at(), and makeTile().

◆ _channels

ChannelSet DD::Image::BufferIopTile::_channels
protected

channels available from this tile

Referenced by makeTile().

◆ _valid

bool DD::Image::BufferIopTile::_valid
protected

whether or not this Tile contains valid data

Referenced by at(), and makeTile().



©2024 The Foundry Visionmongers, Ltd. All Rights Reserved.
www.foundry.com