#include <image.h>

Classes | |
| class | Attachment |
| The individual parameters for a buffer. | |
| struct | Data |
| All distributed data. | |
| struct | Memory |
| Raw image data. | |
| struct | PixelData |
Public Member Functions | |
| Image () | |
| Constructs a new Image. | |
| GLEWContext * | glewGetContext () |
| uint8_t | getNumChannels (const Frame::Buffer buffer) const |
| uint8_t | getChannelSize (const Frame::Buffer buffer) const |
| uint32_t | getDepth (const Frame::Buffer buffer) const |
| std::vector< uint32_t > | findCompressors (const Frame::Buffer buffer) const |
| bool | allocCompressor (const Frame::Buffer buffer, const uint32_t name) |
| Re-allocate, if needed, a compressor instance. | |
Image parameters | |
| void | setFormat (const Frame::Buffer buffer, const uint32_t format) |
| Set the (OpenGL) format of the pixel data for a buffer. | |
| uint32_t | getFormat (const Frame::Buffer buffer) const |
| void | setType (const Frame::Buffer buffer, const uint32_t type) |
| Set the (OpenGL) type of the pixel data for a buffer. | |
| uint32_t | getType (const Frame::Buffer buffer) const |
| bool | hasAlpha () const |
| void | setStorageType (const Frame::Type type) |
| Set the frame pixel storage type. | |
| Frame::Type | getStorageType () const |
| bool | hasData (const Frame::Buffer buffer) const |
| void | setPixelViewport (const PixelViewport &pvp) |
| Set the pixel viewport of the image. | |
| const PixelViewport & | getPixelViewport () const |
| void | reset () |
| Reset the image to its default state. | |
Pixel data | |
| 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 |
| void | clearPixelData (const Frame::Buffer buffer) |
| Clear (zero-initialize) and validate an image buffer. | |
| void | validatePixelData (const Frame::Buffer buffer) |
| Validate an image buffer without initializing its content. | |
| 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 | enablePBO () |
| Switch PBO usage for image transfers on. | |
| void | disablePBO () |
| Switch PBO usage for image transfers off. | |
| bool | usePBO () const |
| void | enableAlphaUsage () |
| Enable compression and transport of alpha data. | |
| void | disableAlphaUsage () |
| Disable compression and transport of alpha data. | |
| bool | ignoreAlpha () const |
Texture access | |
| const Texture & | getTexture (const Frame::Buffer buffer) const |
| Get the texture of this image. | |
| bool | hasTextureData (const Frame::Buffer buffer) const |
| uint32_t | getInternalTextureFormat (const Frame::Buffer which) const |
Operations | |
| void | startReadback (const uint32_t buffers, const PixelViewport &pvp, const Zoom &zoom, 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 valid pixel data as separate images. | |
| bool | readImage (const std::string &filename, const Frame::Buffer buffer) |
| Read pixel data from an uncompressed rgb image file. | |
| void | setOffset (int32_t x, int32_t y) |
| Setting image offset, used after readback to correct position if necessary. | |
| void | flush () |
| Delete all cache data of this image. | |
Friends | |
| std::ostream & | operator<< (std::ostream &os, const Image *) |
An image holds color and depth information for a rectangular region.
Definition at line 36 of file image.h.
| eq::Image::Image | ( | ) |
| 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.
| buffer | the buffer type. | |
| format | the format. |
Definition at line 153 of file image.cpp.
References allocCompressor().
Referenced by eq::Compositor::mergeFramesCPU(), readImage(), and setPixelData().


| uint32_t eq::Image::getFormat | ( | const Frame::Buffer | buffer | ) | const |
Definition at line 177 of file image.cpp.
Referenced by getInternalTextureFormat(), getNumChannels(), hasAlpha(), eq::Texture::upload(), and writeImage().

| 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.
| buffer | the buffer type. | |
| type | the type. |
Definition at line 166 of file image.cpp.
References allocCompressor().
Referenced by eq::Compositor::mergeFramesCPU(), readImage(), and setPixelData().


| uint32_t eq::Image::getType | ( | const Frame::Buffer | buffer | ) | const |
Definition at line 184 of file image.cpp.
Referenced by getChannelSize(), and eq::Texture::upload().

| bool eq::Image::hasAlpha | ( | ) | const |
Definition at line 320 of file image.cpp.
References eq::Frame::BUFFER_COLOR, and getFormat().

| void eq::Image::setStorageType | ( | const Frame::Type | type | ) | [inline] |
Set the frame pixel storage type.
Images of storage type TYPE_MEMORY read back frame buffer data into main memory. The data can be accessed through the PixelData.
Image of storage type TYPE_TEXTURE read frame buffer data into a texture, which can be accessed using getTexture().
| Frame::Type eq::Image::getStorageType | ( | ) | const [inline] |
Definition at line 109 of file image.h.
Referenced by eq::Compositor::assembleImageDB_GLSL().

| bool eq::Image::hasData | ( | const Frame::Buffer | buffer | ) | const |
Definition at line 336 of file image.cpp.
References hasPixelData(), hasTextureData(), eq::Frame::TYPE_MEMORY, and eq::Frame::TYPE_TEXTURE.
Referenced by eq::Compositor::assembleImage(), eq::Compositor::assembleImage2D(), and eq::Compositor::assembleImageDB_FF().


| void eq::Image::setPixelViewport | ( | const PixelViewport & | pvp | ) |
Set the pixel viewport of the image.
| pvp | the pixel viewport. |
Definition at line 669 of file image.cpp.
Referenced by eq::Compositor::mergeFramesCPU(), readImage(), and reset().

| const PixelViewport& eq::Image::getPixelViewport | ( | ) | const [inline] |
Definition at line 127 of file image.h.
Referenced by eq::Compositor::assembleImageDB_FF(), eq::Compositor::assembleImageDB_GLSL(), readImage(), eq::Compositor::setupStencilBuffer(), eq::FrameData::transmit(), and eq::Texture::upload().

| void eq::Image::reset | ( | ) |
Reset the image to its default state.
Definition at line 61 of file image.cpp.
References setPixelViewport().
Referenced by Image().


| const uint8_t * eq::Image::getPixelPointer | ( | const Frame::Buffer | buffer | ) | const |
Definition at line 375 of file image.cpp.
References hasPixelData().
Referenced by eq::Compositor::mergeFramesCPU(), eq::Texture::upload(), and writeImage().


| uint32_t eq::Image::getPixelDataSize | ( | const Frame::Buffer | buffer | ) | const [inline] |
Definition at line 142 of file image.h.
References eq::PixelViewport::getArea(), and getDepth().
Referenced by clearPixelData(), compressPixelData(), setPixelData(), eq::FrameData::transmit(), and validatePixelData().


| const Image::PixelData & eq::Image::getPixelData | ( | const Frame::Buffer | buffer | ) | const |
Definition at line 387 of file image.cpp.
References hasPixelData().
Referenced by eq::FrameData::transmit().


| const Image::PixelData & eq::Image::compressPixelData | ( | const Frame::Buffer | buffer | ) |
Definition at line 932 of file image.cpp.
References allocCompressor(), EQ_COMPRESSOR_DATA_2D, EQ_COMPRESSOR_IGNORE_MSE, EQ_COMPRESSOR_NONE, EQWARN, getPixelDataSize(), eq::PixelViewport::h, eq::PixelViewport::w, eq::PixelViewport::x, and eq::PixelViewport::y.
Referenced by eq::FrameData::transmit().


| bool eq::Image::hasPixelData | ( | const Frame::Buffer | buffer | ) | const [inline] |
Definition at line 157 of file image.h.
Referenced by getPixelData(), getPixelPointer(), hasData(), and eq::FrameData::transmit().

| void eq::Image::clearPixelData | ( | const Frame::Buffer | buffer | ) |
Clear (zero-initialize) and validate an image buffer.
| buffer | the image buffer to clear. |
Definition at line 678 of file image.cpp.
References eq::Frame::BUFFER_COLOR, eq::Frame::BUFFER_DEPTH, getDepth(), getPixelDataSize(), and validatePixelData().
Referenced by eq::Compositor::mergeFramesCPU().


| void eq::Image::validatePixelData | ( | const Frame::Buffer | buffer | ) |
Validate an image buffer without initializing its content.
Definition at line 715 of file image.cpp.
References getPixelDataSize().
Referenced by clearPixelData(), and readImage().


| 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. The pixel data is validated.
| buffer | the image buffer to set. | |
| data | the buffer data of size pvp.w * pvp.h * depth. |
Definition at line 725 of file image.cpp.
References getPixelDataSize().
Referenced by setPixelData().


| 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 validated and decompressed , if needed.
| buffer | the image buffer to set. | |
| data | the pixel data. |
Definition at line 739 of file image.cpp.
References EQ_COMPRESSOR_DATA_2D, EQ_COMPRESSOR_IGNORE_MSE, EQ_COMPRESSOR_NONE, getPixelDataSize(), eq::PixelViewport::h, setFormat(), setPixelData(), setType(), eq::PixelViewport::w, eq::PixelViewport::x, and eq::PixelViewport::y.

| void eq::Image::enablePBO | ( | ) | [inline] |
| void eq::Image::disablePBO | ( | ) | [inline] |
| bool eq::Image::usePBO | ( | ) | const [inline] |
| void eq::Image::enableAlphaUsage | ( | ) |
| void eq::Image::disableAlphaUsage | ( | ) |
| bool eq::Image::ignoreAlpha | ( | ) | const [inline] |
Definition at line 210 of file image.h.
Referenced by eq::FrameData::transmit().

| const Texture & eq::Image::getTexture | ( | const Frame::Buffer | buffer | ) | const |
Get the texture of this image.
Definition at line 370 of file image.cpp.
Referenced by eq::Compositor::assembleImageDB_GLSL(), and hasTextureData().

| bool eq::Image::hasTextureData | ( | const Frame::Buffer | buffer | ) | const |
Definition at line 365 of file image.cpp.
References getTexture(), and eq::Texture::isValid().
Referenced by hasData().


| uint32_t eq::Image::getInternalTextureFormat | ( | const Frame::Buffer | which | ) | const |
Definition at line 128 of file image.cpp.
References EQWARN, and getFormat().
Referenced by eq::Texture::upload().


| void eq::Image::startReadback | ( | const uint32_t | buffers, | |
| const PixelViewport & | pvp, | |||
| const Zoom & | zoom, | |||
| Window::ObjectManager * | glObjects | |||
| ) |
Start reading back an image from the frame buffer.
| buffers | bit-wise combination of the frame buffer components. | |
| pvp | the area of the frame buffer wrt the drawable. | |
| zoom | the scale factor to apply during readback. | |
| glObjects | the GL object manager for the current GL context. |
Definition at line 393 of file image.cpp.
References eq::PixelViewport::apply(), eq::Frame::BUFFER_COLOR, eq::Frame::BUFFER_DEPTH, EQLOG, eq::LOG_ASSEMBLY, eq::PixelViewport::x, and eq::PixelViewport::y.
Referenced by eq::FrameData::startReadback().


| void eq::Image::syncReadback | ( | ) |
Make sure that the last readback operation is complete.
Definition at line 419 of file image.cpp.
References eq::Frame::BUFFER_COLOR, and eq::Frame::BUFFER_DEPTH.
Referenced by eq::FrameData::syncReadback().

| void eq::Image::writeImage | ( | const std::string & | filename, | |
| const Frame::Buffer | buffer | |||
| ) | const |
Writes the pixel data as rgb image files.
Definition at line 1056 of file image.cpp.
References EQERROR, getChannelSize(), getFormat(), getNumChannels(), getPixelPointer(), eq::PixelViewport::h, and eq::PixelViewport::w.
Referenced by writeImages().


| void eq::Image::writeImages | ( | const std::string & | filenameTemplate | ) | const |
Writes all valid pixel data as separate images.
Definition at line 992 of file image.cpp.
References eq::Frame::BUFFER_COLOR, eq::Frame::BUFFER_DEPTH, and writeImage().
Referenced by eq::Compositor::assembleFramesCPU(), and eq::FrameData::syncReadback().


| bool eq::Image::readImage | ( | const std::string & | filename, | |
| const Frame::Buffer | buffer | |||
| ) |
Read pixel data from an uncompressed rgb image file.
Definition at line 1145 of file image.cpp.
References eq::Frame::BUFFER_COLOR, eq::Frame::BUFFER_DEPTH, EQERROR, eq::base::MemoryMap::getAddress(), getPixelViewport(), eq::base::MemoryMap::getSize(), eq::base::MemoryMap::map(), setFormat(), setPixelViewport(), setType(), and validatePixelData().

| void eq::Image::flush | ( | ) |
Delete all cache data of this image.
Definition at line 68 of file image.cpp.
Referenced by eq::FrameData::flush().

| GLEWContext* eq::Image::glewGetContext | ( | ) | [inline] |
Definition at line 275 of file image.h.
References eq::ObjectManager< T >::glewGetContext().

| uint8_t eq::Image::getNumChannels | ( | const Frame::Buffer | buffer | ) | const |
Definition at line 81 of file image.cpp.
References EQWARN, and getFormat().
Referenced by getDepth(), and writeImage().


| uint8_t eq::Image::getChannelSize | ( | const Frame::Buffer | buffer | ) | const |
Definition at line 106 of file image.cpp.
References getType().
Referenced by getDepth(), and writeImage().


| uint32_t eq::Image::getDepth | ( | const Frame::Buffer | buffer | ) | const |
Definition at line 76 of file image.cpp.
References getChannelSize(), and getNumChannels().
Referenced by clearPixelData(), and getPixelDataSize().


| std::vector< uint32_t > eq::Image::findCompressors | ( | const Frame::Buffer | buffer | ) | const |
For internal use only.
Definition at line 246 of file image.cpp.
References EQINFO, eq::PluginRegistry::getCompressors(), eq::Compressor::getInfos(), eq::Global::getPluginRegistry(), EqCompressorInfo::name, and EqCompressorInfo::tokenType.
Referenced by allocCompressor().


| bool eq::Image::allocCompressor | ( | const Frame::Buffer | buffer, | |
| const uint32_t | name | |||
| ) |
Re-allocate, if needed, a compressor instance.
Find and activate a compression engine.
For internal use only.
Definition at line 844 of file image.cpp.
References EQ_COMPRESSOR_NONE, EQINFO, findCompressors(), and eq::Global::getPluginRegistry().
Referenced by compressPixelData(), setFormat(), and setType().


0.9 by
1.5.8