eq::Image Class Reference

#include <image.h>

Collaboration diagram for eq::Image:

Collaboration graph
[legend]

List of all members.


Detailed Description

A holder for pixel data.

An image holds color and depth information for a rectangular region.

Definition at line 21 of file image.h.


Operations

void startReadback (const uint32_t buffers, const PixelViewport &pvp, Window::ObjectManager *glObjects)
 Start reading back an image from the frame buffer.
void syncReadback ()
 Make sure that the last readback operation is complete.
void writeImage (const std::string &filename, const Frame::Buffer buffer) const
 Writes the pixel data as rgb image files.
void writeImages (const std::string &filenameTemplate) const
 Writes all pixel data as separate images.
bool readImage (const std::string &filename, const Frame::Buffer buffer)
 Read pixel data from an uncompressed rgb image file.
std::ostream & operator<< (std::ostream &os, const Image *)

Public Member Functions

 Image ()
 Constructs a new Image.
Data Access
const eq::ViewportgetViewport () const
GLEWContext * glewGetContext ()
void reset ()
 Reset the image to its default state.
void setFormat (const Frame::Buffer buffer, const uint32_t format)
 Set the (OpenGL) format of the pixel data for a buffer.
void setType (const Frame::Buffer buffer, const uint32_t type)
 Set the (OpenGL) type of the pixel data for a buffer.
uint32_t getFormat (const Frame::Buffer buffer) const
uint32_t getType (const Frame::Buffer buffer) const
uint32_t getDepth (const Frame::Buffer buffer) const
bool hasAlpha () const
const uint8_t * getPixelPointer (const Frame::Buffer buffer) const
uint8_t * getPixelPointer (const Frame::Buffer buffer)
uint32_t getPixelDataSize (const Frame::Buffer buffer) const
const PixelData & getPixelData (const Frame::Buffer buffer) const
const PixelData & compressPixelData (const Frame::Buffer buffer)
bool hasPixelData (const Frame::Buffer buffer) const
const PixelViewportgetPixelViewport () const
void setPixelViewport (const PixelViewport &pvp)
 Set the pixel viewport of the image buffers.
void clearPixelData (const Frame::Buffer buffer)
 Clear (zero-initialize) and validate an image buffer.
void setPixelData (const Frame::Buffer buffer, const uint8_t *data)
 Set the pixel data of one of the image buffers.
void setPixelData (const Frame::Buffer buffer, const PixelData &data)
 Set the pixel data of one of the image buffers.
void setPBO (const bool onOff)
 Switch PBO usage for image transfers on or off.
bool getPBO () const

Classes

class  CompressedPixels
struct  Data
 All distributed data.
struct  PixelData
class  Pixels
 Raw image data.

Constructor & Destructor Documentation

eq::Image::Image (  ) 

Constructs a new Image.

Definition at line 39 of file image.cpp.

References reset().

Here is the call graph for this function:


Member Function Documentation

const eq::Viewport& eq::Image::getViewport (  )  const [inline]

Returns:
the fractional viewport of the image.

Definition at line 55 of file image.h.

GLEWContext* eq::Image::glewGetContext (  )  [inline]

Returns:
the GL function table, valid during readback.

Definition at line 58 of file image.h.

void eq::Image::reset (  ) 

Reset the image to its default state.

Definition at line 49 of file image.cpp.

References setPixelViewport().

Referenced by Image().

Here is the call graph for this function:

Here is the caller graph for this function:

void eq::Image::setFormat ( const Frame::Buffer  buffer,
const uint32_t  format 
)

Set the (OpenGL) format of the pixel data for a buffer.

Invalidates the pixel data.

Parameters:
buffer the buffer type.
format the format.

Definition at line 160 of file image.cpp.

Referenced by setPixelData().

Here is the caller graph for this function:

void eq::Image::setType ( const Frame::Buffer  buffer,
const uint32_t  type 
)

Set the (OpenGL) type of the pixel data for a buffer.

Invalidates the pixel data.

Parameters:
buffer the buffer type.
type the type.

Definition at line 167 of file image.cpp.

Referenced by setPixelData().

