CD - Canvas Draw

Overview

CD is a platform-independent graphics library. It is implemented in several platforms using native graphics libraries: Microsoft Windows (GDI and GDI+) and X-Windows (XLIB).

The library contains functions to support both vector and image applications, and the visualization surface can be either a canvas or a more abstract surface, such as Clipboard, Metafile, PS, and so on.

To make the Application Programmers Interface (API) simple, all data are standard C types (int, double or char). Thus the application program does not have to maintain parallel data structures to deal with the graphic library.

Furthermore, the list of parameters of the CD primitive functions contains only the geometrical descriptions of the objects (line, circle, text, etc.). Where these objects should appear and what is the their color, thickness, etc. are defined as current state variables stored in the visualization surfaces. That is, the library is visualization-surface oriented, meaning that all attributes are stored in each visualization surface.

To control where the primitives are going to be drawn there we use the active canvas (visualization surface) concept. This means that you have to activate a given surface if you want to draw on it. As was pointed out, this approach simplifies the drawing for many primitives, so you do not have to pass the canvas as a parameter in each primitive. On the other hand, if there is no active canvas a call to a primitive does nothing and may cause an invalid memory access.

CD is free software, can be used for public and commercial applications.

Availability

The library is available for several compilers:

  • GCC and CC, in the UNIX environment
  • Visual C++, Borland C++, Watcom C++ and GCC (Cygwin and MingW), in the Windows environment

The library is available for several operating systems:

  • UNIX (SunOS, IRIX, AIX, FreeBSD and Linux)
  • Microsoft Windows NT/2K/XP

Support

The official support mechanism is by e-mail, using cd AT tecgraf.puc-rio.br (replace " AT " by "@"). Before sending your message:

  • Check if the reported behavior is not described in the user guide.
  • Check if the reported behavior is not described in the specific driver characteristics.
  • Check the History to see if your version is updated.
  • Check the To Do list to see if your problem has already been reported.

After all of the above have been checked, report the problem, including in your message: function, element, driver, platform, and compiler.

We host CD support features at LuaForge. It provides us Tracker, Lists, News, CVS and Files. The CD page at LuaForge is available at: http://luaforge.net/projects/cdlib/.

The discussion list is available at: http://lists.luaforge.net/mailman/listinfo/cdlib-users.
You can also submit Bugs, Feature Requests and Support Requests at: http://luaforge.net/tracker/?group_id=88.
Source code, pre-compiled binaries and samples can be downloaded at: http://luaforge.net/frs/?group_id=88.
The CVS can be browsed at: http://luaforge.net/scm/?group_id=88.

If you want us to develop a specific feature for the library, Tecgraf is available for partnerships and cooperation. Please contact tcg AT tecgraf.puc-rio.br.

Lua documentation and resources can be found at http://www.lua.org/.

Credits

This work was developed at Tecgraf by means of the partnership with PETROBRAS/CENPES.

We thank the people at the SEPROC department at CENPES and the library creators Marcelo Gattass, Luiz Henrique de Figueiredo, Luiz Fernando Martha and Carlos Henrique Levy.

Thanks to the people that worked in the library:
- Antonio Scuri (all since version 3.0)
- Carlos Cassino (X-Windows Platform Driver, Postscript Driver and WD functions),
- Renato Borges (X-Windows Platform Driver and WD functions),
- Marcelo Gattass (Microsoft Windows Platform Drivers),
- Carlos Augusto Mendes (DOS Platform Drivers),
- Diego Fernandes Nehab (DOS Platform Drivers, Lua binding),
- Danilo Tuler (Lua 5 binding),
- Vinicius da Silva Almendra (DGN Driver),
- Milton Jonathan (DXF Driver),
- Pedro Miller (DirectX Driver),
- Erick de Moura Ferreira (RGB Client Image Driver and Simulation,
- Carolina Alfaro (revision and translation of the user guide in Portuguese and English),
- Camilo Freire (CGM Driver),
- André Derraik (Macintosh Platform Beta Drivers),
- Alexandre Ferreira (Direct X Beta Driver)

We also thank the developers of the FreeType and Mesa libraries and of the XV program, for making the source code available, which helped us improve our implementation of the Simulation driver and of the X-Windows driver. Thanks to Jason Perkins for the Premake tool.

The CD distribution includes the FreeType library, this is a third party library not developed at Tecgraf. But its license is also free and have the same freedom as the Tecgraf Library License. You can read the Free Type license and copyright in the file freetype.txt. FreeType is copyright David Turner, Robert Wilhelm, and Werner Lemberg.

Documentation

This library is available at http://www.tecgraf.puc-rio.br/cd. 

The full documentation can be downloaded from the Download by choosing the "Documentation Files" option.

The documentation is also available in Adobe Acrobat (cd.pdf ~400Kb) and Windows HTML Help (cd.chm ~200Kb) formats.

The HTML navigation uses the WebBook tool, available at http://www.tecgraf.puc-rio.br/webbook.