OpenImageIO
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | Public Attributes | Friends | List of all members
ROI Struct Reference

#include <imagebuf.h>

Public Member Functions

 ROI ()
 
 ROI (int xbegin, int xend, int ybegin, int yend, int zbegin=0, int zend=1, int chbegin=0, int chend=10000)
 
bool defined () const
 Is a region defined?
 
int width () const
 
int height () const
 
int depth () const
 
int nchannels () const
 
imagesize_t npixels () const
 Total number of pixels in the region.
 

Static Public Member Functions

static ROI All ()
 

Public Attributes

int xbegin
 
int xend
 
int ybegin
 
int yend
 
int zbegin
 
int zend
 
int chbegin
 
int chend
 

Friends

bool operator== (const ROI &a, const ROI &b)
 Test equality of two ROIs.
 
bool operator!= (const ROI &a, const ROI &b)
 Test inequality of two ROIs.
 
std::ostream & operator<< (std::ostream &out, const ROI &roi)
 Stream output of the range.
 

Detailed Description

Helper struct describing a region of interest in an image. The region is [xbegin,xend) x [begin,yend) x [zbegin,zend), with the "end" designators signifying one past the last pixel, a la STL style.

Constructor & Destructor Documentation

ROI::ROI ( )
inline

Default constructor is an undefined region.

ROI::ROI ( int  xbegin,
int  xend,
int  ybegin,
int  yend,
int  zbegin = 0,
int  zend = 1,
int  chbegin = 0,
int  chend = 10000 
)
inline

Constructor with an explicitly defined region.

Member Function Documentation

static ROI ROI::All ( )
inlinestatic

Documentary sugar – although the static ROI::All() function simply returns the results of the default ROI constructor, it makes it very clear when using as a default function argument that it means "all" of the image. For example, float myfunc (ImageBuf &buf, ROI roi = ROI::All()); Doesn't that make it abundantly clear?

bool ROI::defined ( ) const
inline

Is a region defined?

int ROI::nchannels ( ) const
inline

Number of channels in the region. Beware – this defaults to a huge number, and to be meaningful you must consider std::min (imagebuf.nchannels(), roi.nchannels()).

imagesize_t ROI::npixels ( ) const
inline

Total number of pixels in the region.

Friends And Related Function Documentation

bool operator!= ( const ROI a,
const ROI b 
)
friend

Test inequality of two ROIs.

std::ostream& operator<< ( std::ostream &  out,
const ROI roi 
)
friend

Stream output of the range.

bool operator== ( const ROI a,
const ROI b 
)
friend

Test equality of two ROIs.


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