#include "bitmap.h"
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <mem.h>
Go to the source code of this file.
Functions | |
Bitmap * | BM_Alloc (int w, int h) |
Allocate a Bitmap structure. | |
Bitmap * | BM_Copy (Bitmap *bm) |
Copy a Bitmap. | |
void | BM_Free (Bitmap *bm) |
Free a Bitmap structure. | |
void | BM_Clear (Bitmap *bm, char pattern) |
Clear a Bitmap's bmBits. | |
void | BM_Invert (Bitmap *bm) |
Invert all pixel of a Bitmap. | |
void | BM_Scroll (Bitmap *bm, int dx, int dy) |
Scroll bitmap contents. | |
Bitmap * | BM_Load (char *fn) |
Load a bitmap from a bmp file. | |
void | BM_Save (Bitmap *bm, char *fn) |
Save a bitmap into a bmp file. | |
void | BM_Blit (Bitmap *dst, int x, int y, Bitmap *src, int u, int v, int w, int h, int mode) |
Copy a region between two Bitmaps (with clipping). | |
void | BM_FastBlit (Bitmap *dst, int x, int y, Bitmap *src, int u, int v, int w, int h, int mode) |
Copy a region between two Bitmaps (without clipping). | |
Variables | |
BM_BlitFunc * | blitFuncs [] |
Function pointers to blitter functions. |
|
Allocate a Bitmap structure.
Definition at line 44 of file bitmap.cpp. References Bitmap::bmBitsSize, Bitmap::height, and Bitmap::width. |
|
Copy a region between two Bitmaps (with clipping).
Definition at line 335 of file bitmap.cpp. References BM_FastBlit(), Bitmap::height, src, and Bitmap::width. |
|
Clear a Bitmap's bmBits.
Definition at line 104 of file bitmap.cpp. References Bitmap::bmBits, and Bitmap::bmBitsSize. |
|
Copy a Bitmap.
Definition at line 66 of file bitmap.cpp. References BM_Alloc(), Bitmap::bmBits, Bitmap::bmBitsSize, Bitmap::height, and Bitmap::width. Referenced by BM_Scroll(). |
|
Copy a region between two Bitmaps (without clipping).
Definition at line 398 of file bitmap.cpp. References blitFuncs, Bitmap::bmBits, fbm, Bitmap::height, lbm, pages, shift, src, and Bitmap::width. Referenced by BM_Blit(), and GFX_FillRect(). |
|
Free a Bitmap structure. BM_Free frees a Bitmap (and its bmBits) previously allocated by BM_Alloc.
Definition at line 87 of file bitmap.cpp. References Bitmap::bmBitsSize, Bitmap::height, and Bitmap::width. |
|
Invert all pixel of a Bitmap.
Definition at line 115 of file bitmap.cpp. References Bitmap::bmBits, and Bitmap::bmBitsSize. |
|
Load a bitmap from a bmp file. This function allocates and loads a bitmap from a windows .bmp file. Only two color, uncompressed bitmaps are supported.
Definition at line 183 of file bitmap.cpp. References BitmapFileHeader::bfOffBits, BitmapFileHeader::bfType, BitmapFileHeader::biBitCount, BitmapFileHeader::biCompression, BitmapFileHeader::biHeight, BitmapFileHeader::biPlanes, BitmapFileHeader::biWidth, BM_Alloc(), BM_Clear(), Bitmap::bmBits, Bitmap::bmBitsSize, Bitmap::height, src, and Bitmap::width. Referenced by gfxTest(). |
|
Save a bitmap into a bmp file. This function saves a bitmap into a two-color, uncompressed windows .bmp file.
Definition at line 252 of file bitmap.cpp. References BitmapFileHeader::bfOffBits, BitmapFileHeader::bfReserved1, BitmapFileHeader::bfReserved2, BitmapFileHeader::bfSize, BitmapFileHeader::bfType, BitmapFileHeader::biBitCount, BitmapFileHeader::biClrImportant, BitmapFileHeader::biClrUsed, BitmapFileHeader::biCompression, BitmapFileHeader::biHeight, BitmapFileHeader::biPlanes, BitmapFileHeader::biSize, BitmapFileHeader::biSizeImage, BitmapFileHeader::biWidth, BitmapFileHeader::biXPelsPerMeter, BitmapFileHeader::biYPelsPerMeter, Bitmap::bmBits, BMP_BGCOLOR, BMP_FGCOLOR, BitmapFileHeader::color0, BitmapFileHeader::color1, DPI2PPM, Bitmap::height, src, and Bitmap::width. Referenced by gfxTest(). |
|
Scroll bitmap contents.
Definition at line 161 of file bitmap.cpp. |
|
Initial value: { NULL, BM_Blit_Nor, BM_Blit_NotAnd, BM_Blit_NotCopy, BM_Blit_AndNot, NULL, BM_Blit_Xor, BM_Blit_Nand, BM_Blit_And, BM_Blit_Nexor, NULL, BM_Blit_NotOr, BM_Blit_Copy, BM_Blit_OrNot, BM_Blit_Or, NULL }
Definition at line 26 of file bitmap.cpp. Referenced by BM_FastBlit(). |