Takes the output of an image tree and put it into an 8-bit buffer. More...
Inherits DD::Image::NoIop.
Public Types | |
enum | Transpose { NONE, YFLIP, XFLIP, R180, TRANSPOSE, R270, R90, TRANSPOSE1 } |
Public Member Functions | |
ToBuffer (Node *node=0) | |
const char * | Class () const |
const char * | node_help () const |
LUT * | lut () |
The transfer function for output conversion. | |
int | stride () |
The number of pixels to next row. | |
int | depth () |
Image depth, ie number of channels. | |
Transpose | transpose () |
Display orientation. | |
void | lut (LUT *l) |
The transfer function for output conversion. | |
void | transpose (Transpose tpose) |
The number of pixels to next row. | |
void | stride (const int v) |
Image depth, ie number of channels. | |
void | depth (const int v) |
Display orientation. | |
virtual void | to_buffer (unsigned char *buffer) |
The master to_buffer() function. | |
virtual void | to_buffer (U16 *buffer) |
virtual void | to_buffer (unsigned char *buffer, int x, int y, int w, int h, ChannelMask channels, int delta=1, int stride=0) |
virtual void | to_buffer (U16 *buffer, int x, int y, int w, int h, ChannelMask channels, int delta=1, int stride=0) |
virtual void | to_buffer (unsigned char *buffer, int x, int y, int w, int h, int depth, int stride=0) |
virtual void | to_buffer (U16 *buffer, int x, int y, int w, int h, int depth, int stride=0) |
virtual void | to_buffer (unsigned char *buffer, int w, int h, int depth, Transpose=NONE, int stride=0) |
virtual void | to_buffer (U16 *buffer, int w, int h, int depth, Transpose=NONE, int stride=0) |
Protected Attributes | |
LUT * | lut_ |
int | stride_ |
int | depth_ |
Transpose | tpose_ |
void * | buffers [64] |
Takes the output of an image tree and put it into an 8-bit buffer.
Hides all the uglyness of calling DDImage and of multithreading.
Potential RLE compressed output types should derive from this class.
void ToBuffer::to_buffer | ( | unsigned char * | buffer | ) | [virtual] |
The master to_buffer() function.
The master to buffer function. The others simply set the necessary output attributes, and call this method. This fills the provided buffer with data from the region specified to this class.
References DD::Image::Op::all_forget_request(), DD::Image::IopInfoOwner::channels(), DD::Image::LUT::GetDefaultLutForType(), DD::Image::Box::h(), DD::Image::IopInfoOwner::h(), DD::Image::IopInfoOwner::info_, DD::Image::Iop::input(), DD::Image::Thread::numThreads, DD::Image::IopInfoOwner::r(), DD::Image::Iop::request(), DD::Image::Thread::spawn(), DD::Image::IopInfoOwner::t(), DD::Image::Box::w(), DD::Image::IopInfoOwner::w(), DD::Image::Thread::wait(), DD::Image::IopInfoOwner::x(), DD::Image::IopInfoOwner::y(), and DD::Image::IopInfoOwner::ydirection().
Referenced by to_buffer().
void ToBuffer::to_buffer | ( | U16 * | buffer | ) | [virtual] |
Version producing 16-bit colors
References DD::Image::Op::all_forget_request(), DD::Image::IopInfoOwner::channels(), DD::Image::LUT::GetDefaultLutForType(), DD::Image::Box::h(), DD::Image::IopInfoOwner::h(), DD::Image::IopInfoOwner::info_, DD::Image::Iop::input(), DD::Image::Thread::numThreads, DD::Image::IopInfoOwner::r(), DD::Image::Iop::request(), DD::Image::Thread::spawn(), DD::Image::IopInfoOwner::t(), DD::Image::Box::w(), DD::Image::IopInfoOwner::w(), DD::Image::Thread::wait(), DD::Image::IopInfoOwner::x(), DD::Image::IopInfoOwner::y(), and DD::Image::IopInfoOwner::ydirection().
void ToBuffer::to_buffer | ( | unsigned char * | buffer, |
int | x, | ||
int | y, | ||
int | w, | ||
int | h, | ||
ChannelMask | channels, | ||
int | delta = 1 , |
||
int | stride = 0 |
||
) | [virtual] |
Read the output and put it into a set of buffers. By cleverly setting the buffer pointers and the delta and stride you should be able to produce any interlace pattern, mirror the image, or file rotate by right angles.
References DD::Image::Box::h(), DD::Image::IopInfoOwner::info_, stride(), to_buffer(), DD::Image::Box::w(), DD::Image::Box::x(), and DD::Image::Box::y().
void ToBuffer::to_buffer | ( | unsigned char * | buffer, |
int | x, | ||
int | y, | ||
int | w, | ||
int | h, | ||
int | depth, | ||
int | stride = 0 |
||
) | [virtual] |
Put the first depth channels of the image into an interlaced buffer in OpenGL format. Pass a negative depth to flip the byte order to BGR or BGRA.
References depth(), DD::Image::Box::h(), DD::Image::IopInfoOwner::info_, stride(), to_buffer(), DD::Image::Box::w(), DD::Image::Box::x(), and DD::Image::Box::y().
void ToBuffer::to_buffer | ( | unsigned char * | buffer, |
int | w, | ||
int | h, | ||
int | depth, | ||
Transpose | transpose = NONE , |
||
int | stride = 0 |
||
) | [virtual] |
Put the region 0, 0, w, h into buffer with simple rotations and reflections. Legal values for transpose are NONE=0, YFLIP=1, XFLIP=2, R180=3, TRANSPOSE=4 (0,0 position corner stays the same), R270=5, R90=6, TRANSPOSE1=7 (upper-right corner ends up at 0,0). Pass a negative delta to flip the byte order to BGR.
References depth(), DD::Image::Box::h(), DD::Image::IopInfoOwner::info_, stride(), to_buffer(), transpose(), DD::Image::Box::w(), DD::Image::Box::x(), and DD::Image::Box::y().