plptools
Loading...
Searching...
No Matches
psibitmap.h File Reference
#include "bufferstore.h"
Include dependency graph for psibitmap.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef int(* getPixelFunction_t) (int x, int y)
 This function is used by encodeBitmap for retrieving image data. More...
 

Functions

void encodeBitmap (int width, int height, getPixelFunction_t getPixel, bool rle, bufferStore &out)
 Convert an image into a bitmap in Psion format. More...
 
bool decodeBitmap (const unsigned char *p, int &width, int &height, bufferStore &out)
 Convert a Psion bitmap to a 8bit/pixel grayscale image. More...
 

Typedef Documentation

◆ getPixelFunction_t

typedef int(* getPixelFunction_t) (int x, int y)

This function is used by encodeBitmap for retrieving image data.

It must return a gray value between 0 and 255 where 0 is black and 255 is white.

Parameters
xThe x coordinate of the pixel to get (0 = left)
yThe y coordinate of the pixel to get (0 = top)

Definition at line 34 of file psibitmap.h.

Function Documentation

◆ decodeBitmap()

bool decodeBitmap ( const unsigned char *  p,
int &  width,
int &  height,
bufferStore out 
)

Convert a Psion bitmap to a 8bit/pixel grayscale image.

Parameters
pPointer to an input buffer which contains the Psion-formatted bitmap to convert. Must start with a Psion bitmap header.
widthOn return, the image width in pixels is returned here.
heightOn return, the image height in pixels is returned here.
outBuffer which gets filled with the raw image data. Each pixel is represented by a byte. The image data is organized in height scanlines of width bytes, starting with the topmost scanline.
Returns
true on success, false if input data is inconsistent.

Definition at line 141 of file psibitmap.cpp.

◆ encodeBitmap()

void encodeBitmap ( int  width,
int  height,
getPixelFunction_t  getPixel,
bool  rle,
bufferStore out 
)

Convert an image into a bitmap in Psion format.

Parameters
widthThe width of the image to convert.
heightThe height of the image to convert.
getPixelPointer to a function for retrieving pixel values.
rleFlag: Perform RLE compression (currently ignored).
outOutput buffer; gets filled with the Psion representation of the converted image.

Definition at line 26 of file psibitmap.cpp.