11.01.2015 Views

CLIM 2 User Guide

CLIM 2 User Guide

CLIM 2 User Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

3.5 Pixmaps in <strong>CLIM</strong><br />

A pixmap can be thought of as an off-screen window, that is, a medium that can be used for graphical output,<br />

but is not visible on any display device. Pixmaps are provided to allow a programmer to generate a piece of<br />

output associated with some display device that can then later be rapidly drawn on a real display device.<br />

For example, an electrical CAD system might generate a pixmap that corresponds to a complex, frequently<br />

used part in a VLSI schematic, and then use draw-pixmap or copy-from-pixmap to draw the part<br />

as needed.<br />

The exact representation of a pixmap is explicitly unspecified.<br />

Note that there is no interaction between the pixmap operations and output recording, that<br />

is, displaying a pixmap on a sheet is a pure drawing operation that affects only the display, not the<br />

output history. Some mediums may not support pixmaps (such as PostScript mediums); in this<br />

case, an error will be signaled.<br />

copy-to-pixmap<br />

Arguments: medium medium-x medium-y width height<br />

&optional pixmap (pixmap-x 0) (pixmap-y 0)<br />

(boole-fun boole-1)<br />

[Function]<br />

■ Copies the pixels from the medium medium starting at the position specified by (mediumx,medium-y)<br />

into the pixmap pixmap at the position specified by (pixmap-x,pixmap-y). A<br />

rectangle whose width and height is specified by width and height is copied. medium-x and<br />

medium-y are specified in user coordinates. (If medium is a sheet or a stream, then medium-x<br />

and medium-y are transformed by the user transformation.)<br />

If pixmap is not supplied, a new pixmap will be allocated. Otherwise, pixmap must be an<br />

object returned by allocate-pixmap that has the appropriate characteristics for medium.<br />

The pixels are copied as if with the boolean operation specified by boole-fun. The value of<br />

that argument should one of the boole-xxx constants and defaults to boole-1, meaning that the<br />

source bits are set into the destination.<br />

Note that copy-to-pixmap does not record any information on an output record. drawpixmap<br />

and draw-pixmap* both do add to the output record.<br />

■ The returned value is the pixmap.<br />

copy-from-pixmap<br />

[Function]<br />

Arguments: pixmap pixmap-x pixmap-y width height medium medium-x<br />

medium-y &optional (boole-fun boole-1)<br />

■ Copies the pixels from the pixmap pixmap starting at the position specified by (pixmapx,pixmap-y)<br />

into the medium medium at the position (medium-x,medium-y). A rectangle<br />

whose width and height is specified by width and height is copied. medium-x and mediumy<br />

are specified in user coordinates. (If medium is a sheet or a stream, then medium-x and<br />

medium-y are transformed by the user transformation.)<br />

pixmap must be an object returned by allocate-pixmap that has the appropriate characteristics<br />

for medium.<br />

As for copy-to-pixmap, the pixels are copied as if with the boolean operation specified by<br />

boole-fun. The value of that argument should one of the boole-xxx constants and defaults to<br />

boole-1, meaning that the source bits are set into the destination.<br />

■ The returned value is the pixmap.<br />

40 <strong>CLIM</strong> 2.2 <strong>User</strong> <strong>Guide</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!