ImageGear Professional for Linux
Getting and Setting Linear Groups of Pixels

ImageGear lets you get and set the values of linear groups of pixels that run in a horizontal, vertical, or diagonal direction.

IG_DIB_column_get()

Gets the values of a variable-length (vertical) column of pixels.

The IG_DIB_column_get() function requires that you set the nX parameter to the horizontal position of the column that you would like to get, and also the first and last row from which you would like to get the pixel values. For this, you set the values of nY1 and nY2. You also give it a pointer to and nLenBytes (size in bytes) of the buffer to which you will store the pixel values. This function will return the actual number of pixel values acquired: lpNumPixels. If the buffer size of nLenBytes is not large enough to accommodate the number of pixels specified by nY1 and nY2, the line of pixels will be truncated, and you will not receive all of the pixels that you specified.

IG_DIB_column_set()

Sets the values of a column of pixels.

IG_DIB_column_set() does just the opposite as its _get() counterpart. It takes the pixel values in the buffer and transfers a specified number of them to a HIGEAR image at row nX, and columns nY1 through nY2. You also supply this function with the number of pixel values that you will be setting, where:

max # of pixels to set = (nY2 - nY1) + 1

IG_DIB_line_get()

Gets the values of a variable-length line of pixels.

Gives you access to the line of pixel values between any two sets of points in the image (i.e., a diagonal line, a horizontal line, or a vertical line). For this reason, it requires that you have set two x coordinates and two y coordinates. If you were to give equal values to either the x pair of coordinates or the y pair of coordinates, you would specify a line that was strictly horizontal or vertical, respectively. These get/set functions require that you give the size in bytes of the buffer and its address.

IG_DIB_line_set()

Sets the values of a line of pixels.

Gives you access to the line of pixel values between any two sets of points in the image (i.e., a diagonal line, a horizontal line, or a vertical line). For this reason, it requires that you set two x coordinates and two y coordinates. If you were to give equal values to either the x pair of coordinates or the y pair of coordinates, you would specify a line that was strictly horizontal or vertical, respectively. These get/set functions require that you give the size in bytes of the buffer and its address.

IG_DIB_raster_get()

Gets the values of a full raster line of pixels.

Works similarly to the IG_DIB_column_get() and IG_DIB_row_get() functions, except that it will get the values of a full (horizontal) raster line of pixels. This function is quite a bit easier to use than the above functions, however, because you do not need to supply the beginning and ending position of the line. Also, while you must allocate sufficient memory for the data, you do not need to tell ImageGear what number of bytes your buffer contains.

IG_DIB_raster_set()

Sets the values of a full raster line of pixels.

Works similarly to the IG_DIB_column_set() and IG_DIB_row_set() functions, except that it will set the values of a full (horizontal) raster line of pixels. This function is quite a bit easier to use than the above functions, however, because you do not need to supply the beginning and ending position of the line. Also, while you must allocate sufficient memory for the data, you do not need to tell ImageGear what number of bytes your buffer contains.

IG_DIB_row_get()

Gets the values of a variable-length (horizontal) row of pixels.

This function works exactly like IG_DIB_column_get(), except that it gets the values of a horizontal row of pixels.

IG_DIB_row_set()

Sets the values of a row of pixels.

This function works exactly like IG_DIB_column_set(), except that it sets the values of a horizontal row of pixels.

All pixel access functions consider the coordinates 0,0 as the upper left-hand corner of the bitmap data.

Raster and row access API allow packing more than one pixel per byte; to pack more than one pixel per byte, set the nFormat argument to IG_PIXEL_PACKED. For more details, see Pixel Access Modes.

See Also

Allocating Space for ImageGear Pixel Access Functions

 

 


©2016. Accusoft Corporation. All Rights Reserved.

Send Feedback