Pixel Access
Read and write individual pixels.
More...
Functions |
int | rapp_pixel_get_bin (const uint8_t *buf, int dim, int off, int x, int y) |
| Get a binary pixel value.
|
int | rapp_pixel_set_bin (uint8_t *buf, int dim, int off, int x, int y, int value) |
| Set a binary pixel value.
|
int | rapp_pixel_get_u8 (const uint8_t *buf, int dim, int x, int y) |
| Get an 8-bit pixel value.
|
int | rapp_pixel_set_u8 (uint8_t *buf, int dim, int x, int y, int value) |
| Set an 8-bit pixel value.
|
Detailed Description
Read and write individual pixels.
These functions are intended for handling individual pixels, and are not suitable for any kind of processing. The images may be misaligned.
Next section: Pixelwise Operations
Function Documentation
int rapp_pixel_get_bin |
( |
const uint8_t * |
buf, |
|
|
int |
dim, |
|
|
int |
off, |
|
|
int |
x, |
|
|
int |
y | |
|
) |
| | |
Get a binary pixel value.
- Parameters:
-
[in] | buf | A pixel buffer. |
| dim | Row dimension of the pixel buffer. |
| off | Binary offset of the pixel buffer. |
| x | X coordinate of the pixel to read. |
| y | Y coordinate of the pixel to read. |
- Returns:
- The binary pixel value, or a negative error code on error.
int rapp_pixel_set_bin |
( |
uint8_t * |
buf, |
|
|
int |
dim, |
|
|
int |
off, |
|
|
int |
x, |
|
|
int |
y, |
|
|
int |
value | |
|
) |
| | |
Set a binary pixel value.
- Parameters:
-
[in] | buf | A pixel buffer. |
| dim | Row dimension of the pixel buffer. |
| off | Binary offset of the pixel buffer. |
| x | X coordinate of the pixel to read. |
| y | Y coordinate of the pixel to read. |
| value | The binary value to set, zero or one. |
- Returns:
- A negative error code on error, zero otherwise.
int rapp_pixel_get_u8 |
( |
const uint8_t * |
buf, |
|
|
int |
dim, |
|
|
int |
x, |
|
|
int |
y | |
|
) |
| | |
Get an 8-bit pixel value.
- Parameters:
-
[in] | buf | A pixel buffer. |
| dim | Row dimension of the pixel buffer. |
| x | X coordinate of the pixel to read. |
| y | Y coordinate of the pixel to read. |
- Returns:
- The 8-bit pixel value, or a negative error code on error.
int rapp_pixel_set_u8 |
( |
uint8_t * |
buf, |
|
|
int |
dim, |
|
|
int |
x, |
|
|
int |
y, |
|
|
int |
value | |
|
) |
| | |
Set an 8-bit pixel value.
- Parameters:
-
[in] | buf | A pixel buffer. |
| dim | Row dimension of the pixel buffer. |
| x | X coordinate of the pixel to read. |
| y | Y coordinate of the pixel to read. |
| value | The 8-bit value to set, 0-255. |
- Returns:
- A negative error code on error, zero otherwise.