Posted to tcl by GPS at Sat Oct 25 21:13:36 GMT 2008view raw
-
- imagecore::jpeg decode bytearray
- Decode the bytearray data that is expected to be a valid JPEG. If the data is invalid then an error is returned. On success a serialized imagecore representation is produced.
-
- imagecore::jpeg encode ?-quality? serialized-data
- Encode the serialized data to a JPEG. The result when successful is a bytearray of JPEG data. If an error occurs during encoding, an error is returned.
-
- imagecore::png decode bytearray
-
- imagecore::png encode ?-compression? serialized-data
-
-
- imagecore ?serialized-data?
- By default if serialized-data isn't passed, we get a 0 by 0 image. The command created by imagecore is used for interacting and modifying the image.
-
-
- Instance Commands:
- getsize
- Return a 2 element list of the width and height. It may be assigned to variables with lassign.
-
- setsize width height
- Set the size of the image. The old image data will be lost. Negative width or height will return an error.
-
- serialize
- Returns a serialized representation of the image data, suitable for transferring over the network. The serialized data may be reconstructed with the imagecore command.
-
- scale xvalue yvalue
- Scale x and y by a floating point (double) value where 1.0 is 0 change.
-
- scaleto width height
- Scale to an absolute width and height.
-
- rotate degress
- Degrees should be in the range [-360,360].
-
- getpixel x y
- Return a [list R G B A] of the pixel at x y.
-
- putpixel x y [list R G B A]
- Set the pixel at x y.
-
- getrow y
- Return a row of pixels as a list.
-
- putrow y row
- Set a row of pixels. The coordinate y must be valid. The row must be a list that exactly matches the width of the image.
-
- blend imagecore-src-instance srcx srcy width height destx desty
- Perform alpha blending using the alpha values in imagecore-src-instance.
-
- blendalpha imagecore-src-instance alpha srcx srcy width height destx desty
- Perform alpha blending using the alpha argument value.
-
- blendcomplex imagecore-src-instance srcx srcy width height destx desty cummulative-alpha-buffer.
- Perform alpha blending using
-
- line x1 y1 x2 y2 [list R G B A] ?width?
- Draw a line using the color and optional width along the coordinates specified.
-
- rectangle x y width height [list R G B A]
- Draw a rectangle using the specified color and coordinates.
-
- arc x1 y1 x2 y2 [list R G B A] ?width?
- Draw an arch using the color and optional width along the coordinates specified.
-
- ?nurbs curve?
-
-
- C API
- int Tcl_ImagecoreGetBuffer(Tcl_Interp *interp, Tcl_Obj *instanceName, void **imageData, int *width, int *height);
-
- If the result is TCL_OK then return the start of the image data, its width, and height. The idea is that this may be used with a new Tk image backend or for extension users.
-
-
- int Tcl_ImagecoreSetBuffer(Tcl_Interp *interp, Tcl_Obj *instanceName, void *imageData, int width, int height);
-
- If the result is TCL_OK then the imagecore instance exists, and the data has been replaced (with a new buffer if the width and height are different).
-