#include <djv_jb2common.h>
This class is used to preserve 1-bit black and white image, which defines JB2 shapes.
Celartem::DjVu::PackedBitmap::PackedBitmap |
( |
| ) |
|
|
inline |
Initialize a new instance.
With this constructor, you are responsible for all the content and the number of foreground bits.
Celartem::DjVu::PackedBitmap::PackedBitmap |
( |
size_t |
inWidth, |
|
|
size_t |
inHeight |
|
) |
| |
|
inline |
Initialize a new instance.
- Parameters
-
inWidth | The width in pixels. |
inHeight | The heigth in pixels. |
With this constructor, you are responsible for all the content and the number of foreground bits.
Celartem::DjVu::PackedBitmap::PackedBitmap |
( |
size_t |
inWidth, |
|
|
size_t |
inHeight, |
|
|
ssize_t |
inRowStride, |
|
|
const u8 * |
inImagePtr, |
|
|
bool |
inPacked = false |
|
) |
| |
Initialize a new instance.
- Parameters
-
inWidth | The width in pixels. |
inHeight | The heigth in pixels. |
inRowStride | The row-stride in bytes. |
inImagePtr | Pointer to the image. The type of the image is determined by inPacked and if inPacked is false , each byte stands for a pixel. All the pixels with non-0 value will be translated as 1 and others as 0.
Otherwise, if inPacked is ture , each bit stands for a pixel. MSB(0x80) in each byte is the left-side pixel of a sequential pixels and LSB(0x01) in the byte is the right-side pixel. 1 stands for a foreground pixel (usually in black) and 0 for a background pixel (usually in white). |
inPacked | If inImagePtr is a packed bitmap, this is true ; otherwise if unpacked bitmap, this is false . |
Celartem::DjVu::PackedBitmap::PackedBitmap |
( |
const PackedBitmap & |
inBitmap | ) |
|
|
inline |
Duplicate an existing PackedBitmap instance.
- Parameters
-
inBitmap | An instance to duplicate. |
u8* Celartem::DjVu::PackedBitmap::allocate |
( |
size_t |
inWidth, |
|
|
size_t |
inHeight |
|
) |
| |
|
inline |
Initialize a bitmap.
- Parameters
-
inWidth | The width in pixels. |
inHeight | The heigth in pixels. |
- Returns
- The pointer to the raw packed (1-bit per pixel) image.
Note that the buffer is not zero-cleared.
Referenced by PackedBitmap().
size_t Celartem::DjVu::PackedBitmap::getHeight |
( |
| ) |
const |
|
inline |
Get the height in pixels.
- Returns
- The height in pixels.
size_t Celartem::DjVu::PackedBitmap::getPixelCount |
( |
| ) |
const |
Get the number of flagged pixels.
- Returns
- The number of flagged pixels.
const u8* Celartem::DjVu::PackedBitmap::getPtr |
( |
size_t |
y = 0 | ) |
const |
|
inline |
Get the pointer to the (0,y) pixel.
- Parameters
-
- Returns
- The pointer to the (0,y) pixel.
u8* Celartem::DjVu::PackedBitmap::getPtr |
( |
size_t |
y = 0 | ) |
|
|
inline |
Get the pointer to the (0,y) pixel.
- Parameters
-
- Returns
- The pointer to the (0,y) pixel.
ssize_t Celartem::DjVu::PackedBitmap::getRowStride |
( |
| ) |
const |
|
inline |
Get the row-stride (bytes-to-the-next-line) in bytes.
- Returns
- The row-stride.
size_t Celartem::DjVu::PackedBitmap::getWidth |
( |
| ) |
const |
|
inline |
Get the width in pixels.
- Returns
- The width in pixels.
bool Celartem::DjVu::PackedBitmap::isIdentical |
( |
const PackedBitmap & |
inBitmap | ) |
const |
Compare two instances.
- Parameters
-
inBitmap | A PackedBitmap instance to compare with. |
- Returns
true
if two instances are identical; otherwise false
.
bool Celartem::DjVu::PackedBitmap::isValid |
( |
| ) |
const |
|
inline |
Determine whether the instance is valid (contains meaningful bitmap) or not.
- Returns
true
if the instance is valid.
void Celartem::DjVu::PackedBitmap::swap |
( |
PackedBitmap & |
ioBitmap | ) |
|
|
inline |
Swap this one with the specified one.
- Parameters
-
ioBitmap | An instance to swap with. |
void Celartem::DjVu::PackedBitmap::zeroClear |
( |
| ) |
|
|
inline |
The documentation for this class was generated from the following file: