From 1ad72d5276b1876bf218336a1ff47f086a0834c9 Mon Sep 17 00:00:00 2001 From: scuri Date: Thu, 24 Jun 2010 20:32:39 +0000 Subject: *** empty log message *** --- html/en/drv/gl.html | 2 +- html/en/func/client.html | 44 +++++++++++++++++++++---------------------- html/en/func/clipping.html | 12 ++++++------ html/en/func/color.html | 28 +++++++++++++-------------- html/en/func/control.html | 20 +++++++++++--------- html/en/func/coordinates.html | 32 +++++++++++++++---------------- html/en/func/init.html | 35 +++++++++++++++++----------------- html/en/func/lines.html | 22 +++++++++++----------- html/en/func/marks.html | 31 +++++++++++++++--------------- html/en/func/other.html | 16 ++++++++-------- html/en/func/polygon.html | 10 +++++----- html/en/func/region.html | 10 +++++----- html/en/func/server.html | 12 ++++++------ html/en/func/text.html | 26 ++++++++++++------------- html/en/func/vectortext.html | 28 +++++++++++++-------------- html/en/func/wd.html | 26 ++++++++++++------------- html/en/to_do.html | 11 +++++++++++ 17 files changed, 189 insertions(+), 176 deletions(-) (limited to 'html') diff --git a/html/en/drv/gl.html b/html/en/drv/gl.html index cff89db..e7c07d5 100644 --- a/html/en/drv/gl.html +++ b/html/en/drv/gl.html @@ -74,7 +74,7 @@ must be set with the new size or cdCanvasGetSize will return an incorrect value.

Client Images

diff --git a/html/en/func/client.html b/html/en/func/client.html index 20a6c4e..93fd9b2 100644 --- a/html/en/func/client.html +++ b/html/en/func/client.html @@ -21,7 +21,7 @@

The Put functions may do zoom in or out; zero order interpolation is used to scale the image. It is not possible to specify a part of the image to be drawn.


