ImageGear for C and C++ on Linux v18.10 - Updated
IG_runs_row_set
API Reference Guide > Core Component API Reference > Core Component Functions Reference > Run-End Functions > IG_runs_row_set

This function sets the run-end data of the line specified by the yPos parameter.

Declaration:

 
Copy Code
AT_ERRCOUNT ACCUAPI IG_runs_row_set(
        HIGEAR hIGear, 
        AT_PIXPOS yPos, 
        AT_RUN wRunCount, 
        LPCAT_RUN lpRunEnd
);

Arguments:

hIGear HIGEAR HIGEAR handle of the image containing the raster line you would like to modify.
yPos AT_PIXPOS Y-Offset into the image.
wRunCount AT_RUN The number of runs in the lpRunEnd buffer.
lpRunEnd LPCAT_RUN The Run- end pointer to copy into the image.

Return Value:

Returns the number of ImageGear errors that occurred during this function call. If there are no errors, the return value is IGE_SUCCESS.

Supported Raster Image Formats:

Indexed RGB - 1 bpp;
Grayscale – 1bpp.

Example:

See the example for IG_runs_row_get().

Remarks:

The wRunCount parameter should be set to the number of runs contained in the lpRunEnd buffer. Run-end encoding is used on 1-bit images only. This function is faster than using IG_DIB_raster_set() for a 1-bit image. This function copies the data in the lpRunEnd parameter to the second AT_RUN value of the line. The first AT_RUN value is set to the wRunCount parameter.

Developers should be cautious when using this function because it is possible to corrupt the image by supplying invalid run-end data.

Both of these functions will set an error if the image specified by hIGear is not in run-ends format or if the yPos parameter is greater than the height of the image.

The format of the run-end encoded data is as follows: Each line in the image starts with a value of type AT_RUN which stores the number of AT_RUN values used to hold the line. This value is equal to the number of runs in the line plus one (for the size value). The rest of the line consists of run ends of type AT_RUN. A run end specifies the first pixel position beyond the run of color. The run ends alternate between white and black, and start with white. The line ends with at least three run ends containing a value equal to the image's width. A 2500 pixel source line with black pixels in positions 0, 7, 23, and 30, would be encoded as runs: 10, 0, 1, 7, 8, 23, 31, 2500, 2500, 2500 (with 10 being the number of AT_RUN values used to store the encoded line.)

See also IG_runs_row_get() function.