Go to the documentation of this file.
168 size_t numFaces = 1,
uint8 numMipMaps = 0);
208 return loadDynamicImage(data, width, height, 1, format);
233 size_t numFaces = 1,
size_t numMipMaps = 0);
258 return loadRawData(stream, width, height, 1, format);
ColourValue getColourAt(size_t x, size_t y, size_t z) const
Get colour value from a certain location in the image.
static size_t calculateSize(size_t mipmaps, size_t faces, uint32 width, uint32 height, uint32 depth, PixelFormat format)
Static function to calculate size in bytes from the number of mipmaps, faces and the dimensions.
PixelFormat getFormat() const
Returns the image format.
DataStreamPtr encode(const String &formatextension)
Encode the image and return a stream to the data.
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
uint32 mHeight
The height of the image in pixels.
Image()
Standard constructor.
size_t getRowSpan(void) const
Gets the physical width in bytes of each row of pixels.
Image & load(DataStreamPtr &stream, const String &type=StringUtil::BLANK)
Loads an image file from a stream.
@ PF_BYTE_RGBA
4 byte pixel format, 1 byte for red, 1 byte for green, 1 byte for blue, and one byte for alpha
Class representing an image file.
Image & loadTwoImagesAsRGBA(DataStreamPtr &rgbStream, DataStreamPtr &alphaStream, PixelFormat format=PF_BYTE_RGBA, const String &rgbType=StringUtil::BLANK, const String &alphaType=StringUtil::BLANK)
Utility method to combine 2 separate images into this one, with the first image source supplying the ...
Image & loadDynamicImage(uchar *data, uint32 width, uint32 height, uint32 depth, PixelFormat format, bool autoDelete=false, size_t numFaces=1, uint8 numMipMaps=0)
Stores a pointer to raw data in memory.
uint32 getWidth(void) const
Gets the width of the image in pixels.
Image & combineTwoImagesAsRGBA(const Image &rgb, const Image &alpha, PixelFormat format=PF_BYTE_RGBA)
Utility method to combine 2 separate images into this one, with the first image source supplying the ...
bool mAutoDelete
A bool to determine if we delete the buffer or the calling app does.
uint32 getDepth(void) const
Gets the depth of the image.
const uchar * getData() const
Returns a const pointer to the internal image buffer.
size_t mBufSize
The size of the image buffer.
PixelFormat mFormat
The pixel format of the image.
uint8 getNumMipmaps() const
Returns the number of mipmaps contained in the image.
size_t getSize() const
Returns the size of the data buffer.
uchar * getData(void)
Returns a pointer to the internal image buffer.
void resize(ushort width, ushort height, Filter filter=FILTER_BILINEAR)
Resize a 2D image, applying the appropriate filter.
void setColourAt(ColourValue const &cv, size_t x, size_t y, size_t z)
Set colour value at a certain location in the image.
static const String BLANK
Constant blank string, useful for returning by ref where local does not exist.
static void applyGamma(uchar *buffer, Real gamma, size_t size, uchar bpp)
Does gamma adjustment.
PixelFormat
The pixel format used for images, textures, and render surfaces.
Image(const Image &img)
Copy-constructor - copies all the data from the target image.
uint32 mWidth
The width of the image in pixels.
static String getFileExtFromMagic(DataStreamPtr stream)
Static function to get an image type string from a stream via magic numbers.
vector< const Image * >::type ConstImagePtrList
unsigned char uchar
In order to avoid finger-aches :)
bool getHasAlpha() const
Returns true if the image has an alpha component.
uchar getBPP() const
Returns the number of bits per pixel.
void save(const String &filename)
Save the image as a file.
Structure used to define a box in a 3-D integer space.
Image & loadRawData(DataStreamPtr &stream, uint32 width, uint32 height, uint32 depth, PixelFormat format, size_t numFaces=1, size_t numMipMaps=0)
Loads raw data from a stream.
static void scale(const PixelBox &src, const PixelBox &dst, Filter filter=FILTER_BILINEAR)
Scale a 1D, 2D or 3D image volume.
Image & loadDynamicImage(uchar *data, uint32 width, uint32 height, PixelFormat format)
Stores a pointer to raw data in memory.
virtual ~Image()
Standard destructor.
vector< Image * >::type ImagePtrList
Class representing colour.
A primitive describing a volume (3D), image (2D) or line (1D) of pixels in memory.
Image & loadTwoImagesAsRGBA(const String &rgbFilename, const String &alphaFilename, const String &groupName, PixelFormat format=PF_BYTE_RGBA)
Utility method to combine 2 separate images into this one, with the first image source supplying the ...
uint8 mNumMipmaps
The number of mipmaps the image contains.
Image & load(const String &filename, const String &groupName)
Loads an image file.
Image & flipAroundY()
Flips (mirrors) the image around the Y-axis.
float Real
Software floating point type.
PixelBox getPixelBox(size_t face=0, size_t mipmap=0) const
Get a PixelBox encapsulating the image data of a mipmap.
bool hasFlag(const ImageFlags imgFlag) const
Returns true if the image has the appropriate flag set.
void freeMemory()
Delete all the memory held by this image, if owned by this image (not dynamic)
uchar mPixelSize
The number of bytes per pixel.
size_t getNumFaces(void) const
Get the number of faces of the image.
uint32 getHeight(void) const
Gets the height of the image in pixels.
int mFlags
Image specific flags.
uint32 mDepth
The depth of the image.
Image & loadRawData(DataStreamPtr &stream, uint32 width, uint32 height, PixelFormat format)
Loads raw data from a stream.
Image & flipAroundX()
Flips (mirrors) the image around the X-axis.
Copyright © 2012 Torus Knot Software Ltd

This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.