Beatmup
Beatmup::SingleByteBitmapWriter Class Reference

Single byte bitmap writer. More...

#include <bitmap_access.h>

Inheritance diagram for Beatmup::SingleByteBitmapWriter:
Beatmup::SingleByteBitmapReader Beatmup::BitmapContentModifier Beatmup::CustomBitmapScanner< pixbyte, 1 >

Public Member Functions

void assign (int x)
 
void assign (int r, int g, int b)
 
void assign (int r, int g, int b, int a)
 
void assign (float x)
 
void assign (float r, float g, float b)
 
void assign (float r, float g, float b, float a)
 
void operator<< (const pixint1 &P)
 
void operator<< (const pixint3 &P)
 
void operator<< (const pixint4 &P)
 
void operator<< (const pixfloat1 &P)
 
void operator<< (const pixfloat3 &P)
 
void operator<< (const pixfloat4 &P)
 
void operator= (const pixint1 &P)
 
void operator= (const pixint3 &P)
 
void operator= (const pixint4 &P)
 
void operator= (const pixfloat1 &P)
 
void operator= (const pixfloat3 &P)
 
void operator= (const pixfloat4 &P)
 
 SingleByteBitmapWriter (AbstractBitmap &bitmap, int x=0, int y=0)
 
- Public Member Functions inherited from Beatmup::SingleByteBitmapReader
pixint1 operator() () const
 Returns value at current position. More...
 
pixint1 operator() (int x, int y) const
 Returns value at pixel (x,y) position. More...
 
const pixint1 operator[] (int i) const
 Retrieves a value at position shifted by i pixels in scanline order with respect to the current position. More...
 
 SingleByteBitmapReader (const AbstractBitmap &bitmap, int x=0, int y=0)
 
- Public Member Functions inherited from Beatmup::CustomBitmapScanner< pixbyte, 1 >
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)
 

Additional Inherited Members

- Public Types inherited from Beatmup::SingleByteBitmapReader
typedef pixint1 pixtype
 
- Public Types inherited from Beatmup::CustomBitmapScanner< pixbyte, 1 >
typedef pixbyte pixvaltype
 
- Public Attributes inherited from Beatmup::SingleByteBitmapReader
const int MAX_VALUE = 255
 
- Public Attributes inherited from Beatmup::CustomBitmapScanner< pixbyte, 1 >
const int NUMBER_OF_CHANNELS
 
- Protected Member Functions inherited from Beatmup::CustomBitmapScanner< pixbyte, 1 >
pixbytejump (int x, int y) const
 Retrieves pixel address at a given position;. More...
 
- Protected Attributes inherited from Beatmup::CustomBitmapScanner< pixbyte, 1 >
pixbytedata
 bitmap data More...
 
pixbyteptr
 pointer to the current pixel More...
 
int width
 
int height
 bitmap sizes in pixels More...
 
- Private Member Functions inherited from Beatmup::BitmapContentModifier
 BitmapContentModifier (AbstractBitmap &bitmap)
 

Detailed Description

Single byte bitmap writer.

Definition at line 336 of file bitmap_access.h.

Constructor & Destructor Documentation

◆ SingleByteBitmapWriter()

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

Definition at line 410 of file bitmap_access.h.

BitmapContentModifier(AbstractBitmap &bitmap)
Definition: bitmap_access.h:60
SingleByteBitmapReader(const AbstractBitmap &bitmap, int x=0, int y=0)
jobject jlong jint jint y
jobject jlong jint x
Beatmup::InternalBitmap * bitmap

Member Function Documentation

◆ assign() [1/6]

void Beatmup::SingleByteBitmapWriter::assign ( int  x)
inline

Definition at line 338 of file bitmap_access.h.

338  {
339  *ptr = clipPixint(x);
340  }
pixbyte * ptr
pointer to the current pixel
Definition: bitmap_access.h:69
pixbyte clipPixint(int x)
Clips an integer pixel value to 0..255 range.

◆ assign() [2/6]

void Beatmup::SingleByteBitmapWriter::assign ( int  r,
int  g,
int  b 
)
inline

Definition at line 342 of file bitmap_access.h.

342  {
343  *ptr = clipPixint((r + g + b) / 3);
344  }
jobject jlong jint jint jint jint g
jobject jlong jint jint jint jint jint b
jobject jlong jint jint jint r

