Skip to content

Commit 2a17839

Browse files
committed
Upgrade Agg to SVN r103
1 parent ebd921b commit 2a17839

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+6915
-3236
lines changed

extern/agg24/include/agg_alpha_mask_u8.h

Lines changed: 38 additions & 38 deletions
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-
agg::rendering_buffer* m_rbuf;
305+
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-
agg::rendering_buffer* m_rbuf;
452+
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

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy