VSTGUI: CMultiFrameBitmap Class Reference

VSTGUI 4.10 Graphical User Interface Framework not only for VST plugins

Public Member Functions | List of all members
CMultiFrameBitmap Class Reference
New classes » Version 4.12

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 More...
CMultiFrameBitmapDescription | getMultiFrameDesc () const
| get the mult frame description More...
CPoint | getFrameSize () const
| get the frame size More...
uint16_t | getNumFrames () const
| get the number of frames More...
uint16_t | getNumFramesPerRow () const
| get the number of frames per row More...
CRect | calcFrameRect (uint32_t frameIndex) const
| calculate the rect for one frame More...
void | drawFrame (CDrawContext *context, uint16_t frameIndex, CPoint pos)
| draw one frame at the position in the context More...
virtual uint16_t | normalizedValueToFrameIndex (float value) const
| return the frame to display for a normalized value More...
virtual float | frameIndexToNormalizedValue (uint16_t frameIndex) const
| return the normalized value from the frame index More...
| CBitmap (const CResourceDescription &desc)
| Create an image from a resource identifier. More...
| CBitmap (CCoord width, CCoord height)
| Create an image with a given size. More...
| CBitmap (CPoint size, double scaleFactor=1.)
| Create an image with a given size and scale factor. More...
| CBitmap (const PlatformBitmapPtr &platformBitmap)
| CBitmap ()
Public Member Functions inherited from CBitmap
| CBitmap (const CResourceDescription &desc)
| Create an image from a resource identifier. More...
| CBitmap (CCoord width, CCoord height)
| Create an image with a given size. More...
| CBitmap (CPoint size, double scaleFactor=1.)
| Create an image with a given size and scale factor. More...
| 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 More...
CCoord | getHeight () const
| get the height of the image More...
CPoint | getSize () const
| get size of image More...
bool | isLoaded () const
| check if image is loaded More...
const CResourceDescription & | getResourceDescription () 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< T >
| ReferenceCounted ()=default
virtual | ~ReferenceCounted () noexcept=default
| ReferenceCounted (const ReferenceCounted &)
ReferenceCounted & | operator= (const ReferenceCounted &)
void | forget () override
| decrease refcount and delete object if refcount == 0 More...
void | remember () override
| increase refcount More...
virtual int32_t | getNbReference () const
| get refcount More...
virtual void | forget ()=0
| decrease refcount and delete object if refcount == 0 More...
virtual void | remember ()=0
| increase refcount More...

## Additional Inherited Members
Public Types inherited from CBitmap
using | BitmapVector = std::vector< PlatformBitmapPtr >
using | const_iterator = BitmapVector::const_iterator
Protected Member Functions inherited from CBitmap
| CBitmap ()
Protected Attributes inherited from 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()

CMultiFrameBitmap | ( | const CResourceDescription & | desc,
|  | CMultiFrameBitmapDescription | multiFrameDesc
| ) |  |

## 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

  desc | the multi frame description

Returns
  true if bitmap is big enough for the description

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

- cbitmap.h
- cbitmap.cpp