#include <ZE_ZImage.h>
Public Member Functions | |
| ZImage () | |
| Default Constructor. | |
| ZImage (const ZImage &rhs) | |
| Copy constructor for ZImage. | |
| ZImage (std::string filename) | |
| Constructor to Construct from File. | |
| ZImage (SDL_Surface *surface) | |
| Constructor to Construct from SDL_Surface*. | |
| ZImage (SDL_Surface *img, Sint16 x, Sint16 y, Sint16 w, Sint16 h) | |
| Constructor to Construct from part of an SDL_Surface*. | |
| ZImage (const ZImage &img, Sint16 x, Sint16 y, Sint16 w, Sint16 h) | |
| Constructor to Construct from part of another ZImage. | |
| virtual | ~ZImage () |
| Destructor, frees memory. | |
| void | Open (std::string filename) |
| Opens a file. | |
| void | OpenFromZip (std::string zipname, std::string filename) |
| Opens an image file from within a zip archive. | |
| void | OpenFromImage (SDL_Surface *img, Sint16 x, Sint16 y, Sint16 w, Sint16 h) |
| Cuts part of an existing image to create a new image. | |
| void | OpenFromImage (const ZImage &img, Sint16 x, Sint16 y, Sint16 w, Sint16 h) |
| Cuts part of an existing ZImage to create a new image. | |
| void | Attach (SDL_Surface *surface) |
| Attach an existing surface to class. | |
| void | Reload () |
| Reattach a preloaded texture that has been lost. | |
| void | Release () |
| Releases image. | |
| void | SetAlpha (Uint8 alpha) |
| Set alpha value (translucency) of image. | |
| void | SetColorKey (Uint8 red, Uint8 green, Uint8 blue) |
| Set Color Key (transparent color) of image. | |
| void | Draw (int x, int y) const |
| Draw Image to Screen. | |
| void | DrawClipped (int x, int y, ZRect clipRect) const |
| Draw Image, clipped within a given rectangle to the screen. | |
| void | Draw (float x, float y) const |
| Draw Image to Screen. | |
| void | Draw (float x, float y, Uint8 vc[]) const |
| Draw Image to screen with shaded/colored vertices. | |
| void | DrawRotated (int x, int y, float angle) const |
| Draw Image rotated to screen. | |
| void | DrawRotated (float x, float y, float angle) const |
| Draw Image rotated to screen. | |
| void | DrawRotated (float x, float y, float angle, Uint8 vc[]) const |
| Draw Image rotated to screen with shaded/colored vertices. | |
| void | DrawClipped (float x, float y, ZRect clipRect) const |
| Draw Image, clipped within a given rectangle to the screen. | |
| void | DrawClipped (float x, float y, ZRect clipRect, Uint8 vc[]) const |
| Draw Image, clipped within a given rectangle to the screen with colored/shaded vertices. | |
| void | Flip (bool horizontal, bool vertical) |
| Flip image over one or both axes. | |
| void | Stretch (float xFactor, float yFactor) |
| Stretch the image by a certain X and Y factor. | |
| void | Resize (float width, float height) |
| Resizes an image, stretching to new size. | |
| void | Bind () const |
| OpenGL related bind call. | |
| bool | IsLoaded () const |
| Check if file is loaded. | |
| SDL_Surface * | Surface () const |
| Get SDL_Surface. Get SDL_Surface pointer to actual image data. | |
| float | Width () const |
| Get Width. | |
| float | Height () const |
| Get Height. | |
| Uint8 | Alpha () const |
| Get Alpha component. | |
Protected Attributes | |
| ZEngine * | rEngine |
| Pointer to ZEngine Object. | |
| SDL_Surface * | rImage |
| Stored texture. | |
| Uint8 | rAlpha |
| Stored alpha value for drawing texture. | |
| GLfloat | rTexMinX |
| Texture lower X, used internally for flip. | |
| GLfloat | rTexMinY |
| Texture lower Y, used internally for flip. | |
| GLfloat | rTexMaxX |
| Texture X width ratio, used internally by OpenGL. | |
| GLfloat | rTexMaxY |
| Texture Y width ratio, used internally by OpenGL. | |
| unsigned int | rTexID |
| Texture ID for OpenGL. | |
| GLfloat | rWidth |
| Current draw width of Texture. | |
| GLfloat | rHeight |
| Current draw height of Texture. | |
|
|
Default Constructor, initializes variables. |
|
|
Creates one ZImage using another.
|
|
|
Constructor is same as calling ZImage::Open() on passed filename.
|
|
|
Constructor is same as calling ZImage::Attach() on passed SDL_Surface*.
|
|
||||||||||||||||||||||||
|
Constructor is same as calling ZImage::OpenFromImage with an SDL_Surface*.
|
|
||||||||||||||||||||||||
|
Constructor is same as calling ZImage::OpenFromImage with a ZImage.
|
|
|
Destructor calls ZImage::Release(). |
|
|
Open an image file using ZEngine.
|
|
||||||||||||
|
Open an image file from within a zip archive using zlib and SDL_RWops.
|
|
||||||||||||||||||||||||
|
Cut part of an SDL_Surface to create a new Image.
|
|
||||||||||||||||||||||||
|
Cut part of another ZImage to create a new Image.
|
|
|
Attach a pointer to instance of ZImage. (NOTE: Should not be used on a surface that is owned elsewhere.)
|
|
|
Attach loaded textures which have been lost due to loss of focus, should be called when ZEngine::ImagesNeedReload is true. |
|
|
Frees memory for the image. (Called by destructor). |
|
|
Set translucency value 0-255 (0 is transparent, 255 = opaque).
|
|
||||||||||||||||
|
Set color which will not be drawn in image.
|
|
||||||||||||
|
Draw Image to screen at specified location.
|
|
||||||||||||||||
|
Image is drawn such that only portions of image which fall within a certain area appear. This clipping rectangle can be used for areas of the screen which are separated from others such as a splitscreen mode in a game or a map on a HUD.
|
|
||||||||||||
|
Draw Image to screen at specified location.
|
|
||||||||||||||||
|
Draw Image to screen using OpenGL to shade and color vertices.
|
|
||||||||||||||||
|
Image is rotated about it's own center by specified angle, then drawn to screen.
|
|
||||||||||||||||
|
Image is rotated about it's own center by specified angle, then drawn to screen.
|
|
||||||||||||||||||||
|
Image is rotated about it's own center by specified angle, then drawn to screen with shaded or colored vertices.
|
|
||||||||||||||||
|
Image is drawn such that only portions of image which fall within a certain area appear. This clipping rectangle can be used for areas of the screen which are separated from others such as a splitscreen mode in a game or a map on a HUD.
|
|
||||||||||||||||||||
|
Image is drawn such that only portions of image which fall within a certain area appear. This clipping rectangle can be used for areas of the screen which are separated from others such as a splitscreen mode in a game or a map on a HUD. Image is drawn with colored/shaded vertices.
|
|
||||||||||||
|
Flip image vertical and/or horizontal.
|
|
||||||||||||
|
Stretch image using a factor to multiply width and height by.
|
|
||||||||||||
|
Stretch image to new width and height.
|
|
|
OpenGL related bind call, only available in case you want to bind image in 3D. Draw uses this but the average user should never need to call this. |
|
|
Check if surface is a valid GL texture. (does not detect surface loss)
|
|
|
|
|
|
Get Current Width of Image.
|
|
|
Get Current Height of Image.
|
|
|
Get current alpha value of image.
|
1.3