41 #ifndef _graphicsimage_cpp
42 #define _graphicsimage_cpp
44 #include "Graphics/image.h"
45 #include "Graphics/graphicsutilities.h"
47 #include "stringtool.h"
49 #include "Internal/iostreamwrapper.h.cpp"
80 this->
Load(ResourceName,ResourceGroup);
86 this->
Initialize(Data,Width,Height,Format,AutoDelete,NumFaces,NumMipMaps);
92 this->
Initialize(Data,Width,Height,Depth,Format,AutoDelete,NumFaces,NumMipMaps);
157 this->
IID->
GraphicsImage.loadDynamicImage(Data,Width,Height,1,static_cast<Ogre::PixelFormat>(Format),AutoDelete,NumFaces,NumMipMaps);
163 this->
IID->
GraphicsImage.loadDynamicImage(Data,Width,Height,Depth,static_cast<Ogre::PixelFormat>(Format),AutoDelete,NumFaces,NumMipMaps);
178 std::ifstream ImageFileStream;
179 ImageFileStream.open(FilePathAndName.c_str(),std::ifstream::in | std::ifstream::binary);
180 if( ImageFileStream.fail() ) {
183 return this->
Load(&ImageFileStream,FilePathAndName.substr(FilePathAndName.find_last_of(
'.')+1));
218 Ogre::MemoryDataStream* RawOgreStream =
static_cast<Ogre::MemoryDataStream*
>( OgreStream.getPointer() );
219 Stream->write(reinterpret_cast<char*>(RawOgreStream->getPtr()),RawOgreStream->size());
Graphics::ImageFileFormat ConvertImageFileExtension(String Extension)
Converts a String file extension to an ImageFileFormat enum value. an invalid extension string is pro...
bool Boole
Generally acts a single bit, true or false.
Whole GetRowSpan() const
Gets the size of a row of pixels in this image.
Whole GetNumFaces() const
Gets the number of faces for thie image.
UInt8 * GetImageData()
Gets the raw image data.
ColourValue GetColourAt(const Whole X, const Whole Y, const Whole Z) const
Gets the colour of an individual pixel in this image.
#define MEZZ_EXCEPTION(num, desc)
An easy way to throw exceptions with rich information.
Thrown when we just have not coded a thing yet, but we knew what the API should look like...
Image & Save(const String &FileName, const String &GroupName)
Writes this image to the asset group.
Ogre::Image & _GetInternalImage() const
Gets the internal Image this class is based on.
Image & Initialize(UInt8 *Data, const UInt32 Width, const UInt32 Height, const Graphics::PixelFormat Format, const Boole AutoDelete=false, const Whole NumFaces=1, const UInt8 NumMipMaps=0)
Loads an image from a buffer.
UInt32 GetHeight() const
Gets the height of this image in pixels.
uint8_t UInt8
An 8-bit unsigned integer.
This is a simple class for holding 4 reals representing the colour any give object or lightsource can...
UInt32 GetWidth() const
Gets the width of this image in pixels.
~Image()
Class Destructor.
This class is used to store the internal structures needed by the Image class.
Image & Load(const String &ResourceName, const String &ResourceGroup)
Loads an image.
uint32_t UInt32
An 32-bit unsigned integer.
ProcessDepth Depth
The current process depth as interpretted by Main.
Thrown when there was an issue with IO but very little was known about it.
This class represents an image loaded into system memory.
PixelFormat
This is used to describe how bits are arraged for each pixel in an image.
UInt8 GetBitsPerPixel() const
Gets the number of bits allocated for each pixel in this image.
InternalImageData * IID
A pointer to the internal implementation of the Image.
Image & FlipAroundXAxis()
Reverses the order of each pixel on the X axis.
Image & FlipAroundYAxis()
Reverses the order of each pixel on the Y axis.
Image()
Blank, no-init constructor.
Ogre::Image GraphicsImage
The internal representation of the Image.
UInt32 GetDepth() const
Gets the depth of this image in pixels.
The bulk of the engine components go in this namspace.
unsigned long Whole
Whole is an unsigned integer, it will be at least 32bits in size.
ImageFileFormat
This enum describes the various file formats for images supported by the Mezzanine.
Graphics::PixelFormat GetFormat() const
Gets the pixel format of this image.
void SetColourAt(const Whole X, const Whole Y, const Whole Z, const ColourValue &Colour)
Sets the colour of an individual pixel in this image.
CountedPtr< DataStream > DataStreamPtr
This is a convenience type for a data stream in a counted pointer.
Ogre::ColourValue GetOgreColourValue() const
Creates and returns an Ogre ColourValue class with values equal to this one.
Whole GetSize() const
Gets the size of this image.
std::string String
A datatype used to a series of characters.
Whole GetNumMipMaps() const
Gets the number of MipMaps that exist for this image.