Beatmup
|
A simple wrapper of GDI bitmap. More...
#include <gdi_bitmap.h>
Classes | |
class | Impl |
A simple wrapper of IL image. More... | |
Public Member Functions | |
GDIBitmap (Context &ctx, const wchar_t *filename) | |
GDIBitmap (Context &ctx, PixelFormat format, int width, int height) | |
const PixelFormat | getPixelFormat () const |
Pixel format of the bitmap. More... | |
const int | getWidth () const |
Width of the texture in pixels. More... | |
const int | getHeight () const |
Height of the texture in pixels. More... | |
int | getStride () const |
const msize | getMemorySize () const |
Bitmap size in bytes. More... | |
void | lockPixelData () |
Locks access to the CPU memory buffer containing pixel data. More... | |
void | unlockPixelData () |
Unlocks access to the CPU memory buffer containing pixel data. More... | |
const pixbyte * | getData (int x, int y) const |
Returns a pointer to given pixel. More... | |
void | save (const wchar_t *filename) |
Public Member Functions inherited from Beatmup::AbstractBitmap | |
virtual const int | getDepth () const |
Depth of the texture in pixels. More... | |
virtual const TextureFormat | getTextureFormat () const |
Returns the texture format specifying how the shader must interpret the data. More... | |
bool | isUpToDate (ProcessingTarget) const |
bool | isDirty () const |
Returns true if the bitmap does not contain any valid content. More... | |
virtual pixbyte * | getData (int x, int y)=0 |
int | getPixelInt (int x, int y, int cha=0) const |
Retrieves integer value of given channel at given pixel. More... | |
const unsigned char | getBitsPerPixel () const |
Returns number of bits per pixel stored in each bitmap. More... | |
const unsigned char | getNumberOfChannels () const |
Returns number of bytes per pixel stored in each bitmap. More... | |
const ImageResolution | getSize () const |
Returns the bitmap resolution within ImageResolution object. More... | |
Context & | getContext () const |
void | zero () |
Sets all the pixels to zero. More... | |
bool | isInteger () const |
Returns true if the bitmap contains integer values, false otherwise. More... | |
bool | isFloat () const |
Returns true if the bitmap contains floating point values, false otherwise. More... | |
bool | isMask () const |
Returns true if the bitmap is a mask, false otherwise. More... | |
std::string | toString () const |
Retruns a string describing the bitmap. More... | |
void | saveBmp (const char *filename) |
Saves the bitmap to a BMP file. More... | |
~AbstractBitmap () | |
Public Member Functions inherited from Beatmup::GL::TextureHandler | |
~TextureHandler () | |
float | getAspectRatio () const |
Aspect ratio of the texture. More... | |
float | getInvAspectRatio () const |
Inverse of the aspect ratio of the texture. More... | |
const bool | isFloatingPoint () const |
const int | getNumberOfChannels () const |
Returns number of channels containing in the texture. More... | |
bool | hasValidHandle () const |
Returns true if the texture handle points to a valid texture. More... | |
Public Member Functions inherited from Beatmup::Object | |
virtual | ~Object () |
Private Attributes | |
Impl * | impl |
Additional Inherited Members | |
Public Types inherited from Beatmup::GL::TextureHandler | |
enum | TextureFormat { Rx8 , RGBx8 , RGBAx8 , Rx32f , RGBx32f , RGBAx32f , OES_Ext } |
Texture format, specifies how the texture should be interpreted on the shader side. More... | |
Static Public Member Functions inherited from Beatmup::AbstractBitmap | |
static bool | isInteger (PixelFormat pixelFormat) |
Returns true if a given pixel format corresponds to integer values, false otherwise. More... | |
static bool | isFloat (PixelFormat pixelFormat) |
Returns true if a given pixel format corresponds to floating point values, false otherwise. More... | |
static bool | isMask (PixelFormat pixelFormat) |
Returns true if a given pixel format corresponds to a mask, false otherwise. More... | |
Static Public Member Functions inherited from Beatmup::GL::TextureHandler | |
static const char * | textureFormatToString (const TextureFormat &) |
Static Public Attributes inherited from Beatmup::AbstractBitmap | |
static const int | NUM_PIXEL_FORMATS = 9 |
static const char * | PIXEL_FORMAT_NAMES [NUM_PIXEL_FORMATS] |
pixel format names More... | |
static const unsigned char | CHANNELS_PER_PIXEL [NUM_PIXEL_FORMATS] |
number of channels for each pixel format More... | |
static const unsigned char | BITS_PER_PIXEL [NUM_PIXEL_FORMATS] |
number of bits per pixel for each pixel format More... | |
Static Public Attributes inherited from Beatmup::GL::TextureHandler | |
static const int | TEXTURE_FORMAT_BYTES_PER_PIXEL [] |
size of a texel in bytes for different texture formats More... | |
Protected Member Functions inherited from Beatmup::AbstractBitmap | |
AbstractBitmap (Context &ctx) | |
virtual void | prepare (GraphicPipeline &gpu) |
Prepares (eventually uploads) texture data on GPU. More... | |
Protected Member Functions inherited from Beatmup::GL::TextureHandler | |
TextureHandler () | |
void | invalidate (RecycleBin &) |
Forces disposing the texture data, e.g. More... | |
Protected Attributes inherited from Beatmup::AbstractBitmap | |
Context & | ctx |
context managing this bitmap More... | |
bool | upToDate [2] |
bitmap up-to-date state on CPU and GPU More... | |
Protected Attributes inherited from Beatmup::GL::TextureHandler | |
handle_t | textureHandle |
A simple wrapper of GDI bitmap.
Definition at line 31 of file gdi_bitmap.h.
GDIBitmap::GDIBitmap | ( | Context & | ctx, |
const wchar_t * | filename | ||
) |
Definition at line 167 of file gdi_bitmap.cpp.
GDIBitmap::GDIBitmap | ( | Context & | ctx, |
PixelFormat | format, | ||
int | width, | ||
int | height | ||
) |
Definition at line 174 of file gdi_bitmap.cpp.
|
virtual |
Pixel format of the bitmap.
Implements Beatmup::AbstractBitmap.
Definition at line 179 of file gdi_bitmap.cpp.
|
virtual |
Width of the texture in pixels.
Implements Beatmup::GL::TextureHandler.
Definition at line 184 of file gdi_bitmap.cpp.
|
virtual |
Height of the texture in pixels.
Implements Beatmup::GL::TextureHandler.
Definition at line 189 of file gdi_bitmap.cpp.
int GDIBitmap::getStride | ( | ) | const |
Definition at line 194 of file gdi_bitmap.cpp.
|
virtual |
Bitmap size in bytes.
Implements Beatmup::AbstractBitmap.
Definition at line 199 of file gdi_bitmap.cpp.
|
virtual |
Locks access to the CPU memory buffer containing pixel data.
Implements Beatmup::AbstractBitmap.
Definition at line 204 of file gdi_bitmap.cpp.
|
virtual |
Unlocks access to the CPU memory buffer containing pixel data.
Implements Beatmup::AbstractBitmap.
Definition at line 209 of file gdi_bitmap.cpp.
|
virtual |
Returns a pointer to given pixel.
x | target pixel horizontal coordinate |
y | target pixel vertical coordinate |
Implements Beatmup::AbstractBitmap.
Definition at line 214 of file gdi_bitmap.cpp.
void GDIBitmap::save | ( | const wchar_t * | filename | ) |
Definition at line 219 of file gdi_bitmap.cpp.
|
private |
Definition at line 34 of file gdi_bitmap.h.