public |
Inheritance Graph
graph BT
Bitmap
Bitmap --> ReferenceCounter
click Bitmap "classUtil_1_1Bitmap"
click ReferenceCounter "classUtil_1_1ReferenceCounter"
Description
Coordinates:
(0,0) (width,0) +————+ | /\ | / \ | +————+ (0,height) (width,height) |
Note: the coordinates are the same as for SDL Surfaces, but not for OpenGl Textures!
Public Functions
Bitmap(const uint32_t width, const uint32_t height, AttributeFormat pixelFormat) Create a new bitmap. |
|
Bitmap(const uint32_t width, const uint32_t height, size_t rawDataSize) | |
Bitmap(const Bitmap & source) Create a copy of the bitmap together with its data. |
|
void | swap( Bitmap & other) Swap all the data with another bitmap. |
uint32_t | getWidth() const |
uint32_t | getHeight() const |
const AttributeFormat & | getPixelFormat() const |
size_t | getDataSize() const Return the number of bytes that are allocated by this Bitmap or that will be allocated. |
uint8_t * | data() Access the data of the bitmap. |
const uint8_t * | data() const Access the data of the bitmap. |
void | setData(const std::vector< uint8_t > & newData) |
void | swapData(std::vector< uint8_t > & other) |
void | flipVertically() Swap the rows, so that the bitmap is turned upside down afterwards. |
Documentation
function
Util::Bitmap::Bitmap
public | explicit |
Bitmap( | const uint32_t | width, |
const uint32_t | height, | |
AttributeFormat | pixelFormat | |
) |
Create a new bitmap.
Defined in Util/Graphics/Bitmap.h:43
function
Util::Bitmap::Bitmap
public |
Bitmap( | const uint32_t | width, |
const uint32_t | height, | |
size_t | rawDataSize | |
) |
Create a new bitmap which containing only raw data. A direct pixel access is not possible.
Note: This can e.g. be used to store compressed textures
Defined in Util/Graphics/Bitmap.h:47
function
Util::Bitmap::Bitmap
public | explicit |
Bitmap( | const Bitmap & | source ) |
Create a copy of the bitmap together with its data.
Defined in Util/Graphics/Bitmap.h:50
function
Util::Bitmap::swap
public |
void swap( | Bitmap & | other ) |
Swap all the data with another bitmap.
Defined in Util/Graphics/Bitmap.h:53
function
Util::Bitmap::getWidth
public | const | inline |
uint32_t getWidth( | ) const |
Defined in Util/Graphics/Bitmap.h:55
function
Util::Bitmap::getHeight
public | const | inline |
uint32_t getHeight( | ) const |
Defined in Util/Graphics/Bitmap.h:56
function
Util::Bitmap::getPixelFormat
public | const | inline |
const AttributeFormat & getPixelFormat( | ) const |
Defined in Util/Graphics/Bitmap.h:58
function
Util::Bitmap::getDataSize
public | const | inline |
size_t getDataSize( | ) const |
Return the number of bytes that are allocated by this Bitmap or that will be allocated.
Defined in Util/Graphics/Bitmap.h:61
function
Util::Bitmap::data
public | inline |
uint8_t * data( | ) |
Access the data of the bitmap.
Defined in Util/Graphics/Bitmap.h:64
function
Util::Bitmap::data
public | const | inline |
const uint8_t * data( | ) const |
Access the data of the bitmap.
Defined in Util/Graphics/Bitmap.h:67
function
Util::Bitmap::setData
public |
void setData( | const std::vector< uint8_t > & | newData ) |
Overwrite the current data with the given data.
Parameters
- newData
- Data that will be copied to the internal data storage
Note: The new data must have the same size as the existing data.
Defined in Util/Graphics/Bitmap.h:75
function
Util::Bitmap::swapData
public |
void swapData( | std::vector< uint8_t > & | other ) |
Defined in Util/Graphics/Bitmap.h:76
function
Util::Bitmap::flipVertically
public |
void flipVertically( | ) |
Swap the rows, so that the bitmap is turned upside down afterwards.
Defined in Util/Graphics/Bitmap.h:79