5 The Paint

The paint describes the color or raster to be pushed through the shape, when the graphical object is displayed on a canvas. The paint concept in Bifrost supports any kind of pure colors, as well as more sophisticated features such as hatching, tiling, and sampled raster images. These various features of paint can be described in two main paint concepts: solid color and raster paint.

A solid color fills out the entire shape with one particular color. This concept may be specialized by allowing a repeated pattern, a tile, to be applied to the paint, conceptually by only allowing the paint to reach the canvas where this pattern allows it to. This is a way of obtaining various hatching effects.

Raster paint uses a raster to fill the shape. The concept Raster is described in Rasters. In order to use a raster to fill the shape several things must be specified: first, the raster itself must be specified; secondly, the raster position in the shape must be supplied (by specifying the hotspot of the raster in shape coordinates); third and last, it must be specified what to do if the raster is too small to fill out the entire shape. Bifrost supports two approaches when the raster is too small to fill out the entire shape: repeating the raster over and over again, thus tiling the interior of the shape with it, or by using a solid color - called a padding color - to fill out any parts of the shape not covered by the raster, and thus not filled by the raster image.

The paint hierarchy is illustrated in the Figure below. This hierarchy may, of course, be extended if needed.

Figure 11: The Paint Hierarchy

[1kb 183x79 GIF]

Two operations are defined for the general paint concept:

FillShape.
Takes a shape as argument and fills the shape with the paint on a canvas.
Copy.
Makes a (deep) copy of the paint


The Bifrost Graphics System - Reference Manual
© 1991-2002 Mjølner Informatics
[Modified: Tuesday October 24th 2000 at 15:02]