◆ assign() [3/6]

void Beatmup::SingleByteBitmapWriter::assign ( int  r,
int  g,
int  b,
int  a 
)
inline

Definition at line 346 of file bitmap_access.h.

346  {
347  *ptr = clipPixint((r + g + b) / 3);
348  }

◆ assign() [4/6]

void Beatmup::SingleByteBitmapWriter::assign ( float  x)
inline

Definition at line 350 of file bitmap_access.h.

350  {
351  *ptr = pixfloat2pixbyte(x);
352  }
pixbyte pixfloat2pixbyte(pixfloat x)
Converts a floating point pixel value to a 0..255 integer.

◆ assign() [5/6]

void Beatmup::SingleByteBitmapWriter::assign ( float  r,
float  g,
float  b 
)
inline

Definition at line 354 of file bitmap_access.h.

354  {
355  *ptr = pixfloat2pixbyte((r + g + b) / 3);
356  }

◆ assign() [6/6]

void Beatmup::SingleByteBitmapWriter::assign ( float  r,
float  g,
float  b,
float  a 
)
inline

Definition at line 358 of file bitmap_access.h.

358  {
359  *ptr = pixfloat2pixbyte((r + g + b) / 3);
360  }

◆ operator<<() [1/6]

void Beatmup::SingleByteBitmapWriter::operator<< ( const pixint1 P)
inline

Definition at line 362 of file bitmap_access.h.

362  {
363  assign(P.x);
364  }

◆ operator<<() [2/6]

void Beatmup::SingleByteBitmapWriter::operator<< ( const pixint3 P)
inline

Definition at line 366 of file bitmap_access.h.

366  {
367  assign(P.r, P.g, P.b);
368  }

◆ operator<<() [3/6]

void Beatmup::SingleByteBitmapWriter::operator<< ( const pixint4 P)
inline

Definition at line 370 of file bitmap_access.h.

370  {
371  *ptr = clipPixint(((P.r + P.g + P.b) * P.a + *ptr * (255 - P.a) * 3) / 765);
372  }

◆ operator<<() [4/6]

void Beatmup::SingleByteBitmapWriter::operator<< ( const pixfloat1 P)
inline

Definition at line 374 of file bitmap_access.h.

374  {
375  assign(P.x);
376  }

◆ operator<<() [5/6]

void Beatmup::SingleByteBitmapWriter::operator<< ( const pixfloat3 P)
inline

Definition at line 378 of file bitmap_access.h.

378  {
379  assign(P.r, P.g, P.b);
380  }

◆ operator<<() [6/6]

void Beatmup::SingleByteBitmapWriter::operator<< ( const pixfloat4 P)
inline

Definition at line 382 of file bitmap_access.h.

382  {
383  *ptr = pixfloat2pixbyte((P.r + P.g + P.b) * P.a / 3 + *ptr * (1 - P.a));
384  }

◆ operator=() [1/6]

void Beatmup::SingleByteBitmapWriter::operator= ( const pixint1 P)
inline

Definition at line 386 of file bitmap_access.h.

386  {
387  assign(P.x);
388  }

◆ operator=() [2/6]

void Beatmup::SingleByteBitmapWriter::operator= ( const pixint3 P)
inline

Definition at line 390 of file bitmap_access.h.

390  {
391  assign(P.r, P.g, P.b);
392  }

◆ operator=() [3/6]

void Beatmup::SingleByteBitmapWriter::operator= ( const pixint4 P)
inline

Definition at line 394 of file bitmap_access.h.

394  {
395  assign(P.r, P.g, P.b, P.a);
396  }

◆ operator=() [4/6]

void Beatmup::SingleByteBitmapWriter::operator= ( const pixfloat1 P)
inline

Definition at line 398 of file bitmap_access.h.

398  {
399  assign(P.x);
400  }

◆ operator=() [5/6]

void Beatmup::SingleByteBitmapWriter::operator= ( const pixfloat3 P)
inline

Definition at line 402 of file bitmap_access.h.

402  {
403  assign(P.r, P.g, P.b);
404  }

◆ operator=() [6/6]

void Beatmup::SingleByteBitmapWriter::operator= ( const pixfloat4 P)
inline

Definition at line 406 of file bitmap_access.h.

406  {
407  assign(P.r, P.g, P.b, P.a);
408  }

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