package camlpdf
Install
dune-project
Dependency
Authors
Maintainers
Sources
md5=5ec4c14006769e68be97a3ed70d46bc7
sha512=2480a282a6ce09444ed14a3f41561375ecf7e3c57f7559a48ad9791d9f824e59820bfd39aa36910ff6bdc9b160cef76ab90dbbfe628c836c3f5c5081dfd5e452
doc/camlpdf/Pdftransform/index.html
Module Pdftransform
Affine Transformations in Two Dimensions
Types
type transform = transform_op listA list of transformations, the first at the end of the list (thus, to append another transformation, just cons to the beginning.)
A transformation matrix (first row a c e, second row b d f, third row 0 0 1)
val i : transformThe identity transform
val string_of_transform : transform -> stringMake a string of a transform for debug purposes.
Making transformation matrices
val i_matrix : transform_matrixThe identity matrix
val string_of_matrix : transform_matrix -> stringString of a transformation matrix.
val mktranslate : float -> float -> transform_matrixMake a transformation matrix from x and y translation.
val mkscale : (float * float) -> float -> float -> transform_matrixMake a transformation matrix from an x and y scale and a point to scale about.
val mkrotate : (float * float) -> float -> transform_matrixMake a rotation matrix to rotate by a number of radians around a point.
val mkshearx : (float * float) -> float -> transform_matrixMatrix to shear in x by a given factor about a point.
val mksheary : (float * float) -> float -> transform_matrixMatrix to shear in y by a given factor about a point.
Composing and manipulating transforms
val compose : transform_op -> transform -> transformcompose t ts adds operation t to the transform ts.
append a b is a transform with the same effect as performing b then a
val matrix_compose : transform_matrix -> transform_matrix -> transform_matrixcompose a b produces a matrix equivalent to performing b then a.
val matrix_of_op : transform_op -> transform_matrixMake a matrix from a single transformation operation
val matrix_of_transform : transform -> transform_matrixMake a matrix from a transform
Inverting transforms
val matrix_invert : transform_matrix -> transform_matrixMatrix inversion. May raise NonInvertable
val transform : transform -> (float * float) -> float * floatTransform a coordinate by a given transform.
val transform_matrix : transform_matrix -> (float * float) -> float * floatTransform a coordinate by a given transformation matrix.
Decomposing and recomposing matrices
val decompose :
transform_matrix ->
float * float * float * float * float * floatDecompose a transformation matrix to scale, aspect, rotation, shear, translation in x, translation in y. Always succeeds, but results are not guaranteed to mean anything.
val recompose :
float ->
float ->
float ->
float ->
float ->
float ->
transform_matrixRecompose from the above information. It is not guaranteed that recompose (decompose t) = t