20 #include "../../core/bitmap/abstract_bitmap.h"
25 using namespace Android;
30 jvm->AttachCurrentThread(&env, NULL);
42 AndroidBitmapFormat
format = (AndroidBitmapFormat)
getInfo().format;
44 format != ANDROID_BITMAP_FORMAT_RGBA_8888 &&
45 format != ANDROID_BITMAP_FORMAT_A_8
57 AndroidBitmapInfo info;
69 AndroidBitmapFormat
format = (AndroidBitmapFormat)
getInfo().format;
71 case ANDROID_BITMAP_FORMAT_RGBA_8888:
73 case ANDROID_BITMAP_FORMAT_A_8:
103 throw RuntimeError(
"AndroidBitmap_lockPixels() failed with error");
A very basic class for any image.
static const unsigned char BITS_PER_PIXEL[NUM_PIXEL_FORMATS]
number of bits per pixel for each pixel format
Bitmap(Beatmup::Context &, JNIEnv *, jobject)
Creates the bitmap from Android Bitmap java object.
const int getWidth() const
Width of the texture in pixels.
const PixelFormat getPixelFormat() const
Pixel format of the bitmap.
const msize getMemorySize() const
Bitmap size in bytes.
void * lockedPixels
pixel buffer; available only after calling lockPixelData()
JavaVM * jvm
java environment
PixelFormat lockedPixelFormat
AndroidBitmapInfo getInfo() const
jobject bitmap
java object representing the bitmap
const pixbyte * getData(int x, int y) const
Returns a pointer to given pixel.
void unlockPixelData()
Unlocks access to the CPU memory buffer containing pixel data.
void lockPixelData()
Locks access to the CPU memory buffer containing pixel data.
const int getHeight() const
Height of the texture in pixels.
static void insanity(const char *message)
static void check(const bool condition, const std::string &message)
#define BEATMUP_ASSERT_DEBUG(C)
uint32_t msize
memory size
@ SingleByte
single channel of 8 bits per pixel (like grayscale), unsigned integer values
@ QuadByte
4 channels of 8 bits per pixel (like RGBA), unsigned integer values
JNIEnv jobject jint format
jobject jlong jint jint y
Beatmup::InternalBitmap * bitmap