MTek-GDL 0.100.4-muffintrap
Loading...
Searching...
No Matches
mgdl-wii-image.h
1
5#ifndef _GDL_WII_IMAGE_H
6#define _GDL_WII_IMAGE_H
7
8#include <png.h>
9
10#include <mgdl/mgdl-color.h>
11#include <mgdl/wii/mgdl-wii-texture.h>
12#include <mgdl/wii/mgdl-wii-types.h>
13
14
15namespace gdl {
16
17
24
36void SaveScreen(const char *fileName);
37
38
40
47class ImageWii {
48
49 short xSize,ySize;
50 float u,v;
51 void *vList;
52 void *tList;
53
54 void _PrepareImage(short xRes, short yRes);
55 bool _ProcessImage(png_structp png_ptr, u_int minFilt, u_int magFilt, u_int format, bool mipmapped, short maxMips);
56
57public:
58
59
62
63
65 ImageWii();
66
67
69 virtual ~ImageWii();
70
71
73
90 bool Create(short xRes, short yRes, u_int filterMode, u_int format = RGBA8);
91
92
94
113 bool CreateMipmapped(short xSize, short ySize, u_int minFilt, u_int magFilt, short maxMipmaps, u_int format = gdl::RGBA8);
114
115
117
139 bool LoadImage(const char *fileName, u_int filterMode, u_int format = RGBA8);
140
141
143
163 bool LoadImageMipmapped(const char* fileName, u_int minFilt, u_int magFilt, short maxMipmaps, u_int format = gdl::RGBA8);
164
165
167
180 bool LoadImageMem(void *imagePtr, u_int filterMode, u_int format);
181
182 /* Changed: 13.4.2024
183 Header and documentation added for LoadImageBuffer by muffintrap
184 */
186
200 bool LoadImageBuffer(const void *buffer, size_t size, u_int filterMode, u_int format);
201
203
206 short Xsize();
207
208
210
213 short Ysize();
214
215
217
230 void Put(short x, short y, Color4f* col, short cx = 0, short cy = 0, float scale = 1.f, float angle = 0.f);
231
232
234
245 void PutS(short x1, short y1, short x2, short y2, Color4f* col);
246
247
248};
249
253}
254
255
256#endif // _GDL_WII_IMAGE_H
Image handling class.
Definition mgdl-wii-image.h:47
void PutS(short x1, short y1, short x2, short y2, Color4f *col)
Draws an image as a stretchable rectangle.
Definition wii-image.cpp:927
virtual ~ImageWii()
Deconstructor.
Definition wii-image.cpp:698
bool LoadImage(const char *fileName, u_int filterMode, u_int format=RGBA8)
Loads an image.
Definition wii-image.cpp:730
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.
Definition wii-image.cpp:920
bool LoadImageBuffer(const void *buffer, size_t size, u_int filterMode, u_int format)
Loads an image from memory.
Definition wii-image.cpp:857
bool LoadImageMem(void *imagePtr, u_int filterMode, u_int format)
Loads an image from a memory block.
Definition wii-image.cpp:834
bool Create(short xRes, short yRes, u_int filterMode, u_int format=RGBA8)
Creates an image.
Definition wii-image.cpp:708
gdl::Texture Texture
gdl::Texture object containing the actual texture data of the image.
Definition mgdl-wii-image.h:61
ImageWii()
Constructor.
Definition wii-image.cpp:689
short Ysize()
Returns the Y size of the image in pixels.
Definition wii-image.cpp:914
short Xsize()
Returns the X size of the image in pixels.
Definition wii-image.cpp:908
bool CreateMipmapped(short xSize, short ySize, u_int minFilt, u_int magFilt, short maxMipmaps, u_int format=gdl::RGBA8)
Creates a mipmapped image.
Definition wii-image.cpp:719
bool LoadImageMipmapped(const char *fileName, u_int minFilt, u_int magFilt, short maxMipmaps, u_int format=gdl::RGBA8)
Loads an image with mipmap generation.
Definition wii-image.cpp:800
Texture handling class.
Definition mgdl-wii-texture.h:58
void SaveScreen(const char *fileName)
Saves a screenshot.
Definition wii-image.cpp:937
@ RGBA8
32-bit RGBA8 pixel format (4 bytes per pixel).
Definition mgdl-wii-texture.h:38
Color struct and functions.
Library namespace.
Definition wii-globals.cpp:12
Definition mgdl-color.h:54