package archimedes
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=6c27810ecc964480a95584bdab10c5fd2784d530395c1a464f43be18f6f363be
md5=7f3bd1771751a074e4b4d2ccc5213260
doc/archimedes.cairo/Archimedes_cairo/B/index.html
Module Archimedes_cairo.B
Source
include Archimedes.Backend.T
Handle to a backend.
set_color bk c
sets the color of the backend bk
to c
.
set_color bk c
sets the color of the backend bk
to c
.
set_line_width bk w
sets the line width of the backend bk
to w
. The line width is expressed in the natural backend coordinates (i.e. when the CTM is the identity).
set_line_width bk w
sets the line width of the backend bk
to w
. The line width is expressed in the natural backend coordinates (i.e. when the CTM is the identity).
set_line_cap bk c
sets the line cap for the backend bk
to c
.
set_line_cap bk c
sets the line cap for the backend bk
to c
.
set_dash bk ofs pattern
set_dash bk ofs pattern
set_line_join bk j
sets the line join for the backend bk
to j
.
Begin a new sub-path. After this call the current point will be (x, y)
.
Begin a new sub-path. After this call the current point will be (x, y)
.
line_to bk x y
Adds a line to the path from the current point to position (x, y)
in the current backend coordinates. After this call the current point will be (x, y)
.
If there is no current point before the call to line_to
this function will behave as move_to
bk x y
.
curve_to bk x1 y1 x2 y2 x3 y3
adds an Bezier curve to the path, starting at the current point, ending at point (x3,y3)
, with control points (x1,y1)
and (x2,y2)
.
rectangle bk x y w h
adds to the current path of bk
a rectangle whose lower left corner is at (x,y)
and width and height are respectively w
and h
.
arc bk r a1 a2
add an arc to the current path starting from the current point with a radius r
, starting at angle a1
and going clockwise to angle a2
.
Adds a line segment to the path from the current point to the beginning of the current sub-path (the most recent point passed to Archimedes.Backend.T.move_to
) and closes this sub-path.
Adds a line segment to the path from the current point to the beginning of the current sub-path (the most recent point passed to Archimedes.Backend.T.move_to
) and closes this sub-path.
Clears the current path. After this call there will be no path. Nothing is guaranteed about the current point (it may not be preserved).
Clears the current path. After this call there will be no path. Nothing is guaranteed about the current point (it may not be preserved).
stroke bk
draw the curve described by the current path according to the current line width and color.
stroke bk
draw the curve described by the current path according to the current line width and color.
Same as stroke
but make sure the current path is unmodified.
Same as stroke
but make sure the current path is unmodified.
fill bk
draw the curve described by the current path according to the current line width and color. The current path may be modified. This is affected by the CTM.
fill bk
draw the curve described by the current path according to the current line width and color. The current path may be modified. This is affected by the CTM.
Same as fill
but make sure the current path is unmodified.
stroke_path bk p
stroke the abstract path p
, where its coordinates are interpreted in the current transformation matrix. Of course, the current clipping, line width and color are be obeyed. This function may modify the current path in bk
.
For backend developers: the internal representation of the path is available in Archimedes_internals.Path
.
stroke_path bk p
stroke the abstract path p
, where its coordinates are interpreted in the current transformation matrix. Of course, the current clipping, line width and color are be obeyed. This function may modify the current path in bk
.
For backend developers: the internal representation of the path is available in Archimedes_internals.Path
.
fill_path_preserve
is similar to stroke_path_preserve
except that it fills the path.
fill_with_color t c
fill the current path of t
with the color c
. Even if the color is transparent, it must replace all underlying elements (contrarily to Backend.T.fill
which will show the underlying elements through a transparent color). If transparency is not supported by the backend, it does the same as Backend.T.fill
, except that this operation does not change the current color of the backend. It may modify the current path however.
Some backends may not show immediately the action of stroke
, fill
, stroke_path_preserve
,... immediately (usually because it is expensive but also to avoid flicker during animations). show bk
forces the backend to update.
Establishes a new clip rectangle by intersecting the current clip rectangle. This may clear the current path. Calling clip_rectangle
can only make the clip region smaller, never larger. For clip_rectangle
to have only a local effect, put it in a save
/ restore
group.
clip_rectangle
is garantee to respect the CTM only if the components xy
and yx
of the matrix are both 0.
.
Save the current state of the backend. Note that save/restore must not affect the current path.
Save the current state of the backend. Note that save/restore must not affect the current path.
Restore the saved state of the backend.
translate cr tx ty
modifies the current transformation matrix by translating the user-space origin by (tx
,ty
).
translate cr tx ty
modifies the current transformation matrix by translating the user-space origin by (tx
,ty
).
scale sx sy
modifies the current transformation matrix by scaling the X and Y user-space axes by sx
and sy
respectively.
scale sx sy
modifies the current transformation matrix by scaling the X and Y user-space axes by sx
and sy
respectively.
Modifies the current transformation matrix by rotating the user-space axes by angle
radians.
Modifies the current transformation matrix by rotating the user-space axes by angle
radians.
Set the current transformation matrix which is the matrix transorming user to device coordinates.
Set the current transformation matrix which is the matrix transorming user to device coordinates.
Return the current transformation matrix. Modifying this matrix does not affect the matrix held in t
.
Return the current transformation matrix. Modifying this matrix does not affect the matrix held in t
.
true
iff this kind of device has its Y axis pointing downwards. FIXME: really needed ? Beware that on some devices, the font display happens in the current coordinates.
val select_font_face :
t ->
Archimedes.Backend.slant ->
Archimedes.Backend.weight ->
string ->
unit
select_font_face t slant weight family
selects a family and style of font from a simplified description as a family name, slant and weight. Family names are bakend dependent. Raise an exception if the face is not supported.
select_font_face t slant weight family
selects a family and style of font from a simplified description as a family name, slant and weight. Family names are bakend dependent. Raise an exception if the face is not supported.
Set the scaling of the font.
Set the scaling of the font.
Returns a rectangle whose width and height specify respectively the length and the height of the text. The x and y values give the lower bottom point of the rectangle as if the text was placed at the origin.
val show_text :
t ->
rotate:float ->
x:float ->
y:float ->
Archimedes.Backend.text_position ->
string ->
unit
Returns a rectangle whose width and height specify respectively the length and the height of the text. The x and y values give the lower bottom point of the rectangle as if the text was placed at the origin.
show_text t angle x y pos txt
displays txt
at the point (x
,y
) as indicated by pos
. The point (x
,y
) is in the current coordinate system but the current transformation matrix will NOT be applied to the text itself. angle
indicates by how many radians the text must be rotated w.r.t. the x-axis (in the current coordinate system, assuming it is orthonormal) -- not all device support rotations of angles <> 0.
(in device coordinates). This is an immediate operation: no stroke
nor fill
are required (nor will have any effect).
Name under which to register the backend.
create options width height
must creates a new handle of size width
×height
(in units proper to the module) on which the subsequent drawing functions operate. options
allows to pass options to the backend (this is backend specific).