#include <sdlmm_basesurface.h>
Inheritance diagram for SDLmm::BaseSurface::
Public Methods | |
virtual | ~BaseSurface () |
The destructor. More... | |
SDL_Surface* | GetSurface () |
const SDL_Surface* | GetSurface () const |
bool | Lock () |
Lock the surface to allow direct access to the surface pixels. Returns true if lock succeeded, false otherwise. More... | |
void | Unlock () |
Unlock the surface. More... | |
void | SetPixel (int x, int y, Color color) |
Set the pixel to the color. More... | |
void | SetPixel1 (int x, int y, Color color) |
Set the pixel to the color. More... | |
void | SetPixel2 (int x, int y, Color color) |
Set the pixel to the color. More... | |
void | SetPixel3 (int x, int y, Color color) |
Set the pixel to the color. More... | |
void | SetPixel4 (int x, int y, Color color) |
Set the pixel to the color. More... | |
void | SetPixel (const SRect &point, Color color) |
Set the pixel to the color. More... | |
Color | GetPixel (int x, int y) const |
Get the color of the pixel. More... | |
Color | GetPixel (const SRect &point) const |
Get the color of the pixel. More... | |
bool | SetColorKey (Uint32 flag, Color key) |
Sets the color key (transparent pixel) in a blittable surface and enables or disables RLE blit acceleration. More... | |
bool | SetAlpha (Uint32 flag, Uint8 alpha) |
Adjust the alpha properties of this surface. More... | |
virtual bool | SetDisplayFormat ()=0 |
Convert the surface to the display format. More... | |
virtual bool | SetDisplayFormatAlpha ()=0 |
Convert the surface to the display format. More... | |
bool | SaveBMP (const char *file) const |
Save a BaseSurface object as a Windows bitmap file. More... | |
bool | SaveBMP (const std::string &file) const |
Save a BaseSurface object as a Windows bitmap file. More... | |
Informational methods | |
bool | valid () const |
Returns true if this surface is initialized, false otherwise. More... | |
Uint32 | flags () const |
Returns the surface flags. More... | |
const PixelFormat | GetPixelFormat () const |
Returns the pixel format. More... | |
PixelFormat | GetPixelFormat () |
int | w () const |
Returns the width of the surface. More... | |
int | h () const |
Returns the height of the surface. More... | |
Uint16 | pitch () const |
Returns the scanline length in bytes. More... | |
const SRect | clip_rect () const |
Returns the surface clip rectangle. More... | |
void* | pixels () |
Returns the pixel data, which can be used for low-level manipulation. More... | |
const void* | pixels () const |
Returns the pixel data, which can be used for low-level manipulation. More... | |
struct private_hwdata* | hwdata () const |
Returns the hardware-specific surface info. More... | |
Clipping Methods | |
void | ResetClipRect () |
Resets the clipping rectangle for the surface. More... | |
void | SetClipRect (const SDL_Rect &rect) |
Sets the clipping rectangle for the surface. More... | |
void | GetClipRect (SDL_Rect &rect) const |
Gets the clipping rectangle for the surface. More... | |
Blitting / Filling | |
int | Blit (const BaseSurface &src) |
Fast blit the entire source surface onto this surface. More... | |
int | Blit (const BaseSurface &src, SDL_Rect &dstrect) |
Fast blit the entire source surface onto this surface at the specified coordinates. More... | |
int | Blit (const BaseSurface &src, const SPoint &dstpoint, SDL_Rect &dstrect) |
Fast blit the entire source surface onto this surface at the specified coordinates. More... | |
int | Blit (const BaseSurface &src, const SPoint &dstpoint) |
Fast blit the entire source surface onto this surface at the specified coordinates. More... | |
int | Blit (const BaseSurface &src, const SDL_Rect &srcrect, SDL_Rect &dstrect) |
Fast blit the specified area part of the source surface onto this surface at the specified coordinates. More... | |
int | Blit (const BaseSurface &src, const SDL_Rect &srcrect, const SPoint &dstpoint, SDL_Rect &dstrect) |
Fast blit the specified area part of the source surface onto this surface at the specified coordinates. More... | |
int | Blit (const BaseSurface &src, const SDL_Rect &srcrect, const SPoint &dstpoint) |
Fast blit the specified area part of the source surface onto this surface at the specified coordinates. More... | |
bool | Fill (Color color) |
Fast fill the surface with the specified color. More... | |
bool | Fill (Uint8 r, Uint8 g, Uint8 b) |
Fast fill the surface with the specified color. More... | |
bool | Fill (Uint8 r, Uint8 g, Uint8 b, Uint8 a) |
Fast fill the surface with the specified color. More... | |
bool | FillRect (SDL_Rect &dstrect, Color color) |
Performs a fast fill of the given rectangle with the specified color. More... | |
bool | FillRect (SDL_Rect &dstrect, Uint8 r, Uint8 g, Uint8 b) |
Performs a fast fill of the given rectangle with the specified color. More... | |
bool | FillRect (SDL_Rect &dstrect, Uint8 r, Uint8 g, Uint8 b, Uint8 a) |
Performs a fast fill of the given rectangle with the specified color. More... | |
Protected Methods | |
virtual void | SetSurface (SDL_Surface *surface) |
BaseSurface (SDL_Surface *surface) | |
Constructor from an SDL_Surface*. More... | |
BaseSurface (const BaseSurface &other) | |
BaseSurface& | operator= (const BaseSurface &other) |
Protected Attributes | |
SDL_Surface* | me |
The actual SDL_Surface allocated for this BaseSurface. More... |
Surfaces represent areas of "graphical" memory, memory that can be drawn to. The video framebuffer is returned as a VideoSurface by SetVideoMode() and GetVideoSurface(). Ordinary (non-framebuffer surfaces) are represented by a Surface. The clipping rectangle returned by clip_rect() can be set with SetClipRect() method.
Definition at line 43 of file sdlmm_basesurface.h.
|
Constructor from an SDL_Surface*. This creates a new BaseSurface object from an existing SDL_Surface. Note that ownership of the SDL_Surface is passed on to the BaseSurface. It's very important not to free the original surface since that will cause a problem when the object is destructed (SDL_Surface storage freed twice). Use with caution. Definition at line 63 of file sdlmm_basesurface.h. |
|
Definition at line 67 of file sdlmm_basesurface.h. |
|
The destructor.
Definition at line 80 of file sdlmm_basesurface.h. |
|
Fast blit the specified area part of the source surface onto this surface at the specified coordinates. The choosen rectangle of the source surface will be blitted to this surface. If the source area is larger than the destination, clipping will occur. No scaling will be performed. Blitting should not be used on a locked surface. The entire surface will be copied to this surface using this function.
Definition at line 173 of file sdlmm_basesurface.cpp. |
|
Fast blit the specified area part of the source surface onto this surface at the specified coordinates. The choosen rectangle of the source surface will be blitted to this surface. If the source area is larger than the destination, clipping will occur. No scaling will be performed. Blitting should not be used on a locked surface. The entire surface will be copied to this surface using this function. The final blit rectangle is saved in dstrect after all clipping is performed (srcrect is not modified).
Definition at line 398 of file sdlmm_basesurface.h. |
|
Fast blit the specified area part of the source surface onto this surface at the specified coordinates. The choosen rectangle of the source surface will be blitted to this surface. If the source area is larger than the destination, clipping will occur. No scaling will be performed. Blitting should not be used on a locked surface. The entire surface will be copied to this surface using this function. The final blit rectangle is saved in dstrect after all clipping is performed (srcrect is not modified).
Definition at line 169 of file sdlmm_basesurface.cpp. |
|
Fast blit the entire source surface onto this surface at the specified coordinates. The source surface will be blitted to this surface. If the source area is larger than the destination, clipping will occur. No scaling will be performed. Blitting should not be used on a locked surface. The entire surface will be copied to this surface using this function.
Definition at line 183 of file sdlmm_basesurface.cpp. |
|
Fast blit the entire source surface onto this surface at the specified coordinates. The source surface will be blitted to this surface. If the source area is larger than the destination, clipping will occur. No scaling will be performed. Blitting should not be used on a locked surface. The entire surface will be copied to this surface using this function. The final blit rectangle is saved in dstrect after all clipping is performed.
Definition at line 330 of file sdlmm_basesurface.h. |
|
Fast blit the entire source surface onto this surface at the specified coordinates. The source surface will be blitted to this surface. If the source area is larger than the destination, clipping will occur. No scaling will be performed. Blitting should not be used on a locked surface. The entire surface will be copied to this surface using this function. The final blit rectangle is saved in dstrect after all clipping is performed.
Definition at line 179 of file sdlmm_basesurface.cpp. |
|
Fast blit the entire source surface onto this surface. The source surface will be blitted to this surface. If the source area is larger than the destination, clipping will occur. No scaling will be performed. Blitting should not be used on a locked surface. The entire surface will be copied to this surface using this function.
Definition at line 189 of file sdlmm_basesurface.cpp. Referenced by Blit().
|
|
Fast fill the surface with the specified color. If a clipping rectangle has been set using SetClipRect(), only the area within that rectangle will be filled.
Definition at line 447 of file sdlmm_basesurface.h. |
|
Fast fill the surface with the specified color. If a clipping rectangle has been set using SetClipRect(), only the area within that rectangle will be filled.
Definition at line 437 of file sdlmm_basesurface.h. |
|
Fast fill the surface with the specified color. If a clipping rectangle has been set using SetClipRect(), only the area within that rectangle will be filled.
Definition at line 193 of file sdlmm_basesurface.cpp. Referenced by Fill().
|
|
Performs a fast fill of the given rectangle with the specified color. If a clipping rectangle has been set using SetClipRect(), the area filled will be the intersection of the clipping rectangle and dstrect.
Definition at line 484 of file sdlmm_basesurface.h. |
|
Performs a fast fill of the given rectangle with the specified color. If a clipping rectangle has been set using SetClipRect(), the area filled will be the intersection of the clipping rectangle and dstrect.
Definition at line 471 of file sdlmm_basesurface.h. |
|
Performs a fast fill of the given rectangle with the specified color. If a clipping rectangle has been set using SetClipRect(), the area filled will be the intersection of the clipping rectangle and dstrect.
Definition at line 197 of file sdlmm_basesurface.cpp. Referenced by FillRect().
|
|
Gets the clipping rectangle for the surface. Gets the clipping rectangle for a surface. When this surface is the destination of a blit, only the area within the clip rectangle is drawn into.
Definition at line 218 of file sdlmm_basesurface.cpp. |
|
Get the color of the pixel.
Definition at line 194 of file sdlmm_basesurface.h. |
|
Get the color of the pixel.
Definition at line 124 of file sdlmm_basesurface.cpp. Referenced by GetPixel().
|
|
Definition at line 114 of file sdlmm_basesurface.h. |
|
Returns the pixel format.
Definition at line 113 of file sdlmm_basesurface.h. Referenced by Fill(), FillRect(), GetPixel(), SetPixel(), SetPixel1(), SetPixel2(), SetPixel3(), and SetPixel4().
|
|
Definition at line 91 of file sdlmm_basesurface.h. |
|
Definition at line 86 of file sdlmm_basesurface.h. Referenced by GetPixelFormat(), clip_rect(), flags(), h(), hwdata(), pitch(), pixels(), and w().
|
|
Lock the surface to allow direct access to the surface pixels. Returns true if lock succeeded, false otherwise.
Definition at line 30 of file sdlmm_basesurface.cpp. |
|
Resets the clipping rectangle for the surface. This functions resets the clipping to the full size of the surface.
Definition at line 214 of file sdlmm_basesurface.cpp. |
|
Save a BaseSurface object as a Windows bitmap file.
Definition at line 544 of file sdlmm_basesurface.h. |
|
Save a BaseSurface object as a Windows bitmap file.
Definition at line 222 of file sdlmm_basesurface.cpp. Referenced by SaveBMP().
|
|
Adjust the alpha properties of this surface. SetAlpha is used for setting the surface alpha value and / or enabling and disabling alpha blending.
Definition at line 206 of file sdlmm_basesurface.cpp. |
|
Sets the clipping rectangle for the surface. Sets the clipping rectangle for a surface. When this surface is the destination of a blit, only the area within the clip rectangle will be drawn into.
Definition at line 210 of file sdlmm_basesurface.cpp. |
|
Sets the color key (transparent pixel) in a blittable surface and enables or disables RLE blit acceleration. RLE acceleration can substantially speed up blitting of images with large horizontal runs of transparent pixels (i.e., pixels that match the key value). The key must be of the same pixel format as the surface, MapRGB() is often useful for obtaining an acceptable value.
Definition at line 202 of file sdlmm_basesurface.cpp. |
|
Convert the surface to the display format. This function converts the surface to the pixel format and colors of the video framebuffer, making it suitable for fast blitting onto the display surface. If you want to take advantage of hardware colorkey or alpha blit acceleration, you should set the colorkey and alpha value before calling this function.
Reimplemented in SDLmm::Display, and SDLmm::Surface. |
|
Convert the surface to the display format. This function converts the surface to the pixel format and colors of the video framebuffer plus an alpha channel, making it suitable for fast blitting onto the display surface. If you want to take advantage of hardware colorkey or alpha blit acceleration, you should set the colorkey and alpha value before calling this function.
Reimplemented in SDLmm::Display, and SDLmm::Surface. |
|
Set the pixel to the color.
Definition at line 182 of file sdlmm_basesurface.h. |
|
Set the pixel to the color.
Definition at line 93 of file sdlmm_basesurface.cpp. Referenced by SetPixel().
|
|
Set the pixel to the color.
Definition at line 43 of file sdlmm_basesurface.cpp. Referenced by SetPixel().
|
|
Set the pixel to the color.
Definition at line 53 of file sdlmm_basesurface.cpp. Referenced by SetPixel().
|
|
Set the pixel to the color.
Definition at line 63 of file sdlmm_basesurface.cpp. Referenced by SetPixel().
|
|
Set the pixel to the color.
Definition at line 83 of file sdlmm_basesurface.cpp. Referenced by SetPixel().
|
|
Definition at line 48 of file sdlmm_basesurface.h. Referenced by SDLmm::Surface::SetDisplayFormat(), SDLmm::Surface::SetDisplayFormatAlpha(), and operator=().
|
|
Unlock the surface.
Definition at line 37 of file sdlmm_basesurface.cpp. |
|
Returns the surface clip rectangle.
Definition at line 126 of file sdlmm_basesurface.h. |
|
Returns the surface flags.
Definition at line 110 of file sdlmm_basesurface.h. |
|
Returns the height of the surface.
Definition at line 120 of file sdlmm_basesurface.h. Referenced by GetPixel(), SetPixel(), SetPixel1(), SetPixel2(), SetPixel3(), and SetPixel4().
|
|
Returns the hardware-specific surface info.
Definition at line 141 of file sdlmm_basesurface.h. |
|
Definition at line 71 of file sdlmm_basesurface.h. |
|
Returns the scanline length in bytes.
Definition at line 123 of file sdlmm_basesurface.h. Referenced by GetPixel(), SetPixel1(), SetPixel2(), SetPixel3(), and SetPixel4().
|
|
Returns the pixel data, which can be used for low-level manipulation.
Definition at line 138 of file sdlmm_basesurface.h. |
|
Returns the pixel data, which can be used for low-level manipulation.
Definition at line 132 of file sdlmm_basesurface.h. Referenced by GetPixel(), SetPixel1(), SetPixel2(), SetPixel3(), and SetPixel4().
|
|
Returns true if this surface is initialized, false otherwise.
Definition at line 107 of file sdlmm_basesurface.h. |
|
Returns the width of the surface.
Definition at line 117 of file sdlmm_basesurface.h. Referenced by GetPixel(), SetPixel(), SetPixel1(), SetPixel2(), SetPixel3(), and SetPixel4().
|
|
The actual SDL_Surface allocated for this BaseSurface.
Definition at line 47 of file sdlmm_basesurface.h. |
Documentation automatically generated by written by Dimitri van Heesch. | Project hosted at |