[Previous] [Contents] [Next]

Render Library

The render library includes the following functions:

Function Summary
my_bitmap() Draw a bitmap
my_blit() Copy data from one location to another
my_drawline() Draw a line
my_expose() Redraw part of the rendered area
my_fillbuffer() Fill the entire draw buffer with a given color
my_fillrect() Draw a filled rectangle
my_getpalette() Get the initial hardware palette
my_getpixel() Get a pixel in native printer coordinates
my_image() Draw an image
my_ispalette() Indicate whether colors are palette-based or RGB
my_ncolors() Get the number of colors available per pixel
my_palcolor() Convert a palette-based color into RGB
my_patfillrect() Fill a rectangle with a dithering pattern
my_patline() Draw a line with a dithering pattern
my_setclip() Set the clipping rectangle
my_setcolor() Set the color for subsequent drawing operations
my_set_dither() Set the dithering pattern
my_setdrawmode() Define the drawing mode for subsequent draw operations
my_setpalette() Set the palette for subsequent draw operations
_my_setpixel_l() Draw a single pixel (landscape mode)
_my_setpixel_p() Draw a single pixel (portrait mode)
my_set_transparency() Set the transparency pattern
my_string() Render a string
_Rect() Draw a rectangle in native printer coordinates

Note: You must provide the _Rect() functions. You can provide the other functions if necessary.

Unless otherwise stated, all these functions are given source coordinates. You can convert them to printer coordinates by calling:

_X( src_x )
_Y( src_y )

_Rect() is passed printer coordinates.

All these functions have to respect the orientation member of the _doc_ctrl structure. If this field is equal to Pp_LANDSCAPE, the function will need to switch the x and y coordinates.


Note: The Printer and Render library functions return different values:
Meaning Printer Render
Success 0 (EOK) 1
Error =/= 0 0

When overriding functions in the printer library, you simply link the filter using your private set of functions. In contrast, the render library is automatically initialized to use the default functions in the phrender_lib shared library. To override these functions, create your own version of the printer library's my_startrender() function and store pointers to your render functions in the _doc_ctrl structure.


[Previous] [Contents] [Next]