::pixTop, Main, Index
Help procedures.
CommandsTop, Main, Index
colorHTMLtoRGBA [::pix]Top, Main, Index
Converts an HTML color string into an RGBA value and returns it as a Tcl list.
Parameters
HTMLcolor | A color string |
Return value
A Tcl list {r g b a}.
degToRad [::pix]Top, Main, Index
Converts degrees to radians.
Parameters
angle | A double value (in degrees). |
Return value
A double value (in radians).
determinantMatrix [::pix]Top, Main, Index
Computes the determinant of a 3x3 matrix.
Parameters
matrix | A Tcl list of 9 numbers representing the 3x3 matrix. |
Return value
The matrix determinant as a double.
drawPixSurface [::pix]Top, Main, Index
Draws object to Tk photo.
Parameters
object | img, ctx object or 'pixphoto' name. |
photo | Tk pix photo variable. Optional, default "". |
Return value
Nothing.
drawSurface [::pix]Top, Main, Index
Draws object to Tk photo.
Parameters
object | img or ctx object. |
photo | Tk photo variable. |
Return value
Nothing.
fromB64 [::pix]Top, Main, Index
Converts a base64-encoded string or data URL into an img object.
Parameters
string | Base64-encoded image data or a data URL. |
Return value
An img object.
getKeys [::pix]Top, Main, Index
Retrieves all registered object keys from both the context and image tables.
Return value
A Tcl dictionary containing two keys:
| ctx | A Tcl list of all ctx handles. |
| img | A Tcl list of all img handles. |
| font | A Tcl list of all font handles. |
| path | A Tcl list of all path handles. |
identityMatrix [::pix]Top, Main, Index
Creates a 3x3 identity matrix.
Return value
The identity matrix as a Tcl list of 9 elements.
invMatrix [::pix]Top, Main, Index
Inverts the specified 3x3 transformation matrix.
Parameters
matrix | Optional Tcl list of 9 numbers representing an input 3x3 matrix . Optional, default identityMatrix. |
Return value
The inverted 3x3 matrix as a Tcl list of 9 elements.
mulMatrix [::pix]Top, Main, Index
Multiplies a sequence of 3x3 matrices together.
Parameters
args | A variable list of matrices, where each matrix is a Tcl list of 9 numbers. |
Return value
The resulting multiplied matrix as a Tcl list of 9 elements.
nearlyEqualMatrix [::pix]Top, Main, Index
Checks whether two matrices are approximately equal.
Parameters
matrix1 | A Tcl list of 9 numbers representing an input 3x3 matrix |
matrix2 | A Tcl list of 9 numbers representing an input 3x3 matrix |
Return value
1 if the matrices are approximately equal, 0 otherwise.
pathObjToString [::pix]Top, Main, Index
Parses a path object and returns its SVG path string representation.
Parameters
path | path object handle |
Return value
The parsed path as an SVG-style string.
rotMatrix [::pix]Top, Main, Index
Creates a transformation rotation matrix or multiplies an existing one.
Parameters
angle | Double value (in radians). |
matrix | Optional Tcl list of 9 numbers representing an input 3x3 matrix . Optional, default identityMatrix. |
Return value
The rotated 3x3 matrix as a Tcl list of 9 elements.
scaleMatrix [::pix]Top, Main, Index
Creates a scaling matrix or multiplies an existing one.
Parameters
scale | A Tcl list {x y} representing scale factor coordinates. |
matrix | Optional Tcl list of 9 numbers representing an input 3x3 matrix . Optional, default identityMatrix. |
Return value
The scaled 3x3 matrix as a Tcl list of 9 elements.
svgStyleToPathObj [::pix]Top, Main, Index
Transforms an SVG-style path string into a path object.
Parameters
path | An SVG path data string. |
Return value
A new handle path object.
toB64 [::pix]Top, Main, Index
Converts an img or ctx object into a base64-encoded string.
Parameters
object | img or ctx object handle. |
Description
Note: On the Nim side, the base64 module is considered unstable. It is recommended to use the toBinary command combined with Tcl's native binary encode base64 command instead.
Return value
A base64-encoded string.
toBinary [::pix]Top, Main, Index
Converts an img or ctx object into raw binary image data.
Parameters
object | img or ctx object handle. |
format | Image format string (png, qoi, bmp, ppm) . Optional, default png. |
Return value
A byte array string in binary format.
transformMatrixPoint [::pix]Top, Main, Index
Transforms a 2D point using a 3x3 transformation matrix.
Parameters
point | A Tcl list {x y} representing the point coordinates. |
matrix | A Tcl list of 9 numbers representing the 3x3 matrix. |
Return value
A Tcl list {x y} containing the transformed coordinates.
transMatrix [::pix]Top, Main, Index
Creates a translation matrix or multiplies an existing one.
Parameters
trans | A Tcl list {x y} representing translation distance coordinates. |
matrix | Optional Tcl list of 9 numbers representing an input 3x3 matrix . Optional, default identityMatrix. |
Return value
The translated 3x3 matrix as a Tcl list of 9 elements.