sptk2 logo
SPTK Home Page

sptk::CPngImage Class Reference

PNG image that is initialized from the memory buffer. More...

#include <CPngImage.h>

Inheritance diagram for sptk::CPngImage:

sptk::CFrame sptk::CFrame

List of all members.

Public Types

enum  CPatternDrawMode { PDM_UNDEFINED, PDM_TILE, PDM_STRETCH }
 The way how the resized parts of image are drawn. More...

Public Member Functions

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.
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.
 CPngImage (const CBuffer &imagedata)
 Constructor.
 CPngImage (const Fl_RGB_Image *image)
 Constructor.
 CPngImage (std::string fileName)
 Constructor.
void drawResized (int x, int y, int w, int h, int cornerZone, CPatternDrawMode drawMode, bool drawBackground)
 Draws resized image.
void drawResized (int x, int y, int w, int h, int border[], CPatternDrawMode drawMode, bool drawBackground)
 Draws resized image.


Detailed Description

PNG image that is initialized from the memory buffer.

This class is used by SPTK themes


Member Enumeration Documentation

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.


Constructor & Destructor Documentation

sptk::CPngImage::CPngImage ( const CBuffer imagedata  ) 

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

sptk::CPngImage::CPngImage ( const Fl_RGB_Image *  image  ) 

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

sptk::CPngImage::CPngImage ( std::string  fileName  ) 

Constructor.

An object of the class contains it's own copy of the image data

Parameters:
fileName std::string, image file (.png)


Member Function Documentation

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

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

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

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


The documentation for this class was generated from the following file:

Mon Mar 5 11:56:17 2012: SPTK 3.5.7