OpenImageIO
|
#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. | |
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.
|
inline |
Default constructor is an undefined region.
|
inline |
Constructor with an explicitly defined region.
|
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?
|
inline |
Is a region defined?
|
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()).
|
inline |
Total number of pixels in the region.
|
friend |
Stream output of the range.