PNG image that is initialized from the memory buffer.
More...
#include <CPngImage.h>
|
void | cutTileDraw (int srcX, int srcY, int srcW, int srcH, int destX, int destY, int destW, int destH) |
| Draws a part of the image by cutting a corresponding source and tiling it in required area. More...
|
|
void | cutStretchDraw (int srcX, int srcY, int srcW, int srcH, int destX, int destY, int destW, int destH) |
| Draws a part of the image by cutting a corresponding source and stretching it in required area. More...
|
|
| CPngImage (const Buffer &imagedata) |
| Constructor. More...
|
|
| CPngImage (const Fl_RGB_Image *image) |
| Constructor. More...
|
|
| CPngImage (const String &fileName) |
| Constructor. More...
|
|
void | drawResized (int x, int y, int w, int h, int cornerZone, CPatternDrawMode drawMode, bool drawBackground) |
| Draws resized image. More...
|
|
void | drawResized (int x, int y, int w, int h, int border[], CPatternDrawMode drawMode, bool drawBackground) |
| Draws resized image. More...
|
|
|
static void | cutTileDraw (CPngImage *image, int srcX, int srcY, int srcW, int srcH, int destX, int destY, int destW, int destH) |
| Draws a part of the image by cutting a corresponding source and tiling it in required area. More...
|
|
static void | cutStretchDraw (CPngImage *image, int srcX, int srcY, int srcW, int srcH, int destX, int destY, int destW, int destH) |
| Draws a part of the image by cutting a corresponding source and stretching it in required area. More...
|
|
PNG image that is initialized from the memory buffer.
This class is used by SPTK themes
◆ CPatternDrawMode
The way how the resized parts of image are drawn.
By resized parts I mean everything besides four corners. Corners are rectangles with the side of corner zone
Enumerator |
---|
PDM_UNDEFINED | Undefined and not drawn, should be defined later.
|
PDM_TILE | The resized parts are tiled
|
PDM_STRETCH | The resized parts are stretched
|
◆ CPngImage() [1/3]
sptk::CPngImage::CPngImage |
( |
const Buffer & |
imagedata | ) |
|
|
explicit |
Constructor.
An object of the class contains it's own copy of the image data
- Parameters
-
imagedata | const CBuffer&, PNG image data in memory buffer |
◆ CPngImage() [2/3]
sptk::CPngImage::CPngImage |
( |
const Fl_RGB_Image * |
image | ) |
|
|
explicit |
Constructor.
An object of the class contains it's own copy of the image data
- Parameters
-
image | Fl_RGB_Image*, RGB image data in memory buffer |
◆ CPngImage() [3/3]
sptk::CPngImage::CPngImage |
( |
const String & |
fileName | ) |
|
|
explicit |
Constructor.
An object of the class contains it's own copy of the image data
- Parameters
-
fileName | std::string, image file (.png) |
◆ cutStretchDraw() [1/2]
static void sptk::CPngImage::cutStretchDraw |
( |
CPngImage * |
image, |
|
|
int |
srcX, |
|
|
int |
srcY, |
|
|
int |
srcW, |
|
|
int |
srcH, |
|
|
int |
destX, |
|
|
int |
destY, |
|
|
int |
destW, |
|
|
int |
destH |
|
) |
| |
|
staticprotected |
Draws a part of the image by cutting a corresponding source and stretching it in required area.
- Parameters
-
image | CPngImage*, source image |
srcX | int, x-coordinate of the source fragment |
srcY | int, y-coordinate of the source fragment |
srcW | int, width of the source fragment |
srcH | int, height of the source fragment |
destX | int, x-coordinate of the destination fragment |
destY | int, y-coordinate of the destination fragment |
destW | int, width of the destination fragment |
destH | int, height of the destination fragment |
◆ cutStretchDraw() [2/2]
void sptk::CPngImage::cutStretchDraw |
( |
int |
srcX, |
|
|
int |
srcY, |
|
|
int |
srcW, |
|
|
int |
srcH, |
|
|
int |
destX, |
|
|
int |
destY, |
|
|
int |
destW, |
|
|
int |
destH |
|
) |
| |
|
inline |
Draws a part of the image by cutting a corresponding source and stretching it in required area.
- Parameters
-
srcX | int, x-coordinate of the source fragment |
srcY | int, y-coordinate of the source fragment |
srcW | int, width of the source fragment |
srcH | int, height of the source fragment |
destX | int, x-coordinate of the destination fragment |
destY | int, y-coordinate of the destination fragment |
destW | int, width of the destination fragment |
destH | int, height of the destination fragment |
◆ cutTileDraw() [1/2]
static void sptk::CPngImage::cutTileDraw |
( |
CPngImage * |
image, |
|
|
int |
srcX, |
|
|
int |
srcY, |
|
|
int |
srcW, |
|
|
int |
srcH, |
|
|
int |
destX, |
|
|
int |
destY, |
|
|
int |
destW, |
|
|
int |
destH |
|
) |
| |
|
staticprotected |
Draws a part of the image by cutting a corresponding source and tiling it in required area.
- Parameters
-
image | CPngImage*, source image |
srcX | int, x-coordinate of the source fragment |
srcY | int, y-coordinate of the source fragment |
srcW | int, width of the source fragment |
srcH | int, height of the source fragment |
destX | int, x-coordinate of the destination fragment |
destY | int, y-coordinate of the destination fragment |
destW | int, width of the destination fragment |
destH | int, height of the destination fragment |
◆ cutTileDraw() [2/2]
void sptk::CPngImage::cutTileDraw |
( |
int |
srcX, |
|
|
int |
srcY, |
|
|
int |
srcW, |
|
|
int |
srcH, |
|
|
int |
destX, |
|
|
int |
destY, |
|
|
int |
destW, |
|
|
int |
destH |
|
) |
| |
|
inline |
Draws a part of the image by cutting a corresponding source and tiling it in required area.
- Parameters
-
srcX | int, x-coordinate of the source fragment |
srcY | int, y-coordinate of the source fragment |
srcW | int, width of the source fragment |
srcH | int, height of the source fragment |
destX | int, x-coordinate of the destination fragment |
destY | int, y-coordinate of the destination fragment |
destW | int, width of the destination fragment |
destH | int, height of the destination fragment |
◆ drawResized() [1/2]
void sptk::CPngImage::drawResized |
( |
int |
x, |
|
|
int |
y, |
|
|
int |
w, |
|
|
int |
h, |
|
|
int |
border[], |
|
|
CPatternDrawMode |
drawMode, |
|
|
bool |
drawBackground |
|
) |
| |
Draws resized image.
- Parameters
-
x | int, the x coordinate to draw image |
y | int, the y coordinate to draw image |
w | int, the width to draw image |
h | int, the height to draw image |
border | int[], the borders that are copied from the image with minimal possible processing |
drawMode | CPatternDrawMode, the mode to draw the resized parts of image |
drawBackground | bool, if true then the internal area of the image is used for background |
◆ drawResized() [2/2]
void sptk::CPngImage::drawResized |
( |
int |
x, |
|
|
int |
y, |
|
|
int |
w, |
|
|
int |
h, |
|
|
int |
cornerZone, |
|
|
CPatternDrawMode |
drawMode, |
|
|
bool |
drawBackground |
|
) |
| |
Draws resized image.
- Parameters
-
x | int, the x coordinate to draw image |
y | int, the y coordinate to draw image |
w | int, the width to draw image |
h | int, the height to draw image |
cornerZone | int, the height (and width) of the corners that are simply copied from the image w/o processing |
drawMode | CPatternDrawMode, the mode to draw the resized parts of image |
drawBackground | bool, if true then the internal area of the image is used for background |
Referenced by sptk::CFrame::drawResized().
◆ load()
void sptk::CPngImage::load |
( |
const Buffer & |
buffer | ) |
|
|
protected |
Internal loader from PNG image buffer.
- Parameters
-
buffer | const CBuffer&, image data |
The documentation for this class was generated from the following file: