|
MTek-GDL 0.100.4-muffintrap
|
Image handling class. More...
#include <mgdl-wii-image.h>

Public Member Functions | |
| ImageWii () | |
| Constructor. | |
| virtual | ~ImageWii () |
| Deconstructor. | |
| bool | Create (short xRes, short yRes, u_int filterMode, u_int format=RGBA8) |
| Creates an image. | |
| bool | CreateMipmapped (short xSize, short ySize, u_int minFilt, u_int magFilt, short maxMipmaps, u_int format=gdl::RGBA8) |
| Creates a mipmapped image. | |
| bool | LoadImage (const char *fileName, u_int filterMode, u_int format=RGBA8) |
| Loads an image. | |
| bool | LoadImageMipmapped (const char *fileName, u_int minFilt, u_int magFilt, short maxMipmaps, u_int format=gdl::RGBA8) |
| Loads an image with mipmap generation. | |
| bool | LoadImageMem (void *imagePtr, u_int filterMode, u_int format) |
| Loads an image from a memory block. | |
| bool | LoadImageBuffer (const void *buffer, size_t size, u_int filterMode, u_int format) |
| Loads an image from memory. | |
| short | Xsize () |
| Returns the X size of the image in pixels. | |
| short | Ysize () |
| Returns the Y size of the image in pixels. | |
| void | Put (short x, short y, Color4f *col, short cx=0, short cy=0, float scale=1.f, float angle=0.f) |
| Draws the image onto the screen with more options. | |
| void | PutS (short x1, short y1, short x2, short y2, Color4f *col) |
| Draws an image as a stretchable rectangle. | |
Data Fields | |
| gdl::Texture | Texture |
| gdl::Texture object containing the actual texture data of the image. | |
Image handling class.
This class is used for loading and drawing images with ease similar to SFML's sf::Image class. It also contains a gdl::Texture object for storing the actual image data and can be used for custom graphics routines.
| bool gdl::ImageWii::Create | ( | short | xRes, |
| short | yRes, | ||
| u_int | filterMode, | ||
| u_int | format = RGBA8 |
||
| ) |
Creates an image.
This function allocates texture and vertex array buffers for handling and drawing an image. The class contains a gdl::Texture object for storing the actual image data and you can use it to alter the texture data of the image.
| [in] | xRes | X size of texture in pixels. |
| [in] | yRes | Y size of texture in pixels. |
| [in] | filterMode | Image filter mode (see gdl::TextureFilterModes). |
| [in] | format | Texture format (see gdl::TextureFormatModes). |
| bool gdl::ImageWii::CreateMipmapped | ( | short | xSize, |
| short | ySize, | ||
| u_int | minFilt, | ||
| u_int | magFilt, | ||
| short | maxMipmaps, | ||
| u_int | format = gdl::RGBA8 |
||
| ) |
Creates a mipmapped image.
Similar to gdl::Image::Create() but it creates a mipmapped image which improves rendering quality (and in some cases, performance) when the image gets downscaled.
| [in] | xSize | X size of texture in pixels. |
| [in] | ySize | Y size of texture in pixels. |
| [in] | minFilt | Far filter mode (see gdl::TextureFilterModes). |
| [in] | magFilt | Near filter mode (see gdl::TextureFilterModes). |
| [in] | maxMipmaps | Maximum number of mipmap levels to generate. |
| [in] | format | Texture format (see gdl::TextureFormatModes). |
| bool gdl::ImageWii::LoadImage | ( | const char * | fileName, |
| u_int | filterMode, | ||
| u_int | format = RGBA8 |
||
| ) |
Loads an image.
Loads an image file, internally creates texture and image buffers and then converts the image data into a texture. This version of the library only supports PNG image files that are in grayscale, 8-bit palletized, RGB, and RGBA color formats as well as TPL texture files containing a single texture. There will be no support for interlaced PNG images.
It is advisable that you use an appropriate texture format if you wish to save as much MEM1 memory as possible such as using gdl::RGB5A3 for images that have simple transparency (like pixel art sprites) and gdl::RGB565 for images that have no alpha channel. Using such texture formats may result in slight color quality loss however so use it in situations where color definition is not so important.
| [in] | fileName | File name of image file to load. |
| [in] | filterMode | Image filter mode (see gdl::TextureFilterModes). |
| [in] | format | Texture format (see gdl::TextureFormatModes). |
| bool gdl::ImageWii::LoadImageBuffer | ( | const void * | buffer, |
| size_t | size, | ||
| u_int | filterMode, | ||
| u_int | format | ||
| ) |
Loads an image from memory.
Similar to gdl::LoadImage() but this function loads an image file from a memory address. This is most useful when making standalone DOL executables where image data is embedded into the program.
| [in] | buffer | Pointer to a memory block containing an image file. |
| [in] | size | Size of the buffer in bytes |
| [in] | filterMode | Filtering mode (see gdl::TextureFilterModes). |
| [in] | format | Texture format (see gdl::TextureFormatModes). |
| bool gdl::ImageWii::LoadImageMem | ( | void * | imagePtr, |
| u_int | filterMode, | ||
| u_int | format | ||
| ) |
Loads an image from a memory block.
Similar to gdl::LoadImage() but this function loads an image file from a memory address. This is most useful when making standalone DOL executables where image data is embedded into the program.
| [in] | imagePtr | Pointer to a memory block containing an image file. |
| [in] | filterMode | Filtering mode (see gdl::TextureFilterModes). |
| [in] | format | Texture format (see gdl::TextureFormatModes). |
| bool gdl::ImageWii::LoadImageMipmapped | ( | const char * | fileName, |
| u_int | minFilt, | ||
| u_int | magFilt, | ||
| short | maxMipmaps, | ||
| u_int | format = gdl::RGBA8 |
||
| ) |
Loads an image with mipmap generation.
Similar to gdl::Image::LoadImage() but it also generates mipmaps of the image.
With mipmapped images, aliasing issues will be eliminated when you scale down an image from its original resolution. Since mipmapped images take up a bit more memory than a non-mipmapped image, use it wisely for graphics that scale down tremendously or textures of environments.
| [in] | fileName | File name of image to load. |
| [in] | minFilt | Filter mode when image is drawn smaller than original size (see gdl::TextureFilterModes). |
| [in] | magFilt | Filter mode when image is drawn bigger than original size (see gdl::TextureFilterModes). |
| [in] | maxMipmaps | The maximum number of mipmaps to generate (9 is the maximum value). |
| [in] | format | Texture format (see gdl::TextureFormatModes). |
| void gdl::ImageWii::Put | ( | short | x, |
| short | y, | ||
| Color4f * | col, | ||
| short | cx = 0, |
||
| short | cy = 0, |
||
| float | scale = 1.f, |
||
| float | angle = 0.f |
||
| ) |
Draws the image onto the screen with more options.
Draws the image with color translation and optional rotation and scaling. This function must only be called between a gdl::PrepDisplay() and gdl::Display() pair and if no image is loaded in this class, nothing is drawn.
| [in] | x | X coordinate of image. |
| [in] | y | Y coordinate of image. |
| [in] | col | Color of image (use gdl::Color::White or full white or RGBA() for normal colors). |
| [in] | cx | X offset of image pivot (you can also use one of the gdl::AlignmentModes). |
| [in] | cy | Y offset of image pivot (you can also use one of the gdl::AlignmentModes). |
| [in] | scale | Scale of image (1.0f is original size). |
| [in] | angle | Rotation angle in degrees. |
Draws an image as a stretchable rectangle.
Draws the image as a fully stretchable rectangle with optional color translation. This function must only be called between a gdl::PrepDisplay() and gdl::Display() pair and if no image is loaded in this class, nothing is drawn.
| [in] | x1 | Upper-left X coordinate of image. |
| [in] | y1 | Upper-left Y coordinate of image. |
| [in] | x2 | Lower-right X coordinate of image. |
| [in] | y2 | Lower-right Y coordinate of image. |
| [in] | col | Color of image (use gdl::Color::White or full white with RGBA() for normal colors). |
| short gdl::ImageWii::Xsize | ( | ) |
Returns the X size of the image in pixels.
| short gdl::ImageWii::Ysize | ( | ) |
Returns the Y size of the image in pixels.