21 #include "../exception.h"
33 #ifdef BEATMUP_CHANNEL_ORDER_ARGB
35 #elif BEATMUP_CHANNEL_ORDER_BGRA
49 #ifdef BEATMUP_CHANNEL_ORDER_ARGB
51 #elif BEATMUP_CHANNEL_ORDER_BGRA
75 inline pixel*
jump(
int x,
int y)
const {
103 ptr += num_channels *
n;
111 DebugAssertion::check(
x >= 0 &&
y >= 0 &&
x <
width &&
y <
height,
"Coordinates outside of image: %d %d (width=%d, height=%d)",
x,
y,
width,
height);
132 DebugAssertion::check(
134 "Invalid bitmap scanner"
474 float _a = (1 - P.
a) / 255;
576 float _a = (1 - P.
a) / 255;
A very basic class for any image.
const unsigned char getBitsPerPixel() const
Returns number of bits per pixel stored in each bitmap.
BitmapContentModifier(AbstractBitmap &bitmap)
A generic to access bitmap data.
bool operator<(const CustomBitmapScanner &another) const
pixel * ptr
pointer to the current pixel
void operator+=(const int n)
Move the current position N pixels forward.
CustomBitmapScanner(const AbstractBitmap &bitmap, int x=0, int y=0)
pixel * jump(int x, int y) const
Retrieves pixel address at a given position;.
pixel * operator*() const
void operator++(int)
Move the current position ONE PIXEL forward.
int getHeight() const
Returns bitmap height in pixels.
void goTo(int x, int y)
Changes current position.
int getWidth() const
Returns bitmap width in pixels.
int height
bitmap sizes in pixels
const int NUMBER_OF_CHANNELS
Base class for all exceptions.
const pixbyte * getData(int x, int y) const
Returns a pointer to given pixel.
const int getHeight() const
Height of the texture in pixels.
const int getWidth() const
Width of the texture in pixels.
pixint4 operator()() const
QuadByteBitmapReader(const AbstractBitmap &bitmap, int x=0, int y=0)
const pixint4 operator[](int i) const
Retrieves a value at position shifted by i pixels in scanline order with respect to the current posit...
pixint4 operator()(int x, int y) const
QuadByteBitmapWriter(AbstractBitmap &bitmap, int x=0, int y=0)
void operator<<(const pixfloat1 &P)
void operator<<(const pixint1 &P)
void operator=(const pixint3 &P)
void operator<<(const pixfloat4 &P)
void assign(float r, float g, float b, float a)
void operator=(const pixfloat3 &P)
void operator=(const pixfloat4 &P)
void operator=(const pixint1 &P)
void assign(int r, int g, int b, int a)
void operator<<(const pixint3 &P)
void operator=(const pixfloat1 &P)
void assign(float r, float g, float b)
void operator<<(const pixfloat3 &P)
void operator=(const pixint4 &P)
void operator<<(const pixint4 &P)
void assign(int r, int g, int b)
Quad float bitmap reader.
const pixfloat4 operator[](int i) const
Retrieves a value at position shifted by i pixels in scanline order with respect to the current posit...
pixfloat4 operator()(int x, int y) const
pixfloat4 operator()() const
QuadFloatBitmapReader(const AbstractBitmap &bitmap, int x=0, int y=0)
pixfloat4 at(int x, int y) const
Quad float bitmap writer.
void assign(float r, float g, float b)
void assign(int r, int g, int b)
void operator<<(const pixint4 &P)
void operator<<(const pixint1 &P)
QuadFloatBitmapWriter(AbstractBitmap &bitmap, int x=0, int y=0)
void operator=(const pixfloat1 &P)
void operator=(const pixfloat4 &P)
void operator=(const pixint3 &P)
void assign(float r, float g, float b, float a)
void assign(int r, int g, int b, int a)
void operator=(const pixfloat3 &P)
void operator<<(const pixfloat1 &P)
void operator<<(const pixfloat4 &P)
void operator<<(const pixfloat3 &P)
void operator=(const pixint4 &P)
void operator<<(const pixint3 &P)
void operator=(const pixint1 &P)
Single byte bitmap reader.
pixint1 operator()() const
Returns value at current position.
const pixint1 operator[](int i) const
Retrieves a value at position shifted by i pixels in scanline order with respect to the current posit...
pixint1 operator()(int x, int y) const
Returns value at pixel (x,y) position.
SingleByteBitmapReader(const AbstractBitmap &bitmap, int x=0, int y=0)
Single byte bitmap writer.
void assign(int r, int g, int b)
void operator=(const pixint1 &P)
void assign(int r, int g, int b, int a)
void operator=(const pixint3 &P)
void operator<<(const pixfloat3 &P)
void operator=(const pixint4 &P)
void operator<<(const pixint1 &P)
void operator<<(const pixint3 &P)
void assign(float r, float g, float b, float a)
SingleByteBitmapWriter(AbstractBitmap &bitmap, int x=0, int y=0)
void operator<<(const pixint4 &P)
void operator<<(const pixfloat1 &P)
void operator=(const pixfloat1 &P)
void assign(float r, float g, float b)
void operator=(const pixfloat3 &P)
void operator<<(const pixfloat4 &P)
void operator=(const pixfloat4 &P)
Single float bitmap reader.
pixfloat1 operator()() const
pixfloat1 operator()(int x, int y) const
SingleFloatBitmapReader(const AbstractBitmap &bitmap, int x=0, int y=0)
const pixfloat1 operator[](int i) const
Retrieves a value at position shifted by i pixels in scanline order with respect to the current posit...
Single float bitmap writer.
void operator=(const pixfloat1 &P)
void operator<<(const pixfloat3 &P)
void operator=(const pixfloat3 &P)
void assign(float r, float g, float b, float a)
void operator=(const pixfloat4 &P)
void assign(int r, int g, int b, int a)
void assign(int r, int g, int b)
void operator<<(const pixint3 &P)
void operator<<(const pixfloat1 &P)
void operator=(const pixint4 &P)
SingleFloatBitmapWriter(AbstractBitmap &bitmap, int x=0, int y=0)
void operator=(const pixint1 &P)
void assign(float r, float g, float b)
void operator=(const pixint3 &P)
void operator<<(const pixint1 &P)
void operator<<(const pixfloat4 &P)
void operator<<(const pixint4 &P)
Triple byte bitmap reader.
const pixint3 operator[](int i) const
Retrieves a value at position shifted by i pixels in scanline order with respect to the current posit...
pixint3 operator()() const
TripleByteBitmapReader(const AbstractBitmap &bitmap, int x=0, int y=0)
pixint3 operator()(int x, int y) const
Triple byte bitmap writer.
void assign(int r, int g, int b, int a)
void operator=(const pixint1 &P)
void operator<<(const pixfloat3 &P)
void operator=(const pixint3 &P)
void operator<<(const pixint1 &P)
void operator<<(const pixfloat1 &P)
TripleByteBitmapWriter(AbstractBitmap &bitmap, int x=0, int y=0)
void operator=(const pixint4 &P)
void assign(int r, int g, int b)
void operator=(const pixfloat4 &P)
void operator<<(const pixint3 &P)
void operator=(const pixfloat3 &P)
void operator<<(const pixfloat4 &P)
void assign(float r, float g, float b, float a)
void operator<<(const pixint4 &P)
void operator=(const pixfloat1 &P)
void assign(float r, float g, float b)
Triple float bitmap reader.
TripleFloatBitmapReader(const AbstractBitmap &bitmap, int x=0, int y=0)
const pixfloat3 operator[](int i) const
Retrieves a value at position shifted by i pixels in scanline order with respect to the current posit...
pixfloat3 operator()() const
pixfloat3 operator()(int x, int y) const
Triple float bitmap writer.
void operator=(const pixint1 &P)
void operator=(const pixfloat3 &P)
void operator<<(const pixint3 &P)
void operator=(const pixfloat1 &P)
void operator<<(const pixfloat1 &P)
void assign(int r, int g, int b)
void operator<<(const pixint4 &P)
void assign(float r, float g, float b, float a)
void operator=(const pixint3 &P)
void operator=(const pixfloat4 &P)
TripleFloatBitmapWriter(AbstractBitmap &bitmap, int x=0, int y=0)
void operator<<(const pixfloat3 &P)
void assign(int r, int g, int b, int a)
void operator<<(const pixint1 &P)
void assign(float r, float g, float b)
void operator<<(const pixfloat4 &P)
void operator=(const pixint4 &P)
pixbyte clipPixint(int x)
Clips an integer pixel value to 0..255 range.
pixfloat clipPixfloat(pixfloat x)
Clips a floating point pixel value to 0..1 range.
pixbyte pixfloat2pixbyte(pixfloat x)
Converts a floating point pixel value to a 0..255 integer.
pixfloat int2pixfloat(int x)
Converts an integer value to 0..1 floating point pixel value.
static const struct Beatmup::@1 CHANNELS_4
static const struct Beatmup::@2 CHANNELS_3
Monochromatic floating point arithmetic.
Trichromatic floating point arithmetic.
4-channel floating point arithmetic
Monochromatic integer arithmetic.
Trichromatic integer arithmetic.
4-channel integer arithmetic
jobject jlong jint jint jint jint g
jobject jlong jint jint jint jint jint b
jobject jlong jint jint y
jobject jlong jint jint jint r
jobject jlong jint jint jint jint jint jint a
Beatmup::InternalBitmap * bitmap
Beatmup::IntPoint p((int) x,(int) y)