docs
Loading...
Searching...
No Matches
Bitmap.h

Classes

struct  BitmapFormatInfo
 Block geometry for a BitmapFormat. More...
class  Bitmap
 A container for pixel data. More...
class  LockedPixels< T >
 Forward declaration for the LockedPixels class. More...

Functions

BitmapFormatInfo GetBitmapFormatInfo (BitmapFormat format)
 Get the block geometry for a given BitmapFormat.
bool IsCompressedFormat (BitmapFormat format)
 Whether or not a given BitmapFormat is block-compressed (a BCn format).

Namespaces

namespace  ultralight
 Root namespace for every public Ultralight type, function, and enumeration.

Macros

#define GetBytesPerPixel(x)
 Macro to get the bytes per pixel from a BitmapFormat.

Typedefs

typedef void(*) DestroyBitmapCallback(void *user_data, void *data)
 Function signature for a user-defined destruction callback to be optionally called when the Bitmap is destroyed.

Enumerations

enum class  BitmapFormat : uint8_t {
  A8_UNORM , BGRA8_UNORM_SRGB , RG8_UNORM , BC1_UNORM ,
  BC2_UNORM , BC3_UNORM , BC7_UNORM , RGBA16F ,
  RGBA16UI , RGBA32F
}
 The various Bitmap formats. More...

Macro Definition Documentation

◆ GetBytesPerPixel

#define GetBytesPerPixel ( x)
Value:
((x) == BitmapFormat::A8_UNORM ? 1 \
: (x) == BitmapFormat::RG8_UNORM ? 2 \
: (x) == BitmapFormat::RGBA16F ? 8 \
: (x) == BitmapFormat::RGBA16UI ? 8 \
: (x) == BitmapFormat::RGBA32F ? 16 \
: 4)

Macro to get the bytes per pixel from a BitmapFormat.

Note
This is only meaningful for non-block-compressed formats. Block-compressed (BCn) formats have no per-pixel size– use GetBitmapFormatInfo() and row_bytes() / size() for storage math instead.

Go to the source code of this file.