Beatmup
Beatmup::TripleByteBitmapReader Class Reference

Triple byte bitmap reader. More...

#include <bitmap_access.h>

Inheritance diagram for Beatmup::TripleByteBitmapReader:
Beatmup::CustomBitmapScanner< pixbyte, 3 > Beatmup::TripleByteBilinearInterpolator Beatmup::TripleByteBitmapWriter

Public Types

typedef pixint3 pixtype
 
- Public Types inherited from Beatmup::CustomBitmapScanner< pixbyte, 3 >
typedef pixbyte pixvaltype
 

Public Member Functions

pixint3 operator() () const
 
pixint3 operator() (int x, int y) const
 
const pixint3 operator[] (int i) const
 Retrieves a value at position shifted by i pixels in scanline order with respect to the current position. More...
 
 TripleByteBitmapReader (const AbstractBitmap &bitmap, int x=0, int y=0)
 
- Public Member Functions inherited from Beatmup::CustomBitmapScanner< pixbyte, 3 >
bool operator< (const CustomBitmapScanner &another) const
 
pixbyteoperator* () const
 
void operator++ (int)
 Move the current position ONE PIXEL forward. More...
 
void operator+= (const int n)
 Move the current position N pixels forward. More...
 
void goTo (int x, int y)
 Changes current position. More...
 
int getWidth () const
 Returns bitmap width in pixels. More...
 
int getHeight () const
 Returns bitmap height in pixels. More...
 
 CustomBitmapScanner (const AbstractBitmap &bitmap, int x=0, int y=0)
 

Public Attributes

const int MAX_VALUE = 255
 
- Public Attributes inherited from Beatmup::CustomBitmapScanner< pixbyte, 3 >
const int NUMBER_OF_CHANNELS
 

Additional Inherited Members

- Protected Member Functions inherited from Beatmup::CustomBitmapScanner< pixbyte, 3 >
pixbytejump (int x, int y) const
 Retrieves pixel address at a given position;. More...
 
- Protected Attributes inherited from Beatmup::CustomBitmapScanner< pixbyte, 3 >
pixbytedata
 bitmap data More...
 
pixbyteptr
 pointer to the current pixel More...
 
int width
 
int height
 bitmap sizes in pixels More...
 

Detailed Description

Triple byte bitmap reader.

Definition at line 181 of file bitmap_access.h.

Member Typedef Documentation

◆ pixtype

Constructor & Destructor Documentation

◆ TripleByteBitmapReader()

Beatmup::TripleByteBitmapReader::TripleByteBitmapReader ( const AbstractBitmap bitmap,
int  x = 0,
int  y = 0 
)
inline

Definition at line 204 of file bitmap_access.h.

CustomBitmapScanner(const AbstractBitmap &bitmap, int x=0, int y=0)
jobject jlong jint jint y
jobject jlong jint x
Beatmup::InternalBitmap * bitmap

Member Function Documentation

◆ operator()() [1/2]

pixint3 Beatmup::TripleByteBitmapReader::operator() ( ) const
inline

Definition at line 187 of file bitmap_access.h.

187  {
188  return pixint3{ ptr[CHANNELS_3.R], ptr[CHANNELS_3.G], ptr[CHANNELS_3.B] };
189  }
pixbyte * ptr
pointer to the current pixel
Definition: bitmap_access.h:69
static const struct Beatmup::@2 CHANNELS_3

◆ operator()() [2/2]

pixint3 Beatmup::TripleByteBitmapReader::operator() ( int  x,
int  y 
) const
inline

Definition at line 191 of file bitmap_access.h.

191  {
192  int i = 3 * (y * width + x);
193  return pixint3{ data[i + CHANNELS_3.R], data[i + CHANNELS_3.G], data[i + CHANNELS_3.B] };
194  }

◆ operator[]()

const pixint3 Beatmup::TripleByteBitmapReader::operator[] ( int  i) const
inline

Retrieves a value at position shifted by i pixels in scanline order with respect to the current position.

Definition at line 199 of file bitmap_access.h.

199  {
200  const pixbyte* p = ptr + 3 * i;
201  return pixint3{ p[CHANNELS_3.R], p[CHANNELS_3.G], p[CHANNELS_3.B] };
202  }
uint8_t pixbyte
Definition: basic_types.h:34
Beatmup::IntPoint p((int) x,(int) y)

Member Data Documentation

◆ MAX_VALUE

const int Beatmup::TripleByteBitmapReader::MAX_VALUE = 255

Definition at line 185 of file bitmap_access.h.


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