Beatmup
Beatmup::QuadByteBitmapWriter Class Reference

Quad byte bitmap writer. More...

#include <bitmap_access.h>

Inheritance diagram for Beatmup::QuadByteBitmapWriter:
Beatmup::QuadByteBitmapReader Beatmup::BitmapContentModifier Beatmup::CustomBitmapScanner< pixbyte, 4 >

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)
 
 QuadByteBitmapWriter (AbstractBitmap &bitmap, int x=0, int y=0)
 
- Public Member Functions inherited from Beatmup::QuadByteBitmapReader
pixint4 operator() () const
 
pixint4 operator() (int x, int y) const
 
const pixint4 operator[] (int i) const
 Retrieves a value at position shifted by i pixels in scanline order with respect to the current position. More...
 
 QuadByteBitmapReader (const AbstractBitmap &bitmap, int x=0, int y=0)
 
- Public Member Functions inherited from Beatmup::CustomBitmapScanner< pixbyte, 4 >
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::QuadByteBitmapReader
typedef pixint4 pixtype
 
- Public Types inherited from Beatmup::CustomBitmapScanner< pixbyte, 4 >
typedef pixbyte pixvaltype
 
- Public Attributes inherited from Beatmup::QuadByteBitmapReader
const int MAX_VALUE = 255
 
- Public Attributes inherited from Beatmup::CustomBitmapScanner< pixbyte, 4 >
const int NUMBER_OF_CHANNELS
 
- Protected Member Functions inherited from Beatmup::CustomBitmapScanner< pixbyte, 4 >
pixbytejump (int x, int y) const
 Retrieves pixel address at a given position;. More...
 
- Protected Attributes inherited from Beatmup::CustomBitmapScanner< pixbyte, 4 >
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

Quad byte bitmap writer.

Definition at line 511 of file bitmap_access.h.

Constructor & Destructor Documentation

◆ QuadByteBitmapWriter()

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

Definition at line 607 of file bitmap_access.h.

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

Definition at line 513 of file bitmap_access.h.

513  {
515  ptr[CHANNELS_4.A] = 255;
516  }
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::@1 CHANNELS_4

◆ assign() [2/6]

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

Definition at line 518 of file bitmap_access.h.

518  {
519  ptr[CHANNELS_4.R] = clipPixint(r);
520  ptr[CHANNELS_4.G] = clipPixint(g);
521  ptr[CHANNELS_4.B] = clipPixint(b);
522  ptr[CHANNELS_4.A] = 255;
523  }
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::QuadByteBitmapWriter::assign ( int  r,
int  g,
int  b,
int  a 
)
inline

Definition at line 525 of file bitmap_access.h.

525  {
526  ptr[CHANNELS_4.R] = clipPixint(r);
527  ptr[CHANNELS_4.G] = clipPixint(g);
528  ptr[CHANNELS_4.B] = clipPixint(b);
529  ptr[CHANNELS_4.A] = clipPixint(a);
530  }
jobject jlong jint jint jint jint jint jint a

◆ assign() [4/6]

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

Definition at line 532 of file bitmap_access.h.

532  {
534  ptr[CHANNELS_4.A] = 255;
535  }
pixbyte pixfloat2pixbyte(pixfloat x)
Converts a floating point pixel value to a 0..255 integer.

◆ assign() [5/6]

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

Definition at line 537 of file bitmap_access.h.

537  {
541  ptr[CHANNELS_4.A] = 255;
542  }

◆ assign() [6/6]

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

Definition at line 544 of file bitmap_access.h.

544  {
549  }

◆ operator<<() [1/6]

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

Definition at line 551 of file bitmap_access.h.

551  {
552  assign(P.x);
553  }

◆ operator<<() [2/6]

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

Definition at line 555 of file bitmap_access.h.

555  {
556  assign(P.r, P.g, P.b);
557  }

◆ operator<<() [3/6]

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

Definition at line 559 of file bitmap_access.h.

559  {
560  int _a = 255 - P.a;
561  ptr[CHANNELS_4.R] = clipPixint(P.r + ptr[CHANNELS_4.R] * _a / 255);
562  ptr[CHANNELS_4.G] = clipPixint(P.g + ptr[CHANNELS_4.G] * _a / 255);
563  ptr[CHANNELS_4.B] = clipPixint(P.b + ptr[CHANNELS_4.B] * _a / 255);
564  ptr[CHANNELS_4.A] = clipPixint(255 - _a*(255 - ptr[CHANNELS_4.A]) / 255);
565  }

◆ operator<<() [4/6]

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

Definition at line 567 of file bitmap_access.h.

567  {
568  assign(P.x);
569  }

◆ operator<<() [5/6]

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

Definition at line 571 of file bitmap_access.h.

571  {
572  assign(P.r, P.g, P.b);
573  }

◆ operator<<() [6/6]

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

Definition at line 575 of file bitmap_access.h.

575  {
576  float _a = (1 - P.a) / 255;
577  ptr[CHANNELS_4.R] = pixfloat2pixbyte(P.r + ptr[CHANNELS_4.R] * _a);
578  ptr[CHANNELS_4.G] = pixfloat2pixbyte(P.g + ptr[CHANNELS_4.G] * _a);
579  ptr[CHANNELS_4.B] = pixfloat2pixbyte(P.b + ptr[CHANNELS_4.B] * _a);
580  ptr[CHANNELS_4.A] = pixfloat2pixbyte(1 - _a * (255 - ptr[CHANNELS_4.B]) / 255);
581  }

◆ operator=() [1/6]

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

Definition at line 583 of file bitmap_access.h.

583  {
584  assign(P.x);
585  }

◆ operator=() [2/6]

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

Definition at line 587 of file bitmap_access.h.

587  {
588  assign(P.r, P.g, P.b);
589  }

◆ operator=() [3/6]

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

Definition at line 591 of file bitmap_access.h.

591  {
592  assign(P.r, P.g, P.b, P.a);
593  }

◆ operator=() [4/6]

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

Definition at line 595 of file bitmap_access.h.

595  {
596  assign(P.x);
597  }

◆ operator=() [5/6]

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

Definition at line 599 of file bitmap_access.h.

599  {
600  assign(P.r, P.g, P.b);
601  }

◆ operator=() [6/6]

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

Definition at line 603 of file bitmap_access.h.

603  {
604  assign(P.r, P.g, P.b, P.a);
605  }

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