'<(skia_include_path)/c/xamarin/sk_x_document.h',
'<(skia_include_path)/c/xamarin/sk_x_image.h',
'<(skia_include_path)/c/xamarin/sk_x_maskfilter.h',
+ '<(skia_include_path)/c/xamarin/sk_x_matrix.h',
'<(skia_include_path)/c/xamarin/sk_x_imagefilter.h',
'<(skia_include_path)/c/xamarin/sk_x_colorfilter.h',
'<(skia_include_path)/c/xamarin/sk_x_paint.h',
'<(skia_src_path)/c/xamarin/sk_x_document.cpp',
'<(skia_src_path)/c/xamarin/sk_x_image.cpp',
'<(skia_src_path)/c/xamarin/sk_x_maskfilter.cpp',
+ '<(skia_src_path)/c/xamarin/sk_x_matrix.cpp',
'<(skia_src_path)/c/xamarin/sk_x_imagefilter.cpp',
'<(skia_src_path)/c/xamarin/sk_x_colorfilter.cpp',
'<(skia_src_path)/c/xamarin/sk_x_paint.cpp',
*/
SK_API void sk_matrix_post_concat (sk_matrix_t *result, sk_matrix_t *matrix);
+/**
+ Apply the @matrix to the coordinates in rectangle @source using the matrix definition into @dest
+*/
+SK_API void sk_matrix_map_rect (sk_matrix_t *matrix, sk_rect_t *dest, sk_rect_t *source);
+
+/**
+ Apply the @matrix to the array of points @src containing @count points into @dst
+*/
+SK_API void sk_matrix_map_points (sk_matrix_t *matrix, sk_point_t *dst, sk_point_t *src, int count);
+
+/**
+ Apply this matrix to the array of vectors specified by src, and write
+ the transformed vectors into the array of vectors specified by dst.
+ This is similar to mapPoints, but ignores any translation in the matrix.
+ @param dst Where the transformed coordinates are written. It must
+ contain at least count entries
+ @param src The original coordinates that are to be transformed. It
+ must contain at least count entries
+ @param count The number of vectors in src to read, and then transform
+ into dst.
+*/
+SK_API void sk_matrix_map_vectors (sk_matrix_t *matrix, sk_point_t *dst, sk_point_t *src, int count);
+
+/**
+ Applies the matrix to the the @x,@y positions
+*/
+SK_API sk_point_t sk_matrix_map_xy (sk_matrix_t *matrix, float x, float y);
+
+/**
+ Applies the matrix to the the @x,@y positions, ignoring the translation component.
+*/
+SK_API sk_point_t sk_matrix_map_vector (sk_matrix_t *matrix, float x, float y);
+
+/**
+ Return the mean radius of a circle after it has been mapped by
+ this matrix. NOTE: in perspective this value assumes the circle
+ has its center at the origin.
+*/
+SK_API float sk_matrix_map_radius (sk_matrix_t *matrix, float radius);
+
SK_C_PLUS_PLUS_END_GUARD
#endif
return paint->getFontMetrics(AsFontMetrics(cfontmetrics), scale);
}
-int sk_matrix_try_invert (sk_matrix_t *matrix, sk_matrix_t *result)
-{
- SkMatrix copy, inverse;
- from_c (matrix, ©);
- if (copy.invert (&inverse)){
- from_sk (&inverse, result);
- return 1;
- }
- return 0;
-}
-
-void sk_matrix_concat (sk_matrix_t *matrix, sk_matrix_t *first, sk_matrix_t *second)
-{
- SkMatrix target, skfirst, sksecond;
-
- from_c (matrix, &target);
- from_c (first, &skfirst);
- from_c (second, &sksecond);
- target.setConcat (skfirst, sksecond);
- from_sk (&target, matrix);
-}
-
-void sk_matrix_pre_concat (sk_matrix_t *target, sk_matrix_t *matrix)
-{
- SkMatrix sktarget, skmatrix;
- from_c (target, &sktarget);
- from_c (matrix, &skmatrix);
- sktarget.preConcat (skmatrix);
- from_sk (&sktarget, target);
-}
-
-void sk_matrix_post_concat (sk_matrix_t *target, sk_matrix_t *matrix)
-{
- SkMatrix sktarget, skmatrix;
- from_c (target, &sktarget);
- from_c (matrix, &skmatrix);
- sktarget.postConcat (skmatrix);
- from_sk (&sktarget, target);
-}