Beatmup
Beatmup::UnsupportedPixelFormat Class Reference

An exception to throw if a pixel format is not supported. More...

#include <bitmap_access.h>

Inheritance diagram for Beatmup::UnsupportedPixelFormat:
Beatmup::Exception

Public Member Functions

 UnsupportedPixelFormat (PixelFormat pf)
 
- Public Member Functions inherited from Beatmup::Exception
virtual const char * what () const NOEXCEPT override
 

Static Public Member Functions

static void check (AbstractBitmap &bitmap, PixelFormat pf)
 
static void assertMask (AbstractBitmap &bitmap)
 
static void assertFloat (AbstractBitmap &bitmap)
 
static void assertInt (AbstractBitmap &bitmap)
 

Additional Inherited Members

- Protected Member Functions inherited from Beatmup::Exception
 Exception (const char *message)
 
template<typename ... Args>
 Exception (const char *message, const Args &... args)
 

Detailed Description

An exception to throw if a pixel format is not supported.

Definition at line 890 of file bitmap_access.h.

Constructor & Destructor Documentation

◆ UnsupportedPixelFormat()

Beatmup::UnsupportedPixelFormat::UnsupportedPixelFormat ( PixelFormat  pf)
inline

Definition at line 892 of file bitmap_access.h.

892 : Exception("This pixel format is not supported: %s", AbstractBitmap::PIXEL_FORMAT_NAMES[pf]) {};
static const char * PIXEL_FORMAT_NAMES[NUM_PIXEL_FORMATS]
pixel format names
Exception(const char *message)
Definition: exception.h:41

Member Function Documentation

◆ check()

void Beatmup::UnsupportedPixelFormat::check ( AbstractBitmap bitmap,
PixelFormat  pf 
)
static

Definition at line 28 of file bitmap_access.cpp.

28  {
29  if (bitmap.getPixelFormat() != pf)
31 }
const PixelFormat getPixelFormat() const
Pixel format of the bitmap.
UnsupportedPixelFormat(PixelFormat pf)
Beatmup::InternalBitmap * bitmap

◆ assertMask()

void Beatmup::UnsupportedPixelFormat::assertMask ( AbstractBitmap bitmap)
static

Definition at line 34 of file bitmap_access.cpp.

34  {
35  if (!bitmap.isMask())
37 }
bool isMask() const
Returns true if the bitmap is a mask, false otherwise.

◆ assertFloat()

void Beatmup::UnsupportedPixelFormat::assertFloat ( AbstractBitmap bitmap)
static

Definition at line 40 of file bitmap_access.cpp.

40  {
41  if (!bitmap.isFloat())
43 }
bool isFloat() const
Returns true if the bitmap contains floating point values, false otherwise.

◆ assertInt()

void Beatmup::UnsupportedPixelFormat::assertInt ( AbstractBitmap bitmap)
static

Definition at line 46 of file bitmap_access.cpp.

46  {
47  if (!bitmap.isInteger())
49 }
bool isInteger() const
Returns true if the bitmap contains integer values, false otherwise.

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