#include "config.h"
#include <stdint.h>
#include "psibitmap.h"
Go to the source code of this file.
◆ splitByte
Value:do { \
int j; \
\
if (x < bytesPerLine) \
for (j = 0; j < pixelsPerByte; j++) { \
if (j && ((oidx % xPixels) == 0)) \
break; \
else \
if (oidx >= picsize) \
return false; \
else { \
out.addByte((v & mask) * grayVal); \
v >>= bitsPerPixel; \
oidx++; \
} \
} \
if (++x >= linelen) \
x = 0; \
} while (0)
Definition at line 119 of file psibitmap.cpp.
◆ decodeBitmap()
| bool decodeBitmap |
( |
const unsigned char * |
p, |
|
|
int & |
width, |
|
|
int & |
height, |
|
|
bufferStore & |
out |
|
) |
| |
Convert a Psion bitmap to a 8bit/pixel grayscale image.
- Parameters
-
| p | Pointer to an input buffer which contains the Psion-formatted bitmap to convert. Must start with a Psion bitmap header. |
| width | On return, the image width in pixels is returned here. |
| height | On return, the image height in pixels is returned here. |
| out | Buffer 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()
Convert an image into a bitmap in Psion format.
- Parameters
-
| width | The width of the image to convert. |
| height | The height of the image to convert. |
| getPixel | Pointer to a function for retrieving pixel values. |
| rle | Flag: Perform RLE compression (currently ignored). |
| out | Output buffer; gets filled with the Psion representation of the converted image. |
Definition at line 26 of file psibitmap.cpp.