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/func/client.html | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'html/en/func/client.html') 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 -- cgit v1.2.3