All Manuals > CAPI User Guide and Reference Manual > 22 GRAPHICS-PORTS Reference Entries

NextPrevUpTopContentsIndex

image-access-pixel

Function
Summary

Gets and sets the pixels in an Image Access object.

Package

graphics-ports

Signature

image-access-pixel image-access x y => color-rep

(setf image-access-pixel) color-rep image-access x y => color-rep

Arguments

image-access

An Image Access object

x

An integer.

y

An integer.

Values

color-rep

A color reference.

Description

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.

Notes

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
(example-edit-file "capi/graphics/image-access") (example-edit-file "capi/graphics/image-access-alpha")
See also

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) - 25 Feb 2015

NextPrevUpTopContentsIndex