Convert between pixel depths. More...
Functions | |
int | rapp_type_u8_to_bin (uint8_t *restrict dst, int dst_dim, const uint8_t *restrict src, int src_dim, int width, int height) |
Convert u8 pixels to binary pixels. | |
int | rapp_type_bin_to_u8 (uint8_t *restrict dst, int dst_dim, const uint8_t *restrict src, int src_dim, int width, int height) |
Convert binary pixels to u8 pixels. |
Convert between pixel depths.
These functions convert images between different pixel depths, e.g. between binary and 8-bit images. The binary pixel values 0 and 1 values will be converted to the 8-bit values 0 and 255, respectively. An 8-bit value of 128 or greater will be converted to binary 1, and to binary 0 below that value. This is equivalent of calling rapp_thresh_gt_u8() with the threshold value 127.
To convert between 8-bit unsigned-with-bias to 8-bit two's complement, use the rapp_pixop_flip_u8() operation.
All images must be aligned.
Next section: Statistical Operations
int rapp_type_u8_to_bin | ( | uint8_t *restrict | dst, | |
int | dst_dim, | |||
const uint8_t *restrict | src, | |||
int | src_dim, | |||
int | width, | |||
int | height | |||
) |
Convert u8 pixels to binary pixels.
[out] | dst | Destination pixel buffer. |
dst_dim | Row dimension in bytes of the destination buffer. | |
[in] | src | Source pixel buffer. |
src_dim | Row dimension in bytes of the source buffer. | |
width | Image width in pixels. | |
height | Image height in pixels. |
int rapp_type_bin_to_u8 | ( | uint8_t *restrict | dst, | |
int | dst_dim, | |||
const uint8_t *restrict | src, | |||
int | src_dim, | |||
int | width, | |||
int | height | |||
) |
Convert binary pixels to u8 pixels.
[out] | dst | Destination pixel buffer. |
dst_dim | Row dimension in bytes of the destination buffer. | |
[in] | src | Source pixel buffer. |
src_dim | Row dimension in bytes of the source buffer. | |
width | Image width in pixels. | |
height | Image height in pixels. |