#include <OgreImage.h>
Public Types | |
enum | Filter { FILTER_NEAREST, FILTER_LINEAR, FILTER_BILINEAR, FILTER_BOX, FILTER_TRIANGLE, FILTER_BICUBIC } |
Public Methods | |
Image () | |
Standard constructor. | |
Image (const Image &img) | |
Copy-constructor - copies all the data from the target image. | |
virtual | ~Image () |
Standard destructor. | |
Image & | operator= (const Image &img) |
Assignment operator- copies all the data from the target image. | |
Image & | flipAroundY () |
Flips (mirrors) the image around the Y-axis. | |
Image & | flipAroundX () |
Flips (mirrors) the image around the X-axis. | |
Image & | loadDynamicImage (uchar *pData, ushort uWidth, ushort uHeight, PixelFormat eFormat) |
Stores a pointer to raw data in memory. | |
Image & | loadRawData (const DataChunk &pData, ushort uWidth, ushort uHeight, PixelFormat eFormat) |
Loads raw data from memory. | |
Image & | load (const String &strFileName) |
Loads an image file. | |
Image & | load (const DataChunk &chunk, const String &type) |
Loads an image file from a chunk of memory. | |
void | save (const String &filename) |
Save the image as a file. | |
uchar * | getData (void) |
Returns a pointer to the internal image buffer. | |
const uchar * | getData () const |
Returns a const pointer to the internal image buffer. | |
size_t | getSize () const |
Returns the size of the data buffer. | |
unsigned short | getNumMipmaps () const |
Returns the number of mipmaps contained in the image. | |
bool | hasFlag (const ImageFlags imgFlag) const |
Returns true if the image has the appropriate flag set. | |
ushort | getWidth (void) const |
Gets the width of the image in pixels. | |
ushort | getHeight (void) const |
Gets the height of the image in pixels. | |
ushort | getDepth (void) const |
Gets the depth of the image. | |
ushort | getRowSpan (void) const |
Gets the physical width in bytes of each row of pixels. | |
PixelFormat | getFormat () const |
Returns the image format. | |
uchar | getBPP () const |
Returns the number of bits per pixel. | |
bool | getHasAlpha () const |
Returns true if the image has an alpha component. | |
void | resize (ushort width, ushort height, Filter filter=FILTER_BILINEAR) |
Resize a 2D image, applying the appropriate filter. | |
Static Public Methods | |
uchar | PF2PS (PixelFormat format) |
uchar | getNumElemBytes (PixelFormat format) |
Returns the size in bytes of an element of the given pixel format. | |
uchar | PF2BPP (PixelFormat format) |
uchar | getNumElemBits (PixelFormat format) |
Returns the size in bits of an element of the given pixel format. | |
bool | PFHasAlpha (PixelFormat format) |
Returns the existance of an alpha component given a pixel format. | |
bool | convReqsFlip (PixelFormat srcformat, PixelFormat destformat) |
Decides wether converting from a pixel format to another requires endian-flipping. | |
void | applyGamma (uchar *buffer, Real gamma, size_t size, uchar bpp) |
Does gamma adjustment. | |
bool | formatHasAlpha (PixelFormat format) |
Private Attributes | |
ushort | m_uWidth |
ushort | m_uHeight |
ushort | m_uDepth |
uint | m_uSize |
ushort | m_uNumMipmaps |
int | m_uFlags |
PixelFormat | m_eFormat |
uchar | m_ucPixelSize |
uchar * | m_pBuffer |
bool | m_bAutoDelete |
Typically, you would want to use an Image object to load a texture when extra processing needs to be done on an image before it is loaded or when you want to blit to an existing texture.
Definition at line 51 of file OgreImage.h.
|
Definition at line 447 of file OgreImage.h. |
|
Standard constructor.
Definition at line 40 of file OgreImage.cpp. |
|
Copy-constructor - copies all the data from the target image.
Definition at line 51 of file OgreImage.cpp. |
|
Standard destructor.
Definition at line 58 of file OgreImage.cpp. References m_bAutoDelete, and m_pBuffer. |
|
Does gamma adjustment.
|
|
Decides wether converting from a pixel format to another requires endian-flipping.
Definition at line 280 of file OgreImage.h. References Ogre::PF_A2R10G10B10, Ogre::PF_A4L4, Ogre::PF_A4R4G4B4, Ogre::PF_A8R8G8B8, Ogre::PF_R5G6B5, Ogre::PF_R8G8B8, Ogre::PixelFormat, and Ogre::uchar. |
|
Flips (mirrors) the image around the X-axis.
Definition at line 190 of file OgreImage.cpp. References Except, m_pBuffer, m_ucPixelSize, m_uHeight, m_uWidth, OgreGuard, OgreUnguardRet, Ogre::uchar, and Ogre::ushort. Referenced by Ogre::Win32Window::writeContentsToFile(), Ogre::SDLWindow::writeContentsToFile(), and Ogre::GLXWindow::writeContentsToFile(). |
|
Flips (mirrors) the image around the Y-axis.
Definition at line 96 of file OgreImage.cpp. References Except, m_pBuffer, m_uHeight, m_uWidth, OgreGuard, OgreUnguardRet, Ogre::uchar, Ogre::uint, and Ogre::ushort. |
|
Definition at line 472 of file OgreImage.cpp. References Ogre::PF_A2R10G10B10, Ogre::PF_A4L4, Ogre::PF_A4R4G4B4, Ogre::PF_A8, Ogre::PF_A8R8G8B8, Ogre::PF_B10G10R10A2, Ogre::PF_B4G4R4A4, Ogre::PF_B5G6R5, Ogre::PF_B8G8R8, Ogre::PF_B8G8R8A8, Ogre::PF_L4A4, Ogre::PF_L8, Ogre::PF_R5G6B5, Ogre::PF_R8G8B8, Ogre::PF_UNKNOWN, and Ogre::PixelFormat. |
|
Returns the number of bits per pixel.
Definition at line 461 of file OgreImage.cpp. References m_ucPixelSize, and Ogre::uchar. Referenced by Ogre::D3DTexture::blitImage(), Ogre::D3DTexture::blitImage3D(), Ogre::D3D9Texture::loadImage(), Ogre::D3DTexture::loadImage(), and Ogre::D3DTexture::loadImage3D(). |
|
Returns a const pointer to the internal image buffer.
|
|
Returns a pointer to the internal image buffer.
Definition at line 394 of file OgreImage.cpp. References m_pBuffer, and Ogre::uchar. Referenced by Ogre::ColourImageAffector::_affectParticles(), Ogre::D3D9Texture::_blitImagesToCubeTex(), Ogre::D3D9Texture::_blitImageToNormTex(), Ogre::ColourImageAffector::_initParticle(), Ogre::D3DTexture::blitImage(), Ogre::D3DTexture::blitImage3D(), Ogre::GLTexture::blitToTexture(), Ogre::D3D9Texture::blitToTexture(), Ogre::GLXConfigurator::CreateBackdrop(), Ogre::GLTexture::load(), Ogre::LoadIcon(), Ogre::D3D9Texture::loadImage(), Ogre::HeightmapTerrainPageSource::requestPage(), Ogre::GLTexture::rescaleNPower2(), Ogre::Win32Window::writeContentsToFile(), Ogre::SDLWindow::writeContentsToFile(), and Ogre::GLXWindow::writeContentsToFile(). |
|
Gets the depth of the image.
Definition at line 432 of file OgreImage.cpp. References m_uDepth, and Ogre::ushort. Referenced by Ogre::GLTexture::load(), and Ogre::GLTexture::loadImages(). |
|
Returns the image format.
Definition at line 455 of file OgreImage.cpp. References m_eFormat, and Ogre::PixelFormat. Referenced by Ogre::D3D9Texture::_blitImageToNormTex(), Ogre::D3D9Texture::_loadCubeTex(), Ogre::D3D9Texture::blitToTexture(), Ogre::GLXConfigurator::CreateBackdrop(), Ogre::GLTexture::load(), Ogre::LoadIcon(), Ogre::D3D9Texture::loadImage(), Ogre::D3DTexture::loadImage(), Ogre::D3DTexture::loadImage3D(), Ogre::GLTexture::loadImages(), Ogre::HeightmapTerrainPageSource::requestPage(), and Ogre::ColourImageAffector::setImageAdjust(). |
|
Returns true if the image has an alpha component.
Definition at line 467 of file OgreImage.cpp. References m_eFormat. Referenced by Ogre::D3DTexture::blitImage(), Ogre::D3DTexture::blitImage3D(), Ogre::D3DTexture::loadImage(), Ogre::D3DTexture::loadImage3D(), and Ogre::GLTexture::loadImages(). |
|
Gets the height of the image in pixels.
Definition at line 443 of file OgreImage.cpp. References m_uHeight, and Ogre::ushort. Referenced by Ogre::ColourImageAffector::_affectParticles(), Ogre::D3D9Texture::_blitImagesToCubeTex(), Ogre::D3D9Texture::_blitImageToNormTex(), Ogre::D3D9Texture::_loadCubeTex(), Ogre::D3DTexture::blitImage(), Ogre::D3DTexture::blitImage3D(), Ogre::GLTexture::blitToTexture(), Ogre::D3D9Texture::blitToTexture(), Ogre::D3DTexture::blitToTexture(), Ogre::GLXConfigurator::CreateBackdrop(), Ogre::GLTexture::load(), Ogre::HeightmapTerrainPageSource::loadHeightmap(), Ogre::LoadIcon(), Ogre::D3D9Texture::loadImage(), Ogre::D3DTexture::loadImage(), Ogre::D3DTexture::loadImage3D(), and Ogre::GLTexture::loadImages(). |
|
Returns the size in bits of an element of the given pixel format.
Definition at line 209 of file OgreImage.h. References Ogre::PF_A2R10G10B10, Ogre::PF_A4L4, Ogre::PF_A4R4G4B4, Ogre::PF_A8, Ogre::PF_A8R8G8B8, Ogre::PF_B10G10R10A2, Ogre::PF_B4G4R4A4, Ogre::PF_B5G6R5, Ogre::PF_B8G8R8, Ogre::PF_B8G8R8A8, Ogre::PF_DXT1, Ogre::PF_DXT2, Ogre::PF_DXT3, Ogre::PF_DXT4, Ogre::PF_DXT5, Ogre::PF_L4A4, Ogre::PF_L8, Ogre::PF_R5G6B5, Ogre::PF_R8G8B8, Ogre::PF_UNKNOWN, Ogre::PixelFormat, and Ogre::uchar. |
|
Returns the size in bytes of an element of the given pixel format.
Definition at line 157 of file OgreImage.h. References Ogre::PF_A2R10G10B10, Ogre::PF_A4L4, Ogre::PF_A4R4G4B4, Ogre::PF_A8, Ogre::PF_A8R8G8B8, Ogre::PF_B10G10R10A2, Ogre::PF_B4G4R4A4, Ogre::PF_B5G6R5, Ogre::PF_B8G8R8, Ogre::PF_B8G8R8A8, Ogre::PF_L4A4, Ogre::PF_L8, Ogre::PF_R5G6B5, Ogre::PF_R8G8B8, Ogre::PF_UNKNOWN, Ogre::PixelFormat, and Ogre::uchar. |
|
Returns the number of mipmaps contained in the image.
Definition at line 413 of file OgreImage.cpp. References m_uNumMipmaps. Referenced by Ogre::GLTexture::loadImages(). |
|
Gets the physical width in bytes of each row of pixels.
Definition at line 449 of file OgreImage.cpp. References m_ucPixelSize, m_uWidth, and Ogre::ushort. |
|
Returns the size of the data buffer.
Definition at line 407 of file OgreImage.cpp. References m_uSize. Referenced by Ogre::D3DTexture::blitImage(), Ogre::D3DTexture::blitImage3D(), Ogre::GLTexture::load(), Ogre::D3D9Texture::loadImage(), and Ogre::GLTexture::rescaleNPower2(). |
|
Gets the width of the image in pixels.
Definition at line 437 of file OgreImage.cpp. References m_uWidth, and Ogre::ushort. Referenced by Ogre::ColourImageAffector::_affectParticles(), Ogre::D3D9Texture::_blitImagesToCubeTex(), Ogre::D3D9Texture::_blitImageToNormTex(), Ogre::D3D9Texture::_loadCubeTex(), Ogre::D3DTexture::blitImage(), Ogre::D3DTexture::blitImage3D(), Ogre::GLTexture::blitToTexture(), Ogre::D3D9Texture::blitToTexture(), Ogre::D3DTexture::blitToTexture(), Ogre::GLXConfigurator::CreateBackdrop(), Ogre::GLTexture::load(), Ogre::HeightmapTerrainPageSource::loadHeightmap(), Ogre::LoadIcon(), Ogre::D3D9Texture::loadImage(), Ogre::D3DTexture::loadImage(), Ogre::D3DTexture::loadImage3D(), and Ogre::GLTexture::loadImages(). |
|
Returns true if the image has the appropriate flag set.
Definition at line 419 of file OgreImage.cpp. References Ogre::ImageFlags, and m_uFlags. Referenced by Ogre::GLTexture::load(), and Ogre::GLTexture::loadImages(). |
|
Loads an image file from a chunk of memory.
Definition at line 357 of file OgreImage.cpp. References Ogre::Codec::decode(), Ogre::ImageCodec::ImageData::depth, Except, Ogre::ImageCodec::ImageData::flags, Ogre::ImageCodec::ImageData::format, Ogre::DataChunk::getPtr(), Ogre::ImageCodec::ImageData::height, m_eFormat, m_pBuffer, m_ucPixelSize, m_uDepth, m_uFlags, m_uHeight, m_uNumMipmaps, m_uSize, m_uWidth, Ogre::ImageCodec::ImageData::num_mipmaps, OgreGuard, OgreUnguardRet, PF2PS(), Ogre::ImageCodec::ImageData::size, Ogre::String, and Ogre::ImageCodec::ImageData::width. |
|
|
Stores a pointer to raw data in memory. The pixel format has to be specified.
Definition at line 221 of file OgreImage.cpp. References m_bAutoDelete, m_eFormat, m_pBuffer, m_ucPixelSize, m_uHeight, m_uSize, m_uWidth, OgreGuard, OgreUnguardRet, PF2PS(), Ogre::PixelFormat, Ogre::uchar, and Ogre::ushort. |
|
Loads raw data from memory. The pixel format has to be specified. Definition at line 240 of file OgreImage.cpp. References Ogre::DataChunk::getPtr(), m_eFormat, m_pBuffer, m_ucPixelSize, m_uHeight, m_uSize, m_uWidth, OgreGuard, OgreUnguardRet, PF2PS(), Ogre::PixelFormat, Ogre::uchar, and Ogre::ushort. Referenced by Ogre::Font::createTextureFromFont(), Ogre::Quake3Level::extractLightmaps(), Ogre::GLTexture::load(), Ogre::Texture::loadRawData(), Ogre::Win32Window::writeContentsToFile(), Ogre::SDLWindow::writeContentsToFile(), and Ogre::GLXWindow::writeContentsToFile(). |
|
Assignment operator- copies all the data from the target image.
Definition at line 69 of file OgreImage.cpp. References m_bAutoDelete, m_eFormat, m_pBuffer, m_ucPixelSize, m_uDepth, m_uFlags, m_uHeight, m_uNumMipmaps, m_uSize, m_uWidth, and Ogre::uchar. |
|
Definition at line 196 of file OgreImage.h. References Ogre::PixelFormat, and Ogre::uchar. |
|
Definition at line 144 of file OgreImage.h. References Ogre::PixelFormat, and Ogre::uchar. Referenced by load(), loadDynamicImage(), and loadRawData(). |
|
Returns the existance of an alpha component given a pixel format.
Definition at line 250 of file OgreImage.h. References Ogre::PF_A2R10G10B10, Ogre::PF_A4L4, Ogre::PF_A4R4G4B4, Ogre::PF_A8, Ogre::PF_A8R8G8B8, Ogre::PF_B10G10R10A2, Ogre::PF_B4G4R4A4, Ogre::PF_B8G8R8A8, Ogre::PF_L4A4, and Ogre::PixelFormat. |
|
Resize a 2D image, applying the appropriate filter.
Definition at line 559 of file OgreImage.cpp. References Ogre::getILFilter(), m_eFormat, m_pBuffer, m_ucPixelSize, m_uHeight, m_uWidth, Ogre::OgreFormat2ilFormat(), Ogre::uchar, and Ogre::ushort. |
|
Save the image as a file.
Definition at line 322 of file OgreImage.cpp. References Ogre::Codec::codeToFile(), Except, Ogre::ImageCodec::ImageData::format, Ogre::ImageCodec::ImageData::height, m_eFormat, m_pBuffer, m_uHeight, m_uSize, m_uWidth, Ogre::String, and Ogre::ImageCodec::ImageData::width. |
|
Definition at line 482 of file OgreImage.h. Referenced by loadDynamicImage(), operator=(), and ~Image(). |
|
Definition at line 475 of file OgreImage.h. Referenced by getFormat(), getHasAlpha(), load(), loadDynamicImage(), loadRawData(), operator=(), resize(), and save(). |
|
Definition at line 479 of file OgreImage.h. Referenced by flipAroundX(), flipAroundY(), getData(), load(), loadDynamicImage(), loadRawData(), operator=(), resize(), save(), and ~Image(). |
|
Definition at line 478 of file OgreImage.h. Referenced by flipAroundX(), getBPP(), getRowSpan(), load(), loadDynamicImage(), loadRawData(), operator=(), and resize(). |
|
Definition at line 466 of file OgreImage.h. |
|
Definition at line 472 of file OgreImage.h. |
|
Definition at line 464 of file OgreImage.h. Referenced by flipAroundX(), flipAroundY(), getHeight(), load(), loadDynamicImage(), loadRawData(), operator=(), resize(), and save(). |
|
Definition at line 470 of file OgreImage.h. Referenced by getNumMipmaps(), load(), and operator=(). |
|
Definition at line 468 of file OgreImage.h. Referenced by getSize(), load(), loadDynamicImage(), loadRawData(), operator=(), and save(). |
|
Definition at line 462 of file OgreImage.h. Referenced by flipAroundX(), flipAroundY(), getRowSpan(), getWidth(), load(), loadDynamicImage(), loadRawData(), operator=(), resize(), and save(). |
Copyright © 2002-2003 by The OGRE Team
Last modified Sun Nov 28 19:51:06 2004