Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b40923d

Browse files
committed
use agg:int8u not uint8_t
1 parent 1712678 commit b40923d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/_tkagg.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#include <cstdio>
1414
#include <sstream>
1515

16-
#include <mplutils.h> // uint8_t on old MSC_VER
16+
#include <agg_basics.h> // agg:int8u
1717

1818
// Include our own excerpts from the Tcl / Tk headers
1919
#include "_tkmini.h"
@@ -52,7 +52,7 @@ static int PyAggImagePhoto(ClientData clientdata, Tcl_Interp *interp, int
5252
int wdata, hdata, bbox_parse;
5353
float x1, x2, y1, y2;
5454
bool has_bbox;
55-
uint8_t *destbuffer, *buffer;
55+
agg::int8u *destbuffer, *buffer;
5656
int destx, desty, destwidth, destheight, deststride;
5757

5858
long mode;
@@ -80,7 +80,7 @@ static int PyAggImagePhoto(ClientData clientdata, Tcl_Interp *interp, int
8080
(char *)NULL);
8181
return TCL_ERROR;
8282
}
83-
buffer = (uint8_t*)pdata;
83+
buffer = (agg::int8u*)pdata;
8484

8585
/* get array mode (0=mono, 1=rgb, 2=rgba) */
8686
mode = atol(argv[3]);
@@ -109,7 +109,7 @@ static int PyAggImagePhoto(ClientData clientdata, Tcl_Interp *interp, int
109109
destheight = (int)(y2 - y1);
110110
deststride = 4 * destwidth;
111111

112-
destbuffer = new uint8_t[deststride * destheight];
112+
destbuffer = new agg::int8u[deststride * destheight];
113113
if (destbuffer == NULL) {
114114
TCL_APPEND_RESULT(interp, "could not allocate memory", (char *)NULL);
115115
return TCL_ERROR;

0 commit comments

Comments
 (0)