| 1 |
This file describes possible customizations of the libxmi library. Please |
| 2 |
read the file README first; it describes what libxmi does. |
| 3 |
|
| 4 |
1. If desired, modify the default definition of `miPixel' in ./xmi.h by |
| 5 |
defining the MI_PIXEL_TYPE preprocessor symbol at compile time. Each |
| 6 |
point in a miPaintedSet is painted with a miPixel, but what a miPixel |
| 7 |
is, is up to you. By default it is an `unsigned int', but it could be |
| 8 |
another integer type, a floating point type, a structure, a union... |
| 9 |
That would be arranged by defining MI_PIXEL_TYPE. If MI_PIXEL_TYPE is a |
| 10 |
structure or a union, the macro MI_SAME_PIXEL(), which tests two |
| 11 |
miPixels for equality, should be redefined too. |
| 12 |
|
| 13 |
2. If desired, define the macro MI_DEFAULT_MERGE2_PIXEL() also. As |
| 14 |
explained in ./xmi.h, by default, miCopyPaintedSetToCanvas() uses the |
| 15 |
Painter's Algorithm (a source pixel replaces a destination pixel). That |
| 16 |
may be altered programatically by invoking miSetPixelMerge2(). But at |
| 17 |
installation time, the default behavior may be altered too, by defining |
| 18 |
the macro MI_DEFAULT_MERGE2_PIXEL(new, source, dest). For example, if |
| 19 |
the miPixel datatype is defined to include an alpha component as well as |
| 20 |
color components, a change would be called for. |
| 21 |
|
| 22 |
3. The same, for the macro MI_DEFAULT_MERGE3_PIXEL(). This macro is used |
| 23 |
when a "texture" pixel is available as part of a miCanvas, and must be |
| 24 |
taken into account, besides the source pixel and the destination pixel |
| 25 |
already on the miCanvas. |
| 26 |
|
| 27 |
4. If desired, customize the definition of the `drawable' contained within |
| 28 |
an miCanvas by defining the symbol MI_CANVAS_DRAWABLE_TYPE. If this is |
| 29 |
not defined, the drawable will be an miPixmap. If you define |
| 30 |
MI_CANVAS_DRAWABLE_TYPE, you will also need to define the accessor |
| 31 |
macros MI_GET_CANVAS_DRAWABLE_PIXEL(pCanvas, x, y, pixel) and |
| 32 |
MI_SET_CANVAS_DRAWABLE_PIXEL(pCanvas, x, y, pixel). The macro |
| 33 |
MI_GET_CANVAS_DRAWABLE_BOUNDS(pCanvas, xleft, ytop, xright, ybottom) |
| 34 |
should be defined too. See ./xmi.h. |
| 35 |
|
| 36 |
|
| 37 |
Actually, if you are interested only in the first stage of the graphics |
| 38 |
pipeline, i.e., the painting of pixels in a miPaintedSet by the eight |
| 39 |
drawing functions in the core API, only modification #1 above is relevant. |
| 40 |
A miPaintedSet is an opaque object, but by looking at the function |
| 41 |
miCopyPaintedSetToCanvas() in the file mi_canvas.c, you should be able to |
| 42 |
see how it is laid out. It would be trivial to write your own function |
| 43 |
that copies pixels out of a miPaintedSet, i.e., to rewrite the second stage |
| 44 |
of the graphics pipeline from scratch in a completely customized way. |