Skip to content

Commit 6f18cf8

Browse files
committed
Merged revisions 6927-6928 via svnmerge from
https://matplotlib.svn.sf.net/svnroot/matplotlib/branches/v0_98_5_maint ........ r6927 | mdboom | 2009-02-23 12:30:07 -0500 (Mon, 23 Feb 2009) | 2 lines Add credit to Allen Haldane in comments. ........ r6928 | mdboom | 2009-02-23 12:38:35 -0500 (Mon, 23 Feb 2009) | 2 lines C++ standards compliance for use with Sun C++ compiler. These should be equivalent to what was there before on gcc. ........ svn path=/trunk/matplotlib/; revision=6929
1 parent d85fbba commit 6f18cf8

File tree

3 files changed

+48
-48
lines changed

3 files changed

+48
-48
lines changed

CXX/Extensions.hxx

+1-1
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ namespace Py
203203
{
204204
typedef PyObject *(*method_varargs_call_handler_t)( PyObject *_self, PyObject *_args );
205205
typedef PyObject *(*method_keyword_call_handler_t)( PyObject *_self, PyObject *_args, PyObject *_dict );
206-
};
206+
}
207207

208208
template<class T>
209209
class MethodDefExt : public PyMethodDef

agg24/include/agg_alpha_mask_u8.h

+38-38
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// Anti-Grain Geometry - Version 2.4
33
// Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com)
44
//
5-
// Permission to copy, use, modify, sell and distribute this software
6-
// is granted provided this copyright notice appears in all copies.
5+
// Permission to copy, use, modify, sell and distribute this software
6+
// is granted provided this copyright notice appears in all copies.
77
// This software is provided "as is" without express or implied
88
// warranty, and with no claim as to its suitability for any purpose.
99
//
@@ -30,15 +30,15 @@ namespace agg
3030
{
3131
static unsigned calculate(const int8u* p) { return *p; }
3232
};
33-
33+
3434

