Beatmup
Beatmup::MaskScanner< num_bits > Class Template Reference

A generic to access mask bitmap data. More...

#include <mask_bitmap_access.h>

Inheritance diagram for Beatmup::MaskScanner< num_bits >:
Beatmup::LookupMaskScanner< num_bits, lookup > Beatmup::LookupMaskWriter< num_bits, lookup >

Public Types

typedef unsigned char pixvaltype
 
typedef pixint1 pixtype
 

Public Member Functions

bool operator< (const MaskScanner &another) const
 
pixtypeoperator* () const
 
int getWidth () const
 Returns bitmap width in pixels. More...
 
int getHeight () const
 Returns bitmap height in pixels. More...
 

Public Attributes

const int NUMBER_OF_CHANNELS = 1
 
const int NUMBER_OF_BITS = num_bits
 
const int MAX_VALUE = 255
 
const int MAX_UNNORM_VALUE = (1 << num_bits) - 1
 

Protected Member Functions

 MaskScanner (const AbstractBitmap &bitmap)
 

Protected Attributes

unsigned char * data
 all bitmap data More...
 
unsigned char * ptr
 pointer to current pixel More...
 
unsigned char bit
 current position bit More...
 
int width
 
int height
 bitmap size in pixels More...
 

Detailed Description

template<const int num_bits>
class Beatmup::MaskScanner< num_bits >

A generic to access mask bitmap data.

Definition at line 28 of file mask_bitmap_access.h.

Member Typedef Documentation

◆ pixvaltype

template<const int num_bits>
typedef unsigned char Beatmup::MaskScanner< num_bits >::pixvaltype

Definition at line 47 of file mask_bitmap_access.h.

◆ pixtype

template<const int num_bits>
typedef pixint1 Beatmup::MaskScanner< num_bits >::pixtype

Definition at line 48 of file mask_bitmap_access.h.

Constructor & Destructor Documentation

◆ MaskScanner()

template<const int num_bits>
Beatmup::MaskScanner< num_bits >::MaskScanner ( const AbstractBitmap bitmap)
inlineprotected

Definition at line 36 of file mask_bitmap_access.h.

36  {
37 #ifdef BEATMUP_DEBUG
38  DebugAssertion::check(bitmap.getBitsPerPixel() == num_bits,
39  "Invalid mask bitmap scanner");
40 #endif
41  width = bitmap.getWidth();
43  data = (unsigned char*)bitmap.getData(0, 0);
44  }
const unsigned char getBitsPerPixel() const
Returns number of bits per pixel stored in each bitmap.
const pixbyte * getData(int x, int y) const
Returns a pointer to given pixel.
const int getHeight() const
Height of the texture in pixels.
const int getWidth() const
Width of the texture in pixels.
int height
bitmap size in pixels
unsigned char * data
all bitmap data
Beatmup::InternalBitmap * bitmap

Member Function Documentation

◆ operator<()

template<const int num_bits>
bool Beatmup::MaskScanner< num_bits >::operator< ( const MaskScanner< num_bits > &  another) const
inline

Definition at line 56 of file mask_bitmap_access.h.

56  {
57  return (ptr < another.ptr) || (ptr == another.ptr && bit < another.bit);
58  }
unsigned char bit
current position bit
unsigned char * ptr
pointer to current pixel

◆ operator*()

template<const int num_bits>
pixtype* Beatmup::MaskScanner< num_bits >::operator* ( ) const
inline

Definition at line 60 of file mask_bitmap_access.h.

60  {
61  return (pixtype*)ptr;
62  }

◆ getWidth()

template<const int num_bits>
int Beatmup::MaskScanner< num_bits >::getWidth ( ) const
inline

Returns bitmap width in pixels.

Definition at line 67 of file mask_bitmap_access.h.

67  {
68  return width;
69  }

◆ getHeight()

template<const int num_bits>
int Beatmup::MaskScanner< num_bits >::getHeight ( ) const
inline

Returns bitmap height in pixels.

Definition at line 74 of file mask_bitmap_access.h.

74  {
75  return height;
76  }

Member Data Documentation

◆ data

template<const int num_bits>
unsigned char* Beatmup::MaskScanner< num_bits >::data
protected

all bitmap data

Definition at line 31 of file mask_bitmap_access.h.

◆ ptr

template<const int num_bits>
unsigned char * Beatmup::MaskScanner< num_bits >::ptr
protected

pointer to current pixel

Definition at line 32 of file mask_bitmap_access.h.

◆ bit

template<const int num_bits>
unsigned char Beatmup::MaskScanner< num_bits >::bit
protected

current position bit

Definition at line 33 of file mask_bitmap_access.h.

◆ width

template<const int num_bits>
int Beatmup::MaskScanner< num_bits >::width
protected

Definition at line 34 of file mask_bitmap_access.h.

◆ height

template<const int num_bits>
int Beatmup::MaskScanner< num_bits >::height
protected

bitmap size in pixels

Definition at line 34 of file mask_bitmap_access.h.

◆ NUMBER_OF_CHANNELS

template<const int num_bits>
const int Beatmup::MaskScanner< num_bits >::NUMBER_OF_CHANNELS = 1

Definition at line 51 of file mask_bitmap_access.h.

◆ NUMBER_OF_BITS

template<const int num_bits>
const int Beatmup::MaskScanner< num_bits >::NUMBER_OF_BITS = num_bits

Definition at line 52 of file mask_bitmap_access.h.

◆ MAX_VALUE

template<const int num_bits>
const int Beatmup::MaskScanner< num_bits >::MAX_VALUE = 255

Definition at line 53 of file mask_bitmap_access.h.

◆ MAX_UNNORM_VALUE

template<const int num_bits>
const int Beatmup::MaskScanner< num_bits >::MAX_UNNORM_VALUE = (1 << num_bits) - 1

Definition at line 54 of file mask_bitmap_access.h.


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