20 #include "../exception.h"
21 #include "../utils/bmp_file.h"
22 #include "../utils/utils.hpp"
63 throw IOError(bmpFilename,
"Unsupported pixel format");
75 if (this->width * this->height !=
width *
height && memory) {
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
const unsigned char getBitsPerPixel() const
Returns number of bits per pixel stored in each bitmap.
bool upToDate[2]
bitmap up-to-date state on CPU and GPU
datatype * ptr(int offset=0)
Toolset to load and store images in BMP format.
int32_t getHeight() const
void load(void *pixels, const uint32_t pixelsSizeInBytes)
Loads the content of the file into memory.
uint8_t getBitsPerPixel() const
Basic class: task and memory management, any kind of static data.
GL::RecycleBin * getGpuRecycleBin() const
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 msize getMemorySize() const
Bitmap size in bytes.
const int getWidth() const
Width of the texture in pixels.
const PixelFormat getPixelFormat() const
Pixel format of the bitmap.
InternalBitmap(Context &ctx, PixelFormat pixelFormat, int width, int height, bool allocate=true)
Creates a bitmap.
void lockPixelData()
Locks access to the CPU memory buffer containing pixel data.
void reshape(int width, int height)
Changes bitmap size.
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
@ TripleByte
3 channels of 8 bits per pixel (like RGB), unsigned integer values
@ BinaryMask
1 bit per pixel
@ HexMask
4 bits per pixel
#define ceili(x, y)
integer division x/y with ceiling
jlong jint jint jint jint pixelFormat
jobject jlong jint jint y