image-access-pixel image-access x y => color-rep
(setf image-access-pixel) color-rep image-access x y => color-rep
The function image-access-pixel
returns the converted color at position
x
,
y
in the Image Access object
image-access
.
The converted color color-rep is a color representation like that returned by convert-color. If needed, color-rep can be converted to an RGB value using unconvert-color. color-rep can contain an alpha value, for images with an alpha channel, and in that case the values are premultiplied.
The function (setf image-access-pixel)
sets the value of the pixel at position
x
,
y
in the Image Access object
image-access
.
The color rep has to be a converted color, and if the image has alpha it is assumed to be premultiplied.
image-access must be an Image Access object returned by make-image-access.
If the result of image-access-pixel
on an image with alpha is used elsewhere (for example drawing a string with the same color), to get the same color you need to un-premultiply it first using color-from-premultiplied. When setting the color that came from elsewhere in an image with alpha, you will need to premultiply it using color-to-premultiplied. For images without alpha, premultiplication has no effect.
(example-edit-file "capi/graphics/image-access")
(example-edit-file "capi/graphics/image-access-alpha")
color-from-premultiplied
color-to-premultiplied
image-access-pixels-from-bgra
image-access-pixels-to-bgra
image-access-transfer-to-image
image-access-transfer-from-image
free-image-access
make-image-access
Image access
CAPI User Guide and Reference Manual (Windows version) - 3 Aug 2017