3535
//=====================================================rgb_to_gray_mask_u8
3636
template<unsigned R, unsigned G, unsigned B>
3737
struct rgb_to_gray_mask_u8
3838
{
39-
static unsigned calculate(const int8u* p)
40-
{
41-
return (p[R]*77 + p[G]*150 + p[B]*29) >> 8;
39+
static unsigned calculate(const int8u* p)
40+
{
41+
return (p[R]*77 + p[G]*150 + p[B]*29) >> 8;
4242
}
4343
};
4444

@@ -50,7 +50,7 @@ namespace agg
5050
typedef int8u cover_type;
5151
typedef alpha_mask_u8<Step, Offset, MaskF> self_type;
5252
enum cover_scale_e
53-
{
53+
{
5454
cover_shift = 8,
5555
cover_none = 0,
5656
cover_full = 255
@@ -64,12 +64,12 @@ namespace agg
6464
MaskF& mask_function() { return m_mask_function; }
6565
const MaskF& mask_function() const { return m_mask_function; }
6666

67-
67+
6868
//--------------------------------------------------------------------
6969
cover_type pixel(int x, int y) const
7070
{
71-
if(x >= 0 && y >= 0 &&
72-
x < (int)m_rbuf->width() &&
71+
if(x >= 0 && y >= 0 &&
72+
x < (int)m_rbuf->width() &&
7373
y < (int)m_rbuf->height())
7474
{
7575
return (cover_type)m_mask_function.calculate(
@@ -81,13 +81,13 @@ namespace agg
8181
//--------------------------------------------------------------------
8282
cover_type combine_pixel(int x, int y, cover_type val) const
8383
{
84-
if(x >= 0 && y >= 0 &&
85-
x < (int)m_rbuf->width() &&
84+
if(x >= 0 && y >= 0 &&
85+
x < (int)m_rbuf->width() &&
8686
y < (int)m_rbuf->height())
8787
{
88-
return (cover_type)((cover_full + val *
88+
return (cover_type)((cover_full + val *
8989
m_mask_function.calculate(
90-
m_rbuf->row_ptr(y) + x * Step + Offset)) >>
90+
m_rbuf->row_ptr(y) + x * Step + Offset)) >>
9191
cover_shift);
9292
}
9393
return 0;
@@ -112,7 +112,7 @@ namespace agg
112112
if(x < 0)
113113
{
114114
count += x;
115-
if(count <= 0)
115+
if(count <= 0)
116116
{
117117
memset(dst, 0, num_pix * sizeof(cover_type));
118118
return;
@@ -126,7 +126,7 @@ namespace agg
126126
{
127127
int rest = x + count - xmax - 1;
128128
count -= rest;
129-
if(count <= 0)
129+
if(count <= 0)
130130
{
131131
memset(dst, 0, num_pix * sizeof(cover_type));
132132
return;
@@ -162,7 +162,7 @@ namespace agg
162162
if(x < 0)
163163
{
164164
count += x;
165-
if(count <= 0)
165+
if(count <= 0)
166166
{
167167
memset(dst, 0, num_pix * sizeof(cover_type));
168168
return;
@@ -176,7 +176,7 @@ namespace agg
176176
{
177177
int rest = x + count - xmax - 1;
178178
count -= rest;
179-
if(count <= 0)
179+
if(count <= 0)
180180
{
181181
memset(dst, 0, num_pix * sizeof(cover_type));
182182
return;
@@ -187,8 +187,8 @@ namespace agg
187187
const int8u* mask = m_rbuf->row_ptr(y) + x * Step + Offset;
188188
do
189189
{
190-
*covers = (cover_type)((cover_full + (*covers) *
191-
m_mask_function.calculate(mask)) >>
190+
*covers = (cover_type)((cover_full + (*covers) *
191+
m_mask_function.calculate(mask)) >>
192192
cover_shift);
193193
++covers;
194194
mask += Step;
@@ -214,7 +214,7 @@ namespace agg
214214
if(y < 0)
215215
{
216216
count += y;
217-
if(count <= 0)
217+
if(count <= 0)
218218
{
219219
memset(dst, 0, num_pix * sizeof(cover_type));
220220
return;
@@ -228,7 +228,7 @@ namespace agg
228228
{
229229
int rest = y + count - ymax - 1;
230230
count -= rest;
231-
if(count <= 0)
231+
if(count <= 0)
232232
{
233233
memset(dst, 0, num_pix * sizeof(cover_type));
234234
return;
@@ -263,7 +263,7 @@ namespace agg
263263
if(y < 0)
264264
{
265265
count += y;
266-
if(count <= 0)
266+
if(count <= 0)
267267
{
268268
memset(dst, 0, num_pix * sizeof(cover_type));
269269
return;
@@ -277,7 +277,7 @@ namespace agg
277277
{
278278
int rest = y + count - ymax - 1;
279279
count -= rest;
280-
if(count <= 0)
280+
if(count <= 0)
281281
{
282282
memset(dst, 0, num_pix * sizeof(cover_type));
283283
return;
@@ -288,8 +288,8 @@ namespace agg
288288
const int8u* mask = m_rbuf->row_ptr(y) + x * Step + Offset;
289289
do
290290
{
291-
*covers = (cover_type)((cover_full + (*covers) *
292-
m_mask_function.calculate(mask)) >>
291+
*covers = (cover_type)((cover_full + (*covers) *
292+
m_mask_function.calculate(mask)) >>
293293
cover_shift);
294294
++covers;
295295
mask += m_rbuf->stride();
@@ -302,10 +302,10 @@ namespace agg
302302
alpha_mask_u8(const self_type&);
303303
const self_type& operator = (const self_type&);
304304

305-
rendering_buffer* m_rbuf;
305+
agg::rendering_buffer* m_rbuf;
306306
MaskF m_mask_function;
307307
};
308-
308+
309309

310310
typedef alpha_mask_u8<1, 0> alpha_mask_gray8; //----alpha_mask_gray8
311311

@@ -354,7 +354,7 @@ namespace agg
354354
typedef int8u cover_type;
355355
typedef amask_no_clip_u8<Step, Offset, MaskF> self_type;
356356
enum cover_scale_e
357-
{
357+
{
358358
cover_shift = 8,
359359
cover_none = 0,
360360
cover_full = 255
@@ -376,13 +376,13 @@ namespace agg
376376
m_rbuf->row_ptr(y) + x * Step + Offset);
377377
}
378378

379-
379+
380380
//--------------------------------------------------------------------
381381
cover_type combine_pixel(int x, int y, cover_type val) const
382382
{
383-
return (cover_type)((cover_full + val *
383+
return (cover_type)((cover_full + val *
384384
m_mask_function.calculate(
385-
m_rbuf->row_ptr(y) + x * Step + Offset)) >>
385+
m_rbuf->row_ptr(y) + x * Step + Offset)) >>
386386
cover_shift);
387387
}
388388

@@ -407,8 +407,8 @@ namespace agg
407407
const int8u* mask = m_rbuf->row_ptr(y) + x * Step + Offset;
408408
do
409409
{
410-
*dst = (cover_type)((cover_full + (*dst) *
411-
m_mask_function.calculate(mask)) >>
410+
*dst = (cover_type)((cover_full + (*dst) *
411+
m_mask_function.calculate(mask)) >>
412412
cover_shift);
413413
++dst;
414414
mask += Step;
@@ -436,8 +436,8 @@ namespace agg
436436
const int8u* mask = m_rbuf->row_ptr(y) + x * Step + Offset;
437437
do
438438
{
439-
*dst = (cover_type)((cover_full + (*dst) *
440-
m_mask_function.calculate(mask)) >>
439+
*dst = (cover_type)((cover_full + (*dst) *
440+
m_mask_function.calculate(mask)) >>
441441
cover_shift);
442442
++dst;
443443
mask += m_rbuf->stride();
@@ -449,10 +449,10 @@ namespace agg
449449
amask_no_clip_u8(const self_type&);
450450
const self_type& operator = (const self_type&);
451451

452-
rendering_buffer* m_rbuf;
452+
agg::rendering_buffer* m_rbuf;
453453
MaskF m_mask_function;
454454
};
455-
455+
456456

457457
typedef amask_no_clip_u8<1, 0> amask_no_clip_gray8; //----amask_no_clip_gray8
458458

src/path_converters.h

+9-9
Original file line numberDiff line numberDiff line change
@@ -515,15 +515,15 @@ class PathSimplifier : protected EmbeddedQueue<9>
515515
the last line. Once it gets too big, the lines cannot be
516516
combined. */
517517

518-
/* This code was originally written by someone else (John
519-
Hunter?) and I have modified to work in-place -- meaning
520-
not creating an entirely new path list each time. In order
521-
to do that without too much additional code complexity, it
522-
keeps a small queue around so that multiple points can be
523-
emitted in a single call, and those points will be popped
524-
from the queue in subsequent calls. The following block
525-
will empty the queue before proceeding to the main loop
526-
below. -- Michael Droettboom */
518+
/* This code was originally written by Allan Haldane and I
519+
have modified to work in-place -- meaning not creating an
520+
entirely new path list each time. In order to do that
521+
without too much additional code complexity, it keeps a
522+
small queue around so that multiple points can be emitted
523+
in a single call, and those points will be popped from the
524+
queue in subsequent calls. The following block will empty
525+
the queue before proceeding to the main loop below.
526+
-- Michael Droettboom */
527527

528528
if (queue_flush(&cmd, x, y)) {
529529
return cmd;

0 commit comments

Comments
 (0)