Single Conditional Operations

Perform conditional pixelwise set, copy and add operations. More...

Functions

int rapp_cond_set_u8 (uint8_t *restrict dst, int dst_dim, const uint8_t *restrict map, int map_dim, int width, int height, unsigned value)
 Set pixels conditionally.
int rapp_cond_addc_u8 (uint8_t *restrict dst, int dst_dim, const uint8_t *restrict map, int map_dim, int width, int height, int value)
 Add signed constant conditionally.
int rapp_cond_copy_u8 (uint8_t *restrict dst, int dst_dim, const uint8_t *restrict src, int src_dim, const uint8_t *restrict map, int map_dim, int width, int height)
 Copy pixels conditionally.
int rapp_cond_add_u8 (uint8_t *restrict dst, int dst_dim, const uint8_t *restrict src, int src_dim, const uint8_t *restrict map, int map_dim, int width, int height)
 Add pixels conditionally.

Detailed Description

Perform conditional pixelwise set, copy and add operations.

These functions process individual pixels conditionally based on the value of the corresponding pixels in a binary map image. A pixel is processed if and only if the pixel in the binary map is set. Performance is highly input-sensitive. If the map is sparse, i.e. most pixels are zero, the operation will be very fast. A map image of alternating ones and zeros in a checkerboard may be between one or two magnitudes slower than the all-zeros case.

Only copy, set and add operations are available as conditional operations. For more complex conditional processing, use the gather/scatter mechanism.

The images must be aligned.

Next section: Gather


Function Documentation

int rapp_cond_set_u8 ( uint8_t *restrict  dst,
int  dst_dim,
const uint8_t *restrict  map,
int  map_dim,
int  width,
int  height,
unsigned  value 
)

Set pixels conditionally.

Sets pixels to a fixed value if the corresponding map pixel is set.

Parameters:
[out] dst Destination pixel buffer.
dst_dim Row dimension of the destination buffer.
[in] map Binary map pixel buffer.
map_dim Row dimension of the binary map buffer.
width Image width in pixels.
height Image height in pixels.
value The value to set, in the range 0 - 255.
Returns:
A negative error code on error, zero otherwise.
int rapp_cond_addc_u8 ( uint8_t *restrict  dst,
int  dst_dim,
const uint8_t *restrict  map,
int  map_dim,
int  width,
int  height,
int  value 
)

Add signed constant conditionally.

Computes buf[i] = buf[i] + value, where map[i] is set. The result is saturated.

Parameters:
[out] dst Destination pixel buffer.
dst_dim Row dimension of the destination buffer.
[in] map Binary map pixel buffer.
map_dim Row dimension of the binary map buffer.
width Image width in pixels.
height Image height in pixels.
value Constant term, in the range -255 - 255.
Returns:
A negative error code on error, zero otherwise.
int rapp_cond_copy_u8 ( uint8_t *restrict  dst,
int  dst_dim,
const uint8_t *restrict  src,
int  src_dim,
const uint8_t *restrict  map,
int  map_dim,
int  width,
int  height 
)

Copy pixels conditionally.

Copies pixels if the corresponding map pixel is set.

Parameters:
[out] dst Destination pixel buffer.
dst_dim Row dimension of the destination buffer.
[in] src Source pixel buffer.
src_dim Row dimension of the source buffer.
[in] map Binary map pixel buffer.
map_dim Row dimension of the binary map buffer.
width Image width in pixels.
height Image height in pixels.
Returns:
A negative error code on error, zero otherwise.
int rapp_cond_add_u8 ( uint8_t *restrict  dst,
int  dst_dim,
const uint8_t *restrict  src,
int  src_dim,
const uint8_t *restrict  map,
int  map_dim,
int  width,
int  height 
)

Add pixels conditionally.

Computes dst[i] = dst[i] + src[i], where map[i] is set. The result is saturated.

Parameters:
[out] dst Destination pixel buffer.
dst_dim Row dimension of the destination buffer.
[in] src Source pixel buffer.
src_dim Row dimension of the source buffer.
[in] map Binary map pixel buffer.
map_dim Row dimension of the binary map buffer.
width Image width in pixels.
height Image height in pixels.
Returns:
A negative error code on error, zero otherwise.

Generated on 1 Jun 2016 for RAPP by  doxygen 1.6.1