CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::Bitmap Class Reference

A class that wraps a bitmap into a rich class for accessing it. More...

#include <CeresEngine/Texture/Bitmap.hpp>

Public Member Functions

 Bitmap (const BitmapExtent &extents, const Format format=Format::RGBA8UInt)
 Creates a new bitmap with the given extents.
 
 Bitmap (UInt32 width, const Format format=Format::RGBA8UInt)
 
 Bitmap (UInt32 width, UInt32 height, const Format format=Format::RGBA8UInt)
 
 Bitmap (UInt32 width, UInt32 height, UInt32 depth, const Format format=Format::RGBA8UInt)
 
const FormatgetFormat () const noexcept
 The format used by the bitmap data.
 
const BitmapExtentgetExtents () const noexcept
 Determines the size of the bitmap.
 
BitmapData getData () const noexcept
 The raw bitmap data.
 
void copyData (const Byte *const source, const size_t length)
 
ByteMemoryView getByteData () const
 
void setByteData (const ByteMemoryView &data)
 

Private Attributes

Format mFormat = Format::RGBA8UInt
 The format used by the bitmap data.
 
BitmapExtent mExtents
 Determines the size of the bitmap.
 
Vector< BytemData
 The raw bitmap data.
 

Friends

class TUserTypeInfo< Bitmap >
 

Detailed Description

A class that wraps a bitmap into a rich class for accessing it.

Constructor & Destructor Documentation

◆ Bitmap() [1/4]

CeresEngine::Bitmap::Bitmap ( const BitmapExtent extents,
const Format  format = Format::RGBA8UInt 
)
inline

Creates a new bitmap with the given extents.

Parameters
extentsThe size of the bitmap data to be created.
formatThe format of the bitmap data.

◆ Bitmap() [2/4]

CeresEngine::Bitmap::Bitmap ( UInt32  width,
const Format  format = Format::RGBA8UInt 
)
inline

◆ Bitmap() [3/4]

CeresEngine::Bitmap::Bitmap ( UInt32  width,
UInt32  height,
const Format  format = Format::RGBA8UInt 
)
inline

◆ Bitmap() [4/4]

CeresEngine::Bitmap::Bitmap ( UInt32  width,
UInt32  height,
UInt32  depth,
const Format  format = Format::RGBA8UInt 
)
inline

Member Function Documentation

◆ copyData()

void CeresEngine::Bitmap::copyData ( const Byte *const  source,
const size_t  length 
)
inline

◆ getByteData()

ByteMemoryView CeresEngine::Bitmap::getByteData ( ) const
inline

◆ getData()

BitmapData CeresEngine::Bitmap::getData ( ) const
inlinenoexcept

The raw bitmap data.

To access this data properly it must be interpreted for the given mFormat.

◆ getExtents()

const BitmapExtent & CeresEngine::Bitmap::getExtents ( ) const
inlinenoexcept

Determines the size of the bitmap.

◆ getFormat()

const Format & CeresEngine::Bitmap::getFormat ( ) const
inlinenoexcept

The format used by the bitmap data.

This will control how the bytes in mData are interpreted into colors.

◆ setByteData()

void CeresEngine::Bitmap::setByteData ( const ByteMemoryView data)
inline

Friends And Related Symbol Documentation

◆ TUserTypeInfo< Bitmap >

Member Data Documentation

◆ mData

Vector<Byte> CeresEngine::Bitmap::mData
private

The raw bitmap data.

To access this data properly it must be interpreted for the given mFormat.

◆ mExtents

BitmapExtent CeresEngine::Bitmap::mExtents
private

Determines the size of the bitmap.

◆ mFormat

Format CeresEngine::Bitmap::mFormat = Format::RGBA8UInt
private

The format used by the bitmap data.

This will control how the bytes in mData are interpreted into colors.


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