StuBS
Loading...
Searching...
No Matches
Framebuffer< COLORDEPTH, OFFSET_RED, OFFSET_GREEN, OFFSET_BLUE, BITS_RED, BITS_GREEN, BITS_BLUE >::Pixel Union Reference

Pixel (colored) More...

#include <framebuffer.h>

Collaboration diagram for Framebuffer< COLORDEPTH, OFFSET_RED, OFFSET_GREEN, OFFSET_BLUE, BITS_RED, BITS_GREEN, BITS_BLUE >::Pixel:

Public Member Functions

 Pixel (const unsigned data)
 Constructor (using RGB value)
 
 Pixel (const unsigned r, const unsigned g, const unsigned b)
 Constructor (using explicit RGB components)
 
template<bool ALPHA, unsigned BITS>
 Pixel (const struct SpritePixel< RGB, ALPHA, BITS > &other)
 Constructor (using SpritePixel)
 
Color getColor () const
 Get color of pixel.
 
template<unsigned BITS>
Pixeloperator= (const struct SpritePixel< RGB, false, BITS > &other)
 Assign pixel (with colored SpritePixel)
 
template<unsigned BITS>
Pixeloperator= (const struct SpritePixel< GREYSCALE, false, BITS > &other)
 Assign pixel (with greyscale SpritePixel)
 
template<unsigned BITS>
Pixeloperator= (const struct SpritePixel< RGB, true, BITS > &other)
 Assign pixel (with greyscale SpritePixel supporting transparency)
 
template<unsigned BITS>
Pixeloperator= (const struct SpritePixel< GREYSCALE, true, BITS > &other)
 Assign pixel (with greyscale SpritePixel supporting transparency)
 

Public Attributes

struct { 
 
   unsigned   data: COLORDEPTH 
 RGB value.
 
};  
 Bits per pixel.
 
PixelComponent< OFFSET_RED, BITS_RED > red
 Red color component.
 
PixelComponent< OFFSET_GREEN, BITS_GREEN > green
 Green color component.
 
PixelComponent< OFFSET_BLUE, BITS_BLUE > blue
 Blue color component.
 

Detailed Description

template<unsigned char COLORDEPTH, unsigned char OFFSET_RED, unsigned char OFFSET_GREEN, unsigned char OFFSET_BLUE, unsigned char BITS_RED, unsigned char BITS_GREEN, unsigned char BITS_BLUE>
union Framebuffer< COLORDEPTH, OFFSET_RED, OFFSET_GREEN, OFFSET_BLUE, BITS_RED, BITS_GREEN, BITS_BLUE >::Pixel

Pixel (colored)

Constructor & Destructor Documentation

◆ Pixel() [1/3]

template<unsigned char COLORDEPTH, unsigned char OFFSET_RED, unsigned char OFFSET_GREEN, unsigned char OFFSET_BLUE, unsigned char BITS_RED, unsigned char BITS_GREEN, unsigned char BITS_BLUE>
Framebuffer< COLORDEPTH, OFFSET_RED, OFFSET_GREEN, OFFSET_BLUE, BITS_RED, BITS_GREEN, BITS_BLUE >::Pixel::Pixel ( const unsigned data)
inlineexplicit

Constructor (using RGB value)

Parameters
dataRGB value

◆ Pixel() [2/3]

template<unsigned char COLORDEPTH, unsigned char OFFSET_RED, unsigned char OFFSET_GREEN, unsigned char OFFSET_BLUE, unsigned char BITS_RED, unsigned char BITS_GREEN, unsigned char BITS_BLUE>
Framebuffer< COLORDEPTH, OFFSET_RED, OFFSET_GREEN, OFFSET_BLUE, BITS_RED, BITS_GREEN, BITS_BLUE >::Pixel::Pixel ( const unsigned r,
const unsigned g,
const unsigned b )
inline

Constructor (using explicit RGB components)

Unused bits are zeroed.

Parameters
rRed color component
gGreen color component
bBlue color component

◆ Pixel() [3/3]

