Gamp v0.0.7-54-gccdc599
Gamp: Graphics, Audio, Multimedia and Processing
Loading...
Searching...
No Matches
gamp::render::pixel::PixelFormat Class Reference

Packed pixel composition, i.e. More...

#include <PixelFormat.hpp>

Collaboration diagram for gamp::render::pixel::PixelFormat:

Public Member Functions

constexpr const u32array4_tbitCount () const noexcept
 
constexpr const u32array4_tbitMask () const noexcept
 
constexpr const u32array4_tbitShift () const noexcept
 
constexpr uint32_t bitsPerPixel () const noexcept
 Number of bits per pixel, e.g.
 
constexpr uint32_t bitStride () const noexcept
 Bit distance between pixels.
 
constexpr uint32_t bytesPerPixel () const noexcept
 Number of bytes per pixel, i.e.
 
constexpr uint32_t defaultValue (uint32_t cIdx, bool shiftResult) const noexcept
 
constexpr uint32_t find (CType s) const noexcept
 Returns first index of given CType within componentOrder(), -1 if not exists.
 
constexpr uint32_t fromFloat (float f, uint32_t cIdx, bool shiftResult) const noexcept
 
constexpr size_t hashCode () const noexcept
 
constexpr bool isInterleaved () const noexcept
 Returns true if all components are packed, i.e.
 
constexpr bool isUniform () const noexcept
 Returns true if all components are of same bit-size, e.g.
 
constexpr bool operator== (const PixelFormat &rhs) const noexcept
 
constexpr const comparray4_torder () const noexcept
 Returns the Component type order of all components, see componentBitMask().
 
constexpr jau::nsize_t size () const noexcept
 Number of components per pixel, e.g.
 
constexpr float toFloat (uint32_t v, jau::nsize_t cIdx, bool isShifted) const noexcept
 
std::string toString () const noexcept
 
uint32_t toU32 (const uint8_t *src) const
 
constexpr uint32_t toU32 (uint8_t c1NormI8) const noexcept
 
constexpr uint32_t toU32 (uint8_t c1NormI8, uint8_t c2NormI8, uint8_t c3NormI8) const noexcept
 
constexpr uint32_t toU32 (uint8_t c1NormI8, uint8_t c2NormI8, uint8_t c3NormI8, uint8_t c4NormI8) const noexcept
 

Friends

class PixelFormats
 

Detailed Description

Packed pixel composition, i.e.

layout of its components.

Components are interleaved, i.e. packed.

Definition at line 53 of file PixelFormat.hpp.

Member Function Documentation

◆ toString()

std::string gamp::render::pixel::PixelFormat::toString ( ) const
inlinenoexcept

Definition at line 149 of file PixelFormat.hpp.

Here is the caller graph for this function:

◆ isUniform()

bool gamp::render::pixel::PixelFormat::isUniform ( ) const
inlineconstexprnoexcept

Returns true if all components are of same bit-size, e.g.

RGBA8888, otherwise false, e.g. RGBA5551

Definition at line 159 of file PixelFormat.hpp.

◆ isInterleaved()

bool gamp::render::pixel::PixelFormat::isInterleaved ( ) const
inlineconstexprnoexcept

Returns true if all components are packed, i.e.

interleaved, e.g. RGBA8888, otherwise false.

Instances of PixelFormat returns true.

Definition at line 167 of file PixelFormat.hpp.

◆ size()

jau::nsize_t gamp::render::pixel::PixelFormat::size ( ) const
inlineconstexprnoexcept

Number of components per pixel, e.g.

3 for RGBx8888.

Definition at line 170 of file PixelFormat.hpp.

Here is the caller graph for this function:

◆ bitsPerPixel()

uint32_t gamp::render::pixel::PixelFormat::bitsPerPixel ( ) const
inlineconstexprnoexcept

Number of bits per pixel, e.g.

24 bits for RGBx8888.

Definition at line 173 of file PixelFormat.hpp.

Here is the caller graph for this function:

◆ bitStride()

uint32_t gamp::render::pixel::PixelFormat::bitStride ( ) const
inlineconstexprnoexcept

Bit distance between pixels.

