Beatmup
Beatmup::TripleByteBitmapWriter Class Reference

Triple byte bitmap writer. More...

#include <bitmap_access.h>

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

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)
 
 TripleByteBitmapWriter (AbstractBitmap &bitmap, int x=0, int y=0)
 
- Public Member Functions inherited from Beatmup::TripleByteBitmapReader
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)
 

Additional Inherited Members

- Public Types inherited from Beatmup::TripleByteBitmapReader
typedef pixint3 pixtype
 
- Public Types inherited from Beatmup::CustomBitmapScanner< pixbyte, 3 >
typedef pixbyte pixvaltype
 
- Public Attributes inherited from Beatmup::TripleByteBitmapReader
const int MAX_VALUE = 255
 
- Public Attributes inherited from Beatmup::CustomBitmapScanner< pixbyte, 3 >
const int NUMBER_OF_CHANNELS
 
- 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...
 
- Private Member Functions inherited from Beatmup::BitmapContentModifier
 BitmapContentModifier (AbstractBitmap &bitmap)
 

Detailed Description

Triple byte bitmap writer.

Definition at line 417 of file bitmap_access.h.

Constructor & Destructor Documentation

◆ TripleByteBitmapWriter()

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

Definition at line 504 of file bitmap_access.h.

BitmapContentModifier(AbstractBitmap &bitmap)
Definition: bitmap_access.h:60
TripleByteBitmapReader(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::TripleByteBitmapWriter::assign ( int  x)
inline

Definition at line 419 of file bitmap_access.h.

419  {
421  }
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.
static const struct Beatmup::@2 CHANNELS_3

◆ assign() [2/6]

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

Definition at line 423 of file bitmap_access.h.

423  {
424  ptr[CHANNELS_3.R] = clipPixint(r);
425  ptr[CHANNELS_3.G] = clipPixint(g);
426  ptr[CHANNELS_3.B] = clipPixint(b);
427  }
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::TripleByteBitmapWriter::assign ( int  r,
int  g,
int  b,
int  a 
)
inline

Definition at line 429 of file bitmap_access.h.

429  {
430  ptr[CHANNELS_3.R] = clipPixint(r);
431  ptr[CHANNELS_3.G] = clipPixint(g);
432  ptr[CHANNELS_3.B] = clipPixint(b);
433  }

◆ assign() [4/6]

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

Definition at line 435 of file bitmap_access.h.

435  {
437  }
pixbyte pixfloat2pixbyte(pixfloat x)
Converts a floating point pixel value to a 0..255 integer.

◆ assign() [5/6]

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

Definition at line 439 of file bitmap_access.h.

439  {
443  }

◆ assign() [6/6]

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

Definition at line 445 of file bitmap_access.h.

445  {
449  }

◆ operator<<() [1/6]

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

Definition at line 451 of file bitmap_access.h.

451  {
452  assign(P.x);
453  }

◆ operator<<() [2/6]

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

Definition at line 455 of file bitmap_access.h.

455  {
456  assign(P.r, P.g, P.b);
457  }

◆ operator<<() [3/6]

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

Definition at line 459 of file bitmap_access.h.

459  {
460  ptr[CHANNELS_3.R] = clipPixint((P.r * P.a + ptr[CHANNELS_3.R] * (255 - P.a)) / 255);
461  ptr[CHANNELS_3.G] = clipPixint((P.g * P.a + ptr[CHANNELS_3.G] * (255 - P.a)) / 255);
462  ptr[CHANNELS_3.B] = clipPixint((P.b * P.a + ptr[CHANNELS_3.B] * (255 - P.a)) / 255);
463  }

◆ operator<<() [4/6]

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

Definition at line 465 of file bitmap_access.h.

465  {
466  assign(P.x);
467  }

◆ operator<<() [5/6]

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

Definition at line 469 of file bitmap_access.h.

469  {
470  assign(P.r, P.g, P.b);
471  }

◆ operator<<() [6/6]

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

Definition at line 473 of file bitmap_access.h.

473  {
474  float _a = (1 - P.a) / 255;
475  ptr[CHANNELS_3.R] = pixfloat2pixbyte(P.r * P.a + ptr[CHANNELS_3.R] * _a);
476  ptr[CHANNELS_3.G] = pixfloat2pixbyte(P.g * P.a + ptr[CHANNELS_3.G] * _a);
477  ptr[CHANNELS_3.B] = pixfloat2pixbyte(P.b * P.a + ptr[CHANNELS_3.B] * _a);
478  }

◆ operator=() [1/6]

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

Definition at line 480 of file bitmap_access.h.

480  {
481  assign(P.x);
482  }

◆ operator=() [2/6]

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

Definition at line 484 of file bitmap_access.h.

484  {
485  assign(P.r, P.g, P.b);
486  }

◆ operator=() [3/6]

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

Definition at line 488 of file bitmap_access.h.

488  {
489  assign(P.r, P.g, P.b, P.a);
490  }

◆ operator=() [4/6]

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

Definition at line 492 of file bitmap_access.h.

492  {
493  assign(P.x);
494  }

◆ operator=() [5/6]

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

Definition at line 496 of file bitmap_access.h.

496  {
497  assign(P.r, P.g, P.b);
498  }

◆ operator=() [6/6]

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

Definition at line 500 of file bitmap_access.h.

500  {
501  assign(P.r, P.g, P.b, P.a);
502  }

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