template<unsigned char COLORDEPTH, unsigned char OFFSET_RED, unsigned char OFFSET_GREEN, unsigned char OFFSET_BLUE, unsigned char BITS_RED, unsigned char BITS_GREEN, unsigned char BITS_BLUE>
template<bool ALPHA, unsigned BITS>
Framebuffer< COLORDEPTH, OFFSET_RED, OFFSET_GREEN, OFFSET_BLUE, BITS_RED, BITS_GREEN, BITS_BLUE >::Pixel::Pixel ( const struct SpritePixel< RGB, ALPHA, BITS > & other)
inlineexplicit

Constructor (using SpritePixel)

Template Parameters
ALPHAtrue if alpha channel
BITSSize of mask
Parameters
otherother

Member Function Documentation

◆ getColor()

template<unsigned char COLORDEPTH, unsigned char OFFSET_RED, unsigned char OFFSET_GREEN, unsigned char OFFSET_BLUE, unsigned char BITS_RED, unsigned char BITS_GREEN, unsigned char BITS_BLUE>
Color Framebuffer< COLORDEPTH, OFFSET_RED, OFFSET_GREEN, OFFSET_BLUE, BITS_RED, BITS_GREEN, BITS_BLUE >::Pixel::getColor ( ) const
inline

Get color of pixel.

Returns
color of pixel

◆ operator=() [1/4]

template<unsigned char COLORDEPTH, unsigned char OFFSET_RED, unsigned char OFFSET_GREEN, unsigned char OFFSET_BLUE, unsigned char BITS_RED, unsigned char BITS_GREEN, unsigned char BITS_BLUE>
template<unsigned BITS>
Pixel & Framebuffer< COLORDEPTH, OFFSET_RED, OFFSET_GREEN, OFFSET_BLUE, BITS_RED, BITS_GREEN, BITS_BLUE >::Pixel::operator= ( const struct SpritePixel< GREYSCALE, false, BITS > & other)
inline

Assign pixel (with greyscale SpritePixel)

Template Parameters
BITSSize of other pixels mask
Parameters
otherother pixel

◆ operator=() [2/4]

template<unsigned char COLORDEPTH, unsigned char OFFSET_RED, unsigned char OFFSET_GREEN, unsigned char OFFSET_BLUE, unsigned char BITS_RED, unsigned char BITS_GREEN, unsigned char BITS_BLUE>
template<unsigned BITS>
Pixel & Framebuffer< COLORDEPTH, OFFSET_RED, OFFSET_GREEN, OFFSET_BLUE, BITS_RED, BITS_GREEN, BITS_BLUE >::Pixel::operator= ( const struct SpritePixel< GREYSCALE, true, BITS > & other)
inline

Assign pixel (with greyscale SpritePixel supporting transparency)

Template Parameters
BITSSize of other pixels mask
Parameters
otherother pixel

◆ operator=() [3/4]

template<unsigned char COLORDEPTH, unsigned char OFFSET_RED, unsigned char OFFSET_GREEN, unsigned char OFFSET_BLUE, unsigned char BITS_RED, unsigned char BITS_GREEN, unsigned char BITS_BLUE>
template<unsigned BITS>
Pixel & Framebuffer< COLORDEPTH, OFFSET_RED, OFFSET_GREEN, OFFSET_BLUE, BITS_RED, BITS_GREEN, BITS_BLUE >::Pixel::operator= ( const struct SpritePixel< RGB, false, BITS > & other)
inline

Assign pixel (with colored SpritePixel)

Template Parameters
BITSSize of other pixels mask
Parameters
otherother pixel

◆ operator=() [4/4]

template<unsigned char COLORDEPTH, unsigned char OFFSET_RED, unsigned char OFFSET_GREEN, unsigned char OFFSET_BLUE, unsigned char BITS_RED, unsigned char BITS_GREEN, unsigned char BITS_BLUE>
template<unsigned BITS>
Pixel & Framebuffer< COLORDEPTH, OFFSET_RED, OFFSET_GREEN, OFFSET_BLUE, BITS_RED, BITS_GREEN, BITS_BLUE >::Pixel::operator= ( const struct SpritePixel< RGB, true, BITS > & other)
inline

Assign pixel (with greyscale SpritePixel supporting transparency)

Template Parameters
BITSSize of other pixels mask
Parameters
otherother pixel

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