Gets and sets the pixels in an Image Access object.
graphics-ports
image-access-pixel image-access x y => color-rep
(setf image-access-pixel) color-rep image-access x y => color-rep
image-access⇩ |
An Image Access object. |
x⇩ |
An integer. |
y⇩ |
An integer. |
color-rep⇩ |
A color reference. |
color-rep⇩ |
A color reference. |
The accessor image-access-pixel
accesses 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 in color-rep are assumed to be 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
13.10.8 Image access
CAPI User Guide and Reference Manual (Macintosh version) - 01 Dec 2021 19:31:44