summaryrefslogtreecommitdiff
path: root/agg/inc/agg_span_pattern_filter_rgba.h
diff options
context:
space:
mode:
Diffstat (limited to 'agg/inc/agg_span_pattern_filter_rgba.h')
-rwxr-xr-xagg/inc/agg_span_pattern_filter_rgba.h120
1 files changed, 60 insertions, 60 deletions
diff --git a/agg/inc/agg_span_pattern_filter_rgba.h b/agg/inc/agg_span_pattern_filter_rgba.h
index 8460880fdb79..b6c13a030f0a 100755
--- a/agg/inc/agg_span_pattern_filter_rgba.h
+++ b/agg/inc/agg_span_pattern_filter_rgba.h
@@ -2,8 +2,8 @@
// Anti-Grain Geometry - Version 2.3
// Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com)
//
-// Permission to copy, use, modify, sell and distribute this software
-// is granted provided this copyright notice appears in all copies.
+// Permission to copy, use, modify, sell and distribute this software
+// is granted provided this copyright notice appears in all copies.
// This software is provided "as is" without express or implied
// warranty, and with no claim as to its suitability for any purpose.
//
@@ -13,12 +13,12 @@
// http://www.antigrain.com
//----------------------------------------------------------------------------
//
-// Adaptation for high precision colors has been sponsored by
+// Adaptation for high precision colors has been sponsored by
// Liberty Technology Systems, Inc., visit http://lib-sys.com
//
// Liberty Technology Systems, Inc. is the provider of
// PostScript and PDF technology for software developers.
-//
+//
//----------------------------------------------------------------------------
//
// classes span_pattern_filter_rgba*
@@ -38,12 +38,12 @@ namespace agg
//===========================================span_pattern_filter_rgba
template<class ColorT,
- class Order,
+ class Order,
class Interpolator,
class WrapModeX,
class WrapModeY,
- class Allocator = span_allocator<ColorT> >
- class span_pattern_filter_rgba_nn :
+ class Allocator = span_allocator<ColorT> >
+ class span_pattern_filter_rgba_nn :
public span_image_filter<ColorT, Interpolator, Allocator>
{
public:
@@ -61,7 +61,7 @@ namespace agg
};
//--------------------------------------------------------------------
- span_pattern_filter_rgba_nn(alloc_type& alloc) :
+ span_pattern_filter_rgba_nn(alloc_type& alloc) :
base_type(alloc),
m_wrap_mode_x(1),
m_wrap_mode_y(1)
@@ -69,7 +69,7 @@ namespace agg
//--------------------------------------------------------------------
span_pattern_filter_rgba_nn(alloc_type& alloc,
- const rendering_buffer& src,
+ const rendering_buffer& src,
interpolator_type& inter) :
base_type(alloc, src, color_type(0,0,0,0), inter, 0),
m_wrap_mode_x(src.width()),
@@ -77,8 +77,8 @@ namespace agg
{}
//--------------------------------------------------------------------
- void source_image(const rendering_buffer& src)
- {
+ void source_image(const rendering_buffer& src)
+ {
base_type::source_image(src);
m_wrap_mode_x = WrapModeX(src.width());
m_wrap_mode_y = WrapModeX(src.height());
@@ -87,7 +87,7 @@ namespace agg
//--------------------------------------------------------------------
color_type* generate(int x, int y, unsigned len)
{
- base_type::interpolator().begin(x + base_type::filter_dx_dbl(),
+ base_type::interpolator().begin(x + base_type::filter_dx_dbl(),
y + base_type::filter_dy_dbl(), len);
const value_type *fg_ptr;
color_type* span = base_type::allocator().span();
@@ -127,12 +127,12 @@ namespace agg
//=====================================span_pattern_filter_rgba_bilinear
template<class ColorT,
- class Order,
+ class Order,
class Interpolator,
class WrapModeX,
class WrapModeY,
- class Allocator = span_allocator<ColorT> >
- class span_pattern_filter_rgba_bilinear :
+ class Allocator = span_allocator<ColorT> >
+ class span_pattern_filter_rgba_bilinear :
public span_image_filter<ColorT, Interpolator, Allocator>
{
public:
@@ -150,7 +150,7 @@ namespace agg
};
//--------------------------------------------------------------------
- span_pattern_filter_rgba_bilinear(alloc_type& alloc) :
+ span_pattern_filter_rgba_bilinear(alloc_type& alloc) :
base_type(alloc),
m_wrap_mode_x(1),
m_wrap_mode_y(1)
@@ -158,7 +158,7 @@ namespace agg
//--------------------------------------------------------------------
span_pattern_filter_rgba_bilinear(alloc_type& alloc,
- const rendering_buffer& src,
+ const rendering_buffer& src,
interpolator_type& inter) :
base_type(alloc, src, color_type(0,0,0,0), inter, 0),
m_wrap_mode_x(src.width()),
@@ -166,8 +166,8 @@ namespace agg
{}
//-------------------------------------------------------------------
- void source_image(const rendering_buffer& src)
- {
+ void source_image(const rendering_buffer& src)
+ {
base_type::source_image(src);
m_wrap_mode_x = WrapModeX(src.width());
m_wrap_mode_y = WrapModeX(src.height());
@@ -176,7 +176,7 @@ namespace agg
//--------------------------------------------------------------------
color_type* generate(int x, int y, unsigned len)
{
- base_type::interpolator().begin(x + base_type::filter_dx_dbl(),
+ base_type::interpolator().begin(x + base_type::filter_dx_dbl(),
y + base_type::filter_dy_dbl(), len);
calc_type fg[4];
const value_type *fg_ptr;
@@ -205,9 +205,9 @@ namespace agg
const value_type* ptr1 = (value_type*)base_type::source_image().row(y1);
const value_type* ptr2 = (value_type*)base_type::source_image().row(y2);
- fg[0] =
- fg[1] =
- fg[2] =
+ fg[0] =
+ fg[1] =
+ fg[2] =
fg[3] = image_subpixel_size * image_subpixel_size / 2;
x_hr &= image_subpixel_mask;
@@ -215,7 +215,7 @@ namespace agg
int weight;
fg_ptr = ptr1 + x1;
- weight = (image_subpixel_size - x_hr) *
+ weight = (image_subpixel_size - x_hr) *
(image_subpixel_size - y_hr);
fg[0] += weight * fg_ptr[0];
fg[1] += weight * fg_ptr[1];
@@ -268,12 +268,12 @@ namespace agg
//=====================================span_pattern_filter_rgba_2x2
template<class ColorT,
- class Order,
+ class Order,
class Interpolator,
class WrapModeX,
class WrapModeY,
- class Allocator = span_allocator<ColorT> >
- class span_pattern_filter_rgba_2x2 :
+ class Allocator = span_allocator<ColorT> >
+ class span_pattern_filter_rgba_2x2 :
public span_image_filter<ColorT, Interpolator, Allocator>
{
public:
@@ -291,7 +291,7 @@ namespace agg
};
//--------------------------------------------------------------------
- span_pattern_filter_rgba_2x2(alloc_type& alloc) :
+ span_pattern_filter_rgba_2x2(alloc_type& alloc) :
base_type(alloc),
m_wrap_mode_x(1),
m_wrap_mode_y(1)
@@ -299,7 +299,7 @@ namespace agg
//--------------------------------------------------------------------
span_pattern_filter_rgba_2x2(alloc_type& alloc,
- const rendering_buffer& src,
+ const rendering_buffer& src,
interpolator_type& inter,
const image_filter_lut& filter) :
base_type(alloc, src, color_type(0,0,0,0), inter, &filter),
@@ -308,8 +308,8 @@ namespace agg
{}
//-------------------------------------------------------------------
- void source_image(const rendering_buffer& src)
- {
+ void source_image(const rendering_buffer& src)
+ {
base_type::source_image(src);
m_wrap_mode_x = WrapModeX(src.width());
m_wrap_mode_y = WrapModeX(src.height());
@@ -318,13 +318,13 @@ namespace agg
//--------------------------------------------------------------------
color_type* generate(int x, int y, unsigned len)
{
- base_type::interpolator().begin(x + base_type::filter_dx_dbl(),
+ base_type::interpolator().begin(x + base_type::filter_dx_dbl(),
y + base_type::filter_dy_dbl(), len);
calc_type fg[4];
const value_type *fg_ptr;
color_type* span = base_type::allocator().span();
- const int16* weight_array = base_type::filter().weight_array() +
- ((base_type::filter().diameter()/2 - 1) <<
+ const int16* weight_array = base_type::filter().weight_array() +
+ ((base_type::filter().diameter()/2 - 1) <<
image_subpixel_shift);
do
{
@@ -356,9 +356,9 @@ namespace agg
int weight;
fg_ptr = ptr1 + x1;
- weight = (weight_array[x_hr + image_subpixel_size] *
- weight_array[y_hr + image_subpixel_size] +
- image_filter_size / 2) >>
+ weight = (weight_array[x_hr + image_subpixel_size] *
+ weight_array[y_hr + image_subpixel_size] +
+ image_filter_size / 2) >>
image_filter_shift;
fg[0] += weight * fg_ptr[0];
fg[1] += weight * fg_ptr[1];
@@ -366,9 +366,9 @@ namespace agg
fg[3] += weight * fg_ptr[3];
fg_ptr = ptr1 + x2;
- weight = (weight_array[x_hr] *
- weight_array[y_hr + image_subpixel_size] +
- image_filter_size / 2) >>
+ weight = (weight_array[x_hr] *
+ weight_array[y_hr + image_subpixel_size] +
+ image_filter_size / 2) >>
image_filter_shift;
fg[0] += weight * fg_ptr[0];
fg[1] += weight * fg_ptr[1];
@@ -376,9 +376,9 @@ namespace agg
fg[3] += weight * fg_ptr[3];
fg_ptr = ptr2 + x1;
- weight = (weight_array[x_hr + image_subpixel_size] *
- weight_array[y_hr] +
- image_filter_size / 2) >>
+ weight = (weight_array[x_hr + image_subpixel_size] *
+ weight_array[y_hr] +
+ image_filter_size / 2) >>
image_filter_shift;
fg[0] += weight * fg_ptr[0];
fg[1] += weight * fg_ptr[1];
@@ -386,9 +386,9 @@ namespace agg
fg[3] += weight * fg_ptr[3];
fg_ptr = ptr2 + x2;
- weight = (weight_array[x_hr] *
- weight_array[y_hr] +
- image_filter_size / 2) >>
+ weight = (weight_array[x_hr] *
+ weight_array[y_hr] +
+ image_filter_size / 2) >>
image_filter_shift;
fg[0] += weight * fg_ptr[0];
fg[1] += weight * fg_ptr[1];
@@ -434,12 +434,12 @@ namespace agg
//==============================================span_pattern_filter_rgba
template<class ColorT,
- class Order,
+ class Order,
class Interpolator,
class WrapModeX,
class WrapModeY,
- class Allocator = span_allocator<ColorT> >
- class span_pattern_filter_rgba :
+ class Allocator = span_allocator<ColorT> >
+ class span_pattern_filter_rgba :
public span_image_filter<ColorT, Interpolator, Allocator>
{
public:
@@ -457,13 +457,13 @@ namespace agg
};
//--------------------------------------------------------------------
- span_pattern_filter_rgba(alloc_type& alloc) :
+ span_pattern_filter_rgba(alloc_type& alloc) :
base_type(alloc)
{}
//--------------------------------------------------------------------
span_pattern_filter_rgba(alloc_type& alloc,
- const rendering_buffer& src,
+ const rendering_buffer& src,
interpolator_type& inter,
const image_filter_lut& filter) :
base_type(alloc, src, color_type(0,0,0,0), inter, &filter),
@@ -472,8 +472,8 @@ namespace agg
{}
//--------------------------------------------------------------------
- void source_image(const rendering_buffer& src)
- {
+ void source_image(const rendering_buffer& src)
+ {
base_type::source_image(src);
m_wrap_mode_x = WrapModeX(src.width());
m_wrap_mode_y = WrapModeX(src.height());
@@ -482,7 +482,7 @@ namespace agg
//--------------------------------------------------------------------
color_type* generate(int x, int y, unsigned len)
{
- base_type::interpolator().begin(x + base_type::filter_dx_dbl(),
+ base_type::interpolator().begin(x + base_type::filter_dx_dbl(),
y + base_type::filter_dy_dbl(), len);
int fg[4];
@@ -492,7 +492,7 @@ namespace agg
color_type* span = base_type::allocator().span();
- int x_count;
+ int x_count;
int weight_y;
do
@@ -502,8 +502,8 @@ namespace agg
x -= base_type::filter_dx_int();
y -= base_type::filter_dy_int();
- int x_hr = x;
- int y_hr = y;
+ int x_hr = x;
+ int y_hr = y;
int x_fract = x_hr & image_subpixel_mask;
unsigned y_count = diameter;
@@ -525,10 +525,10 @@ namespace agg
do
{
const value_type* fg_ptr = row_ptr + (x_lr << 2);
- int weight = (weight_y * weight_array[x_hr] +
- image_filter_size / 2) >>
+ int weight = (weight_y * weight_array[x_hr] +
+ image_filter_size / 2) >>
image_filter_shift;
-
+
fg[0] += fg_ptr[0] * weight;
fg[1] += fg_ptr[1] * weight;
fg[2] += fg_ptr[2] * weight;