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

image-access-pixels-to-bgra Function

Summary

Copies pixel values from an Image Access object into a vector.

Package

graphics-ports

Signature

image-access-pixels-to-bgra image-access vector

Arguments
image-access
An Image Access object.
vector
A vector.
Description

The function image-access-pixels-to-bgra copies all the pixels in the Image Access object image-access into the vector vector as a sequence of integer values in the range 0-255 for the blue, green, red and alpha components of each pixel. This function is optimized for the case where vector has element type (unsigned-byte 8). If the image has alpha, the values in vector are assumed to be premultiplied.

An error is signalled if vector is not of the correct length for the Image Access object, that is (* 4 width height) where width and height represent the size of image-access.

image-access must be an Image Access object returned by make-image-access.

Notes
  1. When setting values in a vector that is going to be used by image-access-pixels-to-bgra to modify an image with alpha using colors that came from elsewhere, you need to premultiply them either by hand (multiply the color values by the alpha), or using color-to-premultiplied.
  2. image-access-transfer-from-image must be called before this function (similarly to image-access-pixel).
Examples
(example-edit-file "capi/graphics/image-access-bgra")
See also

color-to-premultiplied
image-access-pixel
image-access-pixels-from-bgra


CAPI User Guide and Reference Manual (Windows version) - 01 Dec 2021 19:34:15