#include <OgreImage.h>
Public Types | |
| enum | Filter { FILTER_NEAREST, FILTER_LINEAR, FILTER_BILINEAR, FILTER_BOX, FILTER_TRIANGLE, FILTER_BICUBIC } |
| typedef Ogre::Box | Box |
| typedef Ogre::Rect | Rect |
Public Member Functions | |
| 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, size_t uWidth, size_t uHeight, size_t depth, PixelFormat eFormat, bool autoDelete=false, size_t numFaces=1, size_t numMipMaps=0) |
| Stores a pointer to raw data in memory. | |
| Image & | loadDynamicImage (uchar *pData, size_t uWidth, size_t uHeight, PixelFormat eFormat) |
| Stores a pointer to raw data in memory. | |
| Image & | loadRawData (DataStreamPtr &stream, size_t uWidth, size_t uHeight, size_t uDepth, PixelFormat eFormat, size_t numFaces=1, size_t numMipMaps=0) |
| Loads raw data from a stream. | |
| Image & | loadRawData (DataStreamPtr &stream, size_t uWidth, size_t uHeight, PixelFormat eFormat) |
| Loads raw data from a stream. | |
| Image & | load (const String &strFileName, const String &groupName) |
| Loads an image file. | |
| Image & | load (DataStreamPtr &stream, const String &type) |
| Loads an image file from a stream. | |
| 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. | |
| size_t | 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. | |
| size_t | getWidth (void) const |
| Gets the width of the image in pixels. | |
| size_t | getHeight (void) const |
| Gets the height of the image in pixels. | |
| size_t | getDepth (void) const |
| Gets the depth of the image. | |
| size_t | getNumFaces (void) const |
| Get the numer of faces of the image. | |
| size_t | 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. | |
| ColourValue | getColourAt (int x, int y, int z) |
| Get colour value from a certain location in the image. | |
| PixelBox | getPixelBox (size_t face=0, size_t mipmap=0) const |
| Get a PixelBox encapsulating the image data of a mipmap. | |
| void | resize (ushort width, ushort height, Filter filter=FILTER_BILINEAR) |
| Resize a 2D image, applying the appropriate filter. | |
Static Public Member Functions | |
| static void | applyGamma (uchar *buffer, Real gamma, size_t size, uchar bpp) |
| Does gamma adjustment. | |
| static void | scale (const PixelBox &src, const PixelBox &dst, Filter filter=FILTER_BILINEAR) |
| Scale a 1D, 2D or 3D image volume. | |
| static size_t | calculateSize (size_t mipmaps, size_t faces, size_t width, size_t height, size_t depth, PixelFormat format) |
Private Attributes | |
| size_t | m_uWidth |
| size_t | m_uHeight |
| size_t | m_uDepth |
| size_t | m_uSize |
| size_t | m_uNumMipmaps |
| int | m_uFlags |
| PixelFormat | m_eFormat |
| uchar | m_ucPixelSize |
| uchar * | m_pBuffer |
| bool | m_bAutoDelete |
Definition at line 56 of file OgreImage.h.
| typedef Ogre::Box Ogre::Image::Box |
Definition at line 59 of file OgreImage.h.
| typedef Ogre::Rect Ogre::Image::Rect |
Definition at line 60 of file OgreImage.h.
| enum Ogre::Image::Filter |
Definition at line 374 of file OgreImage.h.
| Ogre::Image::Image | ( | ) |
Standard constructor.
| Ogre::Image::Image | ( | const Image & | img | ) |
Copy-constructor - copies all the data from the target image.
| virtual Ogre::Image::~Image | ( | ) | [virtual] |
Standard destructor.
Assignment operator - copies all the data from the target image.
| Image& Ogre::Image::flipAroundY | ( | ) |
Flips (mirrors) the image around the Y-axis.
originalimg
00000000000
00000000000
00000000000
00000000000
00000000000
------------> flip axis
00000000000
00000000000
00000000000
00000000000
00000000000
originalimg
| Image& Ogre::Image::flipAroundX | ( | ) |
Flips (mirrors) the image around the X-axis.
flip axis
|
originalimg|gmilanigiro
00000000000|00000000000
00000000000|00000000000
00000000000|00000000000
00000000000|00000000000
00000000000|00000000000
| Image& Ogre::Image::loadDynamicImage | ( | uchar * | pData, | |
| size_t | uWidth, | |||
| size_t | uHeight, | |||
| size_t | depth, | |||
| PixelFormat | eFormat, | |||
| bool | autoDelete = false, |
|||
| size_t | numFaces = 1, |
|||
| size_t | numMipMaps = 0 | |||
| ) |
Stores a pointer to raw data in memory.
The pixel format has to be specified.
| The | data pointer | |
| Width | of image | |
| Height | of image | |
| Image | Depth (in 3d images, numbers of layers, otherwhise 1) | |
| Pixel | Format | |
| if | memory associated with this buffer is to be destroyed with the Image object. | |
| the | number of faces the image data has inside (6 for cubemaps, 1 otherwise) | |
| the | number of mipmaps the image data has inside |
| Image& Ogre::Image::loadDynamicImage | ( | uchar * | pData, | |
| size_t | uWidth, | |||
| size_t | uHeight, | |||
| PixelFormat | eFormat | |||
| ) |
Stores a pointer to raw data in memory.
The pixel format has to be specified.
| The | data pointer | |
| Width | of image | |
| Height | of image | |
| Pixel | Format |
Definition at line 197 of file OgreImage.h.
| Image& Ogre::Image::loadRawData | ( | DataStreamPtr & | stream, | |
| size_t | uWidth, | |||
| size_t | uHeight, | |||
| size_t | uDepth, | |||
| PixelFormat | eFormat, | |||
| size_t | numFaces = 1, |
|||
| size_t | numMipMaps = 0 | |||
| ) |
Loads raw data from a stream.
See the function loadDynamicImage for a description of the parameters.
| Image& Ogre::Image::loadRawData | ( | DataStreamPtr & | stream, | |
| size_t | uWidth, | |||
| size_t | uHeight, | |||
| PixelFormat | eFormat | |||
| ) |
Loads raw data from a stream.
The pixel format has to be specified.
Definition at line 245 of file OgreImage.h.
Loads an image file.
| strFileName | Name of a file file to load. | |
| groupName | Name of the resource group to search for the image |
| Image& Ogre::Image::load | ( | DataStreamPtr & | stream, | |
| const String & | type | |||
| ) |
Loads an image file from a stream.
| stream | The source data. | |
| type | The type of the image. Used to decide what decompression codec to use. |
| void Ogre::Image::save | ( | const String & | filename | ) |
Save the image as a file.
| uchar* Ogre::Image::getData | ( | void | ) |
Returns a pointer to the internal image buffer.
| const uchar* Ogre::Image::getData | ( | ) | const |
Returns a const pointer to the internal image buffer.
| size_t Ogre::Image::getSize | ( | ) | const |
Returns the size of the data buffer.
| size_t Ogre::Image::getNumMipmaps | ( | ) | const |
Returns the number of mipmaps contained in the image.
| bool Ogre::Image::hasFlag | ( | const ImageFlags | imgFlag | ) | const |
Returns true if the image has the appropriate flag set.
| size_t Ogre::Image::getWidth | ( | void | ) | const |
Gets the width of the image in pixels.
| size_t Ogre::Image::getHeight | ( | void | ) | const |
Gets the height of the image in pixels.
| size_t Ogre::Image::getDepth | ( | void | ) | const |
Gets the depth of the image.
| size_t Ogre::Image::getNumFaces | ( | void | ) | const |
Get the numer of faces of the image.
This is usually 6 for a cubemap, and 1 for a normal image.
| size_t Ogre::Image::getRowSpan | ( | void | ) | const |
Gets the physical width in bytes of each row of pixels.
| PixelFormat Ogre::Image::getFormat | ( | ) | const |
Returns the image format.
| uchar Ogre::Image::getBPP | ( | ) | const |
Returns the number of bits per pixel.
| bool Ogre::Image::getHasAlpha | ( | ) | const |
Returns true if the image has an alpha component.
Does gamma adjustment.
| ColourValue Ogre::Image::getColourAt | ( | int | x, | |
| int | y, | |||
| int | z | |||
| ) |
Get colour value from a certain location in the image.
The z coordinate is only valid for cubemaps and volume textures. This uses the first (largest) mipmap.
| PixelBox Ogre::Image::getPixelBox | ( | size_t | face = 0, |
|
| size_t | mipmap = 0 | |||
| ) | const |
Get a PixelBox encapsulating the image data of a mipmap.
| static void Ogre::Image::scale | ( | const PixelBox & | src, | |
| const PixelBox & | dst, | |||
| Filter | filter = FILTER_BILINEAR | |||
| ) | [static] |
Scale a 1D, 2D or 3D image volume.
| src | PixelBox containing the source pointer, dimensions and format | |
| dst | PixelBox containing the destination pointer, dimensions and format | |
| filter | Which filter to use |
Resize a 2D image, applying the appropriate filter.
| static size_t Ogre::Image::calculateSize | ( | size_t | mipmaps, | |
| size_t | faces, | |||
| size_t | width, | |||
| size_t | height, | |||
| size_t | depth, | |||
| PixelFormat | format | |||
| ) | [static] |
size_t Ogre::Image::m_uWidth [private] |
Definition at line 399 of file OgreImage.h.
size_t Ogre::Image::m_uHeight [private] |
Definition at line 401 of file OgreImage.h.
size_t Ogre::Image::m_uDepth [private] |
Definition at line 403 of file OgreImage.h.
size_t Ogre::Image::m_uSize [private] |
Definition at line 405 of file OgreImage.h.
size_t Ogre::Image::m_uNumMipmaps [private] |
Definition at line 407 of file OgreImage.h.
int Ogre::Image::m_uFlags [private] |
Definition at line 409 of file OgreImage.h.
PixelFormat Ogre::Image::m_eFormat [private] |
Definition at line 412 of file OgreImage.h.
uchar Ogre::Image::m_ucPixelSize [private] |
Definition at line 415 of file OgreImage.h.
uchar* Ogre::Image::m_pBuffer [private] |
Definition at line 416 of file OgreImage.h.
bool Ogre::Image::m_bAutoDelete [private] |
Definition at line 419 of file OgreImage.h.
Copyright © 2000-2005 by The OGRE Team

This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.
Last modified Mon Jun 16 12:50:04 2008