colormap->graymap

Synopsis

(colormap->graymap colormap)

Parameters

  • colormap

Description

The colormap is converted to a new 16 bit graymap with the same dimensions. The 16 bit resulting value for each pixel is computed by adding all three RGB values expanded to (and treated as) “quarternary” format.

This expansion to 16 bit just adds a “0”-bit in front of each bit in the input byte, for example: The byte 0b11111111 is expanded to 0b0101010101010101.

The result of this conversion may display with more contrast than expected.

Side Effects

Return Value

The resulting 16 bit graymap is returned.

Example

> (define g (grabber-create))
g
> (define cm (grabber-grab g))
cm
> (colormap->graymap cm)
#<graymap(16) orow:-1 ocol:-1 xres:-1 yres:-1 h:720 w:1280>
>