GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — matplotlib/src/py_converters.cpp at main · matplotlib/matplotlib

Expand file tree

/

py_converters.cpp

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
22 lines (19 loc) · 677 Bytes
/

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];
}
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.