VSTGUI 4.10
Graphical User Interface Framework not only for VST plugins
Loading...
Searching...
No Matches
CMultiFrameBitmap Class Reference

Multi frame bitmap. More...

#include <cbitmap.h>

+ Inheritance diagram for CMultiFrameBitmap:

Public Member Functions

 CMultiFrameBitmap (const CResourceDescription &desc, CMultiFrameBitmapDescription multiFrameDesc)
 
bool setMultiFrameDesc (CMultiFrameBitmapDescription desc)
 set the multi frame description
 
CMultiFrameBitmapDescription getMultiFrameDesc () const
 get the mult frame description
 
CPoint getFrameSize () const
 get the frame size
 
uint16_t getNumFrames () const
 get the number of frames
 
uint16_t getNumFramesPerRow () const
 get the number of frames per row
 
CRect calcFrameRect (uint32_t frameIndex) const
 calculate the rect for one frame
 
void drawFrame (CDrawContext *context, uint16_t frameIndex, CPoint pos)
 draw one frame at the position in the context
 
virtual uint16_t normalizedValueToFrameIndex (float value) const
 return the frame to display for a normalized value
 
virtual float frameIndexToNormalizedValue (uint16_t frameIndex) const
 return the normalized value from the frame index
 
 CBitmap (const CResourceDescription &desc)
 Create an image from a resource identifier.
 
 CBitmap (CCoord width, CCoord height)
 Create an image with a given size.
 
 CBitmap (CPoint size, double scaleFactor=1.)
 Create an image with a given size and scale factor.
 
 CBitmap (const PlatformBitmapPtr &platformBitmap)
 
 CBitmap ()
 
- Public Member Functions inherited from CBitmap
 CBitmap (const CResourceDescription &desc)
 Create an image from a resource identifier.
 
 CBitmap (CCoord width, CCoord height)
 Create an image with a given size.
 
 CBitmap (CPoint size, double scaleFactor=1.)
 Create an image with a given size and scale factor.
 
 CBitmap (const PlatformBitmapPtr &platformBitmap)
 
 ~CBitmap () noexcept override=default
 
virtual void draw (CDrawContext *context, const CRect &rect, const CPoint &offset=CPoint(0, 0), float alpha=1.f)
 
CCoord getWidth () const
 get the width of the image
 
CCoord getHeight () const
 get the height of the image
 
CPoint getSize () const
 get size of image
 
bool isLoaded () const
 check if image is loaded
 
const CResourceDescriptiongetResourceDescription () const
 
PlatformBitmapPtr getPlatformBitmap () const
 
void setPlatformBitmap (const PlatformBitmapPtr &bitmap)
 
bool addBitmap (const PlatformBitmapPtr &platformBitmap)
 
PlatformBitmapPtr getBestPlatformBitmapForScaleFactor (double scaleFactor) const
 
const_iterator begin () const
 
const_iterator end () const
 
- Public Member Functions inherited from ReferenceCounted< std::atomic< int32_t > >
 ReferenceCounted ()=default
 
virtual ~ReferenceCounted () noexcept=default
 
 ReferenceCounted (const ReferenceCounted &)
 
ReferenceCountedoperator= (const ReferenceCounted &)
 
 ReferenceCounted ()=default
 
 ReferenceCounted (const ReferenceCounted &)
 
virtual ~ReferenceCounted () noexcept=default
 
ReferenceCountedoperator= (const ReferenceCounted &)
 
void forget () override
 decrease refcount and delete object if refcount == 0
 
void remember () override
 increase refcount
 
virtual int32_t getNbReference () const
 get refcount
 
void forget () override
 decrease refcount and delete object if refcount == 0
 
void remember () override
 increase refcount
 
virtual int32_t getNbReference () const
 get refcount
 

Additional Inherited Members

- Public Types inherited from CBitmap
using BitmapVector = std::vector<PlatformBitmapPtr>
 
using const_iterator = BitmapVector::const_iterator
 
 CBitmap ()
 
CResourceDescription resourceDesc
 
BitmapVector bitmaps
 

Detailed Description

Multi frame bitmap.

A bitmap describing multiple frames ordered in rows and columns

The index order is columns and then rows:

1.Row: 1 -> 2 -> 3 2.Row: 4 -> 5 -> 6 ...

Constructor & Destructor Documentation

◆ CMultiFrameBitmap()

Member Function Documentation

◆ calcFrameRect()

CRect calcFrameRect ( uint32_t frameIndex) const

calculate the rect for one frame

◆ CBitmap() [1/5]

CBitmap ( )

◆ CBitmap() [2/5]

CBitmap ( CCoord width,
CCoord height )

Create an image with a given size.

◆ CBitmap() [3/5]

CBitmap ( const CResourceDescription & desc)
explicit

Create an image from a resource identifier.

◆ CBitmap() [4/5]

CBitmap ( const PlatformBitmapPtr & platformBitmap)
explicit

◆ CBitmap() [5/5]

CBitmap ( CPoint size,
double scaleFactor = 1. )

Create an image with a given size and scale factor.

◆ drawFrame()

void drawFrame ( CDrawContext * context,
uint16_t frameIndex,
CPoint pos )

draw one frame at the position in the context

◆ getFrameSize()

CPoint getFrameSize ( ) const

get the frame size

◆ getMultiFrameDesc()

CMultiFrameBitmapDescription getMultiFrameDesc ( ) const

get the mult frame description

◆ getNumFrames()

uint16_t getNumFrames ( ) const

get the number of frames

◆ getNumFramesPerRow()

uint16_t getNumFramesPerRow ( ) const

get the number of frames per row

◆ setMultiFrameDesc()

bool setMultiFrameDesc ( CMultiFrameBitmapDescription desc)

set the multi frame description

Parameters
descthe multi frame description
Returns
true if bitmap is big enough for the description

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