xtd 0.2.0
Loading...
Searching...
No Matches
matrix.h
1#pragma once
3#if !defined(__XTD_DRAWING_NATIVE_LIBRARY__)
4#error "Do not include this file: Internal use only"
5#endif
7
8#include <cstdint>
9#include <vector>
10#include <utility>
11#include <xtd/collections/generic/key_value_pair>
12#include <xtd/static>
13#include <xtd/string>
14#include <xtd/drawing_native_export.h>
15
17namespace xtd {
19 namespace drawing {
21 namespace drawing_2d {
22 class matrix;
23 }
25
28 namespace native {
36 class drawing_native_export_ matrix final static_ {
38 protected:
40
51 static intptr create(float m11, float m12, float m21, float m22, float dx, float dy);
52
56 static void destroy(intptr handle);
57
62 static std::vector<float> elenents(intptr handle);
63
68 static bool is_identity(intptr handle);
69
74 static bool is_invertible(intptr handle);
75
79 static void invert(intptr handle);
80
85 static float offset_x(intptr handle);
86
91 static float offset_y(intptr handle);
92
98 static void multiply(intptr handle, intptr matrix, int32 order);
99
103 static void reset(intptr handle);
104
110 static void rotate(intptr handle, float angle, int32 order);
111
119 static void rotate_at(intptr handle, float angle, float x, float y, int32 order);
120
127 static void scale(intptr handle, float scale_x, float scale_y, int32 order);
128
135 static void shear(intptr handle, float scale_x, float scale_y, int32 order);
136
142 static void transform_point(intptr handle, int32& x, int32& y);
148 static void transform_point(intptr handle, float& x, float& y);
149
160
167 static void translate(intptr handle, float offset_x, float offset_y, int32 order);
168
175 };
176 }
177 }
178}
Encapsulates a 3-by-3 affine matrix that represents a geometric transform. This class cannot be inher...
Definition matrix.h:73
Contains matrix native API.
Definition matrix.h:36
static void scale(intptr handle, float scale_x, float scale_y, int32 order)
Applies the specified scale vector (scale_x and scale_y) to this xtd::drawing::drawing_2d::matrix usi...
static std::vector< float > elenents(intptr handle)
Gets an array of floating-point values that represents the elements of the matrix.
static void destroy(intptr handle)
Destroys the matrix.
static void rotate_at(intptr handle, float angle, float x, float y, int32 order)
Applies a clockwise rotation to the matrix around the point specified in the point parameter,...
static intptr create(float m11, float m12, float m21, float m22, float dx, float dy)
Create a matrix with the specified elements.
static void translate(intptr handle, float offset_x, float offset_y, int32 order)
Applies the specified translation vector (offset_x and offset_y) to the matrix in the specified order...
static float offset_x(intptr handle)
Gets the x translation value (the dx value, or the element in the third row and first column) of the ...
static void multiply(intptr handle, intptr matrix, int32 order)
Multiplies this xtd::drawing::drawing_2d::matrix by the matrix specified in the matrix parameter,...
static void transform_vectors(intptr handle, std::vector< xtd::collections::generic::key_value_pair< int32, int32 > > &points)
Applies only the scale and rotate components of the matrix to the specified array of points.
static void invert(intptr handle)
Inverts the matrix, if it is invertible.
static void transform_point(intptr handle, int32 &x, int32 &y)
Applies the geometric transform represented by the matrix to a specified array of points.
static void reset(intptr handle)
Resets the matrix to have the elements of the identity matrix.
static void shear(intptr handle, float scale_x, float scale_y, int32 order)
Applies the specified shear vector to the matrix in the specified order.
static void transform_point(intptr handle, float &x, float &y)
Applies the geometric transform represented by the matrix to a specified array of points.
static bool is_identity(intptr handle)
Gets a value indicating whether the matrix is the identity matrix.
static void vector_transform_points(intptr handle, std::vector< xtd::collections::generic::key_value_pair< int32, int32 > > &points)
Multiplies each vector in an array by the matrix. The translation elements of this matrix (third row)...
static float offset_y(intptr handle)
Gets the y translation value (the dx value, or the element in the third row and first column) of the ...
static void rotate(intptr handle, float angle, int32 order)
repend to the matrix a clockwise rotation, around the origin and by the specified angle.
static bool is_invertible(intptr handle)
Gets a value indicating whether the matrix is invertible.
static void transform_vectors(intptr handle, std::vector< xtd::collections::generic::key_value_pair< float, float > > &points)
Applies only the scale and rotate components of the matrix to the specified array of points.
std::pair< key_t, value_t > key_value_pair
Defines a key/value pair that can be set or retrieved.
Definition key_value_pair.h:29
#define static_
This keyword is use to represent a static object. A static object can't be instantiated (constructors...
Definition static.h:37
int32_t int32
Represents a 32-bit signed integer.
Definition int32.h:23
intmax_t intptr
Represent a pointer or a handle.
Definition intptr.h:23
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10