Here is the caller graph for this function:

uint32_t eq::Image::getFormat ( const Frame::Buffer  buffer  )  const

Returns:
the (OpenGL) format of the pixel data.

Definition at line 174 of file image.cpp.

Referenced by eq::Compositor::assembleImage2D(), eq::Compositor::assembleImageDB_FF(), eq::Compositor::assembleImageDB_GLSL(), compressPixelData(), getDepth(), hasAlpha(), and writeImage().

Here is the caller graph for this function:

uint32_t eq::Image::getType ( const Frame::Buffer  buffer  )  const

Returns:
the (OpenGL) type of the pixel data.

Definition at line 180 of file image.cpp.

Referenced by eq::Compositor::assembleImage2D(), eq::Compositor::assembleImageDB_FF(), eq::Compositor::assembleImageDB_GLSL(), compressPixelData(), and getDepth().

Here is the caller graph for this function:

uint32_t eq::Image::getDepth ( const Frame::Buffer  buffer  )  const

Returns:
the size of a single image pixel in bytes.

Definition at line 61 of file image.cpp.

References getFormat(), and getType().

Referenced by clearPixelData(), compressPixelData(), readImage(), setPixelData(), and writeImage().

Here is the call graph for this function:

Here is the caller graph for this function:

bool eq::Image::hasAlpha (  )  const

Returns:
true if the image has a color buffer with alpha.

Definition at line 186 of file image.cpp.

References eq::Frame::BUFFER_COLOR, and getFormat().

Here is the call graph for this function:

const uint8_t * eq::Image::getPixelPointer ( const Frame::Buffer  buffer  )  const

Returns:
a pointer to the raw pixel data.

Definition at line 200 of file image.cpp.

References hasPixelData().

Referenced by eq::Compositor::assembleImage2D(), eq::Compositor::assembleImageDB_FF(), eq::Compositor::assembleImageDB_GLSL(), compressPixelData(), and writeImage().

Here is the call graph for this function:

Here is the caller graph for this function:

uint32_t eq::Image::getPixelDataSize ( const Frame::Buffer  buffer  )  const [inline]

Returns:
the size of the raw pixel data in bytes

Definition at line 98 of file image.h.

Referenced by clearPixelData(), compressPixelData(), and setPixelData().

Here is the caller graph for this function:

const Image::PixelData & eq::Image::getPixelData ( const Frame::Buffer  buffer  )  const

Returns:
the pixel data.

Definition at line 216 of file image.cpp.

References hasPixelData().

Referenced by eq::FrameData::transmit().

Here is the call graph for this function:

Here is the caller graph for this function:

const Image::PixelData & eq::Image::compressPixelData ( const Frame::Buffer  buffer  ) 

Returns:
the compressed pixel data.

Definition at line 534 of file image.cpp.

References getDepth(), getFormat(), eq::base::OMP::getNThreads(), getPixelDataSize(), getPixelPointer(), and getType().

Referenced by eq::FrameData::transmit().

Here is the call graph for this function:

Here is the caller graph for this function:

bool eq::Image::hasPixelData ( const Frame::Buffer  buffer  )  const [inline]

Returns:
true if the image has pixel data for the buffer, false if not.

Definition at line 111 of file image.h.

Referenced by eq::Compositor::assembleImage(), eq::Compositor::assembleImage2D(), eq::Compositor::assembleImageDB_FF(), getPixelData(), getPixelPointer(), and eq::FrameData::transmit().

Here is the caller graph for this function:

const PixelViewport& eq::Image::getPixelViewport (  )  const [inline]

Returns:
the pixel viewport of the image with in the frame buffer.

Definition at line 115 of file image.h.

Referenced by eq::Compositor::assembleImage2D(), eq::Compositor::assembleImageDB_FF(), eq::Compositor::assembleImageDB_GLSL(), readImage(), eq::Compositor::setupStencilBuffer(), and eq::FrameData::transmit().

Here is the caller graph for this function:

void eq::Image::setPixelViewport ( const PixelViewport pvp  ) 

Set the pixel viewport of the image buffers.

The image buffers will be invalidated.

