All Manuals > CAPI User Guide > 13 Graphics Ports > 13.2 Features

NextPrevUpTopContentsIndex

13.2.1 The drawing mode and anti-aliasing

Graphics ports has two drawing modes:

:compatible

Compatible with LispWorks 6.0 and earlier versions

:quality

Introduced in LispWorks 6.1, allowing high quality drawing

The main visible effect is that with drawing-mode :quality , all drawings are transformed properly.

With drawing-mode :compatible , strings and images are not scaled or rotated at all, and ellipses are not rotated correctly. Other shapes are transformed "at the front", that is they are drawn as if the drawing function was called with transformed coordinates. The target of copy-pixels is also transformed "at the front", that is the rectangle can be translated, but not scaled or rotated.

With drawing-mode :quality , all drawings are fully transformed correctly. Shapes are transformed "at the back", that is they are drawn and then the result of the drawing is transformed. Note that clear-rectangle and pixblt are not drawing functions in this sense, and do not take transforms into account.

Another difference is that drawing-mode :quality supports anti-aliasing on Windows, and on GTK+ it adds control over anti-aliasing. See shape-mode and text-mode in the page for graphics-state in the LispWorks CAPI Reference Manual .

With drawing-mode :quality the operation value in the graphics-state is not supported and is ignored. This is because operations do not combine sensibly with anti-aliasing and colors with alpha components. Instead, there is now compositing-mode . See the page for graphics-state in the LispWorks CAPI Reference Manual .

On Microsoft Windows with drawing-mode :quality only Truetype fonts are supported.

The drawing-mode of all graphics ports is :quality by default, except when a graphics port is made in association with another graphics ports (for exanple, by create-pixmap-port ), in which case the drawing-mode is inherited from the "parent" graphics port.

All the interfaces that create graphics ports, or modify a graphics port to draw to another place, take keyword argument :drawing-mode . Its value drawing--mode can be :quality , :compatible , or nil which is interpreted as use the default (either inherited or the global default :quality ). These interfaces are listed in Creating instances.

These examples in the examples/capi/graphics/ directory demonstrate features that are available only with drawing-mode :quality :

catherine-wheel.lisp

Rotating a string.

compositing-mode-simple.lisp

Using compositing-mode .

compositing-mode.lisp

Using compositing-mode .

images-with-alpha.lisp

Using compositing-mode , transforming an image.


CAPI User Guide (Unix version) - 30 Aug 2011

NextPrevUpTopContentsIndex