Beatmup
Beatmup::QuadFloatBitmapWriter Class Reference

Quad float bitmap writer. More...

#include <bitmap_access.h>

Inheritance diagram for Beatmup::QuadFloatBitmapWriter:
Beatmup::QuadFloatBitmapReader Beatmup::BitmapContentModifier Beatmup::CustomBitmapScanner< pixfloat, 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)
 
 QuadFloatBitmapWriter (AbstractBitmap &bitmap, int x=0, int y=0)
 
- Public Member Functions inherited from Beatmup::QuadFloatBitmapReader
pixfloat4 operator() () const
 
pixfloat4 operator() (int x, int y) const
 
pixfloat4 at (int x, int y) const
 
const pixfloat4 operator[] (int i) const
 Retrieves a value at position shifted by i pixels in scanline order with respect to the current position. More...
 
 QuadFloatBitmapReader (const AbstractBitmap &bitmap, int x=0, int y=0)
 
- Public Member Functions inherited from Beatmup::CustomBitmapScanner< pixfloat, 4 >
bool operator< (const CustomBitmapScanner &another) const
 
pixfloatoperator* () 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::QuadFloatBitmapReader
typedef pixfloat4 pixtype
 
- Public Types inherited from Beatmup::CustomBitmapScanner< pixfloat, 4 >
typedef pixfloat pixvaltype
 
- Public Attributes inherited from Beatmup::QuadFloatBitmapReader
const float MAX_VALUE = 1.0f
 
- Public Attributes inherited from Beatmup::CustomBitmapScanner< pixfloat, 4 >
const int NUMBER_OF_CHANNELS
 
- Protected Member Functions inherited from Beatmup::CustomBitmapScanner< pixfloat, 4 >
pixfloatjump (int x, int y) const
 Retrieves pixel address at a given position;. More...
 
- Protected Attributes inherited from Beatmup::CustomBitmapScanner< pixfloat, 4 >
pixfloatdata
 bitmap data More...
 
pixfloatptr
 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 float bitmap writer.

Definition at line 788 of file bitmap_access.h.

Constructor & Destructor Documentation

◆ QuadFloatBitmapWriter()

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

Definition at line 884 of file bitmap_access.h.

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

Definition at line 790 of file bitmap_access.h.

790  {
792  ptr[CHANNELS_4.A] = 1.0f;
793  }
pixfloat * ptr
pointer to the current pixel
Definition: bitmap_access.h:69
pixfloat int2pixfloat(int x)
Converts an integer value to 0..1 floating point pixel value.
static const struct Beatmup::@1 CHANNELS_4

◆ assign() [2/6]

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

Definition at line 795 of file bitmap_access.h.

795  {
799  ptr[CHANNELS_4.A] = 1.0f;
800  }
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::QuadFloatBitmapWriter::assign ( int  r,
int  g,
int  b,
int  a 
)
inline

Definition at line 802 of file bitmap_access.h.

802  {
807  }
jobject jlong jint jint jint jint jint jint a

◆ assign() [4/6]

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

Definition at line 809 of file bitmap_access.h.

809  {
811  ptr[CHANNELS_4.A] = 1.0f;
812  }
pixfloat clipPixfloat(pixfloat x)
Clips a floating point pixel value to 0..1 range.

◆ assign() [5/6]

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

Definition at line 814 of file bitmap_access.h.

814  {
818  ptr[CHANNELS_4.A] = 1.0f;
819  }

◆ assign() [6/6]

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

Definition at line 821 of file bitmap_access.h.

821  {
826  }

◆ operator<<() [1/6]

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

Definition at line 828 of file bitmap_access.h.

828  {
829  assign(P.x);
830  }

◆ operator<<() [2/6]

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

Definition at line 832 of file bitmap_access.h.

832  {
833  assign(P.r, P.g, P.b);
834  }

◆ operator<<() [3/6]

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

Definition at line 836 of file bitmap_access.h.

836  {
837  int _a = 255 - P.a;
838  ptr[CHANNELS_4.R] = clipPixfloat((P.r + ptr[CHANNELS_4.R] * _a) / 255.0f);
839  ptr[CHANNELS_4.G] = clipPixfloat((P.g + ptr[CHANNELS_4.G] * _a) / 255.0f);
840  ptr[CHANNELS_4.B] = clipPixfloat((P.b + ptr[CHANNELS_4.B] * _a) / 255.0f);
841  ptr[CHANNELS_4.A] = clipPixfloat(1 - _a * ptr[CHANNELS_4.A] / 255.0f);
842  }

◆ operator<<() [4/6]

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

Definition at line 844 of file bitmap_access.h.

844  {
845  assign(P.x);
846  }

◆ operator<<() [5/6]

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

Definition at line 848 of file bitmap_access.h.

848  {
849  assign(P.r, P.g, P.b);
850  }

◆ operator<<() [6/6]

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

Definition at line 852 of file bitmap_access.h.

852  {
853  float _a = 1 - P.a;
854  ptr[CHANNELS_4.R] = clipPixfloat(P.r + ptr[CHANNELS_4.R] * _a);
855  ptr[CHANNELS_4.G] = clipPixfloat(P.g + ptr[CHANNELS_4.G] * _a);
856  ptr[CHANNELS_4.B] = clipPixfloat(P.b + ptr[CHANNELS_4.B] * _a);
857  ptr[CHANNELS_4.A] = clipPixfloat(1 - _a * (1 - ptr[CHANNELS_4.A]));
858  }

◆ operator=() [1/6]

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

Definition at line 860 of file bitmap_access.h.

860  {
861  assign(P.x);
862  }

◆ operator=() [2/6]

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

Definition at line 864 of file bitmap_access.h.

864  {
865  assign(P.r, P.g, P.b);
866  }

◆ operator=() [3/6]

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

Definition at line 868 of file bitmap_access.h.

868  {
869  assign(P.r, P.g, P.b, P.a);
870  }

◆ operator=() [4/6]

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

Definition at line 872 of file bitmap_access.h.

872  {
873  assign(P.x);
874  }

◆ operator=() [5/6]

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

Definition at line 876 of file bitmap_access.h.

876  {
877  assign(P.r, P.g, P.b);
878  }

◆ operator=() [6/6]

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

Definition at line 880 of file bitmap_access.h.

880  {
881  assign(P.r, P.g, P.b, P.a);
882  }

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