FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
matplotlib/src/py_converters.cpp at main · matplotlib/matplotlib · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
matplotlib
/
matplotlib
Public
Uh oh!
There was an error while loading.
Please reload this page
.
Notifications
You must be signed in to change notification settings
Fork
8.5k
Star
23.1k
Code
Issues
1.1k
Pull requests
415
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
matplotlib
/
src
/
py_converters.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
22 lines (19 loc) · 677 Bytes
Breadcrumbs
matplotlib
/
src
/
py_converters.cpp
Copy path
File metadata and controls
22 lines (19 loc) · 677 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#
include
"
py_converters.h
"
void
convert_trans_affine
(
const
py::object& transform, agg::trans_affine& affine)
{
//
If None assume identity transform so leave affine unchanged
if
(transform.
is_none
()) {
return
;
}
auto
array = py::
array_t
<
double
, py::array::c_style>::
ensure
(transform);
if
(!array || array.
ndim
() !=
2
|| array.
shape
(
0
) !=
3
|| array.
shape
(
1
) !=
3
) {
throw
std::invalid_argument
(
"
Invalid affine transformation matrix
"
);
}
auto
buffer = array.
data
();
affine.
sx
= buffer[
0
];
affine.
shx
= buffer[
1
];
affine.
tx
= buffer[
2
];
affine.
shy
= buffer[
3
];
affine.
sy
= buffer[
4
];
affine.
ty
= buffer[
5
];
}
Back
|
FazBrowse Home
|
New Git URL