Package: gsk

GEnum gsk:transform-category

Declaration

(gobject:define-genum "GskTransformCategory" transform-category
  (:export t
   :type-initializer "gsk_transform_category_get_type")
   :unknown
   :any
   :3d
   :2d
   :2d-affine
   :2d-translate
   :identity)  

Values

:unknown
The category of the matrix has not been determined.
:any
Analyzing the matrix concluded that it does not fit in any other category.
:3d
The matrix is a 3D matrix. This means that the w column (the last column) has the values (0, 0, 0, 1).
:2d
The matrix is a 2D matrix. This is equivalent to the graphene:matrix-is-2d function returning true. In particular, this means that Cairo can deal with the matrix.
:2d-affine
The matrix is a combination of 2D scale and 2D translation operations. In particular, this means that any rectangle can be transformed exactly using this matrix.
:2d-translate
The matrix is a 2D translation.
:identity
The matrix is the identity matrix.

Details

The categories of matrices relevant for GSK and GTK. Note that the enumeration values are ordered in a way that any category includes matrices of all later categories. So if you want to for example check if a matrix is a 2D matrix, the category value of the matrix is greater or equal the :2d value.

Also keep in mind that rounding errors may cause matrices to not conform to their categories. Otherwise, matrix operations done via multiplication will not worsen categories. So for the matrix multiplication C = A * B the result has the category category(C) = (MIN (category(A), category(B)).

Examples

With the helper function
(defun category-value (category)
  (cffi:convert-to-foreign category 'gsk:transform-category))    
you can check if a matrix with category is a 2D matrix with
(>= (category-value category) (category-value :2d))    
 

See also

2024-4-21