Windows DIB
[Utilities]
Detailed Description
- Windows DIBs in memory are handled just like a BMP file without the file header.
These functions will work only in Windows. They are usefull for interchanging data with the clipboard, with capture drivers, with the AVI and WMF file formats and others.
- Supported DIB aspects:
- bpp must be 1, 4, 8, 16, 24, or 32.
- BITMAPV4HEADER or BITMAPV5HEADER are handled but ignored.
- BITMAPCOREHEADER is not handled .
- BI_JPEG and BI_PNG compressions are not handled.
- biHeight can be negative, compression can be RLE only if created from imDibCreateReference, imDibPasteClipboard, imDibLoadFile.
- can not encode/decode Images to/from RLE compressed Dibs.
- if working with RLE Dibs bits_size is greatter than used.
- the resolution of a new Dib is taken from the screen.
- SetDIBitsToDevice(start_scan is 0, scan_lines is dib->bmih->biHeight).
- StretchDIBits(use always DIB_RGB_COLORS).
- CreateDIBPatternBrushPt(packed_dib is dib->dib).
- Must include <windows.h> before using these functions.
Check <wingdi.h> for structures and definitions.
- See im_dib.h
Data Structures | |
struct | _imDib |
Windows DIB Structure. More... | |
Typedefs | |
typedef _imDib | imDib |
typedef unsigned int(* | imDibLineGetPixel )(unsigned char *line, int col) |
typedef void(* | imDibLineSetPixel )(unsigned char *line, int col, unsigned int pixel) |
Functions | |
imDib * | imDibCreate (int width, int height, int bpp) |
imDib * | imDibCreateCopy (const imDib *dib) |
imDib * | imDibCreateReference (BYTE *bmi, BYTE *bits) |
imDib * | imDibCreateSection (HDC hDC, HBITMAP *image, int width, int height, int bpp) |
void | imDibDestroy (imDib *dib) |
imDibLineGetPixel | imDibLineGetPixelFunc (int bpp) |
imDibLineSetPixel | imDibLineSetPixelFunc (int bpp) |
imDib * | imDibFromHBitmap (const HBITMAP image, const HPALETTE hPalette) |
HBITMAP | imDibToHBitmap (const imDib *dib) |
HPALETTE | imDibLogicalPalette (const imDib *dib) |
imDib * | imDibCaptureScreen (int x, int y, int width, int height) |
void | imDibCopyClipboard (imDib *dib) |
imDib * | imDibPasteClipboard (void) |
int | imDibIsClipboardAvailable (void) |
int | imDibSaveFile (const imDib *dib, const char *filename) |
imDib * | imDibLoadFile (const char *filename) |
void | imDibDecodeToRGBA (const imDib *dib, unsigned char *red, unsigned char *green, unsigned char *blue, unsigned char *alpha) |
void | imDibDecodeToMap (const imDib *dib, unsigned char *map, long *palette) |
void | imDibEncodeFromRGBA (imDib *dib, const unsigned char *red, const unsigned char *green, const unsigned char *blue, const unsigned char *alpha) |
void | imDibEncodeFromMap (imDib *dib, const unsigned char *map, const long *palette, int palette_count) |
void | imDibEncodeFromBitmap (imDib *dib, const unsigned char *data) |
void | imDibDecodeToBitmap (const imDib *dib, unsigned char *data) |
Typedef Documentation
|
Windows DIB Structure.
|
|
DIB GetPixel function definition. |
|
DIB SetPixel function definition |
Function Documentation
|
Creates a new DIB. |
|
Duplicates the DIB contents in a new DIB. |
|
Creates a DIB using an already allocated memory. |
|
Creates a DIB section for drawing porposes. |
|
Destroy the DIB |
|
Returns a function to read pixels from a DIB line. |
|
Returns a function to write pixels into a DIB line. |
|
Creates a DIB from a image handle and a palette handle. |
|
Creates a image handle from a DIB. |
|
Returns a Logical palette from the DIB palette. |
|
Captures the screen into a DIB. |
|
Transfer the DIB to the clipboard. |
|
Creates a reference for the DIB in the clipboard if any. Returns NULL otherwise. Warning: Clipboard functions in C++ can fail with Visual C++ /EHsc (Enable C++ Exceptions) |
|
Checks if there is a dib at the clipboard. |
|
Saves the DIB into a file ".bmp". |
|
Creates a DIB from a file ".bmp". |
|
Converts a DIB into an RGBA image. alpha is optional. bpp must be >8. |
|
Converts a DIB into an indexed image. bpp must be <=8. colors must have room for at least 256 colors. colors is rgb packed (RGBRGBRGB...) |
|
Converts an RGBA image into a DIB. alpha is optional. bpp must be >8. |
|
Converts an indexed image into a DIB. bpp must be <=8. |
|
Converts a IM_RGB packed image, with or without alpha, into a DIB. |
|
Converts a DIB into IM_RGB packed image, with or without alpha. |