11
11
12
12
#include < Python.h>
13
13
#include < stdlib.h>
14
+ #include < stdio.h>
14
15
#include < sstream>
15
16
16
17
#include " agg_basics.h"
@@ -47,6 +48,8 @@ PyAggImagePhoto(ClientData clientdata, Tcl_Interp* interp,
47
48
48
49
// vars for blitting
49
50
PyObject* bboxo;
51
+
52
+ unsigned long aggl, bboxl;
50
53
bool has_bbox;
51
54
agg::int8u *destbuffer;
52
55
double l,b,r,t;
@@ -73,10 +76,14 @@ PyAggImagePhoto(ClientData clientdata, Tcl_Interp* interp,
73
76
return TCL_ERROR;
74
77
}
75
78
/* get array (or object that can be converted to array) pointer */
76
- std::stringstream agg_ptr_ss;
77
- agg_ptr_ss.str (argv[2 ]);
78
- agg_ptr_ss >> tmp_ptr;
79
- aggo = (PyObject*)tmp_ptr;
79
+ sscanf (argv[2 ]," %lu" ,&aggl);
80
+ aggo = (PyObject*)aggl;
81
+ // aggo = (PyObject*)atol(argv[2]);
82
+
83
+ // std::stringstream agg_ptr_ss;
84
+ // agg_ptr_ss.str(argv[2]);
85
+ // agg_ptr_ss >> tmp_ptr;
86
+ // aggo = (PyObject*)tmp_ptr;
80
87
RendererAgg *aggRenderer = (RendererAgg *)aggo;
81
88
int srcheight = (int )aggRenderer->get_height ();
82
89
@@ -90,10 +97,14 @@ PyAggImagePhoto(ClientData clientdata, Tcl_Interp* interp,
90
97
}
91
98
92
99
/* check for bbox/blitting */
93
- std::stringstream bbox_ptr_ss;
94
- bbox_ptr_ss.str (argv[4 ]);
95
- bbox_ptr_ss >> tmp_ptr;
96
- bboxo = (PyObject*)tmp_ptr;
100
+ sscanf (argv[4 ]," %lu" ,&bboxl);
101
+ bboxo = (PyObject*)bboxl;
102
+
103
+ // bboxo = (PyObject*)atol(argv[4]);
104
+ // std::stringstream bbox_ptr_ss;
105
+ // bbox_ptr_ss.str(argv[4]);
106
+ // bbox_ptr_ss >> tmp_ptr;
107
+ // bboxo = (PyObject*)tmp_ptr;
97
108
if (py_convert_bbox (bboxo, l, b, r, t)) {
98
109
has_bbox = true ;
99
110
0 commit comments