palette-fold!

Synopsis

(palette-fold! colormap)

Parameters

  • colormap: A colormap with dimensions 65536x1 or 256x256

Description

This procedure converts a palette colormap with dimensions 65536x1 to its equivalent with dimensions 256x256 not changing the total number of color pixels. If the palette colormap has already dimensions of 256x256 the colormap dimensions are not altered and the palette colormap is returned unchanged.

Side Effects

The dimensions are changed only if the input dimensions are 65536x1.

Return Value

The palette colormap is returned.

Example

> (set! cm (colormap-scale-absolute cm 65536 1))
cm
> cm
#<colormap orow:-1 ocol:-1 xres:-1 yres:-1 w:65536 h:1>
> (palette-fold! cm)
#<colormap orow:-1 ocol:-1 xres:-1 yres:-1 w:256 h:256>
> cm
#<colormap orow:-1 ocol:-1 xres:-1 yres:-1 w:256 h:256>
>