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

NextPrevUpTopContentsIndex

image-access-pixels-from-bgra

Function
Summary

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

Package

graphics-ports

Signature

image-access-pixels-from-bgra image-access vector

Arguments

image-access

An Image Access object.

vector

A vector.

Description

The function image-access-pixels-from-bgra copies all the pixels to the Image Access object image-access from the vector vector . vector should contain a sequence of integer values in the range 0-255 for blue, green, red and alpha 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 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. If you want to use the values in the vector that was filled from an image with alpha in other places, to get the sample color you will need to un-premultiply them, either by hand (divide the color values by the alpha), or by making a RGB color and using color-from-premultiplied.
  2. image-access-transfer-to-image must be called after this function (similarly to (setf image-access-pixel) ).
Example
(example-edit-file "capi/graphics/image-access-bgra")
See also

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


CAPI User Guide and Reference Manual (Windows version) - 25 Feb 2015

NextPrevUpTopContentsIndex