SOD C/C++ API Reference - Image Processing


Syntax

void sod_img_set_pixel(sod_img input, int x, int y, int c, float val);

Description

Add a constant value to a pixel at the given location. This value must be set between 0..1 such as 0.7.

Parameters

sod_img    input

The input image to be processed. The image can be loaded from disk using sod_img_load_from_file(), from memory (i.e. network socket) via sod_img_load_from_mem() or dynamically created via sod_make_image().

int    x

The x-coordinate, in logical units, of the pixel to be set.

int    y

The y-coordinate, in logical units, of the pixel to be set.

int    c

The target color channel starting from 0 for Red, 1 for Green and 2 for Blue in a typical RGB colorspace. Note that in a grayscale image, this value must be set to 0.

float    val

The constant value to be added at the target location.

Return Value

None. If the coordinate is out-of-range then this function is a no-op.

Example

Checkout the introduction course, the C/C++ samples on the download page or refer to the SOD Github Repository.

See also

sod_canny_edge_imagesod_grayscale_imagesod_img_get_layersod_hough_lines_detectsod_hilditch_thin_imagesod_make_image.



Back