Base Framework
Classes | Public Types | Public Member Functions | List of all members
Bitmap Class Reference

Bitmap. More...

#include <base/ui/Bitmap.h>

Inherits Object.

Public Types

enum  Format { GRAY, GRAY_ALPHA, RGB, RGBA }
 
enum  Encoding {
  GRAY_8, RGB_15, RGB_16, RGB_24,
  RGB_24_LE, RGB_24_BE, RGB_32, RGB_32_LE,
  RGB_32_BE, RGBA_32, RGBA_32_LE, RGBA_32_BE
}
 

Public Member Functions

 Bitmap () noexcept
 
 Bitmap (const Dimension &dimension, Format format, Encoding encoding, const void *data)
 
 Bitmap (const Bitmap &copy) noexcept
 
Bitmapoperator= (const Bitmap &assign) noexcept
 
bool isValid () const noexcept
 
Dimension getDimension () const
 
uint32 getPixel (const Position &position) const
 
void setPixel (const Position &position, uint32 value) const
 

Detailed Description

Bitmap.

A bitmap stored in native format.

Version
1.0

Member Enumeration Documentation

◆ Encoding

Pixel encoding.

Enumerator
GRAY_8 

Pixels are stored as

RGB_15 

Pixels are stored in 16 bits (5 bit per component).

RGB_16 

Pixels are stored in 16 bits (5 bit for red and blue and 6 for green component).

RGB_24 

Pixels are stored in 24 bits (8 bits per component with the most significant octet not used).

RGB_24_LE 

Pixels are stored in 24 bits (8 bits per component with the most significant octet not used).

RGB_24_BE 

Pixels are stored in 24 bits (8 bits per component with the most significant octet not used).

RGB_32 

Pixels are stored in 32 bits (8 bits per component).

RGB_32_LE 

Pixels are stored in 32 bits (8 bits per component).

RGB_32_BE 

Pixels are stored in 32 bits (8 bits per component).

RGBA_32 

Each pixel take up 32 bit.

RGBA_32_LE 

Each pixel take up 32 bit (red, green, blue, and alpha).

RGBA_32_BE 

Each pixel take up 32 bit (alpha, blue, green, and red).

◆ Format

Pixel format.

Enumerator
GRAY 

Gray components.

GRAY_ALPHA 

Gray and alpha components.

RGB 

Red, green, and blue components.

RGBA 

Red, green, blue, and alpha components.

Constructor & Destructor Documentation

◆ Bitmap() [1/3]

Bitmap::Bitmap ( )
inlinenoexcept

Initializes bitmap as invalid.

◆ Bitmap() [2/3]

Bitmap::Bitmap ( const Dimension dimension,
Format  format,
Encoding  encoding,
const void *  data 
)

Initializes bitmap.

Parameters
dimensionThe dimension of the bitmap.
formatThe pixel format.
encodingThe encoding of the pixels.
dataThe bitmap data.

◆ Bitmap() [3/3]

Bitmap::Bitmap ( const Bitmap copy)
inlinenoexcept

Initializes bitmap from other bitmap.

Member Function Documentation

◆ getDimension()

Dimension Bitmap::getDimension ( ) const

Returns the dimension of the bitmap.

◆ getPixel()

uint32 Bitmap::getPixel ( const Position position) const

Returns the value of the specified pixel.

◆ isValid()

bool Bitmap::isValid ( ) const
inlinenoexcept

Returns true if the bitmap is valid.

◆ operator=()

Bitmap& Bitmap::operator= ( const Bitmap assign)
inlinenoexcept

Assignment of bitmap by bitmap.

◆ setPixel()

void Bitmap::setPixel ( const Position position,
uint32  value 
) const

Sets the value of the specified pixel.