Parameters:
pvp the pixel viewport.

Definition at line 359 of file image.cpp.

Referenced by readImage(), and reset().

Here is the caller graph for this function:

void eq::Image::clearPixelData ( const Frame::Buffer  buffer  ) 

Clear (zero-initialize) and validate an image buffer.

Parameters:
buffer the image buffer to clear.

Definition at line 368 of file image.cpp.

References eq::Frame::BUFFER_COLOR, eq::Frame::BUFFER_DEPTH, getDepth(), and getPixelDataSize().

Here is the call graph for this function:

void eq::Image::setPixelData ( const Frame::Buffer  buffer,
const uint8_t *  data 
)

Set the pixel data of one of the image buffers.

The data is copied, and previous data for the buffer is overwritten.

Parameters:
buffer the image buffer to set.
data the buffer data of size pvp.w * pvp.h * depth.

Definition at line 419 of file image.cpp.

References getPixelDataSize().

Referenced by readImage(), and setPixelData().

Here is the call graph for this function:

Here is the caller graph for this function:

void eq::Image::setPixelData ( const Frame::Buffer  buffer,
const PixelData &  data 
)

Set the pixel data of one of the image buffers.

Previous data for the buffer is overwritten. The pixel data is decompressed, if needed.

Parameters:
buffer the image buffer to set.
data the pixel data.

Definition at line 433 of file image.cpp.

References getDepth(), getPixelDataSize(), setFormat(), setPixelData(), and setType().

Here is the call graph for this function:

void eq::Image::setPBO ( const bool  onOff  )  [inline]

Switch PBO usage for image transfers on or off.

Definition at line 155 of file image.h.

bool eq::Image::getPBO (  )  const [inline]

Returns:
if this image should use PBO for image transfers.

Definition at line 158 of file image.h.

void eq::Image::startReadback ( const uint32_t  buffers,
const PixelViewport pvp,
Window::ObjectManager glObjects 
)

Start reading back an image from the frame buffer.

Parameters:
buffers bit-wise combination of the frame buffer components.
pvp the area of the frame buffer wrt the drawable.
glObjects the GL object manager for the current GL context.

Definition at line 222 of file image.cpp.

References eq::Frame::BUFFER_COLOR, eq::Frame::BUFFER_DEPTH, eq::PixelViewport::x, and eq::PixelViewport::y.

Referenced by eq::FrameData::startReadback().

Here is the caller graph for this function:

void eq::Image::syncReadback (  ) 

Make sure that the last readback operation is complete.

Definition at line 246 of file image.cpp.

References eq::Frame::BUFFER_COLOR, and eq::Frame::BUFFER_DEPTH.

Referenced by eq::FrameData::syncReadback().

Here is the caller graph for this function:

void eq::Image::writeImage ( const std::string &  filename,
const Frame::Buffer  buffer 
) const

Writes the pixel data as rgb image files.

Definition at line 745 of file image.cpp.

References getDepth(), getFormat(), getPixelPointer(), eq::PixelViewport::h, and eq::PixelViewport::w.

Referenced by writeImages().

Here is the call graph for this function:

Here is the caller graph for this function:

void eq::Image::writeImages ( const std::string &  filenameTemplate  )  const

Writes all pixel data as separate images.

Definition at line 676 of file image.cpp.

References eq::Frame::BUFFER_COLOR, eq::Frame::BUFFER_DEPTH, and writeImage().

Referenced by eq::Compositor::assembleFramesCPU(), and eq::FrameData::syncReadback().

Here is the call graph for this function:

Here is the caller graph for this function:

bool eq::Image::readImage ( const std::string &  filename,
const Frame::Buffer  buffer 
)

Read pixel data from an uncompressed rgb image file.

Definition at line 807 of file image.cpp.

References eq::Frame::BUFFER_COLOR, eq::Frame::BUFFER_DEPTH, getDepth(), getPixelViewport(), setPixelData(), and setPixelViewport().

Here is the call graph for this function:


The documentation for this class was generated from the following files:
Generated on Sat Dec 6 12:01:47 2008 for Equalizer 0.6 by  doxygen 1.5.5