An image surface.
Inheritance:
Public Fields
-
SigC::Signal1<void, TImage*> OnChange
- Signal called when image is modified
Public Methods
-
TImage()
- Constructs an un-initialized image.
-
TImage(int width, int height, TPixelFormatType pixel_format = TPixelFormat::DISPLAY, Uint8 image_type = SYSTEM_MEMORY)
- Construct an image with the given attributes.
-
TImage(int width, int height, Uint8 bpp, Uint8 image_type = SYSTEM_MEMORY)
- Construct an image with the given attributes.
-
TImage(const char* filename, char* type = "AUTODETECT")
- Contruct an image loaded from the given file.
-
TImage(const TImage& V)
- Contruct an image as a copy of an other image.
-
TImage& operator = (const TImage& V)
- Assign this image to the data of another image.
-
~TImage()
- destructor
-
void Create(int width, int height, TPixelFormatType pixel_format = TPixelFormat::DISPLAY, Uint8 image_type = SYSTEM_MEMORY)
- Initialize this image with the given attributes.
-
void Create(int width, int height, Uint8 bpp, Uint8 image_flags = SYSTEM_MEMORY)
- Initialize this image with the given attributes.
-
TImage Convert(const TPixelFormat &pixel_format, Uint8 image_type)
- Convert an image to the given format
-
TImage Convert(const TPixelFormat &pixel_format)
- Convert an image to the given format
-
void Load(const char* Filename, char* type = "AUTODETECT")
- Load the image data from a file.
-
void Save(const char* Filename, char* type)
- Save the image data to a file.
-
void OnWrite()
- Call this function to perform "copy on write"
-
void Resize(int width, int height)
- Resizes the image to the given dimensions
-
TSubSurface* CreateSubSurface(int X, int Y, int Width, int Height, bool Buffered)
- Creates a sub-surface with the given dimensions
-
void Fill(const TColor& Color)
- Clears the image with the given color
-
TCanvas* GetCanvas()
- Returns a TCanvas object for drawing to this image.
-
void SetSurface(SDL_Surface* sdl_surface, bool owned = true)
- Sets this image to an sdl_surface.
-
SDL_Surface* GetSurface()
- Returns the SDL_Surface object underlying this image
Documentation
An image surface. TImage is a surface that you can construct to any
artibrary size, load files, save files, and draw to. TImage objects
are copied on write. This means that when one image is assigned to
another, its data is shared until one of the images is actually written
to.
- TImage()
- Constructs an un-initialized image. Use Create or Load to make
a valid image.
- TImage(int width, int height, TPixelFormatType pixel_format = TPixelFormat::DISPLAY, Uint8 image_type = SYSTEM_MEMORY)
- Construct an image with the given attributes. Uses the same
arguments as Create.
- TImage(int width, int height, Uint8 bpp, Uint8 image_type = SYSTEM_MEMORY)
- Construct an image with the given attributes. Uses the same
arguments as Create.
- TImage(const char* filename, char* type = "AUTODETECT")
- Contruct an image loaded from the given file. Uses the same
arguments as Load.
- TImage(const TImage& V)
- Contruct an image as a copy of an other image. The image is not actually
copied until the copy is written to (called "copy on write").
- TImage& operator = (const TImage& V)
- Assign this image to the data of another image. The image is not actually
copied until the copy is written to (called "copy on write").
- ~TImage()
- destructor
- SigC::Signal1<void, TImage*> OnChange
- Signal called when image is modified
- void Create(int width, int height, TPixelFormatType pixel_format = TPixelFormat::DISPLAY, Uint8 image_type = SYSTEM_MEMORY)
- Initialize this image with the given attributes.
- Parameters:
- width - The desired width.
height - The desired height.
pixel_format - The desired TPixelFormatType for this image.
image_type - Controls the type of image that is created.
- void Create(int width, int height, Uint8 bpp, Uint8 image_flags = SYSTEM_MEMORY)
- Initialize this image with the given attributes.
- Parameters:
- width - The desired width.
height - The desired height.
pixel_format - The desired TPixelFormatType for this image.
image_type - Controls the type of image that is created.
- TImage Convert(const TPixelFormat &pixel_format, Uint8 image_type)
- Convert an image to the given format
- TImage Convert(const TPixelFormat &pixel_format)
- Convert an image to the given format
- void Load(const char* Filename, char* type = "AUTODETECT")
- Load the image data from a file. The image loader uses a plugin system,
so make sure that you have the appropriate plugins loaded. You can
specify an image type string as the type argument as one of the following:
- AUTODETECT - Check the given file an use the appropriate
plugin to load it.
- PNG - Load PNG images.
- BMP - Load BMP images.
- TIF - Load tiff images.
- JGP - Load jpeg images.
- PCX - Load PCX images.
- void Save(const char* Filename, char* type)
- Save the image data to a file. The image loaded uses a plugin system,
so make sure that you have the approprate plugins loaded. Currently,
the only valid image type string is "BMP".
- void OnWrite()
- Call this function to perform "copy on write"
- void Resize(int width, int height)
- Resizes the image to the given dimensions
- TSubSurface* CreateSubSurface(int X, int Y, int Width, int Height, bool Buffered)
- Creates a sub-surface with the given dimensions
- void Fill(const TColor& Color)
- Clears the image with the given color
- TCanvas* GetCanvas()
- Returns a TCanvas object for drawing to this image. This function is
garenteed to return a valid pointer.
- void SetSurface(SDL_Surface* sdl_surface, bool owned = true)
- Sets this image to an sdl_surface. The reference to previous surface is
first cleared.
- SDL_Surface* GetSurface()
- Returns the SDL_Surface object underlying this image
- This class has no child classes.
Alphabetic index HTML hierarchy of classes or Java
This page was generated with the help of DOC++.