CD - Canvas Draw

History of Changes

Version 4.4 (24/Ago/2005 - BETA 2)
                    (27/Jun/2005 - BETA 1)

  • TODO: fix error drawing simulated text when cross canvas border.
  • TODO: implement cdChord in Simulation Base Driver.
  • NEW: CDLua for Lua 5. The CDLua for Lua 3 is now also totally compatible with the "cd." name space used in the CDLUA for Lua 5. So the documentation now reflects only the new nomenclature although the old CDLua 3 names are still valid. (BETA 2)
  • NEW: cdlua_close function to release the memory allocated by the cdlua_open.
  • NEW: "ROTATE" attribute for PS driver, GDI+ base driver and GDI base driver.
  • NEW: CD_FILLSPLINE and CD_SPLINE parameters for cdBegin in GDI+ base driver.
  • NEW: support for complex regions for clipping using: cdBox, cdSector, Polygons and cdText. New parameter CD_REGION for cdBegin to create the region, new parameter CD_CLIPREGION for cdClip to select the region for clipping. New funtions to control regions: cdPointInRegion, cdOffsetRegion, cdRegionBox and  cdRegionCombineMode. Valid only for the Windows GDI, GDI+ and X-Windows base drivers and their derived drives.
  • NEW: mode for cdBegin, CD_BEZIER.
  • NEW: filled primitive cdChord.
  • NEW: polygon fill rule control using cdFillMode with CD_EVENODD (the default) and CD_WINDING parameters.
  • NEW: line cap and line join styles using cdLineCap and cdLineJoin.
  • NEW: typeface CD_NATIVE to indicate that a native font has been selected.
  • NEW: custom line style using cdLineStyleDashes and cdLineStyle(CD_CUSTOM). This replaces the attribute "USERLINESTYLE".
    (All NEW, when not specified the divers, are valid for all the drivers, except DXF, DGN e CGM.)
  • NEW: text utility function cdTextBounds that returns the oriented bounding rectangle. (BETA 2)
  • NEW: "IMAGEFORMAT" and "IMAGEALPHA" attributes for the Windows base driver. (BETA 2)
  • NEW: In GDI+, the CD_CLIPBOARD driver supports EMF and BMP formats. (BETA 2)
  • NEW: function cdReleaseState to release the memory allocated by a state. The cdRestoreState does not release the memory anymore so it can be used several times for the same state. (BETA 2)
  • IMPROVEMENT: Optimization flags now are ON when building the library in all platforms.
  • IMPROVEMENT: Upgraded Freetype to version 2.1.10. The CD library file size increased because of this. But we gain a better text rendering for images.
  • IMPROVEMENT: Better organization of the documentation.
  • CORRECTION: Text clipping for CD_IMAGERGB driver.
  • CORRECTION: fixed size in milimeter of cdGetScreenSize in Win32.
  • CORRECTION: fixed size of the EMF picture.
  • CORRECTION: fixed the parse of filenames with spaces for all file based drivers. The filename must be inside double quotes (") if it has spaces.
  • CORRECTION: cdSetAttribute in Lua now can set nil values.
  • CORRECTION: fixed cdSector when interior style is CD_HOLLOW, to include two lines connecting to the center point.
  • CORRECTION: In GDI+, the NATIVEWINDOW driver ignored other data pointer configurations in cdCreateCanvas.
  • CORRECTION: In GDI+, cdStipple was not updated when the foreground or background colors where changed. (BETA 2)
  • CORRECTION: In GDI+, cdSector and cdArc have incorrect angles. (BETA 2)
  • CORRECTION: "simple.c" and "simple.zip" were outdated. Now new makefiles were added.
  • CORRECTION: in Windows base driver small incompatibility in cdNativeFont with the IUP FONT attribute. (BETA 2)
  • IMPROVEMENT: In Windows the NATIVEWINDOW driver now accepts a NULL pointer to draw in the entire screen.
  • IMPROVEMENT: Optimized cdPutImageRGBARect in Windows base driver. (BETA 2)
  • CHANGE: The default fill rule for polygons in CD_PS is now the Even-Odd rule. Matching the other drivers.
  • CHANGE: Line Styles in GDI+ was corrected again to match GDI line styles when line width is not 1.
  • CHANGE: The native WC support in GDI+ was removed because of alignment and size problems, simulation will be used. (BETA 2)
  • CHANGE: the EMF drivers now ignore the resolution parameter. For EMFs, the resolution is always the screen resolution.
  • CHANGE: the value of following attributes were changed to strings "IMAGEMASK", "IMAGEPOINTS", "ROTATE", "GRADIENTCOLOR", "IMAGETRANSP" and  "IMAGEFORMAT".
  • CHANGE: in GDI+ base driver, the cdBegin modes CD_IMAGEWARP and CD_GRADIENT were moved to attributes "IMAGEPOINTS" and "LINEGRADIENT". Mode CD_PATHGRADIENT was renamed to CD_FILLGRADIENT, and "PATHGRADIENT" attribute was renamed to "GRADIENTCOLOR". Their definition was also changed.
  • CHANGE: cdImageEx was renamed to cdBitmap, and now supports only client images. This will cause a conflict with a macro definition in "im_image.h" header of the IM toolkit. Include this header before "cd.h" and inbetween set "#undef cdPutBitmap". The IM macro will be changed in the next IM version.
  • CHANGE: cdText is not dependent on the cdBackOpacity anymore. Text now is always transparent. If you need a box under the text use cdTextBox to calculate the dimensions for cdBox.

Version 4.3.3 (25/Aug/2004)

  • NEW: new "USERLINESTYLE" attribute for the base GDI and X11 drivers.
  • NEW: new "GC" attribute for the base X11 driver.
  • IMPROVEMENT: in the Native Window driver for the Windows system, the creation using a HDC can have an addicional parameter for the canvas size.
  • IMPROVEMENT: in cdTextSize for the GDI+ base driver we now compensates the height in -10% to match the GDI height.
  • IMPROVEMENT: The GDI+ printer driver now returns the HDC attribute.
  • CORRECTION: fixed a bug in cdNativeFont for the GDI+ base driver.
  • CORRECTION: again fixed a rounding error in cdPutImage* for big zooms.

Version 4.3.2 (14/Apr/2004)

  • CORRECTION: in the Win32 and X-Win drivers the cdPutImageRGB and cdPutImageMap functions when zooming bigger then the canvas where incorrectly positioning the image by some pixels because of round errors.

Version 4.3.1 (07/Nov/2003)

  • CORRECTION: in the Win32 driver the clipping of cdPutImage* functions when zooming was wrong. In the DoubleBuffer driver the main canvas cdOrigin can be used to move the image in the swap operation (cdFlush). In the GDI+ DoubleBuffer driver there was an error in the cdFlush when some primitive used world coordinates directly in the main canvas.

Version 4.3 (06/Mar/2003)

  • NEW: the function cdlua_getcanvas retreives the pointer of a canvas created in Lua.
  • NEW: in Win32 the function cdUseContextPlus change the behavior of the Windows drivers NativeWindow, IUP, Image, Printer, EMF and Double Buffer to make them use the GDI+ for drawing. GDI+ does not have support for XOR Write Mode, but it has other resources like: transparency, anti-aliasing, gradient filling, bezier lines and filled cardinal splines. WC functions are directly implemented in the base driver. Two new functions were created to support transparency in the CD color coding: cdEncodeAlpha and cdDecodeAlpha.Check the documentation for more information.
  • IMPROVEMENT: the Lua binding is now distributed in the same package. There is only one version number.
  • CORRECTION: the PS header had same flaws, the character ":" was missing in some DCS attributes.
  • CORRECTION: screen resolution was wrong in the Win32 driver, this afects the size of the canvas in milimeters.
  • CORRECTION: in the Win32 driver the creation of a polygon for clipping does not activate the clipping.
  • CORRECTION: in the Win32 driver the function cdNativeFont using "-d" parameter need some ajusts. Also the returned string does not contains all the used parameters.
  • CORRECTION: in the Win32 driver the function cdPutImageRectRGBA had a positioning error.

Version 4.2 (20/July/2001)

  • IMPROVEMENT: in driver Win32, cdNativeFont accepts parameter "-d" on the font name to show the font-selection dialog.
  • IMPROVEMENT: the whole code can now be compiled as C++.
  • IMPROVEMENT: functions wdPattern and wdStipple were changed to make pattern deformation more uniform.
  • CORRECTION: in the Clipboard driver on Win32, when parameter "-b" was used the image was not correctly copied.
  • CORRECTION: in certain moments, color vectors were being allocated with size 4 and should be "sizeof(long)". This was done to improve the compatibility with 64-bit systems.
  • CORRECTION: cdPutImageRectRGB in driver ImageRGB had a memory-invasion error in some cases when the image was placed in a negative coordinate.

Version 4.1.10 (04/May/2000)

  • IMPROVEMENT: the driver Native Windows in Win32 now also accepts an already created HDC handle as a parameter.
  • IMPROVEMENT: in the cdPutImageMap* functions, in case the color vector is null, a vector with 256 gray shades in assumed.
  • CORRECTION: cdRegisterAttribute was not verifying whether the attribute had already been registered.
  • CORRECTION: function cdArc in the simulation driver (includes ImageRGB) was returning without drawing anything in an incorrect test.
  • CORRECTION: function cdTextBox was returning incorrect values when the text had an orientation different from the default one in some alignment instances.
  • CORRECTION: in function cdRGB2Map there was a memory invasion.
  • CORRECTION: the vector text simulation was not freeing the memory used for fonts loaded from files.
  • CORRECTION: in the Doubled Buffer driver in X-Windows there was an invalid memory liberation.
  • CORRECTION: in the Lua binding, in several functions receiving or returning tables, the first index was being considered as 0, but in Lua they must be 1. This correction includes cdVectorTextTransform, cdGetVectorTextBounds, wdGetVectorTextBounds, cdGetClipPoly and wdGetClipPoly.
  • CORRECTION: when the PS driver generated EPS, it did not correctly add the description of the bounding box (a line break was missing).
  • CORRECTION: the vector text drawing functions did not take into account the fact that the default font and the GKS fonts were in ASCII standard. Now a conversion from ANSI to ASCII is made before these fonts are used for drawing.
  • CORRECTION: in the X-Win driver, an error in the X-Vertex library caused the texts in 90/270 degrees to be drawn incorrectly.
  • CORRECTION: in the X-Win driver, the cdPutImageMap functions were generating a memory invasion when the X was in 16 bits.
  • CORRECTION: in the Win32 driver, very large non-filled polygons were not being drawn in Windows 9x. To correct that, they were divided into smaller polygons.

Version 4.1 (24/Nov/99)

  • NEW: new basic Windows driver attributes that allow controling the internal simulation of pattern/stipple, XOR text, and filled polygon ("SIMXORTEXT", "SIMPATTERN8X8", "SIMPENFILLPOLY"). New attribute for returning the HDC of the Windows canvas.
  • NEW: the PS driver accepts landscape orientation as a parameter. New "POLYHOLE" attribute allows controling the number of holes in a closed polygon. New "-1" parameter forces a level 1 Postscript. New "-g" parameter adds comments to the PS file in order to better explain what is done. New "CMD" attribute saves a string to the file.
  • NEW: new environment variable, CD_QUIET, does not display in stdout the library's version information.
  • NEW: two new exclusive functions for the Native Window driver: cdGetScreenColorPlanes and cdGetScreenSize.
  • NEW: new CD_DBUFFER driver implements a double buffer using a server image.
  • NEW: new attributes in the ImageRGB driver: "REDIMAGE", "GREENIMAGE" and "BLUEIMAGE".
  • NEW: new functions wdGetVectorTextBounds and cdGetVectorTextBounds to obtain the bounding box of the vector text.
  • NEW: new wdGetFont function. It is equivalent to cdGetFont, but the returned size is in millimeters.
  • CORRECTION: the management of WD functions was incomplete for functions cdPixel, cdVertex and cdPutImage*. This resulted in a wrong or out of the canvas positioning. It only affects drivers PS and METAFILE.
  • CORRECTION: function cdActivate in Lua was not returning the correct values.
  • CORRECTION: when the image was partially out of the window, above or below, functions cdPutImageMap and RGB were drawing a wrong portion of the image.
  • CORRECTION: in the CGM driver, after opening the file of the cdPlay function, the check to see if the opening had been successful was not being done.
  • CORRECTION: when the active canvas was already NULL, the activation of a NULL canvas was generating a memory invasion.
  • CORRECTION: in the creation of EPS, the PS driver was adding a wrong call to setpagedevice. The cdPutImageMap function was modifying the wrong PS parameter in the file. The margin clipping was not saved when the drawing's clipping area was changed. The clipping area, when drawing in WD, was being incorrectly modified.
  • CORRECTION: in the IMAGERGB driver, functions cdRedImage, cdBlueImage and cdGreenImage were returning invalid pointers.
  • CORRECTION: when initializing text simulation functions, the opened font file was not being closed. This affected all CD drivers, but was only apparent in the application that opened and closed many drivers.
  • CORRECTION: the approximate computation of the text size was not accepting sizes in pixels.
  • CORRECTION: the creation of the IMAGERGB driver in Lua was incorrect when the resolution parameter (which is optional) was not specified.
  • CORRECTION: functions cdGetClipPoly and wdGetClipPoly in Lua were causing memory invasion.
  • IMPROVEMENT: in the PS driver, when the Map image is actually a grayscale, function cdPutImageMap uses an 8 bit image, thus saving memory. Level 2 Postscript functions rectfill, rectstroke and rectclip are now used. The comments in DCS were updated to DCS version 3 and were increased to improve the document's portability.
  • IMPROVEMENT: in driver X-Windows, the text drawing attribute was implemented with any orientation.
  • CHANGE: function cdVersion in Lua now behaves just like in C. A global Lua variable, CDLUA_VERSION, was created containing the version of the Lua binding library - for example: "CDLua 1.3.0".
  • CHANGE: function cdVectorTextTransform now returns the previsous transformation matrix.
  • TIP: when the creation of a printer canvas returns NULL, this means the user has cancelled the print dialogue.
  • TIP: in case the foreground and the background colors are modified, the hatched and monochromatic fillings must be changed again in order to be updated.
  • TIP: the Native Window driver works regularly in a window of the OpenGL library.
  • TIP: in the Guide topic of this user guide, a comparison between the CD library and other graphics libraries available for free in the Web was included.

Version 4.0.1 (05/Mar/99)

  • CORRECTION: in the Windows driver, the polygon simulation with pattern was corrected to polygons with repeated points.
  • CORRECTION: in the Windows driver, function cdNativeFont was corrected for IUP fonts. It was affecting the Matrix's visualization.
  • CORRECTION: function cdNativeFont was wrongly testing its input parameter and always returning.
  • CORRECTION: in the drivers IUP and Native Window, the cdGetCanvasSize function was corrected. When the window size was changed, the values in millimeters were not updated to cdActivate.
  • CORRECTION: in the CGM driver, function cdPlay was generating problems in reading and displaying cell arrays. When the cdCreateCanvas function used the default values for dimensions and resolution, it generated files with errors.
  • IMPROVEMENT: in the X-Windows driver, function cdPixel was optimized. It now compares the color to the foreground color and reuses the value.

Version 4.0 (18/Feb/99)

  • Summary: (necessary due to the great number of changes).
    - Update of the Lua binding.
    - Several changes in the internal structure (most bringing benefits only to the driver developer).
    - Countless corrections.
    - Small changes in the functions cdHatch, cdScrollImage, cdFont and cdPlay.
    - Optimization of functions  wdVectorFont and cdMark.
    - New functions:
       cdCreateCanvasf, cdGetContext, cdContextCaps, cdSaveState, cdRestoreState,   cdSetAttribute, cdGetAttribute
     cdOrigin, cdRect, wdRect, cdGetFont, cdGetStipple, cdGetPattern, cdTextBox
     cdPutImageRectRGB, cdPutImageRectRGBA, cdPutImageRectMap,
     cdCreateImageEx, cdKillImageEx, cdPutImageEx, cdGetImageEx
    .
    - New WD functions: wdHardcopy, wdPattern, wdStipple, wdPixel, wdPutImageRect, wdPutImageRectRGB, wdPutImageRectRGBA and wdPutImageRectMap.
    - New vector text functions: cdVectorFont, cdVectorTextDirection, cdVectorTextTransform, cdVectorTextSize, cdGetVectorTextSize, cdVectorCharSize, cdVectorText and cdMultiLineVectorText.
    - wdActivate is no longer necessary.
    - Driver IMAGERGB complete.
    - Driver SIMULATE no longer exists; now function cdSimulate must be used.
    - New driver DIRECTDRAW.
    - Policy change of cdPalette in the X-Windows driver
    - IUP driver is now in a separate library.

IMPORTANT NOTE: This version is not totally compatible to the previous one. The applications using the driver IUP must be relinked, as this driver is now in a separate library, "cdiup". The Lua applications must also be modified to include a call to function cdluaiup_open after cdlua_open, and must be linked with the "cdluaiup" library. The SIMULATE driver no longer exists, therefore the applications that used it must be modified to use the new function, cdSimulate, without the need for creating a new driver.

  • IMPROVEMENT: the internal structure of the library was changed once again. One of the purposes is to make the drivers become independent from the function table. With this change, adding a new function to the function table does not imply editing the old drivers. We also allowed the drivers not to implement functions that do not make sense in their context. Another modification simplifying the work in the drivers was to bring the attribute query mechanism to the library's control part, freeing the drivers from this obligation. Taking the chance, we determined that a change in an attribute to a value equal to the current one will not be effective, thus saving calls to the driver. Now, the value of an attribute is changed even if the driver function is not implemented, as the driver can query this attribute later on. The management of default values of the attributes is also done by the library's control part. All these changes prepare the library to a new philosophy: before, if a driver did not contain a certain feature, it simply did nothing. The new philosophy will be: if a driver does not contain a certain feature, then the simulation of this feature will be activated.
  • IMPROVEMENT: when a canvas which is already active is activated again, an internal driver function is now called, notifying an update instead of an activation.
  • IMPROVEMENT: the use of the CD canvas with a IUP canvas is better described in the manual, showing the various ways of treating the canvas creation prooblem.
  • IMPROVEMENT: all functions in the control module now have ASSERT directives. Thus, using the library with depuration information, one can better detect simple errors.
  • IMPROVEMENT: in order to use the IUP driver, it must be linked with the "cdiup" library, apart from the "cd" library (cdiup.lib in Windows, cdiuplib.a in UNIX).
  • IMPROVEMENT: the IMAGERGB driver is now implemented using the simulation functions.
  • IMPROVEMENT: the cdMark function is back to the function table, so that the drivers in which the primitive can be implemented can profit from it.
  • IMPROVEMENT: in order to assure that the use of server images is done only between canvases of the same driver, or of the same basic driver, an internal structure was defined for the server image containing the functions of the driver from which the image was created. Thus, if the cdKillImage function is called with an active canvas of a different kind from that in which the image was created, the KillImage function of the correct driver will be called.
  • IMPROVEMENT: in the X-Windows driver, the XV code was used to optimize functions cdPutImageRectRGB and cdPutImageRectMap.
  • IMPROVEMENT: the Lua binding was updated. Now the user guide contains Lua function together with C functions.
  • CHANGE: in the X-Windows driver, cdPalette's policy was changed to fulfill the requirements of some applications, which wanted to force a palette. Please see the function's documentation in the driver.
  • IMPROVEMENT: the CGM driver used to always store the cdForeground attribute before drawing a primitive; now it stores the attribute only when it is changed. The cdBackOpacity function was not implemented. The cdFlush function was not preserving the canvas attributes. Now when the canvas size is not specified in the cdCreateCanvas function, the VDC Extension saved to the file is the figure's bounding rectangle. The patterns and/or stipples selected were being stored in a way so that only the first one was valid.
  • CHANGE: the documentation of the old DOS driver was removed from the user guide.
  • CHANGE: the default resolution for drivers DGN, DXF, METAFILE, CGM and ImageRGB is no longer 1 but 3.8 points per mm (96 DPI).
  • CHANGE: in the cdInteriorStyle function, if stipple or pattern are not defined, the state of the attribute is not modified. There is no longer a default 32x32 pattern or stipple.
  • CHANGE: in functions cdFontDim and cdTextSize, if the driver does not support this kind of query, the values are estimated.
  • CHANGE: function cdHatch now returns the previous value.
  • CHANGE: function cdScrollImage is now called cdScrollArea, better reflecting its functionality, since it does not require any explicitly defined image to be performed. The old function is maintained to assure compatibility with old applications.
  • CHANGE: the cdPlay function now accepts all window parameters null. In this case, the primitives in the file are interpreted without scaling.
  • CHANGE: cdFontnow accepts font sizes in pixels when negative values are used as a parameter.
  • CHANGE: the WD functions were included in the library's function table, so that the drivers can use floating point precision when storing primitives. Presently, only the drivers PS and METAFILE have this resource directly implemented. With this change, the wdActivate function became obsolete and is no longer necessary. For purposes of compatibility with other applications, it was maintained only as a call to function cdActivate.
  • CHANGE: drivers EMF and WMF now accept the resolution as a parameter.
  • NEW: internal modification of the Windows driver to allow the creation of the DirectDraw driver.
  • NEW: DirectDraw driver to accelerate video access to high-performance applications.
  • NEW: function cdInteriorStyle now accepts style CD_HOLLOW. When this style is defined, the cdBox and cdSector functions behave like their equivalents cdRect and cdArc, and the polygons with the CD_FILL style behave like CD_CLOSED_LINES.
  • NEW: new functions:
    - cdCreateCanvasf accepts parameters equivalent to sprintf, helping in the creation of some canvases.
    - cdOrigin allows translating the origin - for instance, to the center of the canvas.
    - cdGetContext returns the context of a given canvas; it can be compared with predefined contexts, such as "CD_PS".
    - cdSaveState and cdRestoreState allow saving and restoring the state of attributes of the active canvas.
    - cdSetAttribute and cdGetAttribute allow passing customized attributes to the driver, which are ignored if the driver does not have the attribute defined.
    - cdContextCaps returns a combination of several flags informing the available resources of the canvas in that context.
    - Driver SIMULATE no longer exists. Now function cdSimulate must be used. The simulation can be activated and deactivated at any moment.
    - cdRect and wdRect allow drawing a box with no filling.
    - cdGetFont returns the values of the font modified by function cdFont and ignores those modified by cdNativeFont.
    - cdTextBox returns the horizontal bounding rectangle of the text box, even if it is bended.
    - cdGetStipple and cdGetPattern return current stipple and pattern. With these functions and with function cdGetFont, one can now totally change and restore the attributes of a given canvas.
    - wdPattern and wdStipple allow specifying the style in world coordinates. The size of the image is modified to the specified size in millimeters.
    - functions  cdPutImageRectRGB, cdPutImageRectRGBA and cdPutImageRectMap allow specifying a rectangle in the image to be used for the drawing instead of the whole image.
    - wdPixel, wdPutImageRect, wdPutImageRectRGB, wdPutImageRectRGBA and wdPutImageRectMap are equivalent to cdPixel, cdPutImageRect, cdPutImageRectRGB, cdPutImageRectRGBA and cdPutImageRectMap, respectively, but the target coordinates are specified in world coordinates.
    - New vector text functions: cdVectorFont, cdVectorTextDirection, cdVectorTextTransform, cdVectorTextSize, cdGetVectorTextSize, cdVectorCharSize, cdVectorText, cdMultiLineVectorText. The vector text can now be used without the need of world coordinates. Functions wdVectorFont and wdVectorTextTransform have become obsolete, though they still exist for compatibility reasons.
    - wdHarcopy helps drawing WD primitives in devices, adjusting Window and Viewport.
    - Auxiliary functions were created to manipulate all sorts of images in a single way, being either client, RGB, RGBA, MAP, or server images: cdCreateImageEx, cdKillImageEx, cdPutImageEx, cdGetImageEx, etc.
  • CORRECTION: the documentation of function cdFont was confusing, causing errors in the conversion from pixels to points.
  • CORRECTION: function wdFont was making a wrong conversion of the font size parameter from millimeters to points.
  • CORRECTION: functions  wdVectorText and wdMultiLineVectorText were generating an extra polygon when the text contained blank spaces in certain positions.
  • CORRECTION: the PS driver was not prepared for marked texts. Function cdFlush did not preserve current attributes. The interior style was affecting line drawing. The text alignment now takes into account an estimation for the baseline. Function cdTextOrientation was implemented. The world coordinate functions were implemented directly in the driver. Hatch and stipple interior styles were implemented, but they are still only opaque.
  • CORRECTION: in the X-Windows driver, function cdGetColorPlanes was returning 8 bpp even if the canvas was 24 bbp when the default visualization was different from the canvas' visualization in that X server. Text position on the screen was above the one entered. Function cdFont was looping in certain conditions. Function cdEnd in the X-Windows driver in the AIX system was generating an error and aborting the program if only one point of the polygon was specified. Dashed lines were always opaque, ignoring the cdBackOpacity attribute.
  • CORRECTION: in the Clipboard driver for X-Windows, a parameter was missing which prevented it from working properly. Before the update, it used that of the IUP/Native Window active canvas.
  • CORRECTION: in the Windows driver, the text position on the screen was above the position provided. Filled polygons had a one pixel error to the right and below due to the small NULL used. Fillings with hatch, pattern and stipple still contain errors. The internal simulation of polygons filled with pattern and stipple was also corrected; they had one additional pixel to the right and below. Text alignment treatment was improved.
  • CORRECTION: driver WMF now has text alignment.
  • CORRECTION: in the PRINTER (Windows) driver, function cdFlush was not preserving current attributes.
  • CORRECTION: in the CGM driver, the text align interpretation was corrected. The cdMark function is implemented directly in the driver. Function cdBackOpacity was implemented. Mark interpretation was also corrected.
  • OPTIMIZATION: function wdVectorFont only loads the new font if it is different from the current one.
  • OPTIMIZATION: function cdMark now modifies fill and line attributes only if they are different from the one needed to draw the mark.

Version 3.6 (05/May/98)

  • CORRECTION / Win32: every time the clipping region changed the old region was not deleted.
  • NEW: new function cdRGB2Map, which converts an RGB image into a 256 indexed-colors image. It is the same algorithm used in the IM library - in fact, it is the same code.
  • IMPROVEMENT: the cdMark function now uses the cdPixel function when drawing a mark of 1 pixel size.
  • IMPROVEMENT / Win32: the cdPixel function now uses the SetPixelV function when not under Win32s. This function is faster than the SetPixel function because it does not return the old value.
  • IMPROVEMENT / Win32: the polygon used for clipping is now optimized to not include 3 points that are in the same horizontal or vertical line.
  • CORRECTION / WD: the wdVectorText function was not drawing correctly when extended characters (>128) were used.
  • CORRECTION / X: the cdPalette function and the color management for canvases with only 256 colors were wrong. Each canvas had its own management, now all canvases in the same aplication use the same management.
  • CORRECTION / X: several resource and memory leaks were corrected.
  • CORRECTION / IMAGERGB: functions cdRedImage, cdGreenImage and cdBlueImage were not returning the correct pointer.
  • CORRECTION / SunOS: drivers IMAGERGB, SIMULATE and NATIVEWINDOW use  the "%p" format string, but in the SunOS they use "%d" because of an internal bug of the run time library of this OS.
  • IMPROVEMENT / IUP: driver IUP sets the cdCanvas function as an attribute of the IupCanvas passed as a parameter using the name "_CD_CANVAS".
  • MANUAL: the manual appearance was changed to match the new Tecgraf standard.

Version 3.5 (07/Jan/98)

  • NEW: the cdTextDirection function allows raster text to be drawn in any direction. Up to now it is implemented only in the basic Win32 driver.
  • CORRECTION / X / NativeWindow: the canvas was not created if the screen was 0.
  • CORRECTION / Win32 / NativeWindow: now the driver considers the existence of non owner-draw device contexts.
  • CORRECTION / Win32: function cdClipArea was not including xmax and xmin in the clipping area.
  • IMPROVEMENT: the cdCallback typedef was defined, being useful for type casting when calling the cdRegisterCallback function.
  • CORRECTION / Win32: a compatibility problem with the cdNativeFont string and the WINFONT IUP attribute was corrected.
  • IMPROVEMENT / Win32: the cdPutImageRGB and cdPutImageMap functions use a cache memory for best performance.
  • CORRECTION: text size estimation for the CGM and PS drivers now uses Courier New as the "System" font. As it was, it was causing a memory invasion.

Version 3.4 (12/Nov/97)

  • IMPROVEMENT / X: memory use of the cdPutImageRGB, cdPutImageRGBA and cdPutImageMap functions was optimized, as well as the performance of the cdPutImageMap function.
  • IMPROVEMENT / X and Win32: when the canvas has bpp <= 8, function cdPutImageRGB converts the image into Map before displaying it.
  • IMPROVEMENT / X and Win32: if a font's parameters are the same as the current parameters, the cdFont function does nothing.
  • DOC / PS: the "-d" parameter for the EPS option was not documented.
  • CORRECTION / PS: parameters "-w" and "-h" were incorrectly interpreted.
  • CORRECTION / X: the internal function names were generating an error in the VMS plataform.
  • CORRECTION / X: the cdKillCanvas function was freeing some pointers of the active canvas.
  • IMPROVEMENT / Win32: the cdVertex function now ignores duplicate points.
  • IMPROVEMENT / Win32: the cdNativeFont function also accepts the font string of the WINFONT IUP attribute.
  • CORRECTION / DXF: corrections in color conversion and in the cdArc function for small radius were made, and an unnecessary identation was removed.

Version 3.3 (19/Sep/97)

  • IMPROVEMENT / X: the cdFont function now has a better heuristic to find a closer font if the requested font does not match an available one.
  • IMPROVEMENT / X: the cdPattern and cdStipple functions now use a bitmap cache to store the pixmap and do not recreate it if the size is not changed.
  • CORRECTION / X and Win32: the cdPutImageRect function was placing the bitmap in a wrong position.
  • CORRECTION / Win32: the cdCreateImage function did not return NULL when the creating failed.
  • IMPROVEMENT / Win32: the cdPutImageRGB, cdPutImageRGBA and cdPutImageMap functions were largely optimized when the picture displayed is larger than the screen.
  • IMPROVEMENT / WMF: using the cdPlay function we discovered that the size of the picture was incorrect in the header file, so we first had to calculate the bounding box and then interpret the picture.
  • IMPROVEMENT / PS and CGM: now the cdFontDim and cdTextSize functions return approximate dimensions, instead of nothing.
  • CORRECTION / PS: the default font was not being set when the canvas was created.
  • CORRECTION / PS: text alignment was incorrect in the vertical direction.
  • CORRECTION / SIM: the clipping algorithm of the cdPixel function of the Simulation driver was corrected.
  • CORRECTION / CD: now you can activate a NULL canvas. When you get the active canvas and restore it, if it was NULL the cdActivate function was accessing an invalid pointer.
  • MANUAL: several changes were made on the online manual structure, and were added to the CDLua page.

Version 3.2

  • A problem in the cdFlush function in the Postscript driver was corrected. It was not setting the scale.
  • Functions wdFontDim and wdTextSize now check if the return pointers are not NULL.
  • An internal function in the DGN driver was drawing an ellipse with two times the axis size.
  • The cdFont function was corrected to store the font names in the CGM driver.

Version 3.1

  • Several minor bugs in the Win32 Printer driver and in the Postscript driver were corrected. The EPS mode of the PS driver now generates a "showpage" PS function so it can be printed.
  • The Clipboard driver was implemented in Motif. The cdPlay function was implemented in the Motif and Win32 Clipboard drivers.
  • The cdRegisterCallback function was added to allow the customization of the cdPlay function's behavior.
  • The wdVectorTextTransform function allows a 2D transformation applied to any vector text.
  • Now the Simulation driver has several levels of simulation, and the simulation was improved with pattern and clipping simulation.

Version 3.0

  • The library's architecture underwent several changes. The function tables are no longer public, only the drivers know its structure. This means that we have eliminated the need to recompile applications that use the dynamic library when we change something in the function table. There are some other benefits, like the fact that the Windows DLL can now be implemented and that it is more simple to explain the library to new users, so they will not be confused by the cdprivat.h header.
  • Corrections to the text alignment of the wdVectortext function were made.
  • Memory allocation of the cdPattern and cdStipple functions in the basic Windows driver was corrected.
  • Memory release of the cdKillCanvas function in the basic Windows driver was corrected.
  • The cdPattern function was implemented in the Postscript driver, and the cdPutImageRGB and cdPutImageMap functions now write color images.
  • The cdPattern function was corrected in the basic X-Windows driver for use with clipping.
  • The compiler directive #include<malloc.h> was changed to #include<stdlib.h> in several modules for better compatibility with other compilers.
  • The cdPlay function now accepts the viewport rectangle where the drawing will be rendered.
  • Several navigation changes were made to the user guide pages.
  • A new CD_SIMULATE driver was created. Use it to replace some primitives and to handle attributes of another driver. It can be used with any other driver. Basically, it substitutes the interior style of dependent primitives: box, sector and filled polygons. It also substitutes the clipping methods of these primitives.
  • The Windows DLL version of the library was created.

Version 2.2.1

  • Interrnal macros that affect wdArc and wdSector were corrected.
  • The CGM driver now supports some client image functions.
  • Hatch styles in the Image RGB driver were corrected.

Version 2.2.0

New Functions:

cdVersion - returns the current library version.
cdNativeFont - sets a native font.
cdPutImageRect - same as cdPutImage but you may specify a part of the image.
cdPutImageRGBA - cdPutImageRGB with transparency.
wdFont - cdFont for the WD client, the size parameter is in millimeters.

New Drivers:

NativeWindow - now the library can work with other Interface libraries.
DGN - MicroStation Design File.
EMF - Windows Enhanced Metafile.
CD Metafile - our own metafile.
Client Image RGB - now you can write in an RGB image.

  • DGN, CGM and DXF file-based drivers now have a default size in pixels (INT_MAX = 2.147.483.647) and are optional. In fact the size is irrelevant in these file formats. The cdCreateCanvas data string may contain the size in millimeters and the resolution in pixels per millimeters. Both are real values. The default resolution is 1.
  • The cdPlay function now works on the CGM and on the CD Metafile drivers.
  • The interior style attributes were implemented in the CGM driver.
  • On the Clipboard driver: limitations are considered if creating a WMF under Win32s.
  • Now the Printer Driver shows the Printer's Dialog Box (Win32 & Mac) if the parameter "-d" is specified.
  • On the PS driver: all the dimensions in the Data parameter string are now in millimeters.
  • On the WMF driver: several functions were disabled because of WMF limitations. Picture size was corrected.
  • On the basic X-Windows driver: cdLineWidth(1) uses width 0 for better performance. Stipple was being incorrectly interpreted. cdGetImageRGB was swapping red and blue channels on true color canvas.
  • The clipping region now can be a polygon on some systems/drivers (Win32, Mac, X-Win and PS). Use cdClip(CD_CLIPPOLYGON) to use the polygon defined by a cdBegin(CD_CLIP), cdVertex(...), cdEnd() sequence.
  • The functions wdMM2Pixel and wdPixel2MM became cdMM2Pixel and cdPixel2MM, respectively.
  • Minor bugs in the wdFontDim, wdLineWidth and wdMarkSize functions were corrected.
  • wdVectorCharSize now returns the previous value.

Up to Version 2.1

  • The cdActiveCanvas, cdPlay and the wdVectorFont functions were added, and the cdKillCanvas function was corrected when destroying the current canvas.
  • The cdMark function no longer depends on line style, line width and interior style attributes, and it is the same for all drivers because it is implemented only with CD functions.
  • The wdLineWidth and wdMarkSize functions now use millimeters.
  • The functions cdEncodeColor and cdDecodeColor now can be called without an active canvas. The DXF driver was added.
  • WD can now access files with vector font definitions.
  • Minor bugs in the wdTextSize function were corrected.