-
void cdCanvasGetImageRGB(cdCanvas* canvas, unsigned char *r, 
+  
void cdCanvasGetImageRGB(cdCanvas* canvas, unsigned char *r, 
                    unsigned char *g, 
                    unsigned char *b, 
                    int x, int y, int w, int h); [in C]
@@ -34,7 +34,7 @@ canvas:GetImageRGB(imagergb: cdImageRGB; x, y: number) [in Lua]
library, the pixel (0,0) is at the bottom left corner, and the pixel (w-1,h-1) is that the upper right corner of the image rectangle.

-
void cdCanvasPutImageRectRGB(cdCanvas* canvas, int iw, int ih, 
+    
void cdCanvasPutImageRectRGB(cdCanvas* canvas, int iw, int ih, 
                        const unsigned char *r, 
                        const unsigned char *g, 
                        const unsigned char *b, 
@@ -69,7 +69,7 @@ canvas:wPutImageRectRGB(imagergb: cdImageRGB; x, y, w, h, xmin, xmax, ymin, ymax
     

If the driver has bpp <=8 or only 256 colors or less, then the image is converted to 256 optimal colors using the function cdRGB2Map and is drawn using cdPutImageRectMap.

-
void cdCanvasPutImageRectRGBA(cdCanvas* canvas, int iw, int ih, 
+    
void cdCanvasPutImageRectRGBA(cdCanvas* canvas, int iw, int ih, 
                         const unsigned char *r, 
                         const unsigned char *g, 
                         const unsigned char *b, 
@@ -96,7 +96,7 @@ canvas:wPutImageRectRGBA(imagergba: cdImageRGBA; x, y, w, h, xmin, xmax, ymin, y
     

If this function is not defined for a given driver or if alpha is NULL, then the function cdPutImageRectRGB is used, as long as it is defined.

-
void cdCanvasPutImageRectMap(cdCanvas* canvas, int iw, int ih, 
+    
void cdCanvasPutImageRectMap(cdCanvas* canvas, int iw, int ih, 
                        const unsigned char *index, 
                        const long int *colors, 
                        int x, int y, int w, int h, 
@@ -114,7 +114,7 @@ canvas:wPutImageRectMap(imagemap: cdImageMap; palette: cdPalette; x, y, w, h, xm
       (map). The color corresponding to a given index is given in  colors[index]. 
       The map is also a matrix stored as a byte vector. If the color vector is null, 
       then a vector with 256 gray tones is assumed.

-
void cdRGB2Map(int iw, int ih, 
+    
void cdRGB2Map(int iw, int ih, 
                const unsigned char *r, 
                const unsigned char *g, 
                const unsigned char *b, 
@@ -126,7 +126,7 @@ cd.RGB2Map(imagergb: cdImageRGB, imagemap: cdImageMap, palette: cdPalette) [in L
       image must have the same size (width x length) as the RGB image. It is 
       necessary to allocate memory for the arrays map and
       colors. This is the same algorithm used in the IM 
-      library - in fact, the same code.

+ library - in fact, the same code.

Extras

The following functions are used only for encapsulating the several types of client images from the library in a single structure, simplifying their @@ -138,7 +138,7 @@ cd.RGB2Map(imagergb: cdImageRGB, imagemap: cdImageMap, palette: cdPalette) [in L int w /* image width */ int h /* image heigth */ int type /* image type: CD_RGBA, CD_RGB or CD_MAP */

-
cdBitmap* cdCreateBitmap(int w, int h, int type); [in C]
+    
cdBitmap* cdCreateBitmap(int w, int h, int type); [in C]
 
 cd.CreateBitmap(w, h, type: number) -> (bitmap: cdBitmap) [in Lua]

Creates an image with width w, and height h and @@ -149,7 +149,7 @@ cd.CreateBitmap(w, h, type: number) -> (bitmap: cdBitmap) [in Lua]

Internally, the color palette is always allocated with 256 entries, which may or may not be totally fulfilled. In this case, the value of type can be changed as wished.

-
cdBitmap* cdInitBitmap(int w, int h, int type, ...); [in C]
+    
cdBitmap* cdInitBitmap(int w, int h, int type, ...); [in C]
 
 [There is no equivalent in Lua]

Similar to cdCreateBitmap, but it accepts the @@ -158,12 +158,12 @@ cd.CreateBitmap(w, h, type: number) -> (bitmap: cdBitmap) [in Lua]

CD_RGBA - (unsigned char* red, unsigned char* green, unsigned char* blue, unsigned char* alpha)
 CD_RGB - (unsigned char* red, unsigned char* green, unsigned char* blue)
 CD_MAP - (unsigned char* index, lont int* colors)
-
void cdKillBitmap(cdBitmap* image); [in C]
+    
void cdKillBitmap(cdBitmap* image); [in C]
 
 cd.KillBitmap(bitmap: cdBitmap) [in Lua]

Liberates the memory allocated for the image. If this function is not called in Lua, the garbage collector will call it.

-
unsigned char* cdBitmapGetData(cdBitmap* image, int dataptr); [in C]
+    
unsigned char* cdBitmapGetData(cdBitmap* image, int dataptr); [in C]
 
 cd.BitmapGetData(bitmap: cdBitmap; dataptr: number) -> (data: cdImageChannel) [in Lua]

Returns a pointer to the image's data area according to dataptr. @@ -177,13 +177,13 @@ cd.BitmapGetData(bitmap: cdBitmap; dataptr: number) -> (data: cdImageChannel)

In Lua, channels are also available as tables, see Data Access

-
void cdBitmapSetRect(cdBitmap* image, int xmin, int xmax, int ymin, int ymax); [in C]
+    
void cdBitmapSetRect(cdBitmap* image, int xmin, int xmax, int ymin, int ymax); [in C]
 
 cd.BitmapSetRect(bitmap: cdBitmap; xmin, xmax, ymin, ymax: number) [in Lua]

Allows specifying a region of interest inside the image to be used by the function cdPutBitmap. If no region was defined, the whole image is used, that is, (0, w-1, 0, h-1).

-
void cdCanvasPutBitmap(cdCanvas* canvas, cdBitmap* image, int x, int y, int w, int h); [in C]
+    
void cdCanvasPutBitmap(cdCanvas* canvas, cdBitmap* image, int x, int y, int w, int h); [in C]
 void wdCanvasPutBitmap(cdCanvas* canvas, cdBitmap* image, double x, double y, double w, double h); (WC) [in C]
 
 canvas:PutBitmap(image: cdBitmap; x, y, w, h: number) [in Lua]
@@ -197,35 +197,35 @@ canvas:wPutBitmap(bitmap: cdBitmap; x, y, w, h: number) (WC) [in Lua]
image, increasing or decreasing its dimensions when drawn. If  w and/or h are 0, then no scale change is assumed.

-
void cdCanvasGetBitmap(cdCanvas* canvas, cdBitmap* image, int x, int y); [in C]
+    
void cdCanvasGetBitmap(cdCanvas* canvas, cdBitmap* image, int x, int y); [in C]
 
 canvas:GetBitmap(bitmap: cdBitmap; x, y: number) [in Lua]

Encapsulates cdGetImageRGB. Nothing happens if the image is MAP.

-
void cdBitmapRGB2Map(cdBitmap* image_rgb, cdBitmap* image_map); [in C]
+    
void cdBitmapRGB2Map(cdBitmap* image_rgb, cdBitmap* image_map); [in C]
 
 cd.BitmapRGB2Map(bitmap_rgb: cdBitmap, bitmap_map: cdBitmap) [in Lua]

Encapsulates cdRGB2Map. The images must be of - types RGB(A) and MAP, respectively.

+ types RGB(A) and MAP, respectively.

Extras in Lua (Deprecated)

-
cd.CreateImageRGB(width, height: number) -> (imagergb: cdImageRGB)
+
cd.CreateImageRGB(width, height: number) -> (imagergb: cdImageRGB)

Creates an RGB image in Lua. Deprecated use cd.CreateBitmap.

-
cd.KillImageRGB(imagergb: cdImageRGB)
+
cd.KillImageRGB(imagergb: cdImageRGB)

Destroys the created RGB image and liberates allocated memory. If this function is not called in Lua, the garbage collector will call it. Deprecated use cd.KillBitmap.

-
cd.CreateImageRGBA(width, height: number) -> (imagergba: cdImageRGBA)
+
cd.CreateImageRGBA(width, height: number) -> (imagergba: cdImageRGBA)

Creates an RGBA image in Lua. Deprecated use cd.CreateBitmap.

-
cd.KillImageRGBA(imagergba: cdImageRGBA)
+
cd.KillImageRGBA(imagergba: cdImageRGBA)

Destroys the created RGBA image and liberates allocated memory. If this function is not called in Lua, the garbage collector will call it. Deprecated use cd.KillBitmap.

-
cd.CreateImageMap(width, height: number) -> (imagemap: cdImageMap)
+
cd.CreateImageMap(width, height: number) -> (imagemap: cdImageMap)

Creates a Map image in Lua. Deprecated use cd.CreateBitmap.

-
cd.KillImageMap(imagemap: cdImageMap)
+
cd.KillImageMap(imagemap: cdImageMap)

Destroys the created Map image and liberates allocated memory. If this function is not called in Lua, the garbage collector will call it. Deprecated use - cd.KillBitmap.

+ cd.KillBitmap.

Data Access

Data access in Lua is done directly using the operator "[y*width + x]" in image channels. Each channel works as a value table which should be diff --git a/html/en/func/clipping.html b/html/en/func/clipping.html index 00bbbdd..d875b17 100644 --- a/html/en/func/clipping.html +++ b/html/en/func/clipping.html @@ -19,7 +19,7 @@ texts.

The Clip function activates and deactivaes the clipping.


-
int cdCanvasClip(cdCanvas* canvas, int mode); [in C]
+    
int cdCanvasClip(cdCanvas* canvas, int mode); [in C]
 
 canvas:Clip(mode: number) -> (old_mode: number) [in Lua]

Activates or deactivates clipping. Returns the previous status. Values: CD_CLIPAREA, @@ -41,7 +41,7 @@ canvas:Clip(mode: number) -> (old_mode: number) [in Lua]

polygon and complex region without having to define them again. Also if the active clipping region is re-defined it immediately becomes the current clipping region.

-
void cdCanvasClipArea(cdCanvas* canvas, int xmin, int xmax, int ymin, int ymax); [in C]
+    
void cdCanvasClipArea(cdCanvas* canvas, int xmin, int xmax, int ymin, int ymax); [in C]
 void cdfCanvasClipArea(cdCanvas* canvas, double xmin, double xmax, double ymin, double ymax); [in C]
 void wdCanvasClipArea(cdCanvas* canvas, double xmin, double xmax, double ymin, double ymax); (WC) [in C]
 
@@ -51,7 +51,7 @@ canvas:wClipArea(xmin, xmax, ymin, ymax: number) (WC) [in Lua]
x <= xmax
and ymin <= y <= ymax will be printed. Default region: (0, w-1, 0, h-1).

-
int cdCanvasGetClipArea(cdCanvas* canvas, int *xmin, int *xmax, int *ymin, int *ymax); [in C]
+    
int cdCanvasGetClipArea(cdCanvas* canvas, int *xmin, int *xmax, int *ymin, int *ymax); [in C]
 int cdfCanvasGetClipArea(cdCanvas* canvas, double *xmin, double *xmax, double *ymin, double *ymax); [in C]
 int wdCanvasGetClipArea(cdCanvas* canvas, double *xmin, double *xmax, double *ymin, double *ymax); (WC) [in C]
 
@@ -59,9 +59,9 @@ canvas:GetClipArea() -> (xmin, xmax, ymin, ymax, status: number) [in Lua]
 canvas:wGetClipArea() -> (xmin, xmax, ymin, ymax, status: number) (WC) [in Lua]

Returns the rectangle and the clipping status. It is not necessary to provide all return pointers, you can provide only the desired values and NULL - for the others.

-

Polygons

+ for the others.

+
Polygons

A polygon for clipping can be created using cdBegin(CD_CLIP)/cdVertex(x,y)/.../cdEnd().

-

See the documentation of cdBegin/cdVertex/cdEnd.

+

See the documentation of cdBegin/cdVertex/cdEnd.

diff --git a/html/en/func/color.html b/html/en/func/color.html index fbd4b52..de8216a 100644 --- a/html/en/func/color.html +++ b/html/en/func/color.html @@ -36,19 +36,19 @@ CD_DARK_GRAY = (128,128,128) CD_GRAY = (192,192,192)

-
long int cdEncodeColor(unsigned char red, unsigned char green, unsigned char blue) [in C]
+    
long int cdEncodeColor(unsigned char red, unsigned char green, unsigned char blue) [in C]
 
 cd.EncodeColor(r, g, b: number) -> (old_color: lightuserdata) [in Lua]

Returns a codified triple (r,g,b) in a long integer such as 0x00RRGGBB, where RR are the red components, GG are the green ones and BB are the blue ones. The code is used in the CD library to define colors. It can be used without an active canvas.

-
void cdDecodeColor(long int color, unsigned char *red, unsigned char *green, unsigned char *blue) [in C]
+    
void cdDecodeColor(long int color, unsigned char *red, unsigned char *green, unsigned char *blue) [in C]
 
 cd.DecodeColor(color: lightuserdata) -> (r, g, b: number) [in Lua]

Returns the red, green and blue components of a color in the CD library. Can be used without an active canvas.

-
long int cdEncodeAlpha(long int color, unsigned char alpha) [in C]
+    
long int cdEncodeAlpha(long int color, unsigned char alpha) [in C]
 
 cd.EncodeAlpha(color: lightuserdata, alpha: number) -> (color: lightuserdata) [in Lua]

Returns the given color coded with the alpha information. ATENTION: At the @@ -60,40 +60,40 @@ cd.EncodeAlpha(color: lightuserdata, alpha: number) -> (color: lightuserdata) must be 0 and opaque for backward compatibility, so you should use the cdDecodeAlpha function or the cdAlpha macro to retrieve the alpha component. 0 is transparent, 255 is opaque.

-
unsigned char cdDecodeAlpha(long int color) [in C]
+    
unsigned char cdDecodeAlpha(long int color) [in C]
 
 cd.DecodeAlpha(color: lightuserdata) -> (a: number) [in Lua]

Returns the alpha component of a color in the CD library. Can be used without an active canvas. 0 is transparent, 255 is opaque.

-
unsigned char cdAlpha(long int color); [in C]
+    
unsigned char cdAlpha(long int color); [in C]
 
 cd.Alpha(color: lightuserdata) -> (r: number) [in Lua]

Macro that returns the alpha component of a color in the CD library. Can be used without an active canvas.

-
unsigned char cdRed(long int color); [in C]
+    
unsigned char cdRed(long int color); [in C]
 
 cd.Red(color: lightuserdata) -> (r: number) [in Lua]

Macro that returns the red component of a color in the CD library. Can be used without an active canvas.

-
unsigned char cdGreen(long int color); [in C]
+    
unsigned char cdGreen(long int color); [in C]
 
 cd.Green(color: lightuserdata) -> (g: number) [in Lua]

Macro that returns the green component of a color in the CD library. Can be used without an active canvas.

-
unsigned char cdBlue(long int color); [in C]
+    
unsigned char cdBlue(long int color); [in C]
 
 cd.Blue(color: lightuserdata) -> (b: number) [in Lua]

Macro that returns the blue component of a color in the CD library. Can be used without an active canvas.


-
int cdCanvasGetColorPlanes(cdCanvas* canvas); [in C]
+    
int cdCanvasGetColorPlanes(cdCanvas* canvas); [in C]
 
 canvas:GetColorPlanes() -> (bpp: number) [in Lua]

Returns a given number, for instance p, which defines the number of colors supported by the current device as 2p, representing the number of bits by pixel.

-
void cdCanvasPalette(cdCanvas* canvas, int n, const long int *color, int mode); [in C]
+    
void cdCanvasPalette(cdCanvas* canvas, int n, const long int *color, int mode); [in C]
 
 canvas:Palette(palette: cdPalette; mode: number) [in Lua]

In systems limited to 256 palette colors, this function aims at adding  @@ -104,15 +104,15 @@ canvas:Palette(palette: cdPalette; mode: number) [in Lua]

since the menus and dialogues may be in illegible colors, but there will be more colors available. CD_POLITE is the recommended type. It must always be used before drawing. It cannot be queried.

- +

Palette

-
cd.CreatePalette(size: number) -> (palette: cdPalette) [in Lua Only]
+
cd.CreatePalette(size: number) -> (palette: cdPalette) [in Lua Only]

Creates a palette.

-
cd.KillPalette(palette: cdPalette) [in Lua Only]
+
cd.KillPalette(palette: cdPalette) [in Lua Only]

Destroys the created palette and liberates allocated memory. If this function is not called in Lua, the garbage collector will call it.

- +

Palette Data Access

Data access in Lua is done directly using the array access operators. The diff --git a/html/en/func/control.html b/html/en/func/control.html index 5ccdd1c..42b8762 100644 --- a/html/en/func/control.html +++ b/html/en/func/control.html @@ -8,7 +8,7 @@

Canvas Control

-
void cdCanvasClear(cdCanvas* canvas); [in C]
+    
void cdCanvasClear(cdCanvas* canvas); [in C]
 
 canvas:Clear() [in Lua]

Cleans the active canvas using the current background color. This action is @@ -16,48 +16,50 @@ canvas:Clear() [in Lua]

rectangle with the current background color. It is NOT necessary to call cdClear when the canvas has just been created, as at this moment it is already clean. Most file-based drivers do not implement this function.

-
void cdCanvasFlush(cdCanvas* canvas); [in C]
+    
void cdCanvasFlush(cdCanvas* canvas); [in C]
     
 canvas:Flush() [in Lua]

Has a different meaning for each driver. It is useful to send information to buffered devices and to move to a new page or layer. In all cases, the current canvas attributes are preserved.

+

-
cdState* cdCanvasSaveState(cdCanvas* canvas); [in C]
+    
cdState* cdCanvasSaveState(cdCanvas* canvas); [in C]
     
 canvas:SaveState() -> (state: cdState) [in Lua]

Saves the state of attributes of the active canvas. It does not save cdPlay callbacks, polygon creation states (begin/vertex/vertex/...), the palette, complex clipping regions and driver internal attributes.

-
void cdCanvasRestoreState(cdCanvas* canvas, cdState* state); [in C]
+    
void cdCanvasRestoreState(cdCanvas* canvas, cdState* state); [in C]
     
 canvas:RestoreState(state: cdState) [in Lua]

Restores the attribute state of the active canvas. It can be used between canvases of different contexts. It can be used several times for the same state.

-
void cdReleaseState(cdState* state); [in C]
+    
void cdReleaseState(cdState* state); [in C]
 
 cd.ReleaseState(state: cdState) [in Lua]

Releases the memory allocated by the cdSaveState function. If this function is not called in Lua, the garbage collector will call it.

-
-
void cdCanvasSetAttribute(cdCanvas* canvas, const char* name, char* data); [in C]
+    
+    

void cdCanvasSetAttribute(cdCanvas* canvas, const char* name, char* data); [in C]
     
 canvas:SetAttribute(name, data: string) [in Lua]

Modifies a custom attribute directly in the driver of the active canvas. If the driver does not have this attribute, the call is ignored.

-
void cdCanvasSetfAttribute(cdCanvas* canvas, const char* name, const char* format, ...); [in C]
+    
void cdCanvasSetfAttribute(cdCanvas* canvas, const char* name, const char* format, ...); [in C]
     
 [There is no equivalent in Lua]

Same as cdSetAttribute, used for the case in which the parameter data is a string composed by several parameters. It can be  used with parameters equivalent to those of the printf function from the standard C library.

-
char* cdCanvasGetAttribute(cdCanvas* canvas, const char* name); [in C]
+    
char* cdCanvasGetAttribute(cdCanvas* canvas, const char* name); [in C]
     
 canvas:SetAttribute(name: string) -> (data: string) [in Lua]

Returns a custom attribute from the driver of the active canvas. If the driver does not have this attribute, it returns NULL.

+
\ No newline at end of file diff --git a/html/en/func/coordinates.html b/html/en/func/coordinates.html index a56b12d..ffaed2a 100644 --- a/html/en/func/coordinates.html +++ b/html/en/func/coordinates.html @@ -11,14 +11,14 @@

Coordinate System

-
void cdCanvasGetSize(cdCanvas* canvas, int *width, int *height, double *width_mm, double *height_mm); [in C]
+
void cdCanvasGetSize(cdCanvas* canvas, int *width, int *height, double *width_mm, double *height_mm); [in C]
 
 canvas:GetSize() -> (width, height, mm_width, mm_height: number) [in Lua]

Returns the canvas size in pixels and in millimeters. You can provide only the desired values and NULL for the others.

-
int cdCanvasYAxisMode(cdCanvas* canvas, int invert); [in C]
+
int cdCanvasYAxisMode(cdCanvas* canvas, int invert); [in C]
 
 canvas:YAxisMode(invert: number) -> (old_invert: number) [in Lua]
@@ -30,7 +30,7 @@ canvas:YAxisMode(invert: number) -> (old_invert: number) [in Lua]
orientation, with that you can in fact invert the orientation of the CD primitives.

-
int cdCanvasUpdateYAxis(cdCanvas* canvas, int *y); [in C]
+
int cdCanvasUpdateYAxis(cdCanvas* canvas, int *y); [in C]
 double cdfCanvasUpdateYAxis(cdCanvas* canvas, double *y); [in C]
 int cdCanvasInvertYAxis(cdCanvas* canvas, int y); [in C]
 double cdfCanvasInvertYAxis(cdCanvas* canvas, double y); [in C]
@@ -45,7 +45,7 @@ canvas:InvertYAxis(yc: number) -> (yr: number) [in Lua]
the given value, the "Update" function will invert only if the canvas has the Y axis inverted.

-
void cdCanvasMM2Pixel(cdCanvas* canvas, double mm_dx, double mm_dy, int *dx, int *dy); [in C]
+
void cdCanvasMM2Pixel(cdCanvas* canvas, double mm_dx, double mm_dy, int *dx, int *dy); [in C]
 void cdfCanvasMM2Pixel(cdCanvas* canvas, double mm_dx, double mm_dy, double *dx, double *dy); [in C]
 
 canvas:MM2Pixel(mm_dx, mm_dy: number) -> (dx, dy: number) [in Lua]
@@ -55,7 +55,7 @@ canvas:fMM2Pixel(mm_dx, mm_dy: number) -> (dx, dy: number) [in Lua]
provide only the desired values and NULL for the others.

-
void cdCanvasPixel2MM(cdCanvas* canvas, int dx, int dy, double *mm_dx, double *mm_dy); [in C]
+
void cdCanvasPixel2MM(cdCanvas* canvas, int dx, int dy, double *mm_dx, double *mm_dy); [in C]
 void cdfCanvasPixel2MM(cdCanvas* canvas, double dx, double dy, double *mm_dx, double *mm_dy); [in C]
 
 canvas:Pixel2MM(dx, dy: number) -> (mm_dx, mm_dy: number) [in Lua]
@@ -68,7 +68,7 @@ canvas:fPixel2MM(dx, dy: number) -> (mm_dx, mm_dy: number) [in Lua]
dy. The resolution value is obtained using the formula res=1.0/mm.

-
void cdCanvasOrigin(cdCanvas* canvas, int x, int y); [in C]
+
void cdCanvasOrigin(cdCanvas* canvas, int x, int y); [in C]
 void cdfCanvasOrigin(cdCanvas* canvas, double x, double y); [in C]
 
 canvas:Origin(x, y: number) [in Lua]
@@ -80,7 +80,7 @@ canvas:fOrigin(x, y: number) [in Lua]
canvas in the respective driver. Default values: (0, 0)

-
void cdCanvasGetOrigin(cdCanvas* canvas, int *x, int *y); [in C]
+
void cdCanvasGetOrigin(cdCanvas* canvas, int *x, int *y); [in C]
 void cdfCanvasGetOrigin(cdCanvas* canvas, double *x, double *y); [in C]
 
 canvas:GetOrigin() -> (x, y: number) [in Lua]
@@ -88,10 +88,10 @@ canvas:fGetOrigin() -> (x, y: number) [in Lua]

Returns the origin.

- +

Transformation Matrix

-
void cdCanvasTransform(cdCanvas* canvas, const double* matrix); [in C]
+
void cdCanvasTransform(cdCanvas* canvas, const double* matrix); [in C]
 
 canvas:Transform(matrix: table) [in Lua]
@@ -113,46 +113,46 @@ functions. And those are affected if a transformation is set, just like other regular primitives.

-
double* cdCanvasGetTransform(cdCanvas* canvas); [in C]
+
double* cdCanvasGetTransform(cdCanvas* canvas); [in C]
 
 canvas:GetTransformation() -> (matrix: table) [in Lua]

Returns the transformation matrix. If the identity is set, returns NULL.

-
void cdCanvasTransforMultiply(cdCanvas* canvas, const double* matrix); [in C]
+
void cdCanvasTransforMultiply(cdCanvas* canvas, const double* matrix); [in C]
 
 canvas:TransformMultiply(matrix: table) [in Lua]

Left multiply the current transformation by the given transformation.

-
void cdCanvasTransformTranslate(cdCanvas* canvas, double dx, double dy); [in C]
+
void cdCanvasTransformTranslate(cdCanvas* canvas, double dx, double dy); [in C]
 
 canvas:TransformTranslate(dx, dy: number) [in Lua]

Applies a translation to the current transformation.

-
void cdCanvasTransformScale(cdCanvas* canvas, double sx, double sy); [in C]
+
void cdCanvasTransformScale(cdCanvas* canvas, double sx, double sy); [in C]
 
 canvas:TransformScale(sx, sy: number) [in Lua]

Applies a scale to the current transformation.

-
void cdCanvasTransformRotate(cdCanvas* canvas, double angle); [in C]
+
void cdCanvasTransformRotate(cdCanvas* canvas, double angle); [in C]
 
 canvas:TransformRotate(angle: number) [in Lua]

Applies a rotation to the current transformation. Angle is in degrees, oriented counter-clockwise from the horizontal axis.

-
void cdCanvasTransformPoint(cdCanvas* canvas, int x, int y, int *tx, int *ty); [in C]
+
void cdCanvasTransformPoint(cdCanvas* canvas, int x, int y, int *tx, int *ty); [in C]
 void cdfCanvasTransformPoint(cdCanvas* canvas, double x, double y, double *tx, double *ty); [in C]
 
 canvas:TransformPoint(x, y: number) -> (tx, ty: number) [in Lua]
 canvas:fTransformPoint(x, y: number) -> (tx, ty: number) [in Lua]

Applies a transformation to a given point.

- +
\ No newline at end of file diff --git a/html/en/func/init.html b/html/en/func/init.html index 17092c8..8b3bccb 100644 --- a/html/en/func/init.html +++ b/html/en/func/init.html @@ -11,7 +11,7 @@

Canvas Initialization

-
cdCanvas *cdCreateCanvas(cdContext* ctx, void *data); [in C]
+
cdCanvas *cdCreateCanvas(cdContext* ctx, void *data); [in C]
 
 cd.CreateCanvas(ctx: number, data: string or userdata) -> (canvas: cdCanvas) [in Lua]
@@ -33,6 +33,8 @@ cd.CreateCanvas(ctx: number, data: string or userdata) -> (canvas: cdCanvas)
  • CD_IUP = IUP Canvas (cdiup.h).
  • CD_NATIVEWINDOW = Native Window (cdnative.h).
  • +
  • CD_GL = Native + Window (cdgl.h).
  • @@ -77,7 +79,7 @@ cd.CreateCanvas(ctx: number, data: string or userdata) -> (canvas: cdCanvas) Metafile (cdwmf.h). Works only in MS Windows systems. -
    cdCanvas* cdCreateCanvasf(cdContext *ctx, const char* format, ...); [in C]
    +
    cdCanvas* cdCreateCanvasf(cdContext *ctx, const char* format, ...); [in C]
     
     [There is no equivalent in Lua]
    @@ -85,14 +87,14 @@ cd.CreateCanvas(ctx: number, data: string or userdata) -> (canvas: cdCanvas) data
    is a string composed by several parameters. This function can be used with parameters equivalent to the printf function from the default C library.

    -
    void cdKillCanvas(cdCanvas *canvas); [in C]
    +
    void cdKillCanvas(cdCanvas *canvas); [in C]
     
     cd.KillCanvas(canvas: cdCanvas) [in Lua]

    Destroys a previously created canvas. If this function is not called in Lua, the garbage collector will call it.

    -
    int cdCanvasActivate(cdCanvas *canvas); [in C]
    +
    int cdCanvasActivate(cdCanvas *canvas); [in C]
     
     canvas:Activate(canvas: cdCanvas) -> (status: number) [in Lua]
    @@ -102,7 +104,7 @@ canvas:Activate(canvas: cdCanvas) -> (status: number) [in Lua]
    canvas size has changed. In these cases the function MUST be called, for other drivers is useless. Returns CD_ERROR or CD_OK.

    -
    void cdCanvasDeactivate(cdCanvas* canvas); [in C]
    +
    void cdCanvasDeactivate(cdCanvas* canvas); [in C]
     
     canvas:Deactivate(canvas: cdCanvas) [in Lua]
    @@ -111,14 +113,14 @@ canvas:Deactivate(canvas: cdCanvas) [in Lua]
    can not be retained, the drawing can only be done again after a cdCanvasActivate. On some drivers will simply call Flush.

    -
    int cdUseContextPlus(int use); [in C]
    +
    int cdUseContextPlus(int use); [in C]
     
     cd.UseContextPlus(use: boolean) -> (old_use: boolean) [in Lua]

    Activates or deactivates the use of an external context for the next calls of the cdCreateCanvas function.

    -
    void cdInitContextPlus(void); [in C]
    +
    void cdInitContextPlus(void); [in C]
     
     cd.InitContextPlus() [in Lua]

    Initializes the context driver to use another context replacing the standard drivers. @@ -130,14 +132,13 @@ transparency.

    In Lua, when using require"cdluacontextplus" this function will be automatically called.

    -
    -
    cdContext* cdCanvasGetContext(cdCanvas *canvas); [in C]
    +

    cdContext* cdCanvasGetContext(cdCanvas *canvas); [in C]
     
     canvas:GetContext(canvas: cdCanvas) -> (ctx: number) [in Lua]

    Returns the context of a given canvas, which can be compared with the predefined contexts, such as "CD_PS".

    -
    int cdContextCaps(cdContext* ctx); [in C]
    +
    int cdContextCaps(cdContext* ctx); [in C]
     
     cd.ContextCaps(ctx: number) -> (caps: number) [in Lua]
    @@ -180,7 +181,7 @@ cd.ContextCaps(ctx: number) -> (caps: number) [in Lua]
    (Native Window and IUP).

    -
    int cdCanvasSimulate(cdCanvas* canvas, int mode); [in C]
    +
    int cdCanvasSimulate(cdCanvas* canvas, int mode); [in C]
     
     canvas:Simulate(mode: number) -> (old_mode: number) [in Lua]
    @@ -209,27 +210,27 @@ canvas:Simulate(mode: number) -> (old_mode: number) [in Lua]
    CD_SIM_FILLS - Combination of CD_SIM_BOX, CD_SIM_SECTOR, CD_SIM_CHORD and CD_SIM_POLYGON.

    - +

    Extras

    -
    int cdlua_open(lua_State* L); [for Lua 5]
    +
    int cdlua_open(lua_State* L); [for Lua 5]

    Initializes the CDLua binding. In Lua 5 the binding is lua state safe, this means that several states can be initialized any time.

    -
    int cdlua_close(lua_State* L); [for Lua 5]
    +
    int cdlua_close(lua_State* L); [for Lua 5]

    Releases the memory allocated by the CDLua binding.

    -
    cdCanvas* cdlua_checkcanvas(lua_State* L, int pos); [for Lua 5]
    +
    cdCanvas* cdlua_checkcanvas(lua_State* L, int pos); [for Lua 5]

    Returns the canvas in the Lua stack at position pos. The function will call lua_error if there is not a valid canvas in the stack at the given position.

    -
    void cdlua_pushcanvas(lua_State* L, cdCanvas* canvas);
    +
    void cdlua_pushcanvas(lua_State* L, cdCanvas* canvas);

    Pushes the given canvas into the stack.

    - +
    \ No newline at end of file diff --git a/html/en/func/lines.html b/html/en/func/lines.html index cbea432..2456df7 100644 --- a/html/en/func/lines.html +++ b/html/en/func/lines.html @@ -20,7 +20,7 @@ opacity attribute and by the background color.


    -
    void cdCanvasLine(cdCanvas* canvas, int x1, int y1, int x2, int y2); [in C]
    +
    void cdCanvasLine(cdCanvas* canvas, int x1, int y1, int x2, int y2); [in C]
     void cdfCanvasLine(cdCanvas* canvas, double x1, double y1, double x2, double y2); [in C]
    void wdCanvasLine(cdCanvas* canvas, double x1, double y1, double x2, double y2); (WC) [in C] canvas:Line(x1, y1, x2, y2: number) [in Lua] @@ -31,7 +31,7 @@ canvas:wLine(x1, y1, x2, y2: number) (WC) [in Lua] -
    Polygons and Bezier Lines
    +
    Polygons and Bezier Lines

    Open polygons can be created using cdBegin(CD_OPEN_LINES)/cdVertex(x,y)/.../cdEnd().

    Closed polygons use the same number of vertices but the last point is @@ -44,7 +44,7 @@ canvas:wLine(x1, y1, x2, y2: number) (WC) [in Lua]

    See the documentation of cdBegin/cdVertex/cdEnd.

    -
    void cdCanvasRect(cdCanvas* canvas, int xmin, int xmax, int ymin, int ymax); [in C]
    void cdfCanvasRect(cdCanvas* canvas, double xmin, double xmax, double ymin, double ymax); [in C] +
    void cdCanvasRect(cdCanvas* canvas, int xmin, int xmax, int ymin, int ymax); [in C]
    void cdfCanvasRect(cdCanvas* canvas, double xmin, double xmax, double ymin, double ymax); [in C] void wdCanvasRect(cdCanvas* canvas, double xmin, double xmax, double ymin, double ymax); (WC) [in C] canvas:Rect(xmin, xmax, ymin, ymax: number) [in Lua] @@ -56,7 +56,7 @@ canvas:fRect(xmin, xmax, ymin, ymax: number) [in Lua]
    canvas:wRect(x If the active driver does not include this primitive, it will be simulated using the cdLine primitive.

    -
    void cdCanvasArc(cdCanvas* canvas, int xc, int yc, int w, int h, double angle1, double angle2); [in C]
    void cdfCanvasArc(cdCanvas* canvas, double xc, double yc, double w, double h, double angle1, double angle2); [in C] +
    void cdCanvasArc(cdCanvas* canvas, int xc, int yc, int w, int h, double angle1, double angle2); [in C]
    void cdfCanvasArc(cdCanvas* canvas, double xc, double yc, double w, double h, double angle1, double angle2); [in C] void wdCanvasArc(cdCanvas* canvas, double xc, double yc, double w, double h, double angle1, double angle2); (WC) [in C] canvas:Arc(xc, yc, w, h, angle1, angle2: number) [in Lua] @@ -87,9 +87,9 @@ canvas:wArc(xc, yc, w, h, angle1, angle2: number) (WC) [in to multiply the value in radians before passing the angle to CD.

    Arc Parameters
     

    - +

    Attributes

    -
    int cdCanvasLineStyle(cdCanvas* canvas, int style); [in C]
    +
    int cdCanvasLineStyle(cdCanvas* canvas, int style); [in C]
     
     canvas:LineStyle(style: number) -> (old_style: number) [in Lua]
    @@ -104,7 +104,7 @@ canvas:LineStyle(style: number) -> (old_style: number) [in

    Line Styles

    -
    void cdCanvasLineStyleDashes(cdCanvas* canvas, const int* dashes, int count); [in C]
    +
    void cdCanvasLineStyleDashes(cdCanvas* canvas, const int* dashes, int count); [in C]
     
     canvas:LineStyleDashes(dashes: table, count: number) -> (old_style: number) [in Lua]
    @@ -113,7 +113,7 @@ canvas:LineStyleDashes(dashes: table, count: number) -> (old_style: number) [ example: "10 2 5 2" means dash size 10, space size 2, dash size 5, space size 2, and repeats the pattern. Sizes are in pixels.

    -
    int cdCanvasLineWidth(cdCanvas* canvas, int width); [in C]
    double wdCanvasLineWidth(cdCanvas* canvas, double width_mm); (WC) [in C] +
    int cdCanvasLineWidth(cdCanvas* canvas, int width); [in C]
    double wdCanvasLineWidth(cdCanvas* canvas, double width_mm); (WC) [in C] canvas:LineWidth(width: number) -> (old_width: number) [in Lua] canvas:wLineWidth(width_mm: number) -> (old_width_mm: number) (WC) [in Lua]
    @@ -123,7 +123,7 @@ canvas:wLineWidth(width_mm: number) -> (old_width_mm: number) (WC) [in Lua]

    In WC, it configures the current line width in millimeters. 

    -
    int cdCanvasLineJoin(cdCanvas* canvas, int style); [in C]
    +
    int cdCanvasLineJoin(cdCanvas* canvas, int style); [in C]
     
     canvas:LineJoin(style: number) -> (old_style: number) [in Lua]
    @@ -134,7 +134,7 @@ canvas:LineJoin(style: number) -> (old_style: number) [in Lua]

    Line Joins

    -
    int cdCanvasLineCap(cdCanvas* canvas, int style); [in C]
    +
    int cdCanvasLineCap(cdCanvas* canvas, int style); [in C]
     
     canvas:LineCap(style: number) -> (old_style: number) [in Lua]
    @@ -145,7 +145,7 @@ canvas:LineCap(style: number) -> (old_style: number) [in Lua]

    Line Caps

    - + diff --git a/html/en/func/marks.html b/html/en/func/marks.html index e467c10..926498d 100644 --- a/html/en/func/marks.html +++ b/html/en/func/marks.html @@ -15,10 +15,10 @@

    A mark is a punctual representation. It can have different sizes and types. All types are affected only by mark attributes and by the foreground color.

    All marks in all drivers are simulated using other CD primitives, except -cdPixel.

    +cdCanvasPixel.


    -
    void cdCanvasPixel(cdCanvas* canvas, int x, int y, long int color); [in C]
    +
    void cdCanvasPixel(cdCanvas* canvas, int x, int y, long int color); [in C]
     void wdCanvasPixel(cdCanvas* canvas, double x, double y, long int color); (WC) [in C]
     
     canvas:Pixel(x, y: number, color: lightuserdata) [in Lua]
    @@ -28,7 +28,7 @@ canvas:wPixel(x, y: number, color: lightuserdata) (WC) [in Lua]
    on global attributes of the canvas. It can be very slow on some drivers. Sometimes it is implemented as a rectangle with size 1x1.

    -
    void cdCanvasMark(cdCanvas* canvas, int x, int y); [in C]
    +
    void cdCanvasMark(cdCanvas* canvas, int x, int y); [in C]
     void wdCanvasMark(cdCanvas* canvas, double x, double y); (WC) [in C]
     
     canvas:Mark(x, y: number) [in Lua]
    @@ -36,27 +36,26 @@ canvas:wMark(x, y: number) (WC) [in Lua]

    Draws a mark in (x,y) using the current foreground color. It is not possible to use this function between a call to functions - cdBegin and cdEnd + cdCanvasBegin and cdCanvasEnd if the type of mark is set to CD_DIAMOND. If the active driver does not include this primitive, it will be simulated using other primitives - from the library, such as cdLine.

    -

    If you will call function cdMark - or wdMark several times in a + from the library, such as cdCanvasLine.

    +

    If you will call this function several times in a sequence, then it is recommended that the application changes the filling and - line attributes to those used by the cdMark + line attributes to those used by this function:

    -
    cdInteriorStyle(CD_SOLID);
    -cdLineStyle(CD_CONTINUOUS);
    -cdLineWidth(1);
    +
    cdCanvasInteriorStyle(canvas, CD_SOLID);
    +cdCanvasLineStyle(canvas, CD_CONTINUOUS);
    +cdCanvasLineWidth(canvas, 1);

    This will greatly increase this function's performance. Also in this case, - if the mark is very small, we suggest using the cdPixel + if the mark is very small, we suggest using the cdCanvasPixel function so that the application itself draws the mark. In many cases, this also increases this function's performance.

    - +

    Attributes

    -
    int cdCanvasMarkType(cdCanvas* canvas, int type); [in C]
    +
    int cdCanvasMarkType(cdCanvas* canvas, int type); [in C]
     
     canvas:MarkType(type: number) -> (old_type: number) [in Lua]
    @@ -69,7 +68,7 @@ canvas:MarkType(type: number) -> (old_type: number) [in Lua]

    Mark Types

    -
    int cdCanvasMarkSize(cdCanvas* canvas, int size); [in C]
    +
    int cdCanvasMarkSize(cdCanvas* canvas, int size); [in C]
     double wdCanvasMarkSize(cdCanvas* canvas, double size); (WC) [in C]
     
     canvas:MarkSize(size: number) -> (old_size: number) [in Lua]
    @@ -79,7 +78,7 @@ canvas:wMarkSize(size: number) -> (old_size: number) (WC) [in Lua]
    value: 10. Value CD_QUERY simply returns the current value. Valid width interval: >= 1.

    In WC, it configures the current line width in millimeters. 

    - +
    diff --git a/html/en/func/other.html b/html/en/func/other.html index d334508..5a14387 100644 --- a/html/en/func/other.html +++ b/html/en/func/other.html @@ -11,7 +11,7 @@

    System

    -
    char* cdVersion(void); [in C]
    +
    char* cdVersion(void); [in C]
     
     cd.Version() -> (version: string) [in Lua]
    @@ -24,15 +24,15 @@ cd.Version() -> (version: string) [in Lua]
    functions added to the library; and the build version number represents one or more corrected bugs.

    -
    char* cdVersionDate(void); [in C]
    +
    char* cdVersionDate(void); [in C]
     
     cd.VersionDate() -> (versiondate: string) [in Lua]

    Returns the release date of the current version of the library.

    -
    int cdVersionNumber(void); [in C]
    +
    int cdVersionNumber(void); [in C]
     
     cd.VersionNumber() -> (version: number) [in Lua]

    Returns the current version number of the library.

    -
    [in C]
    +
    [in C]
     CD_NAME           "CD - Canvas Draw"
     CD_DESCRIPTION    "A 2D Graphics Library"
     CD_COPYRIGHT      "Copyright (C) 1994-2007 Tecgraf/PUC-Rio and PETROBRAS S/A"
    @@ -50,10 +50,10 @@ cd._VERSION_NUMBER

    Useful definitions. They have the same value returned by cdVersion* functions, except that they do not include the build number.

    - +

    Metafile Interpretation

    -
    int cdCanvasPlay(cdCanvas* canvas, cdContext* ctx, int xmin, int xmax, int ymin, int ymax, void *data); [in C]
    +
    int cdCanvasPlay(cdCanvas* canvas, cdContext* ctx, int xmin, int xmax, int ymin, int ymax, void *data); [in C]
     
     canvas:Play(ctx, xmin, xmax, ymin, ymax: number, data: string) -> (status: number) [in Lua]
    @@ -90,7 +90,7 @@ canvas:Play(ctx, xmin, xmax, ymin, ymax: number, data: string) -> (status: nu is a cdCanvas* of the Picture canvas. -
    int cdContextRegisterCallback(cdContext *ctx, int cb, int(*func)(cdCanvas* canvas, ...)); [in C]
    +
    int cdContextRegisterCallback(cdContext *ctx, int cb, int(*func)(cdCanvas* canvas, ...)); [in C]
     
     cd.ContextRegisterCallback(ctx, cb: number, func: function) -> (status: number) [in Lua]
    @@ -114,7 +114,7 @@ cd.ContextRegisterCallback(ctx, cb: number, func: function) -> (status: numbe create the canvas inside the callback. It works as a  cdCanvasGetSize function.

    - +
    \ No newline at end of file diff --git a/html/en/func/polygon.html b/html/en/func/polygon.html index 90890d4..1c930c3 100644 --- a/html/en/func/polygon.html +++ b/html/en/func/polygon.html @@ -26,7 +26,7 @@ Regions Creation that can contains one or more polygons inside.


    -
    void cdCanvasBegin(cdCanvas* canvas, int mode); [in C]
    +
    void cdCanvasBegin(cdCanvas* canvas, int mode); [in C]
     
     canvas:Begin(mode: number) [in Lua]
    @@ -70,7 +70,7 @@ canvas:Begin(mode: number) [in Lua]

    Bezier Lines

    -
    void cdCanvasVertex(cdCanvas* canvas, int x, int y); [in C]
    +
    void cdCanvasVertex(cdCanvas* canvas, int x, int y); [in C]
     void cdfCanvasVertex(cdCanvas* canvas, double x, double y); [in C]
     void wdCanvasVertex(cdCanvas* canvas, double x, double y); (WC) [in C]
     
    @@ -79,14 +79,14 @@ canvas:wVertex(x, y: number) (WC) [in Lua]

    Adds a vertex to the polygon definition.

    -
    void cdCanvasEnd(cdCanvas* canvas); [in C]
    +
    void cdCanvasEnd(cdCanvas* canvas); [in C]
     
     canvas:End() [in Lua]

    Ends the polygon's definition and draws it.

    -
    void cdCanvasPathSet(cdCanvas* canvas, int action); [in C]
    +
    void cdCanvasPathSet(cdCanvas* canvas, int action); [in C]
     
     canvas:PathSet(action: number) [in Lua]
    @@ -151,7 +151,7 @@ cdCanvasVertex(canvas, x8, y8); /* start angle, end angle (degrees / 1000) */ cdCanvasPathSet(canvas, CD_PATH_STROKE); cdCanvasEnd(canvas);
    - + diff --git a/html/en/func/region.html b/html/en/func/region.html index 59874b8..985bf23 100644 --- a/html/en/func/region.html +++ b/html/en/func/region.html @@ -39,7 +39,7 @@

    Complex clipping regions are not saved by cdSaveState.


    -
    int cdCanvasRegionCombineMode(cdCanvas* canvas, int mode); [in C]
    +
    int cdCanvasRegionCombineMode(cdCanvas* canvas, int mode); [in C]
     
     canvas:RegionCombineMode(mode: number) -> (old_mode: number) [in Lua]
    @@ -50,7 +50,7 @@ canvas:RegionCombineMode(mode: number) -> (old_mode: number) [in Lua]

    Combine Modes

    -
    int cdCanvasIsPointInRegion(cdCanvas* canvas, int x, int y); [in C]
    +
    int cdCanvasIsPointInRegion(cdCanvas* canvas, int x, int y); [in C]
     int wdCanvasIsPointInRegion(cdCanvas* canvas, double x, double y); (WC) [in C]
     
     canvas:IsPointInRegion(x, y: number) -> (status: boolean) [in Lua]
    @@ -59,7 +59,7 @@ canvas:wIsPointInRegion(x, y: number) -> (status: boolean) [in Lua]

    Returns a non zero value if the point is contained inside the current region.

    -
    void cdCanvasOffsetRegion(cdCanvas* canvas, int dx, int dy); [in C]
    +
    void cdCanvasOffsetRegion(cdCanvas* canvas, int dx, int dy); [in C]
     void wdCanvasOffsetRegion(cdCanvas* canvas, double dx, double dy); (WC) [in C]
     
     canvas:OffsetRegion(dx, dy: number) [in Lua]
    @@ -69,7 +69,7 @@ canvas:wOffsetRegion(dx, dy: number) (WC) [in Lua]
    moves to outside the canvas border, the part moved outside will be lost, the region will need to be reconstructed.

    -
    void cdCanvasGetRegionBox(cdCanvas* canvas, int *xmin, int *xmax, int *ymin, int *ymax); [in C]
    +
    void cdCanvasGetRegionBox(cdCanvas* canvas, int *xmin, int *xmax, int *ymin, int *ymax); [in C]
     void wdCanvasGetRegionBox(cdCanvas* canvas, double *xmin, double *xmax, double *ymin, double *ymax); (WC) [in C]
     
     canvas:GetRegionBox() -> (xmin, xmax, ymin, ymax, status: number) [in Lua]
    @@ -79,7 +79,7 @@ canvas:wGetRegionBox() -> (xmin, xmax, ymin, ymax, status: number) (WC) [in L
       necessary to provide all return pointers, you can provide only the desired 
       values and NULL for the others.

    - +
    diff --git a/html/en/func/server.html b/html/en/func/server.html index 2a9142e..85bc42d 100644 --- a/html/en/func/server.html +++ b/html/en/func/server.html @@ -25,7 +25,7 @@ and Cairo, support server images.


    -
    cdImage* cdCanvasCreateImage(cdCanvas* canvas, int w, int h); [in C]
    +
    cdImage* cdCanvasCreateImage(cdCanvas* canvas, int w, int h); [in C]
     
     canvas:CreateImage(w, h: number) -> (image: cdImage) [in Lua]
    @@ -36,14 +36,14 @@ canvas:CreateImage(w, h: number) -> (image: cdImage) [in Lua]
    the same type as the canvas that was active when the image was created. The default background is the same as the canvas, CD_WHITE.

    -
    void cdKillImage(cdImage* image); [in C]
    +
    void cdKillImage(cdImage* image); [in C]
     
     image:KillImage() [in Lua]

    Liberates memory allocated for the image. If this function is not called in Lua, the garbage collector will call it.

    -
    void cdCanvasGetImage(cdCanvas* canvas, cdImage* image, int x, int y); [in C]
    +
    void cdCanvasGetImage(cdCanvas* canvas, cdImage* image, int x, int y); [in C]
     
     canvas:GetImage(image: cdImage; x, y: number) [in Lua]
    @@ -53,7 +53,7 @@ canvas:GetImage(image: cdImage; x, y: number) [in Lua]
    width and length of the rectangular region are defined in the image structure (when the image is created).

    -
    void cdCanvasPutImageRect(cdCanvas* canvas, cdImage* image, int x, int y, int xmin, int xmax, int ymin, int ymax); [in C]
    +
    void cdCanvasPutImageRect(cdCanvas* canvas, cdImage* image, int x, int y, int xmin, int xmax, int ymin, int ymax); [in C]
     void wdCanvasPutImageRect(cdCanvas* canvas, cdImage* image, double x, double y, int xmin, int xmax, int ymin, int ymax); (WC) [in C]
     
     canvas:PutImageRect(image: cdImage; x, y, xmin, xmax, ymin, ymax: number) [in Lua]
    @@ -66,7 +66,7 @@ canvas:wPutImageRect(image: cdImage; x, y, xmin, xmax, ymin, ymax: number) (WC)
       and ymax are 0, then the whole 
       image is assumed.

    -
    void cdCanvasScrollArea(cdCanvas* canvas, int xmin, int xmax, int ymin, int ymax, int dx, int dy); [in C]
    +
    void cdCanvasScrollArea(cdCanvas* canvas, int xmin, int xmax, int ymin, int ymax, int dx, int dy); [in C]
     
     canvas:ScrollArea(xmin, xmax, ymin, ymax, dx, dy: number) [in Lua]
    @@ -79,7 +79,7 @@ canvas:ScrollArea(xmin, xmax, ymin, ymax, dx, dy: number) [in Lua]
    to the second, remains unchanged (the function does not clean this region).

    - + \ No newline at end of file diff --git a/html/en/func/text.html b/html/en/func/text.html index c2735b0..a5edc29 100644 --- a/html/en/func/text.html +++ b/html/en/func/text.html @@ -34,7 +34,7 @@ TextAligment function.


    -
    void cdCanvasText(cdCanvas* canvas, int x, int y, const char* text); [in C]
    +
    void cdCanvasText(cdCanvas* canvas, int x, int y, const char* text); [in C]
     void cdfCanvasText(cdCanvas* canvas, double x, double y, const char* text); [in C]
     void wdCanvasText(cdCanvas* canvas, double x, double y, const char* text); (WC) [in C]
     
    @@ -44,9 +44,9 @@ canvas:wText(x, y: number, text: string) (WC) [in Lua]

    Draws a text in the position (x,y) according to the current font and text alignment. It expects an ANSI string. Can have line breaks.

    - +

    Attributes

    -
    void cdCanvasFont(cdCanvas* canvas, const char* typeface, int style, int size); [in C]
    +
    void cdCanvasFont(cdCanvas* canvas, const char* typeface, int style, int size); [in C]
     void wdCanvasFont(cdCanvas* canvas, const char* typeface, int style, double size); (WD) [in C]
     
     canvas:Font(typeface, style, size: number) [in Lua]
    @@ -89,7 +89,7 @@ driver.

    -
    void cdCanvasGetFont(cdCanvas* canvas, char* typeface, int *style, int *size); [in C]
    +
    void cdCanvasGetFont(cdCanvas* canvas, char* typeface, int *style, int *size); [in C]
     void wdCanvasGetFont(cdCanvas* canvas, char* typeface, int *style, double *size); (WC) [in C]
     
     canvas:GetFont() -> (typeface: string, style, size: number) [in Lua]
    @@ -99,7 +99,7 @@ canvas:wGetFont() -> (typeface: string, style, size: number) (WC) [in Lua]

    In WC, the size is returned in millimeters.

    -
    char* cdCanvasNativeFont(cdCanvas* canvas, const char* nativefont); [in C]
    +
    char* cdCanvasNativeFont(cdCanvas* canvas, const char* nativefont); [in C]
     
     canvas:NativeFont(font: string) -> (old_font: string) [in Lua]
    @@ -127,7 +127,7 @@ and platforms.

    Using "(char*)CD_QUERY" as a parameter, it returns the current selected font in the common format definition.

    -
    int cdCanvasTextAlignment(cdCanvas* canvas, int alignment); [in C]
    +
    int cdCanvasTextAlignment(cdCanvas* canvas, int alignment); [in C]
     
     canvas:TextAlignment(alignment: number) -> (old_alignment: number) [in Lua]
    @@ -139,16 +139,16 @@ canvas:TextAlignment(alignment: number) -> (old_alignment: number) [in Lua]Text Alignment

    -
    double cdCanvasTextOrientation(cdCanvas* canvas, double angle); [in C]
    +
    double cdCanvasTextOrientation(cdCanvas* canvas, double angle); [in C]
     
     canvas:TextOrientation(angle: number) -> (old_angle: number) [in Lua]

    Defines the text orientation, which is an angle provided in degrees relative to the horizontal line according to which the text is drawn. Returns the previous value. Value CD_QUERY simply returns the current value. The default value is 0.

    - +

    Properties

    -
    void cdCanvasGetFontDim(cdCanvas* canvas, int *max_width, int *height, int *ascent, int *descent); [in C]
    +
    void cdCanvasGetFontDim(cdCanvas* canvas, int *max_width, int *height, int *ascent, int *descent); [in C]
     void wdCanvasGetFontDim(cdCanvas* canvas, double *max_width, double *height, double *ascent, double *descent); (WC) [in C]
     
     canvas:GetFontDim() -> (max_width, height, ascent, descent: number) [in Lua]
    @@ -163,7 +163,7 @@ canvas:wGetFontDim() -> (max_width, height, ascent, descent: number) (WC) [in
       

    Font Dimension Attributes

    -
    void cdCanvasGetTextSize(cdCanvas* canvas, const char* text, int *width, int *height); [in C]
    +
    void cdCanvasGetTextSize(cdCanvas* canvas, const char* text, int *width, int *height); [in C]
     void wdCanvasGetTextSize(cdCanvas* canvas, const char* text, double *width, double *height); (WC) [in C]
     
     canvas:GetTextSize(text: string) -> (width, heigth: number) [in Lua]
    @@ -173,7 +173,7 @@ canvas:wGetTextSize(text: string) -> (width, heigth: number) (WC) [in Lua]

    NULL for the others.

    -
    void cdCanvasGetTextBounds(cdCanvas* canvas, int x, int y, const char *text, int *rect); [in C]
    +
    void cdCanvasGetTextBounds(cdCanvas* canvas, int x, int y, const char *text, int *rect); [in C]
     void wdCanvasGetTextBounds(cdCanvas* canvas, double x, double y, const char* text, double *rect); (WC) [in C]
     
     canvas:GetTextBounds(x, y: number, text: string) -> (rect: table) [in Lua]
    @@ -185,7 +185,7 @@ canvas:wGetTextBounds(x, y: number, text: string) -> (rect: table) (WC) [in L
       order starting with the bottom left corner, arranged (x0,y0,x1,y1,x2,y2,x3,y3).

    -
    void cdCanvasGetTextBox(cdCanvas* canvas, int x, int y, const char* text, int *xmin, int *xmax, int *ymin, int *ymax); [in C]
    +
    void cdCanvasGetTextBox(cdCanvas* canvas, int x, int y, const char* text, int *xmin, int *xmax, int *ymin, int *ymax); [in C]
     void wdCanvasGetTextBox(cdCanvas* canvas, double x, double y, const char* text, double *xmin, double *xmax, double *ymin, double *ymax); (WC) [in C]
     
     canvas:GetTextBox(x, y: number, text: string) -> (xmin, xmax, ymin, ymax: number) [in Lua]
    @@ -195,7 +195,7 @@ canvas:wGetTextBox(x, y: number, text: string) -> (xmin, xmax, ymin, ymax: nu
     	position. If orientation is not 0 then its area is always larger than the 
     	area of the rectangle returned by GetTextBounds. It is not necessary 
       to provide all return pointers, you can provide only the desired values and NULL for the others.

    - +
    diff --git a/html/en/func/vectortext.html b/html/en/func/vectortext.html index ec66aa2..febcf24 100644 --- a/html/en/func/vectortext.html +++ b/html/en/func/vectortext.html @@ -17,7 +17,7 @@

    All vector text drawing in all drivers are simulated with other CD primitives using polygons only.


    -
    void cdCanvasVectorText(cdCanvas* canvas, int x, int y, const char* text); [in C]
    +    
    void cdCanvasVectorText(cdCanvas* canvas, int x, int y, const char* text); [in C]
     void wdCanvasVectorText(cdCanvas* canvas, double x, double y, const char* text); (WC) [in C]
         
     canvas:VectorText(x, y: number, text: string) [in Lua]
    @@ -32,9 +32,9 @@ canvas:wVectorText(x, y: number, text: string) (WC) [in Lua]
    actually depends on World Coordinates. The other Vector Text functions although use the "wd" prefix they do not depend on World Coordinates. They are kept with these names for backward compatibility. The - correct prefix would be "cdf".

    + correct prefix would be "cdf".

    Attributes

    -
    void cdCanvasVectorTextDirection(cdCanvas* canvas, int x1, int y1, int x2, int y2); [in C]
    +    
    void cdCanvasVectorTextDirection(cdCanvas* canvas, int x1, int y1, int x2, int y2); [in C]
     void wdCanvasVectorTextDirection(cdCanvas* canvas, double x1, double y1, double x2, double y2); [in C]
     
     canvas:VectorTextDirection(x1, y1, x2, y2: number) [in Lua]
    @@ -42,7 +42,7 @@ canvas:wVectorTextDirection(x1, y1, x2, y2: number) [in Lua]

    Defines the text direction by means of two points, (x1,y1) and (x2,y2). The default direction is horizontal from left to right. It is independent from the transformation matrix.

    -
    double* cdCanvasVectorTextTransform(cdCanvas* canvas, const double* matrix); [in C]
    +    
    double* cdCanvasVectorTextTransform(cdCanvas* canvas, const double* matrix); [in C]
     
     canvas:VectorTextTransform(matrix: table) -> (old_matrix: table) [in Lua] 

    Defines a transformation matrix with 6 elements. If the matrix is NULL, no @@ -57,14 +57,14 @@ canvas:VectorTextTransform(matrix: table) -> (old_matrix: table) [in Lua]&nbs |1|

    It has the same effect of the cdCanvasTransform, but notice that the indices are different.

    -
    void cdCanvasVectorTextSize(cdCanvas* canvas, int width, int height, const char * text); [in C]
    +    
    void cdCanvasVectorTextSize(cdCanvas* canvas, int width, int height, const char * text); [in C]
     void wdCanvasVectorTextSize(cdCanvas* canvas, double width, double height, const char* text); [in C]
     
     canvas:VectorTextSize(width, height: number, text: string) [in Lua]
     canvas:wVectorTextSize(width, height: number, text: string) [in Lua]

    Modifies the font size of the vector text so that it fits the string in the box defined by width and height.

    -
    double cdCanvasVectorCharSize(cdCanvas* canvas, int size); [in C]
    +    
    double cdCanvasVectorCharSize(cdCanvas* canvas, int size); [in C]
     double wdCanvasVectorCharSize(cdCanvas* canvas, double size); [in C]
     
     canvas:VectorCharSize(size: number) -> (old_size: number) [in Lua]
    @@ -72,17 +72,17 @@ canvas:wVectorCharSize(size: number) -> (old_size: number) [in Lua]

    Modifies the font size by specifying the height of the characters. Returns the previous value. CD_QUERY returns the current value.

    -
    void cdCanvasVectorFontSize(cdCanvas* canvas, double size_x, double size_x); [in C]
    +    
    void cdCanvasVectorFontSize(cdCanvas* canvas, double size_x, double size_x); [in C]
     
     canvas:VectorFontSize(size_x, size_y: number) [in Lua]

    Directly modifies the font size. Set size_x==size_y to maintain the original aspect ratio of the font.

    -
    void cdCanvasGetVectorFontSize(cdCanvas* canvas, double *size_x, double *size_x); [in C]
    +    
    void cdCanvasGetVectorFontSize(cdCanvas* canvas, double *size_x, double *size_x); [in C]
     
     canvas:GetVectorFontSize() -> (size_x, size_y: number) [in Lua]

    Returns the font size. It is not necessary to provide all return pointers, you can provide only the desired values and NULL for the others.

    -
    char* cdCanvasVectorFont(cdCanvas* canvas, const char *filename); [in C]
    +    
    char* cdCanvasVectorFont(cdCanvas* canvas, const char *filename); [in C]
     
     canvas:VectorFont(filename: string) -> (fontname: string) [in Lua]

    Replaces the current vector font with a font stored in a file with a given @@ -95,9 +95,9 @@ canvas:VectorFont(filename: string) -> (fontname: string) [in Lua]

    load it using the filename as a string containing the font as if the file was loaded into that string, if it fails again the font is reset to the default font and returns NULL. The file format is - compatible with the GKS file format (text mode).

    + compatible with the GKS file format (text mode).

    Properties

    -
    void cdCanvasGetVectorTextSize(cdCanvas* canvas, const char* text, int *width, int *height); [in C]
    +    
    void cdCanvasGetVectorTextSize(cdCanvas* canvas, const char* text, int *width, int *height); [in C]
     void wdCanvasGetVectorTextSize(cdCanvas* canvas, const char* text, double *width, double *height); [in C]
     
     canvas:GetVectorTextSize(text: string) -> (width, height: number) [in Lua]
    @@ -105,7 +105,7 @@ canvas:wGetVectorTextSize(text: string) -> (width, height: number) [in Lua]Returns the text size independent from orientation. It is 
           not necessary to provide all return pointers, you can provide only the desired 
           values and NULL for the others.

    -
    void cdCanvasGetVectorTextBounds(cdCanvas* canvas, char* text, int x, int y, int *rect); [in C]
    +    
    void cdCanvasGetVectorTextBounds(cdCanvas* canvas, char* text, int x, int y, int *rect); [in C]
     void wdCanvasGetVectorTextBounds(cdCanvas* canvas, char* text, double x, double y, double *rect); [in C]
     
     canvas:GetVectorTextBounds(text: string, x, y: number) -> (rect: table) [in Lua]
    @@ -117,7 +117,7 @@ canvas:wGetVectorTextBounds(text: string, x, y: number) -> (rect: table) [in
       order starting with the bottom left corner, arranged (x0,y0,x1,y1,x2,y2,x3,y3).

    -
    void cdCanvasGetVectorTextBox(cdCanvas* canvas, int x, int y, const char* text, int *xmin, int *xmax, int *ymin, int *ymax); [in C]
    +
    void cdCanvasGetVectorTextBox(cdCanvas* canvas, int x, int y, const char* text, int *xmin, int *xmax, int *ymin, int *ymax); [in C]
     void wdCanvasGetVectorTextBox(cdCanvas* canvas, double x, double y, const char* text, double *xmin, double *xmax, double *ymin, double *ymax); [in C]
     
     canvas:GetVectorTextBox(x, y: number, text: string) -> (xmin, xmax, ymin, ymax: number) [in Lua]
    @@ -128,7 +128,7 @@ canvas:wGetVectorTextBox(x, y: number, text: string) -> (xmin, xmax, ymin, ym
     	orientation is not 0 then its area is always larger than the area of the 
     	rectangle returned by GetVectorTextBounds. It is not necessary 
       to provide all return pointers, you can provide only the desired values and NULL for the others.

    - +

    Character Codes

    The old GKS format contains ASCII codes so a convertion from ANSI to ASCII is done when possible, unmapped characters are left unchanged, but some rearrage diff --git a/html/en/func/wd.html b/html/en/func/wd.html index c7aacff..ebd9793 100644 --- a/html/en/func/wd.html +++ b/html/en/func/wd.html @@ -27,21 +27,21 @@ primitives and do NOT depend or use the cdCanvasTransform transformation matrix.


    -
    void wdCanvasWindow(cdCanvas* canvas, double xmin, double xmax, double ymin, double ymax); [in C]
    +    
    void wdCanvasWindow(cdCanvas* canvas, double xmin, double xmax, double ymin, double ymax); [in C]
         
     canvas:wWindow(xmin, xmax, ymin, ymax: number) [in Lua]

    Configures a window in the world coordinate system to be used to convert world coordinates (with values in real numbers) into canvas coordinates (with values in integers). The default window is the size in millimeters of the whole canvas.

    -
    void wdCanvasGetWindow(cdCanvas* canvas, double *xmin, double *xmax, double *ymin, double *ymax); [in C]
    +    
    void wdCanvasGetWindow(cdCanvas* canvas, double *xmin, double *xmax, double *ymin, double *ymax); [in C]
     
     canvas:wGetWindow() -> (xmin, xmax, ymin, ymax: number) [in Lua]

    Queries the current window in the world coordinate system being used to convert world coordinates into canvas coordinates (and the other way round). It is not necessary to provide all return pointers, you can provide only the desired values.

    -
    void wdCanvasViewport(cdCanvas* canvas, int xmin, int xmax, int ymin, int ymax); [in C]
    +    
    void wdCanvasViewport(cdCanvas* canvas, int xmin, int xmax, int ymin, int ymax); [in C]
     
     canvas:wViewport(xmin, xmax, ymin, ymax: number) [in Lua]

    Configures a viewport in the canvas coordinate system to be used to convert @@ -49,27 +49,27 @@ canvas:wViewport(xmin, xmax, ymin, ymax: number) [in Lua]

    values in integers). The default viewport is the whole canvas (0,w-1,0,h-1). If the canvas size is changed, the viewport will not be automatically updated.

    -
    void wdCanvasGetViewport(cdCanvas* canvas, int *xmin, int *xmax, int *ymin, int *ymax); [in C]
    +    
    void wdCanvasGetViewport(cdCanvas* canvas, int *xmin, int *xmax, int *ymin, int *ymax); [in C]
     
     canvas:wGetViewport() -> (xmin, xmax, ymin, ymax: number) [in Lua]

    Queries the current viewport in the world coordinate system being used to convert world coordinates into canvas coordinates (and the other way round). It is not necessary to provide all return pointers, you can provide only the desired values and NULL for the others.

    -
    void wdCanvasWorld2Canvas(cdCanvas* canvas, double xw, double yw, int *xv, int *yv); [in C]
    +    
    void wdCanvasWorld2Canvas(cdCanvas* canvas, double xw, double yw, int *xv, int *yv); [in C]
     
     canvas:wWorld2Canvas(xw, yw: number) -> (xv, yv: number) [in Lua]

    Converts world coordinates into canvas coordinates. It is not necessary to provide all return pointers, you can provide only the desired values and NULL for the others.

    -
    void wdCanvasCanvas2World(cdCanvas* canvas, int xv, int yv, double *xw, double *yw); [in C]
    +    
    void wdCanvasCanvas2World(cdCanvas* canvas, int xv, int yv, double *xw, double *yw); [in C]
     
     canvas:wCanvas2World(xv, yv: number) -> (xw, yw: number) [in Lua]

    Converts canvas coordinates into world coordinates. It is not necessary to provide all return pointers, you can provide only the desired values and NULL for the others.

    -
    void wdCanvasSetTransform(cdCanvas* canvas, double sx, double sy, double tx, double ty); [in C]
    +    
    void wdCanvasSetTransform(cdCanvas* canvas, double sx, double sy, double tx, double ty); [in C]
         
     canvas:wSetTransform(sx, sy, tx, ty: number) [in Lua]

    Configures the world coordinate system transformation to be used to @@ -77,7 +77,7 @@ canvas:wSetTransform(sx, sy, tx, ty: number) [in Lua]

    coordinates (with values in integers). The transformation is automatically set by wdCanvasWindow and wdCanvasViewport. This has NO relation with cdCanvasTransform.

    -
    void wdCanvasGetTransform(cdCanvas* canvas, double *sx, double *sy, double *tx, double *ty); [in C]
    +    
    void wdCanvasGetTransform(cdCanvas* canvas, double *sx, double *sy, double *tx, double *ty); [in C]
     
     canvas:wGetTransform() -> (sx, sy, tx, ty: number) [in Lua]

    Queries the current transformation being used to @@ -85,20 +85,20 @@ canvas:wGetTransform() -> (sx, sy, tx, ty: number) [in Lua]

    is not necessary to provide all return pointers, you can provide only the desired values.

    -
    void wdCanvasTranslate(cdCanvas* canvas, double dtx, double dty); [in C]
    +    
    void wdCanvasTranslate(cdCanvas* canvas, double dtx, double dty); [in C]
         
     canvas:wTranslate(dtx, dty: number) [in Lua]

    Translates the transformation by a delta, by adding the given values to the current tx and ty values.

    -
    void wdCanvasScale(cdCanvas* canvas, double dsx, double dsy); [in C]
    +    
    void wdCanvasScale(cdCanvas* canvas, double dsx, double dsy); [in C]
         
     canvas:wScale(dsx, dsy: number) [in Lua]

    Scales the transformation by a delta, by multiplying the given values by - the current sx and sy values.

    + the current sx and sy values.

    Extra

    -
    void wdCanvasHardcopy(cdCanvas *canvas, cdContext* ctx, void *data, void(*draw_func)(cdCanvas *canvas_copy)); [in C]
    +    
    void wdCanvasHardcopy(cdCanvas *canvas, cdContext* ctx, void *data, void(*draw_func)(cdCanvas *canvas_copy)); [in C]
     
     canvas:wCanvasHardcopy(ctx: number, data: string or userdata, draw_func: function) [in Lua]

    Creates a new canvas, prepares Window and Viewport according to @@ -107,6 +107,6 @@ canvas:wCanvasHardcopy(ctx: number, data: string or userdata, draw_func: functio must use routines in WC) and, finally, removes the new canvas.

    It is usually used for "hard copies" of drawings (print equivalent copy). The most common used contexts are Printer, PS and PDF.

    - +
    diff --git a/html/en/to_do.html b/html/en/to_do.html index be20e0c..78c0e8b 100644 --- a/html/en/to_do.html +++ b/html/en/to_do.html @@ -6,6 +6,11 @@ To Do + @@ -28,6 +33,12 @@
  • Shape Extension and XShapeCombineMask to implement "WINDOWRGN" attribute (non rectangular windows from regions)
  • +

    OpenGL

    +
      +
    • Use textures to improve image drawing with transformation + and patter+stipple support.
    • +
    • Use tesselation to support fillmode and non convex polygons.
    • +

    Simulation

    • Implement line styles, line cap and line join for line with > 1.
    • -- cgit v1.2.3