[Libreoffice-commits] .: agg/inc agg/prj agg/source
René Engelhard
rene at kemper.freedesktop.org
Sat Oct 30 08:20:33 PDT 2010
agg/inc/agg_alpha_mask_u8.h | 499 -
agg/inc/agg_arc.h | 74
agg/inc/agg_array.h | 887 --
agg/inc/agg_arrowhead.h | 82
agg/inc/agg_basics.h | 343
agg/inc/agg_bezier_arc.h | 158
agg/inc/agg_bitset_iterator.h | 54
agg/inc/agg_bounding_rect.h | 116
agg/inc/agg_bspline.h | 77
agg/inc/agg_clip_liang_barsky.h | 209
agg/inc/agg_color_gray.h | 364 -
agg/inc/agg_color_rgba.h | 618 -
agg/inc/agg_config.h | 31
agg/inc/agg_conv_adaptor_vcgen.h | 169
agg/inc/agg_conv_adaptor_vpgen.h | 166
agg/inc/agg_conv_bspline.h | 48
agg/inc/agg_conv_clip_polygon.h | 69
agg/inc/agg_conv_clip_polyline.h | 69
agg/inc/agg_conv_close_polygon.h | 132
agg/inc/agg_conv_concat.h | 80
agg/inc/agg_conv_contour.h | 65
agg/inc/agg_conv_curve.h | 174
agg/inc/agg_conv_dash.h | 68
agg/inc/agg_conv_gpc.h | 443 -
agg/inc/agg_conv_marker.h | 154
agg/inc/agg_conv_marker_adaptor.h | 51
agg/inc/agg_conv_segmentator.h | 48
agg/inc/agg_conv_shorten_path.h | 50
agg/inc/agg_conv_smooth_poly1.h | 80
agg/inc/agg_conv_stroke.h | 73
agg/inc/agg_conv_transform.h | 75
agg/inc/agg_conv_unclose_polygon.h | 59
agg/inc/agg_curves.h | 150
agg/inc/agg_dda_line.h | 290
agg/inc/agg_ellipse.h | 98
agg/inc/agg_ellipse_bresenham.h | 113
agg/inc/agg_embedded_raster_fonts.h | 59
agg/inc/agg_font_cache_manager.h | 397 -
agg/inc/agg_gamma_functions.h | 123
agg/inc/agg_gamma_lut.h | 114
agg/inc/agg_glyph_raster_bin.h | 155
agg/inc/agg_gsv_text.h | 154
agg/inc/agg_image_filters.h | 449 -
agg/inc/agg_line_aa_basics.h | 152
agg/inc/agg_math.h | 247
agg/inc/agg_math_stroke.h | 340
agg/inc/agg_path_storage.h | 364 -
agg/inc/agg_path_storage_integer.h | 300
agg/inc/agg_pattern_filters_rgba.h | 122
agg/inc/agg_pixfmt_amask_adaptor.h | 265
agg/inc/agg_pixfmt_gray.h | 703 --
agg/inc/agg_pixfmt_rgb.h | 760 --
agg/inc/agg_pixfmt_rgb_packed.h | 1277 ---
agg/inc/agg_pixfmt_rgba.h | 1312 ---
agg/inc/agg_rasterizer_outline.h | 146
agg/inc/agg_rasterizer_outline_aa.h | 516 -
agg/inc/agg_rasterizer_scanline_aa.h | 743 --
agg/inc/agg_render_scanlines.h | 66
agg/inc/agg_renderer_base.h | 618 -
agg/inc/agg_renderer_markers.h | 707 --
agg/inc/agg_renderer_mclip.h | 383 -
agg/inc/agg_renderer_outline_aa.h | 1545 ----
agg/inc/agg_renderer_outline_image.h | 924 --
agg/inc/agg_renderer_primitives.h | 224
agg/inc/agg_renderer_raster_text.h | 264
agg/inc/agg_renderer_scanline.h | 450 -
agg/inc/agg_rendering_buffer.h | 179
agg/inc/agg_rendering_buffer_dynarow.h | 184
agg/inc/agg_rounded_rect.h | 79
agg/inc/agg_scanline_bin.h | 171
agg/inc/agg_scanline_boolean_algebra.h | 1559 ----
agg/inc/agg_scanline_p.h | 197
agg/inc/agg_scanline_storage_aa.h | 796 --
agg/inc/agg_scanline_storage_bin.h | 569 -
agg/inc/agg_scanline_u.h | 323
agg/inc/agg_shorten_path.h | 66
agg/inc/agg_simul_eq.h | 147
agg/inc/agg_span_allocator.h | 72
agg/inc/agg_span_converter.h | 53
agg/inc/agg_span_generator.h | 50
agg/inc/agg_span_gouraud.h | 180
agg/inc/agg_span_gouraud_gray.h | 185
agg/inc/agg_span_gouraud_rgba.h | 206
agg/inc/agg_span_gradient.h | 422 -
agg/inc/agg_span_gradient_alpha.h | 123
agg/inc/agg_span_image_filter.h | 110
agg/inc/agg_span_image_filter_gray.h | 701 --
agg/inc/agg_span_image_filter_rgb.h | 840 --
agg/inc/agg_span_image_filter_rgba.h | 864 --
agg/inc/agg_span_image_resample.h | 180
agg/inc/agg_span_image_resample_gray.h | 359 -
agg/inc/agg_span_image_resample_rgb.h | 393 -
agg/inc/agg_span_image_resample_rgba.h | 393 -
agg/inc/agg_span_interpolator_adaptor.h | 77
agg/inc/agg_span_interpolator_linear.h | 232
agg/inc/agg_span_interpolator_persp.h | 462 -
agg/inc/agg_span_interpolator_trans.h | 97
agg/inc/agg_span_pattern.h | 278
agg/inc/agg_span_pattern_filter_gray.h | 472 -
agg/inc/agg_span_pattern_filter_rgb.h | 568 -
agg/inc/agg_span_pattern_filter_rgba.h | 584 -
agg/inc/agg_span_pattern_resample_gray.h | 320
agg/inc/agg_span_pattern_resample_rgb.h | 346
agg/inc/agg_span_pattern_resample_rgba.h | 354 -
agg/inc/agg_span_pattern_rgb.h | 165
agg/inc/agg_span_pattern_rgba.h | 111
agg/inc/agg_span_solid.h | 63
agg/inc/agg_span_subdiv_adaptor.h | 141
agg/inc/agg_trans_affine.h | 344
agg/inc/agg_trans_bilinear.h | 166
agg/inc/agg_trans_double_path.h | 131
agg/inc/agg_trans_lens.h | 79
agg/inc/agg_trans_perspective.h | 192
agg/inc/agg_trans_single_path.h | 97
agg/inc/agg_trans_viewport.h | 304
agg/inc/agg_trans_warp_magnifier.h | 51
agg/inc/agg_vcgen_bspline.h | 74
agg/inc/agg_vcgen_contour.h | 96
agg/inc/agg_vcgen_dash.h | 99
agg/inc/agg_vcgen_markers_term.h | 72
agg/inc/agg_vcgen_smooth_poly1.h | 87
agg/inc/agg_vcgen_stroke.h | 114
agg/inc/agg_vcgen_vertex_sequence.h | 135
agg/inc/agg_vertex_iterator.h | 133
agg/inc/agg_vertex_sequence.h | 176
agg/inc/agg_vpgen_clip_polygon.h | 83
agg/inc/agg_vpgen_clip_polyline.h | 121
agg/inc/agg_vpgen_segmentator.h | 61
agg/prj/build.lst | 5
agg/prj/d.lst | 11
agg/source/agg.flt | 3
agg/source/agg_arc.cpp | 105
agg/source/agg_arrowhead.cpp | 110
agg/source/agg_bezier_arc.cpp | 237
agg/source/agg_bspline.cpp | 299
agg/source/agg_curves.cpp | 246
agg/source/agg_embedded_raster_fonts.cpp |10426 ------------------------------
agg/source/agg_gsv_text.cpp | 688 -
agg/source/agg_image_filters.cpp | 120
agg/source/agg_line_aa_basics.cpp | 82
agg/source/agg_line_profile_aa.cpp | 117
agg/source/agg_path_storage.cpp | 525 -
agg/source/agg_rasterizer_scanline_aa.cpp | 621 -
agg/source/agg_rounded_rect.cpp | 164
agg/source/agg_sqrt_tables.cpp | 115
agg/source/agg_trans_affine.cpp | 195
agg/source/agg_trans_double_path.cpp | 273
agg/source/agg_trans_single_path.cpp | 202
agg/source/agg_trans_warp_magnifier.cpp | 50
agg/source/agg_vcgen_bspline.cpp | 194
agg/source/agg_vcgen_contour.cpp | 191
agg/source/agg_vcgen_dash.cpp | 237
agg/source/agg_vcgen_markers_term.cpp | 103
agg/source/agg_vcgen_smooth_poly1.cpp | 226
agg/source/agg_vcgen_stroke.cpp | 246
agg/source/agg_vpgen_clip_polygon.cpp | 133
agg/source/agg_vpgen_clip_polyline.cpp | 142
agg/source/agg_vpgen_segmentator.cpp | 67
agg/source/makefile.mk | 91
159 files changed, 52625 deletions(-)
New commits:
commit c76416bfc095c3fe20bda7e6bda73ed3829d2071
Author: Rene Engelhard <rene at debian.org>
Date: Wed Oct 27 20:29:22 2010 +0200
bin agg
diff --git a/agg/inc/agg_alpha_mask_u8.h b/agg/inc/agg_alpha_mask_u8.h
deleted file mode 100755
index a3e581a..0000000
--- a/agg/inc/agg_alpha_mask_u8.h
+++ /dev/null
@@ -1,499 +0,0 @@
-//----------------------------------------------------------------------------
-// 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.
-// This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
-//
-//----------------------------------------------------------------------------
-// Contact: mcseem at antigrain.com
-// mcseemagg at yahoo.com
-// http://www.antigrain.com
-//----------------------------------------------------------------------------
-//
-// scanline_u8 class
-//
-//----------------------------------------------------------------------------
-#ifndef AGG_ALPHA_MASK_U8_INCLUDED
-#define AGG_ALPHA_MASK_U8_INCLUDED
-
-#include <string.h>
-#include "agg_basics.h"
-#include "agg_rendering_buffer.h"
-
-namespace agg
-{
- //===================================================one_component_mask_u8
- struct one_component_mask_u8
- {
- static unsigned calculate(const int8u* p) { return *p; }
- };
-
-
- //=====================================================rgb_to_gray_mask_u8
- template<unsigned R, unsigned G, unsigned B>
- struct rgb_to_gray_mask_u8
- {
- static unsigned calculate(const int8u* p)
- {
- return (p[R]*77 + p[G]*150 + p[B]*29) >> 8;
- }
- };
-
- //==========================================================alpha_mask_u8
- template<unsigned Step=1, unsigned Offset=0, class MaskF=one_component_mask_u8>
- class alpha_mask_u8
- {
- public:
- typedef int8u cover_type;
- typedef alpha_mask_u8<Step, Offset, MaskF> self_type;
- enum
- {
- cover_shift = 8,
- cover_none = 0,
- cover_full = 255
- };
-
- alpha_mask_u8() : m_rbuf(0) {}
- alpha_mask_u8(rendering_buffer& rbuf) : m_rbuf(&rbuf) {}
-
- void attach(rendering_buffer& rbuf) { m_rbuf = &rbuf; }
-
- MaskF& mask_function() { return m_mask_function; }
- const MaskF& mask_function() const { return m_mask_function; }
-
-
- //--------------------------------------------------------------------
- cover_type pixel(int x, int y) const
- {
- if(x >= 0 && y >= 0 &&
- x < (int)m_rbuf->width() &&
- y <= (int)m_rbuf->height())
- {
- return (cover_type)m_mask_function.calculate(
- m_rbuf->row(y) + x * Step + Offset);
- }
- return 0;
- }
-
- //--------------------------------------------------------------------
- cover_type combine_pixel(int x, int y, cover_type val) const
- {
- if(x >= 0 && y >= 0 &&
- x < (int)m_rbuf->width() &&
- y <= (int)m_rbuf->height())
- {
- return (cover_type)((val *
- m_mask_function.calculate(
- m_rbuf->row(y) + x * Step + Offset)) >>
- cover_shift);
- }
- return 0;
- }
-
-
- //--------------------------------------------------------------------
- void fill_hspan(int x, int y, cover_type* dst, int num_pix) const
- {
- int xmax = m_rbuf->width() - 1;
- int ymax = m_rbuf->height() - 1;
-
- int count = num_pix;
- cover_type* covers = dst;
-
- if(y < 0 || y > ymax)
- {
- memset(dst, 0, num_pix * sizeof(cover_type));
- return;
- }
-
- if(x < 0)
- {
- count += x;
- if(count <= 0)
- {
- memset(dst, 0, num_pix * sizeof(cover_type));
- return;
- }
- memset(covers, 0, -x * sizeof(cover_type));
- covers -= x;
- x = 0;
- }
-
- if(x + count > xmax)
- {
- int rest = x + count - xmax - 1;
- count -= rest;
- if(count <= 0)
- {
- memset(dst, 0, num_pix * sizeof(cover_type));
- return;
- }
- memset(covers + count, 0, rest * sizeof(cover_type));
- }
-
- const int8u* mask = m_rbuf->row(y) + x * Step + Offset;
- do
- {
- *covers++ = (cover_type)m_mask_function.calculate(mask);
- mask += Step;
- }
- while(--count);
- }
-
-
- //--------------------------------------------------------------------
- void combine_hspan(int x, int y, cover_type* dst, int num_pix) const
- {
- int xmax = m_rbuf->width() - 1;
- int ymax = m_rbuf->height() - 1;
-
- int count = num_pix;
- cover_type* covers = dst;
-
- if(y < 0 || y > ymax)
- {
- memset(dst, 0, num_pix * sizeof(cover_type));
- return;
- }
-
- if(x < 0)
- {
- count += x;
- if(count <= 0)
- {
- memset(dst, 0, num_pix * sizeof(cover_type));
- return;
- }
- memset(covers, 0, -x * sizeof(cover_type));
- covers -= x;
- x = 0;
- }
-
- if(x + count > xmax)
- {
- int rest = x + count - xmax - 1;
- count -= rest;
- if(count <= 0)
- {
- memset(dst, 0, num_pix * sizeof(cover_type));
- return;
- }
- memset(covers + count, 0, rest * sizeof(cover_type));
- }
-
- const int8u* mask = m_rbuf->row(y) + x * Step + Offset;
- do
- {
- *covers = (cover_type)(((*covers) *
- m_mask_function.calculate(mask)) >>
- cover_shift);
- ++covers;
- mask += Step;
- }
- while(--count);
- }
-
- //--------------------------------------------------------------------
- void fill_vspan(int x, int y, cover_type* dst, int num_pix) const
- {
- int xmax = m_rbuf->width() - 1;
- int ymax = m_rbuf->height() - 1;
-
- int count = num_pix;
- cover_type* covers = dst;
-
- if(x < 0 || x > xmax)
- {
- memset(dst, 0, num_pix * sizeof(cover_type));
- return;
- }
-
- if(y < 0)
- {
- count += y;
- if(count <= 0)
- {
- memset(dst, 0, num_pix * sizeof(cover_type));
- return;
- }
- memset(covers, 0, -y * sizeof(cover_type));
- covers -= y;
- y = 0;
- }
-
- if(y + count > ymax)
- {
- int rest = y + count - ymax - 1;
- count -= rest;
- if(count <= 0)
- {
- memset(dst, 0, num_pix * sizeof(cover_type));
- return;
- }
- memset(covers + count, 0, rest * sizeof(cover_type));
- }
-
- const int8u* mask = m_rbuf->row(y) + x * Step + Offset;
- do
- {
- *covers++ = (cover_type)m_mask_function.calculate(mask);
- mask += m_rbuf->stride();
- }
- while(--count);
- }
-
- //--------------------------------------------------------------------
- void combine_vspan(int x, int y, cover_type* dst, int num_pix) const
- {
- int xmax = m_rbuf->width() - 1;
- int ymax = m_rbuf->height() - 1;
-
- int count = num_pix;
- cover_type* covers = dst;
-
- if(x < 0 || x > xmax)
- {
- memset(dst, 0, num_pix * sizeof(cover_type));
- return;
- }
-
- if(y < 0)
- {
- count += y;
- if(count <= 0)
- {
- memset(dst, 0, num_pix * sizeof(cover_type));
- return;
- }
- memset(covers, 0, -y * sizeof(cover_type));
- covers -= y;
- y = 0;
- }
-
- if(y + count > ymax)
- {
- int rest = y + count - ymax - 1;
- count -= rest;
- if(count <= 0)
- {
- memset(dst, 0, num_pix * sizeof(cover_type));
- return;
- }
- memset(covers + count, 0, rest * sizeof(cover_type));
- }
-
- const int8u* mask = m_rbuf->row(y) + x * Step + Offset;
- do
- {
- *covers = (cover_type)(((*covers) *
- m_mask_function.calculate(mask)) >>
- cover_shift);
- ++covers;
- mask += m_rbuf->stride();
- }
- while(--count);
- }
-
-
- private:
- alpha_mask_u8(const self_type&);
- const self_type& operator = (const self_type&);
-
- rendering_buffer* m_rbuf;
- MaskF m_mask_function;
- };
-
-
- typedef alpha_mask_u8<1, 0> alpha_mask_gray8; //----alpha_mask_gray8
-
- typedef alpha_mask_u8<3, 0> alpha_mask_rgb24r; //----alpha_mask_rgb24r
- typedef alpha_mask_u8<3, 1> alpha_mask_rgb24g; //----alpha_mask_rgb24g
- typedef alpha_mask_u8<3, 2> alpha_mask_rgb24b; //----alpha_mask_rgb24b
-
- typedef alpha_mask_u8<3, 2> alpha_mask_bgr24r; //----alpha_mask_bgr24r
- typedef alpha_mask_u8<3, 1> alpha_mask_bgr24g; //----alpha_mask_bgr24g
- typedef alpha_mask_u8<3, 0> alpha_mask_bgr24b; //----alpha_mask_bgr24b
-
- typedef alpha_mask_u8<4, 0> alpha_mask_rgba32r; //----alpha_mask_rgba32r
- typedef alpha_mask_u8<4, 1> alpha_mask_rgba32g; //----alpha_mask_rgba32g
- typedef alpha_mask_u8<4, 2> alpha_mask_rgba32b; //----alpha_mask_rgba32b
- typedef alpha_mask_u8<4, 3> alpha_mask_rgba32a; //----alpha_mask_rgba32a
-
- typedef alpha_mask_u8<4, 1> alpha_mask_argb32r; //----alpha_mask_argb32r
- typedef alpha_mask_u8<4, 2> alpha_mask_argb32g; //----alpha_mask_argb32g
- typedef alpha_mask_u8<4, 3> alpha_mask_argb32b; //----alpha_mask_argb32b
- typedef alpha_mask_u8<4, 0> alpha_mask_argb32a; //----alpha_mask_argb32a
-
- typedef alpha_mask_u8<4, 2> alpha_mask_bgra32r; //----alpha_mask_bgra32r
- typedef alpha_mask_u8<4, 1> alpha_mask_bgra32g; //----alpha_mask_bgra32g
- typedef alpha_mask_u8<4, 0> alpha_mask_bgra32b; //----alpha_mask_bgra32b
- typedef alpha_mask_u8<4, 3> alpha_mask_bgra32a; //----alpha_mask_bgra32a
-
- typedef alpha_mask_u8<4, 3> alpha_mask_abgr32r; //----alpha_mask_abgr32r
- typedef alpha_mask_u8<4, 2> alpha_mask_abgr32g; //----alpha_mask_abgr32g
- typedef alpha_mask_u8<4, 1> alpha_mask_abgr32b; //----alpha_mask_abgr32b
- typedef alpha_mask_u8<4, 0> alpha_mask_abgr32a; //----alpha_mask_abgr32a
-
- typedef alpha_mask_u8<3, 0, rgb_to_gray_mask_u8<0, 1, 2> > alpha_mask_rgb24gray; //----alpha_mask_rgb24gray
- typedef alpha_mask_u8<3, 0, rgb_to_gray_mask_u8<2, 1, 0> > alpha_mask_bgr24gray; //----alpha_mask_bgr24gray
- typedef alpha_mask_u8<4, 0, rgb_to_gray_mask_u8<0, 1, 2> > alpha_mask_rgba32gray; //----alpha_mask_rgba32gray
- typedef alpha_mask_u8<4, 1, rgb_to_gray_mask_u8<0, 1, 2> > alpha_mask_argb32gray; //----alpha_mask_argb32gray
- typedef alpha_mask_u8<4, 0, rgb_to_gray_mask_u8<2, 1, 0> > alpha_mask_bgra32gray; //----alpha_mask_bgra32gray
- typedef alpha_mask_u8<4, 1, rgb_to_gray_mask_u8<2, 1, 0> > alpha_mask_abgr32gray; //----alpha_mask_abgr32gray
-
-
-
- //==========================================================amask_no_clip_u8
- template<unsigned Step=1, unsigned Offset=0, class MaskF=one_component_mask_u8>
- class amask_no_clip_u8
- {
- public:
- typedef int8u cover_type;
- typedef amask_no_clip_u8<Step, Offset, MaskF> self_type;
- enum
- {
- cover_shift = 8,
- cover_none = 0,
- cover_full = 255
- };
-
- amask_no_clip_u8() : m_rbuf(0) {}
- amask_no_clip_u8(rendering_buffer& rbuf) : m_rbuf(&rbuf) {}
-
- void attach(rendering_buffer& rbuf) { m_rbuf = &rbuf; }
-
- MaskF& mask_function() { return m_mask_function; }
- const MaskF& mask_function() const { return m_mask_function; }
-
-
- //--------------------------------------------------------------------
- cover_type pixel(int x, int y) const
- {
- return (cover_type)m_mask_function.calculate(
- m_rbuf->row(y) + x * Step + Offset);
- }
-
-
- //--------------------------------------------------------------------
- cover_type combine_pixel(int x, int y, cover_type val) const
- {
- return (cover_type)((val *
- m_mask_function.calculate(
- m_rbuf->row(y) + x * Step + Offset)) >>
- cover_shift);
- }
-
-
- //--------------------------------------------------------------------
- void fill_hspan(int x, int y, cover_type* dst, int num_pix) const
- {
- const int8u* mask = m_rbuf->row(y) + x * Step + Offset;
- do
- {
- *dst++ = (cover_type)m_mask_function.calculate(mask);
- mask += Step;
- }
- while(--num_pix);
- }
-
-
-
- //--------------------------------------------------------------------
- void combine_hspan(int x, int y, cover_type* dst, int num_pix) const
- {
- const int8u* mask = m_rbuf->row(y) + x * Step + Offset;
- do
- {
- *dst = (cover_type)(((*dst) *
- m_mask_function.calculate(mask)) >>
- cover_shift);
- ++dst;
- mask += Step;
- }
- while(--num_pix);
- }
-
-
- //--------------------------------------------------------------------
- void fill_vspan(int x, int y, cover_type* dst, int num_pix) const
- {
- const int8u* mask = m_rbuf->row(y) + x * Step + Offset;
- do
- {
- *dst++ = (cover_type)m_mask_function.calculate(mask);
- mask += m_rbuf->stride();
- }
- while(--num_pix);
- }
-
-
- //--------------------------------------------------------------------
- void combine_vspan(int x, int y, cover_type* dst, int num_pix) const
- {
- const int8u* mask = m_rbuf->row(y) + x * Step + Offset;
- do
- {
- *dst = (cover_type)(((*dst) *
- m_mask_function.calculate(mask)) >>
- cover_shift);
- ++dst;
- mask += m_rbuf->stride();
- }
- while(--num_pix);
- }
-
- private:
- amask_no_clip_u8(const self_type&);
- const self_type& operator = (const self_type&);
-
- rendering_buffer* m_rbuf;
- MaskF m_mask_function;
- };
-
-
- typedef amask_no_clip_u8<1, 0> amask_no_clip_gray8; //----amask_no_clip_gray8
-
- typedef amask_no_clip_u8<3, 0> amask_no_clip_rgb24r; //----amask_no_clip_rgb24r
- typedef amask_no_clip_u8<3, 1> amask_no_clip_rgb24g; //----amask_no_clip_rgb24g
- typedef amask_no_clip_u8<3, 2> amask_no_clip_rgb24b; //----amask_no_clip_rgb24b
-
- typedef amask_no_clip_u8<3, 2> amask_no_clip_bgr24r; //----amask_no_clip_bgr24r
- typedef amask_no_clip_u8<3, 1> amask_no_clip_bgr24g; //----amask_no_clip_bgr24g
- typedef amask_no_clip_u8<3, 0> amask_no_clip_bgr24b; //----amask_no_clip_bgr24b
-
- typedef amask_no_clip_u8<4, 0> amask_no_clip_rgba32r; //----amask_no_clip_rgba32r
- typedef amask_no_clip_u8<4, 1> amask_no_clip_rgba32g; //----amask_no_clip_rgba32g
- typedef amask_no_clip_u8<4, 2> amask_no_clip_rgba32b; //----amask_no_clip_rgba32b
- typedef amask_no_clip_u8<4, 3> amask_no_clip_rgba32a; //----amask_no_clip_rgba32a
-
- typedef amask_no_clip_u8<4, 1> amask_no_clip_argb32r; //----amask_no_clip_argb32r
- typedef amask_no_clip_u8<4, 2> amask_no_clip_argb32g; //----amask_no_clip_argb32g
- typedef amask_no_clip_u8<4, 3> amask_no_clip_argb32b; //----amask_no_clip_argb32b
- typedef amask_no_clip_u8<4, 0> amask_no_clip_argb32a; //----amask_no_clip_argb32a
-
- typedef amask_no_clip_u8<4, 2> amask_no_clip_bgra32r; //----amask_no_clip_bgra32r
- typedef amask_no_clip_u8<4, 1> amask_no_clip_bgra32g; //----amask_no_clip_bgra32g
- typedef amask_no_clip_u8<4, 0> amask_no_clip_bgra32b; //----amask_no_clip_bgra32b
- typedef amask_no_clip_u8<4, 3> amask_no_clip_bgra32a; //----amask_no_clip_bgra32a
-
- typedef amask_no_clip_u8<4, 3> amask_no_clip_abgr32r; //----amask_no_clip_abgr32r
- typedef amask_no_clip_u8<4, 2> amask_no_clip_abgr32g; //----amask_no_clip_abgr32g
- typedef amask_no_clip_u8<4, 1> amask_no_clip_abgr32b; //----amask_no_clip_abgr32b
- typedef amask_no_clip_u8<4, 0> amask_no_clip_abgr32a; //----amask_no_clip_abgr32a
-
- typedef amask_no_clip_u8<3, 0, rgb_to_gray_mask_u8<0, 1, 2> > amask_no_clip_rgb24gray; //----amask_no_clip_rgb24gray
- typedef amask_no_clip_u8<3, 0, rgb_to_gray_mask_u8<2, 1, 0> > amask_no_clip_bgr24gray; //----amask_no_clip_bgr24gray
- typedef amask_no_clip_u8<4, 0, rgb_to_gray_mask_u8<0, 1, 2> > amask_no_clip_rgba32gray; //----amask_no_clip_rgba32gray
- typedef amask_no_clip_u8<4, 1, rgb_to_gray_mask_u8<0, 1, 2> > amask_no_clip_argb32gray; //----amask_no_clip_argb32gray
- typedef amask_no_clip_u8<4, 0, rgb_to_gray_mask_u8<2, 1, 0> > amask_no_clip_bgra32gray; //----amask_no_clip_bgra32gray
- typedef amask_no_clip_u8<4, 1, rgb_to_gray_mask_u8<2, 1, 0> > amask_no_clip_abgr32gray; //----amask_no_clip_abgr32gray
-
-
-}
-
-
-
-#endif
diff --git a/agg/inc/agg_arc.h b/agg/inc/agg_arc.h
deleted file mode 100755
index e681718..0000000
--- a/agg/inc/agg_arc.h
+++ /dev/null
@@ -1,74 +0,0 @@
-//----------------------------------------------------------------------------
-// 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.
-// This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
-//
-//----------------------------------------------------------------------------
-// Contact: mcseem at antigrain.com
-// mcseemagg at yahoo.com
-// http://www.antigrain.com
-//----------------------------------------------------------------------------
-//
-// Arc vertex generator
-//
-//----------------------------------------------------------------------------
-
-#ifndef AGG_ARC_INCLUDED
-#define AGG_ARC_INCLUDED
-
-#include <math.h>
-#include "agg_basics.h"
-
-namespace agg
-{
-
- //=====================================================================arc
- //
- // See Implementation agg_arc.cpp
- //
- class arc
- {
- public:
- arc() : m_scale(1.0), m_initialized(false) {}
- arc(double x, double y,
- double rx, double ry,
- double a1, double a2,
- bool ccw=true);
-
- void init(double x, double y,
- double rx, double ry,
- double a1, double a2,
- bool ccw=true);
-
- void approximation_scale(double s);
- double approximation_scale() const { return m_scale; }
-
- void rewind(unsigned);
- unsigned vertex(double* x, double* y);
-
- private:
- void normalize(double a1, double a2, bool ccw);
-
- double m_x;
- double m_y;
- double m_rx;
- double m_ry;
- double m_angle;
- double m_start;
- double m_end;
- double m_scale;
- double m_da;
- bool m_ccw;
- bool m_initialized;
- unsigned m_path_cmd;
- };
-
-
-}
-
-
-#endif
diff --git a/agg/inc/agg_array.h b/agg/inc/agg_array.h
deleted file mode 100755
index 2881344..0000000
--- a/agg/inc/agg_array.h
+++ /dev/null
@@ -1,887 +0,0 @@
-//----------------------------------------------------------------------------
-// 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.
-// This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
-//
-//----------------------------------------------------------------------------
-// Contact: mcseem at antigrain.com
-// mcseemagg at yahoo.com
-// http://www.antigrain.com
-//----------------------------------------------------------------------------
-#ifndef AGG_ARRAY_INCLUDED
-#define AGG_ARRAY_INCLUDED
-
-#include <stddef.h>
-#include <string.h>
-#include "agg_basics.h"
-
-namespace agg
-{
-
-
-
- //-------------------------------------------------------pod_array_adaptor
- template<class T> class pod_array_adaptor
- {
- public:
- typedef T value_type;
- pod_array_adaptor(T* array, unsigned _size) :
- m_array(array), m_size(_size) {}
-
- unsigned size() const { return m_size; }
- const T& operator [] (unsigned idx) const { return m_array[idx]; }
- T& operator [] (unsigned idx) { return m_array[idx]; }
- private:
- T* m_array;
- unsigned m_size;
- };
-
-
-
- //---------------------------------------------------------pod_auto_array
- template<class T, unsigned Size> class pod_auto_array
- {
- public:
- typedef T value_type;
- typedef pod_auto_array<T, Size> self_type;
-
- pod_auto_array() {}
- explicit pod_auto_array(const T* c)
- {
- memcpy(m_array, c, sizeof(T) * Size);
- }
-
- const self_type& operator = (const T* c)
- {
- memcpy(m_array, c, sizeof(T) * Size);
- return *this;
- }
-
- static unsigned size() { return Size; }
- const T& operator [] (unsigned i) const { return m_array[i]; }
- T& operator [] (unsigned i) { return m_array[i]; }
- private:
- T m_array[Size];
- };
-
-
-
-
-
- //---------------------------------------------------------------pod_array
- // A simple class template to store Plain Old Data, a vector
- // of a fixed size. The data is continous in memory
- //------------------------------------------------------------------------
- template<class T> class pod_array
- {
- public:
- typedef T value_type;
-
- ~pod_array() { delete [] m_array; }
- pod_array() : m_size(0), m_capacity(0), m_array(0) {}
- pod_array(unsigned cap, unsigned extra_tail=0);
-
- // Copying
- pod_array(const pod_array<T>&);
- const pod_array<T>& operator = (const pod_array<T>&);
-
- unsigned capacity() const { return m_capacity; }
- void capacity(unsigned cap, unsigned extra_tail=0);
-
- void resize(unsigned new_size);
-
- void add(const T& v) { m_array[m_size++] = v; }
- void inc_size(unsigned _size) { m_size += _size; }
- unsigned size() const { return m_size; }
- unsigned byte_size() const { return m_size * sizeof(T); }
- void serialize(int8u* ptr) const;
- void deserialize(const int8u* data, unsigned byte_size);
- const T& operator [] (unsigned idx) const { return m_array[idx]; }
- T& operator [] (unsigned idx) { return m_array[idx]; }
-
- void remove_all() { m_size = 0; }
- void cut_at(unsigned num) { if(num < m_size) m_size = num; }
-
- private:
- unsigned m_size;
- unsigned m_capacity;
- T* m_array;
- };
-
- //------------------------------------------------------------------------
- template<class T>
- void pod_array<T>::capacity(unsigned cap, unsigned extra_tail)
- {
- m_size = 0;
- if(cap > m_capacity)
- {
- delete [] m_array;
- m_capacity = cap + extra_tail;
- m_array = m_capacity ? new T [m_capacity] : 0;
- }
- }
-
- //------------------------------------------------------------------------
- template<class T>
- void pod_array<T>::resize(unsigned new_size)
- {
- if(new_size > m_size)
- {
- if(new_size > m_capacity)
- {
- T* data = new T[new_size];
- memcpy(data, m_array, m_size * sizeof(T));
- delete [] m_array;
- m_array = data;
- }
- }
- else
- {
- m_size = new_size;
- }
- }
-
- //------------------------------------------------------------------------
- template<class T> pod_array<T>::pod_array(unsigned cap, unsigned extra_tail) :
- m_size(cap), m_capacity(cap + extra_tail), m_array(new T[m_capacity]) {}
-
- //------------------------------------------------------------------------
- template<class T> pod_array<T>::pod_array(const pod_array<T>& v) :
- m_size(v.m_size),
- m_capacity(v.m_capacity),
- m_array(v.m_capacity ? new T [v.m_capacity] : 0)
- {
- memcpy(m_array, v.m_array, sizeof(T) * v.m_size);
- }
-
- //------------------------------------------------------------------------
- template<class T> const pod_array<T>&
- pod_array<T>::operator = (const pod_array<T>&v)
- {
- capacity(v.m_capacity);
- if(v.m_size) memcpy(m_array, v.m_array, sizeof(T) * v.m_size);
- return *this;
- }
-
- //------------------------------------------------------------------------
- template<class T> void pod_array<T>::serialize(int8u* ptr) const
- {
- if(m_size) memcpy(ptr, m_array, m_size * sizeof(T));
- }
-
- //------------------------------------------------------------------------
- template<class T>
- void pod_array<T>::deserialize(const int8u* data, unsigned _byte_size)
- {
- _byte_size /= sizeof(T);
- capacity(_byte_size);
- if(_byte_size) memcpy(m_array, data, _byte_size * sizeof(T));
- }
-
-
-
-
-
- //---------------------------------------------------------------pod_deque
- // A simple class template to store Plain Old Data, similar to std::deque
- // It doesn't reallocate memory but instead, uses blocks of data of size
- // of (1 << S), that is, power of two. The data is NOT contiguous in memory,
- // so the only valid access method is operator [] or curr(), prev(), next()
- //
- // There reallocs occure only when the pool of pointers to blocks needs
- // to be extended (it happens very rarely). You can control the value
- // of increment to reallocate the pointer buffer. See the second constructor.
- // By default, the incremeent value equals (1 << S), i.e., the block size.
- //------------------------------------------------------------------------
- template<class T, unsigned S=6> class pod_deque
- {
- public:
- enum
- {
- block_shift = S,
- block_size = 1 << block_shift,
- block_mask = block_size - 1
- };
-
- typedef T value_type;
-
- ~pod_deque();
- pod_deque();
- pod_deque(unsigned block_ptr_inc);
-
- // Copying
- pod_deque(const pod_deque<T, S>& v);
- const pod_deque<T, S>& operator = (const pod_deque<T, S>& v);
-
- void remove_all() { m_size = 0; }
- void free_all() { free_tail(0); }
- void free_tail(unsigned size);
- void add(const T& val);
- void modify_last(const T& val);
- void remove_last();
-
- int allocate_continuous_block(unsigned num_elements);
-
- void add_array(const T* ptr, unsigned num_elem)
- {
- while(num_elem--)
- {
- add(*ptr++);
- }
- }
-
- template<class DataAccessor> void add_data(DataAccessor& data)
- {
- while(data.size())
- {
- add(*data);
- ++data;
- }
- }
-
- void cut_at(unsigned _size)
- {
- if(_size < m_size) m_size = _size;
- }
-
- unsigned size() const { return m_size; }
-
- const T& operator [] (unsigned idx) const
- {
- return m_blocks[idx >> block_shift][idx & block_mask];
- }
-
- T& operator [] (unsigned idx)
- {
- return m_blocks[idx >> block_shift][idx & block_mask];
- }
-
- const T& curr(unsigned idx) const
- {
- return (*this)[idx];
- }
-
- T& curr(unsigned idx)
- {
- return (*this)[idx];
- }
-
- const T& prev(unsigned idx) const
- {
- return (*this)[(idx + m_size - 1) % m_size];
- }
-
- T& prev(unsigned idx)
- {
- return (*this)[(idx + m_size - 1) % m_size];
- }
-
- const T& next(unsigned idx) const
- {
- return (*this)[(idx + 1) % m_size];
- }
-
- T& next(unsigned idx)
- {
- return (*this)[(idx + 1) % m_size];
- }
-
- const T& last() const
- {
- return (*this)[m_size - 1];
- }
-
- T& last()
- {
- return (*this)[m_size - 1];
- }
-
- unsigned byte_size() const;
- void serialize(int8u* ptr) const;
- void deserialize(const int8u* data, unsigned byte_size);
- void deserialize(unsigned start, const T& empty_val,
- const int8u* data, unsigned byte_size);
-
- template<class ByteAccessor>
- void deserialize(ByteAccessor data)
- {
- remove_all();
- unsigned elem_size = data.size() / sizeof(T);
-
- for(unsigned i = 0; i < elem_size; ++i)
- {
- int8u* ptr = (int8u*)data_ptr();
- for(unsigned j = 0; j < sizeof(T); ++j)
- {
- *ptr++ = *data;
- ++data;
- }
- ++m_size;
- }
- }
-
- template<class ByteAccessor>
- void deserialize(unsigned start, const T& empty_val, ByteAccessor data)
- {
- while(m_size < start)
- {
- add(empty_val);
- }
-
- unsigned elem_size = data.size() / sizeof(T);
- for(unsigned i = 0; i < elem_size; ++i)
- {
- int8u* ptr;
- if(start + i < m_size)
- {
- ptr = (int8u*)(&((*this)[start + i]));
- }
- else
- {
- ptr = (int8u*)data_ptr();
- ++m_size;
- }
- for(unsigned j = 0; j < sizeof(T); ++j)
- {
- *ptr++ = *data;
- ++data;
- }
- }
- }
-
- const T* block(unsigned nb) const { return m_blocks[nb]; }
-
- private:
- void allocate_block(unsigned nb);
- T* data_ptr();
-
- unsigned m_size;
- unsigned m_num_blocks;
- unsigned m_max_blocks;
- T** m_blocks;
- unsigned m_block_ptr_inc;
- };
-
-
- //------------------------------------------------------------------------
- template<class T, unsigned S> pod_deque<T, S>::~pod_deque()
- {
- if(m_num_blocks)
- {
- T** blk = m_blocks + m_num_blocks - 1;
- while(m_num_blocks--)
- {
- delete [] *blk;
- --blk;
- }
- delete [] m_blocks;
- }
- }
-
-
- //------------------------------------------------------------------------
- template<class T, unsigned S>
- void pod_deque<T, S>::free_tail(unsigned _size)
- {
- if(_size < m_size)
- {
- unsigned nb = (_size + block_mask) >> block_shift;
- while(m_num_blocks > nb)
- {
- delete [] m_blocks[--m_num_blocks];
- }
- m_size = _size;
- }
- }
-
-
- //------------------------------------------------------------------------
- template<class T, unsigned S> pod_deque<T, S>::pod_deque() :
- m_size(0),
- m_num_blocks(0),
- m_max_blocks(0),
- m_blocks(0),
- m_block_ptr_inc(block_size)
- {
- }
-
-
- //------------------------------------------------------------------------
- template<class T, unsigned S>
- pod_deque<T, S>::pod_deque(unsigned block_ptr_inc) :
- m_size(0),
- m_num_blocks(0),
- m_max_blocks(0),
- m_blocks(0),
- m_block_ptr_inc(block_ptr_inc)
- {
- }
-
-
- //------------------------------------------------------------------------
- template<class T, unsigned S>
- pod_deque<T, S>::pod_deque(const pod_deque<T, S>& v) :
- m_size(v.m_size),
- m_num_blocks(v.m_num_blocks),
- m_max_blocks(v.m_max_blocks),
- m_blocks(v.m_max_blocks ? new T* [v.m_max_blocks] : 0),
- m_block_ptr_inc(v.m_block_ptr_inc)
- {
- unsigned i;
- for(i = 0; i < v.m_num_blocks; ++i)
- {
- m_blocks[i] = new T [block_size];
- memcpy(m_blocks[i], v.m_blocks[i], block_size * sizeof(T));
- }
- }
-
-
- //------------------------------------------------------------------------
- template<class T, unsigned S>
- const pod_deque<T, S>& pod_deque<T, S>::operator = (const pod_deque<T, S>& v)
- {
- unsigned i;
- for(i = m_num_blocks; i < v.m_num_blocks; ++i)
- {
- allocate_block(i);
- }
- for(i = 0; i < v.m_num_blocks; ++i)
- {
- memcpy(m_blocks[i], v.m_blocks[i], block_size * sizeof(T));
- }
- m_size = v.m_size;
- return *this;
- }
-
-
- //------------------------------------------------------------------------
- template<class T, unsigned S>
- void pod_deque<T, S>::allocate_block(unsigned nb)
- {
- if(nb >= m_max_blocks)
- {
- T** new_blocks = new T* [m_max_blocks + m_block_ptr_inc];
-
- if(m_blocks)
- {
- memcpy(new_blocks,
- m_blocks,
- m_num_blocks * sizeof(T*));
-
- delete [] m_blocks;
- }
- m_blocks = new_blocks;
- m_max_blocks += m_block_ptr_inc;
- }
- m_blocks[nb] = new T [block_size];
- m_num_blocks++;
- }
-
-
-
- //------------------------------------------------------------------------
- template<class T, unsigned S>
- inline T* pod_deque<T, S>::data_ptr()
- {
- unsigned nb = m_size >> block_shift;
- if(nb >= m_num_blocks)
- {
- allocate_block(nb);
- }
- return m_blocks[nb] + (m_size & block_mask);
- }
-
-
-
- //------------------------------------------------------------------------
- template<class T, unsigned S>
- inline void pod_deque<T, S>::add(const T& val)
- {
- *data_ptr() = val;
- ++m_size;
- }
-
-
- //------------------------------------------------------------------------
- template<class T, unsigned S>
- inline void pod_deque<T, S>::remove_last()
- {
- if(m_size) --m_size;
- }
-
-
- //------------------------------------------------------------------------
- template<class T, unsigned S>
- void pod_deque<T, S>::modify_last(const T& val)
- {
- remove_last();
- add(val);
- }
-
-
- //------------------------------------------------------------------------
- template<class T, unsigned S>
- int pod_deque<T, S>::allocate_continuous_block(unsigned num_elements)
- {
- if(num_elements < block_size)
- {
- data_ptr(); // Allocate initial block if necessary
- unsigned rest = block_size - (m_size & block_mask);
- unsigned index;
- if(num_elements <= rest)
- {
- // The rest of the block is good, we can use it
- //-----------------
- index = m_size;
- m_size += num_elements;
- return index;
- }
-
- // New block
- //---------------
- m_size += rest;
- data_ptr();
- index = m_size;
- m_size += num_elements;
- return index;
- }
- return -1; // Impossible to allocate
- }
-
-
- //------------------------------------------------------------------------
- template<class T, unsigned S>
- unsigned pod_deque<T, S>::byte_size() const
- {
- return m_size * sizeof(T);
- }
-
-
- //------------------------------------------------------------------------
- template<class T, unsigned S>
- void pod_deque<T, S>::serialize(int8u* ptr) const
- {
- unsigned i;
- for(i = 0; i < m_size; i++)
- {
- memcpy(ptr, &(*this)[i], sizeof(T));
- ptr += sizeof(T);
- }
- }
-
- //------------------------------------------------------------------------
- template<class T, unsigned S>
- void pod_deque<T, S>::deserialize(const int8u* data, unsigned _byte_size)
- {
- remove_all();
- _byte_size /= sizeof(T);
- for(unsigned i = 0; i < _byte_size; ++i)
- {
- T* ptr = data_ptr();
- memcpy(ptr, data, sizeof(T));
- ++m_size;
- data += sizeof(T);
- }
- }
-
-
- // Replace or add a number of elements starting from "start" position
- //------------------------------------------------------------------------
- template<class T, unsigned S>
- void pod_deque<T, S>::deserialize(unsigned start, const T& empty_val,
- const int8u* data, unsigned _byte_size)
- {
- while(m_size < start)
- {
- add(empty_val);
- }
-
- _byte_size /= sizeof(T);
- for(unsigned i = 0; i < _byte_size; ++i)
- {
- if(start + i < m_size)
- {
- memcpy(&((*this)[start + i]), data, sizeof(T));
- }
- else
- {
- T* ptr = data_ptr();
- memcpy(ptr, data, sizeof(T));
- ++m_size;
- }
- data += sizeof(T);
- }
- }
-
-
- //-----------------------------------------------------------pod_allocator
- // Allocator for arbitrary POD data. Most usable in different cache
- // systems for efficient memory allocations.
- // Memory is allocated with blocks of fixed size ("block_size" in
- // the constructor). If required size exceeds the block size the allocator
- // creates a new block of the required size. However, the most efficient
- // use is when the average reqired size is much less than the block size.
- //------------------------------------------------------------------------
- class pod_allocator
- {
- public:
- void remove_all()
- {
- if(m_num_blocks)
- {
- int8u** blk = m_blocks + m_num_blocks - 1;
- while(m_num_blocks--)
- {
- delete [] *blk;
- --blk;
- }
- delete [] m_blocks;
- }
- m_num_blocks = 0;
- m_max_blocks = 0;
- m_blocks = 0;
- m_buf_ptr = 0;
- m_rest = 0;
- }
-
- ~pod_allocator()
- {
- remove_all();
- }
-
- pod_allocator(unsigned block_size, unsigned block_ptr_inc=256-8) :
- m_block_size(block_size),
- m_block_ptr_inc(block_ptr_inc),
- m_num_blocks(0),
- m_max_blocks(0),
- m_blocks(0),
- m_buf_ptr(0),
- m_rest(0)
- {
- }
-
-
- int8u* allocate(unsigned size, unsigned alignment=1)
- {
- if(size == 0) return 0;
- if(size <= m_rest)
- {
- int8u* ptr = m_buf_ptr;
- if(alignment > 1)
- {
- unsigned align = (alignment - unsigned((size_t)ptr) % alignment) % alignment;
- size += align;
- ptr += align;
- if(size <= m_rest)
- {
- m_rest -= size;
- m_buf_ptr += size;
- return ptr;
- }
- allocate_block(size);
- return allocate(size - align, alignment);
- }
- m_rest -= size;
- m_buf_ptr += size;
- return ptr;
- }
- allocate_block(size + alignment - 1);
- return allocate(size, alignment);
- }
-
-
- private:
- void allocate_block(unsigned size)
- {
- if(size < m_block_size) size = m_block_size;
- if(m_num_blocks >= m_max_blocks)
- {
- int8u** new_blocks = new int8u* [m_max_blocks + m_block_ptr_inc];
-
- if(m_blocks)
- {
- memcpy(new_blocks,
- m_blocks,
- m_num_blocks * sizeof(int8u*));
-
- delete [] m_blocks;
- }
- m_blocks = new_blocks;
- m_max_blocks += m_block_ptr_inc;
- }
- m_blocks[m_num_blocks] = m_buf_ptr = new int8u [size];
- m_num_blocks++;
- m_rest = size;
- }
-
- unsigned m_block_size;
- unsigned m_block_ptr_inc;
- unsigned m_num_blocks;
- unsigned m_max_blocks;
- int8u** m_blocks;
- int8u* m_buf_ptr;
- unsigned m_rest;
- };
-
-
-
-
-
-
-
-
- //------------------------------------------------------------------------
- enum
- {
- quick_sort_threshold = 9
- };
-
-
- //-----------------------------------------------------------swap_elements
- template<class T> inline void swap_elements(T& a, T& b)
- {
- T temp = a;
- a = b;
- b = temp;
- }
-
-
- //--------------------------------------------------------------quick_sort
- template<class Array, class Less>
- void quick_sort(Array& arr, Less less)
- {
- if(arr.size() < 2) return;
-
- typename Array::value_type* e1;
- typename Array::value_type* e2;
-
- int stack[80];
- int* top = stack;
- int limit = arr.size();
- int base = 0;
-
- for(;;)
- {
- int len = limit - base;
-
- int i;
- int j;
- int pivot;
-
- if(len > quick_sort_threshold)
- {
- // we use base + len/2 as the pivot
- pivot = base + len / 2;
- swap_elements(arr[base], arr[pivot]);
-
- i = base + 1;
- j = limit - 1;
-
- // now ensure that *i <= *base <= *j
- e1 = &(arr[j]);
- e2 = &(arr[i]);
- if(less(*e1, *e2)) swap_elements(*e1, *e2);
-
- e1 = &(arr[base]);
- e2 = &(arr[i]);
- if(less(*e1, *e2)) swap_elements(*e1, *e2);
-
- e1 = &(arr[j]);
- e2 = &(arr[base]);
- if(less(*e1, *e2)) swap_elements(*e1, *e2);
-
- for(;;)
- {
- do i++; while( less(arr[i], arr[base]) );
- do j--; while( less(arr[base], arr[j]) );
-
- if( i > j )
- {
- break;
- }
-
- swap_elements(arr[i], arr[j]);
- }
-
- swap_elements(arr[base], arr[j]);
-
- // now, push the largest sub-array
- if(j - base > limit - i)
- {
- top[0] = base;
- top[1] = j;
- base = i;
- }
- else
- {
- top[0] = i;
- top[1] = limit;
- limit = j;
- }
- top += 2;
- }
- else
- {
- // the sub-array is small, perform insertion sort
- j = base;
- i = j + 1;
-
- for(; i < limit; j = i, i++)
- {
- for(; less(*(e1 = &(arr[j + 1])), *(e2 = &(arr[j]))); j--)
- {
- swap_elements(*e1, *e2);
- if(j == base)
- {
- break;
- }
- }
- }
- if(top > stack)
- {
- top -= 2;
- base = top[0];
- limit = top[1];
- }
- else
- {
- break;
- }
- }
- }
- }
-
-
-
-
- //------------------------------------------------------remove_duplicates
- // Remove duplicates from a sorted array. It doesn't cut the the
- // tail of the array, it just returns the number of remaining elements.
- //-----------------------------------------------------------------------
- template<class Array, class Equal>
- unsigned remove_duplicates(Array& arr, Equal equal)
- {
- if(arr.size() < 2) return arr.size();
-
- unsigned i, j;
- for(i = 1, j = 1; i < arr.size(); i++)
- {
- typename Array::value_type& e = arr[i];
- if(!equal(e, arr[i - 1]))
- {
- arr[j++] = e;
- }
- }
- return j;
- }
-
-
-
-
-}
-
-#endif
diff --git a/agg/inc/agg_arrowhead.h b/agg/inc/agg_arrowhead.h
deleted file mode 100755
index e10fc3e..0000000
--- a/agg/inc/agg_arrowhead.h
+++ /dev/null
@@ -1,82 +0,0 @@
-//----------------------------------------------------------------------------
-// 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.
-// This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
-//
-//----------------------------------------------------------------------------
-// Contact: mcseem at antigrain.com
-// mcseemagg at yahoo.com
-// http://www.antigrain.com
-//----------------------------------------------------------------------------
-//
-// Simple arrowhead/arrowtail generator
-//
-//----------------------------------------------------------------------------
-#ifndef AGG_ARROWHEAD_INCLUDED
-#define AGG_ARROWHEAD_INCLUDED
-
-#include "agg_basics.h"
-
-namespace agg
-{
-
- //===============================================================arrowhead
- //
- // See implementation agg_arrowhead.cpp
- //
- class arrowhead
- {
- public:
- arrowhead();
-
- void head(double d1, double d2, double d3, double d4)
- {
- m_head_d1 = d1;
- m_head_d2 = d2;
- m_head_d3 = d3;
- m_head_d4 = d4;
- m_head_flag = true;
- }
-
- void head() { m_head_flag = true; }
- void no_head() { m_head_flag = false; }
-
- void tail(double d1, double d2, double d3, double d4)
- {
- m_tail_d1 = d1;
- m_tail_d2 = d2;
- m_tail_d3 = d3;
- m_tail_d4 = d4;
- m_tail_flag = true;
- }
-
- void tail() { m_tail_flag = true; }
- void no_tail() { m_tail_flag = false; }
-
- void rewind(unsigned id);
- unsigned vertex(double* x, double* y);
-
- private:
- double m_head_d1;
- double m_head_d2;
- double m_head_d3;
- double m_head_d4;
- double m_tail_d1;
- double m_tail_d2;
- double m_tail_d3;
- double m_tail_d4;
- bool m_head_flag;
- bool m_tail_flag;
- double m_coord[16];
- unsigned m_cmd[8];
- unsigned m_curr_id;
- unsigned m_curr_coord;
- };
-
-}
-
-#endif
diff --git a/agg/inc/agg_basics.h b/agg/inc/agg_basics.h
deleted file mode 100755
index 23b2cdc..0000000
--- a/agg/inc/agg_basics.h
+++ /dev/null
@@ -1,343 +0,0 @@
-//----------------------------------------------------------------------------
-// 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.
-// This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
-//
-//----------------------------------------------------------------------------
-// Contact: mcseem at antigrain.com
-// mcseemagg at yahoo.com
-// http://www.antigrain.com
-//----------------------------------------------------------------------------
-
-#ifndef AGG_BASICS_INCLUDED
-#define AGG_BASICS_INCLUDED
-
-#include "agg_config.h"
-
-//-------------------------------------------------------- Default basic types
-//
-// If the compiler has different capacity of the basic types you can redefine
-// them via the compiler command line or by generating agg_config.h that is
-// empty by default.
-//
-#ifndef AGG_INT8
-#define AGG_INT8 signed char
-#endif
-
-#ifndef AGG_INT8U
-#define AGG_INT8U unsigned char
-#endif
-
-#ifndef AGG_INT16
-#define AGG_INT16 short
-#endif
-
-#ifndef AGG_INT16U
-#define AGG_INT16U unsigned short
-#endif
-
-#ifndef AGG_INT32
-#define AGG_INT32 int
-#endif
-
-#ifndef AGG_INT32U
-#define AGG_INT32U unsigned
-#endif
-
-#ifndef AGG_INT64
-#if defined(_MSC_VER)
-#define AGG_INT64 signed __int64
-#else
-#define AGG_INT64 signed long long
-#endif
-#endif
-
-#ifndef AGG_INT64U
-#if defined(_MSC_VER)
-#define AGG_INT64U unsigned __int64
-#else
-#define AGG_INT64U unsigned long long
-#endif
-#endif
-
-//------------------------------------------------ Some fixes for MS Visual C++
-#if defined(_MSC_VER)
-#pragma warning(disable:4786) // Identifier was truncated...
-#endif
-
-#if defined(_MSC_VER)
-#define AGG_INLINE __forceinline
-#else
-#define AGG_INLINE inline
-#endif
-
-namespace agg
-{
- //-------------------------------------------------------------------------
- typedef AGG_INT8 int8; //----int8
- typedef AGG_INT8U int8u; //----int8u
- typedef AGG_INT16 int16; //----int16
- typedef AGG_INT16U int16u; //----int16u
- typedef AGG_INT32 int32; //----int32
- typedef AGG_INT32U int32u; //----int32u
- typedef AGG_INT64 int64; //----int64
- typedef AGG_INT64U int64u; //----int64u
-
- //-------------------------------------------------------------------------
- typedef unsigned char cover_type; //----cover_type
- enum
- {
- cover_shift = 8, //----cover_shift
- cover_size = 1 << cover_shift, //----cover_size
- cover_mask = cover_size - 1, //----cover_mask
- cover_none = 0, //----cover_none
- cover_full = cover_mask //----cover_full
- };
-
-
- //-----------------------------------------------------------------------pi
- const double pi = 3.14159265358979323846;
-
- //------------------------------------------------------------------deg2rad
- inline double deg2rad(double deg)
- {
- return deg * pi / 180.0;
- }
-
- //------------------------------------------------------------------rad2deg
- inline double rad2deg(double rad)
- {
- return rad * 180.0 / pi;
- }
-
- //----------------------------------------------------------------rect_base
- template<class T> struct rect_base
- {
- typedef rect_base<T> self_type;
- T x1;
- T y1;
- T x2;
- T y2;
-
- rect_base() {}
- rect_base(T x1_, T y1_, T x2_, T y2_) :
- x1(x1_), y1(y1_), x2(x2_), y2(y2_) {}
-
- const self_type& normalize()
- {
- T t;
- if(x1 > x2) { t = x1; x1 = x2; x2 = t; }
- if(y1 > y2) { t = y1; y1 = y2; y2 = t; }
- return *this;
- }
-
- bool clip(const self_type& r)
- {
- if(x2 > r.x2) x2 = r.x2;
- if(y2 > r.y2) y2 = r.y2;
- if(x1 < r.x1) x1 = r.x1;
- if(y1 < r.y1) y1 = r.y1;
- return x1 <= x2 && y1 <= y2;
- }
-
- bool is_valid() const
- {
- return x1 <= x2 && y1 <= y2;
- }
- };
-
- //-----------------------------------------------------intersect_rectangles
- template<class Rect>
- inline Rect intersect_rectangles(const Rect& r1, const Rect& r2)
- {
- Rect r = r1;
-
- // First process x2,y2 because the other order
- // results in Internal Compiler Error under
- // Microsoft Visual C++ .NET 2003 69462-335-0000007-18038 in
- // case of "Maximize Speed" optimization option.
- //-----------------
- if(r.x2 > r2.x2) r.x2 = r2.x2;
- if(r.y2 > r2.y2) r.y2 = r2.y2;
- if(r.x1 < r2.x1) r.x1 = r2.x1;
- if(r.y1 < r2.y1) r.y1 = r2.y1;
- return r;
- }
-
-
- //---------------------------------------------------------unite_rectangles
- template<class Rect>
- inline Rect unite_rectangles(const Rect& r1, const Rect& r2)
- {
- Rect r = r1;
- if(r.x2 < r2.x2) r.x2 = r2.x2;
- if(r.y2 < r2.y2) r.y2 = r2.y2;
- if(r.x1 > r2.x1) r.x1 = r2.x1;
- if(r.y1 > r2.y1) r.y1 = r2.y1;
- return r;
- }
-
- typedef rect_base<int> rect; //----rect
- typedef rect_base<double> rect_d; //----rect_d
-
- //---------------------------------------------------------path_commands_e
- enum path_commands_e
- {
- path_cmd_stop = 0, //----path_cmd_stop
- path_cmd_move_to = 1, //----path_cmd_move_to
- path_cmd_line_to = 2, //----path_cmd_line_to
- path_cmd_curve3 = 3, //----path_cmd_curve3
- path_cmd_curve4 = 4, //----path_cmd_curve4
- path_cmd_end_poly = 6, //----path_cmd_end_poly
- path_cmd_mask = 0x0F //----path_cmd_mask
- };
-
- //------------------------------------------------------------path_flags_e
- enum path_flags_e
- {
- path_flags_none = 0, //----path_flags_none
- path_flags_ccw = 0x10, //----path_flags_ccw
- path_flags_cw = 0x20, //----path_flags_cw
- path_flags_close = 0x40, //----path_flags_close
- path_flags_mask = 0xF0 //----path_flags_mask
- };
-
- //---------------------------------------------------------------is_vertex
- inline bool is_vertex(unsigned c)
- {
- return c >= path_cmd_move_to && c < path_cmd_end_poly;
- }
-
- //-----------------------------------------------------------------is_stop
- inline bool is_stop(unsigned c)
- {
- return c == path_cmd_stop;
- }
-
- //--------------------------------------------------------------is_move_to
- inline bool is_move_to(unsigned c)
- {
- return c == path_cmd_move_to;
- }
-
- //--------------------------------------------------------------is_line_to
- inline bool is_line_to(unsigned c)
- {
- return c == path_cmd_line_to;
- }
-
- //----------------------------------------------------------------is_curve
- inline bool is_curve(unsigned c)
- {
- return c == path_cmd_curve3 || c == path_cmd_curve4;
- }
-
- //---------------------------------------------------------------is_curve3
- inline bool is_curve3(unsigned c)
- {
- return c == path_cmd_curve3;
- }
-
- //---------------------------------------------------------------is_curve4
- inline bool is_curve4(unsigned c)
- {
- return c == path_cmd_curve4;
- }
-
- //-------------------------------------------------------------is_end_poly
- inline bool is_end_poly(unsigned c)
- {
- return (c & path_cmd_mask) == path_cmd_end_poly;
- }
-
- //----------------------------------------------------------------is_close
- inline bool is_close(unsigned c)
- {
- return (c & ~(path_flags_cw | path_flags_ccw)) ==
- (((bool)path_cmd_end_poly) | ((bool)path_flags_close));
- }
-
- //------------------------------------------------------------is_next_poly
- inline bool is_next_poly(unsigned c)
- {
- return is_stop(c) || is_move_to(c) || is_end_poly(c);
- }
-
- //-------------------------------------------------------------------is_cw
- inline bool is_cw(unsigned c)
- {
- return (c & path_flags_cw) != 0;
- }
-
- //------------------------------------------------------------------is_ccw
- inline bool is_ccw(unsigned c)
- {
- return (c & path_flags_ccw) != 0;
- }
-
- //-------------------------------------------------------------is_oriented
- inline bool is_oriented(unsigned c)
- {
- return (c & (path_flags_cw | path_flags_ccw)) != 0;
- }
-
- //---------------------------------------------------------------is_closed
- inline bool is_closed(unsigned c)
- {
- return (c & path_flags_close) != 0;
- }
-
- //----------------------------------------------------------get_close_flag
- inline unsigned get_close_flag(unsigned c)
- {
- return c & path_flags_close;
- }
-
- //-------------------------------------------------------clear_orientation
- inline unsigned clear_orientation(unsigned c)
- {
- return c & ~(path_flags_cw | path_flags_ccw);
- }
-
- //---------------------------------------------------------get_orientation
- inline unsigned get_orientation(unsigned c)
- {
- return c & (path_flags_cw | path_flags_ccw);
- }
-
- //---------------------------------------------------------set_orientation
- inline unsigned set_orientation(unsigned c, unsigned o)
- {
- return clear_orientation(c) | o;
- }
-
- //--------------------------------------------------------------point_type
- struct point_type
- {
- double x, y;
-
- point_type() {}
- point_type(double x_, double y_) : x(x_), y(y_) {}
- };
-
- //-------------------------------------------------------------vertex_type
- struct vertex_type
- {
- double x, y;
- unsigned cmd;
-
- vertex_type() {}
- vertex_type(double x_, double y_, unsigned cmd_) :
- x(x_), y(y_), cmd(cmd_) {}
- };
-
-
-}
-
-
-#endif
-
diff --git a/agg/inc/agg_bezier_arc.h b/agg/inc/agg_bezier_arc.h
deleted file mode 100755
index fef6095..0000000
--- a/agg/inc/agg_bezier_arc.h
+++ /dev/null
@@ -1,158 +0,0 @@
-//----------------------------------------------------------------------------
-// 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.
-// This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
-//
-//----------------------------------------------------------------------------
-// Contact: mcseem at antigrain.com
-// mcseemagg at yahoo.com
-// http://www.antigrain.com
-//----------------------------------------------------------------------------
-//
-// Arc generator. Produces at most 4 consecutive cubic bezier curves, i.e.,
-// 4, 7, 10, or 13 vertices.
-//
-//----------------------------------------------------------------------------
-
-#ifndef AGG_BEZIER_ARC_INCLUDED
-#define AGG_BEZIER_ARC_INCLUDED
-
-#include "agg_conv_transform.h"
-
-namespace agg
-{
-
- //-----------------------------------------------------------------------
- void arc_to_bezier(double cx, double cy, double rx, double ry,
- double start_angle, double sweep_angle,
- double* curve);
-
-
- //==============================================================bezier_arc
- //
- // See implemantaion agg_bezier_arc.cpp
- //
- class bezier_arc
- {
- public:
- //--------------------------------------------------------------------
- bezier_arc() : m_vertex(26) {}
- bezier_arc(double x, double y,
- double rx, double ry,
- double start_angle,
- double sweep_angle)
- {
- init(x, y, rx, ry, start_angle, sweep_angle);
- }
-
- //--------------------------------------------------------------------
- void init(double x, double y,
- double rx, double ry,
- double start_angle,
- double sweep_angle);
-
- //--------------------------------------------------------------------
- void rewind(unsigned)
- {
- m_vertex = 0;
- }
-
- //--------------------------------------------------------------------
- unsigned vertex(double* x, double* y)
- {
- if(m_vertex >= m_num_vertices) return path_cmd_stop;
- *x = m_vertices[m_vertex];
- *y = m_vertices[m_vertex + 1];
- m_vertex += 2;
- return (m_vertex == 2) ? path_cmd_move_to : path_cmd_curve4;
- }
-
- // Supplemantary functions. num_vertices() actually returns doubled
- // number of vertices. That is, for 1 vertex it returns 2.
- //--------------------------------------------------------------------
- unsigned num_vertices() const { return m_num_vertices; }
- const double* vertices() const { return m_vertices; }
- double* vertices() { return m_vertices; }
-
- private:
- unsigned m_vertex;
- unsigned m_num_vertices;
- double m_vertices[26];
- };
-
-
-
- //==========================================================bezier_arc_svg
- // Compute an SVG-style bezier arc.
- //
- // Computes an elliptical arc from (x1, y1) to (x2, y2). The size and
- // orientation of the ellipse are defined by two radii (rx, ry)
- // and an x-axis-rotation, which indicates how the ellipse as a whole
- // is rotated relative to the current coordinate system. The center
- // (cx, cy) of the ellipse is calculated automatically to satisfy the
- // constraints imposed by the other parameters.
- // large-arc-flag and sweep-flag contribute to the automatic calculations
- // and help determine how the arc is drawn.
- class bezier_arc_svg
- {
- public:
- //--------------------------------------------------------------------
- bezier_arc_svg() : m_arc(), m_radii_ok(false) {}
-
- bezier_arc_svg(double x1, double y1,
- double rx, double ry,
- double angle,
- bool large_arc_flag,
- bool sweep_flag,
- double x2, double y2) :
- m_arc(), m_radii_ok(false)
- {
- init(x1, y1, rx, ry, angle, large_arc_flag, sweep_flag, x2, y2);
- }
-
- //--------------------------------------------------------------------
- void init(double x1, double y1,
- double rx, double ry,
- double angle,
- bool large_arc_flag,
- bool sweep_flag,
- double x2, double y2);
-
- //--------------------------------------------------------------------
- bool radii_ok() const { return m_radii_ok; }
-
- //--------------------------------------------------------------------
- void rewind(unsigned)
- {
- m_arc.rewind(0);
- }
-
- //--------------------------------------------------------------------
- unsigned vertex(double* x, double* y)
- {
- return m_arc.vertex(x, y);
- }
-
- // Supplemantary functions. num_vertices() actually returns doubled
- // number of vertices. That is, for 1 vertex it returns 2.
- //--------------------------------------------------------------------
- unsigned num_vertices() const { return m_arc.num_vertices(); }
- const double* vertices() const { return m_arc.vertices(); }
- double* vertices() { return m_arc.vertices(); }
-
- private:
- bezier_arc m_arc;
- bool m_radii_ok;
- };
-
-
-
-
-}
-
-
-#endif
diff --git a/agg/inc/agg_bitset_iterator.h b/agg/inc/agg_bitset_iterator.h
deleted file mode 100755
index 87680b4..0000000
--- a/agg/inc/agg_bitset_iterator.h
+++ /dev/null
@@ -1,54 +0,0 @@
-//----------------------------------------------------------------------------
-// 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.
-// This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
-//
-//----------------------------------------------------------------------------
-// Contact: mcseem at antigrain.com
-// mcseemagg at yahoo.com
-// http://www.antigrain.com
-//----------------------------------------------------------------------------
-
-#ifndef AGG_BITSET_ITERATOR_INCLUDED
-#define AGG_BITSET_ITERATOR_INCLUDED
-
-#include "agg_basics.h"
-
-namespace agg
-{
-
- class bitset_iterator
- {
- public:
- bitset_iterator(const int8u* bits, unsigned offset = 0) :
- m_bits(bits + (offset >> 3)),
- m_mask(0x80 >> (offset & 7))
- {}
-
- void operator ++ ()
- {
- m_mask >>= 1;
- if(m_mask == 0)
- {
- ++m_bits;
- m_mask = 0x80;
- }
- }
-
- unsigned bit() const
- {
- return (*m_bits) & m_mask;
- }
-
- private:
- const int8u* m_bits;
- int8u m_mask;
- };
-
-}
-
-#endif
diff --git a/agg/inc/agg_bounding_rect.h b/agg/inc/agg_bounding_rect.h
deleted file mode 100755
index 21ec603..0000000
--- a/agg/inc/agg_bounding_rect.h
+++ /dev/null
@@ -1,116 +0,0 @@
-//----------------------------------------------------------------------------
-// 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.
-// This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
-//
-//----------------------------------------------------------------------------
-// Contact: mcseem at antigrain.com
-// mcseemagg at yahoo.com
-// http://www.antigrain.com
-//----------------------------------------------------------------------------
-//
-// bounding_rect function template
-//
-//----------------------------------------------------------------------------
-#ifndef AGG_BOUNDING_RECT_INCLUDED
-#define AGG_BOUNDING_RECT_INCLUDED
-
-#include "agg_basics.h"
-
-namespace agg
-{
-
- //-----------------------------------------------------------bounding_rect
- template<class VertexSource, class GetId, class CoordT>
- bool bounding_rect(VertexSource& vs, GetId& gi,
- unsigned start, unsigned num,
- CoordT* x1, CoordT* y1, CoordT* x2, CoordT* y2)
- {
- unsigned i;
- double x;
- double y;
- bool first = true;
-
- *x1 = CoordT(1);
- *y1 = CoordT(1);
- *x2 = CoordT(0);
- *y2 = CoordT(0);
-
- for(i = 0; i < num; i++)
- {
- vs.rewind(gi[start + i]);
- unsigned cmd;
- while(!is_stop(cmd = vs.vertex(&x, &y)))
- {
- if(is_vertex(cmd))
- {
- if(first)
- {
- *x1 = CoordT(x);
- *y1 = CoordT(y);
- *x2 = CoordT(x);
- *y2 = CoordT(y);
- first = false;
- }
- else
- {
- if(CoordT(x) < *x1) *x1 = CoordT(x);
- if(CoordT(y) < *y1) *y1 = CoordT(y);
- if(CoordT(x) > *x2) *x2 = CoordT(x);
- if(CoordT(y) > *y2) *y2 = CoordT(y);
- }
- }
- }
- }
- return *x1 <= *x2 && *y1 <= *y2;
- }
-
-
- //-----------------------------------------------------bounding_rect_single
- template<class VertexSource, class CoordT>
- bool bounding_rect_single(VertexSource& vs, unsigned path_id,
- CoordT* x1, CoordT* y1, CoordT* x2, CoordT* y2)
- {
- double x;
- double y;
- bool first = true;
-
- *x1 = CoordT(1);
- *y1 = CoordT(1);
- *x2 = CoordT(0);
- *y2 = CoordT(0);
-
- vs.rewind(path_id);
- unsigned cmd;
- while(!is_stop(cmd = vs.vertex(&x, &y)))
- {
- if(is_vertex(cmd))
- {
- if(first)
- {
- *x1 = CoordT(x);
- *y1 = CoordT(y);
- *x2 = CoordT(x);
- *y2 = CoordT(y);
- first = false;
- }
- else
- {
- if(CoordT(x) < *x1) *x1 = CoordT(x);
- if(CoordT(y) < *y1) *y1 = CoordT(y);
- if(CoordT(x) > *x2) *x2 = CoordT(x);
- if(CoordT(y) > *y2) *y2 = CoordT(y);
- }
- }
- }
- return *x1 <= *x2 && *y1 <= *y2;
- }
-
-
-}
-
-#endif
diff --git a/agg/inc/agg_bspline.h b/agg/inc/agg_bspline.h
deleted file mode 100755
index db914e2..0000000
--- a/agg/inc/agg_bspline.h
+++ /dev/null
@@ -1,77 +0,0 @@
-//----------------------------------------------------------------------------
-// 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.
-// This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
-//
-//----------------------------------------------------------------------------
-// Contact: mcseem at antigrain.com
-// mcseemagg at yahoo.com
-// http://www.antigrain.com
-//----------------------------------------------------------------------------
-//
-// class bspline
-//
-//----------------------------------------------------------------------------
-
-#ifndef AGG_BSPLINE_INCLUDED
-#define AGG_BSPLINE_INCLUDED
-
-#include "agg_basics.h"
-
-namespace agg
-{
- //----------------------------------------------------------------bspline
- // A very simple class of Bi-cubic Spline interpolation.
- // First call init(num, x[], y[]) where num - number of source points,
- // x, y - arrays of X and Y values respectively. Here Y must be a function
- // of X. It means that all the X-coordinates must be arranged in the ascending
- // order.
- // Then call get(x) that calculates a value Y for the respective X.
- // The class supports extrapolation, i.e. you can call get(x) where x is
- // outside the given with init() X-range. Extrapolation is a simple linear
- // function.
- //
- // See Implementation agg_bspline.cpp
- //------------------------------------------------------------------------
- class bspline
- {
- public:
- ~bspline();
- bspline();
- bspline(int num);
- bspline(int num, const double* x, const double* y);
-
- void init(int num);
- void add_point(double x, double y);
- void prepare();
-
- void init(int num, const double* x, const double* y);
-
- double get(double x) const;
- double get_stateful(double x) const;
-
- private:
- bspline(const bspline&);
- const bspline& operator = (const bspline&);
-
- static void bsearch(int n, const double *x, double x0, int *i);
- double extrapolation_left(double x) const;
- double extrapolation_right(double x) const;
- double interpolation(double x, int i) const;
-
- int m_max;
- int m_num;
- double* m_x;
- double* m_y;
- double* m_am;
- mutable int m_last_idx;
- };
-
-
-}
-
-#endif
diff --git a/agg/inc/agg_clip_liang_barsky.h b/agg/inc/agg_clip_liang_barsky.h
deleted file mode 100755
index 5f185da..0000000
--- a/agg/inc/agg_clip_liang_barsky.h
+++ /dev/null
@@ -1,209 +0,0 @@
-//----------------------------------------------------------------------------
-// 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.
-// This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
-//
-//----------------------------------------------------------------------------
-// Contact: mcseem at antigrain.com
-// mcseemagg at yahoo.com
-// http://www.antigrain.com
-//----------------------------------------------------------------------------
-//
-// Liang-Barsky clipping
-//
-//----------------------------------------------------------------------------
-#ifndef AGG_CLIP_LIANG_BARSKY_INCLUDED
-#define AGG_CLIP_LIANG_BARSKY_INCLUDED
-
-#include "agg_basics.h"
-
-namespace agg
-{
-
- //----------------------------------------------------------clipping_flags
- // Determine the clipping code of the vertex according to the
- // Cyrus-Beck line clipping algorithm
- //
- // | |
- // 0110 | 0010 | 0011
- // | |
- // -------+--------+-------- clip_box.y2
- // | |
- // 0100 | 0000 | 0001
- // | |
- // -------+--------+-------- clip_box.y1
- // | |
- // 1100 | 1000 | 1001
- // | |
- // clip_box.x1 clip_box.x2
- //
- //
- template<class T>
- inline unsigned clipping_flags(T x, T y, const rect_base<T>& clip_box)
- {
- return (x > clip_box.x2) |
- ((y > clip_box.y2) << 1) |
- ((x < clip_box.x1) << 2) |
- ((y < clip_box.y1) << 3);
- }
-
-
-
- //-------------------------------------------------------clip_liang_barsky
- template<class T>
- /*inline*/ unsigned clip_liang_barsky(T x1, T y1, T x2, T y2,
- const rect_base<T>& clip_box,
- T* x, T* y)
- {
- const double nearzero = 1e-30;
-
- double deltax = x2 - x1;
- double deltay = y2 - y1;
- double xin;
- double xout;
- double yin;
- double yout;
- double tinx;
- double tiny;
- double toutx;
- double touty;
- double tin1;
- double tin2;
- double tout1;
- unsigned np = 0;
-
- if(deltax == 0.0)
- {
- // bump off of the vertical
- deltax = (x1 > clip_box.x1) ? -nearzero : nearzero;
- }
-
- if(deltay == 0.0)
- {
- // bump off of the horizontal
- deltay = (y1 > clip_box.y1) ? -nearzero : nearzero;
- }
-
- if(deltax > 0.0)
- {
- // points to right
- xin = clip_box.x1;
- xout = clip_box.x2;
- }
- else
- {
- xin = clip_box.x2;
- xout = clip_box.x1;
- }
-
- if(deltay > 0.0)
- {
- // points up
- yin = clip_box.y1;
- yout = clip_box.y2;
- }
- else
- {
- yin = clip_box.y2;
- yout = clip_box.y1;
- }
-
- tinx = (xin - x1) / deltax;
- tiny = (yin - y1) / deltay;
-
- if (tinx < tiny)
- {
- // hits x first
- tin1 = tinx;
- tin2 = tiny;
- }
- else
- {
- // hits y first
- tin1 = tiny;
- tin2 = tinx;
- }
-
- if(tin1 <= 1.0)
- {
- if(0.0 < tin1)
- {
- *x++ = (T)xin;
- *y++ = (T)yin;
- ++np;
- }
-
- if(tin2 <= 1.0)
- {
- toutx = (xout - x1) / deltax;
- touty = (yout - y1) / deltay;
-
- tout1 = (toutx < touty) ? toutx : touty;
-
- if(tin2 > 0.0 || tout1 > 0.0)
- {
- if(tin2 <= tout1)
- {
- if(tin2 > 0.0)
- {
- if(tinx > tiny)
- {
- *x++ = (T)xin;
- *y++ = (T)(y1 + tinx * deltay);
- }
- else
- {
- *x++ = (T)(x1 + tiny * deltax);
- *y++ = (T)yin;
- }
- ++np;
- }
-
- if(tout1 < 1.0)
- {
- if(toutx < touty)
- {
- *x++ = (T)xout;
- *y++ = (T)(y1 + toutx * deltay);
- }
- else
- {
- *x++ = (T)(x1 + touty * deltax);
- *y++ = (T)yout;
- }
- }
- else
- {
- *x++ = x2;
- *y++ = y2;
- }
- ++np;
- }
- else
- {
- if(tinx > tiny)
- {
- *x++ = (T)xin;
- *y++ = (T)yout;
- }
- else
- {
- *x++ = (T)xout;
- *y++ = (T)yin;
- }
- ++np;
- }
- }
- }
- }
- return np;
- }
-
-
-}
-
-#endif
diff --git a/agg/inc/agg_color_gray.h b/agg/inc/agg_color_gray.h
deleted file mode 100755
index 6196177..0000000
--- a/agg/inc/agg_color_gray.h
+++ /dev/null
@@ -1,364 +0,0 @@
-//----------------------------------------------------------------------------
-// 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.
-// This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
-//
-//----------------------------------------------------------------------------
-// Contact: mcseem at antigrain.com
-// mcseemagg at yahoo.com
-// http://www.antigrain.com
-//----------------------------------------------------------------------------
-//
-// 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.
-//
-//----------------------------------------------------------------------------
-//
-// color types gray8, gray16
-//
-//----------------------------------------------------------------------------
-
-#ifndef AGG_COLOR_GRAY_INCLUDED
-#define AGG_COLOR_GRAY_INCLUDED
-
-#include "agg_basics.h"
-#include "agg_color_rgba.h"
-
-namespace agg
-{
-
- //===================================================================gray8
- struct gray8
- {
- typedef int8u value_type;
- typedef int32u calc_type;
- typedef int32 long_type;
- enum
- {
- base_shift = 8,
- base_size = 1 << base_shift,
- base_mask = base_size - 1
- };
- typedef gray8 self_type;
-
- value_type v;
- value_type a;
-
- //--------------------------------------------------------------------
- gray8() {}
-
- //--------------------------------------------------------------------
- gray8(unsigned v_, unsigned a_=base_mask) :
- v(int8u(v_)), a(int8u(a_)) {}
-
- //--------------------------------------------------------------------
- gray8(const self_type& c, unsigned a_) :
- v(c.v), a(value_type(a_)) {}
-
- //--------------------------------------------------------------------
- gray8(const rgba& c) :
- v(value_type((0.299*c.r + 0.587*c.g + 0.114*c.b) * double(base_mask) + 0.5)),
- a(value_type(c.a * double(base_mask))) {}
-
- //--------------------------------------------------------------------
- gray8(const rgba& c, double a_) :
- v(value_type((0.299*c.r + 0.587*c.g + 0.114*c.b) * double(base_mask) + 0.5)),
- a(value_type(a_ * double(base_mask))) {}
-
- //--------------------------------------------------------------------
- gray8(const rgba8& c) :
- v((c.r*77 + c.g*150 + c.b*29) >> 8),
- a(c.a) {}
-
- //--------------------------------------------------------------------
- gray8(const rgba8& c, unsigned a_) :
- v((c.r*77 + c.g*150 + c.b*29) >> 8),
- a(a_) {}
-
- //--------------------------------------------------------------------
- void clear()
- {
- v = a = 0;
- }
-
- //--------------------------------------------------------------------
- const self_type& transparent()
- {
- a = 0;
- return *this;
- }
-
- //--------------------------------------------------------------------
- void opacity(double a_)
- {
- if(a_ < 0.0) a_ = 0.0;
- if(a_ > 1.0) a_ = 1.0;
- a = value_type(a_ * double(base_mask));
- }
-
- //--------------------------------------------------------------------
- double opacity() const
- {
- return double(a) / double(base_mask);
- }
-
-
- //--------------------------------------------------------------------
- const self_type& premultiply()
- {
- if(a == base_mask) return *this;
- if(a == 0)
- {
- v = 0;
- return *this;
- }
- v = value_type((calc_type(v) * a) >> base_shift);
- return *this;
- }
-
- //--------------------------------------------------------------------
- const self_type& premultiply(unsigned a_)
- {
- if(a == base_mask && a_ >= base_mask) return *this;
- if(a == 0 || a_ == 0)
- {
- v = a = 0;
- return *this;
- }
- calc_type v_ = (calc_type(v) * a_) / a;
- v = value_type((v_ > a_) ? a_ : v_);
- a = value_type(a_);
- return *this;
- }
-
- //--------------------------------------------------------------------
- const self_type& demultiply()
- {
- if(a == base_mask) return *this;
- if(a == 0)
- {
- v = 0;
- return *this;
- }
- calc_type v_ = (calc_type(v) * base_mask) / a;
- v = value_type((v_ > base_mask) ? base_mask : v_);
- return *this;
- }
-
- //--------------------------------------------------------------------
- self_type gradient(self_type c, double k) const
- {
- self_type ret;
- calc_type ik = calc_type(k * base_size);
- ret.v = value_type(calc_type(v) + (((calc_type(c.v) - v) * ik) >> base_shift));
- ret.a = value_type(calc_type(a) + (((calc_type(c.a) - a) * ik) >> base_shift));
- return ret;
- }
-
- //--------------------------------------------------------------------
- static self_type no_color() { return self_type(0,0); }
- };
-
-
- //-------------------------------------------------------------gray8_pre
- inline gray8 gray8_pre(unsigned v, unsigned a = gray8::base_mask)
- {
- return gray8(v,a).premultiply();
- }
- inline gray8 gray8_pre(const gray8& c, unsigned a)
- {
- return gray8(c,a).premultiply();
- }
- inline gray8 gray8_pre(const rgba& c)
- {
- return gray8(c).premultiply();
- }
- inline gray8 gray8_pre(const rgba& c, double a)
- {
- return gray8(c,a).premultiply();
- }
- inline gray8 gray8_pre(const rgba8& c)
- {
- return gray8(c).premultiply();
- }
- inline gray8 gray8_pre(const rgba8& c, unsigned a)
- {
- return gray8(c,a).premultiply();
- }
-
-
-
-
- //==================================================================gray16
- struct gray16
- {
- typedef int16u value_type;
- typedef int32u calc_type;
- typedef int64 long_type;
- enum
- {
- base_shift = 16,
- base_size = 1 << base_shift,
- base_mask = base_size - 1
- };
- typedef gray16 self_type;
-
- value_type v;
- value_type a;
-
- //--------------------------------------------------------------------
- gray16() {}
-
- //--------------------------------------------------------------------
- gray16(unsigned v_, unsigned a_=base_mask) :
- v(int16u(v_)), a(int16u(a_)) {}
-
- //--------------------------------------------------------------------
- gray16(const self_type& c, unsigned a_) :
- v(c.v), a(value_type(a_)) {}
-
- //--------------------------------------------------------------------
- gray16(const rgba& c) :
- v(value_type((0.299*c.r + 0.587*c.g + 0.114*c.b) * double(base_mask) + 0.5)),
- a(value_type(c.a * double(base_mask))) {}
-
- //--------------------------------------------------------------------
- gray16(const rgba& c, double a_) :
- v(value_type((0.299*c.r + 0.587*c.g + 0.114*c.b) * double(base_mask) + 0.5)),
- a(value_type(a_ * double(base_mask))) {}
-
- //--------------------------------------------------------------------
- gray16(const rgba8& c) :
- v(c.r*77 + c.g*150 + c.b*29),
- a((value_type(c.a) << 8) | c.a) {}
-
- //--------------------------------------------------------------------
- gray16(const rgba8& c, unsigned a_) :
- v(c.r*77 + c.g*150 + c.b*29),
- a((value_type(a_) << 8) | c.a) {}
-
- //--------------------------------------------------------------------
- void clear()
- {
- v = a = 0;
- }
-
- //--------------------------------------------------------------------
- const self_type& transparent()
- {
- a = 0;
- return *this;
- }
-
- //--------------------------------------------------------------------
- void opacity(double a_)
- {
- if(a_ < 0.0) a_ = 0.0;
- if(a_ > 1.0) a_ = 1.0;
- a = value_type(a_ * double(base_mask));
- }
-
- //--------------------------------------------------------------------
- double opacity() const
- {
- return double(a) / double(base_mask);
- }
-
-
- //--------------------------------------------------------------------
- const self_type& premultiply()
- {
- if(a == base_mask) return *this;
- if(a == 0)
- {
- v = 0;
- return *this;
- }
- v = value_type((calc_type(v) * a) >> base_shift);
- return *this;
- }
-
- //--------------------------------------------------------------------
- const self_type& premultiply(unsigned a_)
- {
- if(a == base_mask && a_ >= base_mask) return *this;
- if(a == 0 || a_ == 0)
- {
- v = a = 0;
- return *this;
- }
- calc_type v_ = (calc_type(v) * a_) / a;
- v = value_type((v_ > a_) ? a_ : v_);
- a = value_type(a_);
- return *this;
- }
-
- //--------------------------------------------------------------------
- const self_type& demultiply()
- {
- if(a == base_mask) return *this;
- if(a == 0)
- {
- v = 0;
- return *this;
- }
- calc_type v_ = (calc_type(v) * base_mask) / a;
- v = value_type((v_ > base_mask) ? base_mask : v_);
- return *this;
- }
-
- //--------------------------------------------------------------------
- self_type gradient(self_type c, double k) const
- {
- self_type ret;
- calc_type ik = calc_type(k * base_size);
- ret.v = value_type(calc_type(v) + (((calc_type(c.v) - v) * ik) >> base_shift));
- ret.a = value_type(calc_type(a) + (((calc_type(c.a) - a) * ik) >> base_shift));
- return ret;
- }
-
- //--------------------------------------------------------------------
- static self_type no_color() { return self_type(0,0); }
- };
-
-
- //------------------------------------------------------------gray16_pre
- inline gray16 gray16_pre(unsigned v, unsigned a = gray16::base_mask)
- {
- return gray16(v,a).premultiply();
- }
- inline gray16 gray16_pre(const gray16& c, unsigned a)
- {
- return gray16(c,a).premultiply();
- }
- inline gray16 gray16_pre(const rgba& c)
- {
- return gray16(c).premultiply();
- }
- inline gray16 gray16_pre(const rgba& c, double a)
- {
- return gray16(c,a).premultiply();
- }
- inline gray16 gray16_pre(const rgba8& c)
- {
- return gray16(c).premultiply();
- }
- inline gray16 gray16_pre(const rgba8& c, unsigned a)
- {
- return gray16(c,a).premultiply();
- }
-
-
-}
-
-
-
-
-#endif
diff --git a/agg/inc/agg_color_rgba.h b/agg/inc/agg_color_rgba.h
deleted file mode 100755
index ec502ce..0000000
--- a/agg/inc/agg_color_rgba.h
+++ /dev/null
@@ -1,618 +0,0 @@
-//----------------------------------------------------------------------------
-// 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.
-// This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
-//
-//----------------------------------------------------------------------------
-//
-// 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.
-//
-//----------------------------------------------------------------------------
-// Contact: mcseem at antigrain.com
-// mcseemagg at yahoo.com
-// http://www.antigrain.com
-//----------------------------------------------------------------------------
-
-#ifndef AGG_COLOR_RGBA_INCLUDED
-#define AGG_COLOR_RGBA_INCLUDED
-
-#include <math.h>
-#include "agg_basics.h"
-
-namespace agg
-{
- // Supported byte orders for RGB and RGBA pixel formats
- //=======================================================================
- struct order_rgb { enum { R=0, G=1, B=2, rgb_tag }; }; //----order_rgb
- struct order_bgr { enum { B=0, G=1, R=2, rgb_tag }; }; //----order_bgr
- struct order_rgba { enum { R=0, G=1, B=2, A=3, rgba_tag }; }; //----order_rgba
- struct order_argb { enum { A=0, R=1, G=2, B=3, rgba_tag }; }; //----order_argb
- struct order_abgr { enum { A=0, B=1, G=2, R=3, rgba_tag }; }; //----order_abgr
- struct order_bgra { enum { B=0, G=1, R=2, A=3, rgba_tag }; }; //----order_bgra
-
- //====================================================================rgba
- struct rgba
- {
- typedef double value_type;
-
- double r;
- double g;
- double b;
- double a;
-
- //--------------------------------------------------------------------
- rgba() {}
-
- //--------------------------------------------------------------------
- rgba(double r_, double g_, double b_, double a_=1.0) :
- r(r_), g(g_), b(b_), a(a_) {}
-
- //--------------------------------------------------------------------
- rgba(const rgba& c, double a_) : r(c.r), g(c.g), b(c.b), a(a_) {}
-
- //--------------------------------------------------------------------
- void clear()
- {
- r = g = b = a = 0;
- }
-
- //--------------------------------------------------------------------
- const rgba& transparent()
- {
- a = 0.0;
- return *this;
- }
-
- //--------------------------------------------------------------------
- const rgba& opacity(double a_)
- {
- if(a_ < 0.0) a_ = 0.0;
- if(a_ > 1.0) a_ = 1.0;
- a = a_;
- return *this;
- }
-
- //--------------------------------------------------------------------
- double opacity() const
- {
- return a;
- }
-
- //--------------------------------------------------------------------
- const rgba& premultiply()
- {
- r *= a;
- g *= a;
- b *= a;
- return *this;
- }
-
- //--------------------------------------------------------------------
- const rgba& premultiply(double a_)
- {
- if(a <= 0.0 || a_ <= 0.0)
- {
- r = g = b = a = 0.0;
- return *this;
- }
- a_ /= a;
- r *= a_;
- g *= a_;
- b *= a_;
- a = a_;
- return *this;
- }
-
- //--------------------------------------------------------------------
- const rgba& demultiply()
- {
- if(a == 0)
- {
- r = g = b = 0;
- return *this;
- }
- double a_ = 1.0 / a;
- r *= a_;
- g *= a_;
- b *= a_;
- return *this;
- }
-
-
- //--------------------------------------------------------------------
- rgba gradient(rgba c, double k) const
- {
- rgba ret;
- ret.r = r + (c.r - r) * k;
- ret.g = g + (c.g - g) * k;
- ret.b = b + (c.b - b) * k;
- ret.a = a + (c.a - a) * k;
- return ret;
- }
-
- //--------------------------------------------------------------------
- static rgba no_color() { return rgba(0,0,0,0); }
-
- //--------------------------------------------------------------------
- static rgba from_wavelength(double wl, double gamma = 1.0);
-
- //--------------------------------------------------------------------
- rgba(double wavelen, double gamma=1.0)
- {
- *this = from_wavelength(wavelen, gamma);
- }
-
- };
-
- //----------------------------------------------------------------rgba_pre
- inline rgba rgba_pre(double r, double g, double b, double a=1.0)
- {
- return rgba(r, g, b, a).premultiply();
- }
- inline rgba rgba_pre(const rgba& c)
- {
- return rgba(c).premultiply();
- }
- inline rgba rgba_pre(const rgba& c, double a)
- {
- return rgba(c, a).premultiply();
- }
-
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list