For packed pixels e.g. 32 bits for RGBx8888.

Definition at line 180 of file PixelFormat.hpp.

Here is the caller graph for this function:

◆ bytesPerPixel()

uint32_t gamp::render::pixel::PixelFormat::bytesPerPixel ( ) const
inlineconstexprnoexcept

Number of bytes per pixel, i.e.

packed bitStride() in bytes, e.g. 4 for RGBx8888.

Definition at line 183 of file PixelFormat.hpp.

Here is the caller graph for this function:

◆ order()

const comparray4_t & gamp::render::pixel::PixelFormat::order ( ) const
inlineconstexprnoexcept

Returns the Component type order of all components, see componentBitMask().

Definition at line 186 of file PixelFormat.hpp.

Here is the caller graph for this function:

◆ find()

uint32_t gamp::render::pixel::PixelFormat::find ( CType s) const
inlineconstexprnoexcept

Returns first index of given CType within componentOrder(), -1 if not exists.

Definition at line 189 of file PixelFormat.hpp.

◆ bitMask()

const u32array4_t & gamp::render::pixel::PixelFormat::bitMask ( ) const
inlineconstexprnoexcept

Definition at line 191 of file PixelFormat.hpp.

Here is the caller graph for this function:

◆ bitCount()

const u32array4_t & gamp::render::pixel::PixelFormat::bitCount ( ) const
inlineconstexprnoexcept

Definition at line 193 of file PixelFormat.hpp.

Here is the caller graph for this function:

◆ bitShift()

const u32array4_t & gamp::render::pixel::PixelFormat::bitShift ( ) const
inlineconstexprnoexcept

Definition at line 195 of file PixelFormat.hpp.

◆ toU32() [1/4]

uint32_t gamp::render::pixel::PixelFormat::toU32 ( uint8_t c1NormI8) const
inlineconstexprnoexcept

Definition at line 197 of file PixelFormat.hpp.

Here is the caller graph for this function:

◆ toU32() [2/4]

uint32_t gamp::render::pixel::PixelFormat::toU32 ( uint8_t c1NormI8,
uint8_t c2NormI8,
uint8_t c3NormI8 ) const
inlineconstexprnoexcept

Definition at line 200 of file PixelFormat.hpp.

◆ toU32() [3/4]

uint32_t gamp::render::pixel::PixelFormat::toU32 ( uint8_t c1NormI8,
uint8_t c2NormI8,
uint8_t c3NormI8,
uint8_t c4NormI8 ) const
inlineconstexprnoexcept

Definition at line 205 of file PixelFormat.hpp.

◆ toU32() [4/4]

uint32_t gamp::render::pixel::PixelFormat::toU32 ( const uint8_t * src) const
inline

Definition at line 211 of file PixelFormat.hpp.

◆ toFloat()

float gamp::render::pixel::PixelFormat::toFloat ( uint32_t v,
jau::nsize_t cIdx,
bool isShifted ) const
inlineconstexprnoexcept

Definition at line 223 of file PixelFormat.hpp.

Here is the caller graph for this function:

◆ fromFloat()

uint32_t gamp::render::pixel::PixelFormat::fromFloat ( float f,
uint32_t cIdx,
bool shiftResult ) const
inlineconstexprnoexcept

Definition at line 230 of file PixelFormat.hpp.

Here is the caller graph for this function:

◆ defaultValue()

uint32_t gamp::render::pixel::PixelFormat::defaultValue ( uint32_t cIdx,
bool shiftResult ) const
inlineconstexprnoexcept

Definition at line 235 of file PixelFormat.hpp.

Here is the caller graph for this function:

◆ hashCode()

size_t gamp::render::pixel::PixelFormat::hashCode ( ) const
inlineconstexprnoexcept

Definition at line 241 of file PixelFormat.hpp.

◆ operator==()

bool gamp::render::pixel::PixelFormat::operator== ( const PixelFormat & rhs) const
inlineconstexprnoexcept

Definition at line 243 of file PixelFormat.hpp.

Friends And Related Symbol Documentation

◆ PixelFormats

friend class PixelFormats
friend

Definition at line 55 of file PixelFormat.hpp.


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