2
2
// Anti-Grain Geometry - Version 2.4
3
3
// Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com)
4
4
//
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.
7
7
// This software is provided "as is" without express or implied
8
8
// warranty, and with no claim as to its suitability for any purpose.
9
9
//
25
25
#else
26
26
namespace agg
27
27
{
28
- // The policy of all AGG containers and memory allocation strategy
28
+ // The policy of all AGG containers and memory allocation strategy
29
29
// in general is that no allocated data requires explicit construction.
30
30
// It means that the allocator can be really simple; you can even
31
- // replace new/delete to malloc/free. The constructors and destructors
32
- // won't be called in this case, however everything will remain working.
33
- // The second argument of deallocate() is the size of the allocated
31
+ // replace new/delete to malloc/free. The constructors and destructors
32
+ // won't be called in this case, however everything will remain working.
33
+ // The second argument of deallocate() is the size of the allocated
34
34
// block. You can use this information if you wish.
35
35
// ------------------------------------------------------------pod_allocator
36
36
template <class T > struct pod_allocator
@@ -40,8 +40,8 @@ namespace agg
40
40
};
41
41
42
42
// Single object allocator. It's also can be replaced with your custom
43
- // allocator. The difference is that it can only allocate a single
44
- // object and the constructor and destructor must be called.
43
+ // allocator. The difference is that it can only allocate a single
44
+ // object and the constructor and destructor must be called.
45
45
// In AGG there is no need to allocate an array of objects with
46
46
// calling their constructors (only single ones). So that, if you
47
47
// replace these new/delete to malloc/free make sure that the in-place
@@ -213,23 +213,23 @@ namespace agg
213
213
enum cover_scale_e
214
214
{
215
215
cover_shift = 8 , // ----cover_shift
216
- cover_size = 1 << cover_shift, // ----cover_size
217
- cover_mask = cover_size - 1 , // ----cover_mask
218
- cover_none = 0 , // ----cover_none
219
- cover_full = cover_mask // ----cover_full
216
+ cover_size = 1 << cover_shift, // ----cover_size
217
+ cover_mask = cover_size - 1 , // ----cover_mask
218
+ cover_none = 0 , // ----cover_none
219
+ cover_full = cover_mask // ----cover_full
220
220
};
221
221
222
222
// ----------------------------------------------------poly_subpixel_scale_e
223
- // These constants determine the subpixel accuracy, to be more precise,
224
- // the number of bits of the fractional part of the coordinates.
223
+ // These constants determine the subpixel accuracy, to be more precise,
224
+ // the number of bits of the fractional part of the coordinates.
225
225
// The possible coordinate capacity in bits can be calculated by formula:
226
226
// sizeof(int) * 8 - poly_subpixel_shift, i.e, for 32-bit integers and
227
227
// 8-bits fractional part the capacity is 24 bits.
228
228
enum poly_subpixel_scale_e
229
229
{
230
230
poly_subpixel_shift = 8 , // ----poly_subpixel_shift
231
- poly_subpixel_scale = 1 <<poly_subpixel_shift, // ----poly_subpixel_scale
232
- poly_subpixel_mask = poly_subpixel_scale-1 , // ----poly_subpixel_mask
231
+ poly_subpixel_scale = 1 <<poly_subpixel_shift, // ----poly_subpixel_scale
232
+ poly_subpixel_mask = poly_subpixel_scale-1 // ----poly_subpixel_mask
233
233
};
234
234
235
235
// ----------------------------------------------------------filling_rule_e
@@ -253,7 +253,7 @@ namespace agg
253
253
{
254
254
return rad * 180.0 / pi;
255
255
}
256
-
256
+
257
257
// ----------------------------------------------------------------rect_base
258
258
template <class T > struct rect_base
259
259
{
@@ -265,9 +265,9 @@ namespace agg
265
265
rect_base (T x1_, T y1_, T x2_, T y2_) :
266
266
x1 (x1_), y1(y1_), x2(x2_), y2(y2_) {}
267
267
268
- void init (T x1_, T y1_, T x2_, T y2_)
268
+ void init (T x1_, T y1_, T x2_, T y2_)
269
269
{
270
- x1 = x1_; y1 = y1_; x2 = x2_; y2 = y2_;
270
+ x1 = x1_; y1 = y1_; x2 = x2_; y2 = y2_;
271
271
}
272
272
273
273
const self_type& normalize ()
@@ -299,17 +299,17 @@ namespace agg
299
299
};
300
300
301
301
// -----------------------------------------------------intersect_rectangles
302
- template <class Rect >
302
+ template <class Rect >
303
303
inline Rect intersect_rectangles (const Rect& r1, const Rect& r2)
304
304
{
305
305
Rect r = r1;
306
306
307
- // First process x2,y2 because the other order
308
- // results in Internal Compiler Error under
309
- // Microsoft Visual C++ .NET 2003 69462-335-0000007-18038 in
307
+ // First process x2,y2 because the other order
308
+ // results in Internal Compiler Error under
309
+ // Microsoft Visual C++ .NET 2003 69462-335-0000007-18038 in
310
310
// case of "Maximize Speed" optimization option.
311
311
// -----------------
312
- if (r.x2 > r2.x2 ) r.x2 = r2.x2 ;
312
+ if (r.x2 > r2.x2 ) r.x2 = r2.x2 ;
313
313
if (r.y2 > r2.y2 ) r.y2 = r2.y2 ;
314
314
if (r.x1 < r2.x1 ) r.x1 = r2.x1 ;
315
315
if (r.y1 < r2.y1 ) r.y1 = r2.y1 ;
@@ -318,7 +318,7 @@ namespace agg
318
318
319
319
320
320
// ---------------------------------------------------------unite_rectangles
321
- template <class Rect >
321
+ template <class Rect >
322
322
inline Rect unite_rectangles (const Rect& r1, const Rect& r2)
323
323
{
324
324
Rect r = r1;
@@ -336,26 +336,26 @@ namespace agg
336
336
// ---------------------------------------------------------path_commands_e
337
337
enum path_commands_e
338
338
{
339
- path_cmd_stop = 0 , // ----path_cmd_stop
340
- path_cmd_move_to = 1 , // ----path_cmd_move_to
341
- path_cmd_line_to = 2 , // ----path_cmd_line_to
342
- path_cmd_curve3 = 3 , // ----path_cmd_curve3
343
- path_cmd_curve4 = 4 , // ----path_cmd_curve4
339
+ path_cmd_stop = 0 , // ----path_cmd_stop
340
+ path_cmd_move_to = 1 , // ----path_cmd_move_to
341
+ path_cmd_line_to = 2 , // ----path_cmd_line_to
342
+ path_cmd_curve3 = 3 , // ----path_cmd_curve3
343
+ path_cmd_curve4 = 4 , // ----path_cmd_curve4
344
344
path_cmd_curveN = 5 , // ----path_cmd_curveN
345
345
path_cmd_catrom = 6 , // ----path_cmd_catrom
346
346
path_cmd_ubspline = 7 , // ----path_cmd_ubspline
347
347
path_cmd_end_poly = 0x0F , // ----path_cmd_end_poly
348
- path_cmd_mask = 0x0F // ----path_cmd_mask
348
+ path_cmd_mask = 0x0F // ----path_cmd_mask
349
349
};
350
350
351
351
// ------------------------------------------------------------path_flags_e
352
352
enum path_flags_e
353
353
{
354
- path_flags_none = 0 , // ----path_flags_none
355
- path_flags_ccw = 0x10 , // ----path_flags_ccw
356
- path_flags_cw = 0x20 , // ----path_flags_cw
354
+ path_flags_none = 0 , // ----path_flags_none
355
+ path_flags_ccw = 0x10 , // ----path_flags_ccw
356
+ path_flags_cw = 0x20 , // ----path_flags_cw
357
357
path_flags_close = 0x40 , // ----path_flags_close
358
- path_flags_mask = 0xF0 // ----path_flags_mask
358
+ path_flags_mask = 0xF0 // ----path_flags_mask
359
359
};
360
360
361
361
// ---------------------------------------------------------------is_vertex
@@ -372,7 +372,7 @@ namespace agg
372
372
373
373
// -----------------------------------------------------------------is_stop
374
374
inline bool is_stop (unsigned c)
375
- {
375
+ {
376
376
return c == path_cmd_stop;
377
377
}
378
378
@@ -416,7 +416,7 @@ namespace agg
416
416
inline bool is_close (unsigned c)
417
417
{
418
418
return (c & ~(path_flags_cw | path_flags_ccw)) ==
419
- (path_cmd_end_poly | path_flags_close);
419
+ (path_cmd_end_poly | path_flags_close);
420
420
}
421
421
422
422
// ------------------------------------------------------------is_next_poly
@@ -440,19 +440,19 @@ namespace agg
440
440
// -------------------------------------------------------------is_oriented
441
441
inline bool is_oriented (unsigned c)
442
442
{
443
- return (c & (path_flags_cw | path_flags_ccw)) != 0 ;
443
+ return (c & (path_flags_cw | path_flags_ccw)) != 0 ;
444
444
}
445
445
446
446
// ---------------------------------------------------------------is_closed
447
447
inline bool is_closed (unsigned c)
448
448
{
449
- return (c & path_flags_close) != 0 ;
449
+ return (c & path_flags_close) != 0 ;
450
450
}
451
451
452
452
// ----------------------------------------------------------get_close_flag
453
453
inline unsigned get_close_flag (unsigned c)
454
454
{
455
- return c & path_flags_close;
455
+ return c & path_flags_close;
456
456
}
457
457
458
458
// -------------------------------------------------------clear_orientation
@@ -513,7 +513,7 @@ namespace agg
513
513
int x1, x2;
514
514
const T* ptr;
515
515
const_row_info () {}
516
- const_row_info (int x1_, int x2_, const T* ptr_) :
516
+ const_row_info (int x1_, int x2_, const T* ptr_) :
517
517
x1 (x1_), x2(x2_), ptr(ptr_) {}
518
518
};
519
519
0 commit comments