DD::Image::ToBuffer Class Reference

Takes the output of an image tree and put it into an 8-bit buffer. More...

Inherits DD::Image::NoIop.

List of all members.

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
LUTlut ()
 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

LUTlut_
int stride_
int depth_
Transpose tpose_
void * buffers [64]

Detailed Description

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.


Member Function Documentation

void ToBuffer::to_buffer ( unsigned char *  buffer) [virtual]
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().