sptk2 logo
SPTK Home Page
Public Types | Public Member Functions | Protected Attributes | List of all members
sptk::CFrame Class Reference

Frame information class. More...

#include <CFrame.h>

Inheritance diagram for sptk::CFrame:
sptk::CPngImage

Public Types

enum class  CFrameKind : uint8_t { FLTK_STANDARD , USER_EXTENDED }
 An expected usage of the frame. More...
 
- Public Types inherited from sptk::CPngImage
enum class  CPatternDrawMode : uint8_t { PDM_UNDEFINED , PDM_TILE , PDM_STRETCH }
 The way how the resized parts of image are drawn. More...
 

Public Member Functions

 CFrame (const Buffer &imageData, uint32_t frameWidth, uint32_t cornerZone, CPatternDrawMode drawMode=CPngImage::CPatternDrawMode::PDM_STRETCH, CFrameKind kind=CFrameKind::USER_EXTENDED)
 Constructor. More...
 
void drawResized (int x, int y, int w, int h, bool drawBackground)
 Draws resized image. More...
 
uint32_t frameWidth () const
 Returns frame width, to keep widgets inside the frame w/o overlaping.
 
uint32_t cornerZone () const
 Returns corner zone width to draw the frame corners without changes.
 
CFrameKind kind () const
 Returns an expected usage of the frame.
 
- Public Member Functions inherited from sptk::CPngImage
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...
 

Protected Attributes

uint32_t m_frameWidth
 
uint32_t m_cornerZone
 
CPatternDrawMode m_drawMode
 
CFrameKind m_kind
 

Additional Inherited Members

- Protected Member Functions inherited from sptk::CPngImage
void load (const Buffer &buffer)
 Internal loader from PNG image buffer. More...
 
- Static Protected Member Functions inherited from sptk::CPngImage
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...
 

Detailed Description

Frame information class.

Contains the frame image and frame width

Member Enumeration Documentation

◆ CFrameKind

enum class sptk::CFrame::CFrameKind : uint8_t
strong

An expected usage of the frame.

Enumerator
FLTK_STANDARD 

The frame should be used to draw standard FLTK frames

USER_EXTENDED 

The frame should be used to draw user frames

Constructor & Destructor Documentation

◆ CFrame()

sptk::CFrame::CFrame ( const Buffer imageData,
uint32_t  frameWidth,
uint32_t  cornerZone,
CPatternDrawMode  drawMode = CPngImage::CPatternDrawMode::PDM_STRETCH,
CFrameKind  kind = CFrameKind::USER_EXTENDED 
)
inline

Constructor.

Parameters
imageDataconst CBuffer&, an image data presented as memory buffer
frameWidthuint32_t, frame width, to keep widgets inside the frame w/o overlaping
cornerZoneuint32_t, corner zone width to draw the frame corners without changes
drawModeCPatternDrawMode, pattern draw mode
kindCFrameKind, frame kind (standard or user-extended)

Member Function Documentation

◆ drawResized()

void sptk::CFrame::drawResized ( int  x,
int  y,
int  w,
int  h,
bool  drawBackground 
)
inline

Draws resized image.

Parameters
xint, the x coordinate to draw image
yint, the y coordinate to draw image
wint, the width to draw image
hint, the height to draw image
drawBackgroundbool, if true then the internal area of the image is used for background

References sptk::CPngImage::drawResized().

Member Data Documentation

◆ m_cornerZone

uint32_t sptk::CFrame::m_cornerZone
protected

Corner zone width to draw the frame corners without changes

◆ m_drawMode

CPatternDrawMode sptk::CFrame::m_drawMode
protected

Pattern draw mode

◆ m_frameWidth

uint32_t sptk::CFrame::m_frameWidth
protected

Frame width, to keep widgets inside the frame w/o overlaping

◆ m_kind

CFrameKind sptk::CFrame::m_kind
protected

Frame kind (standard or user-extended)


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

Fri Oct 14 2022 09:58:36: SPTK 5.4.1