diff options
Diffstat (limited to 'agg')
155 files changed, 3256 insertions, 3256 deletions
diff --git a/agg/inc/agg_alpha_mask_u8.h b/agg/inc/agg_alpha_mask_u8.h index b7e5c926092f..a3e581ad37dd 100755 --- a/agg/inc/agg_alpha_mask_u8.h +++ b/agg/inc/agg_alpha_mask_u8.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. // @@ -30,15 +30,15 @@ namespace agg { 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; + static unsigned calculate(const int8u* p) + { + return (p[R]*77 + p[G]*150 + p[B]*29) >> 8; } }; @@ -49,8 +49,8 @@ namespace agg public: typedef int8u cover_type; typedef alpha_mask_u8<Step, Offset, MaskF> self_type; - enum - { + enum + { cover_shift = 8, cover_none = 0, cover_full = 255 @@ -64,12 +64,12 @@ namespace agg 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() && + if(x >= 0 && y >= 0 && + x < (int)m_rbuf->width() && y <= (int)m_rbuf->height()) { return (cover_type)m_mask_function.calculate( @@ -81,13 +81,13 @@ namespace agg //-------------------------------------------------------------------- cover_type combine_pixel(int x, int y, cover_type val) const { - if(x >= 0 && y >= 0 && - x < (int)m_rbuf->width() && + if(x >= 0 && y >= 0 && + x < (int)m_rbuf->width() && y <= (int)m_rbuf->height()) { - return (cover_type)((val * + return (cover_type)((val * m_mask_function.calculate( - m_rbuf->row(y) + x * Step + Offset)) >> + m_rbuf->row(y) + x * Step + Offset)) >> cover_shift); } return 0; @@ -112,7 +112,7 @@ namespace agg if(x < 0) { count += x; - if(count <= 0) + if(count <= 0) { memset(dst, 0, num_pix * sizeof(cover_type)); return; @@ -126,7 +126,7 @@ namespace agg { int rest = x + count - xmax - 1; count -= rest; - if(count <= 0) + if(count <= 0) { memset(dst, 0, num_pix * sizeof(cover_type)); return; @@ -162,7 +162,7 @@ namespace agg if(x < 0) { count += x; - if(count <= 0) + if(count <= 0) { memset(dst, 0, num_pix * sizeof(cover_type)); return; @@ -176,7 +176,7 @@ namespace agg { int rest = x + count - xmax - 1; count -= rest; - if(count <= 0) + if(count <= 0) { memset(dst, 0, num_pix * sizeof(cover_type)); return; @@ -187,8 +187,8 @@ namespace agg const int8u* mask = m_rbuf->row(y) + x * Step + Offset; do { - *covers = (cover_type)(((*covers) * - m_mask_function.calculate(mask)) >> + *covers = (cover_type)(((*covers) * + m_mask_function.calculate(mask)) >> cover_shift); ++covers; mask += Step; @@ -214,7 +214,7 @@ namespace agg if(y < 0) { count += y; - if(count <= 0) + if(count <= 0) { memset(dst, 0, num_pix * sizeof(cover_type)); return; @@ -228,7 +228,7 @@ namespace agg { int rest = y + count - ymax - 1; count -= rest; - if(count <= 0) + if(count <= 0) { memset(dst, 0, num_pix * sizeof(cover_type)); return; @@ -263,7 +263,7 @@ namespace agg if(y < 0) { count += y; - if(count <= 0) + if(count <= 0) { memset(dst, 0, num_pix * sizeof(cover_type)); return; @@ -277,7 +277,7 @@ namespace agg { int rest = y + count - ymax - 1; count -= rest; - if(count <= 0) + if(count <= 0) { memset(dst, 0, num_pix * sizeof(cover_type)); return; @@ -288,8 +288,8 @@ namespace agg const int8u* mask = m_rbuf->row(y) + x * Step + Offset; do { - *covers = (cover_type)(((*covers) * - m_mask_function.calculate(mask)) >> + *covers = (cover_type)(((*covers) * + m_mask_function.calculate(mask)) >> cover_shift); ++covers; mask += m_rbuf->stride(); @@ -305,7 +305,7 @@ namespace agg rendering_buffer* m_rbuf; MaskF m_mask_function; }; - + typedef alpha_mask_u8<1, 0> alpha_mask_gray8; //----alpha_mask_gray8 @@ -353,8 +353,8 @@ namespace agg public: typedef int8u cover_type; typedef amask_no_clip_u8<Step, Offset, MaskF> self_type; - enum - { + enum + { cover_shift = 8, cover_none = 0, cover_full = 255 @@ -376,13 +376,13 @@ namespace agg m_rbuf->row(y) + x * Step + Offset); } - + //-------------------------------------------------------------------- cover_type combine_pixel(int x, int y, cover_type val) const { - return (cover_type)((val * + return (cover_type)((val * m_mask_function.calculate( - m_rbuf->row(y) + x * Step + Offset)) >> + m_rbuf->row(y) + x * Step + Offset)) >> cover_shift); } @@ -407,8 +407,8 @@ namespace agg const int8u* mask = m_rbuf->row(y) + x * Step + Offset; do { - *dst = (cover_type)(((*dst) * - m_mask_function.calculate(mask)) >> + *dst = (cover_type)(((*dst) * + m_mask_function.calculate(mask)) >> cover_shift); ++dst; mask += Step; @@ -436,8 +436,8 @@ namespace agg const int8u* mask = m_rbuf->row(y) + x * Step + Offset; do { - *dst = (cover_type)(((*dst) * - m_mask_function.calculate(mask)) >> + *dst = (cover_type)(((*dst) * + m_mask_function.calculate(mask)) >> cover_shift); ++dst; mask += m_rbuf->stride(); @@ -452,7 +452,7 @@ namespace agg rendering_buffer* m_rbuf; MaskF m_mask_function; }; - + typedef amask_no_clip_u8<1, 0> amask_no_clip_gray8; //----amask_no_clip_gray8 diff --git a/agg/inc/agg_arc.h b/agg/inc/agg_arc.h index 80b148d910d0..e681718c180d 100755 --- a/agg/inc/agg_arc.h +++ b/agg/inc/agg_arc.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. // @@ -28,20 +28,20 @@ namespace agg //=====================================================================arc // - // See Implementation agg_arc.cpp + // 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, + 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, + void init(double x, double y, + double rx, double ry, + double a1, double a2, bool ccw=true); void approximation_scale(double s); diff --git a/agg/inc/agg_array.h b/agg/inc/agg_array.h index 2970181c4510..2881344ba31e 100755 --- a/agg/inc/agg_array.h +++ b/agg/inc/agg_array.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. // @@ -29,7 +29,7 @@ namespace agg { public: typedef T value_type; - pod_array_adaptor(T* array, unsigned _size) : + pod_array_adaptor(T* array, unsigned _size) : m_array(array), m_size(_size) {} unsigned size() const { return m_size; } @@ -95,7 +95,7 @@ namespace agg void resize(unsigned new_size); void add(const T& v) { m_array[m_size++] = v; } - void inc_size(unsigned _size) { m_size += _size; } + 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; @@ -113,7 +113,7 @@ namespace agg }; //------------------------------------------------------------------------ - template<class T> + template<class T> void pod_array<T>::capacity(unsigned cap, unsigned extra_tail) { m_size = 0; @@ -126,7 +126,7 @@ namespace agg } //------------------------------------------------------------------------ - template<class T> + template<class T> void pod_array<T>::resize(unsigned new_size) { if(new_size > m_size) @@ -159,7 +159,7 @@ namespace agg } //------------------------------------------------------------------------ - template<class T> const pod_array<T>& + template<class T> const pod_array<T>& pod_array<T>::operator = (const pod_array<T>&v) { capacity(v.m_capacity); @@ -169,12 +169,12 @@ namespace agg //------------------------------------------------------------------------ template<class T> void pod_array<T>::serialize(int8u* ptr) const - { - if(m_size) memcpy(ptr, m_array, m_size * sizeof(T)); + { + if(m_size) memcpy(ptr, m_array, m_size * sizeof(T)); } //------------------------------------------------------------------------ - template<class T> + template<class T> void pod_array<T>::deserialize(const int8u* data, unsigned _byte_size) { _byte_size /= sizeof(T); @@ -188,20 +188,20 @@ namespace agg //---------------------------------------------------------------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, + // 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 + // + // 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 - { + enum + { block_shift = S, block_size = 1 << block_shift, block_mask = block_size - 1 @@ -303,10 +303,10 @@ namespace agg 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, + void deserialize(unsigned start, const T& empty_val, const int8u* data, unsigned byte_size); - template<class ByteAccessor> + template<class ByteAccessor> void deserialize(ByteAccessor data) { remove_all(); @@ -384,7 +384,7 @@ namespace agg //------------------------------------------------------------------------ - template<class T, unsigned S> + template<class T, unsigned S> void pod_deque<T, S>::free_tail(unsigned _size) { if(_size < m_size) @@ -411,7 +411,7 @@ namespace agg //------------------------------------------------------------------------ - template<class T, unsigned S> + template<class T, unsigned S> pod_deque<T, S>::pod_deque(unsigned block_ptr_inc) : m_size(0), m_num_blocks(0), @@ -423,7 +423,7 @@ namespace agg //------------------------------------------------------------------------ - template<class T, unsigned S> + 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), @@ -441,7 +441,7 @@ namespace agg //------------------------------------------------------------------------ - template<class T, unsigned S> + template<class T, unsigned S> const pod_deque<T, S>& pod_deque<T, S>::operator = (const pod_deque<T, S>& v) { unsigned i; @@ -462,14 +462,14 @@ namespace agg template<class T, unsigned S> void pod_deque<T, S>::allocate_block(unsigned nb) { - if(nb >= m_max_blocks) + 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, + memcpy(new_blocks, + m_blocks, m_num_blocks * sizeof(T*)); delete [] m_blocks; @@ -498,7 +498,7 @@ namespace agg //------------------------------------------------------------------------ - template<class T, unsigned S> + template<class T, unsigned S> inline void pod_deque<T, S>::add(const T& val) { *data_ptr() = val; @@ -507,7 +507,7 @@ namespace agg //------------------------------------------------------------------------ - template<class T, unsigned S> + template<class T, unsigned S> inline void pod_deque<T, S>::remove_last() { if(m_size) --m_size; @@ -515,7 +515,7 @@ namespace agg //------------------------------------------------------------------------ - template<class T, unsigned S> + template<class T, unsigned S> void pod_deque<T, S>::modify_last(const T& val) { remove_last(); @@ -524,7 +524,7 @@ namespace agg //------------------------------------------------------------------------ - template<class T, unsigned S> + template<class T, unsigned S> int pod_deque<T, S>::allocate_continuous_block(unsigned num_elements) { if(num_elements < block_size) @@ -554,7 +554,7 @@ namespace agg //------------------------------------------------------------------------ - template<class T, unsigned S> + template<class T, unsigned S> unsigned pod_deque<T, S>::byte_size() const { return m_size * sizeof(T); @@ -562,7 +562,7 @@ namespace agg //------------------------------------------------------------------------ - template<class T, unsigned S> + template<class T, unsigned S> void pod_deque<T, S>::serialize(int8u* ptr) const { unsigned i; @@ -574,7 +574,7 @@ namespace agg } //------------------------------------------------------------------------ - template<class T, unsigned S> + template<class T, unsigned S> void pod_deque<T, S>::deserialize(const int8u* data, unsigned _byte_size) { remove_all(); @@ -591,8 +591,8 @@ namespace agg // 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, + 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) @@ -620,11 +620,11 @@ namespace agg //-----------------------------------------------------------pod_allocator // Allocator for arbitrary POD data. Most usable in different cache - // systems for efficient memory allocations. + // 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. + // use is when the average reqired size is much less than the block size. //------------------------------------------------------------------------ class pod_allocator { @@ -663,7 +663,7 @@ namespace agg m_rest(0) { } - + int8u* allocate(unsigned size, unsigned alignment=1) { @@ -698,14 +698,14 @@ namespace agg void allocate_block(unsigned size) { if(size < m_block_size) size = m_block_size; - if(m_num_blocks >= m_max_blocks) + 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, + memcpy(new_blocks, + m_blocks, m_num_blocks * sizeof(int8u*)); delete [] m_blocks; @@ -740,7 +740,7 @@ namespace agg quick_sort_threshold = 9 }; - + //-----------------------------------------------------------swap_elements template<class T> inline void swap_elements(T& a, T& b) { @@ -760,7 +760,7 @@ namespace agg typename Array::value_type* e2; int stack[80]; - int* top = stack; + int* top = stack; int limit = arr.size(); int base = 0; @@ -781,16 +781,16 @@ namespace agg i = base + 1; j = limit - 1; - // now ensure that *i <= *base <= *j - e1 = &(arr[j]); + // now ensure that *i <= *base <= *j + e1 = &(arr[j]); e2 = &(arr[i]); if(less(*e1, *e2)) swap_elements(*e1, *e2); - e1 = &(arr[base]); + e1 = &(arr[base]); e2 = &(arr[i]); if(less(*e1, *e2)) swap_elements(*e1, *e2); - e1 = &(arr[j]); + e1 = &(arr[j]); e2 = &(arr[base]); if(less(*e1, *e2)) swap_elements(*e1, *e2); @@ -859,7 +859,7 @@ namespace agg //------------------------------------------------------remove_duplicates - // Remove duplicates from a sorted array. It doesn't cut the the + // 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> diff --git a/agg/inc/agg_arrowhead.h b/agg/inc/agg_arrowhead.h index aac99c5ae980..e10fc3e1ef19 100755 --- a/agg/inc/agg_arrowhead.h +++ b/agg/inc/agg_arrowhead.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,7 +13,7 @@ // http://www.antigrain.com //---------------------------------------------------------------------------- // -// Simple arrowhead/arrowtail generator +// Simple arrowhead/arrowtail generator // //---------------------------------------------------------------------------- #ifndef AGG_ARROWHEAD_INCLUDED @@ -26,7 +26,7 @@ namespace agg //===============================================================arrowhead // - // See implementation agg_arrowhead.cpp + // See implementation agg_arrowhead.cpp // class arrowhead { diff --git a/agg/inc/agg_basics.h b/agg/inc/agg_basics.h index d9ca881ab328..23b2cdcdf59f 100755 --- a/agg/inc/agg_basics.h +++ b/agg/inc/agg_basics.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. // @@ -92,10 +92,10 @@ namespace agg 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 + 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 }; @@ -113,7 +113,7 @@ namespace agg { return rad * 180.0 / pi; } - + //----------------------------------------------------------------rect_base template<class T> struct rect_base { @@ -151,17 +151,17 @@ namespace agg }; //-----------------------------------------------------intersect_rectangles - template<class Rect> + 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 + // 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.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; @@ -170,7 +170,7 @@ namespace agg //---------------------------------------------------------unite_rectangles - template<class Rect> + template<class Rect> inline Rect unite_rectangles(const Rect& r1, const Rect& r2) { Rect r = r1; @@ -187,23 +187,23 @@ namespace agg //---------------------------------------------------------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_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_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_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 + path_flags_mask = 0xF0 //----path_flags_mask }; //---------------------------------------------------------------is_vertex @@ -214,7 +214,7 @@ namespace agg //-----------------------------------------------------------------is_stop inline bool is_stop(unsigned c) - { + { return c == path_cmd_stop; } @@ -258,7 +258,7 @@ namespace agg inline bool is_close(unsigned c) { return (c & ~(path_flags_cw | path_flags_ccw)) == - (((bool)path_cmd_end_poly) | ((bool)path_flags_close)); + (((bool)path_cmd_end_poly) | ((bool)path_flags_close)); } //------------------------------------------------------------is_next_poly @@ -282,19 +282,19 @@ namespace agg //-------------------------------------------------------------is_oriented inline bool is_oriented(unsigned c) { - return (c & (path_flags_cw | path_flags_ccw)) != 0; + return (c & (path_flags_cw | path_flags_ccw)) != 0; } //---------------------------------------------------------------is_closed inline bool is_closed(unsigned c) { - return (c & path_flags_close) != 0; + return (c & path_flags_close) != 0; } //----------------------------------------------------------get_close_flag inline unsigned get_close_flag(unsigned c) { - return c & path_flags_close; + return c & path_flags_close; } //-------------------------------------------------------clear_orientation @@ -331,7 +331,7 @@ namespace agg unsigned cmd; vertex_type() {} - vertex_type(double x_, double y_, unsigned cmd_) : + vertex_type(double x_, double y_, unsigned cmd_) : x(x_), y(y_), cmd(cmd_) {} }; diff --git a/agg/inc/agg_bezier_arc.h b/agg/inc/agg_bezier_arc.h index f437ab0a00bd..fef6095584ca 100755 --- a/agg/inc/agg_bezier_arc.h +++ b/agg/inc/agg_bezier_arc.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,7 +13,7 @@ // http://www.antigrain.com //---------------------------------------------------------------------------- // -// Arc generator. Produces at most 4 consecutive cubic bezier curves, i.e., +// Arc generator. Produces at most 4 consecutive cubic bezier curves, i.e., // 4, 7, 10, or 13 vertices. // //---------------------------------------------------------------------------- @@ -27,13 +27,13 @@ namespace agg { //----------------------------------------------------------------------- - void arc_to_bezier(double cx, double cy, double rx, double ry, + 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 @@ -41,18 +41,18 @@ namespace agg public: //-------------------------------------------------------------------- bezier_arc() : m_vertex(26) {} - bezier_arc(double x, double y, - double rx, double ry, - double start_angle, + 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, + void init(double x, double y, + double rx, double ry, + double start_angle, double sweep_angle); //-------------------------------------------------------------------- @@ -71,13 +71,13 @@ namespace agg return (m_vertex == 2) ? path_cmd_move_to : path_cmd_curve4; } - // Supplemantary functions. num_vertices() actually returns doubled + // 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; @@ -87,15 +87,15 @@ namespace agg //==========================================================bezier_arc_svg - // Compute an SVG-style bezier arc. + // 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 + // 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 { @@ -103,20 +103,20 @@ namespace agg //-------------------------------------------------------------------- bezier_arc_svg() : m_arc(), m_radii_ok(false) {} - bezier_arc_svg(double x1, double y1, - double rx, double ry, + bezier_arc_svg(double x1, double y1, + double rx, double ry, double angle, bool large_arc_flag, bool sweep_flag, - double x2, double y2) : + 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, + void init(double x1, double y1, + double rx, double ry, double angle, bool large_arc_flag, bool sweep_flag, @@ -137,7 +137,7 @@ namespace agg return m_arc.vertex(x, y); } - // Supplemantary functions. num_vertices() actually returns doubled + // 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(); } diff --git a/agg/inc/agg_bitset_iterator.h b/agg/inc/agg_bitset_iterator.h index 543432b65d54..87680b45c80d 100755 --- a/agg/inc/agg_bitset_iterator.h +++ b/agg/inc/agg_bitset_iterator.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. // @@ -20,7 +20,7 @@ namespace agg { - + class bitset_iterator { public: diff --git a/agg/inc/agg_bounding_rect.h b/agg/inc/agg_bounding_rect.h index 9a3c301069d7..21ec6034d737 100755 --- a/agg/inc/agg_bounding_rect.h +++ b/agg/inc/agg_bounding_rect.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. // @@ -26,8 +26,8 @@ namespace agg //-----------------------------------------------------------bounding_rect template<class VertexSource, class GetId, class CoordT> - bool bounding_rect(VertexSource& vs, GetId& gi, - unsigned start, unsigned num, + bool bounding_rect(VertexSource& vs, GetId& gi, + unsigned start, unsigned num, CoordT* x1, CoordT* y1, CoordT* x2, CoordT* y2) { unsigned i; @@ -71,7 +71,7 @@ namespace agg //-----------------------------------------------------bounding_rect_single - template<class VertexSource, class CoordT> + template<class VertexSource, class CoordT> bool bounding_rect_single(VertexSource& vs, unsigned path_id, CoordT* x1, CoordT* y1, CoordT* x2, CoordT* y2) { diff --git a/agg/inc/agg_bspline.h b/agg/inc/agg_bspline.h index ca58fa839b44..db914e2837bd 100755 --- a/agg/inc/agg_bspline.h +++ b/agg/inc/agg_bspline.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. // @@ -26,18 +26,18 @@ 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 + // 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. + // 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 + // outside the given with init() X-range. Extrapolation is a simple linear // function. // // See Implementation agg_bspline.cpp //------------------------------------------------------------------------ - class bspline + class bspline { public: ~bspline(); @@ -53,7 +53,7 @@ namespace agg double get(double x) const; double get_stateful(double x) const; - + private: bspline(const bspline&); const bspline& operator = (const bspline&); diff --git a/agg/inc/agg_clip_liang_barsky.h b/agg/inc/agg_clip_liang_barsky.h index e229d52bc6e9..5f185da37a78 100755 --- a/agg/inc/agg_clip_liang_barsky.h +++ b/agg/inc/agg_clip_liang_barsky.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,7 +13,7 @@ // http://www.antigrain.com //---------------------------------------------------------------------------- // -// Liang-Barsky clipping +// Liang-Barsky clipping // //---------------------------------------------------------------------------- #ifndef AGG_CLIP_LIANG_BARSKY_INCLUDED @@ -25,7 +25,7 @@ namespace agg { //----------------------------------------------------------clipping_flags - // Determine the clipping code of the vertex according to the + // Determine the clipping code of the vertex according to the // Cyrus-Beck line clipping algorithm // // | | @@ -41,7 +41,7 @@ namespace agg // | | // clip_box.x1 clip_box.x2 // - // + // template<class T> inline unsigned clipping_flags(T x, T y, const rect_base<T>& clip_box) { @@ -62,7 +62,7 @@ namespace agg const double nearzero = 1e-30; double deltax = x2 - x1; - double deltay = y2 - y1; + double deltay = y2 - y1; double xin; double xout; double yin; @@ -70,52 +70,52 @@ namespace agg double tinx; double tiny; double toutx; - double touty; + double touty; double tin1; double tin2; double tout1; unsigned np = 0; - if(deltax == 0.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 + if(deltay == 0.0) + { + // bump off of the horizontal deltay = (y1 > clip_box.y1) ? -nearzero : nearzero; } - - if(deltax > 0.0) - { + + if(deltax > 0.0) + { // points to right xin = clip_box.x1; xout = clip_box.x2; } - else + else { xin = clip_box.x2; xout = clip_box.x1; } - if(deltay > 0.0) + if(deltay > 0.0) { // points up yin = clip_box.y1; yout = clip_box.y2; } - else + else { yin = clip_box.y2; yout = clip_box.y1; } - + tinx = (xin - x1) / deltax; tiny = (yin - y1) / deltay; - - if (tinx < tiny) + + if (tinx < tiny) { // hits x first tin1 = tinx; @@ -127,10 +127,10 @@ namespace agg tin1 = tiny; tin2 = tinx; } - - if(tin1 <= 1.0) + + if(tin1 <= 1.0) { - if(0.0 < tin1) + if(0.0 < tin1) { *x++ = (T)xin; *y++ = (T)yin; @@ -141,21 +141,21 @@ namespace agg { toutx = (xout - x1) / deltax; touty = (yout - y1) / deltay; - + tout1 = (toutx < touty) ? toutx : touty; - - if(tin2 > 0.0 || tout1 > 0.0) + + if(tin2 > 0.0 || tout1 > 0.0) { - if(tin2 <= tout1) + if(tin2 <= tout1) { - if(tin2 > 0.0) + if(tin2 > 0.0) { - if(tinx > tiny) + if(tinx > tiny) { *x++ = (T)xin; *y++ = (T)(y1 + tinx * deltay); } - else + else { *x++ = (T)(x1 + tiny * deltax); *y++ = (T)yin; @@ -163,34 +163,34 @@ namespace agg ++np; } - if(tout1 < 1.0) + if(tout1 < 1.0) { - if(toutx < touty) + if(toutx < touty) { *x++ = (T)xout; *y++ = (T)(y1 + toutx * deltay); } - else + else { *x++ = (T)(x1 + touty * deltax); *y++ = (T)yout; } } - else + else { *x++ = x2; *y++ = y2; } ++np; } - else + else { - if(tinx > tiny) + if(tinx > tiny) { *x++ = (T)xin; *y++ = (T)yout; } - else + else { *x++ = (T)xout; *y++ = (T)yin; @@ -202,7 +202,7 @@ namespace agg } return np; } - + } diff --git a/agg/inc/agg_color_gray.h b/agg/inc/agg_color_gray.h index 1d0ffd8e773d..6196177458e3 100755 --- a/agg/inc/agg_color_gray.h +++ b/agg/inc/agg_color_gray.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. -// +// //---------------------------------------------------------------------------- // // color types gray8, gray16 diff --git a/agg/inc/agg_color_rgba.h b/agg/inc/agg_color_rgba.h index e1f77206cc66..ec502cee5ccc 100755 --- a/agg/inc/agg_color_rgba.h +++ b/agg/inc/agg_color_rgba.h @@ -2,19 +2,19 @@ // 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. // //---------------------------------------------------------------------------- // -// 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. -// +// //---------------------------------------------------------------------------- // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com @@ -143,7 +143,7 @@ namespace agg //-------------------------------------------------------------------- static rgba from_wavelength(double wl, double gamma = 1.0); - + //-------------------------------------------------------------------- rgba(double wavelen, double gamma=1.0) { @@ -176,7 +176,7 @@ namespace agg t.r = -1.0 * (wl - 440.0) / (440.0 - 380.0); t.b = 1.0; } - else + else if(wl >= 440.0 && wl <= 490.0) { t.g = (wl - 440.0) / (490.0 - 440.0); @@ -218,7 +218,7 @@ namespace agg - + //===================================================================rgba8 struct rgba8 { @@ -244,16 +244,16 @@ namespace agg //-------------------------------------------------------------------- rgba8(unsigned r_, unsigned g_, unsigned b_, unsigned a_=base_mask) : - r(value_type(r_)), - g(value_type(g_)), - b(value_type(b_)), + r(value_type(r_)), + g(value_type(g_)), + b(value_type(b_)), a(value_type(a_)) {} //-------------------------------------------------------------------- rgba8(const rgba& c, double a_) : - r(value_type(c.r * double(base_mask) + 0.5)), - g(value_type(c.g * double(base_mask) + 0.5)), - b(value_type(c.b * double(base_mask) + 0.5)), + r(value_type(c.r * double(base_mask) + 0.5)), + g(value_type(c.g * double(base_mask) + 0.5)), + b(value_type(c.b * double(base_mask) + 0.5)), a(value_type(a_ * double(base_mask) + 0.5)) {} //-------------------------------------------------------------------- @@ -262,9 +262,9 @@ namespace agg //-------------------------------------------------------------------- rgba8(const rgba& c) : - r(value_type(c.r * double(base_mask) + 0.5)), - g(value_type(c.g * double(base_mask) + 0.5)), - b(value_type(c.b * double(base_mask) + 0.5)), + r(value_type(c.r * double(base_mask) + 0.5)), + g(value_type(c.g * double(base_mask) + 0.5)), + b(value_type(c.b * double(base_mask) + 0.5)), a(value_type(c.a * double(base_mask) + 0.5)) {} //-------------------------------------------------------------------- @@ -272,7 +272,7 @@ namespace agg { r = g = b = a = 0; } - + //-------------------------------------------------------------------- const self_type& transparent() { @@ -371,7 +371,7 @@ namespace agg //-------------------------------------------------------------rgba8_pre - inline rgba8 rgba8_pre(unsigned r, unsigned g, unsigned b, + inline rgba8 rgba8_pre(unsigned r, unsigned g, unsigned b, unsigned a = rgba8::base_mask) { return rgba8(r,g,b,a).premultiply(); @@ -443,9 +443,9 @@ namespace agg //-------------------------------------------------------------------- rgba16(unsigned r_, unsigned g_, unsigned b_, unsigned a_=base_mask) : - r(value_type(r_)), - g(value_type(g_)), - b(value_type(b_)), + r(value_type(r_)), + g(value_type(g_)), + b(value_type(b_)), a(value_type(a_)) {} //-------------------------------------------------------------------- @@ -454,30 +454,30 @@ namespace agg //-------------------------------------------------------------------- rgba16(const rgba& c) : - r(value_type(c.r * double(base_mask) + 0.5)), - g(value_type(c.g * double(base_mask) + 0.5)), - b(value_type(c.b * double(base_mask) + 0.5)), + r(value_type(c.r * double(base_mask) + 0.5)), + g(value_type(c.g * double(base_mask) + 0.5)), + b(value_type(c.b * double(base_mask) + 0.5)), a(value_type(c.a * double(base_mask) + 0.5)) {} //-------------------------------------------------------------------- rgba16(const rgba& c, double a_) : - r(value_type(c.r * double(base_mask) + 0.5)), - g(value_type(c.g * double(base_mask) + 0.5)), - b(value_type(c.b * double(base_mask) + 0.5)), + r(value_type(c.r * double(base_mask) + 0.5)), + g(value_type(c.g * double(base_mask) + 0.5)), + b(value_type(c.b * double(base_mask) + 0.5)), a(value_type(a_ * double(base_mask) + 0.5)) {} //-------------------------------------------------------------------- rgba16(const rgba8& c) : - r(value_type((value_type(c.r) << 8) | c.r)), - g(value_type((value_type(c.g) << 8) | c.g)), - b(value_type((value_type(c.b) << 8) | c.b)), + r(value_type((value_type(c.r) << 8) | c.r)), + g(value_type((value_type(c.g) << 8) | c.g)), + b(value_type((value_type(c.b) << 8) | c.b)), a(value_type((value_type(c.a) << 8) | c.a)) {} //-------------------------------------------------------------------- rgba16(const rgba8& c, unsigned a_) : - r(value_type((value_type(c.r) << 8) | c.r)), - g(value_type((value_type(c.g) << 8) | c.g)), - b(value_type((value_type(c.b) << 8) | c.b)), + r(value_type((value_type(c.r) << 8) | c.r)), + g(value_type((value_type(c.g) << 8) | c.g)), + b(value_type((value_type(c.b) << 8) | c.b)), a(value_type(( a_ << 8) | c.a)) {} //-------------------------------------------------------------------- @@ -485,7 +485,7 @@ namespace agg { r = g = b = a = 0; } - + //-------------------------------------------------------------------- const self_type& transparent() { @@ -585,7 +585,7 @@ namespace agg //--------------------------------------------------------------rgba16_pre - inline rgba16 rgba16_pre(unsigned r, unsigned g, unsigned b, + inline rgba16 rgba16_pre(unsigned r, unsigned g, unsigned b, unsigned a = rgba16::base_mask) { return rgba16(r,g,b,a).premultiply(); diff --git a/agg/inc/agg_config.h b/agg/inc/agg_config.h index b412a6dff178..c0070066383e 100755 --- a/agg/inc/agg_config.h +++ b/agg/inc/agg_config.h @@ -2,7 +2,7 @@ #define AGG_CONFIG_INCLUDED // This file can be used to redefine the default basic types such as: -// +// // AGG_INT8 // AGG_INT8U // AGG_INT16 @@ -12,7 +12,7 @@ // AGG_INT64 // AGG_INT64U // -// Just replace this file with new defines if necessary. +// Just replace this file with new defines if necessary. // For example, if your compiler doesn't have a 64 bit integer type // you can still use AGG if you define the follows: // @@ -20,7 +20,7 @@ // #define AGG_INT64U unsigned // // It will result in overflow in 16 bit-per-component image/pattern resampling -// but it won't result any crash and the rest of the library will remain +// but it won't result any crash and the rest of the library will remain // fully functional. // #i65318# Passing agg version on to clients diff --git a/agg/inc/agg_conv_adaptor_vcgen.h b/agg/inc/agg_conv_adaptor_vcgen.h index f8233a388357..613831bff24f 100755 --- a/agg/inc/agg_conv_adaptor_vcgen.h +++ b/agg/inc/agg_conv_adaptor_vcgen.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. // @@ -39,8 +39,8 @@ namespace agg //------------------------------------------------------conv_adaptor_vcgen - template<class VertexSource, - class Generator, + template<class VertexSource, + class Generator, class Markers=null_markers> class conv_adaptor_vcgen { enum status @@ -52,7 +52,7 @@ namespace agg public: conv_adaptor_vcgen(VertexSource& source) : - m_source(&source), + m_source(&source), m_status(initial) {} @@ -63,10 +63,10 @@ namespace agg Markers& markers() { return m_markers; } const Markers& markers() const { return m_markers; } - - void rewind(unsigned id) - { - m_source->rewind(id); + + void rewind(unsigned id) + { + m_source->rewind(id); m_status = initial; } @@ -80,7 +80,7 @@ namespace agg private: // Prohibit copying conv_adaptor_vcgen(const conv_adaptor_vcgen<VertexSource, Generator, Markers>&); - const conv_adaptor_vcgen<VertexSource, Generator, Markers>& + const conv_adaptor_vcgen<VertexSource, Generator, Markers>& operator = (const conv_adaptor_vcgen<VertexSource, Generator, Markers>&); VertexSource* m_source; @@ -97,7 +97,7 @@ namespace agg //------------------------------------------------------------------------ - template<class VertexSource, class Generator, class Markers> + template<class VertexSource, class Generator, class Markers> unsigned conv_adaptor_vcgen<VertexSource, Generator, Markers>::vertex(double* x, double* y) { unsigned cmd = path_cmd_stop; diff --git a/agg/inc/agg_conv_adaptor_vpgen.h b/agg/inc/agg_conv_adaptor_vpgen.h index f6afdb4d7f12..c8cf5c6e07c3 100755 --- a/agg/inc/agg_conv_adaptor_vpgen.h +++ b/agg/inc/agg_conv_adaptor_vpgen.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. // @@ -43,7 +43,7 @@ namespace agg private: conv_adaptor_vpgen(const conv_adaptor_vpgen<VertexSource, VPGen>&); - const conv_adaptor_vpgen<VertexSource, VPGen>& + const conv_adaptor_vpgen<VertexSource, VPGen>& operator = (const conv_adaptor_vpgen<VertexSource, VPGen>&); VertexSource* m_source; @@ -58,8 +58,8 @@ namespace agg //------------------------------------------------------------------------ template<class VertexSource, class VPGen> - void conv_adaptor_vpgen<VertexSource, VPGen>::rewind(unsigned path_id) - { + void conv_adaptor_vpgen<VertexSource, VPGen>::rewind(unsigned path_id) + { m_source->rewind(path_id); m_vpgen.reset(); m_start_x = 0; @@ -90,7 +90,7 @@ namespace agg if(m_vertices < 0) { - if(m_vertices < -1) + if(m_vertices < -1) { m_vertices = 0; return path_cmd_stop; @@ -104,7 +104,7 @@ namespace agg cmd = m_source->vertex(&tx, &ty); if(is_vertex(cmd)) { - if(is_move_to(cmd)) + if(is_move_to(cmd)) { if(m_vpgen.auto_close() && m_vertices > 2) { @@ -120,7 +120,7 @@ namespace agg m_start_y = ty; m_vertices = 1; } - else + else { m_vpgen.line_to(tx, ty); ++m_vertices; diff --git a/agg/inc/agg_conv_bspline.h b/agg/inc/agg_conv_bspline.h index 9c504daff209..f1f3c5d722ed 100755 --- a/agg/inc/agg_conv_bspline.h +++ b/agg/inc/agg_conv_bspline.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. // @@ -24,12 +24,12 @@ namespace agg { //---------------------------------------------------------conv_bspline - template<class VertexSource> + template<class VertexSource> struct conv_bspline : public conv_adaptor_vcgen<VertexSource, vcgen_bspline> { typedef conv_adaptor_vcgen<VertexSource, vcgen_bspline> base_type; - conv_bspline(VertexSource& vs) : + conv_bspline(VertexSource& vs) : conv_adaptor_vcgen<VertexSource, vcgen_bspline>(vs) {} void interpolation_step(double v) { base_type::generator().interpolation_step(v); } @@ -37,7 +37,7 @@ namespace agg private: conv_bspline(const conv_bspline<VertexSource>&); - const conv_bspline<VertexSource>& + const conv_bspline<VertexSource>& operator = (const conv_bspline<VertexSource>&); }; diff --git a/agg/inc/agg_conv_clip_polygon.h b/agg/inc/agg_conv_clip_polygon.h index cbecc51fbdd5..63e17878ab11 100755 --- a/agg/inc/agg_conv_clip_polygon.h +++ b/agg/inc/agg_conv_clip_polygon.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. // @@ -14,12 +14,12 @@ //---------------------------------------------------------------------------- // // Polygon clipping converter -// There an optimized Liang-Basky algorithm is used. +// There an optimized Liang-Basky algorithm is used. // The algorithm doesn't optimize the degenerate edges, i.e. it will never -// break a closed polygon into two or more ones, instead, there will be +// break a closed polygon into two or more ones, instead, there will be // degenerate edges coinciding with the respective clipping boundaries. -// This is a sub-optimal solution, because that optimization would require -// extra, rather expensive math while the rasterizer tolerates it quite well, +// This is a sub-optimal solution, because that optimization would require +// extra, rather expensive math while the rasterizer tolerates it quite well, // without any considerable overhead. // //---------------------------------------------------------------------------- @@ -35,12 +35,12 @@ namespace agg { //=======================================================conv_clip_polygon - template<class VertexSource> + template<class VertexSource> struct conv_clip_polygon : public conv_adaptor_vpgen<VertexSource, vpgen_clip_polygon> { typedef conv_adaptor_vpgen<VertexSource, vpgen_clip_polygon> base_type; - conv_clip_polygon(VertexSource& vs) : + conv_clip_polygon(VertexSource& vs) : conv_adaptor_vpgen<VertexSource, vpgen_clip_polygon>(vs) {} void clip_box(double x1, double y1, double x2, double y2) @@ -60,7 +60,7 @@ namespace agg private: conv_clip_polygon(const conv_clip_polygon<VertexSource>&); - const conv_clip_polygon<VertexSource>& + const conv_clip_polygon<VertexSource>& operator = (const conv_clip_polygon<VertexSource>&); }; diff --git a/agg/inc/agg_conv_clip_polyline.h b/agg/inc/agg_conv_clip_polyline.h index 4ac66276891c..f2f5632a767b 100755 --- a/agg/inc/agg_conv_clip_polyline.h +++ b/agg/inc/agg_conv_clip_polyline.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. // @@ -14,12 +14,12 @@ //---------------------------------------------------------------------------- // // polyline clipping converter -// There an optimized Liang-Basky algorithm is used. +// There an optimized Liang-Basky algorithm is used. // The algorithm doesn't optimize the degenerate edges, i.e. it will never -// break a closed polyline into two or more ones, instead, there will be +// break a closed polyline into two or more ones, instead, there will be // degenerate edges coinciding with the respective clipping boundaries. -// This is a sub-optimal solution, because that optimization would require -// extra, rather expensive math while the rasterizer tolerates it quite well, +// This is a sub-optimal solution, because that optimization would require +// extra, rather expensive math while the rasterizer tolerates it quite well, // without any considerable overhead. // //---------------------------------------------------------------------------- @@ -35,12 +35,12 @@ namespace agg { //=======================================================conv_clip_polyline - template<class VertexSource> + template<class VertexSource> struct conv_clip_polyline : public conv_adaptor_vpgen<VertexSource, vpgen_clip_polyline> { typedef conv_adaptor_vpgen<VertexSource, vpgen_clip_polyline> base_type; - conv_clip_polyline(VertexSource& vs) : + conv_clip_polyline(VertexSource& vs) : conv_adaptor_vpgen<VertexSource, vpgen_clip_polyline>(vs) {} void clip_box(double x1, double y1, double x2, double y2) @@ -60,7 +60,7 @@ namespace agg private: conv_clip_polyline(const conv_clip_polyline<VertexSource>&); - const conv_clip_polyline<VertexSource>& + const conv_clip_polyline<VertexSource>& operator = (const conv_clip_polyline<VertexSource>&); }; diff --git a/agg/inc/agg_conv_close_polygon.h b/agg/inc/agg_conv_close_polygon.h index 60a756a7408a..db2acaaf09d4 100755 --- a/agg/inc/agg_conv_close_polygon.h +++ b/agg/inc/agg_conv_close_polygon.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. // @@ -40,7 +40,7 @@ namespace agg private: conv_close_polygon(const conv_close_polygon<VertexSource>&); - const conv_close_polygon<VertexSource>& + const conv_close_polygon<VertexSource>& operator = (const conv_close_polygon<VertexSource>&); VertexSource* m_source; @@ -54,7 +54,7 @@ namespace agg //------------------------------------------------------------------------ - template<class VertexSource> + template<class VertexSource> void conv_close_polygon<VertexSource>::rewind(unsigned path_id) { m_source->rewind(path_id); @@ -63,9 +63,9 @@ namespace agg } - + //------------------------------------------------------------------------ - template<class VertexSource> + template<class VertexSource> unsigned conv_close_polygon<VertexSource>::vertex(double* x, double* y) { unsigned cmd = path_cmd_stop; diff --git a/agg/inc/agg_conv_concat.h b/agg/inc/agg_conv_concat.h index 2b9886a1be46..d7e69a9fda52 100755 --- a/agg/inc/agg_conv_concat.h +++ b/agg/inc/agg_conv_concat.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. // @@ -22,7 +22,7 @@ namespace agg { //=============================================================conv_concat - // Concatenation of two paths. Usually used to combine lines or curves + // Concatenation of two paths. Usually used to combine lines or curves // with markers such as arrowheads template<class VS1, class VS2> class conv_concat { @@ -35,7 +35,7 @@ namespace agg void rewind(unsigned id) - { + { m_source1->rewind(id); m_source2->rewind(0); m_status = 0; @@ -66,7 +66,7 @@ namespace agg private: conv_concat(const conv_concat<VS1, VS2>&); - const conv_concat<VS1, VS2>& + const conv_concat<VS1, VS2>& operator = (const conv_concat<VS1, VS2>&); VS1* m_source1; diff --git a/agg/inc/agg_conv_contour.h b/agg/inc/agg_conv_contour.h index 652a8e1fa4f3..97b90902f577 100755 --- a/agg/inc/agg_conv_contour.h +++ b/agg/inc/agg_conv_contour.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. // @@ -27,12 +27,12 @@ namespace agg { //-----------------------------------------------------------conv_contour - template<class VertexSource> + template<class VertexSource> struct conv_contour : public conv_adaptor_vcgen<VertexSource, vcgen_contour> { typedef conv_adaptor_vcgen<VertexSource, vcgen_contour> base_type; - conv_contour(VertexSource& vs) : + conv_contour(VertexSource& vs) : conv_adaptor_vcgen<VertexSource, vcgen_contour>(vs) { } @@ -56,7 +56,7 @@ namespace agg private: conv_contour(const conv_contour<VertexSource>&); - const conv_contour<VertexSource>& + const conv_contour<VertexSource>& operator = (const conv_contour<VertexSource>&); }; diff --git a/agg/inc/agg_conv_curve.h b/agg/inc/agg_conv_curve.h index 3b8e6cff2e2e..4ff49ee8f65e 100755 --- a/agg/inc/agg_conv_curve.h +++ b/agg/inc/agg_conv_curve.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. // @@ -28,28 +28,28 @@ namespace agg //---------------------------------------------------------------conv_curve - // Curve converter class. Any path storage can have Bezier curves defined - // by their control points. There're two types of curves supported: curve3 + // Curve converter class. Any path storage can have Bezier curves defined + // by their control points. There're two types of curves supported: curve3 // and curve4. Curve3 is a conic Bezier curve with 2 endpoints and 1 control // point. Curve4 has 2 control points (4 points in total) and can be used - // to interpolate more complicated curves. Curve4, unlike curve3 can be used - // to approximate arcs, both curcular and elliptical. Curves are approximated - // with straight lines and one of the approaches is just to store the whole - // sequence of vertices that approximate our curve. It takes additional - // memory, and at the same time the consecutive vertices can be calculated - // on demand. + // to interpolate more complicated curves. Curve4, unlike curve3 can be used + // to approximate arcs, both curcular and elliptical. Curves are approximated + // with straight lines and one of the approaches is just to store the whole + // sequence of vertices that approximate our curve. It takes additional + // memory, and at the same time the consecutive vertices can be calculated + // on demand. // // Initially, path storages are not suppose to keep all the vertices of the // curves (although, nothig prevents us from doing so). Instead, path_storage // keeps only vertices, needed to calculate a curve on demand. Those vertices - // are marked with special commands. So, if the path_storage contains curves - // (which are not real curves yet), and we render this storage directly, - // all we will see is only 2 or 3 straight line segments (for curve3 and - // curve4 respectively). If we need to see real curves drawn we need to - // include this class into the conversion pipeline. + // are marked with special commands. So, if the path_storage contains curves + // (which are not real curves yet), and we render this storage directly, + // all we will see is only 2 or 3 straight line segments (for curve3 and + // curve4 respectively). If we need to see real curves drawn we need to + // include this class into the conversion pipeline. // - // Class conv_curve recognizes commands path_cmd_curve3 and path_cmd_curve4 - // and converts these vertices into a move_to/line_to sequence. + // Class conv_curve recognizes commands path_cmd_curve3 and path_cmd_curve4 + // and converts these vertices into a move_to/line_to sequence. //----------------------------------------------------------------------- template<class VertexSource> class conv_curve { @@ -59,18 +59,18 @@ namespace agg void set_source(VertexSource& source) { m_source = &source; } - void approximation_scale(double s) - { - m_curve3.approximation_scale(s); - m_curve4.approximation_scale(s); + void approximation_scale(double s) + { + m_curve3.approximation_scale(s); + m_curve4.approximation_scale(s); } - double approximation_scale() const - { - return m_curve3.approximation_scale(); + double approximation_scale() const + { + return m_curve3.approximation_scale(); } - void rewind(unsigned id); + void rewind(unsigned id); unsigned vertex(double* x, double* y); typedef conv_curve<VertexSource> source_type; @@ -80,7 +80,7 @@ namespace agg private: conv_curve(const conv_curve<VertexSource>&); - const conv_curve<VertexSource>& + const conv_curve<VertexSource>& operator = (const conv_curve<VertexSource>&); VertexSource* m_source; @@ -135,13 +135,13 @@ namespace agg m_last_x = *x; m_last_y = *y; default: - break; - + break; + case path_cmd_curve3: m_source->vertex(&end_x, &end_y); - m_curve3.init(m_last_x, m_last_y, - *x, *y, + m_curve3.init(m_last_x, m_last_y, + *x, *y, end_x, end_y); m_curve3.vertex(x, y); // First call returns path_cmd_move_to @@ -153,9 +153,9 @@ namespace agg m_source->vertex(&ct2_x, &ct2_y); m_source->vertex(&end_x, &end_y); - m_curve4.init(m_last_x, m_last_y, - *x, *y, - ct2_x, ct2_y, + m_curve4.init(m_last_x, m_last_y, + *x, *y, + ct2_x, ct2_y, end_x, end_y); m_curve4.vertex(x, y); // First call returns path_cmd_move_to diff --git a/agg/inc/agg_conv_dash.h b/agg/inc/agg_conv_dash.h index 0520276bbb96..2aef0acf7d77 100755 --- a/agg/inc/agg_conv_dash.h +++ b/agg/inc/agg_conv_dash.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. // @@ -27,30 +27,30 @@ namespace agg { //---------------------------------------------------------------conv_dash - template<class VertexSource, class Markers=null_markers> + template<class VertexSource, class Markers=null_markers> struct conv_dash : public conv_adaptor_vcgen<VertexSource, vcgen_dash, Markers> { typedef Markers marker_type; typedef conv_adaptor_vcgen<VertexSource, vcgen_dash, Markers> base_type; - conv_dash(VertexSource& vs) : + conv_dash(VertexSource& vs) : conv_adaptor_vcgen<VertexSource, vcgen_dash, Markers>(vs) { } - void remove_all_dashes() - { - base_type::generator().remove_all_dashes(); + void remove_all_dashes() + { + base_type::generator().remove_all_dashes(); } - void add_dash(double dash_len, double gap_len) - { - base_type::generator().add_dash(dash_len, gap_len); + void add_dash(double dash_len, double gap_len) + { + base_type::generator().add_dash(dash_len, gap_len); } - void dash_start(double ds) - { - base_type::generator().dash_start(ds); + void dash_start(double ds) + { + base_type::generator().dash_start(ds); } void shorten(double s) { base_type::generator().shorten(s); } @@ -58,7 +58,7 @@ namespace agg private: conv_dash(const conv_dash<VertexSource, Markers>&); - const conv_dash<VertexSource, Markers>& + const conv_dash<VertexSource, Markers>& operator = (const conv_dash<VertexSource, Markers>&); }; diff --git a/agg/inc/agg_conv_gpc.h b/agg/inc/agg_conv_gpc.h index 1810309d208a..8064a0a1451e 100755 --- a/agg/inc/agg_conv_gpc.h +++ b/agg/inc/agg_conv_gpc.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,7 +13,7 @@ // http://www.antigrain.com //---------------------------------------------------------------------------- // -// General Polygon Clipper based on the GPC library by Alan Murta +// General Polygon Clipper based on the GPC library by Alan Murta // Union, Intersection, XOR, A-B, B-A // Contact the author if you intend to use it in commercial applications! // http://www.cs.man.ac.uk/aig/staff/alan/software/ @@ -29,9 +29,9 @@ #include "agg_array.h" #include "agg_vertex_iterator.h" -extern "C" -{ -#include "gpc.h" +extern "C" +{ +#include "gpc.h" } namespace agg @@ -191,7 +191,7 @@ namespace agg //------------------------------------------------------------------------ - template<class VSA, class VSB> + template<class VSA, class VSB> void conv_gpc<VSA, VSB>::free_polygon(gpc_polygon& p) { int i; @@ -206,7 +206,7 @@ namespace agg //------------------------------------------------------------------------ - template<class VSA, class VSB> + template<class VSA, class VSB> void conv_gpc<VSA, VSB>::free_result() { if(m_result.contour) @@ -218,7 +218,7 @@ namespace agg //------------------------------------------------------------------------ - template<class VSA, class VSB> + template<class VSA, class VSB> void conv_gpc<VSA, VSB>::free_gpc_data() { free_polygon(m_poly_a); @@ -228,7 +228,7 @@ namespace agg //------------------------------------------------------------------------ - template<class VSA, class VSB> + template<class VSA, class VSB> void conv_gpc<VSA, VSB>::start_contour() { contour_header_type h; @@ -239,7 +239,7 @@ namespace agg //------------------------------------------------------------------------ - template<class VSA, class VSB> + template<class VSA, class VSB> inline void conv_gpc<VSA, VSB>::add_vertex(double x, double y) { gpc_vertex v; @@ -250,14 +250,14 @@ namespace agg //------------------------------------------------------------------------ - template<class VSA, class VSB> + template<class VSA, class VSB> void conv_gpc<VSA, VSB>::end_contour(unsigned orientation) { if(m_contour_accumulator.size()) { if(m_vertex_accumulator.size() > 2) { - contour_header_type& h = + contour_header_type& h = m_contour_accumulator[m_contour_accumulator.size() - 1]; h.num_vertices = m_vertex_accumulator.size(); @@ -286,7 +286,7 @@ namespace agg //------------------------------------------------------------------------ - template<class VSA, class VSB> + template<class VSA, class VSB> void conv_gpc<VSA, VSB>::make_polygon(gpc_polygon& p) { free_polygon(p); @@ -316,7 +316,7 @@ namespace agg //------------------------------------------------------------------------ - template<class VSA, class VSB> + template<class VSA, class VSB> void conv_gpc<VSA, VSB>::start_extracting() { m_status = status_move_to; @@ -326,7 +326,7 @@ namespace agg //------------------------------------------------------------------------ - template<class VSA, class VSB> + template<class VSA, class VSB> bool conv_gpc<VSA, VSB>::next_contour() { if(++m_contour < m_result.num_contours) @@ -339,7 +339,7 @@ namespace agg //------------------------------------------------------------------------ - template<class VSA, class VSB> + template<class VSA, class VSB> inline bool conv_gpc<VSA, VSB>::next_vertex(double* x, double* y) { const gpc_vertex_list& vlist = m_result.contour[m_contour]; @@ -355,7 +355,7 @@ namespace agg //------------------------------------------------------------------------ - template<class VSA, class VSB> + template<class VSA, class VSB> void conv_gpc<VSA, VSB>::rewind(unsigned id) { free_result(); @@ -405,12 +405,12 @@ namespace agg //------------------------------------------------------------------------ - template<class VSA, class VSB> + template<class VSA, class VSB> unsigned conv_gpc<VSA, VSB>::vertex(double* x, double* y) { if(m_status == status_move_to) { - if(next_contour()) + if(next_contour()) { if(next_vertex(x, y)) { @@ -436,7 +436,7 @@ namespace agg return path_cmd_stop; } - + } diff --git a/agg/inc/agg_conv_marker.h b/agg/inc/agg_conv_marker.h index 1ae7fc92307b..52dceb3d93b9 100755 --- a/agg/inc/agg_conv_marker.h +++ b/agg/inc/agg_conv_marker.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. // @@ -45,10 +45,10 @@ namespace agg private: conv_marker(const conv_marker<MarkerLocator, MarkerShapes>&); - const conv_marker<MarkerLocator, MarkerShapes>& + const conv_marker<MarkerLocator, MarkerShapes>& operator = (const conv_marker<MarkerLocator, MarkerShapes>&); - enum status_e + enum status_e { initial, markers, @@ -67,7 +67,7 @@ namespace agg //------------------------------------------------------------------------ - template<class MarkerLocator, class MarkerShapes> + template<class MarkerLocator, class MarkerShapes> conv_marker<MarkerLocator, MarkerShapes>::conv_marker(MarkerLocator& ml, MarkerShapes& ms) : m_marker_locator(&ml), m_marker_shapes(&ms), @@ -79,7 +79,7 @@ namespace agg //------------------------------------------------------------------------ - template<class MarkerLocator, class MarkerShapes> + template<class MarkerLocator, class MarkerShapes> void conv_marker<MarkerLocator, MarkerShapes>::rewind(unsigned) { m_status = initial; @@ -89,7 +89,7 @@ namespace agg //------------------------------------------------------------------------ - template<class MarkerLocator, class MarkerShapes> + template<class MarkerLocator, class MarkerShapes> unsigned conv_marker<MarkerLocator, MarkerShapes>::vertex(double* x, double* y) { unsigned cmd = path_cmd_move_to; diff --git a/agg/inc/agg_conv_marker_adaptor.h b/agg/inc/agg_conv_marker_adaptor.h index 282d26eb5afc..98d4f77807e1 100755 --- a/agg/inc/agg_conv_marker_adaptor.h +++ b/agg/inc/agg_conv_marker_adaptor.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. // @@ -25,13 +25,13 @@ namespace agg //=====================================================conv_marker_adaptor template<class VertexSource, class Markers=null_markers> - struct conv_marker_adaptor : + struct conv_marker_adaptor : public conv_adaptor_vcgen<VertexSource, vcgen_vertex_sequence, Markers> { typedef Markers marker_type; typedef conv_adaptor_vcgen<VertexSource, vcgen_vertex_sequence, Markers> base_type; - conv_marker_adaptor(VertexSource& vs) : + conv_marker_adaptor(VertexSource& vs) : conv_adaptor_vcgen<VertexSource, vcgen_vertex_sequence, Markers>(vs) { } @@ -41,7 +41,7 @@ namespace agg private: conv_marker_adaptor(const conv_marker_adaptor<VertexSource, Markers>&); - const conv_marker_adaptor<VertexSource, Markers>& + const conv_marker_adaptor<VertexSource, Markers>& operator = (const conv_marker_adaptor<VertexSource, Markers>&); }; diff --git a/agg/inc/agg_conv_segmentator.h b/agg/inc/agg_conv_segmentator.h index df81fea9b276..fbdf2162d23a 100755 --- a/agg/inc/agg_conv_segmentator.h +++ b/agg/inc/agg_conv_segmentator.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. // @@ -24,12 +24,12 @@ namespace agg { //========================================================conv_segmentator - template<class VertexSource> + template<class VertexSource> struct conv_segmentator : public conv_adaptor_vpgen<VertexSource, vpgen_segmentator> { typedef conv_adaptor_vpgen<VertexSource, vpgen_segmentator> base_type; - conv_segmentator(VertexSource& vs) : + conv_segmentator(VertexSource& vs) : conv_adaptor_vpgen<VertexSource, vpgen_segmentator>(vs) {} void approximation_scale(double s) { base_type::vpgen().approximation_scale(s); } @@ -37,7 +37,7 @@ namespace agg private: conv_segmentator(const conv_segmentator<VertexSource>&); - const conv_segmentator<VertexSource>& + const conv_segmentator<VertexSource>& operator = (const conv_segmentator<VertexSource>&); }; diff --git a/agg/inc/agg_conv_shorten_path.h b/agg/inc/agg_conv_shorten_path.h index 07bc9357d6ca..5fcf4b27bcc6 100755 --- a/agg/inc/agg_conv_shorten_path.h +++ b/agg/inc/agg_conv_shorten_path.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. // @@ -24,13 +24,13 @@ namespace agg { //=======================================================conv_shorten_path - template<class VertexSource> class conv_shorten_path : + template<class VertexSource> class conv_shorten_path : public conv_adaptor_vcgen<VertexSource, vcgen_vertex_sequence> { public: typedef conv_adaptor_vcgen<VertexSource, vcgen_vertex_sequence> base_type; - conv_shorten_path(VertexSource& vs) : + conv_shorten_path(VertexSource& vs) : conv_adaptor_vcgen<VertexSource, vcgen_vertex_sequence>(vs) { } @@ -40,7 +40,7 @@ namespace agg private: conv_shorten_path(const conv_shorten_path<VertexSource>&); - const conv_shorten_path<VertexSource>& + const conv_shorten_path<VertexSource>& operator = (const conv_shorten_path<VertexSource>&); }; diff --git a/agg/inc/agg_conv_smooth_poly1.h b/agg/inc/agg_conv_smooth_poly1.h index f50a48747f9a..895c2171ec1c 100755 --- a/agg/inc/agg_conv_smooth_poly1.h +++ b/agg/inc/agg_conv_smooth_poly1.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. // @@ -29,13 +29,13 @@ namespace agg { //-------------------------------------------------------conv_smooth_poly1 - template<class VertexSource> - struct conv_smooth_poly1 : + template<class VertexSource> + struct conv_smooth_poly1 : public conv_adaptor_vcgen<VertexSource, vcgen_smooth_poly1> { typedef conv_adaptor_vcgen<VertexSource, vcgen_smooth_poly1> base_type; - conv_smooth_poly1(VertexSource& vs) : + conv_smooth_poly1(VertexSource& vs) : conv_adaptor_vcgen<VertexSource, vcgen_smooth_poly1>(vs) { } @@ -45,15 +45,15 @@ namespace agg private: conv_smooth_poly1(const conv_smooth_poly1<VertexSource>&); - const conv_smooth_poly1<VertexSource>& + const conv_smooth_poly1<VertexSource>& operator = (const conv_smooth_poly1<VertexSource>&); }; //-------------------------------------------------conv_smooth_poly1_curve - template<class VertexSource> - struct conv_smooth_poly1_curve : + template<class VertexSource> + struct conv_smooth_poly1_curve : public conv_curve<conv_smooth_poly1<VertexSource> > { conv_smooth_poly1_curve(VertexSource& vs) : @@ -67,7 +67,7 @@ namespace agg private: conv_smooth_poly1_curve(const conv_smooth_poly1_curve<VertexSource>&); - const conv_smooth_poly1_curve<VertexSource>& + const conv_smooth_poly1_curve<VertexSource>& operator = (const conv_smooth_poly1_curve<VertexSource>&); conv_smooth_poly1<VertexSource> m_smooth; diff --git a/agg/inc/agg_conv_stroke.h b/agg/inc/agg_conv_stroke.h index cbdce446b7be..0cf6c114da27 100755 --- a/agg/inc/agg_conv_stroke.h +++ b/agg/inc/agg_conv_stroke.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. // @@ -27,14 +27,14 @@ namespace agg { //-------------------------------------------------------------conv_stroke - template<class VertexSource, class Markers=null_markers> - struct conv_stroke : + template<class VertexSource, class Markers=null_markers> + struct conv_stroke : public conv_adaptor_vcgen<VertexSource, vcgen_stroke, Markers> { typedef Markers marker_type; typedef conv_adaptor_vcgen<VertexSource, vcgen_stroke, Markers> base_type; - conv_stroke(VertexSource& vs) : + conv_stroke(VertexSource& vs) : conv_adaptor_vcgen<VertexSource, vcgen_stroke, Markers>(vs) { } @@ -63,7 +63,7 @@ namespace agg private: conv_stroke(const conv_stroke<VertexSource, Markers>&); - const conv_stroke<VertexSource, Markers>& + const conv_stroke<VertexSource, Markers>& operator = (const conv_stroke<VertexSource, Markers>&); }; diff --git a/agg/inc/agg_conv_transform.h b/agg/inc/agg_conv_transform.h index fb2dddcef617..580e34b63e56 100755 --- a/agg/inc/agg_conv_transform.h +++ b/agg/inc/agg_conv_transform.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. // @@ -35,9 +35,9 @@ namespace agg void set_source(VertexSource& source) { m_source = &source; } - void rewind(unsigned id) - { - m_source->rewind(id); + void rewind(unsigned id) + { + m_source->rewind(id); } unsigned vertex(double* x, double* y) @@ -62,7 +62,7 @@ namespace agg private: conv_transform(const conv_transform<VertexSource>&); - const conv_transform<VertexSource>& + const conv_transform<VertexSource>& operator = (const conv_transform<VertexSource>&); VertexSource* m_source; diff --git a/agg/inc/agg_conv_unclose_polygon.h b/agg/inc/agg_conv_unclose_polygon.h index a6ba30a1119e..802d4c4ea2c2 100755 --- a/agg/inc/agg_conv_unclose_polygon.h +++ b/agg/inc/agg_conv_unclose_polygon.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. // @@ -48,7 +48,7 @@ namespace agg private: conv_unclose_polygon(const conv_unclose_polygon<VertexSource>&); - const conv_unclose_polygon<VertexSource>& + const conv_unclose_polygon<VertexSource>& operator = (const conv_unclose_polygon<VertexSource>&); VertexSource* m_source; diff --git a/agg/inc/agg_curves.h b/agg/inc/agg_curves.h index bfb02e91ab96..b69e218a0e07 100755 --- a/agg/inc/agg_curves.h +++ b/agg/inc/agg_curves.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. // @@ -28,7 +28,7 @@ namespace agg // See Implemantation agg_curves.cpp - + //------------------------------------------------------------------curve3 class curve3 { @@ -36,17 +36,17 @@ namespace agg curve3() : m_num_steps(0), m_step(0), m_scale(1.0) { } - curve3(double x1, double y1, - double x2, double y2, + curve3(double x1, double y1, + double x2, double y2, double x3, double y3) : - m_num_steps(0), m_step(0), m_scale(1.0) - { + m_num_steps(0), m_step(0), m_scale(1.0) + { init(x1, y1, x2, y2, x3, y3); } void reset() { m_num_steps = 0; m_step = -1; } - void init(double x1, double y1, - double x2, double y2, + void init(double x1, double y1, + double x2, double y2, double x3, double y3); void approximation_scale(double s) { m_scale = s; } double approximation_scale() const { return m_scale; } @@ -63,19 +63,19 @@ namespace agg int m_num_steps; int m_step; double m_scale; - double m_start_x; + double m_start_x; double m_start_y; - double m_end_x; + double m_end_x; double m_end_y; - double m_fx; + double m_fx; double m_fy; - double m_dfx; + double m_dfx; double m_dfy; - double m_ddfx; + double m_ddfx; double m_ddfy; - double m_saved_fx; + double m_saved_fx; double m_saved_fy; - double m_saved_dfx; + double m_saved_dfx; double m_saved_dfy; }; @@ -92,18 +92,18 @@ namespace agg curve4() : m_num_steps(0), m_step(0), m_scale(1.0) { } - curve4(double x1, double y1, - double x2, double y2, + curve4(double x1, double y1, + double x2, double y2, double x3, double y3, double x4, double y4) : - m_num_steps(0), m_step(0), m_scale(1.0) - { + m_num_steps(0), m_step(0), m_scale(1.0) + { init(x1, y1, x2, y2, x3, y3, x4, y4); } void reset() { m_num_steps = 0; m_step = -1; } - void init(double x1, double y1, - double x2, double y2, + void init(double x1, double y1, + double x2, double y2, double x3, double y3, double x4, double y4); @@ -122,23 +122,23 @@ namespace agg int m_num_steps; int m_step; double m_scale; - double m_start_x; + double m_start_x; double m_start_y; - double m_end_x; + double m_end_x; double m_end_y; - double m_fx; + double m_fx; double m_fy; - double m_dfx; + double m_dfx; double m_dfy; - double m_ddfx; + double m_ddfx; double m_ddfy; - double m_dddfx; + double m_dddfx; double m_dddfy; - double m_saved_fx; + double m_saved_fx; double m_saved_fy; - double m_saved_dfx; + double m_saved_dfx; double m_saved_dfy; - double m_saved_ddfx; + double m_saved_ddfx; double m_saved_ddfy; }; diff --git a/agg/inc/agg_dda_line.h b/agg/inc/agg_dda_line.h index 6e7335c6dfec..142964867b44 100755 --- a/agg/inc/agg_dda_line.h +++ b/agg/inc/agg_dda_line.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. // @@ -234,15 +234,15 @@ namespace agg m_x2_lr(line_lr(_x2)), m_y2_lr(line_lr(_y2)), m_ver(abs(m_x2_lr - m_x1_lr) < abs(m_y2_lr - m_y1_lr)), - m_len(m_ver ? abs(m_y2_lr - m_y1_lr) : + m_len(m_ver ? abs(m_y2_lr - m_y1_lr) : abs(m_x2_lr - m_x1_lr)), m_inc(m_ver ? ((_y2 > _y1) ? 1 : -1) : ((_x2 > _x1) ? 1 : -1)), - m_interpolator(m_ver ? _x1 : _y1, - m_ver ? _x2 : _y2, + m_interpolator(m_ver ? _x1 : _y1, + m_ver ? _x2 : _y2, m_len) { } - + //-------------------------------------------------------------------- bool is_ver() const { return m_ver; } unsigned len() const { return m_len; } diff --git a/agg/inc/agg_ellipse.h b/agg/inc/agg_ellipse.h index 158ecf8b55ed..a40d9d6d1818 100755 --- a/agg/inc/agg_ellipse.h +++ b/agg/inc/agg_ellipse.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. // @@ -31,7 +31,7 @@ namespace agg { public: ellipse() : m_x(0.0), m_y(0.0), m_rx(1.0), m_ry(1.0), m_num(4), m_step(0) {} - ellipse(double x, double y, double rx, double ry, unsigned num_steps) + ellipse(double x, double y, double rx, double ry, unsigned num_steps) : m_x(x), m_y(y), m_rx(rx), m_ry(ry), m_num(num_steps), m_step(0) {} void init(double x, double y, double rx, double ry, unsigned num_steps); @@ -62,7 +62,7 @@ namespace agg //------------------------------------------------------------------------ inline void ellipse::approximation_scale(double scale) - { + { m_num = unsigned((fabs(m_rx) + fabs(m_ry) + 6.0) * scale); if(m_num < 6) m_num = 6; } @@ -76,7 +76,7 @@ namespace agg //------------------------------------------------------------------------ inline unsigned ellipse::vertex(double* x, double* y) { - if(m_step == m_num) + if(m_step == m_num) { ++m_step; return path_cmd_end_poly | path_flags_close | path_flags_ccw; diff --git a/agg/inc/agg_ellipse_bresenham.h b/agg/inc/agg_ellipse_bresenham.h index 41133a473d9e..80ee97c9a97c 100755 --- a/agg/inc/agg_ellipse_bresenham.h +++ b/agg/inc/agg_ellipse_bresenham.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. // @@ -42,7 +42,7 @@ namespace agg m_inc_y(-ry * m_two_rx2), m_cur_f(0) {} - + int dx() const { return m_dx; } int dy() const { return m_dy; } @@ -60,28 +60,28 @@ namespace agg mxy = fxy = m_cur_f + m_inc_x + m_ry2 + m_inc_y + m_rx2; if(mxy < 0) mxy = -mxy; - min_m = mx; + min_m = mx; bool flag = true; - if(min_m > my) - { - min_m = my; - flag = false; + if(min_m > my) + { + min_m = my; + flag = false; } m_dx = m_dy = 0; - if(min_m > mxy) - { + if(min_m > mxy) + { m_inc_x += m_two_ry2; m_inc_y += m_two_rx2; m_cur_f = fxy; - m_dx = 1; + m_dx = 1; m_dy = 1; return; } - if(flag) + if(flag) { m_inc_x += m_two_ry2; m_cur_f = fx; diff --git a/agg/inc/agg_embedded_raster_fonts.h b/agg/inc/agg_embedded_raster_fonts.h index f30fedfebe39..5df2411ceeef 100755 --- a/agg/inc/agg_embedded_raster_fonts.h +++ b/agg/inc/agg_embedded_raster_fonts.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. // diff --git a/agg/inc/agg_font_cache_manager.h b/agg/inc/agg_font_cache_manager.h index 55c4d39db75d..6ff9fade21f8 100755 --- a/agg/inc/agg_font_cache_manager.h +++ b/agg/inc/agg_font_cache_manager.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. // @@ -52,7 +52,7 @@ namespace agg enum { block_size = 16384-16 }; //-------------------------------------------------------------------- - font_cache(const char* font_signature) : + font_cache(const char* font_signature) : m_allocator(block_size), m_font_signature(0) { @@ -71,7 +71,7 @@ namespace agg const glyph_cache* find_glyph(unsigned glyph_code) const { unsigned msb = (glyph_code >> 8) & 0xFF; - if(m_glyphs[msb]) + if(m_glyphs[msb]) { return m_glyphs[msb][glyph_code & 0xFF]; } @@ -79,7 +79,7 @@ namespace agg } //-------------------------------------------------------------------- - glyph_cache* cache_glyph(unsigned glyph_code, + glyph_cache* cache_glyph(unsigned glyph_code, unsigned glyph_index, unsigned data_size, glyph_data_type data_type, @@ -90,8 +90,8 @@ namespace agg unsigned msb = (glyph_code >> 8) & 0xFF; if(m_glyphs[msb] == 0) { - m_glyphs[msb] = - (glyph_cache**)m_allocator.allocate(sizeof(glyph_cache*) * 256, + m_glyphs[msb] = + (glyph_cache**)m_allocator.allocate(sizeof(glyph_cache*) * 256, sizeof(glyph_cache*)); memset(m_glyphs[msb], 0, sizeof(glyph_cache*) * 256); } @@ -99,7 +99,7 @@ namespace agg unsigned lsb = glyph_code & 0xFF; if(m_glyphs[msb][lsb]) return 0; // Already exists, do not overwrite - glyph_cache* glyph = + glyph_cache* glyph = (glyph_cache*)m_allocator.allocate(sizeof(glyph_cache), sizeof(double)); @@ -124,7 +124,7 @@ namespace agg - + //---------------------------------------------------------font_cache_pool class font_cache_pool { @@ -141,7 +141,7 @@ namespace agg } //-------------------------------------------------------------------- - font_cache_pool(unsigned max_fonts=32) : + font_cache_pool(unsigned max_fonts=32) : m_fonts(new font_cache* [max_fonts]), m_max_fonts(max_fonts), m_num_fonts(0), @@ -167,8 +167,8 @@ namespace agg if(m_num_fonts >= m_max_fonts) { delete m_fonts[0]; - memcpy(m_fonts, - m_fonts + 1, + memcpy(m_fonts, + m_fonts + 1, (m_max_fonts - 1) * sizeof(font_cache*)); m_num_fonts = m_max_fonts - 1; } @@ -192,7 +192,7 @@ namespace agg } //-------------------------------------------------------------------- - glyph_cache* cache_glyph(unsigned glyph_code, + glyph_cache* cache_glyph(unsigned glyph_code, unsigned glyph_index, unsigned data_size, glyph_data_type data_type, @@ -200,7 +200,7 @@ namespace agg double advance_x, double advance_y) { - if(m_cur_font) + if(m_cur_font) { return m_cur_font->cache_glyph(glyph_code, glyph_index, @@ -274,7 +274,7 @@ namespace agg { synchronize(); const glyph_cache* gl = m_fonts.find_glyph(glyph_code); - if(gl) + if(gl) { m_prev_glyph = m_last_glyph; return m_last_glyph = gl; @@ -284,7 +284,7 @@ namespace agg if(m_engine.prepare_glyph(glyph_code)) { m_prev_glyph = m_last_glyph; - m_last_glyph = m_fonts.cache_glyph(glyph_code, + m_last_glyph = m_fonts.cache_glyph(glyph_code, m_engine.glyph_index(), m_engine.data_size(), m_engine.data_type(), @@ -299,8 +299,8 @@ namespace agg } //-------------------------------------------------------------------- - void init_embedded_adaptors(const glyph_cache* gl, - double x, double y, + void init_embedded_adaptors(const glyph_cache* gl, + double x, double y, double scale=1.0) { if(gl) @@ -340,7 +340,7 @@ namespace agg { if(m_prev_glyph && m_last_glyph) { - return m_engine.add_kerning(m_prev_glyph->glyph_index, + return m_engine.add_kerning(m_prev_glyph->glyph_index, m_last_glyph->glyph_index, x, y); } diff --git a/agg/inc/agg_gamma_functions.h b/agg/inc/agg_gamma_functions.h index 09a8305faedb..646d3fe09c0e 100755 --- a/agg/inc/agg_gamma_functions.h +++ b/agg/inc/agg_gamma_functions.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. // diff --git a/agg/inc/agg_gamma_lut.h b/agg/inc/agg_gamma_lut.h index 30e3b3c89d04..e6e9ea34b7f9 100755 --- a/agg/inc/agg_gamma_lut.h +++ b/agg/inc/agg_gamma_lut.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. // @@ -21,9 +21,9 @@ namespace agg { - template<class LoResT=int8u, - class HiResT=int8u, - unsigned GammaShift=8, + template<class LoResT=int8u, + class HiResT=int8u, + unsigned GammaShift=8, unsigned HiResShift=8> class gamma_lut { public: @@ -47,8 +47,8 @@ namespace agg delete [] m_dir_gamma; } - gamma_lut() : - m_gamma(1.0), + gamma_lut() : + m_gamma(1.0), m_dir_gamma(new HiResT[gamma_size]), m_inv_gamma(new LoResT[hi_res_size]) { @@ -65,14 +65,14 @@ namespace agg } gamma_lut(double g) : - m_gamma(1.0), + m_gamma(1.0), m_dir_gamma(new HiResT[gamma_size]), m_inv_gamma(new LoResT[hi_res_size]) { gamma(g); } - void gamma(double g) + void gamma(double g) { m_gamma = g; @@ -94,13 +94,13 @@ namespace agg return m_gamma; } - HiResT dir(LoResT v) const - { - return m_dir_gamma[unsigned(v)]; + HiResT dir(LoResT v) const + { + return m_dir_gamma[unsigned(v)]; } - LoResT inv(HiResT v) const - { + LoResT inv(HiResT v) const + { return m_inv_gamma[unsigned(v)]; } diff --git a/agg/inc/agg_glyph_raster_bin.h b/agg/inc/agg_glyph_raster_bin.h index 851d9f94bd72..f960735f2cc0 100755 --- a/agg/inc/agg_glyph_raster_bin.h +++ b/agg/inc/agg_glyph_raster_bin.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. // @@ -64,7 +64,7 @@ namespace agg while(*str) { unsigned glyph = *str; - const int8u* bits = m_font + 4 + num_chars * 2 + + const int8u* bits = m_font + 4 + num_chars * 2 + value(m_font + 4 + (glyph - start_char) * 2); w += *bits; ++str; @@ -78,7 +78,7 @@ namespace agg unsigned start_char = m_font[2]; unsigned num_chars = m_font[3]; - m_bits = m_font + 4 + num_chars * 2 + + m_bits = m_font + 4 + num_chars * 2 + value(m_font + 4 + (glyph - start_char) * 2); m_glyph_width = *m_bits++; @@ -96,7 +96,7 @@ namespace agg r->y1 = int(y) - m_font[1] + 1; r->y2 = r->y1 + m_font[0] - 1; } - r->dx = m_glyph_width; + r->dx = m_glyph_width; r->dy = 0; } diff --git a/agg/inc/agg_gsv_text.h b/agg/inc/agg_gsv_text.h index 5d8e1cf63bab..f6593ef51184 100755 --- a/agg/inc/agg_gsv_text.h +++ b/agg/inc/agg_gsv_text.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. // @@ -30,7 +30,7 @@ namespace agg //---------------------------------------------------------------gsv_text // - // See Implementation agg_gsv_text.cpp + // See Implementation agg_gsv_text.cpp // class gsv_text { @@ -119,19 +119,19 @@ namespace agg { } - void width(double w) - { - m_polyline.width(w); + void width(double w) + { + m_polyline.width(w); } - void transformer(const Transformer* trans) + void transformer(const Transformer* trans) { m_trans->transformer(trans); } - void rewind(unsigned id) - { - m_trans.rewind(id); + void rewind(unsigned id) + { + m_trans.rewind(id); m_polyline.line_join(round_join); m_polyline.line_cap(round_cap); } diff --git a/agg/inc/agg_image_filters.h b/agg/inc/agg_image_filters.h index a2037fe0eff1..e498d0567c84 100755 --- a/agg/inc/agg_image_filters.h +++ b/agg/inc/agg_image_filters.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. // @@ -26,17 +26,17 @@ namespace agg { - // See Implementation agg_image_filters.cpp + // See Implementation agg_image_filters.cpp enum { image_filter_shift = 14, //----image_filter_shift - image_filter_size = 1 << image_filter_shift, //----image_filter_size - image_filter_mask = image_filter_size - 1, //----image_filter_mask + image_filter_size = 1 << image_filter_shift, //----image_filter_size + image_filter_mask = image_filter_size - 1, //----image_filter_mask image_subpixel_shift = 8, //----image_subpixel_shift - image_subpixel_size = 1 << image_subpixel_shift, //----image_subpixel_size - image_subpixel_mask = image_subpixel_size - 1 //----image_subpixel_mask + image_subpixel_size = 1 << image_subpixel_shift, //----image_subpixel_size + image_subpixel_mask = image_subpixel_size - 1 //----image_subpixel_mask }; @@ -58,19 +58,19 @@ namespace agg { double x = double(i) / double(image_subpixel_size); double y = filter.calc_weight(x); - m_weight_array[pivot + i] = + m_weight_array[pivot + i] = m_weight_array[pivot - i] = int16(y * image_filter_size + 0.5); } unsigned end = (diameter() << image_subpixel_shift) - 1; m_weight_array[0] = m_weight_array[end]; - if(normalization) + if(normalization) { normalize(); } } - template<class FilterF> image_filter_lut(const FilterF& filter, - bool normalization=true) : + template<class FilterF> image_filter_lut(const FilterF& filter, + bool normalization=true) : m_weight_array(0), m_max_size(0) { @@ -151,7 +151,7 @@ namespace agg return (2.0 * x - 3.0) * x * x + 1.0; } }; - + //------------------------------------------------image_filter_quadric struct image_filter_quadric { @@ -178,7 +178,7 @@ namespace agg static double calc_weight(double x) { return - (1.0/6.0) * + (1.0/6.0) * (pow3(x + 2) - 4 * pow3(x + 1) + 6 * pow3(x) - 4 * pow3(x - 1)); } }; @@ -212,7 +212,7 @@ namespace agg sum = 1.; y = x * x / 4.; t = y; - + for(i = 2; t > epsilon; i++) { sum += t; @@ -299,7 +299,7 @@ namespace agg struct image_filter_gaussian { static double radius() { return 2.0; } - static double calc_weight(double x) + static double calc_weight(double x) { return exp(-2.0 * x * x) * sqrt(2.0 / pi); } @@ -309,7 +309,7 @@ namespace agg //------------------------------------------------image_filter_bessel struct image_filter_bessel { - static double radius() { return 3.2383; } + static double radius() { return 3.2383; } static double calc_weight(double x) { return (x == 0.0) ? pi / 4.0 : j1(pi * x) / (2.0 * x); diff --git a/agg/inc/agg_line_aa_basics.h b/agg/inc/agg_line_aa_basics.h index ab8e94715019..71433cb9642b 100755 --- a/agg/inc/agg_line_aa_basics.h +++ b/agg/inc/agg_line_aa_basics.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. // @@ -21,39 +21,39 @@ namespace agg { - // See Implementation agg_line_aa_basics.cpp + // See Implementation agg_line_aa_basics.cpp //------------------------------------------------------------------------- enum { line_subpixel_shift = 8, //----line_subpixel_shift - line_subpixel_size = 1 << line_subpixel_shift, //----line_subpixel_size - line_subpixel_mask = line_subpixel_size - 1 //----line_subpixel_mask + line_subpixel_size = 1 << line_subpixel_shift, //----line_subpixel_size + line_subpixel_mask = line_subpixel_size - 1 //----line_subpixel_mask }; //------------------------------------------------------------------------- enum { line_mr_subpixel_shift = 4, //----line_mr_subpixel_shift - line_mr_subpixel_size = 1 << line_mr_subpixel_shift, //----line_mr_subpixel_size - line_mr_subpixel_mask = line_mr_subpixel_size - 1 //----line_mr_subpixel_mask + line_mr_subpixel_size = 1 << line_mr_subpixel_shift, //----line_mr_subpixel_size + line_mr_subpixel_mask = line_mr_subpixel_size - 1 //----line_mr_subpixel_mask }; //------------------------------------------------------------------line_mr - inline int line_mr(int x) - { - return x >> ((int)line_subpixel_shift - (int)line_mr_subpixel_shift); + inline int line_mr(int x) + { + return x >> ((int)line_subpixel_shift - (int)line_mr_subpixel_shift); } //-------------------------------------------------------------------line_hr - inline int line_hr(int x) - { - return x << ((int)line_subpixel_shift - (int)line_mr_subpixel_shift); + inline int line_hr(int x) + { + return x << ((int)line_subpixel_shift - (int)line_mr_subpixel_shift); } //---------------------------------------------------------------line_dbl_hr - inline int line_dbl_hr(int x) - { + inline int line_dbl_hr(int x) + { return x << line_subpixel_shift; } @@ -69,7 +69,7 @@ namespace agg //--------------------------------------------------------------------- line_parameters() {} line_parameters(int x1_, int y1_, int x2_, int y2_, int len_) : - x1(x1_), y1(y1_), x2(x2_), y2(y2_), + x1(x1_), y1(y1_), x2(x2_), y2(y2_), dx(abs(x2_ - x1_)), dy(abs(y2_ - y1_)), sx((x2_ > x1_) ? 1 : -1), @@ -96,7 +96,7 @@ namespace agg { return s_diagonal_quadrant[octant] == s_diagonal_quadrant[lp.octant]; } - + //--------------------------------------------------------------------- int x1, y1, x2, y2, dx, dy, sx, sy; bool vertical; @@ -111,19 +111,19 @@ namespace agg - // See Implementation agg_line_aa_basics.cpp + // See Implementation agg_line_aa_basics.cpp //----------------------------------------------------------------bisectrix - void bisectrix(const line_parameters& l1, - const line_parameters& l2, + void bisectrix(const line_parameters& l1, + const line_parameters& l2, int* x, int* y); //-------------------------------------------fix_degenerate_bisectrix_start - void inline fix_degenerate_bisectrix_start(const line_parameters& lp, + void inline fix_degenerate_bisectrix_start(const line_parameters& lp, int* x, int* y) { - int d = int((double(*x - lp.x2) * double(lp.y2 - lp.y1) - + int d = int((double(*x - lp.x2) * double(lp.y2 - lp.y1) - double(*y - lp.y2) * double(lp.x2 - lp.x1)) / lp.len); if(d < line_subpixel_size) { @@ -134,10 +134,10 @@ namespace agg //---------------------------------------------fix_degenerate_bisectrix_end - void inline fix_degenerate_bisectrix_end(const line_parameters& lp, + void inline fix_degenerate_bisectrix_end(const line_parameters& lp, int* x, int* y) { - int d = int((double(*x - lp.x2) * double(lp.y2 - lp.y1) - + int d = int((double(*x - lp.x2) * double(lp.y2 - lp.y1) - double(*y - lp.y2) * double(lp.x2 - lp.x1)) / lp.len); if(d < line_subpixel_size) { diff --git a/agg/inc/agg_math.h b/agg/inc/agg_math.h index 4aef4df9638e..2389a47fef42 100755 --- a/agg/inc/agg_math.h +++ b/agg/inc/agg_math.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. // @@ -25,8 +25,8 @@ namespace agg const double intersection_epsilon = 1.0e-8; //------------------------------------------------------calc_point_location - AGG_INLINE double calc_point_location(double x1, double y1, - double x2, double y2, + AGG_INLINE double calc_point_location(double x1, double y1, + double x2, double y2, double x, double y) { return (x - x2) * (y2 - y1) - (y - y2) * (x2 - x1); @@ -34,9 +34,9 @@ namespace agg //--------------------------------------------------------point_in_triangle - AGG_INLINE bool point_in_triangle(double x1, double y1, - double x2, double y2, - double x3, double y3, + AGG_INLINE bool point_in_triangle(double x1, double y1, + double x2, double y2, + double x3, double y3, double x, double y) { bool cp1 = calc_point_location(x1, y1, x2, y2, x, y) < 0.0; @@ -56,8 +56,8 @@ namespace agg //------------------------------------------------calc_point_line_distance - AGG_INLINE double calc_point_line_distance(double x1, double y1, - double x2, double y2, + AGG_INLINE double calc_point_line_distance(double x1, double y1, + double x2, double y2, double x, double y) { double dx = x2-x1; @@ -89,7 +89,7 @@ namespace agg { double dx = x2 - x1; double dy = y2 - y1; - double d = sqrt(dx*dx + dy*dy); + double d = sqrt(dx*dx + dy*dy); *x = thickness * dy / d; *y = thickness * dx / d; } @@ -103,15 +103,15 @@ namespace agg double d) { double dx1=0.0; - double dy1=0.0; + double dy1=0.0; double dx2=0.0; - double dy2=0.0; + double dy2=0.0; double dx3=0.0; - double dy3=0.0; + double dy3=0.0; double loc = calc_point_location(x1, y1, x2, y2, x3, y3); if(fabs(loc) > intersection_epsilon) { - if(calc_point_location(x1, y1, x2, y2, x3, y3) > 0.0) + if(calc_point_location(x1, y1, x2, y2, x3, y3) > 0.0) { d = -d; } @@ -162,8 +162,8 @@ namespace agg AGG_INLINE unsigned fast_sqrt(unsigned val) { #if defined(_M_IX86) && defined(_MSC_VER) && !defined(AGG_NO_ASM) - //For Ix86 family processors this assembler code is used. - //The key command here is bsr - determination the number of the most + //For Ix86 family processors this assembler code is used. + //The key command here is bsr - determination the number of the most //significant bit of the value. For other processors //(and maybe compilers) the pure C "#else" section is used. __asm @@ -186,15 +186,15 @@ namespace agg } #else - //This code is actually pure C and portable to most - //arcitectures including 64bit ones. + //This code is actually pure C and portable to most + //arcitectures including 64bit ones. unsigned t = val; int bit=0; unsigned shift = 11; //The following piece of code is just an emulation of the //Ix86 assembler command "bsr" (see above). However on old - //Intels (like Intel MMX 233MHz) this code is about twice + //Intels (like Intel MMX 233MHz) this code is about twice //faster (sic!) then just one "bsr". On PIII and PIV the //bsr is optimized quite well. bit = t >> 24; diff --git a/agg/inc/agg_math_stroke.h b/agg/inc/agg_math_stroke.h index 84d83738a9cd..c3734b3c1ad6 100755 --- a/agg/inc/agg_math_stroke.h +++ b/agg/inc/agg_math_stroke.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. // @@ -49,8 +49,8 @@ namespace agg //--------------------------------------------------------stroke_calc_arc template<class VertexConsumer> void stroke_calc_arc(VertexConsumer& out_vertices, - double x, double y, - double dx1, double dy1, + double x, double y, + double dx1, double dy1, double dx2, double dy2, double width, double approximation_scale) @@ -76,7 +76,7 @@ namespace agg if(fabs(da) < stroke_theta) { - out_vertices.add(coord_type((x + x + dx1 + dx2) * 0.5, + out_vertices.add(coord_type((x + x + dx1 + dx2) * 0.5, (y + y + dy1 + dy2) * 0.5)); return; } @@ -111,10 +111,10 @@ namespace agg //-------------------------------------------------------stroke_calc_miter template<class VertexConsumer> void stroke_calc_miter(VertexConsumer& out_vertices, - const vertex_dist& v0, - const vertex_dist& v1, + const vertex_dist& v0, + const vertex_dist& v1, const vertex_dist& v2, - double dx1, double dy1, + double dx1, double dy1, double dx2, double dy2, double width, bool revert_flag, @@ -136,14 +136,14 @@ namespace agg //---------------- if(calc_distance(dx1, -dy1, dx2, -dy2) < width * 0.025) { - // This case means that the next segment continues + // This case means that the next segment continues // the previous one (straight line) //----------------- out_vertices.add(coord_type(v1.x + dx1, v1.y - dy1)); } else { - // This case means that the next segment goes back + // This case means that the next segment goes back //----------------- if(revert_flag) { @@ -153,9 +153,9 @@ namespace agg else { // If no miter-revert, calcuate new dx1, dy1, dx2, dy2 - out_vertices.add(coord_type(v1.x + dx1 + dy1 * miter_limit, + out_vertices.add(coord_type(v1.x + dx1 + dy1 * miter_limit, v1.y - dy1 + dx1 * miter_limit)); - out_vertices.add(coord_type(v1.x + dx2 - dy2 * miter_limit, + out_vertices.add(coord_type(v1.x + dx2 - dy2 * miter_limit, v1.y - dy2 - dx2 * miter_limit)); } } @@ -170,7 +170,7 @@ namespace agg //------------------------ if(revert_flag) { - // For the compatibility with SVG, PDF, etc, + // For the compatibility with SVG, PDF, etc, // we use a simple bevel join instead of // "smart" bevel //------------------- @@ -212,8 +212,8 @@ namespace agg //--------------------------------------------------------stroke_calc_cap template<class VertexConsumer> void stroke_calc_cap(VertexConsumer& out_vertices, - const vertex_dist& v0, - const vertex_dist& v1, + const vertex_dist& v0, + const vertex_dist& v1, double len, line_cap_e line_cap, double width, @@ -241,7 +241,7 @@ namespace agg double da = fabs(1.0 / (width * approximation_scale)); while(a1 < a2) { - out_vertices.add(coord_type(v0.x + cos(a1) * width, + out_vertices.add(coord_type(v0.x + cos(a1) * width, v0.y + sin(a1) * width)); a1 += da; } @@ -259,12 +259,12 @@ namespace agg //-------------------------------------------------------stroke_calc_join template<class VertexConsumer> void stroke_calc_join(VertexConsumer& out_vertices, - const vertex_dist& v0, - const vertex_dist& v1, + const vertex_dist& v0, + const vertex_dist& v1, const vertex_dist& v2, - double len1, + double len1, double len2, - double width, + double width, line_join_e line_join, line_join_e inner_line_join, double miter_limit, @@ -288,9 +288,9 @@ namespace agg // Inner join //--------------- stroke_calc_miter(out_vertices, - v0, v1, v2, dx1, dy1, dx2, dy2, - width, - inner_line_join == miter_join_revert, + v0, v1, v2, dx1, dy1, dx2, dy2, + width, + inner_line_join == miter_join_revert, inner_miter_limit); } else @@ -300,24 +300,24 @@ namespace agg switch(line_join) { case miter_join: - stroke_calc_miter(out_vertices, - v0, v1, v2, dx1, dy1, dx2, dy2, - width, - false, + stroke_calc_miter(out_vertices, + v0, v1, v2, dx1, dy1, dx2, dy2, + width, + false, miter_limit); break; case miter_join_revert: - stroke_calc_miter(out_vertices, - v0, v1, v2, dx1, dy1, dx2, dy2, - width, - true, + stroke_calc_miter(out_vertices, + v0, v1, v2, dx1, dy1, dx2, dy2, + width, + true, miter_limit); break; case round_join: - stroke_calc_arc(out_vertices, - v1.x, v1.y, dx1, -dy1, dx2, -dy2, + stroke_calc_arc(out_vertices, + v1.x, v1.y, dx1, -dy1, dx2, -dy2, width, approximation_scale); break; diff --git a/agg/inc/agg_path_storage.h b/agg/inc/agg_path_storage.h index 8cdb9b9bbeb6..3c584d8036cf 100755 --- a/agg/inc/agg_path_storage.h +++ b/agg/inc/agg_path_storage.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. // @@ -22,16 +22,16 @@ namespace agg { //------------------------------------------------------------path_storage - // A container to store vertices with their flags. - // A path consists of a number of contours separated with "move_to" + // A container to store vertices with their flags. + // A path consists of a number of contours separated with "move_to" // commands. The path storage can keep and maintain more than one - // path. + // path. // To navigate to the beginning of a particular path, use rewind(path_id); // Where path_id is what start_new_path() returns. So, when you call // start_new_path() you need to store its return value somewhere else // to navigate to the path afterwards. // - // See Implementation: agg_path_storage.cpp + // See Implementation: agg_path_storage.cpp // See also: vertex_source concept //------------------------------------------------------------------------ class path_storage @@ -52,7 +52,7 @@ namespace agg { void vertex() { - if(m_vertex_idx < m_path->total_vertices()) + if(m_vertex_idx < m_path->total_vertices()) { m_vertex.cmd = m_path->vertex(m_vertex_idx, &m_vertex.x, &m_vertex.y); } @@ -66,21 +66,21 @@ namespace agg public: const_iterator() {} const_iterator(unsigned cmd) { m_vertex.cmd = cmd; } - const_iterator(const const_iterator& i) : + const_iterator(const const_iterator& i) : m_path(i.m_path), m_vertex_idx(i.m_vertex_idx), - m_vertex(i.m_vertex) + m_vertex(i.m_vertex) { } - const_iterator(const path_storage& p, unsigned id) : + const_iterator(const path_storage& p, unsigned id) : m_path(&p), m_vertex_idx(id) { vertex(); } - const_iterator& operator++() + const_iterator& operator++() { ++m_vertex_idx; vertex(); @@ -90,9 +90,9 @@ namespace agg const vertex_type& operator*() const { return m_vertex; } const vertex_type* operator->() const { return &m_vertex; } - bool operator != (const const_iterator& i) - { - return m_vertex.cmd != i.m_vertex.cmd; + bool operator != (const const_iterator& i) + { + return m_vertex.cmd != i.m_vertex.cmd; } private: @@ -130,28 +130,28 @@ namespace agg bool sweep_flag, double dx, double dy); - void curve3(double x_ctrl, double y_ctrl, + void curve3(double x_ctrl, double y_ctrl, double x_to, double y_to); - void curve3_rel(double dx_ctrl, double dy_ctrl, + void curve3_rel(double dx_ctrl, double dy_ctrl, double dx_to, double dy_to); void curve3(double x_to, double y_to); void curve3_rel(double dx_to, double dy_to); - void curve4(double x_ctrl1, double y_ctrl1, - double x_ctrl2, double y_ctrl2, + void curve4(double x_ctrl1, double y_ctrl1, + double x_ctrl2, double y_ctrl2, double x_to, double y_to); - void curve4_rel(double dx_ctrl1, double dy_ctrl1, - double dx_ctrl2, double dy_ctrl2, + void curve4_rel(double dx_ctrl1, double dy_ctrl1, + double dx_ctrl2, double dy_ctrl2, double dx_to, double dy_to); - void curve4(double x_ctrl2, double y_ctrl2, + void curve4(double x_ctrl2, double y_ctrl2, double x_to, double y_to); - void curve4_rel(double x_ctrl2, double y_ctrl2, + void curve4_rel(double x_ctrl2, double y_ctrl2, double x_to, double y_to); @@ -162,13 +162,13 @@ namespace agg end_poly(path_flags_close | flags); } - void add_poly(const double* vertices, unsigned num, + void add_poly(const double* vertices, unsigned num, bool solid_path = false, unsigned end_flags = path_flags_none); - template<class VertexSource> - void add_path(VertexSource& vs, - unsigned path_id = 0, + template<class VertexSource> + void add_path(VertexSource& vs, + unsigned path_id = 0, bool solid_path = true) { double x, y; @@ -176,7 +176,7 @@ namespace agg vs.rewind(path_id); while(!is_stop(cmd = vs.vertex(&x, &y))) { - if(is_move_to(cmd) && solid_path && m_total_vertices) + if(is_move_to(cmd) && solid_path && m_total_vertices) { cmd = path_cmd_line_to; } @@ -217,7 +217,7 @@ namespace agg // Arrange the orientation of all the polygons. After calling this // method all the polygons will have the same orientation - // determined by the new_orientation flag, i.e., + // determined by the new_orientation flag, i.e., // path_flags_cw or path_flags_ccw unsigned arrange_orientations(unsigned path_id, path_flags_e new_orientation); void arrange_orientations_all_paths(path_flags_e new_orientation); @@ -225,14 +225,14 @@ namespace agg // Flip all the vertices horizontally or vertically void flip_x(double x1, double x2); void flip_y(double y1, double y2); - - // This function adds a vertex with its flags directly. Since there's no + + // This function adds a vertex with its flags directly. Since there's no // checking for errors, keeping proper path integrity is the responsibility - // of the caller. It can be said the function is "not very public". + // of the caller. It can be said the function is "not very public". void add_vertex(double x, double y, unsigned cmd); - // Allows you to modify vertex coordinates. The caller must know - // the index of the vertex. + // Allows you to modify vertex coordinates. The caller must know + // the index of the vertex. void modify_vertex(unsigned idx, double x, double y) { double* pv = m_coord_blocks[idx >> block_shift] + ((idx & block_mask) << 1); @@ -240,8 +240,8 @@ namespace agg *pv = y; } - // Allows you to modify vertex command. The caller must know - // the index of the vertex. + // Allows you to modify vertex command. The caller must know + // the index of the vertex. void modify_command(unsigned idx, unsigned cmd) { m_cmd_blocks[idx >> block_shift][idx & block_mask] = (unsigned char)cmd; @@ -251,7 +251,7 @@ namespace agg private: void allocate_block(unsigned nb); unsigned char* storage_ptrs(double** xy_ptr); - unsigned perceive_polygon_orientation(unsigned idx, + unsigned perceive_polygon_orientation(unsigned idx, double xs, double ys, unsigned* orientation); void reverse_polygon(unsigned start, unsigned end); diff --git a/agg/inc/agg_path_storage_integer.h b/agg/inc/agg_path_storage_integer.h index 841bd10aa27a..4b21fc6746af 100755 --- a/agg/inc/agg_path_storage_integer.h +++ b/agg/inc/agg_path_storage_integer.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. // @@ -45,7 +45,7 @@ namespace agg x(((x_ << 1) & ~1) | (flag & 1)), y(((y_ << 1) & ~1) | (flag >> 1)) {} - unsigned vertex(double* x_, double* y_, + unsigned vertex(double* x_, double* y_, double dx=0, double dy=0, double scale=1.0) const { @@ -88,7 +88,7 @@ namespace agg } //-------------------------------------------------------------------- - void curve3(T x_ctrl, T y_ctrl, + void curve3(T x_ctrl, T y_ctrl, T x_to, T y_to) { m_storage.add(vertex_integer_type(x_ctrl, y_ctrl, vertex_integer_type::cmd_curve3)); @@ -96,8 +96,8 @@ namespace agg } //-------------------------------------------------------------------- - void curve4(T x_ctrl1, T y_ctrl1, - T x_ctrl2, T y_ctrl2, + void curve4(T x_ctrl1, T y_ctrl1, + T x_ctrl2, T y_ctrl2, T x_to, T y_to) { m_storage.add(vertex_integer_type(x_ctrl1, y_ctrl1, vertex_integer_type::cmd_curve4)); @@ -132,16 +132,16 @@ namespace agg //-------------------------------------------------------------------- - void rewind(unsigned) - { - m_vertex_idx = 0; + void rewind(unsigned) + { + m_vertex_idx = 0; m_closed = true; } //-------------------------------------------------------------------- unsigned vertex(double* x, double* y) { - if(m_storage.size() < 2 || m_vertex_idx > m_storage.size()) + if(m_storage.size() < 2 || m_vertex_idx > m_storage.size()) { *x = 0; *y = 0; @@ -230,7 +230,7 @@ namespace agg {} //-------------------------------------------------------------------- - void init(const int8u* data, unsigned size, + void init(const int8u* data, unsigned size, double dx, double dy, double scale=1.0) { m_data = data; @@ -244,16 +244,16 @@ namespace agg //-------------------------------------------------------------------- - void rewind(unsigned) - { - m_ptr = m_data; + void rewind(unsigned) + { + m_ptr = m_data; m_vertices = 0; } //-------------------------------------------------------------------- unsigned vertex(double* x, double* y) { - if(m_data == 0 || m_ptr > m_end) + if(m_data == 0 || m_ptr > m_end) { *x = 0; *y = 0; diff --git a/agg/inc/agg_pattern_filters_rgba.h b/agg/inc/agg_pattern_filters_rgba.h index 5d194b2e39ba..bdad87b567f2 100755 --- a/agg/inc/agg_pattern_filters_rgba.h +++ b/agg/inc/agg_pattern_filters_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. // @@ -29,13 +29,13 @@ namespace agg typedef ColorT color_type; static unsigned dilation() { return 0; } - static void AGG_INLINE pixel_low_res(color_type const* const* buf, + static void AGG_INLINE pixel_low_res(color_type const* const* buf, color_type* p, int x, int y) { *p = buf[y][x]; } - static void AGG_INLINE pixel_high_res(color_type const* const* buf, + static void AGG_INLINE pixel_high_res(color_type const* const* buf, color_type* p, int x, int y) { *p = buf[y >> line_subpixel_shift] @@ -57,13 +57,13 @@ namespace agg static unsigned dilation() { return 1; } - static AGG_INLINE void pixel_low_res(color_type const* const* buf, + static AGG_INLINE void pixel_low_res(color_type const* const* buf, color_type* p, int x, int y) { *p = buf[y][x]; } - static AGG_INLINE void pixel_high_res(color_type const* const* buf, + static AGG_INLINE void pixel_high_res(color_type const* const* buf, color_type* p, int x, int y) { calc_type r, g, b, a; @@ -77,7 +77,7 @@ namespace agg y &= line_subpixel_mask; const color_type* ptr = buf[y_lr] + x_lr; - weight = (line_subpixel_size - x) * + weight = (line_subpixel_size - x) * (line_subpixel_size - y); r += weight * ptr->r; g += weight * ptr->g; diff --git a/agg/inc/agg_pixfmt_amask_adaptor.h b/agg/inc/agg_pixfmt_amask_adaptor.h index 7f3d5899b1c6..b28f8eb97592 100755 --- a/agg/inc/agg_pixfmt_amask_adaptor.h +++ b/agg/inc/agg_pixfmt_amask_adaptor.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. // @@ -92,8 +92,8 @@ namespace agg } //-------------------------------------------------------------------- - void copy_hline(int x, int y, - unsigned len, + void copy_hline(int x, int y, + unsigned len, const color_type& c) { realloc_span(len); @@ -103,7 +103,7 @@ namespace agg //-------------------------------------------------------------------- void blend_hline(int x, int y, - unsigned len, + unsigned len, const color_type& c, cover_type cover) { @@ -114,7 +114,7 @@ namespace agg //-------------------------------------------------------------------- void copy_vline(int x, int y, - unsigned len, + unsigned len, const color_type& c) { realloc_span(len); @@ -124,7 +124,7 @@ namespace agg //-------------------------------------------------------------------- void blend_vline(int x, int y, - unsigned len, + unsigned len, const color_type& c, cover_type cover) { @@ -134,7 +134,7 @@ namespace agg } //-------------------------------------------------------------------- - void copy_from(const rendering_buffer& from, + void copy_from(const rendering_buffer& from, int xdst, int ydst, int xsrc, int ysrc, unsigned len) @@ -145,7 +145,7 @@ namespace agg //-------------------------------------------------------------------- void blend_solid_hspan(int x, int y, - unsigned len, + unsigned len, const color_type& c, const cover_type* covers) { @@ -157,7 +157,7 @@ namespace agg //-------------------------------------------------------------------- void blend_solid_vspan(int x, int y, - unsigned len, + unsigned len, const color_type& c, const cover_type* covers) { @@ -169,12 +169,12 @@ namespace agg //-------------------------------------------------------------------- void blend_color_hspan(int x, int y, - unsigned len, + unsigned len, const color_type* colors, const cover_type* covers, cover_type cover = cover_full) { - if(covers) + if(covers) { init_span(len, covers); m_mask->combine_hspan(x, y, m_span, len); @@ -190,12 +190,12 @@ namespace agg //-------------------------------------------------------------------- void blend_color_vspan(int x, int y, - unsigned len, + unsigned len, const color_type* colors, const cover_type* covers, cover_type cover = cover_full) { - if(covers) + if(covers) { init_span(len, covers); m_mask->combine_vspan(x, y, m_span, len); @@ -211,12 +211,12 @@ namespace agg //-------------------------------------------------------------------- void blend_opaque_color_hspan(int x, int y, - unsigned len, + unsigned len, const color_type* colors, const cover_type* covers, cover_type cover = cover_full) { - if(covers) + if(covers) { init_span(len, covers); m_mask->combine_hspan(x, y, m_span, len); @@ -232,12 +232,12 @@ namespace agg //-------------------------------------------------------------------- void blend_opaque_color_vspan(int x, int y, - unsigned len, + unsigned len, const color_type* colors, const cover_type* covers, cover_type cover = cover_full) { - if(covers) + if(covers) { init_span(len, covers); m_mask->combine_vspan(x, y, m_span, len); diff --git a/agg/inc/agg_pixfmt_gray.h b/agg/inc/agg_pixfmt_gray.h index 48f47d1de32e..0226ccd971d9 100755 --- a/agg/inc/agg_pixfmt_gray.h +++ b/agg/inc/agg_pixfmt_gray.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. -// +// //---------------------------------------------------------------------------- #ifndef AGG_PIXFMT_GRAY_INCLUDED @@ -31,7 +31,7 @@ namespace agg { - + //============================================================blender_gray template<class ColorT> struct blender_gray { @@ -40,7 +40,7 @@ namespace agg typedef typename color_type::calc_type calc_type; enum { base_shift = color_type::base_shift }; - static AGG_INLINE void blend_pix(value_type* p, unsigned cv, + static AGG_INLINE void blend_pix(value_type* p, unsigned cv, unsigned alpha, unsigned) { *p = (value_type)((((cv - calc_type(*p)) * alpha) + (calc_type(*p) << base_shift)) >> base_shift); @@ -64,7 +64,7 @@ namespace agg *p = (value_type)((*p * alpha + cv * cover) >> base_shift); } }; - + //=====================================================apply_gamma_dir_gray @@ -123,8 +123,8 @@ namespace agg private: //-------------------------------------------------------------------- - static AGG_INLINE void copy_or_blend_pix(value_type* p, - const color_type& c, + static AGG_INLINE void copy_or_blend_pix(value_type* p, + const color_type& c, unsigned cover) { if (c.a) @@ -142,8 +142,8 @@ namespace agg } //-------------------------------------------------------------------- - static AGG_INLINE void copy_or_blend_opaque_pix(value_type* p, - const color_type& c, + static AGG_INLINE void copy_or_blend_opaque_pix(value_type* p, + const color_type& c, unsigned cover) { if(cover == 255) @@ -177,10 +177,10 @@ namespace agg //-------------------------------------------------------------------- row_data span(int x, int y) const { - return row_data(x, - width() - 1, - m_rbuf->row(y) + - x * Step * sizeof(value_type) + + return row_data(x, + width() - 1, + m_rbuf->row(y) + + x * Step * sizeof(value_type) + Offset * sizeof(value_type)); } @@ -198,14 +198,14 @@ namespace agg //-------------------------------------------------------------------- - AGG_INLINE void copy_hline(int x, int y, - unsigned len, + AGG_INLINE void copy_hline(int x, int y, + unsigned len, const color_type& c) { value_type* p = (value_type*)m_rbuf->row(y) + x * Step + Offset; do { - *p = c.v; + *p = c.v; p += Step; } while(--len); @@ -214,7 +214,7 @@ namespace agg //-------------------------------------------------------------------- AGG_INLINE void copy_vline(int x, int y, - unsigned len, + unsigned len, const color_type& c) { value_type* p = (value_type*)m_rbuf->row(y) + x * Step + Offset; @@ -229,7 +229,7 @@ namespace agg //-------------------------------------------------------------------- void blend_hline(int x, int y, - unsigned len, + unsigned len, const color_type& c, int8u cover) { @@ -241,7 +241,7 @@ namespace agg { do { - *p = c.v; + *p = c.v; p += Step; } while(--len); @@ -261,7 +261,7 @@ namespace agg //-------------------------------------------------------------------- void blend_vline(int x, int y, - unsigned len, + unsigned len, const color_type& c, int8u cover) { @@ -273,7 +273,7 @@ namespace agg { do { - *p = c.v; + *p = c.v; p = (value_type*)m_rbuf->next_row(p); } while(--len); @@ -293,14 +293,14 @@ namespace agg //-------------------------------------------------------------------- void blend_solid_hspan(int x, int y, - unsigned len, + unsigned len, const color_type& c, const int8u* covers) { if (c.a) { value_type* p = (value_type*)m_rbuf->row(y) + x * Step + Offset; - do + do { calc_type alpha = (calc_type(c.a) * (calc_type(*covers) + 1)) >> 8; if(alpha == base_mask) @@ -321,14 +321,14 @@ namespace agg //-------------------------------------------------------------------- void blend_solid_vspan(int x, int y, - unsigned len, + unsigned len, const color_type& c, const int8u* covers) { if (c.a) { value_type* p = (value_type*)m_rbuf->row(y) + x * Step + Offset; - do + do { calc_type alpha = (calc_type(c.a) * (calc_type(*covers) + 1)) >> 8; if(alpha == base_mask) @@ -349,7 +349,7 @@ namespace agg //-------------------------------------------------------------------- void blend_color_hspan(int x, int y, - unsigned len, + unsigned len, const color_type* colors, const int8u* covers, int8u cover) @@ -357,7 +357,7 @@ namespace agg value_type* p = (value_type*)m_rbuf->row(y) + x * Step + Offset; if(covers) { - do + do { copy_or_blend_pix(p, *colors++, *covers++); p += Step; @@ -368,7 +368,7 @@ namespace agg { if(cover == 255) { - do + do { if(colors->a == base_mask) { @@ -385,7 +385,7 @@ namespace agg } else { - do + do { copy_or_blend_pix(p, *colors++, cover); p += Step; @@ -399,7 +399,7 @@ namespace agg //-------------------------------------------------------------------- void blend_color_vspan(int x, int y, - unsigned len, + unsigned len, const color_type* colors, const int8u* covers, int8u cover) @@ -407,7 +407,7 @@ namespace agg value_type* p = (value_type*)m_rbuf->row(y) + x * Step + Offset; if(covers) { - do + do { copy_or_blend_pix(p, *colors++, *covers++); p = (value_type*)m_rbuf->next_row(p); @@ -418,7 +418,7 @@ namespace agg { if(cover == 255) { - do + do { if(colors->a == base_mask) { @@ -435,7 +435,7 @@ namespace agg } else { - do + do { copy_or_blend_pix(p, *colors++, cover); p = (value_type*)m_rbuf->next_row(p); @@ -447,7 +447,7 @@ namespace agg //-------------------------------------------------------------------- void blend_opaque_color_hspan(int x, int y, - unsigned len, + unsigned len, const color_type* colors, const int8u* covers, int8u cover) @@ -455,7 +455,7 @@ namespace agg value_type* p = (value_type*)m_rbuf->row(y) + x * Step + Offset; if(covers) { - do + do { copy_or_blend_opaque_pix(p, *colors++, *covers++); p += Step; @@ -466,7 +466,7 @@ namespace agg { if(cover == 255) { - do + do { *p = colors->v; p += Step; @@ -476,7 +476,7 @@ namespace agg } else { - do + do { copy_or_blend_opaque_pix(p, *colors++, cover); p += Step; @@ -489,7 +489,7 @@ namespace agg //-------------------------------------------------------------------- void blend_opaque_color_vspan(int x, int y, - unsigned len, + unsigned len, const color_type* colors, const int8u* covers, int8u cover) @@ -497,7 +497,7 @@ namespace agg value_type* p = (value_type*)m_rbuf->row(y) + x * Step + Offset; if(covers) { - do + do { copy_or_blend_opaque_pix(p, *colors++, *covers++); p = (value_type*)m_rbuf->next_row(p); @@ -508,7 +508,7 @@ namespace agg { if(cover == 255) { - do + do { *p = colors->v; p = (value_type*)m_rbuf->next_row(p); @@ -518,7 +518,7 @@ namespace agg } else { - do + do { copy_or_blend_opaque_pix(p, *colors++, cover); p = (value_type*)m_rbuf->next_row(p); @@ -558,13 +558,13 @@ namespace agg } //-------------------------------------------------------------------- - void copy_from(const rendering_buffer& from, + void copy_from(const rendering_buffer& from, int xdst, int ydst, int xsrc, int ysrc, unsigned len) { - memmove((value_type*)m_rbuf->row(ydst) + xdst, - (value_type*)from.row(ysrc) + xsrc, + memmove((value_type*)m_rbuf->row(ydst) + xdst, + (value_type*)from.row(ysrc) + xsrc, sizeof(value_type) * len); } diff --git a/agg/inc/agg_pixfmt_rgb.h b/agg/inc/agg_pixfmt_rgb.h index 436dfa4b284f..767bb4e74c85 100755 --- a/agg/inc/agg_pixfmt_rgb.h +++ b/agg/inc/agg_pixfmt_rgb.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. -// +// //---------------------------------------------------------------------------- #ifndef AGG_PIXFMT_RGB_INCLUDED @@ -83,9 +83,9 @@ namespace agg enum { base_shift = color_type::base_shift }; //-------------------------------------------------------------------- - static AGG_INLINE void blend_pix(value_type* p, - unsigned cr, unsigned cg, unsigned cb, - unsigned alpha, + static AGG_INLINE void blend_pix(value_type* p, + unsigned cr, unsigned cg, unsigned cb, + unsigned alpha, unsigned) { p[Order::R] += (value_type)(((cr - p[Order::R]) * alpha) >> base_shift); @@ -105,7 +105,7 @@ namespace agg enum { base_shift = color_type::base_shift }; //-------------------------------------------------------------------- - static AGG_INLINE void blend_pix(value_type* p, + static AGG_INLINE void blend_pix(value_type* p, unsigned cr, unsigned cg, unsigned cb, unsigned alpha, unsigned cover) @@ -136,9 +136,9 @@ namespace agg void gamma(const gamma_type& g) { m_gamma = &g; } //-------------------------------------------------------------------- - AGG_INLINE void blend_pix(value_type* p, + AGG_INLINE void blend_pix(value_type* p, unsigned cr, unsigned cg, unsigned cb, - unsigned alpha, + unsigned alpha, unsigned) { calc_type r = m_gamma->dir(p[Order::R]); @@ -155,7 +155,7 @@ namespace agg - + //==================================================pixel_formats_rgb template<class Blender> class pixel_formats_rgb { @@ -174,8 +174,8 @@ namespace agg private: //-------------------------------------------------------------------- - AGG_INLINE void copy_or_blend_pix(value_type* p, - const color_type& c, + AGG_INLINE void copy_or_blend_pix(value_type* p, + const color_type& c, unsigned cover) { if (c.a) @@ -195,8 +195,8 @@ namespace agg } //-------------------------------------------------------------------- - AGG_INLINE void copy_or_blend_opaque_pix(value_type* p, - const color_type& c, + AGG_INLINE void copy_or_blend_opaque_pix(value_type* p, + const color_type& c, unsigned cover) { if(cover == 255) @@ -229,16 +229,16 @@ namespace agg AGG_INLINE color_type pixel(int x, int y) const { value_type* p = (value_type*)m_rbuf->row(y) + x + x + x; - return color_type(p[order_type::R], - p[order_type::G], + return color_type(p[order_type::R], + p[order_type::G], p[order_type::B]); } //-------------------------------------------------------------------- row_data span(int x, int y) const { - return row_data(x, - width() - 1, + return row_data(x, + width() - 1, m_rbuf->row(y) + x * 3 * sizeof(value_type)); } @@ -259,15 +259,15 @@ namespace agg //-------------------------------------------------------------------- - AGG_INLINE void copy_hline(int x, int y, - unsigned len, + AGG_INLINE void copy_hline(int x, int y, + unsigned len, const color_type& c) { value_type* p = (value_type*)m_rbuf->row(y) + x + x + x; do { - p[order_type::R] = c.r; - p[order_type::G] = c.g; + p[order_type::R] = c.r; + p[order_type::G] = c.g; p[order_type::B] = c.b; p += 3; } @@ -277,14 +277,14 @@ namespace agg //-------------------------------------------------------------------- AGG_INLINE void copy_vline(int x, int y, - unsigned len, + unsigned len, const color_type& c) { value_type* p = (value_type*)m_rbuf->row(y) + x + x + x; do { - p[order_type::R] = c.r; - p[order_type::G] = c.g; + p[order_type::R] = c.r; + p[order_type::G] = c.g; p[order_type::B] = c.b; p = (value_type*)m_rbuf->next_row(p); } @@ -294,7 +294,7 @@ namespace agg //-------------------------------------------------------------------- void blend_hline(int x, int y, - unsigned len, + unsigned len, const color_type& c, int8u cover) { @@ -306,8 +306,8 @@ namespace agg { do { - p[order_type::R] = c.r; - p[order_type::G] = c.g; + p[order_type::R] = c.r; + p[order_type::G] = c.g; p[order_type::B] = c.b; p += 3; } @@ -328,7 +328,7 @@ namespace agg //-------------------------------------------------------------------- void blend_vline(int x, int y, - unsigned len, + unsigned len, const color_type& c, int8u cover) { @@ -340,8 +340,8 @@ namespace agg { do { - p[order_type::R] = c.r; - p[order_type::G] = c.g; + p[order_type::R] = c.r; + p[order_type::G] = c.g; p[order_type::B] = c.b; p = (value_type*)m_rbuf->next_row(p); } @@ -362,14 +362,14 @@ namespace agg //-------------------------------------------------------------------- void blend_solid_hspan(int x, int y, - unsigned len, + unsigned len, const color_type& c, const int8u* covers) { if (c.a) { value_type* p = (value_type*)m_rbuf->row(y) + x + x + x; - do + do { calc_type alpha = (calc_type(c.a) * (calc_type(*covers) + 1)) >> 8; if(alpha == base_mask) @@ -392,14 +392,14 @@ namespace agg //-------------------------------------------------------------------- void blend_solid_vspan(int x, int y, - unsigned len, + unsigned len, const color_type& c, const int8u* covers) { if (c.a) { value_type* p = (value_type*)m_rbuf->row(y) + x + x + x; - do + do { calc_type alpha = (calc_type(c.a) * (calc_type(*covers) + 1)) >> 8; if(alpha == base_mask) @@ -422,7 +422,7 @@ namespace agg //-------------------------------------------------------------------- void blend_color_hspan(int x, int y, - unsigned len, + unsigned len, const color_type* colors, const int8u* covers, int8u cover) @@ -430,7 +430,7 @@ namespace agg value_type* p = (value_type*)m_rbuf->row(y) + x + x + x; if(covers) { - do + do { copy_or_blend_pix(p, *colors++, *covers++); p += 3; @@ -441,7 +441,7 @@ namespace agg { if(cover == 255) { - do + do { if(colors->a == base_mask) { @@ -460,7 +460,7 @@ namespace agg } else { - do + do { copy_or_blend_pix(p, *colors++, cover); p += 3; @@ -474,7 +474,7 @@ namespace agg //-------------------------------------------------------------------- void blend_color_vspan(int x, int y, - unsigned len, + unsigned len, const color_type* colors, const int8u* covers, int8u cover) @@ -482,7 +482,7 @@ namespace agg value_type* p = (value_type*)m_rbuf->row(y) + x + x + x; if(covers) { - do + do { copy_or_blend_pix(p, *colors++, *covers++); p = (value_type*)m_rbuf->next_row(p); @@ -493,7 +493,7 @@ namespace agg { if(cover == 255) { - do + do { if(colors->a == base_mask) { @@ -512,7 +512,7 @@ namespace agg } else { - do + do { copy_or_blend_pix(p, *colors++, cover); p = (value_type*)m_rbuf->next_row(p); @@ -525,7 +525,7 @@ namespace agg //-------------------------------------------------------------------- void blend_opaque_color_hspan(int x, int y, - unsigned len, + unsigned len, const color_type* colors, const int8u* covers, int8u cover) @@ -533,7 +533,7 @@ namespace agg value_type* p = (value_type*)m_rbuf->row(y) + x + x + x; if(covers) { - do + do { copy_or_blend_opaque_pix(p, *colors++, *covers++); p += 3; @@ -544,7 +544,7 @@ namespace agg { if(cover == 255) { - do + do { p[order_type::R] = colors->r; p[order_type::G] = colors->g; @@ -556,7 +556,7 @@ namespace agg } else { - do + do { copy_or_blend_opaque_pix(p, *colors++, cover); p += 3; @@ -569,7 +569,7 @@ namespace agg //-------------------------------------------------------------------- void blend_opaque_color_vspan(int x, int y, - unsigned len, + unsigned len, const color_type* colors, const int8u* covers, int8u cover) @@ -577,7 +577,7 @@ namespace agg value_type* p = (value_type*)m_rbuf->row(y) + x + x + x; if(covers) { - do + do { copy_or_blend_opaque_pix(p, *colors++, *covers++); p = (value_type*)m_rbuf->next_row(p); @@ -588,7 +588,7 @@ namespace agg { if(cover == 255) { - do + do { p[order_type::R] = colors->r; p[order_type::G] = colors->g; @@ -600,7 +600,7 @@ namespace agg } else { - do + do { copy_or_blend_opaque_pix(p, *colors++, cover); p = (value_type*)m_rbuf->next_row(p); @@ -640,20 +640,20 @@ namespace agg } //-------------------------------------------------------------------- - void copy_from(const rendering_buffer& from, + void copy_from(const rendering_buffer& from, int xdst, int ydst, int xsrc, int ysrc, unsigned len) { - memmove((value_type*)m_rbuf->row(ydst) + xdst * 3, - (const value_type*)from.row(ysrc) + xsrc * 3, + memmove((value_type*)m_rbuf->row(ydst) + xdst * 3, + (const value_type*)from.row(ysrc) + xsrc * 3, sizeof(value_type) * 3 * len); } //-------------------------------------------------------------------- template<class SrcPixelFormatRenderer> - void blend_from(const SrcPixelFormatRenderer& from, + void blend_from(const SrcPixelFormatRenderer& from, const int8u* psrc_, int xdst, int ydst, int xsrc, int ysrc, @@ -663,7 +663,7 @@ namespace agg const value_type* psrc = (const value_type*)psrc_; value_type* pdst = (value_type*)m_rbuf->row(ydst) + xdst * 3; - do + do { value_type alpha = psrc[src_order::A]; if(alpha) @@ -676,7 +676,7 @@ namespace agg } else { - m_blender.blend_pix(pdst, + m_blender.blend_pix(pdst, psrc[src_order::R], psrc[src_order::G], psrc[src_order::B], @@ -706,48 +706,48 @@ namespace agg typedef pixel_formats_rgb<blender_rgb_pre<rgba16, order_bgr> > pixfmt_bgr48_pre; //----pixfmt_bgr48_pre //-----------------------------------------------------pixfmt_rgb24_gamma - template<class Gamma> class pixfmt_rgb24_gamma : + template<class Gamma> class pixfmt_rgb24_gamma : public pixel_formats_rgb<blender_rgb_gamma<rgba8, order_rgb, Gamma> > { public: pixfmt_rgb24_gamma(rendering_buffer& rb, const Gamma& g) : - pixel_formats_rgb<blender_rgb_gamma<rgba8, order_rgb, Gamma> >(rb) + pixel_formats_rgb<blender_rgb_gamma<rgba8, order_rgb, Gamma> >(rb) { this->blender().gamma(g); } }; - + //-----------------------------------------------------pixfmt_bgr24_gamma - template<class Gamma> class pixfmt_bgr24_gamma : + template<class Gamma> class pixfmt_bgr24_gamma : public pixel_formats_rgb<blender_rgb_gamma<rgba8, order_bgr, Gamma> > { public: pixfmt_bgr24_gamma(rendering_buffer& rb, const Gamma& g) : - pixel_formats_rgb<blender_rgb_gamma<rgba8, order_bgr, Gamma> >(rb) + pixel_formats_rgb<blender_rgb_gamma<rgba8, order_bgr, Gamma> >(rb) { this->blender().gamma(g); } }; //-----------------------------------------------------pixfmt_rgb48_gamma - template<class Gamma> class pixfmt_rgb48_gamma : + template<class Gamma> class pixfmt_rgb48_gamma : public pixel_formats_rgb<blender_rgb_gamma<rgba16, order_rgb, Gamma> > { public: pixfmt_rgb48_gamma(rendering_buffer& rb, const Gamma& g) : - pixel_formats_rgb<blender_rgb_gamma<rgba16, order_rgb, Gamma> >(rb) + pixel_formats_rgb<blender_rgb_gamma<rgba16, order_rgb, Gamma> >(rb) { this->blender().gamma(g); } }; - + //-----------------------------------------------------pixfmt_bgr48_gamma - template<class Gamma> class pixfmt_bgr48_gamma : + template<class Gamma> class pixfmt_bgr48_gamma : public pixel_formats_rgb<blender_rgb_gamma<rgba16, order_bgr, Gamma> > { public: pixfmt_bgr48_gamma(rendering_buffer& rb, const Gamma& g) : - pixel_formats_rgb<blender_rgb_gamma<rgba16, order_bgr, Gamma> >(rb) + pixel_formats_rgb<blender_rgb_gamma<rgba16, order_bgr, Gamma> >(rb) { this->blender().gamma(g); } diff --git a/agg/inc/agg_pixfmt_rgb_packed.h b/agg/inc/agg_pixfmt_rgb_packed.h index 4f582ed59847..621c27e23662 100755 --- a/agg/inc/agg_pixfmt_rgb_packed.h +++ b/agg/inc/agg_pixfmt_rgb_packed.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. -// +// //---------------------------------------------------------------------------- #ifndef AGG_PIXFMT_RGB_PACKED_INCLUDED @@ -39,9 +39,9 @@ namespace agg typedef color_type::calc_type calc_type; typedef int16u pixel_type; - static AGG_INLINE void blend_pix(pixel_type* p, + static AGG_INLINE void blend_pix(pixel_type* p, unsigned cr, unsigned cg, unsigned cb, - unsigned alpha, + unsigned alpha, unsigned) { pixel_type rgb = *p; @@ -56,15 +56,15 @@ namespace agg static AGG_INLINE pixel_type make_pix(unsigned r, unsigned g, unsigned b) { - return (pixel_type)(((r & 0xF8) << 7) | - ((g & 0xF8) << 2) | + return (pixel_type)(((r & 0xF8) << 7) | + ((g & 0xF8) << 2) | (b >> 3) | 0x8000); } static AGG_INLINE color_type make_color(pixel_type p) { - return color_type((p >> 7) & 0xF8, - (p >> 2) & 0xF8, + return color_type((p >> 7) & 0xF8, + (p >> 2) & 0xF8, (p << 3) & 0xF8); } }; @@ -78,9 +78,9 @@ namespace agg typedef color_type::calc_type calc_type; typedef int16u pixel_type; - static AGG_INLINE void blend_pix(pixel_type* p, + static AGG_INLINE void blend_pix(pixel_type* p, unsigned cr, unsigned cg, unsigned cb, - unsigned alpha, + unsigned alpha, unsigned cover) { alpha = color_type::base_mask - alpha; @@ -96,15 +96,15 @@ namespace agg static AGG_INLINE pixel_type make_pix(unsigned r, unsigned g, unsigned b) { - return (pixel_type)(((r & 0xF8) << 7) | - ((g & 0xF8) << 2) | + return (pixel_type)(((r & 0xF8) << 7) | + ((g & 0xF8) << 2) | (b >> 3) | 0x8000); } static AGG_INLINE color_type make_color(pixel_type p) { - return color_type((p >> 7) & 0xF8, - (p >> 2) & 0xF8, + return color_type((p >> 7) & 0xF8, + (p >> 2) & 0xF8, (p << 3) & 0xF8); } }; @@ -125,9 +125,9 @@ namespace agg blender_rgb555_gamma() : m_gamma(0) {} void gamma(const gamma_type& g) { m_gamma = &g; } - AGG_INLINE void blend_pix(pixel_type* p, + AGG_INLINE void blend_pix(pixel_type* p, unsigned cr, unsigned cg, unsigned cb, - unsigned alpha, + unsigned alpha, unsigned) { pixel_type rgb = *p; @@ -142,15 +142,15 @@ namespace agg static AGG_INLINE pixel_type make_pix(unsigned r, unsigned g, unsigned b) { - return (pixel_type)(((r & 0xF8) << 7) | - ((g & 0xF8) << 2) | + return (pixel_type)(((r & 0xF8) << 7) | + ((g & 0xF8) << 2) | (b >> 3) | 0x8000); } static AGG_INLINE color_type make_color(pixel_type p) { - return color_type((p >> 7) & 0xF8, - (p >> 2) & 0xF8, + return color_type((p >> 7) & 0xF8, + (p >> 2) & 0xF8, (p << 3) & 0xF8); } @@ -170,9 +170,9 @@ namespace agg typedef color_type::calc_type calc_type; typedef int16u pixel_type; - static AGG_INLINE void blend_pix(pixel_type* p, + static AGG_INLINE void blend_pix(pixel_type* p, unsigned cr, unsigned cg, unsigned cb, - unsigned alpha, + unsigned alpha, unsigned) { pixel_type rgb = *p; @@ -192,8 +192,8 @@ namespace agg static AGG_INLINE color_type make_color(pixel_type p) { - return color_type((p >> 8) & 0xF8, - (p >> 3) & 0xFC, + return color_type((p >> 8) & 0xF8, + (p >> 3) & 0xFC, (p << 3) & 0xF8); } }; @@ -208,9 +208,9 @@ namespace agg typedef color_type::calc_type calc_type; typedef int16u pixel_type; - static AGG_INLINE void blend_pix(pixel_type* p, + static AGG_INLINE void blend_pix(pixel_type* p, unsigned cr, unsigned cg, unsigned cb, - unsigned alpha, + unsigned alpha, unsigned cover) { alpha = color_type::base_mask - alpha; @@ -231,8 +231,8 @@ namespace agg static AGG_INLINE color_type make_color(pixel_type p) { - return color_type((p >> 8) & 0xF8, - (p >> 3) & 0xFC, + return color_type((p >> 8) & 0xF8, + (p >> 3) & 0xFC, (p << 3) & 0xF8); } }; @@ -252,9 +252,9 @@ namespace agg blender_rgb565_gamma() : m_gamma(0) {} void gamma(const gamma_type& g) { m_gamma = &g; } - AGG_INLINE void blend_pix(pixel_type* p, + AGG_INLINE void blend_pix(pixel_type* p, unsigned cr, unsigned cg, unsigned cb, - unsigned alpha, + unsigned alpha, unsigned) { pixel_type rgb = *p; @@ -274,8 +274,8 @@ namespace agg static AGG_INLINE color_type make_color(pixel_type p) { - return color_type((p >> 8) & 0xF8, - (p >> 3) & 0xFC, + return color_type((p >> 8) & 0xF8, + (p >> 3) & 0xFC, (p << 3) & 0xF8); } @@ -293,9 +293,9 @@ namespace agg typedef color_type::calc_type calc_type; typedef int32u pixel_type; - static AGG_INLINE void blend_pix(pixel_type* p, + static AGG_INLINE void blend_pix(pixel_type* p, unsigned cr, unsigned cg, unsigned cb, - unsigned alpha, + unsigned alpha, unsigned) { pixel_type rgb = *p; @@ -310,15 +310,15 @@ namespace agg static AGG_INLINE pixel_type make_pix(unsigned r, unsigned g, unsigned b) { - return (pixel_type)(((r & 0xFFC0) << 14) | - ((g & 0xFFC0) << 4) | + return (pixel_type)(((r & 0xFFC0) << 14) | + ((g & 0xFFC0) << 4) | (b >> 6) | 0xC0000000); } static AGG_INLINE color_type make_color(pixel_type p) { - return color_type((p >> 14) & 0xFFC0, - (p >> 4) & 0xFFC0, + return color_type((p >> 14) & 0xFFC0, + (p >> 4) & 0xFFC0, (p << 6) & 0xFFC0); } }; @@ -333,9 +333,9 @@ namespace agg typedef color_type::calc_type calc_type; typedef int32u pixel_type; - static AGG_INLINE void blend_pix(pixel_type* p, + static AGG_INLINE void blend_pix(pixel_type* p, unsigned cr, unsigned cg, unsigned cb, - unsigned alpha, + unsigned alpha, unsigned cover) { alpha = color_type::base_mask - alpha; @@ -352,15 +352,15 @@ namespace agg static AGG_INLINE pixel_type make_pix(unsigned r, unsigned g, unsigned b) { - return (pixel_type)(((r & 0xFFC0) << 14) | - ((g & 0xFFC0) << 4) | + return (pixel_type)(((r & 0xFFC0) << 14) | + ((g & 0xFFC0) << 4) | (b >> 6) | 0xC0000000); } static AGG_INLINE color_type make_color(pixel_type p) { - return color_type((p >> 14) & 0xFFC0, - (p >> 4) & 0xFFC0, + return color_type((p >> 14) & 0xFFC0, + (p >> 4) & 0xFFC0, (p << 6) & 0xFFC0); } }; @@ -380,9 +380,9 @@ namespace agg blender_rgbAAA_gamma() : m_gamma(0) {} void gamma(const gamma_type& g) { m_gamma = &g; } - AGG_INLINE void blend_pix(pixel_type* p, + AGG_INLINE void blend_pix(pixel_type* p, unsigned cr, unsigned cg, unsigned cb, - unsigned alpha, + unsigned alpha, unsigned) { pixel_type rgb = *p; @@ -397,15 +397,15 @@ namespace agg static AGG_INLINE pixel_type make_pix(unsigned r, unsigned g, unsigned b) { - return (pixel_type)(((r & 0xFFC0) << 14) | - ((g & 0xFFC0) << 4) | + return (pixel_type)(((r & 0xFFC0) << 14) | + ((g & 0xFFC0) << 4) | (b >> 6) | 0xC0000000); } static AGG_INLINE color_type make_color(pixel_type p) { - return color_type((p >> 14) & 0xFFC0, - (p >> 4) & 0xFFC0, + return color_type((p >> 14) & 0xFFC0, + (p >> 4) & 0xFFC0, (p << 6) & 0xFFC0); } private: @@ -421,9 +421,9 @@ namespace agg typedef color_type::calc_type calc_type; typedef int32u pixel_type; - static AGG_INLINE void blend_pix(pixel_type* p, + static AGG_INLINE void blend_pix(pixel_type* p, unsigned cr, unsigned cg, unsigned cb, - unsigned alpha, + unsigned alpha, unsigned) { pixel_type bgr = *p; @@ -438,15 +438,15 @@ namespace agg static AGG_INLINE pixel_type make_pix(unsigned r, unsigned g, unsigned b) { - return (pixel_type)(((b & 0xFFC0) << 14) | - ((g & 0xFFC0) << 4) | + return (pixel_type)(((b & 0xFFC0) << 14) | + ((g & 0xFFC0) << 4) | (r >> 6) | 0xC0000000); } static AGG_INLINE color_type make_color(pixel_type p) { - return color_type((p << 6) & 0xFFC0, - (p >> 4) & 0xFFC0, + return color_type((p << 6) & 0xFFC0, + (p >> 4) & 0xFFC0, (p >> 14) & 0xFFC0); } }; @@ -461,9 +461,9 @@ namespace agg typedef color_type::calc_type calc_type; typedef int32u pixel_type; - static AGG_INLINE void blend_pix(pixel_type* p, + static AGG_INLINE void blend_pix(pixel_type* p, unsigned cr, unsigned cg, unsigned cb, - unsigned alpha, + unsigned alpha, unsigned cover) { alpha = color_type::base_mask - alpha; @@ -480,15 +480,15 @@ namespace agg static AGG_INLINE pixel_type make_pix(unsigned r, unsigned g, unsigned b) { - return (pixel_type)(((b & 0xFFC0) << 14) | - ((g & 0xFFC0) << 4) | + return (pixel_type)(((b & 0xFFC0) << 14) | + ((g & 0xFFC0) << 4) | (r >> 6) | 0xC0000000); } static AGG_INLINE color_type make_color(pixel_type p) { - return color_type((p << 6) & 0xFFC0, - (p >> 4) & 0xFFC0, + return color_type((p << 6) & 0xFFC0, + (p >> 4) & 0xFFC0, (p >> 14) & 0xFFC0); } }; @@ -508,9 +508,9 @@ namespace agg blender_bgrAAA_gamma() : m_gamma(0) {} void gamma(const gamma_type& g) { m_gamma = &g; } - AGG_INLINE void blend_pix(pixel_type* p, + AGG_INLINE void blend_pix(pixel_type* p, unsigned cr, unsigned cg, unsigned cb, - unsigned alpha, + unsigned alpha, unsigned) { pixel_type bgr = *p; @@ -525,15 +525,15 @@ namespace agg static AGG_INLINE pixel_type make_pix(unsigned r, unsigned g, unsigned b) { - return (pixel_type)(((b & 0xFFC0) << 14) | - ((g & 0xFFC0) << 4) | + return (pixel_type)(((b & 0xFFC0) << 14) | + ((g & 0xFFC0) << 4) | (r >> 6) | 0xC0000000); } static AGG_INLINE color_type make_color(pixel_type p) { - return color_type((p << 6) & 0xFFC0, - (p >> 4) & 0xFFC0, + return color_type((p << 6) & 0xFFC0, + (p >> 4) & 0xFFC0, (p >> 14) & 0xFFC0); } @@ -551,9 +551,9 @@ namespace agg typedef color_type::calc_type calc_type; typedef int32u pixel_type; - static AGG_INLINE void blend_pix(pixel_type* p, + static AGG_INLINE void blend_pix(pixel_type* p, unsigned cr, unsigned cg, unsigned cb, - unsigned alpha, + unsigned alpha, unsigned) { pixel_type rgb = *p; @@ -573,8 +573,8 @@ namespace agg static AGG_INLINE color_type make_color(pixel_type p) { - return color_type((p >> 16) & 0xFFE0, - (p >> 5) & 0xFFE0, + return color_type((p >> 16) & 0xFFE0, + (p >> 5) & 0xFFE0, (p << 6) & 0xFFC0); } }; @@ -588,9 +588,9 @@ namespace agg typedef color_type::calc_type calc_type; typedef int32u pixel_type; - static AGG_INLINE void blend_pix(pixel_type* p, + static AGG_INLINE void blend_pix(pixel_type* p, unsigned cr, unsigned cg, unsigned cb, - unsigned alpha, + unsigned alpha, unsigned cover) { alpha = color_type::base_mask - alpha; @@ -612,8 +612,8 @@ namespace agg static AGG_INLINE color_type make_color(pixel_type p) { - return color_type((p >> 16) & 0xFFE0, - (p >> 5) & 0xFFE0, + return color_type((p >> 16) & 0xFFE0, + (p >> 5) & 0xFFE0, (p << 6) & 0xFFC0); } }; @@ -633,9 +633,9 @@ namespace agg blender_rgbBBA_gamma() : m_gamma(0) {} void gamma(const gamma_type& g) { m_gamma = &g; } - AGG_INLINE void blend_pix(pixel_type* p, + AGG_INLINE void blend_pix(pixel_type* p, unsigned cr, unsigned cg, unsigned cb, - unsigned alpha, + unsigned alpha, unsigned) { pixel_type rgb = *p; @@ -655,8 +655,8 @@ namespace agg static AGG_INLINE color_type make_color(pixel_type p) { - return color_type((p >> 16) & 0xFFE0, - (p >> 5) & 0xFFE0, + return color_type((p >> 16) & 0xFFE0, + (p >> 5) & 0xFFE0, (p << 6) & 0xFFC0); } @@ -673,9 +673,9 @@ namespace agg typedef color_type::calc_type calc_type; typedef int32u pixel_type; - static AGG_INLINE void blend_pix(pixel_type* p, + static AGG_INLINE void blend_pix(pixel_type* p, unsigned cr, unsigned cg, unsigned cb, - unsigned alpha, + unsigned alpha, unsigned) { pixel_type bgr = *p; @@ -696,7 +696,7 @@ namespace agg static AGG_INLINE color_type make_color(pixel_type p) { return color_type((p << 5) & 0xFFE0, - (p >> 6) & 0xFFE0, + (p >> 6) & 0xFFE0, (p >> 16) & 0xFFC0); } }; @@ -710,9 +710,9 @@ namespace agg typedef color_type::calc_type calc_type; typedef int32u pixel_type; - static AGG_INLINE void blend_pix(pixel_type* p, + static AGG_INLINE void blend_pix(pixel_type* p, unsigned cr, unsigned cg, unsigned cb, - unsigned alpha, + unsigned alpha, unsigned cover) { alpha = color_type::base_mask - alpha; @@ -735,7 +735,7 @@ namespace agg static AGG_INLINE color_type make_color(pixel_type p) { return color_type((p << 5) & 0xFFE0, - (p >> 6) & 0xFFE0, + (p >> 6) & 0xFFE0, (p >> 16) & 0xFFC0); } }; @@ -755,9 +755,9 @@ namespace agg blender_bgrABB_gamma() : m_gamma(0) {} void gamma(const gamma_type& g) { m_gamma = &g; } - AGG_INLINE void blend_pix(pixel_type* p, + AGG_INLINE void blend_pix(pixel_type* p, unsigned cr, unsigned cg, unsigned cb, - unsigned alpha, + unsigned alpha, unsigned) { pixel_type bgr = *p; @@ -778,7 +778,7 @@ namespace agg static AGG_INLINE color_type make_color(pixel_type p) { return color_type((p << 5) & 0xFFE0, - (p >> 6) & 0xFFE0, + (p >> 6) & 0xFFE0, (p >> 16) & 0xFFC0); } @@ -787,7 +787,7 @@ namespace agg }; - + //===============================================pixel_formats_rgb_packed template<class Blender> class pixel_formats_rgb_packed { @@ -859,8 +859,8 @@ namespace agg //-------------------------------------------------------------------- row_data span(int x, int y) const { - return row_data(x, - width() - 1, + return row_data(x, + width() - 1, m_rbuf->row(y) + x * sizeof(pixel_type)); } @@ -878,8 +878,8 @@ namespace agg //-------------------------------------------------------------------- - AGG_INLINE void copy_hline(int x, int y, - unsigned len, + AGG_INLINE void copy_hline(int x, int y, + unsigned len, const color_type& c) { pixel_type* p = (pixel_type*)m_rbuf->row(y) + x; @@ -894,7 +894,7 @@ namespace agg //-------------------------------------------------------------------- AGG_INLINE void copy_vline(int x, int y, - unsigned len, + unsigned len, const color_type& c) { pixel_type* p = (pixel_type*)m_rbuf->row(y) + x; @@ -910,7 +910,7 @@ namespace agg //-------------------------------------------------------------------- void blend_hline(int x, int y, - unsigned len, + unsigned len, const color_type& c, int8u cover) { @@ -942,7 +942,7 @@ namespace agg //-------------------------------------------------------------------- void blend_vline(int x, int y, - unsigned len, + unsigned len, const color_type& c, int8u cover) { @@ -975,12 +975,12 @@ namespace agg //-------------------------------------------------------------------- void blend_solid_hspan(int x, int y, - unsigned len, + unsigned len, const color_type& c, const int8u* covers) { pixel_type* p = (pixel_type*)m_rbuf->row(y) + x; - do + do { copy_or_blend_pix(p, c, *covers++); ++p; @@ -991,12 +991,12 @@ namespace agg //-------------------------------------------------------------------- void blend_solid_vspan(int x, int y, - unsigned len, + unsigned len, const color_type& c, const int8u* covers) { pixel_type* p = (pixel_type*)m_rbuf->row(y) + x; - do + do { copy_or_blend_pix(p, c, *covers++); p = (pixel_type*)m_rbuf->next_row(p); @@ -1007,13 +1007,13 @@ namespace agg //-------------------------------------------------------------------- void blend_color_hspan(int x, int y, - unsigned len, + unsigned len, const color_type* colors, const int8u* covers, int8u cover) { pixel_type* p = (pixel_type*)m_rbuf->row(y) + x; - do + do { copy_or_blend_pix(p++, *colors++, covers ? *covers++ : cover); } @@ -1023,13 +1023,13 @@ namespace agg //-------------------------------------------------------------------- void blend_color_vspan(int x, int y, - unsigned len, + unsigned len, const color_type* colors, const int8u* covers, int8u cover) { pixel_type* p = (pixel_type*)m_rbuf->row(y) + x; - do + do { copy_or_blend_pix(p, *colors++, covers ? *covers++ : cover); p = (pixel_type*)m_rbuf->next_row(p); @@ -1040,7 +1040,7 @@ namespace agg //-------------------------------------------------------------------- void blend_opaque_color_hspan(int x, int y, - unsigned len, + unsigned len, const color_type* colors, const int8u* covers, int8u cover) @@ -1048,7 +1048,7 @@ namespace agg pixel_type* p = (pixel_type*)m_rbuf->row(y) + x; if(covers) { - do + do { copy_or_blend_opaque_pix(p++, *colors++, *covers++); } @@ -1058,7 +1058,7 @@ namespace agg { if(cover == 255) { - do + do { *p++ = m_blender.make_pix(colors->r, colors->g, colors->b); ++colors; @@ -1067,7 +1067,7 @@ namespace agg } else { - do + do { copy_or_blend_opaque_pix(p++, *colors++, cover); } @@ -1079,7 +1079,7 @@ namespace agg //-------------------------------------------------------------------- void blend_opaque_color_vspan(int x, int y, - unsigned len, + unsigned len, const color_type* colors, const int8u* covers, int8u cover) @@ -1087,7 +1087,7 @@ namespace agg pixel_type* p = (pixel_type*)m_rbuf->row(y) + x; if(covers) { - do + do { copy_or_blend_opaque_pix(p, *colors++, *covers++); p = (pixel_type*)m_rbuf->next_row(p); @@ -1098,7 +1098,7 @@ namespace agg { if(cover == 255) { - do + do { *p = m_blender.make_pix(colors->r, colors->g, colors->b); p = (value_type*)m_rbuf->next_row(p); @@ -1108,7 +1108,7 @@ namespace agg } else { - do + do { copy_or_blend_opaque_pix(p, *colors++, cover); p = (value_type*)m_rbuf->next_row(p); @@ -1117,23 +1117,23 @@ namespace agg } } } - - + + //-------------------------------------------------------------------- - void copy_from(const rendering_buffer& from, + void copy_from(const rendering_buffer& from, int xdst, int ydst, int xsrc, int ysrc, unsigned len) { - memmove((pixel_type*)m_rbuf->row(ydst) + xdst, - (pixel_type*)from.row(ysrc) + xsrc, + memmove((pixel_type*)m_rbuf->row(ydst) + xdst, + (pixel_type*)from.row(ysrc) + xsrc, sizeof(pixel_type) * len); } //-------------------------------------------------------------------- template<class SrcPixelFormatRenderer> - void blend_from(const SrcPixelFormatRenderer& from, + void blend_from(const SrcPixelFormatRenderer& from, const int8u* psrc_, int xdst, int ydst, int xsrc, int ysrc, @@ -1143,20 +1143,20 @@ namespace agg const value_type* psrc = (const value_type*)psrc_; pixel_type* pdst = (pixel_type*)m_rbuf->row(ydst) + xdst; - do + do { value_type alpha = psrc[src_order::A]; if(alpha) { if(alpha == base_mask) { - *pdst = m_blender.make_pix(psrc[src_order::R], + *pdst = m_blender.make_pix(psrc[src_order::R], psrc[src_order::G], psrc[src_order::B]); } else { - m_blender.blend_pix(pdst, + m_blender.blend_pix(pdst, psrc[src_order::R], psrc[src_order::G], psrc[src_order::B], @@ -1194,12 +1194,12 @@ namespace agg //-----------------------------------------------------pixfmt_rgb555_gamma - template<class Gamma> class pixfmt_rgb555_gamma : + template<class Gamma> class pixfmt_rgb555_gamma : public pixel_formats_rgb_packed<blender_rgb555_gamma<Gamma> > { public: pixfmt_rgb555_gamma(rendering_buffer& rb, const Gamma& g) : - pixel_formats_rgb_packed<blender_rgb555_gamma<Gamma> >(rb) + pixel_formats_rgb_packed<blender_rgb555_gamma<Gamma> >(rb) { this->blender().gamma(g); } @@ -1207,12 +1207,12 @@ namespace agg //-----------------------------------------------------pixfmt_rgb565_gamma - template<class Gamma> class pixfmt_rgb565_gamma : + template<class Gamma> class pixfmt_rgb565_gamma : public pixel_formats_rgb_packed<blender_rgb565_gamma<Gamma> > { public: pixfmt_rgb565_gamma(rendering_buffer& rb, const Gamma& g) : - pixel_formats_rgb_packed<blender_rgb565_gamma<Gamma> >(rb) + pixel_formats_rgb_packed<blender_rgb565_gamma<Gamma> >(rb) { this->blender().gamma(g); } @@ -1220,12 +1220,12 @@ namespace agg //-----------------------------------------------------pixfmt_rgbAAA_gamma - template<class Gamma> class pixfmt_rgbAAA_gamma : + template<class Gamma> class pixfmt_rgbAAA_gamma : public pixel_formats_rgb_packed<blender_rgbAAA_gamma<Gamma> > { public: pixfmt_rgbAAA_gamma(rendering_buffer& rb, const Gamma& g) : - pixel_formats_rgb_packed<blender_rgbAAA_gamma<Gamma> >(rb) + pixel_formats_rgb_packed<blender_rgbAAA_gamma<Gamma> >(rb) { this->blender().gamma(g); } @@ -1233,12 +1233,12 @@ namespace agg //-----------------------------------------------------pixfmt_bgrAAA_gamma - template<class Gamma> class pixfmt_bgrAAA_gamma : + template<class Gamma> class pixfmt_bgrAAA_gamma : public pixel_formats_rgb_packed<blender_bgrAAA_gamma<Gamma> > { public: pixfmt_bgrAAA_gamma(rendering_buffer& rb, const Gamma& g) : - pixel_formats_rgb_packed<blender_bgrAAA_gamma<Gamma> >(rb) + pixel_formats_rgb_packed<blender_bgrAAA_gamma<Gamma> >(rb) { this->blender().gamma(g); } @@ -1246,12 +1246,12 @@ namespace agg //-----------------------------------------------------pixfmt_rgbBBA_gamma - template<class Gamma> class pixfmt_rgbBBA_gamma : + template<class Gamma> class pixfmt_rgbBBA_gamma : public pixel_formats_rgb_packed<blender_rgbBBA_gamma<Gamma> > { public: pixfmt_rgbBBA_gamma(rendering_buffer& rb, const Gamma& g) : - pixel_formats_rgb_packed<blender_rgbBBA_gamma<Gamma> >(rb) + pixel_formats_rgb_packed<blender_rgbBBA_gamma<Gamma> >(rb) { this->blender().gamma(g); } @@ -1259,12 +1259,12 @@ namespace agg //-----------------------------------------------------pixfmt_bgrABB_gamma - template<class Gamma> class pixfmt_bgrABB_gamma : + template<class Gamma> class pixfmt_bgrABB_gamma : public pixel_formats_rgb_packed<blender_bgrABB_gamma<Gamma> > { public: pixfmt_bgrABB_gamma(rendering_buffer& rb, const Gamma& g) : - pixel_formats_rgb_packed<blender_bgrABB_gamma<Gamma> >(rb) + pixel_formats_rgb_packed<blender_bgrABB_gamma<Gamma> >(rb) { this->blender().gamma(g); } diff --git a/agg/inc/agg_pixfmt_rgba.h b/agg/inc/agg_pixfmt_rgba.h index 3716877e04f7..06c36abf7510 100755 --- a/agg/inc/agg_pixfmt_rgba.h +++ b/agg/inc/agg_pixfmt_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. -// +// //---------------------------------------------------------------------------- #ifndef AGG_PIXFMT_RGBA_INCLUDED @@ -118,7 +118,7 @@ namespace agg const GammaLut& m_gamma; }; - + //=============================================================blender_rgba template<class ColorT, class Order, class PixelT> struct blender_rgba @@ -128,16 +128,16 @@ namespace agg typedef Order order_type; typedef typename color_type::value_type value_type; typedef typename color_type::calc_type calc_type; - enum - { + enum + { base_shift = color_type::base_shift, base_mask = color_type::base_mask }; //-------------------------------------------------------------------- - static AGG_INLINE void blend_pix(value_type* p, + static AGG_INLINE void blend_pix(value_type* p, unsigned cr, unsigned cg, unsigned cb, - unsigned alpha, + unsigned alpha, unsigned) { calc_type r = p[Order::R]; @@ -160,14 +160,14 @@ namespace agg typedef Order order_type; typedef typename color_type::value_type value_type; typedef typename color_type::calc_type calc_type; - enum - { + enum + { base_shift = color_type::base_shift, base_mask = color_type::base_mask }; //-------------------------------------------------------------------- - static AGG_INLINE void blend_pix(value_type* p, + static AGG_INLINE void blend_pix(value_type* p, unsigned cr, unsigned cg, unsigned cb, unsigned alpha, unsigned cover) @@ -194,7 +194,7 @@ namespace agg enum { base_shift = color_type::base_shift }; //-------------------------------------------------------------------- - static AGG_INLINE void blend_pix(value_type* p, + static AGG_INLINE void blend_pix(value_type* p, unsigned cr, unsigned cg, unsigned cb, unsigned alpha, unsigned) @@ -229,7 +229,7 @@ namespace agg }; //-------------------------------------------------------------------- - static AGG_INLINE void blend_pix(value_type* p, + static AGG_INLINE void blend_pix(value_type* p, unsigned cr, unsigned cg, unsigned cb, unsigned alpha, unsigned cover) @@ -238,8 +238,8 @@ namespace agg } //-------------------------------------------------------------------- - static AGG_INLINE void copy_or_blend_pix(value_type* p, - const color_type& c, + static AGG_INLINE void copy_or_blend_pix(value_type* p, + const color_type& c, unsigned cover) { if (c.a) @@ -260,8 +260,8 @@ namespace agg } //-------------------------------------------------------------------- - static AGG_INLINE void copy_or_blend_opaque_pix(value_type* p, - const color_type& c, + static AGG_INLINE void copy_or_blend_opaque_pix(value_type* p, + const color_type& c, unsigned cover) { if(cover == 255) @@ -280,7 +280,7 @@ namespace agg - + //=======================================================pixel_formats_rgba template<class Blender> class pixel_formats_rgba { @@ -312,17 +312,17 @@ namespace agg AGG_INLINE color_type pixel(int x, int y) const { const value_type* p = (value_type*)m_rbuf->row(y) + (x << 2); - return color_type(p[order_type::R], - p[order_type::G], - p[order_type::B], + return color_type(p[order_type::R], + p[order_type::G], + p[order_type::B], p[order_type::A]); } //-------------------------------------------------------------------- row_data span(int x, int y) const { - return row_data(x, - width() - 1, + return row_data(x, + width() - 1, m_rbuf->row(y) + x * 4 * sizeof(value_type)); } @@ -344,8 +344,8 @@ namespace agg //-------------------------------------------------------------------- - AGG_INLINE void copy_hline(int x, int y, - unsigned len, + AGG_INLINE void copy_hline(int x, int y, + unsigned len, const color_type& c) { value_type* p = (value_type*)m_rbuf->row(y) + (x << 2); @@ -365,7 +365,7 @@ namespace agg //-------------------------------------------------------------------- AGG_INLINE void copy_vline(int x, int y, - unsigned len, + unsigned len, const color_type& c) { value_type* p = (value_type*)m_rbuf->row(y) + (x << 2); @@ -385,7 +385,7 @@ namespace agg //-------------------------------------------------------------------- void blend_hline(int x, int y, - unsigned len, + unsigned len, const color_type& c, int8u cover) { @@ -422,7 +422,7 @@ namespace agg //-------------------------------------------------------------------- void blend_vline(int x, int y, - unsigned len, + unsigned len, const color_type& c, int8u cover) { @@ -459,14 +459,14 @@ namespace agg //-------------------------------------------------------------------- void blend_solid_hspan(int x, int y, - unsigned len, + unsigned len, const color_type& c, const int8u* covers) { if (c.a) { value_type* p = (value_type*)m_rbuf->row(y) + (x << 2); - do + do { calc_type alpha = (calc_type(c.a) * (calc_type(*covers) + 1)) >> 8; if(alpha == base_mask) @@ -490,14 +490,14 @@ namespace agg //-------------------------------------------------------------------- void blend_solid_vspan(int x, int y, - unsigned len, + unsigned len, const color_type& c, const int8u* covers) { if (c.a) { value_type* p = (value_type*)m_rbuf->row(y) + (x << 2); - do + do { calc_type alpha = (calc_type(c.a) * (calc_type(*covers) + 1)) >> 8; if(alpha == base_mask) @@ -521,7 +521,7 @@ namespace agg //-------------------------------------------------------------------- void blend_color_hspan(int x, int y, - unsigned len, + unsigned len, const color_type* colors, const int8u* covers, int8u cover) @@ -529,7 +529,7 @@ namespace agg value_type* p = (value_type*)m_rbuf->row(y) + (x << 2); if(covers) { - do + do { blender_type::copy_or_blend_pix(p, *colors++, *covers++); p += 4; @@ -540,7 +540,7 @@ namespace agg { if(cover == 255) { - do + do { if(colors->a == base_mask) { @@ -560,7 +560,7 @@ namespace agg } else { - do + do { blender_type::copy_or_blend_pix(p, *colors++, cover); p += 4; @@ -574,7 +574,7 @@ namespace agg //-------------------------------------------------------------------- void blend_color_vspan(int x, int y, - unsigned len, + unsigned len, const color_type* colors, const int8u* covers, int8u cover) @@ -582,7 +582,7 @@ namespace agg value_type* p = (value_type*)m_rbuf->row(y) + (x << 2); if(covers) { - do + do { blender_type::copy_or_blend_pix(p, *colors++, *covers++); p = (value_type*)m_rbuf->next_row(p); @@ -593,7 +593,7 @@ namespace agg { if(cover == 255) { - do + do { if(colors->a == base_mask) { @@ -613,7 +613,7 @@ namespace agg } else { - do + do { blender_type::copy_or_blend_pix(p, *colors++, cover); p = (value_type*)m_rbuf->next_row(p); @@ -626,7 +626,7 @@ namespace agg //-------------------------------------------------------------------- void blend_opaque_color_hspan(int x, int y, - unsigned len, + unsigned len, const color_type* colors, const int8u* covers, int8u cover) @@ -634,7 +634,7 @@ namespace agg value_type* p = (value_type*)m_rbuf->row(y) + (x << 2); if(covers) { - do + do { blender_type::copy_or_blend_opaque_pix(p, *colors++, *covers++); p += 4; @@ -645,7 +645,7 @@ namespace agg { if(cover == 255) { - do + do { p[order_type::R] = colors->r; p[order_type::G] = colors->g; @@ -658,7 +658,7 @@ namespace agg } else { - do + do { blender_type::copy_or_blend_opaque_pix(p, *colors++, cover); p += 4; @@ -671,7 +671,7 @@ namespace agg //-------------------------------------------------------------------- void blend_opaque_color_vspan(int x, int y, - unsigned len, + unsigned len, const color_type* colors, const int8u* covers, int8u cover) @@ -679,7 +679,7 @@ namespace agg value_type* p = (value_type*)m_rbuf->row(y) + (x << 2); if(covers) { - do + do { blender_type::copy_or_blend_opaque_pix(p, *colors++, *covers++); p = (value_type*)m_rbuf->next_row(p); @@ -690,7 +690,7 @@ namespace agg { if(cover == 255) { - do + do { p[order_type::R] = colors->r; p[order_type::G] = colors->g; @@ -703,7 +703,7 @@ namespace agg } else { - do + do { blender_type::copy_or_blend_opaque_pix(p, *colors++, cover); p = (value_type*)m_rbuf->next_row(p); @@ -756,20 +756,20 @@ namespace agg } //-------------------------------------------------------------------- - void copy_from(const rendering_buffer& from, + void copy_from(const rendering_buffer& from, int xdst, int ydst, int xsrc, int ysrc, unsigned len) { - memmove((value_type*)m_rbuf->row(ydst) + xdst * 4, - (value_type*)from.row(ysrc) + xsrc * 4, + memmove((value_type*)m_rbuf->row(ydst) + xdst * 4, + (value_type*)from.row(ysrc) + xsrc * 4, sizeof(value_type) * 4 * len); } //-------------------------------------------------------------------- template<class SrcPixelFormatRenderer> - void blend_from(const SrcPixelFormatRenderer& from, + void blend_from(const SrcPixelFormatRenderer& from, const int8u* psrc_, int xdst, int ydst, int xsrc, int ysrc, @@ -786,7 +786,7 @@ namespace agg pdst += (len-1) << 2; incp = -4; } - do + do { value_type alpha = psrc[src_order::A]; @@ -801,7 +801,7 @@ namespace agg } else { - blender_type::blend_pix(pdst, + blender_type::blend_pix(pdst, psrc[src_order::R], psrc[src_order::G], psrc[src_order::B], @@ -853,9 +853,9 @@ namespace agg color_type pixel(int x, int y) const { const value_type* p = m_rbuf->span_ptr(x, y, 1); - return p ? color_type(p[order_type::R], - p[order_type::G], - p[order_type::B], + return p ? color_type(p[order_type::R], + p[order_type::G], + p[order_type::B], p[order_type::A]) : color_type::no_color(); } @@ -915,7 +915,7 @@ namespace agg } //-------------------------------------------------------------------- - void blend_hline(int x, int y, unsigned len, + void blend_hline(int x, int y, unsigned len, const color_type& c, int8u cover) { if (c.a) @@ -949,7 +949,7 @@ namespace agg } //-------------------------------------------------------------------- - void blend_vline(int x, int y, unsigned len, + void blend_vline(int x, int y, unsigned len, const color_type& c, int8u cover) { if (c.a) @@ -972,7 +972,7 @@ namespace agg { do { - blender_type::blend_pix(*(pixel_type*)m_rbuf->span_ptr(x, y++, 1), + blender_type::blend_pix(*(pixel_type*)m_rbuf->span_ptr(x, y++, 1), c.r, c.g, c.b, alpha, cover); } while(--len); @@ -982,11 +982,11 @@ namespace agg //-------------------------------------------------------------------- - void blend_solid_hspan(int x, int y, unsigned len, + void blend_solid_hspan(int x, int y, unsigned len, const color_type& c, const int8u* covers) { value_type* p = (value_type*)m_rbuf->span_ptr(x, y, len); - do + do { blender_type::copy_or_blend_pix(p, c, *covers++); p += 4; @@ -997,13 +997,13 @@ namespace agg //-------------------------------------------------------------------- - void blend_solid_vspan(int x, int y, unsigned len, + void blend_solid_vspan(int x, int y, unsigned len, const color_type& c, const int8u* covers) { - do + do { - blender_type::copy_or_blend_pix((value_type*)m_rbuf->span_ptr(x, y++, 1), - c, + blender_type::copy_or_blend_pix((value_type*)m_rbuf->span_ptr(x, y++, 1), + c, *covers++); } while(--len); @@ -1011,13 +1011,13 @@ namespace agg //-------------------------------------------------------------------- - void blend_color_hspan(int x, int y, unsigned len, - const color_type* colors, + void blend_color_hspan(int x, int y, unsigned len, + const color_type* colors, const int8u* covers, int8u cover) { value_type* p = (value_type*)m_rbuf->span_ptr(x, y, len); - do + do { blender_type::copy_or_blend_pix(p, *colors++, covers ? *covers++ : cover); p += 4; @@ -1027,14 +1027,14 @@ namespace agg //-------------------------------------------------------------------- - void blend_color_vspan(int x, int y, unsigned len, - const color_type* colors, + void blend_color_vspan(int x, int y, unsigned len, + const color_type* colors, const int8u* covers, int8u cover) { - do + do { - blender_type::copy_or_blend_pix((value_type*)m_rbuf->span_ptr(x, y++, 1), + blender_type::copy_or_blend_pix((value_type*)m_rbuf->span_ptr(x, y++, 1), *colors++, covers ? *covers++ : cover); } while(--len); @@ -1043,7 +1043,7 @@ namespace agg //-------------------------------------------------------------------- void blend_opaque_color_hspan(int x, int y, - unsigned len, + unsigned len, const color_type* colors, const int8u* covers, int8u cover) @@ -1051,7 +1051,7 @@ namespace agg value_type* p = (value_type*)m_rbuf->span_ptr(x, y, len); if(covers) { - do + do { blender_type::copy_or_blend_opaque_pix(p, *colors++, *covers++); p += 4; @@ -1062,7 +1062,7 @@ namespace agg { if(cover == 255) { - do + do { p[order_type::R] = colors->r; p[order_type::G] = colors->g; @@ -1075,7 +1075,7 @@ namespace agg } else { - do + do { blender_type::copy_or_blend_opaque_pix(p, *colors++, cover); p += 4; @@ -1088,16 +1088,16 @@ namespace agg //-------------------------------------------------------------------- void blend_opaque_color_vspan(int x, int y, - unsigned len, + unsigned len, const color_type* colors, const int8u* covers, int8u cover) { if(covers) { - do + do { - blender_type::copy_or_blend_opaque_pix((value_type*)m_rbuf->span_ptr(x, y++, 1), + blender_type::copy_or_blend_opaque_pix((value_type*)m_rbuf->span_ptr(x, y++, 1), *colors++, *covers++); } while(--len); @@ -1106,7 +1106,7 @@ namespace agg { if(cover == 255) { - do + do { value_type* p = (value_type*)m_rbuf->span_ptr(x, y++, 1); p[order_type::R] = colors->r; @@ -1119,9 +1119,9 @@ namespace agg } else { - do + do { - blender_type::copy_or_blend_opaque_pix((value_type*)m_rbuf->span_ptr(x, y++, 1), + blender_type::copy_or_blend_opaque_pix((value_type*)m_rbuf->span_ptr(x, y++, 1), *colors++, cover); } while(--len); @@ -1177,7 +1177,7 @@ namespace agg } //-------------------------------------------------------------------- - template<class RenBuf2> void copy_from(const RenBuf2& from, + template<class RenBuf2> void copy_from(const RenBuf2& from, int xdst, int ydst, int xsrc, int ysrc, unsigned len) @@ -1186,8 +1186,8 @@ namespace agg if(p) { p += xsrc * 4 * sizeof(value_type); - memmove(m_rbuf->span_ptr(xdst, ydst, len), - p, + memmove(m_rbuf->span_ptr(xdst, ydst, len), + p, len * 4 * sizeof(value_type)); } } @@ -1195,8 +1195,8 @@ namespace agg //-------------------------------------------------------------------- - template<class SrcPixelFormatRenderer> - void blend_from(const SrcPixelFormatRenderer& from, + template<class SrcPixelFormatRenderer> + void blend_from(const SrcPixelFormatRenderer& from, const int8u* psrc_, int xdst, int ydst, int xsrc, int ysrc, @@ -1213,7 +1213,7 @@ namespace agg pdst += (len-1) << 2; incp = -4; } - do + do { value_type alpha = psrc[src_order::A]; @@ -1228,7 +1228,7 @@ namespace agg } else { - blender_type::blend_pix(pdst, + blender_type::blend_pix(pdst, psrc[src_order::R], psrc[src_order::G], psrc[src_order::B], diff --git a/agg/inc/agg_rasterizer_outline.h b/agg/inc/agg_rasterizer_outline.h index 18512e76a1ad..dac917050456 100755 --- a/agg/inc/agg_rasterizer_outline.h +++ b/agg/inc/agg_rasterizer_outline.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. // @@ -23,10 +23,10 @@ namespace agg template<class Renderer> class rasterizer_outline { public: - rasterizer_outline(Renderer& ren) : - m_ren(&ren), - m_start_x(0), - m_start_y(0), + rasterizer_outline(Renderer& ren) : + m_ren(&ren), + m_start_x(0), + m_start_y(0), m_vertices(0) { } @@ -70,11 +70,11 @@ namespace agg //-------------------------------------------------------------------- void add_vertex(double x, double y, unsigned cmd) { - if(is_move_to(cmd)) + if(is_move_to(cmd)) { move_to_d(x, y); } - else + else { if(is_end_poly(cmd)) { @@ -106,8 +106,8 @@ namespace agg //-------------------------------------------------------------------- template<class VertexSource, class ColorStorage, class PathId> - void render_all_paths(VertexSource& vs, - const ColorStorage& colors, + void render_all_paths(VertexSource& vs, + const ColorStorage& colors, const PathId& id, unsigned num_paths) { diff --git a/agg/inc/agg_rasterizer_outline_aa.h b/agg/inc/agg_rasterizer_outline_aa.h index 3f4d6395fafa..ce543ed7f391 100755 --- a/agg/inc/agg_rasterizer_outline_aa.h +++ b/agg/inc/agg_rasterizer_outline_aa.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. // @@ -29,7 +29,7 @@ namespace agg //-----------------------------------------------------------line_aa_vertex - // Vertex (x, y) with the distance to the next one. The last vertex has + // Vertex (x, y) with the distance to the next one. The last vertex has // the distance between the last and the first points struct line_aa_vertex { @@ -49,7 +49,7 @@ namespace agg { double dx = val.x - x; double dy = val.y - y; - return (len = int(sqrt(dx * dx + dy * dy))) > + return (len = int(sqrt(dx * dx + dy * dy))) > (line_subpixel_size + line_subpixel_size / 2); } }; @@ -78,8 +78,8 @@ namespace agg typedef line_aa_vertex vertex_type; typedef vertex_sequence<vertex_type, 6> vertex_storage_type; - rasterizer_outline_aa(Renderer& ren) : - m_ren(ren), + rasterizer_outline_aa(Renderer& ren) : + m_ren(ren), m_accurate_join(m_ren.accurate_join_only()), m_round_cap(false), m_start_x(0), @@ -88,9 +88,9 @@ namespace agg } //------------------------------------------------------------------------ - void accurate_join(bool v) - { - m_accurate_join = m_ren.accurate_join_only() ? true : v; + void accurate_join(bool v) + { + m_accurate_join = m_ren.accurate_join_only() ? true : v; } bool accurate_join() const { return m_accurate_join; } @@ -128,17 +128,17 @@ namespace agg //------------------------------------------------------------------------ void add_vertex(double x, double y, unsigned cmd) { - if(is_move_to(cmd)) + if(is_move_to(cmd)) { render(false); move_to_d(x, y); } - else + else { if(is_end_poly(cmd)) { render(is_closed(cmd)); - if(is_closed(cmd)) + if(is_closed(cmd)) { move_to(m_start_x, m_start_y); } @@ -169,8 +169,8 @@ namespace agg //------------------------------------------------------------------------ template<class VertexSource, class ColorStorage, class PathId> - void render_all_paths(VertexSource& vs, - const ColorStorage& colors, + void render_all_paths(VertexSource& vs, + const ColorStorage& colors, const PathId& id, unsigned num_paths) { @@ -195,7 +195,7 @@ namespace agg private: rasterizer_outline_aa(const rasterizer_outline_aa<Renderer>&); - const rasterizer_outline_aa<Renderer>& operator = + const rasterizer_outline_aa<Renderer>& operator = (const rasterizer_outline_aa<Renderer>&); Renderer& m_ren; @@ -214,7 +214,7 @@ namespace agg //---------------------------------------------------------------------------- - template<class Renderer> + template<class Renderer> void rasterizer_outline_aa<Renderer>::draw(draw_vars& dv, unsigned start, unsigned end) { unsigned i; @@ -236,7 +236,7 @@ namespace agg dv.lnext = m_src_vertices[dv.idx].len; ++dv.idx; - if(dv.idx >= m_src_vertices.size()) dv.idx = 0; + if(dv.idx >= m_src_vertices.size()) dv.idx = 0; v = &m_src_vertices[dv.idx]; dv.x2 = v->x; @@ -254,7 +254,7 @@ namespace agg else { dv.flags >>= 1; - dv.flags |= ((dv.curr.diagonal_quadrant() == + dv.flags |= ((dv.curr.diagonal_quadrant() == dv.next.diagonal_quadrant()) << 1); } @@ -269,7 +269,7 @@ namespace agg //---------------------------------------------------------------------------- - template<class Renderer> + template<class Renderer> void rasterizer_outline_aa<Renderer>::render(bool close_polygon) { m_src_vertices.close(close_polygon); @@ -320,7 +320,7 @@ namespace agg } else { - dv.flags = + dv.flags = (prev.diagonal_quadrant() == dv.curr.diagonal_quadrant()) | ((dv.curr.diagonal_quadrant() == dv.next.diagonal_quadrant()) << 1); } @@ -355,16 +355,16 @@ namespace agg x2 = v->x; y2 = v->y; line_parameters lp(x1, y1, x2, y2, lprev); - if(m_round_cap) + if(m_round_cap) { m_ren.semidot(cmp_dist_start, x1, y1, x1 + (y2 - y1), y1 - (x2 - x1)); } - m_ren.line3(lp, - x1 + (y2 - y1), + m_ren.line3(lp, + x1 + (y2 - y1), y1 - (x2 - x1), - x2 + (y2 - y1), + x2 + (y2 - y1), y2 - (x2 - x1)); - if(m_round_cap) + if(m_round_cap) { m_ren.semidot(cmp_dist_end, x2, y2, x2 + (y2 - y1), y2 - (x2 - x1)); } @@ -390,22 +390,22 @@ namespace agg line_parameters lp2(x2, y2, x3, y3, lnext); bisectrix(lp1, lp2, &dv.xb1, &dv.yb1); - if(m_round_cap) + if(m_round_cap) { m_ren.semidot(cmp_dist_start, x1, y1, x1 + (y2 - y1), y1 - (x2 - x1)); } - m_ren.line3(lp1, - x1 + (y2 - y1), + m_ren.line3(lp1, + x1 + (y2 - y1), y1 - (x2 - x1), - dv.xb1, + dv.xb1, dv.yb1); - m_ren.line3(lp2, + m_ren.line3(lp2, dv.xb1, dv.yb1, - x3 + (y3 - y2), + x3 + (y3 - y2), y3 - (x3 - x2)); - if(m_round_cap) + if(m_round_cap) { m_ren.semidot(cmp_dist_end, x3, y3, x3 + (y3 - y2), y3 - (x3 - x2)); } @@ -449,7 +449,7 @@ namespace agg } else { - dv.flags = + dv.flags = (prev.diagonal_quadrant() == dv.curr.diagonal_quadrant()) | ((dv.curr.diagonal_quadrant() == dv.next.diagonal_quadrant()) << 1); } @@ -457,19 +457,19 @@ namespace agg if((dv.flags & 1) == 0) { bisectrix(prev, dv.curr, &dv.xb1, &dv.yb1); - m_ren.line3(prev, - x1 + (y2 - y1), + m_ren.line3(prev, + x1 + (y2 - y1), y1 - (x2 - x1), - dv.xb1, + dv.xb1, dv.yb1); } else { - m_ren.line1(prev, - x1 + (y2 - y1), + m_ren.line1(prev, + x1 + (y2 - y1), y1 - (x2 - x1)); } - if(m_round_cap) + if(m_round_cap) { m_ren.semidot(cmp_dist_start, x1, y1, x1 + (y2 - y1), y1 - (x2 - x1)); } @@ -482,19 +482,19 @@ namespace agg if((dv.flags & 1) == 0) { - m_ren.line3(dv.curr, - dv.xb1, + m_ren.line3(dv.curr, + dv.xb1, dv.yb1, - dv.curr.x2 + (dv.curr.y2 - dv.curr.y1), + dv.curr.x2 + (dv.curr.y2 - dv.curr.y1), dv.curr.y2 - (dv.curr.x2 - dv.curr.x1)); } else { - m_ren.line2(dv.curr, - dv.curr.x2 + (dv.curr.y2 - dv.curr.y1), + m_ren.line2(dv.curr, + dv.curr.x2 + (dv.curr.y2 - dv.curr.y1), dv.curr.y2 - (dv.curr.x2 - dv.curr.x1)); } - if(m_round_cap) + if(m_round_cap) { m_ren.semidot(cmp_dist_end, dv.curr.x2, dv.curr.y2, dv.curr.x2 + (dv.curr.y2 - dv.curr.y1), diff --git a/agg/inc/agg_rasterizer_scanline_aa.h b/agg/inc/agg_rasterizer_scanline_aa.h index 03be55dcc62a..4ffd43b9992b 100755 --- a/agg/inc/agg_rasterizer_scanline_aa.h +++ b/agg/inc/agg_rasterizer_scanline_aa.h @@ -2,13 +2,13 @@ // 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. // -// The author gratefully acknowleges the support of David Turner, -// Robert Wilhelm, and Werner Lemberg - the authors of the FreeType +// The author gratefully acknowleges the support of David Turner, +// Robert Wilhelm, and Werner Lemberg - the authors of the FreeType // libray - in producing this work. See http://www.freetype.org for details. // //---------------------------------------------------------------------------- @@ -18,7 +18,7 @@ //---------------------------------------------------------------------------- // // Class rasterizer_scanline_aa -// +// // //---------------------------------------------------------------------------- #ifndef AGG_RASTERIZER_SCANLINE_AA_INCLUDED @@ -37,18 +37,18 @@ namespace agg { //------------------------------------------------------------------------ - // These constants determine the subpixel accuracy, to be more precise, - // the number of bits of the fractional part of the coordinates. + // These constants determine the subpixel accuracy, to be more precise, + // the number of bits of the fractional part of the coordinates. // The possible coordinate capacity in bits can be calculated by formula: // sizeof(int) * 8 - poly_base_shift * 2, i.e, for 32-bit integers and // 8-bits fractional part the capacity is 16 bits or [-32768...32767]. enum { poly_base_shift = 8, //----poly_base_shift - poly_base_size = 1 << poly_base_shift, //----poly_base_size - poly_base_mask = poly_base_size - 1 //----poly_base_mask + poly_base_size = 1 << poly_base_shift, //----poly_base_size + poly_base_mask = poly_base_size - 1 //----poly_base_mask }; - + //--------------------------------------------------------------poly_coord inline int poly_coord(double c) { @@ -56,8 +56,8 @@ namespace agg } //-----------------------------------------------------------------cell_aa - // A pixel cell. There're no constructors defined and it was done - // intentionally in order to avoid extra overhead when allocating an + // A pixel cell. There're no constructors defined and it was done + // intentionally in order to avoid extra overhead when allocating an // array of cells. struct cell_aa { @@ -117,7 +117,7 @@ namespace agg void render_hline(int ey, int x1, int y1, int x2, int y2); void render_line(int x1, int y1, int x2, int y2); void allocate_block(); - + static void qsort_cells(cell_aa** start, unsigned num); private: @@ -149,10 +149,10 @@ namespace agg //==================================================rasterizer_scanline_aa - // Polygon rasterizer that is used to render filled polygons with - // high-quality Anti-Aliasing. Internally, by default, the class uses - // integer coordinates in format 24.8, i.e. 24 bits for integer part - // and 8 bits for fractional - see poly_base_shift. This class can be + // Polygon rasterizer that is used to render filled polygons with + // high-quality Anti-Aliasing. Internally, by default, the class uses + // integer coordinates in format 24.8, i.e. 24 bits for integer part + // and 8 bits for fractional - see poly_base_shift. This class can be // used in the following way: // // 1. filling_rule(filling_rule_e ft) - optional. @@ -161,20 +161,20 @@ namespace agg // // 3. reset() // - // 4. move_to(x, y) / line_to(x, y) - make the polygon. One can create + // 4. move_to(x, y) / line_to(x, y) - make the polygon. One can create // more than one contour, but each contour must consist of at least 3 // vertices, i.e. move_to(x1, y1); line_to(x2, y2); line_to(x3, y3); // is the absolute minimum of vertices that define a triangle. // The algorithm does not check either the number of vertices nor - // coincidence of their coordinates, but in the worst case it just + // coincidence of their coordinates, but in the worst case it just // won't draw anything. - // The orger of the vertices (clockwise or counterclockwise) + // The orger of the vertices (clockwise or counterclockwise) // is important when using the non-zero filling rule (fill_non_zero). // In this case the vertex order of all the contours must be the same // if you want your intersecting polygons to be without "holes". - // You actually can use different vertices order. If the contours do not - // intersect each other the order is not important anyway. If they do, - // contours with the same vertex order will be rendered without "holes" + // You actually can use different vertices order. If the contours do not + // intersect each other the order is not important anyway. If they do, + // contours with the same vertex order will be rendered without "holes" // while the intersecting contours with different orders will have "holes". // // filling_rule() and gamma() can be called anytime before "sweeping". @@ -206,7 +206,7 @@ namespace agg }; //-------------------------------------------------------------------- - rasterizer_scanline_aa() : + rasterizer_scanline_aa() : m_filling_rule(fill_non_zero), m_clipped_start_x(0), m_clipped_start_y(0), @@ -223,8 +223,8 @@ namespace agg } //-------------------------------------------------------------------- - template<class GammaF> - rasterizer_scanline_aa(const GammaF& gamma_function) : + template<class GammaF> + rasterizer_scanline_aa(const GammaF& gamma_function) : m_filling_rule(fill_non_zero), m_clipped_start_x(0), m_clipped_start_y(0), @@ -240,14 +240,14 @@ namespace agg } //-------------------------------------------------------------------- - void reset(); + void reset(); void filling_rule(filling_rule_e filling_rule); void clip_box(double x1, double y1, double x2, double y2); void reset_clipping(); //-------------------------------------------------------------------- template<class GammaF> void gamma(const GammaF& gamma_function) - { + { int i; for(i = 0; i < aa_num; i++) { @@ -256,9 +256,9 @@ namespace agg } //-------------------------------------------------------------------- - unsigned apply_gamma(unsigned cover) const - { - return m_gamma[cover]; + unsigned apply_gamma(unsigned cover) const + { + return m_gamma[cover]; } //-------------------------------------------------------------------- @@ -268,7 +268,7 @@ namespace agg void close_polygon(); void move_to_d(double x, double y); void line_to_d(double x, double y); - + //-------------------------------------------------------------------- int min_x() const { return m_outline.min_x(); } int min_y() const { return m_outline.min_y(); } @@ -305,7 +305,7 @@ namespace agg { close_polygon(); m_iterator.cells = m_outline.cells(); - if(m_outline.num_cells() == 0) + if(m_outline.num_cells() == 0) { return false; } @@ -329,7 +329,7 @@ namespace agg for(;;) { int coord = cur_cell->packed_coord; - int area = cur_cell->area; + int area = cur_cell->area; int last_x = cur_cell->x; m_iterator.cover += cur_cell->cover; @@ -379,7 +379,7 @@ namespace agg } } } - if(sl.num_spans()) + if(sl.num_spans()) { sl.finalize(m_iterator.last_y); break; @@ -428,7 +428,7 @@ namespace agg //-------------------------------------------------------------------- // Disable copying rasterizer_scanline_aa(const rasterizer_scanline_aa<XScale, AA_Shift>&); - const rasterizer_scanline_aa<XScale, AA_Shift>& + const rasterizer_scanline_aa<XScale, AA_Shift>& operator = (const rasterizer_scanline_aa<XScale, AA_Shift>&); //-------------------------------------------------------------------- @@ -464,22 +464,22 @@ namespace agg //------------------------------------------------------------------------ - template<unsigned XScale, unsigned AA_Shift> - void rasterizer_scanline_aa<XScale, AA_Shift>::reset() - { - m_outline.reset(); + template<unsigned XScale, unsigned AA_Shift> + void rasterizer_scanline_aa<XScale, AA_Shift>::reset() + { + m_outline.reset(); m_status = status_initial; } //------------------------------------------------------------------------ - template<unsigned XScale, unsigned AA_Shift> - void rasterizer_scanline_aa<XScale, AA_Shift>::filling_rule(filling_rule_e _filling_rule) - { - m_filling_rule = _filling_rule; + template<unsigned XScale, unsigned AA_Shift> + void rasterizer_scanline_aa<XScale, AA_Shift>::filling_rule(filling_rule_e _filling_rule) + { + m_filling_rule = _filling_rule; } //------------------------------------------------------------------------ - template<unsigned XScale, unsigned AA_Shift> + template<unsigned XScale, unsigned AA_Shift> void rasterizer_scanline_aa<XScale, AA_Shift>::clip_box(double x1, double y1, double x2, double y2) { reset(); @@ -490,7 +490,7 @@ namespace agg } //------------------------------------------------------------------------ - template<unsigned XScale, unsigned AA_Shift> + template<unsigned XScale, unsigned AA_Shift> void rasterizer_scanline_aa<XScale, AA_Shift>::reset_clipping() { reset(); @@ -500,14 +500,14 @@ namespace agg //------------------------------------------------------------------------ - template<unsigned XScale, unsigned AA_Shift> + template<unsigned XScale, unsigned AA_Shift> void rasterizer_scanline_aa<XScale, AA_Shift>::move_to_no_clip(int x, int y) { if(m_status == status_line_to) { close_polygon_no_clip(); } - m_outline.move_to(x * XScale, y); + m_outline.move_to(x * XScale, y); m_clipped_start_x = x; m_clipped_start_y = y; m_status = status_line_to; @@ -515,19 +515,19 @@ namespace agg //------------------------------------------------------------------------ - template<unsigned XScale, unsigned AA_Shift> + template<unsigned XScale, unsigned AA_Shift> void rasterizer_scanline_aa<XScale, AA_Shift>::line_to_no_clip(int x, int y) { if(m_status != status_initial) { - m_outline.line_to(x * XScale, y); + m_outline.line_to(x * XScale, y); m_status = status_line_to; } } //------------------------------------------------------------------------ - template<unsigned XScale, unsigned AA_Shift> + template<unsigned XScale, unsigned AA_Shift> void rasterizer_scanline_aa<XScale, AA_Shift>::close_polygon_no_clip() { if(m_status == status_line_to) @@ -539,8 +539,8 @@ namespace agg //------------------------------------------------------------------------ - template<unsigned XScale, unsigned AA_Shift> - void rasterizer_scanline_aa<XScale, AA_Shift>::clip_segment(int x, int y) + template<unsigned XScale, unsigned AA_Shift> + void rasterizer_scanline_aa<XScale, AA_Shift>::clip_segment(int x, int y) { unsigned flags = clipping_flags(x, y, m_clip_box); if(m_prev_flags == flags) @@ -561,9 +561,9 @@ namespace agg { int cx[4]; int cy[4]; - unsigned n = clip_liang_barsky(m_prev_x, m_prev_y, - x, y, - m_clip_box, + unsigned n = clip_liang_barsky(m_prev_x, m_prev_y, + x, y, + m_clip_box, cx, cy); const int* px = cx; const int* py = cy; @@ -587,7 +587,7 @@ namespace agg //------------------------------------------------------------------------ - template<unsigned XScale, unsigned AA_Shift> + template<unsigned XScale, unsigned AA_Shift> void rasterizer_scanline_aa<XScale, AA_Shift>::add_vertex(double x, double y, unsigned cmd) { if(is_close(cmd)) @@ -596,11 +596,11 @@ namespace agg } else { - if(is_move_to(cmd)) + if(is_move_to(cmd)) { move_to(poly_coord(x), poly_coord(y)); } - else + else { if(is_vertex(cmd)) { @@ -613,12 +613,12 @@ namespace agg //------------------------------------------------------------------------ - template<unsigned XScale, unsigned AA_Shift> - void rasterizer_scanline_aa<XScale, AA_Shift>::move_to(int x, int y) - { + template<unsigned XScale, unsigned AA_Shift> + void rasterizer_scanline_aa<XScale, AA_Shift>::move_to(int x, int y) + { if(m_clipping) { - if(m_outline.sorted()) + if(m_outline.sorted()) { reset(); } @@ -642,9 +642,9 @@ namespace agg } //------------------------------------------------------------------------ - template<unsigned XScale, unsigned AA_Shift> - void rasterizer_scanline_aa<XScale, AA_Shift>::line_to(int x, int y) - { + template<unsigned XScale, unsigned AA_Shift> + void rasterizer_scanline_aa<XScale, AA_Shift>::line_to(int x, int y) + { if(m_clipping) { clip_segment(x, y); @@ -656,9 +656,9 @@ namespace agg } //------------------------------------------------------------------------ - template<unsigned XScale, unsigned AA_Shift> - void rasterizer_scanline_aa<XScale, AA_Shift>::close_polygon() - { + template<unsigned XScale, unsigned AA_Shift> + void rasterizer_scanline_aa<XScale, AA_Shift>::close_polygon() + { if(m_clipping) { clip_segment(m_start_x, m_start_y); @@ -667,22 +667,22 @@ namespace agg } //------------------------------------------------------------------------ - template<unsigned XScale, unsigned AA_Shift> - void rasterizer_scanline_aa<XScale, AA_Shift>::move_to_d(double x, double y) - { - move_to(poly_coord(x), poly_coord(y)); + template<unsigned XScale, unsigned AA_Shift> + void rasterizer_scanline_aa<XScale, AA_Shift>::move_to_d(double x, double y) + { + move_to(poly_coord(x), poly_coord(y)); } //------------------------------------------------------------------------ - template<unsigned XScale, unsigned AA_Shift> - void rasterizer_scanline_aa<XScale, AA_Shift>::line_to_d(double x, double y) - { - line_to(poly_coord(x), poly_coord(y)); + template<unsigned XScale, unsigned AA_Shift> + void rasterizer_scanline_aa<XScale, AA_Shift>::line_to_d(double x, double y) + { + line_to(poly_coord(x), poly_coord(y)); } //------------------------------------------------------------------------ - template<unsigned XScale, unsigned AA_Shift> + template<unsigned XScale, unsigned AA_Shift> bool rasterizer_scanline_aa<XScale, AA_Shift>::hit_test(int tx, int ty) { close_polygon(); diff --git a/agg/inc/agg_render_scanlines.h b/agg/inc/agg_render_scanlines.h index 60ddecf5c2d6..376729bb7ae1 100755 --- a/agg/inc/agg_render_scanlines.h +++ b/agg/inc/agg_render_scanlines.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. // @@ -38,13 +38,13 @@ namespace agg //========================================================render_all_paths - template<class Rasterizer, class Scanline, class Renderer, + template<class Rasterizer, class Scanline, class Renderer, class VertexSource, class ColorStorage, class PathId> - void render_all_paths(Rasterizer& ras, + void render_all_paths(Rasterizer& ras, Scanline& sl, - Renderer& r, - VertexSource& vs, - const ColorStorage& as, + Renderer& r, + VertexSource& vs, + const ColorStorage& as, const PathId& id, unsigned num_paths) { diff --git a/agg/inc/agg_renderer_base.h b/agg/inc/agg_renderer_base.h index 1ef44fecc6d2..973f38554857 100755 --- a/agg/inc/agg_renderer_base.h +++ b/agg/inc/agg_renderer_base.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. // @@ -43,7 +43,7 @@ namespace agg //-------------------------------------------------------------------- const pixfmt_type& ren() const { return *m_ren; } pixfmt_type& ren() { return *m_ren; } - + //-------------------------------------------------------------------- unsigned width() const { return m_ren->width(); } unsigned height() const { return m_ren->height(); } @@ -99,7 +99,7 @@ namespace agg return x >= m_clip_box.x1 && y >= m_clip_box.y1 && x <= m_clip_box.x2 && y <= m_clip_box.y2; } - + //-------------------------------------------------------------------- void first_clip_box() {} bool next_clip_box() { return false; } @@ -130,7 +130,7 @@ namespace agg } } } - + //-------------------------------------------------------------------- void copy_pixel(int x, int y, const color_type& c) { @@ -152,7 +152,7 @@ namespace agg //-------------------------------------------------------------------- color_type pixel(int x, int y) const { - return inbox(x, y) ? + return inbox(x, y) ? m_ren->pixel(x, y) : color_type::no_color(); } @@ -188,7 +188,7 @@ namespace agg } //-------------------------------------------------------------------- - void blend_hline(int x1, int y, int x2, + void blend_hline(int x1, int y, int x2, const color_type& c, cover_type cover) { if(x1 > x2) { int t = x2; x2 = x1; x1 = t; } @@ -204,7 +204,7 @@ namespace agg } //-------------------------------------------------------------------- - void blend_vline(int x, int y1, int y2, + void blend_vline(int x, int y1, int y2, const color_type& c, cover_type cover) { if(y1 > y2) { int t = y2; y2 = y1; y1 = t; } @@ -236,7 +236,7 @@ namespace agg } //-------------------------------------------------------------------- - void blend_bar(int x1, int y1, int x2, int y2, + void blend_bar(int x1, int y1, int x2, int y2, const color_type& c, cover_type cover) { rect rc(x1, y1, x2, y2); @@ -248,8 +248,8 @@ namespace agg { m_ren->blend_hline(rc.x1, y, - unsigned(rc.x2 - rc.x1 + 1), - c, + unsigned(rc.x2 - rc.x1 + 1), + c, cover); } } @@ -257,8 +257,8 @@ namespace agg //-------------------------------------------------------------------- - void blend_solid_hspan(int x, int y, int len, - const color_type& c, + void blend_solid_hspan(int x, int y, int len, + const color_type& c, const cover_type* covers) { if(y > ymax()) return; @@ -280,8 +280,8 @@ namespace agg } //-------------------------------------------------------------------- - void blend_solid_vspan(int x, int y, int len, - const color_type& c, + void blend_solid_vspan(int x, int y, int len, + const color_type& c, const cover_type* covers) { if(x > xmax()) return; @@ -303,8 +303,8 @@ namespace agg } //-------------------------------------------------------------------- - void blend_color_hspan(int x, int y, int len, - const color_type* colors, + void blend_color_hspan(int x, int y, int len, + const color_type* colors, const cover_type* covers, cover_type cover = cover_full) { @@ -329,8 +329,8 @@ namespace agg } //-------------------------------------------------------------------- - void blend_color_vspan(int x, int y, int len, - const color_type* colors, + void blend_color_vspan(int x, int y, int len, + const color_type* colors, const cover_type* covers, cover_type cover = cover_full) { @@ -356,8 +356,8 @@ namespace agg //-------------------------------------------------------------------- - void blend_opaque_color_hspan(int x, int y, int len, - const color_type* colors, + void blend_opaque_color_hspan(int x, int y, int len, + const color_type* colors, const cover_type* covers, cover_type cover = cover_full) { @@ -382,8 +382,8 @@ namespace agg } //-------------------------------------------------------------------- - void blend_opaque_color_vspan(int x, int y, int len, - const color_type* colors, + void blend_opaque_color_vspan(int x, int y, int len, + const color_type* colors, const cover_type* covers, cover_type cover = cover_full) { @@ -409,8 +409,8 @@ namespace agg //-------------------------------------------------------------------- - void blend_color_hspan_no_clip(int x, int y, int len, - const color_type* colors, + void blend_color_hspan_no_clip(int x, int y, int len, + const color_type* colors, const cover_type* covers, cover_type cover = cover_full) { @@ -418,8 +418,8 @@ namespace agg } //-------------------------------------------------------------------- - void blend_color_vspan_no_clip(int x, int y, int len, - const color_type* colors, + void blend_color_vspan_no_clip(int x, int y, int len, + const color_type* colors, const cover_type* covers, cover_type cover = cover_full) { @@ -427,8 +427,8 @@ namespace agg } //-------------------------------------------------------------------- - void blend_opaque_color_hspan_no_clip(int x, int y, int len, - const color_type* colors, + void blend_opaque_color_hspan_no_clip(int x, int y, int len, + const color_type* colors, const cover_type* covers, cover_type cover = cover_full) { @@ -436,8 +436,8 @@ namespace agg } //-------------------------------------------------------------------- - void blend_opaque_color_vspan_no_clip(int x, int y, int len, - const color_type* colors, + void blend_opaque_color_vspan_no_clip(int x, int y, int len, + const color_type* colors, const cover_type* covers, cover_type cover = cover_full) { @@ -490,15 +490,15 @@ namespace agg //-------------------------------------------------------------------- - void copy_from(const rendering_buffer& src, - const rect* rect_src_ptr = 0, - int dx = 0, + void copy_from(const rendering_buffer& src, + const rect* rect_src_ptr = 0, + int dx = 0, int dy = 0) { rect rsrc(0, 0, src.width(), src.height()); if(rect_src_ptr) { - rsrc.x1 = rect_src_ptr->x1; + rsrc.x1 = rect_src_ptr->x1; rsrc.y1 = rect_src_ptr->y1; rsrc.x2 = rect_src_ptr->x2 + 1; rsrc.y2 = rect_src_ptr->y2 + 1; @@ -523,7 +523,7 @@ namespace agg } while(rc.y2 > 0) { - m_ren->copy_from(src, + m_ren->copy_from(src, rdst.x1, rdst.y1, rsrc.x1, rsrc.y1, rc.x2); @@ -538,15 +538,15 @@ namespace agg //-------------------------------------------------------------------- template<class SrcPixelFormatRenderer> - void blend_from(const SrcPixelFormatRenderer& src, - const rect* rect_src_ptr = 0, - int dx = 0, + void blend_from(const SrcPixelFormatRenderer& src, + const rect* rect_src_ptr = 0, + int dx = 0, int dy = 0) { rect rsrc(0, 0, src.width(), src.height()); if(rect_src_ptr) { - rsrc.x1 = rect_src_ptr->x1; + rsrc.x1 = rect_src_ptr->x1; rsrc.y1 = rect_src_ptr->y1; rsrc.x2 = rect_src_ptr->x2 + 1; rsrc.y2 = rect_src_ptr->y2 + 1; diff --git a/agg/inc/agg_renderer_markers.h b/agg/inc/agg_renderer_markers.h index ff47995554d9..631816ecd0ac 100755 --- a/agg/inc/agg_renderer_markers.h +++ b/agg/inc/agg_renderer_markers.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. // @@ -47,7 +47,7 @@ namespace agg marker_dash, marker_dot, marker_pixel, - + end_of_markers }; @@ -72,14 +72,14 @@ namespace agg bool visible(int x, int y, int r) const { rect rc(x-r, y-r, x+y, y+r); - return rc.clip(base_type::ren().bounding_clip_box()); + return rc.clip(base_type::ren().bounding_clip_box()); } //-------------------------------------------------------------------- void square(int x, int y, int r) { - if(visible(x, y, r)) - { + if(visible(x, y, r)) + { if(r) base_type::outlined_rectangle(x-r, y-r, x+r, y+r); else base_type::ren().blend_pixel(x, y, base_type::fill_color(), cover_full); } @@ -100,7 +100,7 @@ namespace agg base_type::ren().blend_pixel(x + dx, y + dy, base_type::line_color(), cover_full); base_type::ren().blend_pixel(x - dx, y - dy, base_type::line_color(), cover_full); base_type::ren().blend_pixel(x + dx, y - dy, base_type::line_color(), cover_full); - + if(dx) { base_type::ren().blend_hline(x-dx+1, y+dy, x+dx-1, base_type::fill_color(), cover_full); @@ -169,10 +169,10 @@ namespace agg { dx += ei.dx(); dy += ei.dy(); - + base_type::ren().blend_pixel(x + dy, y + dx, base_type::line_color(), cover_full); base_type::ren().blend_pixel(x + dy, y - dx, base_type::line_color(), cover_full); - + if(ei.dy() && dx) { base_type::ren().blend_vline(x+dy, y-dx+1, y+dx-1, base_type::fill_color(), cover_full); @@ -205,10 +205,10 @@ namespace agg { dx += ei.dx(); dy += ei.dy(); - + base_type::ren().blend_pixel(x - dy, y + dx, base_type::line_color(), cover_full); base_type::ren().blend_pixel(x - dy, y - dx, base_type::line_color(), cover_full); - + if(ei.dy() && dx) { base_type::ren().blend_vline(x-dy, y-dx+1, y+dx-1, base_type::fill_color(), cover_full); @@ -241,10 +241,10 @@ namespace agg { dx += ei.dx(); dy += ei.dy(); - + base_type::ren().blend_pixel(x + dx, y - dy, base_type::line_color(), cover_full); base_type::ren().blend_pixel(x - dx, y - dy, base_type::line_color(), cover_full); - + if(ei.dy() && dx) { base_type::ren().blend_hline(x-dx+1, y-dy, x+dx-1, base_type::fill_color(), cover_full); @@ -277,10 +277,10 @@ namespace agg { dx += ei.dx(); dy += ei.dy(); - + base_type::ren().blend_pixel(x + dx, y + dy, base_type::line_color(), cover_full); base_type::ren().blend_pixel(x - dx, y + dy, base_type::line_color(), cover_full); - + if(ei.dy() && dx) { base_type::ren().blend_hline(x-dx+1, y+dy, x+dx-1, base_type::fill_color(), cover_full); @@ -313,7 +313,7 @@ namespace agg { base_type::ren().blend_pixel(x + dy, y - dx, base_type::line_color(), cover_full); base_type::ren().blend_pixel(x + dy, y + dx, base_type::line_color(), cover_full); - + if(dx) { base_type::ren().blend_vline(x+dy, y-dx+1, y+dx-1, base_type::fill_color(), cover_full); @@ -348,7 +348,7 @@ namespace agg { base_type::ren().blend_pixel(x - dy, y - dx, base_type::line_color(), cover_full); base_type::ren().blend_pixel(x - dy, y + dx, base_type::line_color(), cover_full); - + if(dx) { base_type::ren().blend_vline(x-dy, y-dx+1, y+dx-1, base_type::fill_color(), cover_full); @@ -383,7 +383,7 @@ namespace agg { base_type::ren().blend_pixel(x - dx, y - dy, base_type::line_color(), cover_full); base_type::ren().blend_pixel(x + dx, y - dy, base_type::line_color(), cover_full); - + if(dx) { base_type::ren().blend_hline(x-dx+1, y-dy, x+dx-1, base_type::fill_color(), cover_full); @@ -418,7 +418,7 @@ namespace agg { base_type::ren().blend_pixel(x - dx, y + dy, base_type::line_color(), cover_full); base_type::ren().blend_pixel(x + dx, y + dy, base_type::line_color(), cover_full); - + if(dx) { base_type::ren().blend_hline(x-dx+1, y+dy, x+dx-1, base_type::fill_color(), cover_full); @@ -459,7 +459,7 @@ namespace agg base_type::ren().blend_pixel(x + dy, y + dx, base_type::line_color(), cover_full); base_type::ren().blend_pixel(x - dy, y - dx, base_type::line_color(), cover_full); base_type::ren().blend_pixel(x - dy, y + dx, base_type::line_color(), cover_full); - + if(dx) { base_type::ren().blend_hline(x-dx+1, y+dy, x+dx-1, base_type::fill_color(), cover_full); @@ -498,8 +498,8 @@ namespace agg } } } - - + + //-------------------------------------------------------------------- void xing(int x, int y, int r) { @@ -521,35 +521,35 @@ namespace agg base_type::ren().blend_pixel(x, y, base_type::fill_color(), cover_full); } } - - + + //-------------------------------------------------------------------- void dash(int x, int y, int r) { - if(visible(x, y, r)) + if(visible(x, y, r)) { if(r) base_type::ren().blend_hline(x-r, y, x+r, base_type::line_color(), cover_full); else base_type::ren().blend_pixel(x, y, base_type::fill_color(), cover_full); } } - - + + //-------------------------------------------------------------------- void dot(int x, int y, int r) { - if(visible(x, y, r)) + if(visible(x, y, r)) { if(r) base_type::solid_ellipse(x, y, r, r); else base_type::ren().blend_pixel(x, y, base_type::fill_color(), cover_full); } } - + //-------------------------------------------------------------------- void pixel(int x, int y, int) { base_type::ren().blend_pixel(x, y, base_type::fill_color(), cover_full); } - + //-------------------------------------------------------------------- void marker(int x, int y, int r, marker_e type) { @@ -593,7 +593,7 @@ namespace agg while(--n); return; } - + switch(type) { case marker_square: do { square (int(*x), int(*y), int(r)); ++x; ++y; } while(--n); break; @@ -614,9 +614,9 @@ namespace agg case marker_dash: do { dash (int(*x), int(*y), int(r)); ++x; ++y; } while(--n); break; case marker_dot: do { dot (int(*x), int(*y), int(r)); ++x; ++y; } while(--n); break; case marker_pixel: do { pixel (int(*x), int(*y), int(r)); ++x; ++y; } while(--n); break; - } + } } - + //-------------------------------------------------------------------- template<class T> void markers(int n, const T* x, const T* y, const T* r, marker_e type) @@ -642,9 +642,9 @@ namespace agg case marker_dash: do { dash (int(*x), int(*y), int(*r)); ++x; ++y; ++r; } while(--n); break; case marker_dot: do { dot (int(*x), int(*y), int(*r)); ++x; ++y; ++r; } while(--n); break; case marker_pixel: do { pixel (int(*x), int(*y), int(*r)); ++x; ++y; ++r; } while(--n); break; - } + } } - + //-------------------------------------------------------------------- template<class T> void markers(int n, const T* x, const T* y, const T* r, const color_type* fc, marker_e type) @@ -672,7 +672,7 @@ namespace agg case marker_pixel: do { base_type::fill_color(*fc); pixel (int(*x), int(*y), int(*r)); ++x; ++y; ++r; ++fc; } while(--n); break; } } - + //-------------------------------------------------------------------- template<class T> void markers(int n, const T* x, const T* y, const T* r, const color_type* fc, const color_type* lc, marker_e type) diff --git a/agg/inc/agg_renderer_mclip.h b/agg/inc/agg_renderer_mclip.h index dc758b9ea72d..95a57009a8f6 100755 --- a/agg/inc/agg_renderer_mclip.h +++ b/agg/inc/agg_renderer_mclip.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. // @@ -42,7 +42,7 @@ namespace agg m_bounds(m_ren.xmin(), m_ren.ymin(), m_ren.xmax(), m_ren.ymax()) { } - + //-------------------------------------------------------------------- const pixfmt_type& ren() const { return m_ren.ren(); } pixfmt_type& ren() { return m_ren.ren(); } @@ -66,7 +66,7 @@ namespace agg int bounding_ymax() const { return m_bounds.y2; } //-------------------------------------------------------------------- - void first_clip_box() + void first_clip_box() { m_curr_cb = 0; if(m_clip.size()) @@ -77,15 +77,15 @@ namespace agg } //-------------------------------------------------------------------- - bool next_clip_box() - { + bool next_clip_box() + { if(++m_curr_cb < m_clip.size()) { const rect& cb = m_clip[m_curr_cb]; m_ren.clip_box_naked(cb.x1, cb.y1, cb.x2, cb.y2); return true; } - return false; + return false; } //-------------------------------------------------------------------- @@ -96,11 +96,11 @@ namespace agg m_curr_cb = 0; m_bounds = m_ren.clip_box(); } - + //-------------------------------------------------------------------- void add_clip_box(int x1, int y1, int x2, int y2) { - rect cb(x1, y1, x2, y2); + rect cb(x1, y1, x2, y2); cb.normalize(); if(cb.clip(rect(0, 0, width() - 1, height() - 1))) { @@ -117,7 +117,7 @@ namespace agg { m_ren.clear(c); } - + //-------------------------------------------------------------------- void copy_pixel(int x, int y, const color_type& c) { @@ -186,7 +186,7 @@ namespace agg } //-------------------------------------------------------------------- - void blend_hline(int x1, int y, int x2, + void blend_hline(int x1, int y, int x2, const color_type& c, cover_type cover) { first_clip_box(); @@ -198,7 +198,7 @@ namespace agg } //-------------------------------------------------------------------- - void blend_vline(int x, int y1, int y2, + void blend_vline(int x, int y1, int y2, const color_type& c, cover_type cover) { first_clip_box(); @@ -221,7 +221,7 @@ namespace agg } //-------------------------------------------------------------------- - void blend_bar(int x1, int y1, int x2, int y2, + void blend_bar(int x1, int y1, int x2, int y2, const color_type& c, cover_type cover) { first_clip_box(); @@ -234,7 +234,7 @@ namespace agg //-------------------------------------------------------------------- - void blend_solid_hspan(int x, int y, int len, + void blend_solid_hspan(int x, int y, int len, const color_type& c, const cover_type* covers) { first_clip_box(); @@ -246,7 +246,7 @@ namespace agg } //-------------------------------------------------------------------- - void blend_solid_vspan(int x, int y, int len, + void blend_solid_vspan(int x, int y, int len, const color_type& c, const cover_type* covers) { first_clip_box(); @@ -258,8 +258,8 @@ namespace agg } //-------------------------------------------------------------------- - void blend_color_hspan(int x, int y, int len, - const color_type* colors, + void blend_color_hspan(int x, int y, int len, + const color_type* colors, const cover_type* covers, cover_type cover = cover_full) { @@ -272,8 +272,8 @@ namespace agg } //-------------------------------------------------------------------- - void blend_color_vspan(int x, int y, int len, - const color_type* colors, + void blend_color_vspan(int x, int y, int len, + const color_type* colors, const cover_type* covers, cover_type cover = cover_full) { @@ -287,8 +287,8 @@ namespace agg //-------------------------------------------------------------------- - void blend_qpaque_color_hspan(int x, int y, int len, - const color_type* colors, + void blend_qpaque_color_hspan(int x, int y, int len, + const color_type* colors, const cover_type* covers, cover_type cover = cover_full) { @@ -301,8 +301,8 @@ namespace agg } //-------------------------------------------------------------------- - void blend_opaque_color_vspan(int x, int y, int len, - const color_type* colors, + void blend_opaque_color_vspan(int x, int y, int len, + const color_type* colors, const cover_type* covers, cover_type cover = cover_full) { @@ -316,8 +316,8 @@ namespace agg //-------------------------------------------------------------------- - void blend_color_hspan_no_clip(int x, int y, int len, - const color_type* colors, + void blend_color_hspan_no_clip(int x, int y, int len, + const color_type* colors, const cover_type* covers, cover_type cover = cover_full) { @@ -325,8 +325,8 @@ namespace agg } //-------------------------------------------------------------------- - void blend_color_vspan_no_clip(int x, int y, int len, - const color_type* colors, + void blend_color_vspan_no_clip(int x, int y, int len, + const color_type* colors, const cover_type* covers, cover_type cover = cover_full) { @@ -334,8 +334,8 @@ namespace agg } //-------------------------------------------------------------------- - void blend_opaque_color_hspan_no_clip(int x, int y, int len, - const color_type* colors, + void blend_opaque_color_hspan_no_clip(int x, int y, int len, + const color_type* colors, const cover_type* covers, cover_type cover = cover_full) { @@ -343,8 +343,8 @@ namespace agg } //-------------------------------------------------------------------- - void blend_opaque_color_vspan_no_clip(int x, int y, int len, - const color_type* colors, + void blend_opaque_color_vspan_no_clip(int x, int y, int len, + const color_type* colors, const cover_type* covers, cover_type cover = cover_full) { @@ -353,9 +353,9 @@ namespace agg //-------------------------------------------------------------------- - void copy_from(const rendering_buffer& from, - const rect* rc=0, - int x_to=0, + void copy_from(const rendering_buffer& from, + const rect* rc=0, + int x_to=0, int y_to=0) { first_clip_box(); @@ -365,10 +365,10 @@ namespace agg } while(next_clip_box()); } - + private: renderer_mclip(const renderer_mclip<PixelFormat>&); - const renderer_mclip<PixelFormat>& + const renderer_mclip<PixelFormat>& operator = (const renderer_mclip<PixelFormat>&); base_ren_type m_ren; diff --git a/agg/inc/agg_renderer_outline_aa.h b/agg/inc/agg_renderer_outline_aa.h index d2f9484c5a1d..c93c23de3fff 100755 --- a/agg/inc/agg_renderer_outline_aa.h +++ b/agg/inc/agg_renderer_outline_aa.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. // @@ -35,7 +35,7 @@ namespace agg distance_interpolator0(int x1, int y1, int x2, int y2, int x, int y) : m_dx(line_mr(x2) - line_mr(x1)), m_dy(line_mr(y2) - line_mr(y1)), - m_dist((line_mr(x + line_subpixel_size/2) - line_mr(x2)) * m_dy - + m_dist((line_mr(x + line_subpixel_size/2) - line_mr(x2)) * m_dy - (line_mr(y + line_subpixel_size/2) - line_mr(y2)) * m_dx) { m_dx <<= line_mr_subpixel_shift; @@ -51,33 +51,33 @@ namespace agg //--------------------------------------------------------------------- void inc_x(int _dy) { - m_dist += m_dy; - if(_dy > 0) m_dist -= m_dx; - if(_dy < 0) m_dist += m_dx; + m_dist += m_dy; + if(_dy > 0) m_dist -= m_dx; + if(_dy < 0) m_dist += m_dx; } //--------------------------------------------------------------------- void dec_x(int _dy) { - m_dist -= m_dy; - if(_dy > 0) m_dist -= m_dx; - if(_dy < 0) m_dist += m_dx; + m_dist -= m_dy; + if(_dy > 0) m_dist -= m_dx; + if(_dy < 0) m_dist += m_dx; } //--------------------------------------------------------------------- void inc_y(int _dx) { - m_dist -= m_dx; - if(_dx > 0) m_dist += m_dy; - if(_dx < 0) m_dist -= m_dy; + m_dist -= m_dx; + if(_dx > 0) m_dist += m_dy; + if(_dx < 0) m_dist -= m_dy; } void dec_y(int _dx) //--------------------------------------------------------------------- { - m_dist += m_dx; - if(_dx > 0) m_dist += m_dy; - if(_dx < 0) m_dist -= m_dy; + m_dist += m_dx; + if(_dx > 0) m_dist += m_dy; + if(_dx < 0) m_dist -= m_dy; } //--------------------------------------------------------------------- @@ -103,7 +103,7 @@ namespace agg distance_interpolator1(int x1, int y1, int x2, int y2, int x, int y) : m_dx(x2 - x1), m_dy(y2 - y1), - m_dist(int(double(x + line_subpixel_size/2 - x2) * double(m_dy) - + m_dist(int(double(x + line_subpixel_size/2 - x2) * double(m_dy) - double(y + line_subpixel_size/2 - y2) * double(m_dx))) { m_dx <<= line_subpixel_shift; @@ -119,33 +119,33 @@ namespace agg //--------------------------------------------------------------------- void inc_x(int _dy) { - m_dist += m_dy; - if(_dy > 0) m_dist -= m_dx; - if(_dy < 0) m_dist += m_dx; + m_dist += m_dy; + if(_dy > 0) m_dist -= m_dx; + if(_dy < 0) m_dist += m_dx; } //--------------------------------------------------------------------- void dec_x(int _dy) { - m_dist -= m_dy; - if(_dy > 0) m_dist -= m_dx; - if(_dy < 0) m_dist += m_dx; + m_dist -= m_dy; + if(_dy > 0) m_dist -= m_dx; + if(_dy < 0) m_dist += m_dx; } //--------------------------------------------------------------------- void inc_y(int _dx) { - m_dist -= m_dx; - if(_dx > 0) m_dist += m_dy; - if(_dx < 0) m_dist -= m_dy; + m_dist -= m_dx; + if(_dx > 0) m_dist += m_dy; + if(_dx < 0) m_dist -= m_dy; } void dec_y(int _dx) //--------------------------------------------------------------------- { - m_dist += m_dx; - if(_dx > 0) m_dist += m_dy; - if(_dx < 0) m_dist -= m_dy; + m_dist += m_dx; + if(_dx > 0) m_dist += m_dy; + if(_dx < 0) m_dist -= m_dy; } //--------------------------------------------------------------------- @@ -177,10 +177,10 @@ namespace agg m_dx_start(line_mr(sx) - line_mr(x1)), m_dy_start(line_mr(sy) - line_mr(y1)), - m_dist(int(double(x + line_subpixel_size/2 - x2) * double(m_dy) - + m_dist(int(double(x + line_subpixel_size/2 - x2) * double(m_dy) - double(y + line_subpixel_size/2 - y2) * double(m_dx))), - m_dist_start((line_mr(x + line_subpixel_size/2) - line_mr(sx)) * m_dy_start - + m_dist_start((line_mr(x + line_subpixel_size/2) - line_mr(sx)) * m_dy_start - (line_mr(y + line_subpixel_size/2) - line_mr(sy)) * m_dx_start) { m_dx <<= line_subpixel_shift; @@ -196,10 +196,10 @@ namespace agg m_dx_start(line_mr(ex) - line_mr(x2)), m_dy_start(line_mr(ey) - line_mr(y2)), - m_dist(int(double(x + line_subpixel_size/2 - x2) * double(m_dy) - + m_dist(int(double(x + line_subpixel_size/2 - x2) * double(m_dy) - double(y + line_subpixel_size/2 - y2) * double(m_dx))), - m_dist_start((line_mr(x + line_subpixel_size/2) - line_mr(ex)) * m_dy_start - + m_dist_start((line_mr(x + line_subpixel_size/2) - line_mr(ex)) * m_dy_start - (line_mr(y + line_subpixel_size/2) - line_mr(ey)) * m_dx_start) { m_dx <<= line_subpixel_shift; @@ -218,68 +218,68 @@ namespace agg //--------------------------------------------------------------------- void inc_x(int _dy) { - m_dist += m_dy; - m_dist_start += m_dy_start; + m_dist += m_dy; + m_dist_start += m_dy_start; if(_dy > 0) { - m_dist -= m_dx; - m_dist_start -= m_dx_start; + m_dist -= m_dx; + m_dist_start -= m_dx_start; } if(_dy < 0) { - m_dist += m_dx; - m_dist_start += m_dx_start; + m_dist += m_dx; + m_dist_start += m_dx_start; } } //--------------------------------------------------------------------- void dec_x(int _dy) { - m_dist -= m_dy; - m_dist_start -= m_dy_start; + m_dist -= m_dy; + m_dist_start -= m_dy_start; if(_dy > 0) { - m_dist -= m_dx; - m_dist_start -= m_dx_start; + m_dist -= m_dx; + m_dist_start -= m_dx_start; } if(_dy < 0) { - m_dist += m_dx; - m_dist_start += m_dx_start; + m_dist += m_dx; + m_dist_start += m_dx_start; } } //--------------------------------------------------------------------- void inc_y(int _dx) { - m_dist -= m_dx; - m_dist_start -= m_dx_start; + m_dist -= m_dx; + m_dist_start -= m_dx_start; if(_dx > 0) { - m_dist += m_dy; - m_dist_start += m_dy_start; + m_dist += m_dy; + m_dist_start += m_dy_start; } if(_dx < 0) { - m_dist -= m_dy; - m_dist_start -= m_dy_start; + m_dist -= m_dy; + m_dist_start -= m_dy_start; } } //--------------------------------------------------------------------- void dec_y(int _dx) { - m_dist += m_dx; - m_dist_start += m_dx_start; + m_dist += m_dx; + m_dist_start += m_dx_start; if(_dx > 0) { - m_dist += m_dy; - m_dist_start += m_dy_start; + m_dist += m_dy; + m_dist_start += m_dy_start; } if(_dx < 0) { - m_dist -= m_dy; - m_dist_start -= m_dy_start; + m_dist -= m_dy; + m_dist_start -= m_dy_start; } } @@ -318,7 +318,7 @@ namespace agg //--------------------------------------------------------------------- distance_interpolator3() {} distance_interpolator3(int x1, int y1, int x2, int y2, - int sx, int sy, int ex, int ey, + int sx, int sy, int ex, int ey, int x, int y) : m_dx(x2 - x1), m_dy(y2 - y1), @@ -327,13 +327,13 @@ namespace agg m_dx_end(line_mr(ex) - line_mr(x2)), m_dy_end(line_mr(ey) - line_mr(y2)), - m_dist(int(double(x + line_subpixel_size/2 - x2) * double(m_dy) - + m_dist(int(double(x + line_subpixel_size/2 - x2) * double(m_dy) - double(y + line_subpixel_size/2 - y2) * double(m_dx))), - m_dist_start((line_mr(x + line_subpixel_size/2) - line_mr(sx)) * m_dy_start - + m_dist_start((line_mr(x + line_subpixel_size/2) - line_mr(sx)) * m_dy_start - (line_mr(y + line_subpixel_size/2) - line_mr(sy)) * m_dx_start), - m_dist_end((line_mr(x + line_subpixel_size/2) - line_mr(ex)) * m_dy_end - + m_dist_end((line_mr(x + line_subpixel_size/2) - line_mr(ex)) * m_dy_end - (line_mr(y + line_subpixel_size/2) - line_mr(ey)) * m_dx_end) { m_dx <<= line_subpixel_shift; @@ -353,19 +353,19 @@ namespace agg //--------------------------------------------------------------------- void inc_x(int _dy) { - m_dist += m_dy; - m_dist_start += m_dy_start; + m_dist += m_dy; + m_dist_start += m_dy_start; m_dist_end += m_dy_end; if(_dy > 0) { - m_dist -= m_dx; - m_dist_start -= m_dx_start; + m_dist -= m_dx; + m_dist_start -= m_dx_start; m_dist_end -= m_dx_end; } if(_dy < 0) { - m_dist += m_dx; - m_dist_start += m_dx_start; + m_dist += m_dx; + m_dist_start += m_dx_start; m_dist_end += m_dx_end; } } @@ -373,19 +373,19 @@ namespace agg //--------------------------------------------------------------------- void dec_x(int _dy) { - m_dist -= m_dy; - m_dist_start -= m_dy_start; + m_dist -= m_dy; + m_dist_start -= m_dy_start; m_dist_end -= m_dy_end; if(_dy > 0) { - m_dist -= m_dx; - m_dist_start -= m_dx_start; + m_dist -= m_dx; + m_dist_start -= m_dx_start; m_dist_end -= m_dx_end; } if(_dy < 0) { - m_dist += m_dx; - m_dist_start += m_dx_start; + m_dist += m_dx; + m_dist_start += m_dx_start; m_dist_end += m_dx_end; } } @@ -393,19 +393,19 @@ namespace agg //--------------------------------------------------------------------- void inc_y(int _dx) { - m_dist -= m_dx; - m_dist_start -= m_dx_start; + m_dist -= m_dx; + m_dist_start -= m_dx_start; m_dist_end -= m_dx_end; if(_dx > 0) { - m_dist += m_dy; - m_dist_start += m_dy_start; + m_dist += m_dy; + m_dist_start += m_dy_start; m_dist_end += m_dy_end; } if(_dx < 0) { - m_dist -= m_dy; - m_dist_start -= m_dy_start; + m_dist -= m_dy; + m_dist_start -= m_dy_start; m_dist_end -= m_dy_end; } } @@ -413,19 +413,19 @@ namespace agg //--------------------------------------------------------------------- void dec_y(int _dx) { - m_dist += m_dx; - m_dist_start += m_dx_start; + m_dist += m_dx; + m_dist_start += m_dx_start; m_dist_end += m_dx_end; if(_dx > 0) { - m_dist += m_dy; - m_dist_start += m_dy_start; + m_dist += m_dy; + m_dist_start += m_dy_start; m_dist_end += m_dy_end; } if(_dx < 0) { - m_dist -= m_dy; - m_dist_start -= m_dy_start; + m_dist -= m_dy; + m_dist_start -= m_dy_start; m_dist_end -= m_dy_end; } } @@ -460,7 +460,7 @@ namespace agg - + //================================================line_interpolator_aa_base template<class Renderer> class line_interpolator_aa_base { @@ -469,8 +469,8 @@ namespace agg typedef typename Renderer::color_type color_type; //--------------------------------------------------------------------- - enum - { + enum + { max_half_width = 64 }; @@ -479,7 +479,7 @@ namespace agg m_lp(&lp), m_li(lp.vertical ? line_dbl_hr(lp.x2 - lp.x1) : line_dbl_hr(lp.y2 - lp.y1), - lp.vertical ? abs(lp.y2 - lp.y1) : + lp.vertical ? abs(lp.y2 - lp.y1) : abs(lp.x2 - lp.x1) + 1), m_ren(ren), m_len((lp.vertical == (lp.inc > 0)) ? -lp.len : lp.len), @@ -493,7 +493,7 @@ namespace agg m_max_extent(m_width >> (line_subpixel_shift - 2)), m_step(0) { - agg::dda2_line_interpolator li(0, lp.vertical ? + agg::dda2_line_interpolator li(0, lp.vertical ? (lp.dy << agg::line_subpixel_shift) : (lp.dx << agg::line_subpixel_shift), lp.len); @@ -546,7 +546,7 @@ namespace agg private: line_interpolator_aa_base(const line_interpolator_aa_base<Renderer>&); - const line_interpolator_aa_base<Renderer>& + const line_interpolator_aa_base<Renderer>& operator = (const line_interpolator_aa_base<Renderer>&); protected: @@ -584,7 +584,7 @@ namespace agg //--------------------------------------------------------------------- line_interpolator_aa0(renderer_type& ren, const line_parameters& lp) : line_interpolator_aa_base<Renderer>(ren, lp), - m_di(lp.x1, lp.y1, lp.x2, lp.y2, + m_di(lp.x1, lp.y1, lp.x2, lp.y2, lp.x1 & ~line_subpixel_mask, lp.y1 & ~line_subpixel_mask) { base_type::m_li.adjust_forward(); @@ -614,9 +614,9 @@ namespace agg *--p0 = (cover_type)base_type::m_ren.cover(dist); ++dy; } - base_type::m_ren.blend_solid_vspan(base_type::m_x, - base_type::m_y - dy + 1, - unsigned(p1 - p0), + base_type::m_ren.blend_solid_vspan(base_type::m_x, + base_type::m_y - dy + 1, + unsigned(p1 - p0), p0); return ++base_type::m_step < base_type::m_count; } @@ -645,20 +645,20 @@ namespace agg *--p0 = (cover_type)base_type::m_ren.cover(dist); ++dx; } - base_type::m_ren.blend_solid_hspan(base_type::m_x - dx + 1, + base_type::m_ren.blend_solid_hspan(base_type::m_x - dx + 1, base_type::m_y, - unsigned(p1 - p0), + unsigned(p1 - p0), p0); return ++base_type::m_step < base_type::m_count; } private: line_interpolator_aa0(const line_interpolator_aa0<Renderer>&); - const line_interpolator_aa0<Renderer>& + const line_interpolator_aa0<Renderer>& operator = (const line_interpolator_aa0<Renderer>&); //--------------------------------------------------------------------- - distance_interpolator1 m_di; + distance_interpolator1 m_di; }; @@ -676,7 +676,7 @@ namespace agg typedef line_interpolator_aa_base<Renderer> base_type; //--------------------------------------------------------------------- - line_interpolator_aa1(renderer_type& ren, const line_parameters& lp, + line_interpolator_aa1(renderer_type& ren, const line_parameters& lp, int sx, int sy) : line_interpolator_aa_base<Renderer>(ren, lp), m_di(lp.x1, lp.y1, lp.x2, lp.y2, sx, sy, @@ -700,7 +700,7 @@ namespace agg base_type::m_old_x = base_type::m_x; - dist1_start = dist2_start = m_di.dist_start(); + dist1_start = dist2_start = m_di.dist_start(); int dx = 0; if(dist1_start < 0) ++npix; @@ -732,7 +732,7 @@ namespace agg base_type::m_old_y = base_type::m_y; - dist1_start = dist2_start = m_di.dist_start(); + dist1_start = dist2_start = m_di.dist_start(); int dy = 0; if(dist1_start < 0) ++npix; @@ -779,7 +779,7 @@ namespace agg dist_start -= m_di.dx_start(); *p1 = 0; if(dist_start <= 0) - { + { *p1 = (cover_type)base_type::m_ren.cover(dist); } ++p1; @@ -793,15 +793,15 @@ namespace agg dist_start += m_di.dx_start(); *--p0 = 0; if(dist_start <= 0) - { + { *p0 = (cover_type)base_type::m_ren.cover(dist); } ++dy; } - base_type::m_ren.blend_solid_vspan(base_type::m_x, + base_type::m_ren.blend_solid_vspan(base_type::m_x, base_type::m_y - dy + 1, - unsigned(p1 - p0), + unsigned(p1 - p0), p0); return ++base_type::m_step < base_type::m_count; } @@ -831,7 +831,7 @@ namespace agg dist_start += m_di.dy_start(); *p1 = 0; if(dist_start <= 0) - { + { *p1 = (cover_type)base_type::m_ren.cover(dist); } ++p1; @@ -845,25 +845,25 @@ namespace agg dist_start -= m_di.dy_start(); *--p0 = 0; if(dist_start <= 0) - { + { *p0 = (cover_type)base_type::m_ren.cover(dist); } ++dx; } - base_type::m_ren.blend_solid_hspan(base_type::m_x - dx + 1, + base_type::m_ren.blend_solid_hspan(base_type::m_x - dx + 1, base_type::m_y, - unsigned(p1 - p0), + unsigned(p1 - p0), p0); return ++base_type::m_step < base_type::m_count; } private: line_interpolator_aa1(const line_interpolator_aa1<Renderer>&); - const line_interpolator_aa1<Renderer>& + const line_interpolator_aa1<Renderer>& operator = (const line_interpolator_aa1<Renderer>&); //--------------------------------------------------------------------- - distance_interpolator2 m_di; + distance_interpolator2 m_di; }; @@ -887,10 +887,10 @@ namespace agg typedef line_interpolator_aa_base<Renderer> base_type; //--------------------------------------------------------------------- - line_interpolator_aa2(renderer_type& ren, const line_parameters& lp, + line_interpolator_aa2(renderer_type& ren, const line_parameters& lp, int ex, int ey) : line_interpolator_aa_base<Renderer>(ren, lp), - m_di(lp.x1, lp.y1, lp.x2, lp.y2, ex, ey, + m_di(lp.x1, lp.y1, lp.x2, lp.y2, ex, ey, lp.x1 & ~line_subpixel_mask, lp.y1 & ~line_subpixel_mask, 0) { @@ -925,7 +925,7 @@ namespace agg dist_end -= m_di.dx_end(); *p1 = 0; if(dist_end > 0) - { + { *p1 = (cover_type)base_type::m_ren.cover(dist); ++npix; } @@ -940,15 +940,15 @@ namespace agg dist_end += m_di.dx_end(); *--p0 = 0; if(dist_end > 0) - { + { *p0 = (cover_type)base_type::m_ren.cover(dist); ++npix; } ++dy; } base_type::m_ren.blend_solid_vspan(base_type::m_x, - base_type::m_y - dy + 1, - unsigned(p1 - p0), + base_type::m_y - dy + 1, + unsigned(p1 - p0), p0); return npix && ++base_type::m_step < base_type::m_count; } @@ -980,7 +980,7 @@ namespace agg dist_end += m_di.dy_end(); *p1 = 0; if(dist_end > 0) - { + { *p1 = (cover_type)base_type::m_ren.cover(dist); ++npix; } @@ -995,26 +995,26 @@ namespace agg dist_end -= m_di.dy_end(); *--p0 = 0; if(dist_end > 0) - { + { *p0 = (cover_type)base_type::m_ren.cover(dist); ++npix; } ++dx; } base_type::m_ren.blend_solid_hspan(base_type::m_x - dx + 1, - base_type::m_y, - unsigned(p1 - p0), + base_type::m_y, + unsigned(p1 - p0), p0); return npix && ++base_type::m_step < base_type::m_count; } private: line_interpolator_aa2(const line_interpolator_aa2<Renderer>&); - const line_interpolator_aa2<Renderer>& + const line_interpolator_aa2<Renderer>& operator = (const line_interpolator_aa2<Renderer>&); //--------------------------------------------------------------------- - distance_interpolator2 m_di; + distance_interpolator2 m_di; }; @@ -1036,10 +1036,10 @@ namespace agg typedef line_interpolator_aa_base<Renderer> base_type; //--------------------------------------------------------------------- - line_interpolator_aa3(renderer_type& ren, const line_parameters& lp, + line_interpolator_aa3(renderer_type& ren, const line_parameters& lp, int sx, int sy, int ex, int ey) : line_interpolator_aa_base<Renderer>(ren, lp), - m_di(lp.x1, lp.y1, lp.x2, lp.y2, sx, sy, ex, ey, + m_di(lp.x1, lp.y1, lp.x2, lp.y2, sx, sy, ex, ey, lp.x1 & ~line_subpixel_mask, lp.y1 & ~line_subpixel_mask) { int dist1_start; @@ -1058,7 +1058,7 @@ namespace agg base_type::m_old_x = base_type::m_x; - dist1_start = dist2_start = m_di.dist_start(); + dist1_start = dist2_start = m_di.dist_start(); int dx = 0; if(dist1_start < 0) ++npix; @@ -1089,7 +1089,7 @@ namespace agg base_type::m_old_y = base_type::m_y; - dist1_start = dist2_start = m_di.dist_start(); + dist1_start = dist2_start = m_di.dist_start(); int dy = 0; if(dist1_start < 0) ++npix; @@ -1145,7 +1145,7 @@ namespace agg dist_end -= m_di.dx_end(); *p1 = 0; if(dist_end > 0 && dist_start <= 0) - { + { *p1 = (cover_type)base_type::m_ren.cover(dist); ++npix; } @@ -1162,15 +1162,15 @@ namespace agg dist_end += m_di.dx_end(); *--p0 = 0; if(dist_end > 0 && dist_start <= 0) - { + { *p0 = (cover_type)base_type::m_ren.cover(dist); ++npix; } ++dy; } base_type::m_ren.blend_solid_vspan(base_type::m_x, - base_type::m_y - dy + 1, - unsigned(p1 - p0), + base_type::m_y - dy + 1, + unsigned(p1 - p0), p0); return npix && ++base_type::m_step < base_type::m_count; } @@ -1208,7 +1208,7 @@ namespace agg dist_end += m_di.dy_end(); *p1 = 0; if(dist_end > 0 && dist_start <= 0) - { + { *p1 = (cover_type)base_type::m_ren.cover(dist); ++npix; } @@ -1225,26 +1225,26 @@ namespace agg dist_end -= m_di.dy_end(); *--p0 = 0; if(dist_end > 0 && dist_start <= 0) - { + { *p0 = (cover_type)base_type::m_ren.cover(dist); ++npix; } ++dx; } base_type::m_ren.blend_solid_hspan(base_type::m_x - dx + 1, - base_type::m_y, - unsigned(p1 - p0), + base_type::m_y, + unsigned(p1 - p0), p0); return npix && ++base_type::m_step < base_type::m_count; } private: line_interpolator_aa3(const line_interpolator_aa3<Renderer>&); - const line_interpolator_aa3<Renderer>& + const line_interpolator_aa3<Renderer>& operator = (const line_interpolator_aa3<Renderer>&); //--------------------------------------------------------------------- - distance_interpolator3 m_di; + distance_interpolator3 m_di; }; @@ -1252,8 +1252,8 @@ namespace agg //==========================================================line_profile_aa // - // See Implementation agg_line_profile_aa.cpp - // + // See Implementation agg_line_profile_aa.cpp + // class line_profile_aa { public: @@ -1272,14 +1272,14 @@ namespace agg aa_num = 1 << aa_shift, aa_mask = aa_num - 1 }; - + //--------------------------------------------------------------------- ~line_profile_aa() { delete [] m_profile; } //--------------------------------------------------------------------- - line_profile_aa() : - m_size(0), - m_profile(0), + line_profile_aa() : + m_size(0), + m_profile(0), m_subpixel_width(0), m_min_width(1.0), m_smoother_width(1.0) @@ -1289,10 +1289,10 @@ namespace agg } //--------------------------------------------------------------------- - template<class GammaF> - line_profile_aa(double w, const GammaF& gamma_function) : - m_size(0), - m_profile(0), + template<class GammaF> + line_profile_aa(double w, const GammaF& gamma_function) : + m_size(0), + m_profile(0), m_subpixel_width(0), m_min_width(1.0), m_smoother_width(1.0) @@ -1307,7 +1307,7 @@ namespace agg //--------------------------------------------------------------------- template<class GammaF> void gamma(const GammaF& gamma_function) - { + { int i; for(i = 0; i < aa_num; i++) { @@ -1401,7 +1401,7 @@ namespace agg //------------------------------------------------------------------------- template<class Cmp> void semidot_hline(Cmp cmp, - int xc1, int yc1, int xc2, int yc2, + int xc1, int yc1, int xc2, int yc2, int x1, int y1, int x2) { cover_type covers[line_interpolator_aa_base<self_type>::max_half_width * 2 + 4]; @@ -1430,14 +1430,14 @@ namespace agg di.inc_x(); } while(++x1 <= x2); - m_ren->blend_solid_hspan(x0, y1, - unsigned(p1 - p0), - color(), + m_ren->blend_solid_hspan(x0, y1, + unsigned(p1 - p0), + color(), p0); } //------------------------------------------------------------------------- - template<class Cmp> + template<class Cmp> void semidot(Cmp cmp, int xc1, int yc1, int xc2, int yc2) { int r = ((subpixel_width() + line_subpixel_mask) >> line_subpixel_shift); @@ -1516,7 +1516,7 @@ namespace agg } //------------------------------------------------------------------------- - void line3(const line_parameters& lp, + void line3(const line_parameters& lp, int sx, int sy, int ex, int ey) { fix_degenerate_bisectrix_start(lp, &sx, &sy); @@ -1534,7 +1534,7 @@ namespace agg private: base_ren_type* m_ren; - const line_profile_aa* m_profile; + const line_profile_aa* m_profile; color_type m_color; }; diff --git a/agg/inc/agg_renderer_outline_image.h b/agg/inc/agg_renderer_outline_image.h index d5cd3992448c..12bb5bf13f12 100755 --- a/agg/inc/agg_renderer_outline_image.h +++ b/agg/inc/agg_renderer_outline_image.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. // @@ -30,7 +30,7 @@ namespace agg typedef typename Source::color_type color_type; line_image_scale(const Source& src, double height) : - m_source(src), + m_source(src), m_height(height), m_scale(src.height() / height) { @@ -39,8 +39,8 @@ namespace agg double width() const { return m_source.width(); } double height() const { return m_height; } - color_type pixel(int x, int y) const - { + color_type pixel(int x, int y) const + { double src_y = (y + 0.5) * m_scale - 0.5; int h = int(m_source.height()) - 1; int y1 = int(floor(src_y)); @@ -90,7 +90,7 @@ namespace agg // Create //-------------------------------------------------------------------- - template<class Source> + template<class Source> line_image_pattern(const Filter& filter, const Source& src) : m_filter(&filter), m_dilation(filter.dilation() + 1), @@ -119,8 +119,8 @@ namespace agg delete [] m_data; m_data = new color_type [(m_width + m_dilation * 2) * (m_height + m_dilation * 2)]; - m_buf.attach(m_data, m_width + m_dilation * 2, - m_height + m_dilation * 2, + m_buf.attach(m_data, m_width + m_dilation * 2, + m_height + m_dilation * 2, m_width + m_dilation * 2); unsigned x, y; color_type* d1; @@ -174,8 +174,8 @@ namespace agg //-------------------------------------------------------------------- void pixel(color_type* p, int x, int y) const { - m_filter->pixel_high_res(m_buf.rows(), - p, + m_filter->pixel_high_res(m_buf.rows(), + p, x % m_width_hr + m_dilation_hr, y + m_offset_y_hr); } @@ -185,7 +185,7 @@ namespace agg private: line_image_pattern(const line_image_pattern<filter_type>&); - const line_image_pattern<filter_type>& + const line_image_pattern<filter_type>& operator = (const line_image_pattern<filter_type>&); protected: @@ -207,32 +207,32 @@ namespace agg //=================================================line_image_pattern_pow2 - template<class Filter> class line_image_pattern_pow2 : + template<class Filter> class line_image_pattern_pow2 : public line_image_pattern<Filter> { public: typedef Filter filter_type; typedef typename filter_type::color_type color_type; typedef line_image_pattern<Filter> base_type; - + //-------------------------------------------------------------------- line_image_pattern_pow2(const Filter& filter) : line_image_pattern<Filter>(filter), m_mask(line_subpixel_mask) {} //-------------------------------------------------------------------- - template<class Source> + template<class Source> line_image_pattern_pow2(const Filter& filter, const Source& src) : line_image_pattern<Filter>(filter), m_mask(line_subpixel_mask) { create(src); } - + //-------------------------------------------------------------------- template<class Source> void create(const Source& src) { line_image_pattern<Filter>::create(src); m_mask = 1; - while(m_mask < base_type::m_width) + while(m_mask < base_type::m_width) { m_mask <<= 1; m_mask |= 1; @@ -246,7 +246,7 @@ namespace agg void pixel(color_type* p, int x, int y) const { base_type::m_filter->pixel_high_res( - base_type::m_buf.rows(), + base_type::m_buf.rows(), p, (x & m_mask) + base_type::m_dilation_hr, y + base_type::m_offset_y_hr); @@ -254,13 +254,13 @@ namespace agg private: unsigned m_mask; }; - - - - - - - + + + + + + + //===================================================distance_interpolator4 class distance_interpolator4 { @@ -268,7 +268,7 @@ namespace agg //--------------------------------------------------------------------- distance_interpolator4() {} distance_interpolator4(int x1, int y1, int x2, int y2, - int sx, int sy, int ex, int ey, + int sx, int sy, int ex, int ey, int len, double scale, int x, int y) : m_dx(x2 - x1), m_dy(y2 - y1), @@ -277,13 +277,13 @@ namespace agg m_dx_end(line_mr(ex) - line_mr(x2)), m_dy_end(line_mr(ey) - line_mr(y2)), - m_dist(int(double(x + line_subpixel_size/2 - x2) * double(m_dy) - + m_dist(int(double(x + line_subpixel_size/2 - x2) * double(m_dy) - double(y + line_subpixel_size/2 - y2) * double(m_dx))), - m_dist_start((line_mr(x + line_subpixel_size/2) - line_mr(sx)) * m_dy_start - + m_dist_start((line_mr(x + line_subpixel_size/2) - line_mr(sx)) * m_dy_start - (line_mr(y + line_subpixel_size/2) - line_mr(sy)) * m_dx_start), - m_dist_end((line_mr(x + line_subpixel_size/2) - line_mr(ex)) * m_dy_end - + m_dist_end((line_mr(x + line_subpixel_size/2) - line_mr(ex)) * m_dy_end - (line_mr(y + line_subpixel_size/2) - line_mr(ey)) * m_dx_end), m_len(int(len / scale)) { @@ -292,8 +292,8 @@ namespace agg int dy = int(((y2 - y1) << line_subpixel_shift) / d); m_dx_pict = -dy; m_dy_pict = dx; - m_dist_pict = ((x + line_subpixel_size/2 - (x1 - dy)) * m_dy_pict - - (y + line_subpixel_size/2 - (y1 + dx)) * m_dx_pict) >> + m_dist_pict = ((x + line_subpixel_size/2 - (x1 - dy)) * m_dy_pict - + (y + line_subpixel_size/2 - (y1 + dx)) * m_dx_pict) >> line_subpixel_shift; m_dx <<= line_subpixel_shift; @@ -305,60 +305,60 @@ namespace agg } //--------------------------------------------------------------------- - void inc_x() - { - m_dist += m_dy; - m_dist_start += m_dy_start; - m_dist_pict += m_dy_pict; - m_dist_end += m_dy_end; + void inc_x() + { + m_dist += m_dy; + m_dist_start += m_dy_start; + m_dist_pict += m_dy_pict; + m_dist_end += m_dy_end; } //--------------------------------------------------------------------- - void dec_x() - { - m_dist -= m_dy; - m_dist_start -= m_dy_start; - m_dist_pict -= m_dy_pict; - m_dist_end -= m_dy_end; + void dec_x() + { + m_dist -= m_dy; + m_dist_start -= m_dy_start; + m_dist_pict -= m_dy_pict; + m_dist_end -= m_dy_end; } //--------------------------------------------------------------------- - void inc_y() - { - m_dist -= m_dx; - m_dist_start -= m_dx_start; - m_dist_pict -= m_dx_pict; - m_dist_end -= m_dx_end; + void inc_y() + { + m_dist -= m_dx; + m_dist_start -= m_dx_start; + m_dist_pict -= m_dx_pict; + m_dist_end -= m_dx_end; } //--------------------------------------------------------------------- - void dec_y() - { - m_dist += m_dx; - m_dist_start += m_dx_start; - m_dist_pict += m_dx_pict; - m_dist_end += m_dx_end; + void dec_y() + { + m_dist += m_dx; + m_dist_start += m_dx_start; + m_dist_pict += m_dx_pict; + m_dist_end += m_dx_end; } //--------------------------------------------------------------------- void inc_x(int dy) { - m_dist += m_dy; - m_dist_start += m_dy_start; - m_dist_pict += m_dy_pict; + m_dist += m_dy; + m_dist_start += m_dy_start; + m_dist_pict += m_dy_pict; m_dist_end += m_dy_end; if(dy > 0) { - m_dist -= m_dx; - m_dist_start -= m_dx_start; - m_dist_pict -= m_dx_pict; + m_dist -= m_dx; + m_dist_start -= m_dx_start; + m_dist_pict -= m_dx_pict; m_dist_end -= m_dx_end; } if(dy < 0) { - m_dist += m_dx; - m_dist_start += m_dx_start; - m_dist_pict += m_dx_pict; + m_dist += m_dx; + m_dist_start += m_dx_start; + m_dist_pict += m_dx_pict; m_dist_end += m_dx_end; } } @@ -366,22 +366,22 @@ namespace agg //--------------------------------------------------------------------- void dec_x(int dy) { - m_dist -= m_dy; - m_dist_start -= m_dy_start; - m_dist_pict -= m_dy_pict; + m_dist -= m_dy; + m_dist_start -= m_dy_start; + m_dist_pict -= m_dy_pict; m_dist_end -= m_dy_end; if(dy > 0) { - m_dist -= m_dx; - m_dist_start -= m_dx_start; - m_dist_pict -= m_dx_pict; + m_dist -= m_dx; + m_dist_start -= m_dx_start; + m_dist_pict -= m_dx_pict; m_dist_end -= m_dx_end; } if(dy < 0) { - m_dist += m_dx; - m_dist_start += m_dx_start; - m_dist_pict += m_dx_pict; + m_dist += m_dx; + m_dist_start += m_dx_start; + m_dist_pict += m_dx_pict; m_dist_end += m_dx_end; } } @@ -389,22 +389,22 @@ namespace agg //--------------------------------------------------------------------- void inc_y(int dx) { - m_dist -= m_dx; - m_dist_start -= m_dx_start; - m_dist_pict -= m_dx_pict; + m_dist -= m_dx; + m_dist_start -= m_dx_start; + m_dist_pict -= m_dx_pict; m_dist_end -= m_dx_end; if(dx > 0) { - m_dist += m_dy; - m_dist_start += m_dy_start; - m_dist_pict += m_dy_pict; + m_dist += m_dy; + m_dist_start += m_dy_start; + m_dist_pict += m_dy_pict; m_dist_end += m_dy_end; } if(dx < 0) { - m_dist -= m_dy; - m_dist_start -= m_dy_start; - m_dist_pict -= m_dy_pict; + m_dist -= m_dy; + m_dist_start -= m_dy_start; + m_dist_pict -= m_dy_pict; m_dist_end -= m_dy_end; } } @@ -412,22 +412,22 @@ namespace agg //--------------------------------------------------------------------- void dec_y(int dx) { - m_dist += m_dx; - m_dist_start += m_dx_start; - m_dist_pict += m_dx_pict; + m_dist += m_dx; + m_dist_start += m_dx_start; + m_dist_pict += m_dx_pict; m_dist_end += m_dx_end; if(dx > 0) { - m_dist += m_dy; - m_dist_start += m_dy_start; - m_dist_pict += m_dy_pict; + m_dist += m_dy; + m_dist_start += m_dy_start; + m_dist_pict += m_dy_pict; m_dist_end += m_dy_end; } if(dx < 0) { - m_dist -= m_dy; - m_dist_start -= m_dy_start; - m_dist_pict -= m_dy_pict; + m_dist -= m_dy; + m_dist_start -= m_dy_start; + m_dist_pict -= m_dy_pict; m_dist_end -= m_dy_end; } } @@ -479,20 +479,20 @@ namespace agg typedef typename Renderer::color_type color_type; //--------------------------------------------------------------------- - enum - { + enum + { max_half_width = 64 }; //--------------------------------------------------------------------- line_interpolator_image(renderer_type& ren, const line_parameters& lp, - int sx, int sy, int ex, int ey, + int sx, int sy, int ex, int ey, int pattern_start, double scale_x) : m_lp(lp), m_li(lp.vertical ? line_dbl_hr(lp.x2 - lp.x1) : line_dbl_hr(lp.y2 - lp.y1), - lp.vertical ? abs(lp.y2 - lp.y1) : + lp.vertical ? abs(lp.y2 - lp.y1) : abs(lp.x2 - lp.x1) + 1), m_di(lp.x1, lp.y1, lp.x2, lp.y2, sx, sy, ex, ey, lp.len, scale_x, lp.x1 & ~line_subpixel_mask, lp.y1 & ~line_subpixel_mask), @@ -508,7 +508,7 @@ namespace agg m_start(pattern_start + (m_max_extent + 2) * ren.pattern_width()), m_step(0) { - agg::dda2_line_interpolator li(0, lp.vertical ? + agg::dda2_line_interpolator li(0, lp.vertical ? (lp.dy << agg::line_subpixel_shift) : (lp.dx << agg::line_subpixel_shift), lp.len); @@ -540,7 +540,7 @@ namespace agg m_old_x = m_x; - dist1_start = dist2_start = m_di.dist_start(); + dist1_start = dist2_start = m_di.dist_start(); int dx = 0; if(dist1_start < 0) ++npix; @@ -573,7 +573,7 @@ namespace agg m_old_y = m_y; - dist1_start = dist2_start = m_di.dist_start(); + dist1_start = dist2_start = m_di.dist_start(); int dy = 0; if(dist1_start < 0) ++npix; @@ -645,7 +645,7 @@ namespace agg dist_end -= m_di.dx_end(); p1->clear(); if(dist_end > 0 && dist_start <= 0) - { + { if(m_lp.inc > 0) dist = -dist; m_ren.pixel(p1, dist_pict, s2 - dist); ++npix; @@ -666,17 +666,17 @@ namespace agg --p0; p0->clear(); if(dist_end > 0 && dist_start <= 0) - { + { if(m_lp.inc > 0) dist = -dist; m_ren.pixel(p0, dist_pict, s2 + dist); ++npix; } ++dy; } - m_ren.blend_color_vspan(m_x, - m_y - dy + 1, - unsigned(p1 - p0), - p0); + m_ren.blend_color_vspan(m_x, + m_y - dy + 1, + unsigned(p1 - p0), + p0); return npix && ++m_step < m_count; } @@ -731,7 +731,7 @@ namespace agg dist_end += m_di.dy_end(); p1->clear(); if(dist_end > 0 && dist_start <= 0) - { + { if(m_lp.inc > 0) dist = -dist; m_ren.pixel(p1, dist_pict, s2 + dist); ++npix; @@ -752,16 +752,16 @@ namespace agg --p0; p0->clear(); if(dist_end > 0 && dist_start <= 0) - { + { if(m_lp.inc > 0) dist = -dist; m_ren.pixel(p0, dist_pict, s2 - dist); ++npix; } ++dx; } - m_ren.blend_color_hspan(m_x - dx + 1, - m_y, - unsigned(p1 - p0), + m_ren.blend_color_hspan(m_x - dx + 1, + m_y, + unsigned(p1 - p0), p0); return npix && ++m_step < m_count; } @@ -783,7 +783,7 @@ namespace agg protected: const line_parameters& m_lp; dda2_line_interpolator m_li; - distance_interpolator4 m_di; + distance_interpolator4 m_di; renderer_type& m_ren; int m_plen; int m_x; @@ -807,7 +807,7 @@ namespace agg //===================================================renderer_outline_image - template<class BaseRenderer, class ImagePattern> + template<class BaseRenderer, class ImagePattern> class renderer_outline_image { public: @@ -865,7 +865,7 @@ namespace agg static bool accurate_join_only() { return true; } //------------------------------------------------------------------------- - template<class Cmp> + template<class Cmp> void semidot(Cmp, int, int, int, int) { } @@ -886,14 +886,14 @@ namespace agg } //------------------------------------------------------------------------- - void line3(const line_parameters& lp, + void line3(const line_parameters& lp, int sx, int sy, int ex, int ey) { fix_degenerate_bisectrix_start(lp, &sx, &sy); fix_degenerate_bisectrix_end(lp, &ex, &ey); - line_interpolator_image<self_type> li(*this, lp, - sx, sy, - ex, ey, + line_interpolator_image<self_type> li(*this, lp, + sx, sy, + ex, ey, m_start, m_scale_x); if(li.vertical()) { diff --git a/agg/inc/agg_renderer_primitives.h b/agg/inc/agg_renderer_primitives.h index 522432c06df6..2b89b22f7127 100755 --- a/agg/inc/agg_renderer_primitives.h +++ b/agg/inc/agg_renderer_primitives.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. // @@ -45,9 +45,9 @@ namespace agg } //-------------------------------------------------------------------- - static int coord(double c) - { - return int(c * line_bresenham_interpolator::subpixel_size); + static int coord(double c) + { + return int(c * line_bresenham_interpolator::subpixel_size); } //-------------------------------------------------------------------- @@ -72,7 +72,7 @@ namespace agg } //-------------------------------------------------------------------- - void outlined_rectangle(int x1, int y1, int x2, int y2) + void outlined_rectangle(int x1, int y1, int x2, int y2) { rectangle(x1, y1, x2, y2); m_ren->blend_bar(x1+1, y1+1, x2-1, y2-1, m_fill_color, cover_full); @@ -204,8 +204,8 @@ namespace agg } //-------------------------------------------------------------------- - const base_ren_type& ren() const { return *m_ren; } - base_ren_type& ren() { return *m_ren; } + const base_ren_type& ren() const { return *m_ren; } + base_ren_type& ren() { return *m_ren; } //-------------------------------------------------------------------- const rendering_buffer& rbuf() const { return m_ren->rbuf(); } diff --git a/agg/inc/agg_renderer_raster_text.h b/agg/inc/agg_renderer_raster_text.h index 957944600332..be4d22e57a28 100755 --- a/agg/inc/agg_renderer_raster_text.h +++ b/agg/inc/agg_renderer_raster_text.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. // @@ -22,7 +22,7 @@ namespace agg { //==============================================renderer_raster_htext_solid - template<class BaseRenderer, class GlyphGenerator> + template<class BaseRenderer, class GlyphGenerator> class renderer_raster_htext_solid { public: @@ -86,7 +86,7 @@ namespace agg //=============================================renderer_raster_vtext_solid - template<class BaseRenderer, class GlyphGenerator> + template<class BaseRenderer, class GlyphGenerator> class renderer_raster_vtext_solid { public: @@ -153,7 +153,7 @@ namespace agg //===================================================renderer_raster_htext - template<class ScanlineRenderer, class GlyphGenerator> + template<class ScanlineRenderer, class GlyphGenerator> class renderer_raster_htext { public: @@ -175,14 +175,14 @@ namespace agg const_span() {} const_span(int x_, unsigned len_, const cover_type* covers_) : - x(x_), len(len_), covers(covers_) + x(x_), len(len_), covers(covers_) {} }; typedef const const_span* const_iterator; //---------------------------------------------------------------- - scanline_single_span(int x, int y, unsigned len, + scanline_single_span(int x, int y, unsigned len, const cover_type* covers) : m_y(y), m_span(x, len, covers) @@ -226,8 +226,8 @@ namespace agg for(i = r.y1; i <= r.y2; i++) { m_ren->render( - scanline_single_span(r.x1, - i, + scanline_single_span(r.x1, + i, (r.x2 - r.x1 + 1), m_glyph->span(r.y2 - i))); } @@ -237,8 +237,8 @@ namespace agg for(i = r.y1; i <= r.y2; i++) { m_ren->render( - scanline_single_span(r.x1, - i, + scanline_single_span(r.x1, + i, (r.x2 - r.x1 + 1), m_glyph->span(i - r.y1))); } diff --git a/agg/inc/agg_renderer_scanline.h b/agg/inc/agg_renderer_scanline.h index cc33942a3770..ef6629e8f3fa 100755 --- a/agg/inc/agg_renderer_scanline.h +++ b/agg/inc/agg_renderer_scanline.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. // @@ -35,11 +35,11 @@ namespace agg m_span_gen(&span_gen) { } - + //-------------------------------------------------------------------- - void prepare(unsigned max_span_len) - { - m_span_gen->prepare(max_span_len); + void prepare(unsigned max_span_len) + { + m_span_gen->prepare(max_span_len); } //-------------------------------------------------------------------- @@ -72,7 +72,7 @@ namespace agg if(x < xmin) { len -= xmin - x; - if(!solid) + if(!solid) { covers += xmin - x; } @@ -88,7 +88,7 @@ namespace agg if(len > 0) { m_ren->blend_color_hspan_no_clip( - x, y, len, + x, y, len, m_span_gen->generate(x, y, len), solid ? 0 : covers, *covers); @@ -101,7 +101,7 @@ namespace agg } while(m_ren->next_clip_box()); } - + private: base_ren_type* m_ren; SpanGenerator* m_span_gen; @@ -122,11 +122,11 @@ namespace agg m_span_gen(&span_gen) { } - + //-------------------------------------------------------------------- - void prepare(unsigned max_span_len) - { - m_span_gen->prepare(max_span_len); + void prepare(unsigned max_span_len) + { + m_span_gen->prepare(max_span_len); } //-------------------------------------------------------------------- @@ -159,7 +159,7 @@ namespace agg if(x < xmin) { len -= xmin - x; - if(!solid) + if(!solid) { covers += xmin - x; } @@ -175,7 +175,7 @@ namespace agg if(len > 0) { m_ren->blend_opaque_color_hspan_no_clip( - x, y, len, + x, y, len, m_span_gen->generate(x, y, len), solid ? 0 : covers, *covers); @@ -188,7 +188,7 @@ namespace agg } while(m_ren->next_clip_box()); } - + private: base_ren_type* m_ren; SpanGenerator* m_span_gen; @@ -208,7 +208,7 @@ namespace agg m_ren(&ren) { } - + //-------------------------------------------------------------------- void color(const color_type& c) { m_color = c; } const color_type& color() const { return m_color; } @@ -228,21 +228,21 @@ namespace agg int x = span->x; if(span->len > 0) { - m_ren->blend_solid_hspan(x, y, (unsigned)span->len, - m_color, + m_ren->blend_solid_hspan(x, y, (unsigned)span->len, + m_color, span->covers); } else { - m_ren->blend_hline(x, y, (unsigned)(x - span->len - 1), - m_color, + m_ren->blend_hline(x, y, (unsigned)(x - span->len - 1), + m_color, *(span->covers)); } ++span; } while(--num_spans); } - + private: base_ren_type* m_ren; color_type m_color; @@ -266,11 +266,11 @@ namespace agg m_span_gen(&span_gen) { } - + //-------------------------------------------------------------------- - void prepare(unsigned max_span_len) - { - m_span_gen->prepare(max_span_len); + void prepare(unsigned max_span_len) + { + m_span_gen->prepare(max_span_len); } //-------------------------------------------------------------------- @@ -307,7 +307,7 @@ namespace agg if(len > 0) { m_ren->blend_color_hspan_no_clip( - x, y, len, + x, y, len, m_span_gen->generate(x, y, len), 0); } @@ -319,7 +319,7 @@ namespace agg } while(m_ren->next_clip_box()); } - + private: base_ren_type* m_ren; SpanGenerator* m_span_gen; @@ -339,11 +339,11 @@ namespace agg m_span_gen(&span_gen) { } - + //-------------------------------------------------------------------- - void prepare(unsigned max_span_len) - { - m_span_gen->prepare(max_span_len); + void prepare(unsigned max_span_len) + { + m_span_gen->prepare(max_span_len); } //-------------------------------------------------------------------- @@ -380,7 +380,7 @@ namespace agg if(len > 0) { m_ren->blend_opaque_color_hspan_no_clip( - x, y, len, + x, y, len, m_span_gen->generate(x, y, len), 0); } @@ -392,7 +392,7 @@ namespace agg } while(m_ren->next_clip_box()); } - + private: base_ren_type* m_ren; SpanGenerator* m_span_gen; @@ -413,7 +413,7 @@ namespace agg m_ren(&ren) { } - + //-------------------------------------------------------------------- void color(const color_type& c) { m_color = c; } const color_type& color() const { return m_color; } @@ -428,18 +428,18 @@ namespace agg typename Scanline::const_iterator span = sl.begin(); do { - m_ren->blend_hline(span->x, - sl.y(), - span->x - 1 + ((span->len < 0) ? - -span->len : - span->len), - m_color, + m_ren->blend_hline(span->x, + sl.y(), + span->x - 1 + ((span->len < 0) ? + -span->len : + span->len), + m_color, cover_full); ++span; } while(--num_spans); } - + private: base_ren_type* m_ren; color_type m_color; diff --git a/agg/inc/agg_rendering_buffer.h b/agg/inc/agg_rendering_buffer.h index 50b6a46fdfa8..fc5a941dfd05 100755 --- a/agg/inc/agg_rendering_buffer.h +++ b/agg/inc/agg_rendering_buffer.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. // @@ -35,7 +35,7 @@ namespace agg int x1, x2; const int8u* ptr; row_data() {} - row_data(int x1_, int x2_, const int8u* ptr_) : + row_data(int x1_, int x2_, const int8u* ptr_) : x1(x1_), x2(x2_), ptr(ptr_) {} }; @@ -102,11 +102,11 @@ namespace agg unsigned width() const { return m_width; } unsigned height() const { return m_height; } int stride() const { return m_stride; } - unsigned stride_abs() const + unsigned stride_abs() const { - return (m_stride < 0) ? - unsigned(-m_stride) : - unsigned(m_stride); + return (m_stride < 0) ? + unsigned(-m_stride) : + unsigned(m_stride); } //-------------------------------------------------------------------- @@ -123,10 +123,10 @@ namespace agg { unsigned h = height(); if(mtx.height() < h) h = mtx.height(); - + unsigned l = stride_abs(); if(mtx.stride_abs() < l) l = mtx.stride_abs(); - + l *= sizeof(T); unsigned y; diff --git a/agg/inc/agg_rendering_buffer_dynarow.h b/agg/inc/agg_rendering_buffer_dynarow.h index b6724d99ff78..b525cb9b9140 100755 --- a/agg/inc/agg_rendering_buffer_dynarow.h +++ b/agg/inc/agg_rendering_buffer_dynarow.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. // @@ -118,19 +118,19 @@ namespace agg // do { blend(r.ptr); r.ptr += PixWidth } while(++r.x1 < r.x2); // } //-------------------------------------------------------------------- - row_data span(int x, int y) const - { + row_data span(int x, int y) const + { row_data r = m_rows[y]; if(r.ptr) { if(x < r.x1) x = r.x1; r.ptr += x * PixWidth; } - return r; + return r; } - // The main function used for rendering. Returns pointer to the + // The main function used for rendering. Returns pointer to the // pre-allocated span. Memory for the row is allocated as needed. //-------------------------------------------------------------------- int8u* span_ptr(int x, int y, unsigned len) @@ -167,7 +167,7 @@ namespace agg //-------------------------------------------------------------------- // Prohibit copying rendering_buffer_dynarow(const rendering_buffer_dynarow<PixWidth>&); - const rendering_buffer_dynarow<PixWidth>& + const rendering_buffer_dynarow<PixWidth>& operator = (const rendering_buffer_dynarow<PixWidth>&); private: diff --git a/agg/inc/agg_rounded_rect.h b/agg/inc/agg_rounded_rect.h index d4185dafa5b3..86a04dd59d6f 100755 --- a/agg/inc/agg_rounded_rect.h +++ b/agg/inc/agg_rounded_rect.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. // @@ -41,7 +41,7 @@ namespace agg void radius(double r); void radius(double rx, double ry); void radius(double rx_bottom, double ry_bottom, double rx_top, double ry_top); - void radius(double rx1, double ry1, double rx2, double ry2, + void radius(double rx1, double ry1, double rx2, double ry2, double rx3, double ry3, double rx4, double ry4); void normalize_radius(); diff --git a/agg/inc/agg_scanline_bin.h b/agg/inc/agg_scanline_bin.h index aa60ed061e07..4b673d5c49df 100755 --- a/agg/inc/agg_scanline_bin.h +++ b/agg/inc/agg_scanline_bin.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. // @@ -25,16 +25,16 @@ namespace agg { //=============================================================scanline_bin - // - // This is binary scaline container which supports the interface - // used in the rasterizer::render(). See description of agg_scanline_u8 + // + // This is binary scaline container which supports the interface + // used in the rasterizer::render(). See description of agg_scanline_u8 // for details. - // + // // Rendering: //------------------------------------------------------------------------- - // + // // int y = sl.y(); - // + // // ************************************ // ...Perform vertical clipping here... // ************************************ @@ -46,16 +46,16 @@ namespace agg // { // x = cur_span->x; // len = cur_span->len; - // + // // ************************************** // ...Perform horizontal clipping here... // ************************************** - // + // // hor_line(x, y, len) // ++cur_span; // } // while(--num_spans); - // + // //------------------------------------------------------------------------ class scanline_bin { diff --git a/agg/inc/agg_scanline_boolean_algebra.h b/agg/inc/agg_scanline_boolean_algebra.h index 7f1a3c5ba774..c606fa2d0d52 100755 --- a/agg/inc/agg_scanline_boolean_algebra.h +++ b/agg/inc/agg_scanline_boolean_algebra.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. // @@ -30,14 +30,14 @@ namespace agg // anti-aliasing information, but only X and Length. The function // is compatible with any type of scanlines. //---------------- - template<class Scanline1, - class Scanline2, - class Scanline> + template<class Scanline1, + class Scanline2, + class Scanline> struct sbool_combine_spans_bin { - void operator () (const typename Scanline1::const_iterator&, - const typename Scanline2::const_iterator&, - int x, unsigned len, + void operator () (const typename Scanline1::const_iterator&, + const typename Scanline2::const_iterator&, + int x, unsigned len, Scanline& sl) const { sl.add_span(x, len, cover_full); @@ -51,14 +51,14 @@ namespace agg // Combine two spans as empty ones. The functor does nothing // and is used to XOR binary spans. //---------------- - template<class Scanline1, - class Scanline2, - class Scanline> + template<class Scanline1, + class Scanline2, + class Scanline> struct sbool_combine_spans_empty { - void operator () (const typename Scanline1::const_iterator&, - const typename Scanline2::const_iterator&, - int, unsigned, + void operator () (const typename Scanline1::const_iterator&, + const typename Scanline2::const_iterator&, + int, unsigned, Scanline&) const {} }; @@ -69,12 +69,12 @@ namespace agg // Functor. // Add nothing. Used in conbine_shapes_sub //---------------- - template<class Scanline1, - class Scanline> + template<class Scanline1, + class Scanline> struct sbool_add_span_empty { - void operator () (const typename Scanline1::const_iterator&, - int, unsigned, + void operator () (const typename Scanline1::const_iterator&, + int, unsigned, Scanline&) const {} }; @@ -84,19 +84,19 @@ namespace agg // Functor. // Add a binary span //---------------- - template<class Scanline1, - class Scanline> + template<class Scanline1, + class Scanline> struct sbool_add_span_bin { - void operator () (const typename Scanline1::const_iterator&, - int x, unsigned len, + void operator () (const typename Scanline1::const_iterator&, + int x, unsigned len, Scanline& sl) const { sl.add_span(x, len, cover_full); } }; - + //-----------------------------------------------------sbool_add_span_aa @@ -105,12 +105,12 @@ namespace agg // anti-aliasing information, but only X and Length. The function // is compatible with any type of scanlines. //---------------- - template<class Scanline1, - class Scanline> + template<class Scanline1, + class Scanline> struct sbool_add_span_aa { - void operator () (const typename Scanline1::const_iterator& span, - int x, unsigned len, + void operator () (const typename Scanline1::const_iterator& span, + int x, unsigned len, Scanline& sl) const { if(span->len < 0) @@ -135,10 +135,10 @@ namespace agg // Intersect two spans preserving the anti-aliasing information. // The result is added to the "sl" scanline. //------------------ - template<class Scanline1, - class Scanline2, - class Scanline, - unsigned CoverShift = cover_shift> + template<class Scanline1, + class Scanline2, + class Scanline, + unsigned CoverShift = cover_shift> struct sbool_intersect_spans_aa { enum @@ -148,18 +148,18 @@ namespace agg cover_mask = cover_size - 1, cover_full = cover_mask }; + - - void operator () (const typename Scanline1::const_iterator& span1, - const typename Scanline2::const_iterator& span2, - int x, unsigned len, + void operator () (const typename Scanline1::const_iterator& span1, + const typename Scanline2::const_iterator& span2, + int x, unsigned len, Scanline& sl) const { unsigned cover; const typename Scanline1::cover_type* covers1; const typename Scanline2::cover_type* covers2; - // Calculate the operation code and choose the + // Calculate the operation code and choose the // proper combination algorithm. // 0 = Both spans are of AA type // 1 = span1 is solid, span2 is AA @@ -176,9 +176,9 @@ namespace agg do { cover = *covers1++ * *covers2++; - sl.add_cell(x++, + sl.add_cell(x++, (cover == cover_full * cover_full) ? - cover_full : + cover_full : (cover >> cover_shift)); } while(--len); @@ -196,9 +196,9 @@ namespace agg do { cover = *(span1->covers) * *covers2++; - sl.add_cell(x++, + sl.add_cell(x++, (cover == cover_full * cover_full) ? - cover_full : + cover_full : (cover >> cover_shift)); } while(--len); @@ -217,9 +217,9 @@ namespace agg do { cover = *covers1++ * *(span2->covers); - sl.add_cell(x++, + sl.add_cell(x++, (cover == cover_full * cover_full) ? - cover_full : + cover_full : (cover >> cover_shift)); } while(--len); @@ -228,9 +228,9 @@ namespace agg case 3: // Both are solid spans cover = *(span1->covers) * *(span2->covers); - sl.add_span(x, len, + sl.add_span(x, len, (cover == cover_full * cover_full) ? - cover_full : + cover_full : (cover >> cover_shift)); break; } @@ -247,10 +247,10 @@ namespace agg // Unite two spans preserving the anti-aliasing information. // The result is added to the "sl" scanline. //------------------ - template<class Scanline1, - class Scanline2, - class Scanline, - unsigned CoverShift = cover_shift> + template<class Scanline1, + class Scanline2, + class Scanline, + unsigned CoverShift = cover_shift> struct sbool_unite_spans_aa { enum @@ -260,18 +260,18 @@ namespace agg cover_mask = cover_size - 1, cover_full = cover_mask }; + - - void operator () (const typename Scanline1::const_iterator& span1, - const typename Scanline2::const_iterator& span2, - int x, unsigned len, + void operator () (const typename Scanline1::const_iterator& span1, + const typename Scanline2::const_iterator& span2, + int x, unsigned len, Scanline& sl) const { unsigned cover; const typename Scanline1::cover_type* covers1; const typename Scanline2::cover_type* covers2; - // Calculate the operation code and choose the + // Calculate the operation code and choose the // proper combination algorithm. // 0 = Both spans are of AA type // 1 = span1 is solid, span2 is AA @@ -287,12 +287,12 @@ namespace agg if(span2->x < x) covers2 += x - span2->x; do { - cover = cover_mask * cover_mask - - (cover_mask - *covers1++) * + cover = cover_mask * cover_mask - + (cover_mask - *covers1++) * (cover_mask - *covers2++); - sl.add_cell(x++, + sl.add_cell(x++, (cover == cover_full * cover_full) ? - cover_full : + cover_full : (cover >> cover_shift)); } while(--len); @@ -309,12 +309,12 @@ namespace agg { do { - cover = cover_mask * cover_mask - - (cover_mask - *(span1->covers)) * + cover = cover_mask * cover_mask - + (cover_mask - *(span1->covers)) * (cover_mask - *covers2++); - sl.add_cell(x++, + sl.add_cell(x++, (cover == cover_full * cover_full) ? - cover_full : + cover_full : (cover >> cover_shift)); } while(--len); @@ -332,12 +332,12 @@ namespace agg { do { - cover = cover_mask * cover_mask - - (cover_mask - *covers1++) * + cover = cover_mask * cover_mask - + (cover_mask - *covers1++) * (cover_mask - *(span2->covers)); - sl.add_cell(x++, + sl.add_cell(x++, (cover == cover_full * cover_full) ? - cover_full : + cover_full : (cover >> cover_shift)); } while(--len); @@ -345,12 +345,12 @@ namespace agg break; case 3: // Both are solid spans - cover = cover_mask * cover_mask - - (cover_mask - *(span1->covers)) * + cover = cover_mask * cover_mask - + (cover_mask - *(span1->covers)) * (cover_mask - *(span2->covers)); - sl.add_span(x, len, + sl.add_span(x, len, (cover == cover_full * cover_full) ? - cover_full : + cover_full : (cover >> cover_shift)); break; } @@ -359,7 +359,7 @@ namespace agg //---------------------------------------------sbool_xor_formula_linear - template<unsigned CoverShift = cover_shift> + template<unsigned CoverShift = cover_shift> struct sbool_xor_formula_linear { enum @@ -379,7 +379,7 @@ namespace agg //---------------------------------------------sbool_xor_formula_saddle - template<unsigned CoverShift = cover_shift> + template<unsigned CoverShift = cover_shift> struct sbool_xor_formula_saddle { enum @@ -417,11 +417,11 @@ namespace agg // XOR two spans preserving the anti-aliasing information. // The result is added to the "sl" scanline. //------------------ - template<class Scanline1, - class Scanline2, - class Scanline, + template<class Scanline1, + class Scanline2, + class Scanline, class XorFormula, - unsigned CoverShift = cover_shift> + unsigned CoverShift = cover_shift> struct sbool_xor_spans_aa { enum @@ -431,18 +431,18 @@ namespace agg cover_mask = cover_size - 1, cover_full = cover_mask }; + - - void operator () (const typename Scanline1::const_iterator& span1, - const typename Scanline2::const_iterator& span2, - int x, unsigned len, + void operator () (const typename Scanline1::const_iterator& span1, + const typename Scanline2::const_iterator& span2, + int x, unsigned len, Scanline& sl) const { unsigned cover; const typename Scanline1::cover_type* covers1; const typename Scanline2::cover_type* covers2; - // Calculate the operation code and choose the + // Calculate the operation code and choose the // proper combination algorithm. // 0 = Both spans are of AA type // 1 = span1 is solid, span2 is AA @@ -507,10 +507,10 @@ namespace agg // Unite two spans preserving the anti-aliasing information. // The result is added to the "sl" scanline. //------------------ - template<class Scanline1, - class Scanline2, - class Scanline, - unsigned CoverShift = cover_shift> + template<class Scanline1, + class Scanline2, + class Scanline, + unsigned CoverShift = cover_shift> struct sbool_subtract_spans_aa { enum @@ -520,18 +520,18 @@ namespace agg cover_mask = cover_size - 1, cover_full = cover_mask }; + - - void operator () (const typename Scanline1::const_iterator& span1, - const typename Scanline2::const_iterator& span2, - int x, unsigned len, + void operator () (const typename Scanline1::const_iterator& span1, + const typename Scanline2::const_iterator& span2, + int x, unsigned len, Scanline& sl) const { unsigned cover; const typename Scanline1::cover_type* covers1; const typename Scanline2::cover_type* covers2; - // Calculate the operation code and choose the + // Calculate the operation code and choose the // proper combination algorithm. // 0 = Both spans are of AA type // 1 = span1 is solid, span2 is AA @@ -550,9 +550,9 @@ namespace agg cover = *covers1++ * (cover_mask - *covers2++); if(cover) { - sl.add_cell(x, + sl.add_cell(x, (cover == cover_full * cover_full) ? - cover_full : + cover_full : (cover >> cover_shift)); } ++x; @@ -568,9 +568,9 @@ namespace agg cover = *(span1->covers) * (cover_mask - *covers2++); if(cover) { - sl.add_cell(x, + sl.add_cell(x, (cover == cover_full * cover_full) ? - cover_full : + cover_full : (cover >> cover_shift)); } ++x; @@ -588,9 +588,9 @@ namespace agg cover = *covers1++ * (cover_mask - *(span2->covers)); if(cover) { - sl.add_cell(x, + sl.add_cell(x, (cover == cover_full * cover_full) ? - cover_full : + cover_full : (cover >> cover_shift)); } ++x; @@ -603,9 +603,9 @@ namespace agg cover = *(span1->covers) * (cover_mask - *(span2->covers)); if(cover) { - sl.add_span(x, len, + sl.add_span(x, len, (cover == cover_full * cover_full) ? - cover_full : + cover_full : (cover >> cover_shift)); } break; @@ -619,13 +619,13 @@ namespace agg //--------------------------------------------sbool_add_spans_and_render - template<class Scanline1, - class Scanline, - class Renderer, + template<class Scanline1, + class Scanline, + class Renderer, class AddSpanFunctor> - void sbool_add_spans_and_render(const Scanline1& sl1, - Scanline& sl, - Renderer& ren, + void sbool_add_spans_and_render(const Scanline1& sl1, + Scanline& sl, + Renderer& ren, AddSpanFunctor add_span) { sl.reset_spans(); @@ -654,13 +654,13 @@ namespace agg // two spans without Anti-Aliasing, the second preserves the AA // information, but works slower // - template<class Scanline1, - class Scanline2, - class Scanline, + template<class Scanline1, + class Scanline2, + class Scanline, class CombineSpansFunctor> - void sbool_intersect_scanlines(const Scanline1& sl1, - const Scanline2& sl2, - Scanline& sl, + void sbool_intersect_scanlines(const Scanline1& sl1, + const Scanline2& sl2, + Scanline& sl, CombineSpansFunctor combine_spans) { sl.reset_spans(); @@ -683,7 +683,7 @@ namespace agg // Determine what spans we should advance in the next step // The span with the least ending X should be advanced - // advance_both is just an optimization when we ending + // advance_both is just an optimization when we ending // coordinates are the same and we can advance both //-------------- bool advance_span1 = xe1 < xe2; @@ -732,8 +732,8 @@ namespace agg //------------------------------------------------sbool_intersect_shapes - // Intersect the scanline shapes. Here the "Scanline Generator" - // abstraction is used. ScanlineGen1 and ScanlineGen2 are + // Intersect the scanline shapes. Here the "Scanline Generator" + // abstraction is used. ScanlineGen1 and ScanlineGen2 are // the generators, and can be of type rasterizer_scanline_aa<>. // There function requires three scanline containers that can be of // different types. @@ -741,23 +741,23 @@ namespace agg // "sl" is ised as the resulting scanline to render it. // The external "sl1" and "sl2" are used only for the sake of // optimization and reusing of the scanline objects. - // the function calls sbool_intersect_scanlines with CombineSpansFunctor + // the function calls sbool_intersect_scanlines with CombineSpansFunctor // as the last argument. See sbool_intersect_scanlines for details. //---------- - template<class ScanlineGen1, - class ScanlineGen2, - class Scanline1, - class Scanline2, - class Scanline, + template<class ScanlineGen1, + class ScanlineGen2, + class Scanline1, + class Scanline2, + class Scanline, class Renderer, class CombineSpansFunctor> void sbool_intersect_shapes(ScanlineGen1& sg1, ScanlineGen2& sg2, Scanline1& sl1, Scanline2& sl2, - Scanline& sl, Renderer& ren, + Scanline& sl, Renderer& ren, CombineSpansFunctor combine_spans) { // Prepare the scanline generators. - // If anyone of them doesn't contain + // If anyone of them doesn't contain // any scanlines, then return. //----------------- if(!sg1.rewind_scanlines()) return; @@ -768,7 +768,7 @@ namespace agg rect r1(sg1.min_x(), sg1.min_y(), sg1.max_x(), sg1.max_y()); rect r2(sg2.min_x(), sg2.min_y(), sg2.max_x(), sg2.max_y()); - // Calculate the intersection of the bounding + // Calculate the intersection of the bounding // boxes and return if they don't intersect. //----------------- rect ir = intersect_rectangles(r1, r2); @@ -785,9 +785,9 @@ namespace agg ren.prepare(unsigned(ir.x2 - ir.x1 + 2)); // The main loop - // Here we synchronize the scanlines with + // Here we synchronize the scanlines with // the same Y coordinate, ignoring all other ones. - // Only scanlines having the same Y-coordinate + // Only scanlines having the same Y-coordinate // are to be combined. //----------------- for(;;) @@ -832,15 +832,15 @@ namespace agg // two spans without Anti-Aliasing, the second preserves the AA // information, but works slower // - template<class Scanline1, - class Scanline2, - class Scanline, + template<class Scanline1, + class Scanline2, + class Scanline, class AddSpanFunctor1, class AddSpanFunctor2, class CombineSpansFunctor> - void sbool_unite_scanlines(const Scanline1& sl1, - const Scanline2& sl2, - Scanline& sl, + void sbool_unite_scanlines(const Scanline1& sl1, + const Scanline2& sl2, + Scanline& sl, AddSpanFunctor1 add_span1, AddSpanFunctor2 add_span2, CombineSpansFunctor combine_spans) @@ -887,7 +887,7 @@ namespace agg { // Retrieve a new span1 if it's invalid //---------------- - if(num1 && xb1 > xe1) + if(num1 && xb1 > xe1) { --num1; ++span1; @@ -897,7 +897,7 @@ namespace agg // Retrieve a new span2 if it's invalid //---------------- - if(num2 && xb2 > xe2) + if(num2 && xb2 > xe2) { --num2; ++span2; @@ -943,7 +943,7 @@ namespace agg // Invalidate span1 and eat // the processed part of span2 //-------------- - xb1 = invalid_b; + xb1 = invalid_b; xe1 = invalid_e; xb2 += len; } @@ -953,7 +953,7 @@ namespace agg // Invalidate span2 and eat // the processed part of span1 //-------------- - xb2 = invalid_b; + xb2 = invalid_b; xe2 = invalid_e; xb1 += len; } @@ -969,7 +969,7 @@ namespace agg { // The spans do not intersect //-------------- - if(xb1 < xb2) + if(xb1 < xb2) { // Advance span1 //--------------- @@ -999,36 +999,36 @@ namespace agg //----------------------------------------------------sbool_unite_shapes - // Unite the scanline shapes. Here the "Scanline Generator" - // abstraction is used. ScanlineGen1 and ScanlineGen2 are + // Unite the scanline shapes. Here the "Scanline Generator" + // abstraction is used. ScanlineGen1 and ScanlineGen2 are // the generators, and can be of type rasterizer_scanline_aa<>. - // There function requires three scanline containers that can be + // There function requires three scanline containers that can be // of different type. // "sl1" and "sl2" are used to retrieve scanlines from the generators, // "sl" is ised as the resulting scanline to render it. // The external "sl1" and "sl2" are used only for the sake of // optimization and reusing of the scanline objects. - // the function calls sbool_unite_scanlines with CombineSpansFunctor + // the function calls sbool_unite_scanlines with CombineSpansFunctor // as the last argument. See sbool_unite_scanlines for details. //---------- - template<class ScanlineGen1, - class ScanlineGen2, - class Scanline1, - class Scanline2, - class Scanline, + template<class ScanlineGen1, + class ScanlineGen2, + class Scanline1, + class Scanline2, + class Scanline, class Renderer, class AddSpanFunctor1, class AddSpanFunctor2, class CombineSpansFunctor> void sbool_unite_shapes(ScanlineGen1& sg1, ScanlineGen2& sg2, Scanline1& sl1, Scanline2& sl2, - Scanline& sl, Renderer& ren, + Scanline& sl, Renderer& ren, AddSpanFunctor1 add_span1, AddSpanFunctor2 add_span2, CombineSpansFunctor combine_spans) { // Prepare the scanline generators. - // If anyone of them doesn't contain + // If anyone of them doesn't contain // any scanlines, then return. //----------------- bool flag1 = sg1.rewind_scanlines(); @@ -1050,20 +1050,20 @@ namespace agg // Reset the scanlines and get two first ones //----------------- sl.reset(ur.x1, ur.x2); - if(flag1) + if(flag1) { sl1.reset(sg1.min_x(), sg1.max_x()); flag1 = sg1.sweep_scanline(sl1); } - if(flag2) + if(flag2) { sl2.reset(sg2.min_x(), sg2.max_x()); flag2 = sg2.sweep_scanline(sl2); } // The main loop - // Here we synchronize the scanlines with + // Here we synchronize the scanlines with // the same Y coordinate. //----------------- while(flag1 || flag2) @@ -1076,7 +1076,7 @@ namespace agg // Combine the scanlines, render if they contain any spans, // and advance both generators to the next scanlines //---------------------- - sbool_unite_scanlines(sl1, sl2, sl, + sbool_unite_scanlines(sl1, sl2, sl, add_span1, add_span2, combine_spans); if(sl.num_spans()) { @@ -1124,8 +1124,8 @@ namespace agg //-------------------------------------------------sbool_subtract_shapes - // Subtract the scanline shapes, "sg1-sg2". Here the "Scanline Generator" - // abstraction is used. ScanlineGen1 and ScanlineGen2 are + // Subtract the scanline shapes, "sg1-sg2". Here the "Scanline Generator" + // abstraction is used. ScanlineGen1 and ScanlineGen2 are // the generators, and can be of type rasterizer_scanline_aa<>. // There function requires three scanline containers that can be of // different types. @@ -1133,20 +1133,20 @@ namespace agg // "sl" is ised as the resulting scanline to render it. // The external "sl1" and "sl2" are used only for the sake of // optimization and reusing of the scanline objects. - // the function calls sbool_intersect_scanlines with CombineSpansFunctor + // the function calls sbool_intersect_scanlines with CombineSpansFunctor // as the last argument. See combine_scanlines_sub for details. //---------- - template<class ScanlineGen1, - class ScanlineGen2, - class Scanline1, - class Scanline2, - class Scanline, + template<class ScanlineGen1, + class ScanlineGen2, + class Scanline1, + class Scanline2, + class Scanline, class Renderer, class AddSpanFunctor1, class CombineSpansFunctor> void sbool_subtract_shapes(ScanlineGen1& sg1, ScanlineGen2& sg2, Scanline1& sl1, Scanline2& sl2, - Scanline& sl, Renderer& ren, + Scanline& sl, Renderer& ren, AddSpanFunctor1 add_span1, CombineSpansFunctor combine_spans) { @@ -1175,9 +1175,9 @@ namespace agg sbool_add_span_empty<Scanline1, Scanline> add_span2; // The main loop - // Here we synchronize the scanlines with + // Here we synchronize the scanlines with // the same Y coordinate, ignoring all other ones. - // Only scanlines having the same Y-coordinate + // Only scanlines having the same Y-coordinate // are to be combined. //----------------- bool flag1 = true; @@ -1221,21 +1221,21 @@ namespace agg //---------------------------------------------sbool_intersect_shapes_aa - // Intersect two anti-aliased scanline shapes. - // Here the "Scanline Generator" abstraction is used. - // ScanlineGen1 and ScanlineGen2 are the generators, and can be of - // type rasterizer_scanline_aa<>. There function requires three + // Intersect two anti-aliased scanline shapes. + // Here the "Scanline Generator" abstraction is used. + // ScanlineGen1 and ScanlineGen2 are the generators, and can be of + // type rasterizer_scanline_aa<>. There function requires three // scanline containers that can be of different types. // "sl1" and "sl2" are used to retrieve scanlines from the generators, // "sl" is ised as the resulting scanline to render it. // The external "sl1" and "sl2" are used only for the sake of // optimization and reusing of the scanline objects. //---------- - template<class ScanlineGen1, - class ScanlineGen2, - class Scanline1, - class Scanline2, - class Scanline, + template<class ScanlineGen1, + class ScanlineGen2, + class Scanline1, + class Scanline2, + class Scanline, class Renderer> void sbool_intersect_shapes_aa(ScanlineGen1& sg1, ScanlineGen2& sg2, Scanline1& sl1, Scanline2& sl2, @@ -1250,14 +1250,14 @@ namespace agg //--------------------------------------------sbool_intersect_shapes_bin - // Intersect two binary scanline shapes (without anti-aliasing). + // Intersect two binary scanline shapes (without anti-aliasing). // See intersect_shapes_aa for more comments //---------- - template<class ScanlineGen1, - class ScanlineGen2, - class Scanline1, - class Scanline2, - class Scanline, + template<class ScanlineGen1, + class ScanlineGen2, + class Scanline1, + class Scanline2, + class Scanline, class Renderer> void sbool_intersect_shapes_bin(ScanlineGen1& sg1, ScanlineGen2& sg2, Scanline1& sl1, Scanline2& sl2, @@ -1272,14 +1272,14 @@ namespace agg //-------------------------------------------------sbool_unite_shapes_aa - // Unite two anti-aliased scanline shapes + // Unite two anti-aliased scanline shapes // See intersect_shapes_aa for more comments //---------- - template<class ScanlineGen1, - class ScanlineGen2, - class Scanline1, - class Scanline2, - class Scanline, + template<class ScanlineGen1, + class ScanlineGen2, + class Scanline1, + class Scanline2, + class Scanline, class Renderer> void sbool_unite_shapes_aa(ScanlineGen1& sg1, ScanlineGen2& sg2, Scanline1& sl1, Scanline2& sl2, @@ -1288,7 +1288,7 @@ namespace agg sbool_add_span_aa<Scanline1, Scanline> add_functor1; sbool_add_span_aa<Scanline2, Scanline> add_functor2; sbool_unite_spans_aa<Scanline1, Scanline2, Scanline> combine_functor; - sbool_unite_shapes(sg1, sg2, sl1, sl2, sl, ren, + sbool_unite_shapes(sg1, sg2, sl1, sl2, sl, ren, add_functor1, add_functor2, combine_functor); } @@ -1297,14 +1297,14 @@ namespace agg //------------------------------------------------sbool_unite_shapes_bin - // Unite two binary scanline shapes (without anti-aliasing). + // Unite two binary scanline shapes (without anti-aliasing). // See intersect_shapes_aa for more comments //---------- - template<class ScanlineGen1, - class ScanlineGen2, - class Scanline1, - class Scanline2, - class Scanline, + template<class ScanlineGen1, + class ScanlineGen2, + class Scanline1, + class Scanline2, + class Scanline, class Renderer> void sbool_unite_shapes_bin(ScanlineGen1& sg1, ScanlineGen2& sg2, Scanline1& sl1, Scanline2& sl2, @@ -1313,7 +1313,7 @@ namespace agg sbool_add_span_bin<Scanline1, Scanline> add_functor1; sbool_add_span_bin<Scanline2, Scanline> add_functor2; sbool_combine_spans_bin<Scanline1, Scanline2, Scanline> combine_functor; - sbool_unite_shapes(sg1, sg2, sl1, sl2, sl, ren, + sbool_unite_shapes(sg1, sg2, sl1, sl2, sl, ren, add_functor1, add_functor2, combine_functor); } @@ -1326,17 +1326,17 @@ namespace agg //---------------------------------------------------sbool_xor_shapes_aa - // Apply eXclusive OR to two anti-aliased scanline shapes. There's + // Apply eXclusive OR to two anti-aliased scanline shapes. There's // a modified "Linear" XOR used instead of classical "Saddle" one. // The reason is to have the result absolutely conststent with what // the scanline rasterizer produces. // See intersect_shapes_aa for more comments //---------- - template<class ScanlineGen1, - class ScanlineGen2, - class Scanline1, - class Scanline2, - class Scanline, + template<class ScanlineGen1, + class ScanlineGen2, + class Scanline1, + class Scanline2, + class Scanline, class Renderer> void sbool_xor_shapes_aa(ScanlineGen1& sg1, ScanlineGen2& sg2, Scanline1& sl1, Scanline2& sl2, @@ -1344,26 +1344,26 @@ namespace agg { sbool_add_span_aa<Scanline1, Scanline> add_functor1; sbool_add_span_aa<Scanline2, Scanline> add_functor2; - sbool_xor_spans_aa<Scanline1, Scanline2, Scanline, + sbool_xor_spans_aa<Scanline1, Scanline2, Scanline, sbool_xor_formula_linear<> > combine_functor; - sbool_unite_shapes(sg1, sg2, sl1, sl2, sl, ren, + sbool_unite_shapes(sg1, sg2, sl1, sl2, sl, ren, add_functor1, add_functor2, combine_functor); } //------------------------------------------sbool_xor_shapes_saddle_aa - // Apply eXclusive OR to two anti-aliased scanline shapes. - // There's the classical "Saddle" used to calculate the + // Apply eXclusive OR to two anti-aliased scanline shapes. + // There's the classical "Saddle" used to calculate the // Anti-Aliasing values, that is: // a XOR b : 1-((1-a+a*b)*(1-b+a*b)) // See intersect_shapes_aa for more comments //---------- - template<class ScanlineGen1, - class ScanlineGen2, - class Scanline1, - class Scanline2, - class Scanline, + template<class ScanlineGen1, + class ScanlineGen2, + class Scanline1, + class Scanline2, + class Scanline, class Renderer> void sbool_xor_shapes_saddle_aa(ScanlineGen1& sg1, ScanlineGen2& sg2, Scanline1& sl1, Scanline2& sl2, @@ -1371,27 +1371,27 @@ namespace agg { sbool_add_span_aa<Scanline1, Scanline> add_functor1; sbool_add_span_aa<Scanline2, Scanline> add_functor2; - sbool_xor_spans_aa<Scanline1, - Scanline2, - Scanline, + sbool_xor_spans_aa<Scanline1, + Scanline2, + Scanline, sbool_xor_formula_saddle<> > combine_functor; - sbool_unite_shapes(sg1, sg2, sl1, sl2, sl, ren, + sbool_unite_shapes(sg1, sg2, sl1, sl2, sl, ren, add_functor1, add_functor2, combine_functor); } //--------------------------------------sbool_xor_shapes_abs_diff_aa - // Apply eXclusive OR to two anti-aliased scanline shapes. - // There's the absolute difference used to calculate + // Apply eXclusive OR to two anti-aliased scanline shapes. + // There's the absolute difference used to calculate // Anti-Aliasing values, that is: // a XOR b : abs(a-b) // See intersect_shapes_aa for more comments //---------- - template<class ScanlineGen1, - class ScanlineGen2, - class Scanline1, - class Scanline2, - class Scanline, + template<class ScanlineGen1, + class ScanlineGen2, + class Scanline1, + class Scanline2, + class Scanline, class Renderer> void sbool_xor_shapes_abs_diff_aa(ScanlineGen1& sg1, ScanlineGen2& sg2, Scanline1& sl1, Scanline2& sl2, @@ -1399,25 +1399,25 @@ namespace agg { sbool_add_span_aa<Scanline1, Scanline> add_functor1; sbool_add_span_aa<Scanline2, Scanline> add_functor2; - sbool_xor_spans_aa<Scanline1, - Scanline2, - Scanline, + sbool_xor_spans_aa<Scanline1, + Scanline2, + Scanline, sbool_xor_formula_abs_diff> combine_functor; - sbool_unite_shapes(sg1, sg2, sl1, sl2, sl, ren, + sbool_unite_shapes(sg1, sg2, sl1, sl2, sl, ren, add_functor1, add_functor2, combine_functor); } //--------------------------------------------------sbool_xor_shapes_bin - // Apply eXclusive OR to two binary scanline shapes (without anti-aliasing). + // Apply eXclusive OR to two binary scanline shapes (without anti-aliasing). // See intersect_shapes_aa for more comments //---------- - template<class ScanlineGen1, - class ScanlineGen2, - class Scanline1, - class Scanline2, - class Scanline, + template<class ScanlineGen1, + class ScanlineGen2, + class Scanline1, + class Scanline2, + class Scanline, class Renderer> void sbool_xor_shapes_bin(ScanlineGen1& sg1, ScanlineGen2& sg2, Scanline1& sl1, Scanline2& sl2, @@ -1426,7 +1426,7 @@ namespace agg sbool_add_span_bin<Scanline1, Scanline> add_functor1; sbool_add_span_bin<Scanline2, Scanline> add_functor2; sbool_combine_spans_empty<Scanline1, Scanline2, Scanline> combine_functor; - sbool_unite_shapes(sg1, sg2, sl1, sl2, sl, ren, + sbool_unite_shapes(sg1, sg2, sl1, sl2, sl, ren, add_functor1, add_functor2, combine_functor); } @@ -1439,11 +1439,11 @@ namespace agg // Subtract shapes "sg1-sg2" with anti-aliasing // See intersect_shapes_aa for more comments //---------- - template<class ScanlineGen1, - class ScanlineGen2, - class Scanline1, - class Scanline2, - class Scanline, + template<class ScanlineGen1, + class ScanlineGen2, + class Scanline1, + class Scanline2, + class Scanline, class Renderer> void sbool_subtract_shapes_aa(ScanlineGen1& sg1, ScanlineGen2& sg2, Scanline1& sl1, Scanline2& sl2, @@ -1451,7 +1451,7 @@ namespace agg { sbool_add_span_aa<Scanline1, Scanline> add_functor; sbool_subtract_spans_aa<Scanline1, Scanline2, Scanline> combine_functor; - sbool_subtract_shapes(sg1, sg2, sl1, sl2, sl, ren, + sbool_subtract_shapes(sg1, sg2, sl1, sl2, sl, ren, add_functor, combine_functor); } @@ -1463,11 +1463,11 @@ namespace agg // Subtract binary shapes "sg1-sg2" without anti-aliasing // See intersect_shapes_aa for more comments //---------- - template<class ScanlineGen1, - class ScanlineGen2, - class Scanline1, - class Scanline2, - class Scanline, + template<class ScanlineGen1, + class ScanlineGen2, + class Scanline1, + class Scanline2, + class Scanline, class Renderer> void sbool_subtract_shapes_bin(ScanlineGen1& sg1, ScanlineGen2& sg2, Scanline1& sl1, Scanline2& sl2, @@ -1475,7 +1475,7 @@ namespace agg { sbool_add_span_bin<Scanline1, Scanline> add_functor; sbool_combine_spans_empty<Scanline1, Scanline2, Scanline> combine_functor; - sbool_subtract_shapes(sg1, sg2, sl1, sl2, sl, ren, + sbool_subtract_shapes(sg1, sg2, sl1, sl2, sl, ren, add_functor, combine_functor); } @@ -1502,11 +1502,11 @@ namespace agg //----------------------------------------------sbool_combine_shapes_bin - template<class ScanlineGen1, - class ScanlineGen2, - class Scanline1, - class Scanline2, - class Scanline, + template<class ScanlineGen1, + class ScanlineGen2, + class Scanline1, + class Scanline2, + class Scanline, class Renderer> void sbool_combine_shapes_bin(sbool_op_e op, ScanlineGen1& sg1, ScanlineGen2& sg2, @@ -1518,7 +1518,7 @@ namespace agg case sbool_or : sbool_unite_shapes_bin (sg1, sg2, sl1, sl2, sl, ren); break; case sbool_and : sbool_intersect_shapes_bin(sg1, sg2, sl1, sl2, sl, ren); break; case sbool_xor : - case sbool_xor_saddle : + case sbool_xor_saddle : case sbool_xor_abs_diff: sbool_xor_shapes_bin (sg1, sg2, sl1, sl2, sl, ren); break; case sbool_a_minus_b : sbool_subtract_shapes_bin (sg1, sg2, sl1, sl2, sl, ren); break; case sbool_b_minus_a : sbool_subtract_shapes_bin (sg2, sg1, sl2, sl1, sl, ren); break; @@ -1529,11 +1529,11 @@ namespace agg //-----------------------------------------------sbool_combine_shapes_aa - template<class ScanlineGen1, - class ScanlineGen2, - class Scanline1, - class Scanline2, - class Scanline, + template<class ScanlineGen1, + class ScanlineGen2, + class Scanline1, + class Scanline2, + class Scanline, class Renderer> void sbool_combine_shapes_aa(sbool_op_e op, ScanlineGen1& sg1, ScanlineGen2& sg2, diff --git a/agg/inc/agg_scanline_p.h b/agg/inc/agg_scanline_p.h index f217998578a1..633119a1ae1c 100755 --- a/agg/inc/agg_scanline_p.h +++ b/agg/inc/agg_scanline_p.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. // @@ -25,11 +25,11 @@ namespace agg { //==============================================================scanline_p - // - // This is a general purpose scaline container which supports the interface + // + // This is a general purpose scaline container which supports the interface // used in the rasterizer::render(). See description of agg_scanline_u // for details. - // + // //------------------------------------------------------------------------ template<class T> class scanline_p { @@ -88,7 +88,7 @@ namespace agg //------------------------------------------------------------------------ - template<class T> + template<class T> void scanline_p<T>::reset(int min_x, int max_x) { unsigned max_len = max_x - min_x + 3; @@ -108,7 +108,7 @@ namespace agg //------------------------------------------------------------------------ - template<class T> + template<class T> void scanline_p<T>::reset_spans() { m_last_x = 0x7FFFFFF0; @@ -119,7 +119,7 @@ namespace agg //------------------------------------------------------------------------ - template<class T> + template<class T> void scanline_p<T>::add_cell(int x, unsigned cover) { *m_cover_ptr = (T)cover; @@ -140,7 +140,7 @@ namespace agg //------------------------------------------------------------------------ - template<class T> + template<class T> void scanline_p<T>::add_cells(int x, unsigned len, const T* covers) { memcpy(m_cover_ptr, covers, len * sizeof(T)); @@ -161,11 +161,11 @@ namespace agg //------------------------------------------------------------------------ - template<class T> + template<class T> void scanline_p<T>::add_span(int x, unsigned len, unsigned cover) { - if(x == m_last_x+1 && - m_cur_span->len < 0 && + if(x == m_last_x+1 && + m_cur_span->len < 0 && cover == *m_cur_span->covers) { m_cur_span->len -= (int16)len; diff --git a/agg/inc/agg_scanline_storage_aa.h b/agg/inc/agg_scanline_storage_aa.h index 3d8b5b946cf9..6f5e78dae35b 100755 --- a/agg/inc/agg_scanline_storage_aa.h +++ b/agg/inc/agg_scanline_storage_aa.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. // @@ -61,7 +61,7 @@ namespace agg } //--------------------------------------------------------------- - const scanline_cell_storage<T>& + const scanline_cell_storage<T>& operator = (const scanline_cell_storage<T>& v) { remove_all(); @@ -304,8 +304,8 @@ namespace agg sp.x = span_iterator->x; sp.len = span_iterator->len; int len = abs(int(sp.len)); - sp.covers_id = - m_covers.add_cells(span_iterator->covers, + sp.covers_id = + m_covers.add_cells(span_iterator->covers, unsigned(len)); m_spans.add(sp); int x1 = sp.x; @@ -443,7 +443,7 @@ namespace agg for(i = 0; i < m_scanlines.size(); ++i) { const scanline_data& sl_this = m_scanlines[i]; - + int8u* size_ptr = data; data += sizeof(int16); // Reserve space for scanline size in bytes @@ -542,7 +542,7 @@ namespace agg { int16 x; int16 len; // If negative, it's a solid span, "covers" is valid - const T* covers; + const T* covers; }; const_iterator(const embedded_scanline& sl) : @@ -557,11 +557,11 @@ namespace agg void operator ++ () { - if(m_span.len < 0) + if(m_span.len < 0) { m_ptr += sizeof(T); } - else + else { m_ptr += m_span.len * sizeof(T); } @@ -691,7 +691,7 @@ namespace agg ((int8u*)&val)[1] = *m_ptr++; return val; } - + public: // Iterate scanlines interface //-------------------------------------------------------------------- @@ -700,7 +700,7 @@ namespace agg m_ptr = m_data; if(m_ptr < m_end) { - m_min_x = read_int16() + m_dx; + m_min_x = read_int16() + m_dx; m_min_y = read_int16() + m_dy; m_max_x = read_int16() + m_dx; m_max_y = read_int16() + m_dy; diff --git a/agg/inc/agg_scanline_storage_bin.h b/agg/inc/agg_scanline_storage_bin.h index 90fa50e4ee6d..ab499feb1259 100755 --- a/agg/inc/agg_scanline_storage_bin.h +++ b/agg/inc/agg_scanline_storage_bin.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. // @@ -474,7 +474,7 @@ namespace agg ((int8u*)&val)[1] = *m_ptr++; return val; } - + public: // Iterate scanlines interface //-------------------------------------------------------------------- @@ -483,7 +483,7 @@ namespace agg m_ptr = m_data; if(m_ptr < m_end) { - m_min_x = read_int16() + m_dx; + m_min_x = read_int16() + m_dx; m_min_y = read_int16() + m_dy; m_max_x = read_int16() + m_dx; m_max_y = read_int16() + m_dy; diff --git a/agg/inc/agg_scanline_u.h b/agg/inc/agg_scanline_u.h index 749c5b3c0054..fd688cafcad0 100755 --- a/agg/inc/agg_scanline_u.h +++ b/agg/inc/agg_scanline_u.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. // @@ -25,22 +25,22 @@ namespace agg // // Unpacked scanline container class // - // This class is used to transfer data from a scanline rastyerizer - // to the rendering buffer. It's organized very simple. The class stores - // information of horizontal spans to render it into a pixel-map buffer. - // Each span has staring X, length, and an array of bytes that determine the - // cover-values for each pixel. - // Before using this class you should know the minimal and maximal pixel + // This class is used to transfer data from a scanline rastyerizer + // to the rendering buffer. It's organized very simple. The class stores + // information of horizontal spans to render it into a pixel-map buffer. + // Each span has staring X, length, and an array of bytes that determine the + // cover-values for each pixel. + // Before using this class you should know the minimal and maximal pixel // coordinates of your scanline. The protocol of using is: // 1. reset(min_x, max_x) - // 2. add_cell() / add_span() - accumulate scanline. + // 2. add_cell() / add_span() - accumulate scanline. // When forming one scanline the next X coordinate must be always greater // than the last stored one, i.e. it works only with ordered coordinates. // 3. Call finalize(y) and render the scanline. // 3. Call reset_spans() to prepare for the new scanline. - // + // // 4. Rendering: - // + // // Scanline provides an iterator class that allows you to extract // the spans and the cover values for each pixel. Be aware that clipping // has not been done yet, so you should perform it yourself. @@ -54,10 +54,10 @@ namespace agg // ************************************ // // scanline_u8::const_iterator span = sl.begin(); - // - // unsigned char* row = m_rbuf->row(y); // The the address of the beginning + // + // unsigned char* row = m_rbuf->row(y); // The the address of the beginning // // of the current row - // + // // unsigned num_spans = sl.num_spans(); // Number of spans. It's guaranteed that // // num_spans is always greater than 0. // @@ -68,7 +68,7 @@ namespace agg // // int num_pix = span->len; // Number of pixels of the span. // // Always greater than 0, still it's - // // better to use "int" instead of + // // better to use "int" instead of // // "unsigned" because it's more // // convenient for clipping // int x = span->x; @@ -79,24 +79,24 @@ namespace agg // ************************************** // // unsigned char* dst = row + x; // Calculate the start address of the row. - // // In this case we assume a simple + // // In this case we assume a simple // // grayscale image 1-byte per pixel. // do // { - // *dst++ = *covers++; // Hypotetical rendering. + // *dst++ = *covers++; // Hypotetical rendering. // } // while(--num_pix); // // ++span; - // } + // } // while(--num_spans); // num_spans cannot be 0, so this loop is quite safe //------------------------------------------------------------------------ // // The question is: why should we accumulate the whole scanline when we // could render just separate spans when they're ready? - // That's because using the scaline is generally faster. When is consists + // That's because using the scaline is generally faster. When is consists // of more than one span the conditions for the processor cash system - // are better, because switching between two different areas of memory + // are better, because switching between two different areas of memory // (that can be very large) occures less frequently. //------------------------------------------------------------------------ template<class T> class scanline_u @@ -264,11 +264,11 @@ namespace agg //=============================================================scanline_am - // + // // The scanline container with alpha-masking - // + // //------------------------------------------------------------------------ - template<class AlphaMask, class CoverT> + template<class AlphaMask, class CoverT> class scanline_am : public scanline_u<CoverT> { public: @@ -289,9 +289,9 @@ namespace agg unsigned count = scanline_type::num_spans(); do { - m_alpha_mask->combine_hspan(span->x, - scanline_type::y(), - span->covers, + m_alpha_mask->combine_hspan(span->x, + scanline_type::y(), + span->covers, span->len); ++span; } @@ -305,7 +305,7 @@ namespace agg //==========================================================scanline_u8_am - template<class AlphaMask> + template<class AlphaMask> class scanline_u8_am : public scanline_am<AlphaMask, int8u> { public: diff --git a/agg/inc/agg_shorten_path.h b/agg/inc/agg_shorten_path.h index 271d2a7ec572..2de2aace3679 100755 --- a/agg/inc/agg_shorten_path.h +++ b/agg/inc/agg_shorten_path.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. // @@ -23,7 +23,7 @@ namespace agg { //===========================================================shorten_path - template<class VertexSequence> + template<class VertexSequence> void shorten_path(VertexSequence& vs, double s, unsigned closed = 0) { typedef typename VertexSequence::value_type vertex_type; diff --git a/agg/inc/agg_simul_eq.h b/agg/inc/agg_simul_eq.h index f52662e82926..118d408ec772 100755 --- a/agg/inc/agg_simul_eq.h +++ b/agg/inc/agg_simul_eq.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. // @@ -71,14 +71,14 @@ namespace agg return 0; } }; - + //===============================================================simul_eq template<unsigned Size, unsigned RightCols> struct simul_eq { - static bool solve(const double left[Size][Size], + static bool solve(const double left[Size][Size], const double right[Size][RightCols], double result[Size][RightCols]) { @@ -92,7 +92,7 @@ namespace agg for(j = 0; j < Size; j++) { tmp[i][j] = left[i][j]; - } + } for(j = 0; j < RightCols; j++) { tmp[i][Size + j] = right[i][j]; diff --git a/agg/inc/agg_span_allocator.h b/agg/inc/agg_span_allocator.h index d99c5b9d8936..a3315b7d1b6b 100755 --- a/agg/inc/agg_span_allocator.h +++ b/agg/inc/agg_span_allocator.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. // @@ -52,8 +52,8 @@ namespace agg //-------------------------------------------------------------------- color_type* span() - { - return m_span; + { + return m_span; } private: diff --git a/agg/inc/agg_span_converter.h b/agg/inc/agg_span_converter.h index 104cd7d8e73e..26bf587d0c9e 100755 --- a/agg/inc/agg_span_converter.h +++ b/agg/inc/agg_span_converter.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. // @@ -26,11 +26,11 @@ namespace agg public: typedef typename SpanGenerator::color_type color_type; - span_converter(SpanGenerator& span_gen, Conv& conv) : + span_converter(SpanGenerator& span_gen, Conv& conv) : m_span_gen(&span_gen), m_conv(&conv) {} //-------------------------------------------------------------------- - void prepare(unsigned max_span_len) + void prepare(unsigned max_span_len) { m_span_gen->prepare(max_span_len); } diff --git a/agg/inc/agg_span_generator.h b/agg/inc/agg_span_generator.h index 82b0ebef95f3..2be965512e75 100755 --- a/agg/inc/agg_span_generator.h +++ b/agg/inc/agg_span_generator.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. // @@ -37,7 +37,7 @@ namespace agg alloc_type& allocator() { return *m_alloc; } //-------------------------------------------------------------------- - void prepare(unsigned max_span_len) + void prepare(unsigned max_span_len) { m_alloc->allocate(max_span_len); } diff --git a/agg/inc/agg_span_gouraud.h b/agg/inc/agg_span_gouraud.h index 76747899b5fc..091ca5d8af53 100755 --- a/agg/inc/agg_span_gouraud.h +++ b/agg/inc/agg_span_gouraud.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. // @@ -24,7 +24,7 @@ namespace agg { //============================================================span_gouraud - template<class ColorT, class Allocator> + template<class ColorT, class Allocator> class span_gouraud : public span_generator<ColorT, Allocator> { public: @@ -39,7 +39,7 @@ namespace agg }; //-------------------------------------------------------------------- - span_gouraud(alloc_type& alloc) : + span_gouraud(alloc_type& alloc) : span_generator<color_type, alloc_type>(alloc), m_vertex(0) { @@ -54,7 +54,7 @@ namespace agg double x1, double y1, double x2, double y2, double x3, double y3, - double d) : + double d) : span_generator<color_type, alloc_type>(alloc) { colors(c1, c2, c3); @@ -71,21 +71,21 @@ namespace agg //-------------------------------------------------------------------- // Sets the triangle and dilates it if needed. - // The trick here is to calculate beveled joins in the vertices of the - // triangle and render it as a 6-vertex polygon. - // It's necessary to achieve numerical stability. + // The trick here is to calculate beveled joins in the vertices of the + // triangle and render it as a 6-vertex polygon. + // It's necessary to achieve numerical stability. // However, the coordinates to interpolate colors are calculated // as miter joins (calc_intersection). - void triangle(double x1, double y1, + void triangle(double x1, double y1, double x2, double y2, double x3, double y3, double d) { - m_coord[0].x = m_x[0] = x1; + m_coord[0].x = m_x[0] = x1; m_coord[0].y = m_y[0] = y1; - m_coord[1].x = m_x[1] = x2; + m_coord[1].x = m_x[1] = x2; m_coord[1].y = m_y[1] = y2; - m_coord[2].x = m_x[2] = x3; + m_coord[2].x = m_x[2] = x3; m_coord[2].y = m_y[2] = y3; m_cmd[0] = path_cmd_move_to; m_cmd[1] = path_cmd_line_to; @@ -93,7 +93,7 @@ namespace agg m_cmd[3] = path_cmd_stop; if(d != 0.0) - { + { dilate_triangle(m_coord[0].x, m_coord[0].y, m_coord[1].x, m_coord[1].y, m_coord[2].x, m_coord[2].y, @@ -144,7 +144,7 @@ namespace agg if(m_coord[0].y > m_coord[2].y) { - coord[0] = m_coord[2]; + coord[0] = m_coord[2]; coord[2] = m_coord[0]; } diff --git a/agg/inc/agg_span_gouraud_gray.h b/agg/inc/agg_span_gouraud_gray.h index caf288919e93..b2c745dca179 100755 --- a/agg/inc/agg_span_gouraud_gray.h +++ b/agg/inc/agg_span_gouraud_gray.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. -// +// //---------------------------------------------------------------------------- #ifndef AGG_SPAN_GOURAUD_GRAY_INCLUDED @@ -88,14 +88,14 @@ namespace agg span_gouraud_gray(alloc_type& alloc) : base_type(alloc) {} //-------------------------------------------------------------------- - span_gouraud_gray(alloc_type& alloc, - const color_type& c1, - const color_type& c2, + span_gouraud_gray(alloc_type& alloc, + const color_type& c1, + const color_type& c2, const color_type& c3, - double x1, double y1, + double x1, double y1, double x2, double y2, - double x3, double y3, - double d = 0) : + double x3, double y3, + double d = 0) : base_type(alloc, c1, c2, c3, x1, y1, x2, y2, x3, y3, d) {} @@ -109,7 +109,7 @@ namespace agg m_y2 = int(coord[1].y); - m_swap = calc_point_location(coord[0].x, coord[0].y, + m_swap = calc_point_location(coord[0].x, coord[0].y, coord[2].x, coord[2].y, coord[1].x, coord[1].y) < 0.0; @@ -153,7 +153,7 @@ namespace agg if(nx < x) { unsigned d = unsigned(x - nx); - v += d; + v += d; a += d; } @@ -162,7 +162,7 @@ namespace agg { span->v = (value_type)v.y(); span->a = (value_type)a.y(); - ++v; + ++v; ++a; ++span; } diff --git a/agg/inc/agg_span_gouraud_rgba.h b/agg/inc/agg_span_gouraud_rgba.h index 75679a9426c2..f37f6a284e1d 100755 --- a/agg/inc/agg_span_gouraud_rgba.h +++ b/agg/inc/agg_span_gouraud_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. -// +// //---------------------------------------------------------------------------- #ifndef AGG_SPAN_GOURAUD_RGBA_INCLUDED @@ -100,14 +100,14 @@ namespace agg span_gouraud_rgba(alloc_type& alloc) : base_type(alloc) {} //-------------------------------------------------------------------- - span_gouraud_rgba(alloc_type& alloc, - const color_type& c1, - const color_type& c2, + span_gouraud_rgba(alloc_type& alloc, + const color_type& c1, + const color_type& c2, const color_type& c3, - double x1, double y1, + double x1, double y1, double x2, double y2, - double x3, double y3, - double d = 0) : + double x3, double y3, + double d = 0) : base_type(alloc, c1, c2, c3, x1, y1, x2, y2, x3, y3, d) {} @@ -121,7 +121,7 @@ namespace agg m_y2 = int(coord[1].y); - m_swap = calc_point_location(coord[0].x, coord[0].y, + m_swap = calc_point_location(coord[0].x, coord[0].y, coord[2].x, coord[2].y, coord[1].x, coord[1].y) < 0.0; @@ -167,9 +167,9 @@ namespace agg if(nx < x) { unsigned d = unsigned(x - nx); - r += d; - g += d; - b += d; + r += d; + g += d; + b += d; a += d; } @@ -180,9 +180,9 @@ namespace agg span->g = (value_type)g.y(); span->b = (value_type)b.y(); span->a = (value_type)a.y(); - ++r; - ++g; - ++b; + ++r; + ++g; + ++b; ++a; ++span; } diff --git a/agg/inc/agg_span_gradient.h b/agg/inc/agg_span_gradient.h index 6bac1c652a84..ada677951487 100755 --- a/agg/inc/agg_span_gradient.h +++ b/agg/inc/agg_span_gradient.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. // @@ -40,7 +40,7 @@ namespace agg //==========================================================span_gradient template<class ColorT, class Interpolator, - class GradientF, + class GradientF, class ColorF, class Allocator = span_allocator<ColorT> > class span_gradient : public span_generator<ColorT, Allocator> @@ -53,7 +53,7 @@ namespace agg enum { - downscale_shift = interpolator_type::subpixel_shift - + downscale_shift = interpolator_type::subpixel_shift - gradient_subpixel_shift }; @@ -65,7 +65,7 @@ namespace agg interpolator_type& inter, const GradientF& gradient_function_, const ColorF& color_function_, - double d1_, double d2_) : + double d1_, double d2_) : base_type(alloc), m_interpolator(&inter), m_gradient_function(&gradient_function_), @@ -90,7 +90,7 @@ namespace agg //-------------------------------------------------------------------- color_type* generate(int x, int y, unsigned len) - { + { color_type* span = base_type::allocator().span(); int dd = m_d2 - m_d1; if(dd < 1) dd = 1; @@ -98,7 +98,7 @@ namespace agg do { m_interpolator->coordinates(&x, &y); - int d = m_gradient_function->calculate(x >> downscale_shift, + int d = m_gradient_function->calculate(x >> downscale_shift, y >> downscale_shift, dd); d = ((d - m_d1) * (int)m_color_function->size()) / dd; if(d < 0) d = 0; @@ -122,18 +122,18 @@ namespace agg //=====================================================gradient_linear_color - template<class ColorT> + template<class ColorT> struct gradient_linear_color { typedef ColorT color_type; gradient_linear_color() {} - gradient_linear_color(const color_type& c1, const color_type& c2, + gradient_linear_color(const color_type& c1, const color_type& c2, unsigned size = 256) : m_c1(c1), m_c2(c2), m_size(size) {} unsigned size() const { return m_size; } - color_type operator [] (unsigned v) const + color_type operator [] (unsigned v) const { return m_c1.gradient(m_c2, double(v) / double(m_size - 1)); } @@ -190,18 +190,18 @@ namespace agg { public: //--------------------------------------------------------------------- - gradient_radial_focus() : - m_radius(100 * gradient_subpixel_size), - m_focus_x(0), + gradient_radial_focus() : + m_radius(100 * gradient_subpixel_size), + m_focus_x(0), m_focus_y(0) { update_values(); } //--------------------------------------------------------------------- - gradient_radial_focus(double r, double fx, double fy) : - m_radius (int(r * gradient_subpixel_size)), - m_focus_x(int(fx * gradient_subpixel_size)), + gradient_radial_focus(double r, double fx, double fy) : + m_radius (int(r * gradient_subpixel_size)), + m_focus_x(int(fx * gradient_subpixel_size)), m_focus_y(int(fy * gradient_subpixel_size)) { update_values(); @@ -230,30 +230,30 @@ namespace agg // Special case to avoid divide by zero or very near zero //--------------------------------- if(x == int(m_focus_x)) - { + { solution_x = m_focus_x; solution_y = 0.0; solution_y += (y > m_focus_y) ? m_trivial : -m_trivial; } - else - { + else + { // Slope of the focus-current line //------------------------------- double slope = double(y - m_focus_y) / double(x - m_focus_x); // y-intercept of that same line //-------------------------------- - double yint = double(y) - (slope * x); - - // Use the classical quadratic formula to calculate - // the intersection point + double yint = double(y) - (slope * x); + + // Use the classical quadratic formula to calculate + // the intersection point //-------------------------------- - double a = (slope * slope) + 1; + double a = (slope * slope) + 1; double b = 2 * slope * yint; double c = yint * yint - m_radius2; double det = sqrt((b * b) - (4.0 * a * c)); solution_x = -b; - + // Choose the positive or negative root depending // on where the X coord lies with respect to the focus. solution_x += (x < m_focus_x) ? -det : det; @@ -261,9 +261,9 @@ namespace agg // Calculating of Y is trivial solution_y = (slope * solution_x) + yint; - } + } - // Calculate the percentage (0...1) of the current point along the + // Calculate the percentage (0...1) of the current point along the // focus-circumference line and return the normalized (0...d) value //------------------------------- solution_x -= double(m_focus_x); @@ -283,16 +283,16 @@ namespace agg //------------------------------- m_radius2 = double(m_radius) * double(m_radius); - double dist = sqrt(double(m_focus_x) * double(m_focus_x) + + double dist = sqrt(double(m_focus_x) * double(m_focus_x) + double(m_focus_y) * double(m_focus_y)); // Test if distance from focus to center is greater than the radius - // For the sake of assurance factor restrict the point to be + // For the sake of assurance factor restrict the point to be // no further than 99% of the radius. //------------------------------- double r = m_radius * 0.99; - if(dist > r) - { + if(dist > r) + { // clamp focus to radius // x = r cos theta, y = r sin theta //------------------------ @@ -335,11 +335,11 @@ namespace agg class gradient_diamond { public: - static AGG_INLINE int calculate(int x, int y, int) - { + static AGG_INLINE int calculate(int x, int y, int) + { int ax = abs(x); int ay = abs(y); - return ax > ay ? ax : ay; + return ax > ay ? ax : ay; } }; @@ -348,9 +348,9 @@ namespace agg class gradient_xy { public: - static AGG_INLINE int calculate(int x, int y, int d) - { - return abs(x) * abs(y) / d; + static AGG_INLINE int calculate(int x, int y, int d) + { + return abs(x) * abs(y) / d; } }; @@ -359,9 +359,9 @@ namespace agg class gradient_sqrt_xy { public: - static AGG_INLINE int calculate(int x, int y, int) - { - return fast_sqrt(abs(x) * abs(y)); + static AGG_INLINE int calculate(int x, int y, int) + { + return fast_sqrt(abs(x) * abs(y)); } }; @@ -370,8 +370,8 @@ namespace agg class gradient_conic { public: - static AGG_INLINE int calculate(int x, int y, int d) - { + static AGG_INLINE int calculate(int x, int y, int d) + { return int(fabs(atan2(double(y), double(x))) * double(d) / pi); } }; @@ -381,7 +381,7 @@ namespace agg template<class GradientF> class gradient_repeat_adaptor { public: - gradient_repeat_adaptor(const GradientF& gradient) : + gradient_repeat_adaptor(const GradientF& gradient) : m_gradient(&gradient) {} AGG_INLINE int calculate(int x, int y, int d) const @@ -400,7 +400,7 @@ namespace agg template<class GradientF> class gradient_reflect_adaptor { public: - gradient_reflect_adaptor(const GradientF& gradient) : + gradient_reflect_adaptor(const GradientF& gradient) : m_gradient(&gradient) {} AGG_INLINE int calculate(int x, int y, int d) const diff --git a/agg/inc/agg_span_gradient_alpha.h b/agg/inc/agg_span_gradient_alpha.h index b1444ed8c4bc..d191c7a634a8 100755 --- a/agg/inc/agg_span_gradient_alpha.h +++ b/agg/inc/agg_span_gradient_alpha.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. // @@ -21,9 +21,9 @@ namespace agg { //======================================================span_gradient_alpha - template<class ColorT, + template<class ColorT, class Interpolator, - class GradientF, + class GradientF, class AlphaF> class span_gradient_alpha { @@ -45,7 +45,7 @@ namespace agg span_gradient_alpha(interpolator_type& inter, const GradientF& gradient_function, const AlphaF& alpha_function, - double d1, double d2) : + double d1, double d2) : m_interpolator(&inter), m_gradient_function(&gradient_function), m_alpha_function(&alpha_function), @@ -69,14 +69,14 @@ namespace agg //-------------------------------------------------------------------- void convert(color_type* span, int x, int y, unsigned len) - { + { int dd = m_d2 - m_d1; if(dd < 1) dd = 1; m_interpolator->begin(x+0.5, y+0.5, len); do { m_interpolator->coordinates(&x, &y); - int d = m_gradient_function->calculate(x >> downscale_shift, + int d = m_gradient_function->calculate(x >> downscale_shift, y >> downscale_shift, dd); d = ((d - m_d1) * (int)m_alpha_function->size()) / dd; if(d < 0) d = 0; diff --git a/agg/inc/agg_span_image_filter.h b/agg/inc/agg_span_image_filter.h index 34163bb29f24..7b59975ce248 100755 --- a/agg/inc/agg_span_image_filter.h +++ b/agg/inc/agg_span_image_filter.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. // @@ -29,7 +29,7 @@ namespace agg { //--------------------------------------------------span_image_filter - template<class ColorT, class Interpolator, class Allocator> + template<class ColorT, class Interpolator, class Allocator> class span_image_filter : public span_generator<ColorT, Allocator> { public: @@ -39,16 +39,16 @@ namespace agg typedef span_generator<color_type, alloc_type> base_type; //---------------------------------------------------------------- - span_image_filter(alloc_type& alloc) : - span_generator<color_type, alloc_type>(alloc) + span_image_filter(alloc_type& alloc) : + span_generator<color_type, alloc_type>(alloc) {} //---------------------------------------------------------------- span_image_filter(alloc_type& alloc, - const rendering_buffer& src, + const rendering_buffer& src, const color_type& back_color, interpolator_type& interpolator_, - const image_filter_lut* filter_) : + const image_filter_lut* filter_) : span_generator<color_type, alloc_type>(alloc), m_src(&src), m_back_color(back_color), @@ -87,7 +87,7 @@ namespace agg interpolator_type& interpolator() { return *m_interpolator; } //-------------------------------------------------------------------- - void prepare(unsigned max_span_len) + void prepare(unsigned max_span_len) { base_type::prepare(max_span_len); } diff --git a/agg/inc/agg_span_image_filter_gray.h b/agg/inc/agg_span_image_filter_gray.h index 3f7ae6fcfa72..963b901cfa76 100755 --- a/agg/inc/agg_span_image_filter_gray.h +++ b/agg/inc/agg_span_image_filter_gray.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. -// +// //---------------------------------------------------------------------------- #ifndef AGG_SPAN_IMAGE_FILTER_GRAY_INCLUDED @@ -36,8 +36,8 @@ namespace agg //==============================================span_image_filter_gray_nn template<class ColorT, class Interpolator, - class Allocator = span_allocator<ColorT> > - class span_image_filter_gray_nn : + class Allocator = span_allocator<ColorT> > + class span_image_filter_gray_nn : public span_image_filter<ColorT, Interpolator, Allocator> { public: @@ -58,16 +58,16 @@ namespace agg //-------------------------------------------------------------------- span_image_filter_gray_nn(alloc_type& alloc, - const rendering_buffer& src, + const rendering_buffer& src, const color_type& back_color, interpolator_type& inter) : - base_type(alloc, src, back_color, inter, 0) + base_type(alloc, src, back_color, inter, 0) {} //-------------------------------------------------------------------- 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; @@ -86,7 +86,7 @@ namespace agg y >>= image_subpixel_shift; if(x >= 0 && y >= 0 && - x <= maxx && y <= maxy) + x <= maxx && y <= maxy) { fg = *((const value_type*)base_type::source_image().row(y) + x); src_alpha = base_mask; @@ -113,9 +113,9 @@ namespace agg //========================================span_image_filter_gray_bilinear template<class ColorT, - class Interpolator, - class Allocator = span_allocator<ColorT> > - class span_image_filter_gray_bilinear : + class Interpolator, + class Allocator = span_allocator<ColorT> > + class span_image_filter_gray_bilinear : public span_image_filter<ColorT, Interpolator, Allocator> { public: @@ -136,16 +136,16 @@ namespace agg //-------------------------------------------------------------------- span_image_filter_gray_bilinear(alloc_type& alloc, - const rendering_buffer& src, + const rendering_buffer& src, const color_type& back_color, interpolator_type& inter) : - base_type(alloc, src, back_color, inter, 0) + base_type(alloc, src, back_color, inter, 0) {} //-------------------------------------------------------------------- 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; calc_type src_alpha; @@ -163,7 +163,7 @@ namespace agg { int x_hr; int y_hr; - + base_type::interpolator().coordinates(&x_hr, &y_hr); x_hr -= base_type::filter_dx_int(); @@ -173,7 +173,7 @@ namespace agg int y_lr = y_hr >> image_subpixel_shift; if(x_lr >= 0 && y_lr >= 0 && - x_lr < maxx && y_lr < maxy) + x_lr < maxx && y_lr < maxy) { fg = image_subpixel_size * image_subpixel_size / 2; @@ -203,13 +203,13 @@ namespace agg } else { - fg = + fg = src_alpha = image_subpixel_size * image_subpixel_size / 2; x_hr &= image_subpixel_mask; y_hr &= image_subpixel_mask; - weight = (image_subpixel_size - x_hr) * + weight = (image_subpixel_size - x_hr) * (image_subpixel_size - y_hr); if(x_lr >= 0 && y_lr >= 0 && x_lr <= maxx && y_lr <= maxy) @@ -293,9 +293,9 @@ namespace agg //========================================span_image_filter_gray_2x2 template<class ColorT, - class Interpolator, - class Allocator = span_allocator<ColorT> > - class span_image_filter_gray_2x2 : + class Interpolator, + class Allocator = span_allocator<ColorT> > + class span_image_filter_gray_2x2 : public span_image_filter<ColorT, Interpolator, Allocator> { public: @@ -316,17 +316,17 @@ namespace agg //-------------------------------------------------------------------- span_image_filter_gray_2x2(alloc_type& alloc, - const rendering_buffer& src, + const rendering_buffer& src, const color_type& back_color, interpolator_type& inter, const image_filter_lut& filter) : - base_type(alloc, src, back_color, inter, &filter) + base_type(alloc, src, back_color, inter, &filter) {} //-------------------------------------------------------------------- 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; calc_type src_alpha; @@ -336,8 +336,8 @@ namespace agg 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); int maxx = base_type::source_image().width() - 1; @@ -347,7 +347,7 @@ namespace agg { int x_hr; int y_hr; - + base_type::interpolator().coordinates(&x_hr, &y_hr); x_hr -= base_type::filter_dx_int(); @@ -357,7 +357,7 @@ namespace agg int y_lr = y_hr >> image_subpixel_shift; if(x_lr >= 0 && y_lr >= 0 && - x_lr < maxx && y_lr < maxy) + x_lr < maxx && y_lr < maxy) { fg = image_filter_size / 2; @@ -365,24 +365,24 @@ namespace agg y_hr &= image_subpixel_mask; fg_ptr = (const value_type*)base_type::source_image().row(y_lr) + x_lr; - fg += *fg_ptr++ * ((weight_array[x_hr + image_subpixel_size] * - weight_array[y_hr + image_subpixel_size] + - image_filter_size / 2) >> + fg += *fg_ptr++ * ((weight_array[x_hr + image_subpixel_size] * + weight_array[y_hr + image_subpixel_size] + + image_filter_size / 2) >> image_filter_shift); - fg += *fg_ptr++ * ((weight_array[x_hr] * - weight_array[y_hr + image_subpixel_size] + - image_filter_size / 2) >> + fg += *fg_ptr++ * ((weight_array[x_hr] * + weight_array[y_hr + image_subpixel_size] + + image_filter_size / 2) >> image_filter_shift); fg_ptr = (const value_type*)base_type::source_image().next_row(fg_ptr - 2); - fg += *fg_ptr++ * ((weight_array[x_hr + image_subpixel_size] * - weight_array[y_hr] + - image_filter_size / 2) >> + fg += *fg_ptr++ * ((weight_array[x_hr + image_subpixel_size] * + weight_array[y_hr] + + image_filter_size / 2) >> image_filter_shift); - fg += *fg_ptr++ * ((weight_array[x_hr] * - weight_array[y_hr] + - image_filter_size / 2) >> + fg += *fg_ptr++ * ((weight_array[x_hr] * + weight_array[y_hr] + + image_filter_size / 2) >> image_filter_shift); fg >>= image_filter_shift; @@ -405,9 +405,9 @@ namespace agg x_hr &= image_subpixel_mask; y_hr &= image_subpixel_mask; - 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; if(x_lr >= 0 && y_lr >= 0 && x_lr <= maxx && y_lr <= maxy) @@ -423,9 +423,9 @@ namespace agg x_lr++; - 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; if(x_lr >= 0 && y_lr >= 0 && x_lr <= maxx && y_lr <= maxy) @@ -442,9 +442,9 @@ namespace agg x_lr--; y_lr++; - 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; if(x_lr >= 0 && y_lr >= 0 && x_lr <= maxx && y_lr <= maxy) @@ -460,9 +460,9 @@ namespace agg x_lr++; - 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; if(x_lr >= 0 && y_lr >= 0 && x_lr <= maxx && y_lr <= maxy) @@ -508,9 +508,9 @@ namespace agg //================================================span_image_filter_gray template<class ColorT, - class Interpolator, - class Allocator = span_allocator<ColorT> > - class span_image_filter_gray : + class Interpolator, + class Allocator = span_allocator<ColorT> > + class span_image_filter_gray : public span_image_filter<ColorT, Interpolator, Allocator> { public: @@ -531,17 +531,17 @@ namespace agg //-------------------------------------------------------------------- span_image_filter_gray(alloc_type& alloc, - const rendering_buffer& src, + const rendering_buffer& src, const color_type& back_color, interpolator_type& inter, const image_filter_lut& filter) : - base_type(alloc, src, back_color, inter, &filter) + base_type(alloc, src, back_color, inter, &filter) {} //-------------------------------------------------------------------- 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; @@ -564,7 +564,7 @@ namespace agg int maxx2 = base_type::source_image().width() - start - 1; int maxy2 = base_type::source_image().height() - start - 1; - int x_count; + int x_count; int weight_y; do @@ -576,7 +576,7 @@ namespace agg int x_hr = x; int y_hr = y; - + int x_lr = x_hr >> image_subpixel_shift; int y_lr = y_hr >> image_subpixel_shift; @@ -586,7 +586,7 @@ namespace agg unsigned y_count = diameter; if(x_lr >= -start && y_lr >= -start && - x_lr <= maxx && y_lr <= maxy) + x_lr <= maxx && y_lr <= maxy) { y_hr = image_subpixel_mask - (y_hr & image_subpixel_mask); fg_ptr = (const value_type*)base_type::source_image().row(y_lr + start) + x_lr + start; @@ -598,8 +598,8 @@ namespace agg do { - fg += *fg_ptr++ * ((weight_y * weight_array[x_hr] + - image_filter_size / 2) >> + fg += *fg_ptr++ * ((weight_y * weight_array[x_hr] + + image_filter_size / 2) >> image_filter_shift); x_hr += image_subpixel_size; @@ -619,7 +619,7 @@ namespace agg else { if(x_lr < start1 || y_lr < start1 || - x_lr > maxx2 || y_lr > maxy2) + x_lr > maxx2 || y_lr > maxy2) { fg = back_v; src_alpha = back_a; @@ -639,12 +639,12 @@ namespace agg do { - 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; - if(x_lr >= 0 && y_lr >= 0 && - x_lr < int(base_type::source_image().width()) && + if(x_lr >= 0 && y_lr >= 0 && + x_lr < int(base_type::source_image().width()) && y_lr < int(base_type::source_image().height())) { fg_ptr = (const value_type*)base_type::source_image().row(y_lr) + x_lr; diff --git a/agg/inc/agg_span_image_filter_rgb.h b/agg/inc/agg_span_image_filter_rgb.h index d8f8142bfffb..1750cba5589e 100755 --- a/agg/inc/agg_span_image_filter_rgb.h +++ b/agg/inc/agg_span_image_filter_rgb.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. -// +// //---------------------------------------------------------------------------- #ifndef AGG_SPAN_IMAGE_FILTER_RGB_INCLUDED @@ -35,10 +35,10 @@ namespace agg //==============================================span_image_filter_rgb_nn template<class ColorT, - class Order, + class Order, class Interpolator, - class Allocator = span_allocator<ColorT> > - class span_image_filter_rgb_nn : + class Allocator = span_allocator<ColorT> > + class span_image_filter_rgb_nn : public span_image_filter<ColorT, Interpolator, Allocator> { public: @@ -60,16 +60,16 @@ namespace agg //-------------------------------------------------------------------- span_image_filter_rgb_nn(alloc_type& alloc, - const rendering_buffer& src, + const rendering_buffer& src, const color_type& back_color, interpolator_type& inter) : - base_type(alloc, src, back_color, inter, 0) + base_type(alloc, src, back_color, inter, 0) {} //-------------------------------------------------------------------- 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[3]; @@ -89,7 +89,7 @@ namespace agg y >>= image_subpixel_shift; if(x >= 0 && y >= 0 && - x <= maxx && y <= maxy) + x <= maxx && y <= maxy) { fg_ptr = (const value_type*)base_type::source_image().row(y) + x + x + x; fg[0] = *fg_ptr++; @@ -123,10 +123,10 @@ namespace agg //=========================================span_image_filter_rgb_bilinear template<class ColorT, - class Order, - class Interpolator, - class Allocator = span_allocator<ColorT> > - class span_image_filter_rgb_bilinear : + class Order, + class Interpolator, + class Allocator = span_allocator<ColorT> > + class span_image_filter_rgb_bilinear : public span_image_filter<ColorT, Interpolator, Allocator> { public: @@ -148,16 +148,16 @@ namespace agg //-------------------------------------------------------------------- span_image_filter_rgb_bilinear(alloc_type& alloc, - const rendering_buffer& src, + const rendering_buffer& src, const color_type& back_color, interpolator_type& inter) : - base_type(alloc, src, back_color, inter, 0) + base_type(alloc, src, back_color, inter, 0) {} //-------------------------------------------------------------------- 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[3]; calc_type src_alpha; @@ -177,7 +177,7 @@ namespace agg { int x_hr; int y_hr; - + base_type::interpolator().coordinates(&x_hr, &y_hr); x_hr -= base_type::filter_dx_int(); @@ -188,17 +188,17 @@ namespace agg unsigned weight; if(x_lr >= 0 && y_lr >= 0 && - x_lr < maxx && y_lr < maxy) + x_lr < maxx && y_lr < maxy) { - fg[0] = - fg[1] = + fg[0] = + fg[1] = fg[2] = image_subpixel_size * image_subpixel_size / 2; x_hr &= image_subpixel_mask; y_hr &= image_subpixel_mask; fg_ptr = (const value_type*)base_type::source_image().row(y_lr) + x_lr + x_lr + x_lr; - weight = (image_subpixel_size - x_hr) * + weight = (image_subpixel_size - x_hr) * (image_subpixel_size - y_hr); fg[0] += weight * *fg_ptr++; fg[1] += weight * *fg_ptr++; @@ -238,15 +238,15 @@ namespace agg } else { - fg[0] = - fg[1] = - fg[2] = + fg[0] = + fg[1] = + fg[2] = src_alpha = image_subpixel_size * image_subpixel_size / 2; x_hr &= image_subpixel_mask; y_hr &= image_subpixel_mask; - weight = (image_subpixel_size - x_hr) * + weight = (image_subpixel_size - x_hr) * (image_subpixel_size - y_hr); if(x_lr >= 0 && y_lr >= 0 && x_lr <= maxx && y_lr <= maxy) @@ -355,10 +355,10 @@ namespace agg //=========================================span_image_filter_rgb_2x2 template<class ColorT, - class Order, - class Interpolator, - class Allocator = span_allocator<ColorT> > - class span_image_filter_rgb_2x2 : + class Order, + class Interpolator, + class Allocator = span_allocator<ColorT> > + class span_image_filter_rgb_2x2 : public span_image_filter<ColorT, Interpolator, Allocator> { public: @@ -380,17 +380,17 @@ namespace agg //-------------------------------------------------------------------- span_image_filter_rgb_2x2(alloc_type& alloc, - const rendering_buffer& src, + const rendering_buffer& src, const color_type& back_color, interpolator_type& inter, const image_filter_lut& filter) : - base_type(alloc, src, back_color, inter, &filter) + base_type(alloc, src, back_color, inter, &filter) {} //-------------------------------------------------------------------- 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[3]; calc_type src_alpha; @@ -402,8 +402,8 @@ namespace agg 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); int maxx = base_type::source_image().width() - 1; @@ -413,7 +413,7 @@ namespace agg { int x_hr; int y_hr; - + base_type::interpolator().coordinates(&x_hr, &y_hr); x_hr -= base_type::filter_dx_int(); @@ -424,7 +424,7 @@ namespace agg unsigned weight; if(x_lr >= 0 && y_lr >= 0 && - x_lr < maxx && y_lr < maxy) + x_lr < maxx && y_lr < maxy) { fg[0] = fg[1] = fg[2] = image_filter_size / 2; @@ -432,17 +432,17 @@ namespace agg y_hr &= image_subpixel_mask; fg_ptr = (const value_type*)base_type::source_image().row(y_lr) + x_lr + x_lr + x_lr; - 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++; fg[1] += weight * *fg_ptr++; fg[2] += weight * *fg_ptr++; - 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++; fg[1] += weight * *fg_ptr++; @@ -450,17 +450,17 @@ namespace agg fg_ptr = (const value_type*)base_type::source_image().next_row(fg_ptr - 6); - 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++; fg[1] += weight * *fg_ptr++; fg[2] += weight * *fg_ptr++; - 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++; fg[1] += weight * *fg_ptr++; @@ -492,9 +492,9 @@ namespace agg x_hr &= image_subpixel_mask; y_hr &= image_subpixel_mask; - 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; if(x_lr >= 0 && y_lr >= 0 && x_lr <= maxx && y_lr <= maxy) @@ -515,9 +515,9 @@ namespace agg x_lr++; - 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; if(x_lr >= 0 && y_lr >= 0 && x_lr <= maxx && y_lr <= maxy) @@ -539,9 +539,9 @@ namespace agg x_lr--; y_lr++; - 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; if(x_lr >= 0 && y_lr >= 0 && x_lr <= maxx && y_lr <= maxy) @@ -562,9 +562,9 @@ namespace agg x_lr++; - 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; if(x_lr >= 0 && y_lr >= 0 && x_lr <= maxx && y_lr <= maxy) @@ -616,10 +616,10 @@ namespace agg //=================================================span_image_filter_rgb template<class ColorT, - class Order, - class Interpolator, - class Allocator = span_allocator<ColorT> > - class span_image_filter_rgb : + class Order, + class Interpolator, + class Allocator = span_allocator<ColorT> > + class span_image_filter_rgb : public span_image_filter<ColorT, Interpolator, Allocator> { public: @@ -641,17 +641,17 @@ namespace agg //-------------------------------------------------------------------- span_image_filter_rgb(alloc_type& alloc, - const rendering_buffer& src, + const rendering_buffer& src, const color_type& back_color, interpolator_type& inter, const image_filter_lut& filter) : - base_type(alloc, src, back_color, inter, &filter) + base_type(alloc, src, back_color, inter, &filter) {} //-------------------------------------------------------------------- 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[3]; @@ -677,7 +677,7 @@ namespace agg int maxx2 = base_type::source_image().width() - start - 1; int maxy2 = base_type::source_image().height() - start - 1; - int x_count; + int x_count; int weight_y; do @@ -689,7 +689,7 @@ namespace agg int x_hr = x; int y_hr = y; - + int x_lr = x_hr >> image_subpixel_shift; int y_lr = y_hr >> image_subpixel_shift; @@ -699,7 +699,7 @@ namespace agg unsigned y_count = diameter; if(x_lr >= -start && y_lr >= -start && - x_lr <= maxx && y_lr <= maxy) + x_lr <= maxx && y_lr <= maxy) { y_hr = image_subpixel_mask - (y_hr & image_subpixel_mask); fg_ptr = (const value_type*)base_type::source_image().row(y_lr + start) + (x_lr + start) * 3; @@ -711,10 +711,10 @@ namespace agg do { - 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++ * weight; fg[1] += *fg_ptr++ * weight; fg[2] += *fg_ptr++ * weight; @@ -744,7 +744,7 @@ namespace agg else { if(x_lr < start1 || y_lr < start1 || - x_lr > maxx2 || y_lr > maxy2) + x_lr > maxx2 || y_lr > maxy2) { fg[order_type::R] = back_r; fg[order_type::G] = back_g; @@ -766,12 +766,12 @@ namespace agg do { - 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; - if(x_lr >= 0 && y_lr >= 0 && - x_lr < int(base_type::source_image().width()) && + if(x_lr >= 0 && y_lr >= 0 && + x_lr < int(base_type::source_image().width()) && y_lr < int(base_type::source_image().height())) { fg_ptr = (const value_type*)base_type::source_image().row(y_lr) + x_lr * 3; diff --git a/agg/inc/agg_span_image_filter_rgba.h b/agg/inc/agg_span_image_filter_rgba.h index 42b822c99b9b..a6a7512244b0 100755 --- a/agg/inc/agg_span_image_filter_rgba.h +++ b/agg/inc/agg_span_image_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_image_filter_rgba32* @@ -37,10 +37,10 @@ namespace agg //=============================================span_image_filter_rgba_nn template<class ColorT, - class Order, + class Order, class Interpolator, - class Allocator = span_allocator<ColorT> > - class span_image_filter_rgba_nn : + class Allocator = span_allocator<ColorT> > + class span_image_filter_rgba_nn : public span_image_filter<ColorT, Interpolator, Allocator> { public: @@ -62,16 +62,16 @@ namespace agg //-------------------------------------------------------------------- span_image_filter_rgba_nn(alloc_type& alloc, - const rendering_buffer& src, + const rendering_buffer& src, const color_type& back_color, interpolator_type& inter) : - base_type(alloc, src, back_color, inter, 0) + base_type(alloc, src, back_color, inter, 0) {} //-------------------------------------------------------------------- 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]; @@ -90,7 +90,7 @@ namespace agg y >>= image_subpixel_shift; if(x >= 0 && y >= 0 && - x <= maxx && y <= maxy) + x <= maxx && y <= maxy) { fg_ptr = (const value_type*)base_type::source_image().row(y) + (x << 2); fg[0] = *fg_ptr++; @@ -128,10 +128,10 @@ namespace agg //=======================================span_image_filter_rgba_bilinear template<class ColorT, - class Order, + class Order, class Interpolator, - class Allocator = span_allocator<ColorT> > - class span_image_filter_rgba_bilinear : + class Allocator = span_allocator<ColorT> > + class span_image_filter_rgba_bilinear : public span_image_filter<ColorT, Interpolator, Allocator> { public: @@ -153,17 +153,17 @@ namespace agg //-------------------------------------------------------------------- span_image_filter_rgba_bilinear(alloc_type& alloc, - const rendering_buffer& src, + const rendering_buffer& src, const color_type& back_color, interpolator_type& inter) : - base_type(alloc, src, back_color, inter, 0) + base_type(alloc, src, back_color, inter, 0) {} //-------------------------------------------------------------------- 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]; @@ -195,11 +195,11 @@ namespace agg unsigned weight; if(x_lr >= 0 && y_lr >= 0 && - x_lr < maxx && y_lr < maxy) + x_lr < maxx && y_lr < maxy) { - 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; @@ -207,7 +207,7 @@ namespace agg fg_ptr = (const value_type*)base_type::source_image().row(y_lr) + (x_lr << 2); - weight = (image_subpixel_size - x_hr) * + weight = (image_subpixel_size - x_hr) * (image_subpixel_size - y_hr); fg[0] += weight * *fg_ptr++; fg[1] += weight * *fg_ptr++; @@ -251,15 +251,15 @@ namespace agg } else { - 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; y_hr &= image_subpixel_mask; - weight = (image_subpixel_size - x_hr) * + weight = (image_subpixel_size - x_hr) * (image_subpixel_size - y_hr); if(x_lr >= 0 && y_lr >= 0 && x_lr <= maxx && y_lr <= maxy) @@ -367,10 +367,10 @@ namespace agg //=======================================span_image_filter_rgba_2x2 template<class ColorT, - class Order, + class Order, class Interpolator, - class Allocator = span_allocator<ColorT> > - class span_image_filter_rgba_2x2 : + class Allocator = span_allocator<ColorT> > + class span_image_filter_rgba_2x2 : public span_image_filter<ColorT, Interpolator, Allocator> { public: @@ -392,18 +392,18 @@ namespace agg //-------------------------------------------------------------------- span_image_filter_rgba_2x2(alloc_type& alloc, - const rendering_buffer& src, + const rendering_buffer& src, const color_type& back_color, interpolator_type& inter, const image_filter_lut& filter) : - base_type(alloc, src, back_color, inter, &filter) + base_type(alloc, src, back_color, inter, &filter) {} //-------------------------------------------------------------------- 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]; @@ -415,8 +415,8 @@ namespace agg 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); int maxx = base_type::source_image().width() - 1; @@ -439,25 +439,25 @@ namespace agg fg[0] = fg[1] = fg[2] = fg[3] = image_filter_size / 2; if(x_lr >= 0 && y_lr >= 0 && - x_lr < maxx && y_lr < maxy) + x_lr < maxx && y_lr < maxy) { x_hr &= image_subpixel_mask; y_hr &= image_subpixel_mask; fg_ptr = (const value_type*)base_type::source_image().row(y_lr) + (x_lr << 2); - 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++; fg[1] += weight * *fg_ptr++; fg[2] += weight * *fg_ptr++; fg[3] += weight * *fg_ptr++; - 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++; fg[1] += weight * *fg_ptr++; @@ -466,18 +466,18 @@ namespace agg fg_ptr = (const value_type*)base_type::source_image().next_row(fg_ptr - 8); - 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++; fg[1] += weight * *fg_ptr++; fg[2] += weight * *fg_ptr++; fg[3] += weight * *fg_ptr++; - 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++; fg[1] += weight * *fg_ptr++; @@ -509,9 +509,9 @@ namespace agg x_hr &= image_subpixel_mask; y_hr &= image_subpixel_mask; - 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; if(x_lr >= 0 && y_lr >= 0 && x_lr <= maxx && y_lr <= maxy) @@ -532,9 +532,9 @@ namespace agg x_lr++; - 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; if(x_lr >= 0 && y_lr >= 0 && x_lr <= maxx && y_lr <= maxy) @@ -556,9 +556,9 @@ namespace agg x_lr--; y_lr++; - 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; if(x_lr >= 0 && y_lr >= 0 && x_lr <= maxx && y_lr <= maxy) @@ -579,9 +579,9 @@ namespace agg x_lr++; - 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; if(x_lr >= 0 && y_lr >= 0 && x_lr <= maxx && y_lr <= maxy) @@ -639,10 +639,10 @@ namespace agg //================================================span_image_filter_rgba template<class ColorT, - class Order, + class Order, class Interpolator, - class Allocator = span_allocator<ColorT> > - class span_image_filter_rgba : + class Allocator = span_allocator<ColorT> > + class span_image_filter_rgba : public span_image_filter<ColorT, Interpolator, Allocator> { public: @@ -664,17 +664,17 @@ namespace agg //-------------------------------------------------------------------- span_image_filter_rgba(alloc_type& alloc, - const rendering_buffer& src, + const rendering_buffer& src, const color_type& back_color, interpolator_type& inter, const image_filter_lut& filter) : - base_type(alloc, src, back_color, inter, &filter) + base_type(alloc, src, back_color, inter, &filter) {} //-------------------------------------------------------------------- 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]; @@ -700,7 +700,7 @@ namespace agg int maxx2 = base_type::source_image().width() - start - 1; int maxy2 = base_type::source_image().height() - start - 1; - int x_count; + int x_count; int weight_y; do @@ -710,8 +710,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_lr = x_hr >> image_subpixel_shift; int y_lr = y_hr >> image_subpixel_shift; @@ -722,7 +722,7 @@ namespace agg unsigned y_count = diameter; if(x_lr >= -start && y_lr >= -start && - x_lr <= maxx && y_lr <= maxy) + x_lr <= maxx && y_lr <= maxy) { y_hr = image_subpixel_mask - (y_hr & image_subpixel_mask); fg_ptr = (const value_type*)base_type::source_image().row(y_lr + start) + ((x_lr + start) << 2); @@ -734,10 +734,10 @@ namespace agg do { - 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++ * weight; fg[1] += *fg_ptr++ * weight; fg[2] += *fg_ptr++ * weight; @@ -770,7 +770,7 @@ namespace agg else { if(x_lr < start1 || y_lr < start1 || - x_lr > maxx2 || y_lr > maxy2) + x_lr > maxx2 || y_lr > maxy2) { fg[order_type::R] = back_r; fg[order_type::G] = back_g; @@ -791,12 +791,12 @@ namespace agg do { - 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; - if(x_lr >= 0 && y_lr >= 0 && - x_lr < int(base_type::source_image().width()) && + if(x_lr >= 0 && y_lr >= 0 && + x_lr < int(base_type::source_image().width()) && y_lr < int(base_type::source_image().height())) { fg_ptr = (const value_type*)base_type::source_image().row(y_lr) + (x_lr << 2); diff --git a/agg/inc/agg_span_image_resample.h b/agg/inc/agg_span_image_resample.h index f4dfd57455d7..f0112641e04c 100755 --- a/agg/inc/agg_span_image_resample.h +++ b/agg/inc/agg_span_image_resample.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. // @@ -24,8 +24,8 @@ namespace agg //=====================================================span_image_resample - template<class ColorT, class Interpolator, class Allocator> - class span_image_resample : + template<class ColorT, class Interpolator, class Allocator> + class span_image_resample : public span_image_filter<ColorT, Interpolator, Allocator> { public: @@ -35,7 +35,7 @@ namespace agg typedef span_image_filter<color_type, interpolator_type, alloc_type> base_type; //-------------------------------------------------------------------- - span_image_resample(alloc_type& alloc) : + span_image_resample(alloc_type& alloc) : base_type(alloc), m_scale_limit(20), m_blur_x(image_subpixel_size), @@ -44,7 +44,7 @@ namespace agg //-------------------------------------------------------------------- span_image_resample(alloc_type& alloc, - const rendering_buffer& src, + const rendering_buffer& src, const color_type& back_color, interpolator_type& inter, const image_filter_lut& filter) : @@ -64,7 +64,7 @@ namespace agg double blur_y() const { return double(m_blur_y) / double(image_subpixel_size); } void blur_x(double v) { m_blur_x = int(v * double(image_subpixel_size) + 0.5); } void blur_y(double v) { m_blur_y = int(v * double(image_subpixel_size) + 0.5); } - void blur(double v) { m_blur_x = + void blur(double v) { m_blur_x = m_blur_y = int(v * double(image_subpixel_size) + 0.5); } protected: @@ -81,8 +81,8 @@ namespace agg //==============================================span_image_resample_affine - template<class ColorT, class Allocator> - class span_image_resample_affine : + template<class ColorT, class Allocator> + class span_image_resample_affine : public span_image_filter<ColorT, span_interpolator_linear<trans_affine>, Allocator> { public: @@ -92,7 +92,7 @@ namespace agg typedef span_image_filter<color_type, interpolator_type, alloc_type> base_type; //-------------------------------------------------------------------- - span_image_resample_affine(alloc_type& alloc) : + span_image_resample_affine(alloc_type& alloc) : base_type(alloc), m_scale_limit(200.0), m_blur_x(1.0), @@ -101,7 +101,7 @@ namespace agg //-------------------------------------------------------------------- span_image_resample_affine(alloc_type& alloc, - const rendering_buffer& src, + const rendering_buffer& src, const color_type& back_color, interpolator_type& inter, const image_filter_lut& filter_) : @@ -125,7 +125,7 @@ namespace agg //-------------------------------------------------------------------- - void prepare(unsigned max_span_len) + void prepare(unsigned max_span_len) { base_type::prepare(max_span_len); diff --git a/agg/inc/agg_span_image_resample_gray.h b/agg/inc/agg_span_image_resample_gray.h index 3d046462cd8c..ac660a440993 100755 --- a/agg/inc/agg_span_image_resample_gray.h +++ b/agg/inc/agg_span_image_resample_gray.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. // @@ -24,8 +24,8 @@ namespace agg //========================================span_image_resample_gray_affine template<class ColorT, - class Allocator = span_allocator<ColorT> > - class span_image_resample_gray_affine : + class Allocator = span_allocator<ColorT> > + class span_image_resample_gray_affine : public span_image_resample_affine<ColorT, Allocator> { public: @@ -47,18 +47,18 @@ namespace agg //-------------------------------------------------------------------- span_image_resample_gray_affine(alloc_type& alloc, - const rendering_buffer& src, + const rendering_buffer& src, const color_type& back_color, interpolator_type& inter, const image_filter_lut& filter) : - base_type(alloc, src, back_color, inter, filter) + base_type(alloc, src, back_color, inter, filter) {} //-------------------------------------------------------------------- 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); long_type fg; @@ -87,13 +87,13 @@ namespace agg fg = src_alpha = image_filter_size / 2; int y_lr = y >> image_subpixel_shift; - int y_hr = ((image_subpixel_mask - (y & image_subpixel_mask)) * - base_type::m_ry_inv) >> + int y_hr = ((image_subpixel_mask - (y & image_subpixel_mask)) * + base_type::m_ry_inv) >> image_subpixel_shift; int total_weight = 0; int x_lr_ini = x >> image_subpixel_shift; - int x_hr_ini = ((image_subpixel_mask - (x & image_subpixel_mask)) * - base_type::m_rx_inv) >> + int x_hr_ini = ((image_subpixel_mask - (x & image_subpixel_mask)) * + base_type::m_rx_inv) >> image_subpixel_shift; do { @@ -106,8 +106,8 @@ namespace agg base_type::source_image().row(y_lr) + x_lr; do { - int weight = (weight_y * weight_array[x_hr] + - image_filter_size / 2) >> + int weight = (weight_y * weight_array[x_hr] + + image_filter_size / 2) >> downscale_shift; if(x_lr >= 0 && x_lr <= maxx) @@ -131,8 +131,8 @@ namespace agg { do { - int weight = (weight_y * weight_array[x_hr] + - image_filter_size / 2) >> + int weight = (weight_y * weight_array[x_hr] + + image_filter_size / 2) >> downscale_shift; total_weight += weight; @@ -174,9 +174,9 @@ namespace agg //==============================================span_image_resample_gray template<class ColorT, - class Interpolator, + class Interpolator, class Allocator = span_allocator<ColorT> > - class span_image_resample_gray : + class span_image_resample_gray : public span_image_resample<ColorT, Interpolator, Allocator> { public: @@ -194,13 +194,13 @@ namespace agg }; //-------------------------------------------------------------------- - span_image_resample_gray(alloc_type& alloc) : + span_image_resample_gray(alloc_type& alloc) : base_type(alloc) {} //-------------------------------------------------------------------- span_image_resample_gray(alloc_type& alloc, - const rendering_buffer& src, + const rendering_buffer& src, const color_type& back_color, interpolator_type& inter, const image_filter_lut& filter) : @@ -211,7 +211,7 @@ namespace agg color_type* generate(int x, int y, unsigned len) { color_type* span = base_type::allocator().span(); - 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); long_type fg; long_type src_alpha; @@ -241,7 +241,7 @@ namespace agg } else { - if(rx > image_subpixel_size * base_type::m_scale_limit) + if(rx > image_subpixel_size * base_type::m_scale_limit) { rx = image_subpixel_size * base_type::m_scale_limit; } @@ -254,7 +254,7 @@ namespace agg } else { - if(ry > image_subpixel_size * base_type::m_scale_limit) + if(ry > image_subpixel_size * base_type::m_scale_limit) { ry = image_subpixel_size * base_type::m_scale_limit; } @@ -272,13 +272,13 @@ namespace agg fg = src_alpha = image_filter_size / 2; int y_lr = y >> image_subpixel_shift; - int y_hr = ((image_subpixel_mask - (y & image_subpixel_mask)) * - ry_inv) >> + int y_hr = ((image_subpixel_mask - (y & image_subpixel_mask)) * + ry_inv) >> image_subpixel_shift; int total_weight = 0; int x_lr_ini = x >> image_subpixel_shift; - int x_hr_ini = ((image_subpixel_mask - (x & image_subpixel_mask)) * - rx_inv) >> + int x_hr_ini = ((image_subpixel_mask - (x & image_subpixel_mask)) * + rx_inv) >> image_subpixel_shift; do @@ -292,8 +292,8 @@ namespace agg base_type::source_image().row(y_lr) + x_lr; do { - int weight = (weight_y * weight_array[x_hr] + - image_filter_size / 2) >> + int weight = (weight_y * weight_array[x_hr] + + image_filter_size / 2) >> downscale_shift; if(x_lr >= 0 && x_lr <= maxx) @@ -317,8 +317,8 @@ namespace agg { do { - int weight = (weight_y * weight_array[x_hr] + - image_filter_size / 2) >> + int weight = (weight_y * weight_array[x_hr] + + image_filter_size / 2) >> downscale_shift; total_weight += weight; @@ -350,7 +350,7 @@ namespace agg } while(--len); return base_type::allocator().span(); } - + }; } diff --git a/agg/inc/agg_span_image_resample_rgb.h b/agg/inc/agg_span_image_resample_rgb.h index de25dd4b382b..aff4f622b486 100755 --- a/agg/inc/agg_span_image_resample_rgb.h +++ b/agg/inc/agg_span_image_resample_rgb.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. // @@ -24,9 +24,9 @@ namespace agg //=========================================span_image_resample_rgb_affine template<class ColorT, - class Order, - class Allocator = span_allocator<ColorT> > - class span_image_resample_rgb_affine : + class Order, + class Allocator = span_allocator<ColorT> > + class span_image_resample_rgb_affine : public span_image_resample_affine<ColorT, Allocator> { public: @@ -49,18 +49,18 @@ namespace agg //-------------------------------------------------------------------- span_image_resample_rgb_affine(alloc_type& alloc, - const rendering_buffer& src, + const rendering_buffer& src, const color_type& back_color, interpolator_type& inter, const image_filter_lut& filter) : - base_type(alloc, src, back_color, inter, filter) + base_type(alloc, src, back_color, inter, filter) {} //-------------------------------------------------------------------- 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); long_type fg[4]; @@ -90,13 +90,13 @@ namespace agg fg[0] = fg[1] = fg[2] = fg[3] = image_filter_size / 2; int y_lr = y >> image_subpixel_shift; - int y_hr = ((image_subpixel_mask - (y & image_subpixel_mask)) * - base_type::m_ry_inv) >> + int y_hr = ((image_subpixel_mask - (y & image_subpixel_mask)) * + base_type::m_ry_inv) >> image_subpixel_shift; int total_weight = 0; int x_lr_ini = x >> image_subpixel_shift; - int x_hr_ini = ((image_subpixel_mask - (x & image_subpixel_mask)) * - base_type::m_rx_inv) >> + int x_hr_ini = ((image_subpixel_mask - (x & image_subpixel_mask)) * + base_type::m_rx_inv) >> image_subpixel_shift; do { @@ -109,8 +109,8 @@ namespace agg base_type::source_image().row(y_lr) + x_lr * 3; do { - int weight = (weight_y * weight_array[x_hr] + - image_filter_size / 2) >> + int weight = (weight_y * weight_array[x_hr] + + image_filter_size / 2) >> downscale_shift; if(x_lr >= 0 && x_lr <= maxx) @@ -138,8 +138,8 @@ namespace agg { do { - int weight = (weight_y * weight_array[x_hr] + - image_filter_size / 2) >> + int weight = (weight_y * weight_array[x_hr] + + image_filter_size / 2) >> downscale_shift; total_weight += weight; @@ -191,10 +191,10 @@ namespace agg //===============================================span_image_resample_rgb template<class ColorT, - class Order, - class Interpolator, + class Order, + class Interpolator, class Allocator = span_allocator<ColorT> > - class span_image_resample_rgb : + class span_image_resample_rgb : public span_image_resample<ColorT, Interpolator, Allocator> { public: @@ -213,13 +213,13 @@ namespace agg }; //-------------------------------------------------------------------- - span_image_resample_rgb(alloc_type& alloc) : + span_image_resample_rgb(alloc_type& alloc) : base_type(alloc) {} //-------------------------------------------------------------------- span_image_resample_rgb(alloc_type& alloc, - const rendering_buffer& src, + const rendering_buffer& src, const color_type& back_color, interpolator_type& inter, const image_filter_lut& filter) : @@ -230,7 +230,7 @@ namespace agg color_type* generate(int x, int y, unsigned len) { color_type* span = base_type::allocator().span(); - 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); long_type fg[4]; value_type back_r = base_type::background_color().r; @@ -261,7 +261,7 @@ namespace agg } else { - if(rx > image_subpixel_size * base_type::m_scale_limit) + if(rx > image_subpixel_size * base_type::m_scale_limit) { rx = image_subpixel_size * base_type::m_scale_limit; } @@ -274,7 +274,7 @@ namespace agg } else { - if(ry > image_subpixel_size * base_type::m_scale_limit) + if(ry > image_subpixel_size * base_type::m_scale_limit) { ry = image_subpixel_size * base_type::m_scale_limit; } @@ -292,13 +292,13 @@ namespace agg fg[0] = fg[1] = fg[2] = fg[3] = image_filter_size / 2; int y_lr = y >> image_subpixel_shift; - int y_hr = ((image_subpixel_mask - (y & image_subpixel_mask)) * - ry_inv) >> + int y_hr = ((image_subpixel_mask - (y & image_subpixel_mask)) * + ry_inv) >> image_subpixel_shift; int total_weight = 0; int x_lr_ini = x >> image_subpixel_shift; - int x_hr_ini = ((image_subpixel_mask - (x & image_subpixel_mask)) * - rx_inv) >> + int x_hr_ini = ((image_subpixel_mask - (x & image_subpixel_mask)) * + rx_inv) >> image_subpixel_shift; do @@ -312,8 +312,8 @@ namespace agg base_type::source_image().row(y_lr) + x_lr * 3; do { - int weight = (weight_y * weight_array[x_hr] + - image_filter_size / 2) >> + int weight = (weight_y * weight_array[x_hr] + + image_filter_size / 2) >> downscale_shift; if(x_lr >= 0 && x_lr <= maxx) @@ -341,8 +341,8 @@ namespace agg { do { - int weight = (weight_y * weight_array[x_hr] + - image_filter_size / 2) >> + int weight = (weight_y * weight_array[x_hr] + + image_filter_size / 2) >> downscale_shift; total_weight += weight; @@ -384,7 +384,7 @@ namespace agg } while(--len); return base_type::allocator().span(); } - + }; } diff --git a/agg/inc/agg_span_image_resample_rgba.h b/agg/inc/agg_span_image_resample_rgba.h index 40f7ccb42e00..b1e02dda87d0 100755 --- a/agg/inc/agg_span_image_resample_rgba.h +++ b/agg/inc/agg_span_image_resample_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. // @@ -24,9 +24,9 @@ namespace agg //========================================span_image_resample_rgba_affine template<class ColorT, - class Order, - class Allocator = span_allocator<ColorT> > - class span_image_resample_rgba_affine : + class Order, + class Allocator = span_allocator<ColorT> > + class span_image_resample_rgba_affine : public span_image_resample_affine<ColorT, Allocator> { public: @@ -49,18 +49,18 @@ namespace agg //-------------------------------------------------------------------- span_image_resample_rgba_affine(alloc_type& alloc, - const rendering_buffer& src, + const rendering_buffer& src, const color_type& back_color, interpolator_type& inter, const image_filter_lut& filter) : - base_type(alloc, src, back_color, inter, filter) + base_type(alloc, src, back_color, inter, filter) {} //-------------------------------------------------------------------- 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); long_type fg[4]; @@ -90,13 +90,13 @@ namespace agg fg[0] = fg[1] = fg[2] = fg[3] = image_filter_size / 2; int y_lr = y >> image_subpixel_shift; - int y_hr = ((image_subpixel_mask - (y & image_subpixel_mask)) * - base_type::m_ry_inv) >> + int y_hr = ((image_subpixel_mask - (y & image_subpixel_mask)) * + base_type::m_ry_inv) >> image_subpixel_shift; int total_weight = 0; int x_lr_ini = x >> image_subpixel_shift; - int x_hr_ini = ((image_subpixel_mask - (x & image_subpixel_mask)) * - base_type::m_rx_inv) >> + int x_hr_ini = ((image_subpixel_mask - (x & image_subpixel_mask)) * + base_type::m_rx_inv) >> image_subpixel_shift; do { @@ -109,8 +109,8 @@ namespace agg base_type::source_image().row(y_lr) + (x_lr << 2); do { - int weight = (weight_y * weight_array[x_hr] + - image_filter_size / 2) >> + int weight = (weight_y * weight_array[x_hr] + + image_filter_size / 2) >> downscale_shift; if(x_lr >= 0 && x_lr <= maxx) @@ -138,8 +138,8 @@ namespace agg { do { - int weight = (weight_y * weight_array[x_hr] + - image_filter_size / 2) >> + int weight = (weight_y * weight_array[x_hr] + + image_filter_size / 2) >> downscale_shift; total_weight += weight; @@ -191,10 +191,10 @@ namespace agg //==============================================span_image_resample_rgba template<class ColorT, - class Order, - class Interpolator, + class Order, + class Interpolator, class Allocator = span_allocator<ColorT> > - class span_image_resample_rgba : + class span_image_resample_rgba : public span_image_resample<ColorT, Interpolator, Allocator> { public: @@ -213,13 +213,13 @@ namespace agg }; //-------------------------------------------------------------------- - span_image_resample_rgba(alloc_type& alloc) : + span_image_resample_rgba(alloc_type& alloc) : base_type(alloc) {} //-------------------------------------------------------------------- span_image_resample_rgba(alloc_type& alloc, - const rendering_buffer& src, + const rendering_buffer& src, const color_type& back_color, interpolator_type& inter, const image_filter_lut& filter) : @@ -230,7 +230,7 @@ namespace agg color_type* generate(int x, int y, unsigned len) { color_type* span = base_type::allocator().span(); - 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); long_type fg[4]; value_type back_r = base_type::background_color().r; @@ -261,7 +261,7 @@ namespace agg } else { - if(rx > image_subpixel_size * base_type::m_scale_limit) + if(rx > image_subpixel_size * base_type::m_scale_limit) { rx = image_subpixel_size * base_type::m_scale_limit; } @@ -274,7 +274,7 @@ namespace agg } else { - if(ry > image_subpixel_size * base_type::m_scale_limit) + if(ry > image_subpixel_size * base_type::m_scale_limit) { ry = image_subpixel_size * base_type::m_scale_limit; } @@ -292,13 +292,13 @@ namespace agg fg[0] = fg[1] = fg[2] = fg[3] = image_filter_size / 2; int y_lr = y >> image_subpixel_shift; - int y_hr = ((image_subpixel_mask - (y & image_subpixel_mask)) * - ry_inv) >> + int y_hr = ((image_subpixel_mask - (y & image_subpixel_mask)) * + ry_inv) >> image_subpixel_shift; int total_weight = 0; int x_lr_ini = x >> image_subpixel_shift; - int x_hr_ini = ((image_subpixel_mask - (x & image_subpixel_mask)) * - rx_inv) >> + int x_hr_ini = ((image_subpixel_mask - (x & image_subpixel_mask)) * + rx_inv) >> image_subpixel_shift; do @@ -312,8 +312,8 @@ namespace agg base_type::source_image().row(y_lr) + (x_lr << 2); do { - int weight = (weight_y * weight_array[x_hr] + - image_filter_size / 2) >> + int weight = (weight_y * weight_array[x_hr] + + image_filter_size / 2) >> downscale_shift; if(x_lr >= 0 && x_lr <= maxx) @@ -341,8 +341,8 @@ namespace agg { do { - int weight = (weight_y * weight_array[x_hr] + - image_filter_size / 2) >> + int weight = (weight_y * weight_array[x_hr] + + image_filter_size / 2) >> downscale_shift; total_weight += weight; @@ -384,7 +384,7 @@ namespace agg } while(--len); return base_type::allocator().span(); } - + }; } diff --git a/agg/inc/agg_span_interpolator_adaptor.h b/agg/inc/agg_span_interpolator_adaptor.h index ead42c13590c..5763d4a10e84 100755 --- a/agg/inc/agg_span_interpolator_adaptor.h +++ b/agg/inc/agg_span_interpolator_adaptor.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. // @@ -32,11 +32,11 @@ namespace agg //-------------------------------------------------------------------- span_interpolator_adaptor() {} - span_interpolator_adaptor(const trans_type& trans, + span_interpolator_adaptor(const trans_type& trans, const distortion_type& dist) : base_type(trans), m_distortion(&dist) - { + { } //-------------------------------------------------------------------- diff --git a/agg/inc/agg_span_interpolator_linear.h b/agg/inc/agg_span_interpolator_linear.h index 3cc2426be450..2c343db132cd 100755 --- a/agg/inc/agg_span_interpolator_linear.h +++ b/agg/inc/agg_span_interpolator_linear.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. // @@ -24,7 +24,7 @@ namespace agg { //================================================span_interpolator_linear - template<class Transformer = trans_affine, unsigned SubpixelShift = 8> + template<class Transformer = trans_affine, unsigned SubpixelShift = 8> class span_interpolator_linear { public: @@ -79,7 +79,7 @@ namespace agg m_li_x = dda2_line_interpolator(m_li_x.y(), int(xe * subpixel_size), len); m_li_y = dda2_line_interpolator(m_li_y.y(), int(ye * subpixel_size), len); } - + //---------------------------------------------------------------- void operator++() { @@ -106,7 +106,7 @@ namespace agg //=====================================span_interpolator_linear_subdiv - template<class Transformer = trans_affine, unsigned SubpixelShift = 8> + template<class Transformer = trans_affine, unsigned SubpixelShift = 8> class span_interpolator_linear_subdiv { public: @@ -125,8 +125,8 @@ namespace agg m_subdiv_size(1 << m_subdiv_shift), m_subdiv_mask(m_subdiv_size - 1) {} - span_interpolator_linear_subdiv(const trans_type& trans, - unsigned subdiv_shift = 4) : + span_interpolator_linear_subdiv(const trans_type& trans, + unsigned subdiv_shift = 4) : m_subdiv_shift(subdiv_shift), m_subdiv_size(1 << m_subdiv_shift), m_subdiv_mask(m_subdiv_size - 1), @@ -149,7 +149,7 @@ namespace agg //---------------------------------------------------------------- unsigned subdiv_shift() const { return m_subdiv_shift; } - void subdiv_shift(unsigned shift) + void subdiv_shift(unsigned shift) { m_subdiv_shift = shift; m_subdiv_size = 1 << m_subdiv_shift; diff --git a/agg/inc/agg_span_interpolator_persp.h b/agg/inc/agg_span_interpolator_persp.h index 632a56449f28..0c01c2e30e09 100755 --- a/agg/inc/agg_span_interpolator_persp.h +++ b/agg/inc/agg_span_interpolator_persp.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. // @@ -24,7 +24,7 @@ namespace agg //===========================================span_interpolator_persp_exact - template<unsigned SubpixelShift = 8> + template<unsigned SubpixelShift = 8> class span_interpolator_persp_exact { public: @@ -41,24 +41,24 @@ namespace agg //-------------------------------------------------------------------- // Arbitrary quadrangle transformations - span_interpolator_persp_exact(const double* src, const double* dst) + span_interpolator_persp_exact(const double* src, const double* dst) { quad_to_quad(src, dst); } //-------------------------------------------------------------------- - // Direct transformations - span_interpolator_persp_exact(double x1, double y1, - double x2, double y2, + // Direct transformations + span_interpolator_persp_exact(double x1, double y1, + double x2, double y2, const double* quad) { rect_to_quad(x1, y1, x2, y2, quad); } //-------------------------------------------------------------------- - // Reverse transformations - span_interpolator_persp_exact(const double* quad, - double x1, double y1, + // Reverse transformations + span_interpolator_persp_exact(const double* quad, + double x1, double y1, double x2, double y2) { quad_to_rect(quad, x1, y1, x2, y2); @@ -74,7 +74,7 @@ namespace agg //-------------------------------------------------------------------- // Set the direct transformations, i.e., rectangle -> quadrangle - void rect_to_quad(double x1, double y1, double x2, double y2, + void rect_to_quad(double x1, double y1, double x2, double y2, const double* quad) { double src[8]; @@ -88,7 +88,7 @@ namespace agg //-------------------------------------------------------------------- // Set the reverse transformations, i.e., quadrangle -> rectangle - void quad_to_rect(const double* quad, + void quad_to_rect(const double* quad, double x1, double y1, double x2, double y2) { double dst[8]; @@ -152,11 +152,11 @@ namespace agg //---------------------------------------------------------------- void resynchronize(double xe, double ye, unsigned len) { - // Assume x1,y1 are equal to the ones at the previous end point + // Assume x1,y1 are equal to the ones at the previous end point int sx1 = m_scale_x.y(); int sy1 = m_scale_y.y(); - // Calculate transformed coordinates at x2,y2 + // Calculate transformed coordinates at x2,y2 double xt = xe; double yt = ye; m_trans_dir.transform(&xt, &yt); @@ -215,7 +215,7 @@ namespace agg { m_trans_dir.transform(x, y); } - + private: trans_type m_trans_dir; trans_type m_trans_inv; @@ -235,7 +235,7 @@ namespace agg //============================================span_interpolator_persp_lerp - template<unsigned SubpixelShift = 8> + template<unsigned SubpixelShift = 8> class span_interpolator_persp_lerp { public: @@ -251,24 +251,24 @@ namespace agg //-------------------------------------------------------------------- // Arbitrary quadrangle transformations - span_interpolator_persp_lerp(const double* src, const double* dst) + span_interpolator_persp_lerp(const double* src, const double* dst) { quad_to_quad(src, dst); } //-------------------------------------------------------------------- - // Direct transformations - span_interpolator_persp_lerp(double x1, double y1, - double x2, double y2, + // Direct transformations + span_interpolator_persp_lerp(double x1, double y1, + double x2, double y2, const double* quad) { rect_to_quad(x1, y1, x2, y2, quad); } //-------------------------------------------------------------------- - // Reverse transformations - span_interpolator_persp_lerp(const double* quad, - double x1, double y1, + // Reverse transformations + span_interpolator_persp_lerp(const double* quad, + double x1, double y1, double x2, double y2) { quad_to_rect(quad, x1, y1, x2, y2); @@ -284,7 +284,7 @@ namespace agg //-------------------------------------------------------------------- // Set the direct transformations, i.e., rectangle -> quadrangle - void rect_to_quad(double x1, double y1, double x2, double y2, + void rect_to_quad(double x1, double y1, double x2, double y2, const double* quad) { double src[8]; @@ -298,7 +298,7 @@ namespace agg //-------------------------------------------------------------------- // Set the reverse transformations, i.e., quadrangle -> rectangle - void quad_to_rect(const double* quad, + void quad_to_rect(const double* quad, double x1, double y1, double x2, double y2) { double dst[8]; @@ -316,7 +316,7 @@ namespace agg //---------------------------------------------------------------- void begin(double x, double y, unsigned len) { - // Calculate transformed coordinates at x1,y1 + // Calculate transformed coordinates at x1,y1 double xt = x; double yt = y; m_trans_dir.transform(&xt, &yt); @@ -343,7 +343,7 @@ namespace agg dy -= y; int sy1 = int(subpixel_size/sqrt(dx*dx + dy*dy)) >> subpixel_shift; - // Calculate transformed coordinates at x2,y2 + // Calculate transformed coordinates at x2,y2 x += len; xt = x; yt = y; @@ -378,13 +378,13 @@ namespace agg //---------------------------------------------------------------- void resynchronize(double xe, double ye, unsigned len) { - // Assume x1,y1 are equal to the ones at the previous end point + // Assume x1,y1 are equal to the ones at the previous end point int x1 = m_coord_x.y(); int y1 = m_coord_y.y(); int sx1 = m_scale_x.y(); int sy1 = m_scale_y.y(); - // Calculate transformed coordinates at x2,y2 + // Calculate transformed coordinates at x2,y2 double xt = xe; double yt = ye; m_trans_dir.transform(&xt, &yt); @@ -447,7 +447,7 @@ namespace agg { m_trans_dir.transform(x, y); } - + private: trans_type m_trans_dir; trans_type m_trans_inv; diff --git a/agg/inc/agg_span_interpolator_trans.h b/agg/inc/agg_span_interpolator_trans.h index 5caaffe9e5c0..916ba92232bf 100755 --- a/agg/inc/agg_span_interpolator_trans.h +++ b/agg/inc/agg_span_interpolator_trans.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. // @@ -26,7 +26,7 @@ namespace agg { //=================================================span_interpolator_trans - template<class Transformer, unsigned SubpixelShift = 8> + template<class Transformer, unsigned SubpixelShift = 8> class span_interpolator_trans { public: diff --git a/agg/inc/agg_span_pattern.h b/agg/inc/agg_span_pattern.h index b9e9b135ff84..0ad8025f2e70 100755 --- a/agg/inc/agg_span_pattern.h +++ b/agg/inc/agg_span_pattern.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. -// +// //---------------------------------------------------------------------------- @@ -34,7 +34,7 @@ namespace agg { //---------------------------------------------------span_pattern_base - template<class ColorT, class Allocator> + template<class ColorT, class Allocator> class span_pattern_base : public span_generator<ColorT, Allocator> { public: @@ -44,14 +44,14 @@ namespace agg enum { base_mask = color_type::base_mask }; //---------------------------------------------------------------- - span_pattern_base(alloc_type& alloc) : - span_generator<color_type, alloc_type>(alloc) + span_pattern_base(alloc_type& alloc) : + span_generator<color_type, alloc_type>(alloc) {} //---------------------------------------------------------------- span_pattern_base(alloc_type& alloc, - const rendering_buffer& src, - unsigned offset_x, unsigned offset_y, + const rendering_buffer& src, + unsigned offset_x, unsigned offset_y, double alpha) : span_generator<color_type, alloc_type>(alloc), m_src(&src), @@ -86,15 +86,15 @@ namespace agg class wrap_mode_repeat { public: - wrap_mode_repeat(unsigned size) : - m_size(size), + wrap_mode_repeat(unsigned size) : + m_size(size), m_add(size * (0x3FFFFFFF / size)), m_value(0) {} AGG_INLINE unsigned operator() (int v) - { - return m_value = (unsigned(v) + m_add) % m_size; + { + return m_value = (unsigned(v) + m_add) % m_size; } AGG_INLINE unsigned operator++ () @@ -121,7 +121,7 @@ namespace agg m_mask >>= 1; } AGG_INLINE unsigned operator() (int v) - { + { return m_value = unsigned(v) & m_mask; } AGG_INLINE unsigned operator++ () @@ -147,8 +147,8 @@ namespace agg m_value(0) {} - AGG_INLINE unsigned operator() (int v) - { + AGG_INLINE unsigned operator() (int v) + { if(m_mask) return m_value = unsigned(v) & m_mask; return m_value = (unsigned(v) + m_add) % m_size; } @@ -171,15 +171,15 @@ namespace agg class wrap_mode_reflect { public: - wrap_mode_reflect(unsigned size) : - m_size(size), + wrap_mode_reflect(unsigned size) : + m_size(size), m_size2(size * 2), m_add(m_size2 * (0x3FFFFFFF / m_size2)), m_value(0) {} AGG_INLINE unsigned operator() (int v) - { + { m_value = (unsigned(v) + m_add) % m_size2; if(m_value >= m_size) return m_size2 - m_value - 1; return m_value; @@ -209,14 +209,14 @@ namespace agg { m_mask = 1; m_size = 1; - while(m_mask < size) + while(m_mask < size) { m_mask = (m_mask << 1) | 1; m_size <<= 1; } } AGG_INLINE unsigned operator() (int v) - { + { m_value = unsigned(v) & m_mask; if(m_value >= m_size) return m_mask - m_value; return m_value; @@ -248,12 +248,12 @@ namespace agg m_value(0) {} - AGG_INLINE unsigned operator() (int v) - { - m_value = m_mask ? unsigned(v) & m_mask : + AGG_INLINE unsigned operator() (int v) + { + m_value = m_mask ? unsigned(v) & m_mask : (unsigned(v) + m_add) % m_size2; if(m_value >= m_size) return m_size2 - m_value - 1; - return m_value; + return m_value; } AGG_INLINE unsigned operator++ () { diff --git a/agg/inc/agg_span_pattern_filter_gray.h b/agg/inc/agg_span_pattern_filter_gray.h index 17a7984be7fe..13a6553212db 100755 --- a/agg/inc/agg_span_pattern_filter_gray.h +++ b/agg/inc/agg_span_pattern_filter_gray.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. // @@ -33,8 +33,8 @@ namespace agg class Interpolator, class WrapModeX, class WrapModeY, - class Allocator = span_allocator<ColorT> > - class span_pattern_filter_gray_nn : + class Allocator = span_allocator<ColorT> > + class span_pattern_filter_gray_nn : public span_image_filter<ColorT, Interpolator, Allocator> { public: @@ -51,7 +51,7 @@ namespace agg }; //-------------------------------------------------------------------- - span_pattern_filter_gray_nn(alloc_type& alloc) : + span_pattern_filter_gray_nn(alloc_type& alloc) : base_type(alloc), m_wrap_mode_x(1), m_wrap_mode_y(1) @@ -59,7 +59,7 @@ namespace agg //-------------------------------------------------------------------- span_pattern_filter_gray_nn(alloc_type& alloc, - const rendering_buffer& src, + const rendering_buffer& src, interpolator_type& inter) : base_type(alloc, src, color_type(0,0), inter, 0), m_wrap_mode_x(src.width()), @@ -67,8 +67,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()); @@ -77,7 +77,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); color_type* span = base_type::allocator().span(); do @@ -112,8 +112,8 @@ namespace agg class Interpolator, class WrapModeX, class WrapModeY, - class Allocator = span_allocator<ColorT> > - class span_pattern_filter_gray_bilinear : + class Allocator = span_allocator<ColorT> > + class span_pattern_filter_gray_bilinear : public span_image_filter<ColorT, Interpolator, Allocator> { public: @@ -130,7 +130,7 @@ namespace agg }; //-------------------------------------------------------------------- - span_pattern_filter_gray_bilinear(alloc_type& alloc) : + span_pattern_filter_gray_bilinear(alloc_type& alloc) : base_type(alloc), m_wrap_mode_x(1), m_wrap_mode_y(1) @@ -138,7 +138,7 @@ namespace agg //-------------------------------------------------------------------- span_pattern_filter_gray_bilinear(alloc_type& alloc, - const rendering_buffer& src, + const rendering_buffer& src, interpolator_type& inter) : base_type(alloc, src, color_type(0,0), inter, 0), m_wrap_mode_x(src.width()), @@ -146,8 +146,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()); @@ -156,7 +156,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; color_type* span = base_type::allocator().span(); @@ -218,8 +218,8 @@ namespace agg class Interpolator, class WrapModeX, class WrapModeY, - class Allocator = span_allocator<ColorT> > - class span_pattern_filter_gray_2x2 : + class Allocator = span_allocator<ColorT> > + class span_pattern_filter_gray_2x2 : public span_image_filter<ColorT, Interpolator, Allocator> { public: @@ -236,7 +236,7 @@ namespace agg }; //-------------------------------------------------------------------- - span_pattern_filter_gray_2x2(alloc_type& alloc) : + span_pattern_filter_gray_2x2(alloc_type& alloc) : base_type(alloc), m_wrap_mode_x(1), m_wrap_mode_y(1) @@ -244,7 +244,7 @@ namespace agg //-------------------------------------------------------------------- span_pattern_filter_gray_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), inter, &filter), @@ -253,8 +253,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()); @@ -263,12 +263,12 @@ 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; 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 { @@ -296,21 +296,21 @@ namespace agg x_hr &= image_subpixel_mask; y_hr &= image_subpixel_mask; - fg += ptr1[x1] * ((weight_array[x_hr + image_subpixel_size] * - weight_array[y_hr + image_subpixel_size] + - image_filter_size / 2) >> + fg += ptr1[x1] * ((weight_array[x_hr + image_subpixel_size] * + weight_array[y_hr + image_subpixel_size] + + image_filter_size / 2) >> image_filter_shift); - fg += ptr1[x2] * ((weight_array[x_hr] * - weight_array[y_hr + image_subpixel_size] + - image_filter_size / 2) >> + fg += ptr1[x2] * ((weight_array[x_hr] * + weight_array[y_hr + image_subpixel_size] + + image_filter_size / 2) >> image_filter_shift); - fg += ptr2[x1] * ((weight_array[x_hr + image_subpixel_size] * - weight_array[y_hr] + - image_filter_size / 2) >> + fg += ptr2[x1] * ((weight_array[x_hr + image_subpixel_size] * + weight_array[y_hr] + + image_filter_size / 2) >> image_filter_shift); - fg += ptr2[x2] * ((weight_array[x_hr] * - weight_array[y_hr] + - image_filter_size / 2) >> + fg += ptr2[x2] * ((weight_array[x_hr] * + weight_array[y_hr] + + image_filter_size / 2) >> image_filter_shift); fg >>= image_filter_shift; @@ -346,8 +346,8 @@ namespace agg class Interpolator, class WrapModeX, class WrapModeY, - class Allocator = span_allocator<ColorT> > - class span_pattern_filter_gray : + class Allocator = span_allocator<ColorT> > + class span_pattern_filter_gray : public span_image_filter<ColorT, Interpolator, Allocator> { public: @@ -364,13 +364,13 @@ namespace agg }; //-------------------------------------------------------------------- - span_pattern_filter_gray(alloc_type& alloc) : + span_pattern_filter_gray(alloc_type& alloc) : base_type(alloc) {} //-------------------------------------------------------------------- span_pattern_filter_gray(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), inter, &filter), @@ -379,8 +379,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()); @@ -389,7 +389,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; @@ -399,7 +399,7 @@ namespace agg color_type* span = base_type::allocator().span(); - int x_count; + int x_count; int weight_y; do @@ -409,8 +409,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; @@ -431,8 +431,8 @@ namespace agg const value_type* row_ptr = (value_type*)base_type::source_image().row(y_lr); do { - fg += row_ptr[x_lr] * ((weight_y * weight_array[x_hr] + - image_filter_size / 2) >> + fg += row_ptr[x_lr] * ((weight_y * weight_array[x_hr] + + image_filter_size / 2) >> image_filter_shift); x_hr += image_subpixel_size; x_lr = ++m_wrap_mode_x; diff --git a/agg/inc/agg_span_pattern_filter_rgb.h b/agg/inc/agg_span_pattern_filter_rgb.h index d4dc1c1797eb..3efed89e5864 100755 --- a/agg/inc/agg_span_pattern_filter_rgb.h +++ b/agg/inc/agg_span_pattern_filter_rgb.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_rgb* @@ -38,12 +38,12 @@ namespace agg //===========================================span_pattern_filter_rgb template<class ColorT, - class Order, + class Order, class Interpolator, class WrapModeX, class WrapModeY, class Allocator = span_allocator<ColorT> > - class span_pattern_filter_rgb_nn : + class span_pattern_filter_rgb_nn : public span_image_filter<ColorT, Interpolator, Allocator> { public: @@ -61,7 +61,7 @@ namespace agg }; //-------------------------------------------------------------------- - span_pattern_filter_rgb_nn(alloc_type& alloc) : + span_pattern_filter_rgb_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_rgb_nn(alloc_type& alloc, - const rendering_buffer& src, + const rendering_buffer& src, interpolator_type& intr) : base_type(alloc, src, color_type(0,0,0,0), intr, 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()); @@ -89,7 +89,7 @@ namespace agg { color_type* span = base_type::allocator().span(); interpolator_type& intr = base_type::interpolator(); - intr.begin(x + base_type::filter_dx_dbl(), + intr.begin(x + base_type::filter_dx_dbl(), y + base_type::filter_dy_dbl(), len); const value_type *fg_ptr; do @@ -127,12 +127,12 @@ namespace agg //=====================================span_pattern_filter_rgb_bilinear template<class ColorT, - class Order, + class Order, class Interpolator, class WrapModeX, class WrapModeY, class Allocator = span_allocator<ColorT> > - class span_pattern_filter_rgb_bilinear : + class span_pattern_filter_rgb_bilinear : public span_image_filter<ColorT, Interpolator, Allocator> { public: @@ -150,7 +150,7 @@ namespace agg }; //-------------------------------------------------------------------- - span_pattern_filter_rgb_bilinear(alloc_type& alloc) : + span_pattern_filter_rgb_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_rgb_bilinear(alloc_type& alloc, - const rendering_buffer& src, + const rendering_buffer& src, interpolator_type& intr) : base_type(alloc, src, color_type(0,0,0,0), intr, 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()); @@ -178,7 +178,7 @@ namespace agg { color_type* span = base_type::allocator().span(); interpolator_type& intr = base_type::interpolator(); - intr.begin(x + base_type::filter_dx_dbl(), + intr.begin(x + base_type::filter_dx_dbl(), y + base_type::filter_dy_dbl(), len); calc_type fg[3]; const value_type *fg_ptr; @@ -206,8 +206,8 @@ namespace agg const value_type* ptr1 = (const value_type*)base_type::source_image().row(y1); const value_type* ptr2 = (const value_type*)base_type::source_image().row(y2); - fg[0] = - fg[1] = + fg[0] = + fg[1] = fg[2] = 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]; @@ -263,12 +263,12 @@ namespace agg //=====================================span_pattern_filter_rgb_2x2 template<class ColorT, - class Order, + class Order, class Interpolator, class WrapModeX, class WrapModeY, class Allocator = span_allocator<ColorT> > - class span_pattern_filter_rgb_2x2 : + class span_pattern_filter_rgb_2x2 : public span_image_filter<ColorT, Interpolator, Allocator> { public: @@ -286,7 +286,7 @@ namespace agg }; //-------------------------------------------------------------------- - span_pattern_filter_rgb_2x2(alloc_type& alloc) : + span_pattern_filter_rgb_2x2(alloc_type& alloc) : base_type(alloc), m_wrap_mode_x(1), m_wrap_mode_y(1) @@ -294,7 +294,7 @@ namespace agg //-------------------------------------------------------------------- span_pattern_filter_rgb_2x2(alloc_type& alloc, - const rendering_buffer& src, + const rendering_buffer& src, interpolator_type& intr, const image_filter_lut& filter) : base_type(alloc, src, color_type(0,0,0,0), intr, &filter), @@ -303,8 +303,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()); @@ -315,12 +315,12 @@ namespace agg { color_type* span = base_type::allocator().span(); interpolator_type& intr = base_type::interpolator(); - intr.begin(x + base_type::filter_dx_dbl(), + intr.begin(x + base_type::filter_dx_dbl(), y + base_type::filter_dy_dbl(), len); calc_type fg[3]; const value_type *fg_ptr; - 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 { @@ -352,36 +352,36 @@ 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]; fg[2] += weight * fg_ptr[2]; 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]; fg[2] += weight * fg_ptr[2]; 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]; fg[2] += weight * fg_ptr[2]; 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]; @@ -423,12 +423,12 @@ namespace agg //==============================================span_pattern_filter_rgb template<class ColorT, - class Order, + class Order, class Interpolator, class WrapModeX, class WrapModeY, class Allocator = span_allocator<ColorT> > - class span_pattern_filter_rgb : + class span_pattern_filter_rgb : public span_image_filter<ColorT, Interpolator, Allocator> { public: @@ -446,13 +446,13 @@ namespace agg }; //-------------------------------------------------------------------- - span_pattern_filter_rgb(alloc_type& alloc) : + span_pattern_filter_rgb(alloc_type& alloc) : base_type(alloc) {} //-------------------------------------------------------------------- span_pattern_filter_rgb(alloc_type& alloc, - const rendering_buffer& src, + const rendering_buffer& src, interpolator_type& intr, const image_filter_lut& filter) : base_type(alloc, src, color_type(0,0,0,0), intr, &filter), @@ -461,8 +461,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()); @@ -473,7 +473,7 @@ namespace agg { color_type* span = base_type::allocator().span(); interpolator_type& intr = base_type::interpolator(); - intr.begin(x + base_type::filter_dx_dbl(), + intr.begin(x + base_type::filter_dx_dbl(), y + base_type::filter_dy_dbl(), len); int fg[3]; @@ -481,7 +481,7 @@ namespace agg int start = base_type::filter().start(); const int16* weight_array = base_type::filter().weight_array(); - int x_count; + int x_count; int weight_y; do @@ -491,8 +491,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; @@ -514,10 +514,10 @@ namespace agg do { const value_type* fg_ptr = row_ptr + x_lr * 3; - 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; 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; diff --git a/agg/inc/agg_span_pattern_resample_gray.h b/agg/inc/agg_span_pattern_resample_gray.h index 212209502f5f..650e913c35b7 100755 --- a/agg/inc/agg_span_pattern_resample_gray.h +++ b/agg/inc/agg_span_pattern_resample_gray.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. // @@ -26,8 +26,8 @@ namespace agg template<class ColorT, class WrapModeX, class WrapModeY, - class Allocator = span_allocator<ColorT> > - class span_pattern_resample_gray_affine : + class Allocator = span_allocator<ColorT> > + class span_pattern_resample_gray_affine : public span_image_resample_affine<ColorT, Allocator> { public: @@ -45,15 +45,15 @@ namespace agg }; //-------------------------------------------------------------------- - span_pattern_resample_gray_affine(alloc_type& alloc) : + span_pattern_resample_gray_affine(alloc_type& alloc) : base_type(alloc), m_wrap_mode_x(1), - m_wrap_mode_y(1) + m_wrap_mode_y(1) {} //-------------------------------------------------------------------- span_pattern_resample_gray_affine(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), inter, filter), @@ -62,8 +62,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()); @@ -74,7 +74,7 @@ namespace agg { color_type* span = base_type::allocator().span(); interpolator_type& intr = base_type::interpolator(); - intr.begin(x + base_type::filter_dx_dbl(), + intr.begin(x + base_type::filter_dx_dbl(), y + base_type::filter_dy_dbl(), len); long_type fg; @@ -96,13 +96,13 @@ namespace agg fg = image_filter_size / 2; int y_lr = m_wrap_mode_y(y >> image_subpixel_shift); - int y_hr = ((image_subpixel_mask - (y & image_subpixel_mask)) * - base_type::m_ry_inv) >> + int y_hr = ((image_subpixel_mask - (y & image_subpixel_mask)) * + base_type::m_ry_inv) >> image_subpixel_shift; int total_weight = 0; int x_lr_ini = x >> image_subpixel_shift; - int x_hr_ini = ((image_subpixel_mask - (x & image_subpixel_mask)) * - base_type::m_rx_inv) >> + int x_hr_ini = ((image_subpixel_mask - (x & image_subpixel_mask)) * + base_type::m_rx_inv) >> image_subpixel_shift; do { @@ -113,8 +113,8 @@ namespace agg do { const value_type* fg_ptr = row_ptr + x_lr; - int weight = (weight_y * weight_array[x_hr] + - image_filter_size / 2) >> + int weight = (weight_y * weight_array[x_hr] + + image_filter_size / 2) >> downscale_shift; fg += *fg_ptr * weight; @@ -155,11 +155,11 @@ namespace agg //============================================span_pattern_resample_gray template<class ColorT, - class Interpolator, + class Interpolator, class WrapModeX, class WrapModeY, class Allocator = span_allocator<ColorT> > - class span_pattern_resample_gray : + class span_pattern_resample_gray : public span_image_resample<ColorT, Interpolator, Allocator> { public: @@ -177,7 +177,7 @@ namespace agg }; //-------------------------------------------------------------------- - span_pattern_resample_gray(alloc_type& alloc) : + span_pattern_resample_gray(alloc_type& alloc) : base_type(alloc), m_wrap_mode_x(1), m_wrap_mode_y(1) @@ -185,7 +185,7 @@ namespace agg //-------------------------------------------------------------------- span_pattern_resample_gray(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), inter, filter), @@ -194,8 +194,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()); @@ -206,7 +206,7 @@ namespace agg { color_type* span = base_type::allocator().span(); interpolator_type& intr = base_type::interpolator(); - intr.begin(x + base_type::filter_dx_dbl(), + intr.begin(x + base_type::filter_dx_dbl(), y + base_type::filter_dy_dbl(), len); long_type fg; @@ -232,7 +232,7 @@ namespace agg } else { - if(rx > image_subpixel_size * base_type::m_scale_limit) + if(rx > image_subpixel_size * base_type::m_scale_limit) { rx = image_subpixel_size * base_type::m_scale_limit; } @@ -245,7 +245,7 @@ namespace agg } else { - if(ry > image_subpixel_size * base_type::m_scale_limit) + if(ry > image_subpixel_size * base_type::m_scale_limit) { ry = image_subpixel_size * base_type::m_scale_limit; } @@ -263,13 +263,13 @@ namespace agg fg = image_filter_size / 2; int y_lr = m_wrap_mode_y(y >> image_subpixel_shift); - int y_hr = ((image_subpixel_mask - (y & image_subpixel_mask)) * - ry_inv) >> + int y_hr = ((image_subpixel_mask - (y & image_subpixel_mask)) * + ry_inv) >> image_subpixel_shift; int total_weight = 0; int x_lr_ini = x >> image_subpixel_shift; - int x_hr_ini = ((image_subpixel_mask - (x & image_subpixel_mask)) * - rx_inv) >> + int x_hr_ini = ((image_subpixel_mask - (x & image_subpixel_mask)) * + rx_inv) >> image_subpixel_shift; do @@ -281,8 +281,8 @@ namespace agg do { const value_type* fg_ptr = row_ptr + x_lr; - int weight = (weight_y * weight_array[x_hr] + - image_filter_size / 2) >> + int weight = (weight_y * weight_array[x_hr] + + image_filter_size / 2) >> downscale_shift; fg += *fg_ptr * weight; total_weight += weight; diff --git a/agg/inc/agg_span_pattern_resample_rgb.h b/agg/inc/agg_span_pattern_resample_rgb.h index baef860eb472..c08ab26257ec 100755 --- a/agg/inc/agg_span_pattern_resample_rgb.h +++ b/agg/inc/agg_span_pattern_resample_rgb.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. // @@ -27,8 +27,8 @@ namespace agg class Order, class WrapModeX, class WrapModeY, - class Allocator = span_allocator<ColorT> > - class span_pattern_resample_rgb_affine : + class Allocator = span_allocator<ColorT> > + class span_pattern_resample_rgb_affine : public span_image_resample_affine<ColorT, Allocator> { public: @@ -47,15 +47,15 @@ namespace agg }; //-------------------------------------------------------------------- - span_pattern_resample_rgb_affine(alloc_type& alloc) : + span_pattern_resample_rgb_affine(alloc_type& alloc) : base_type(alloc), m_wrap_mode_x(1), - m_wrap_mode_y(1) + m_wrap_mode_y(1) {} //-------------------------------------------------------------------- span_pattern_resample_rgb_affine(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_), @@ -64,8 +64,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()); @@ -76,7 +76,7 @@ namespace agg { color_type* span = base_type::allocator().span(); interpolator_type& intr = base_type::interpolator(); - intr.begin(x + base_type::filter_dx_dbl(), + intr.begin(x + base_type::filter_dx_dbl(), y + base_type::filter_dy_dbl(), len); long_type fg[3]; @@ -98,13 +98,13 @@ namespace agg fg[0] = fg[1] = fg[2] = image_filter_size / 2; int y_lr = m_wrap_mode_y(y >> image_subpixel_shift); - int y_hr = ((image_subpixel_mask - (y & image_subpixel_mask)) * - base_type::m_ry_inv) >> + int y_hr = ((image_subpixel_mask - (y & image_subpixel_mask)) * + base_type::m_ry_inv) >> image_subpixel_shift; int total_weight = 0; int x_lr_ini = x >> image_subpixel_shift; - int x_hr_ini = ((image_subpixel_mask - (x & image_subpixel_mask)) * - base_type::m_rx_inv) >> + int x_hr_ini = ((image_subpixel_mask - (x & image_subpixel_mask)) * + base_type::m_rx_inv) >> image_subpixel_shift; do { @@ -115,8 +115,8 @@ namespace agg do { const value_type* fg_ptr = row_ptr + x_lr * 3; - int weight = (weight_y * weight_array[x_hr] + - image_filter_size / 2) >> + int weight = (weight_y * weight_array[x_hr] + + image_filter_size / 2) >> downscale_shift; fg[0] += fg_ptr[0] * weight; @@ -168,12 +168,12 @@ namespace agg //=============================================span_pattern_resample_rgb template<class ColorT, - class Order, - class Interpolator, + class Order, + class Interpolator, class WrapModeX, class WrapModeY, class Allocator = span_allocator<ColorT> > - class span_pattern_resample_rgb : + class span_pattern_resample_rgb : public span_image_resample<ColorT, Interpolator, Allocator> { public: @@ -192,7 +192,7 @@ namespace agg }; //-------------------------------------------------------------------- - span_pattern_resample_rgb(alloc_type& alloc) : + span_pattern_resample_rgb(alloc_type& alloc) : base_type(alloc), m_wrap_mode_x(1), m_wrap_mode_y(1) @@ -200,7 +200,7 @@ namespace agg //-------------------------------------------------------------------- span_pattern_resample_rgb(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), @@ -209,8 +209,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()); @@ -221,7 +221,7 @@ namespace agg { color_type* span = base_type::allocator().span(); interpolator_type& intr = base_type::interpolator(); - intr.begin(x + base_type::filter_dx_dbl(), + intr.begin(x + base_type::filter_dx_dbl(), y + base_type::filter_dy_dbl(), len); long_type fg[3]; @@ -247,7 +247,7 @@ namespace agg } else { - if(rx > image_subpixel_size * base_type::m_scale_limit) + if(rx > image_subpixel_size * base_type::m_scale_limit) { rx = image_subpixel_size * base_type::m_scale_limit; } @@ -260,7 +260,7 @@ namespace agg } else { - if(ry > image_subpixel_size * base_type::m_scale_limit) + if(ry > image_subpixel_size * base_type::m_scale_limit) { ry = image_subpixel_size * base_type::m_scale_limit; } @@ -278,13 +278,13 @@ namespace agg fg[0] = fg[1] = fg[2] = image_filter_size / 2; int y_lr = m_wrap_mode_y(y >> image_subpixel_shift); - int y_hr = ((image_subpixel_mask - (y & image_subpixel_mask)) * - ry_inv) >> + int y_hr = ((image_subpixel_mask - (y & image_subpixel_mask)) * + ry_inv) >> image_subpixel_shift; int total_weight = 0; int x_lr_ini = x >> image_subpixel_shift; - int x_hr_ini = ((image_subpixel_mask - (x & image_subpixel_mask)) * - rx_inv) >> + int x_hr_ini = ((image_subpixel_mask - (x & image_subpixel_mask)) * + rx_inv) >> image_subpixel_shift; do @@ -296,8 +296,8 @@ namespace agg do { const value_type* fg_ptr = row_ptr + x_lr * 3; - int weight = (weight_y * weight_array[x_hr] + - image_filter_size / 2) >> + int weight = (weight_y * weight_array[x_hr] + + image_filter_size / 2) >> downscale_shift; fg[0] += fg_ptr[0] * weight; fg[1] += fg_ptr[1] * weight; diff --git a/agg/inc/agg_span_pattern_resample_rgba.h b/agg/inc/agg_span_pattern_resample_rgba.h index 37b4dade16f4..b295a91f73c7 100755 --- a/agg/inc/agg_span_pattern_resample_rgba.h +++ b/agg/inc/agg_span_pattern_resample_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. // @@ -27,8 +27,8 @@ namespace agg class Order, class WrapModeX, class WrapModeY, - class Allocator = span_allocator<ColorT> > - class span_pattern_resample_rgba_affine : + class Allocator = span_allocator<ColorT> > + class span_pattern_resample_rgba_affine : public span_image_resample_affine<ColorT, Allocator> { public: @@ -47,15 +47,15 @@ namespace agg }; //-------------------------------------------------------------------- - span_pattern_resample_rgba_affine(alloc_type& alloc) : + span_pattern_resample_rgba_affine(alloc_type& alloc) : base_type(alloc), m_wrap_mode_x(1), - m_wrap_mode_y(1) + m_wrap_mode_y(1) {} //-------------------------------------------------------------------- span_pattern_resample_rgba_affine(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_), @@ -64,8 +64,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()); @@ -76,7 +76,7 @@ namespace agg { color_type* span = base_type::allocator().span(); interpolator_type& intr = base_type::interpolator(); - intr.begin(x + base_type::filter_dx_dbl(), + intr.begin(x + base_type::filter_dx_dbl(), y + base_type::filter_dy_dbl(), len); long_type fg[4]; @@ -98,13 +98,13 @@ namespace agg fg[0] = fg[1] = fg[2] = fg[3] = image_filter_size / 2; int y_lr = m_wrap_mode_y(y >> image_subpixel_shift); - int y_hr = ((image_subpixel_mask - (y & image_subpixel_mask)) * - base_type::m_ry_inv) >> + int y_hr = ((image_subpixel_mask - (y & image_subpixel_mask)) * + base_type::m_ry_inv) >> image_subpixel_shift; int total_weight = 0; int x_lr_ini = x >> image_subpixel_shift; - int x_hr_ini = ((image_subpixel_mask - (x & image_subpixel_mask)) * - base_type::m_rx_inv) >> + int x_hr_ini = ((image_subpixel_mask - (x & image_subpixel_mask)) * + base_type::m_rx_inv) >> image_subpixel_shift; do { @@ -115,8 +115,8 @@ 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) >> downscale_shift; fg[0] += fg_ptr[0] * weight; @@ -172,12 +172,12 @@ namespace agg //============================================span_pattern_resample_rgba template<class ColorT, - class Order, - class Interpolator, + class Order, + class Interpolator, class WrapModeX, class WrapModeY, class Allocator = span_allocator<ColorT> > - class span_pattern_resample_rgba : + class span_pattern_resample_rgba : public span_image_resample<ColorT, Interpolator, Allocator> { public: @@ -196,7 +196,7 @@ namespace agg }; //-------------------------------------------------------------------- - span_pattern_resample_rgba(alloc_type& alloc) : + span_pattern_resample_rgba(alloc_type& alloc) : base_type(alloc), m_wrap_mode_x(1), m_wrap_mode_y(1) @@ -204,7 +204,7 @@ namespace agg //-------------------------------------------------------------------- span_pattern_resample_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), @@ -213,8 +213,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()); @@ -225,7 +225,7 @@ namespace agg { color_type* span = base_type::allocator().span(); interpolator_type& intr = base_type::interpolator(); - intr.begin(x + base_type::filter_dx_dbl(), + intr.begin(x + base_type::filter_dx_dbl(), y + base_type::filter_dy_dbl(), len); long_type fg[4]; @@ -251,7 +251,7 @@ namespace agg } else { - if(rx > image_subpixel_size * base_type::m_scale_limit) + if(rx > image_subpixel_size * base_type::m_scale_limit) { rx = image_subpixel_size * base_type::m_scale_limit; } @@ -264,7 +264,7 @@ namespace agg } else { - if(ry > image_subpixel_size * base_type::m_scale_limit) + if(ry > image_subpixel_size * base_type::m_scale_limit) { ry = image_subpixel_size * base_type::m_scale_limit; } @@ -282,13 +282,13 @@ namespace agg fg[0] = fg[1] = fg[2] = fg[3] = image_filter_size / 2; int y_lr = m_wrap_mode_y(y >> image_subpixel_shift); - int y_hr = ((image_subpixel_mask - (y & image_subpixel_mask)) * - ry_inv) >> + int y_hr = ((image_subpixel_mask - (y & image_subpixel_mask)) * + ry_inv) >> image_subpixel_shift; int total_weight = 0; int x_lr_ini = x >> image_subpixel_shift; - int x_hr_ini = ((image_subpixel_mask - (x & image_subpixel_mask)) * - rx_inv) >> + int x_hr_ini = ((image_subpixel_mask - (x & image_subpixel_mask)) * + rx_inv) >> image_subpixel_shift; do @@ -300,8 +300,8 @@ 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) >> downscale_shift; fg[0] += fg_ptr[0] * weight; fg[1] += fg_ptr[1] * weight; diff --git a/agg/inc/agg_span_pattern_rgb.h b/agg/inc/agg_span_pattern_rgb.h index 2e17f11e7c70..3ad7a462e9d4 100755 --- a/agg/inc/agg_span_pattern_rgb.h +++ b/agg/inc/agg_span_pattern_rgb.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. -// +// //---------------------------------------------------------------------------- @@ -33,10 +33,10 @@ namespace agg { //=======================================================span_pattern_rgb template<class ColorT, - class Order, + class Order, class WrapModeX, class WrapModeY, - class Allocator = span_allocator<ColorT> > + class Allocator = span_allocator<ColorT> > class span_pattern_rgb : public span_pattern_base<ColorT, Allocator> { public: @@ -53,16 +53,16 @@ namespace agg }; //-------------------------------------------------------------------- - span_pattern_rgb(alloc_type& alloc) : - base_type(alloc), + span_pattern_rgb(alloc_type& alloc) : + base_type(alloc), m_wrap_mode_x(1), m_wrap_mode_y(1) {} //---------------------------------------------------------------- span_pattern_rgb(alloc_type& alloc, - const rendering_buffer& src, - unsigned offset_x, + const rendering_buffer& src, + unsigned offset_x, unsigned offset_y, value_type alpha = base_mask) : base_type(alloc, src, offset_x, offset_y, alpha), @@ -71,8 +71,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 = WrapModeY(src.height()); @@ -80,10 +80,10 @@ namespace agg //-------------------------------------------------------------------- color_type* generate(int x, int y, unsigned len) - { + { color_type* span = base_type::allocator().span(); unsigned sx = m_wrap_mode_x(base_type::offset_x() + x); - const value_type* row_ptr = + const value_type* row_ptr = (const value_type*)base_type::source_image().row( m_wrap_mode_y( base_type::offset_y() + y)); @@ -123,8 +123,8 @@ namespace agg //---------------------------------------------------------------- span_pattern_rgb24(alloc_type& alloc, - const rendering_buffer& src, - unsigned offset_x, unsigned offset_y, + const rendering_buffer& src, + unsigned offset_x, unsigned offset_y, int8u alpha = 255) : base_type(alloc, src, offset_x, offset_y, alpha) {} @@ -132,7 +132,7 @@ namespace agg //-------------------------------------------------------------------- color_type* generate(int x, int y, unsigned len) - { + { color_type* span = base_type::allocator().span(); unsigned sx = (base_type::offset_x() + x) % base_type::source_image().width(); unsigned wp = base_type::source_image().width() * 3; diff --git a/agg/inc/agg_span_pattern_rgba.h b/agg/inc/agg_span_pattern_rgba.h index d952d0733696..ecc0435eb298 100755 --- a/agg/inc/agg_span_pattern_rgba.h +++ b/agg/inc/agg_span_pattern_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. -// +// //---------------------------------------------------------------------------- @@ -34,10 +34,10 @@ namespace agg //======================================================span_pattern_rgba template<class ColorT, - class Order, + class Order, class WrapModeX, class WrapModeY, - class Allocator = span_allocator<ColorT> > + class Allocator = span_allocator<ColorT> > class span_pattern_rgba : public span_pattern_base<ColorT, Allocator> { public: @@ -54,15 +54,15 @@ namespace agg }; //-------------------------------------------------------------------- - span_pattern_rgba(alloc_type& alloc) : - base_type(alloc), + span_pattern_rgba(alloc_type& alloc) : + base_type(alloc), m_wrap_mode_x(1), m_wrap_mode_y(1) {} //---------------------------------------------------------------- span_pattern_rgba(alloc_type& alloc, - const rendering_buffer& src, + const rendering_buffer& src, unsigned offset_x, unsigned offset_y) : base_type(alloc, src, offset_x, offset_y, 0), m_wrap_mode_x(src.width()), @@ -70,8 +70,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 = WrapModeY(src.height()); @@ -79,10 +79,10 @@ namespace agg //-------------------------------------------------------------------- color_type* generate(int x, int y, unsigned len) - { + { color_type* span = base_type::allocator().span(); unsigned sx = m_wrap_mode_x(base_type::offset_x() + x); - const value_type* row_ptr = + const value_type* row_ptr = (const value_type*)base_type::source_image().row( m_wrap_mode_y( base_type::offset_y() + y)); diff --git a/agg/inc/agg_span_solid.h b/agg/inc/agg_span_solid.h index aa8374bfe61f..7df72ebc0e59 100755 --- a/agg/inc/agg_span_solid.h +++ b/agg/inc/agg_span_solid.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. // @@ -43,7 +43,7 @@ namespace agg //-------------------------------------------------------------------- color_type* generate(int x, int y, unsigned len) - { + { color_type* span = base_type::allocator().span(); do { diff --git a/agg/inc/agg_span_subdiv_adaptor.h b/agg/inc/agg_span_subdiv_adaptor.h index 60196d705bdb..d37f6c6adfb4 100755 --- a/agg/inc/agg_span_subdiv_adaptor.h +++ b/agg/inc/agg_span_subdiv_adaptor.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. // @@ -21,7 +21,7 @@ namespace agg { //=================================================span_subdiv_adaptor - template<class Interpolator, unsigned SubpixelShift = 8> + template<class Interpolator, unsigned SubpixelShift = 8> class span_subdiv_adaptor { public: @@ -41,14 +41,14 @@ namespace agg m_subdiv_size(1 << m_subdiv_shift), m_subdiv_mask(m_subdiv_size - 1) {} - span_subdiv_adaptor(interpolator_type& interpolator, - unsigned subdiv_shift = 4) : + span_subdiv_adaptor(interpolator_type& interpolator, + unsigned subdiv_shift = 4) : m_subdiv_shift(subdiv_shift), m_subdiv_size(1 << m_subdiv_shift), m_subdiv_mask(m_subdiv_size - 1), m_interpolator(&interpolator) {} - span_subdiv_adaptor(interpolator_type& interpolator, + span_subdiv_adaptor(interpolator_type& interpolator, double x, double y, unsigned len, unsigned subdiv_shift = 4) : m_subdiv_shift(subdiv_shift), @@ -65,18 +65,18 @@ namespace agg void interpolator(interpolator_type& intr) { m_interpolator = &intr; } //---------------------------------------------------------------- - const trans_type& transformer() const - { - return *m_interpolator->transformer(); + const trans_type& transformer() const + { + return *m_interpolator->transformer(); } - void transformer(const trans_type& trans) - { - m_interpolator->transformer(trans); + void transformer(const trans_type& trans) + { + m_interpolator->transformer(trans); } //---------------------------------------------------------------- unsigned subdiv_shift() const { return m_subdiv_shift; } - void subdiv_shift(unsigned shift) + void subdiv_shift(unsigned shift) { m_subdiv_shift = shift; m_subdiv_size = 1 << m_subdiv_shift; @@ -102,8 +102,8 @@ namespace agg { unsigned len = m_len; if(len > m_subdiv_size) len = m_subdiv_size; - m_interpolator->resynchronize(double(m_src_x) / double(subpixel_size) + len, - m_src_y, + m_interpolator->resynchronize(double(m_src_x) / double(subpixel_size) + len, + m_src_y, len); m_pos = 0; } diff --git a/agg/inc/agg_trans_affine.h b/agg/inc/agg_trans_affine.h index 5a4098f904de..11ecf759f18d 100755 --- a/agg/inc/agg_trans_affine.h +++ b/agg/inc/agg_trans_affine.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. // @@ -31,32 +31,32 @@ namespace agg // See Implementation agg_trans_affine.cpp // // Affine transformation are linear transformations in Cartesian coordinates - // (strictly speaking not only in Cartesian, but for the beginning we will - // think so). They are rotation, scaling, translation and skewing. - // After any affine transformation a line segment remains a line segment - // and it will never become a curve. + // (strictly speaking not only in Cartesian, but for the beginning we will + // think so). They are rotation, scaling, translation and skewing. + // After any affine transformation a line segment remains a line segment + // and it will never become a curve. // - // There will be no math about matrix calculations, since it has been + // There will be no math about matrix calculations, since it has been // described many times. Ask yourself a very simple question: - // "why do we need to understand and use some matrix stuff instead of just + // "why do we need to understand and use some matrix stuff instead of just // rotating, scaling and so on". The answers are: // // 1. Any combination of transformations can be done by only 4 multiplications // and 4 additions in floating point. // 2. One matrix transformation is equivalent to the number of consecutive - // discrete transformations, i.e. the matrix "accumulates" all transformations - // in the order of their settings. Suppose we have 4 transformations: + // discrete transformations, i.e. the matrix "accumulates" all transformations + // in the order of their settings. Suppose we have 4 transformations: // * rotate by 30 degrees, - // * scale X to 2.0, - // * scale Y to 1.5, - // * move to (100, 100). - // The result will depend on the order of these transformations, + // * scale X to 2.0, + // * scale Y to 1.5, + // * move to (100, 100). + // The result will depend on the order of these transformations, // and the advantage of matrix is that the sequence of discret calls: - // rotate(30), scaleX(2.0), scaleY(1.5), move(100,100) + // rotate(30), scaleX(2.0), scaleY(1.5), move(100,100) // will have exactly the same result as the following matrix transformations: - // + // // affine_matrix m; - // m *= rotate_matrix(30); + // m *= rotate_matrix(30); // m *= scaleX_matrix(2.0); // m *= scaleY_matrix(1.5); // m *= move_matrix(100,100); @@ -64,7 +64,7 @@ namespace agg // m.transform_my_point_at_last(x, y); // // What is the good of it? In real life we will set-up the matrix only once - // and then transform many points, let alone the convenience to set any + // and then transform many points, let alone the convenience to set any // combination of transformations. // // So, how to use it? Very easy - literally as it's shown above. Not quite, @@ -77,9 +77,9 @@ namespace agg // m.transform(&x, &y); // // The affine matrix is all you need to perform any linear transformation, - // but all transformations have origin point (0,0). It means that we need to + // but all transformations have origin point (0,0). It means that we need to // use 2 translations if we want to rotate someting around (100,100): - // + // // m *= agg::trans_affine_translation(-100.0, -100.0); // move to (0,0) // m *= agg::trans_affine_rotation(30.0 * 3.1415926 / 180.0); // rotate // m *= agg::trans_affine_translation(100.0, 100.0); // move back to (100,100) @@ -105,14 +105,14 @@ namespace agg } // Construct a matrix to transform a rectangle to a parallelogram. - trans_affine(double x1, double y1, double x2, double y2, + trans_affine(double x1, double y1, double x2, double y2, const double* parl) { rect_to_parl(x1, y1, x2, y2, parl); } // Construct a matrix to transform a parallelogram to a rectangle. - trans_affine(const double* parl, + trans_affine(const double* parl, double x1, double y1, double x2, double y2) { parl_to_rect(parl, x1, y1, x2, y2); @@ -121,20 +121,20 @@ namespace agg //---------------------------------- Parellelogram transformations // Calculate a matrix to transform a parallelogram to another one. - // src and dst are pointers to arrays of three points - // (double[6], x,y,...) that identify three corners of the + // src and dst are pointers to arrays of three points + // (double[6], x,y,...) that identify three corners of the // parallelograms assuming implicit fourth points. - // There are also transformations rectangtle to parallelogram and + // There are also transformations rectangtle to parallelogram and // parellelogram to rectangle - const trans_affine& parl_to_parl(const double* src, + const trans_affine& parl_to_parl(const double* src, const double* dst); - const trans_affine& rect_to_parl(double x1, double y1, - double x2, double y2, + const trans_affine& rect_to_parl(double x1, double y1, + double x2, double y2, const double* parl); - const trans_affine& parl_to_rect(const double* parl, - double x1, double y1, + const trans_affine& parl_to_rect(const double* parl, + double x1, double y1, double x2, double y2); @@ -148,8 +148,8 @@ namespace agg // Multiply "m" to "this" and assign the result to "this" const trans_affine& premultiply(const trans_affine& m); - // Invert matrix. Do not try to invert degenerate matrices, - // there's no check for validity. If you set scale to 0 and + // Invert matrix. Do not try to invert degenerate matrices, + // there's no check for validity. If you set scale to 0 and // then try to invert matrix, expect unpredictable result. const trans_affine& invert(); @@ -174,7 +174,7 @@ namespace agg } //------------------------------------------- Operators - + // Multiply current matrix to another one const trans_affine& operator *= (const trans_affine& m) { @@ -211,8 +211,8 @@ namespace agg // Direct transformation x and y void transform(double* x, double* y) const; - // Inverse transformation x and y. It works slower than the - // direct transformation, so if the performance is critical + // Inverse transformation x and y. It works slower than the + // direct transformation, so if the performance is critical // it's better to invert() the matrix and then use transform() void inverse_transform(double* x, double* y) const; @@ -223,7 +223,7 @@ namespace agg return 1.0 / (m0 * m3 - m1 * m2); } - // Get the average scale (by X and Y). + // Get the average scale (by X and Y). // Basically used to calculate the approximation_scale when // decomposinting curves into line segments. double scale() const; @@ -291,12 +291,12 @@ namespace agg //====================================================trans_affine_rotation // Rotation matrix. sin() and cos() are calculated twice for the same angle. // There's no harm because the performance of sin()/cos() is very good on all - // modern processors. Besides, this operation is not going to be invoked too + // modern processors. Besides, this operation is not going to be invoked too // often. class trans_affine_rotation : public trans_affine { public: - trans_affine_rotation(double a) : + trans_affine_rotation(double a) : trans_affine(cos(a), sin(a), -sin(a), cos(a), 0.0, 0.0) {} }; @@ -306,11 +306,11 @@ namespace agg class trans_affine_scaling : public trans_affine { public: - trans_affine_scaling(double sx, double sy) : + trans_affine_scaling(double sx, double sy) : trans_affine(sx, 0.0, 0.0, sy, 0.0, 0.0) {} - trans_affine_scaling(double s) : + trans_affine_scaling(double s) : trans_affine(s, 0.0, 0.0, s, 0.0, 0.0) {} }; @@ -320,7 +320,7 @@ namespace agg class trans_affine_translation : public trans_affine { public: - trans_affine_translation(double tx, double ty) : + trans_affine_translation(double tx, double ty) : trans_affine(1.0, 0.0, 0.0, 1.0, tx, ty) {} }; @@ -330,7 +330,7 @@ namespace agg class trans_affine_skewing : public trans_affine { public: - trans_affine_skewing(double sx, double sy) : + trans_affine_skewing(double sx, double sy) : trans_affine(1.0, tan(sy), tan(sx), 1.0, 0.0, 0.0) {} }; diff --git a/agg/inc/agg_trans_bilinear.h b/agg/inc/agg_trans_bilinear.h index 7398a866d3b0..7c63e48ff926 100755 --- a/agg/inc/agg_trans_bilinear.h +++ b/agg/inc/agg_trans_bilinear.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. // @@ -34,15 +34,15 @@ namespace agg //-------------------------------------------------------------------- // Arbitrary quadrangle transformations - trans_bilinear(const double* src, const double* dst) + trans_bilinear(const double* src, const double* dst) { quad_to_quad(src, dst); } //-------------------------------------------------------------------- - // Direct transformations - trans_bilinear(double x1, double y1, double x2, double y2, + // Direct transformations + trans_bilinear(double x1, double y1, double x2, double y2, const double* quad) { rect_to_quad(x1, y1, x2, y2, quad); @@ -50,8 +50,8 @@ namespace agg //-------------------------------------------------------------------- - // Reverse transformations - trans_bilinear(const double* quad, + // Reverse transformations + trans_bilinear(const double* quad, double x1, double y1, double x2, double y2) { quad_to_rect(quad, x1, y1, x2, y2); @@ -84,7 +84,7 @@ namespace agg //-------------------------------------------------------------------- // Set the direct transformations, i.e., rectangle -> quadrangle - void rect_to_quad(double x1, double y1, double x2, double y2, + void rect_to_quad(double x1, double y1, double x2, double y2, const double* quad) { double src[8]; @@ -98,7 +98,7 @@ namespace agg //-------------------------------------------------------------------- // Set the reverse transformations, i.e., quadrangle -> rectangle - void quad_to_rect(const double* quad, + void quad_to_rect(const double* quad, double x1, double y1, double x2, double y2) { double dst[8]; diff --git a/agg/inc/agg_trans_double_path.h b/agg/inc/agg_trans_double_path.h index 16ea9f7264bd..05a491ad6f86 100755 --- a/agg/inc/agg_trans_double_path.h +++ b/agg/inc/agg_trans_double_path.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. // @@ -21,7 +21,7 @@ namespace agg { - + // See also: agg_trans_double_path.cpp // //-------------------------------------------------------trans_double_path @@ -60,8 +60,8 @@ namespace agg void finalize_paths(); //-------------------------------------------------------------------- - template<class VertexSource1, class VertexSource2> - void add_paths(VertexSource1& vs1, VertexSource2& vs2, + template<class VertexSource1, class VertexSource2> + void add_paths(VertexSource1& vs1, VertexSource2& vs2, unsigned path1_id=0, unsigned path2_id=0) { double x; @@ -72,11 +72,11 @@ namespace agg vs1.rewind(path1_id); while(!is_stop(cmd = vs1.vertex(&x, &y))) { - if(is_move_to(cmd)) + if(is_move_to(cmd)) { move_to1(x, y); } - else + else { if(is_vertex(cmd)) { @@ -88,11 +88,11 @@ namespace agg vs2.rewind(path2_id); while(!is_stop(cmd = vs2.vertex(&x, &y))) { - if(is_move_to(cmd)) + if(is_move_to(cmd)) { move_to2(x, y); } - else + else { if(is_vertex(cmd)) { @@ -110,7 +110,7 @@ namespace agg private: double finalize_path(vertex_storage& vertices); - void transform1(const vertex_storage& vertices, + void transform1(const vertex_storage& vertices, double kindex, double kx, double *x, double* y) const; diff --git a/agg/inc/agg_trans_lens.h b/agg/inc/agg_trans_lens.h index ad900686c3fd..dfcdaf9a8fab 100755 --- a/agg/inc/agg_trans_lens.h +++ b/agg/inc/agg_trans_lens.h @@ -2,8 +2,8 @@ // Anti-Grain Geometry - Version 2.1 // 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. // @@ -27,7 +27,7 @@ namespace agg { public: trans_warp_magnifier() : m_xc(0.0), m_yc(0.0), m_magn(1.0), m_radius(1.0), m_warp(false) {} - + void center(double x, double y) { m_xc = x; m_yc = y; } void magnification(double m) { m_magn = m; } void radius(double r) { m_radius = r; } diff --git a/agg/inc/agg_trans_perspective.h b/agg/inc/agg_trans_perspective.h index a127c9095ad2..726d6affacd9 100755 --- a/agg/inc/agg_trans_perspective.h +++ b/agg/inc/agg_trans_perspective.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. // @@ -34,15 +34,15 @@ namespace agg //-------------------------------------------------------------------- // Arbitrary quadrangle transformations - trans_perspective(const double* src, const double* dst) + trans_perspective(const double* src, const double* dst) { quad_to_quad(src, dst); } //-------------------------------------------------------------------- - // Direct transformations - trans_perspective(double x1, double y1, double x2, double y2, + // Direct transformations + trans_perspective(double x1, double y1, double x2, double y2, const double* quad) { rect_to_quad(x1, y1, x2, y2, quad); @@ -50,8 +50,8 @@ namespace agg //-------------------------------------------------------------------- - // Reverse transformations - trans_perspective(const double* quad, + // Reverse transformations + trans_perspective(const double* quad, double x1, double y1, double x2, double y2) { quad_to_rect(quad, x1, y1, x2, y2); @@ -98,7 +98,7 @@ namespace agg //-------------------------------------------------------------------- // Set the direct transformations, i.e., rectangle -> quadrangle - void rect_to_quad(double x1, double y1, double x2, double y2, + void rect_to_quad(double x1, double y1, double x2, double y2, const double* quad) { double src[8]; @@ -112,7 +112,7 @@ namespace agg //-------------------------------------------------------------------- // Set the reverse transformations, i.e., quadrangle -> rectangle - void quad_to_rect(const double* quad, + void quad_to_rect(const double* quad, double x1, double y1, double x2, double y2) { double dst[8]; diff --git a/agg/inc/agg_trans_single_path.h b/agg/inc/agg_trans_single_path.h index 68369626c396..baf6447f5126 100755 --- a/agg/inc/agg_trans_single_path.h +++ b/agg/inc/agg_trans_single_path.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. // @@ -54,7 +54,7 @@ namespace agg void finalize_path(); //-------------------------------------------------------------------- - template<class VertexSource> + template<class VertexSource> void add_path(VertexSource& vs, unsigned path_id=0) { double x; @@ -64,11 +64,11 @@ namespace agg vs.rewind(path_id); while(!is_stop(cmd = vs.vertex(&x, &y))) { - if(is_move_to(cmd)) + if(is_move_to(cmd)) { move_to(x, y); } - else + else { if(is_vertex(cmd)) { diff --git a/agg/inc/agg_trans_viewport.h b/agg/inc/agg_trans_viewport.h index b77a7204feb9..14771912c4b3 100755 --- a/agg/inc/agg_trans_viewport.h +++ b/agg/inc/agg_trans_viewport.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. // @@ -41,7 +41,7 @@ namespace agg { public: //------------------------------------------------------------------- - trans_viewport() : + trans_viewport() : m_world_x1(0.0), m_world_y1(0.0), m_world_x2(1.0), @@ -64,8 +64,8 @@ namespace agg {} //------------------------------------------------------------------- - void preserve_aspect_ratio(double alignx, - double aligny, + void preserve_aspect_ratio(double alignx, + double aligny, aspect_ratio_e aspect) { m_align_x = alignx; @@ -113,7 +113,7 @@ namespace agg } //------------------------------------------------------------------- - void world_viewport_actual(double* x1, double* y1, + void world_viewport_actual(double* x1, double* y1, double* x2, double* y2) const { *x1 = m_wx1; @@ -163,7 +163,7 @@ namespace agg //------------------------------------------------------------------- unsigned byte_size() const { - return + return sizeof(m_world_x1) + sizeof(m_world_y1) + sizeof(m_world_x2) + @@ -187,7 +187,7 @@ namespace agg void serialize(int8u* ptr) const { - memcpy(ptr, &m_world_x1, sizeof(m_world_x1)); ptr += sizeof(m_world_x1); + memcpy(ptr, &m_world_x1, sizeof(m_world_x1)); ptr += sizeof(m_world_x1); memcpy(ptr, &m_world_y1, sizeof(m_world_y1)); ptr += sizeof(m_world_y1); memcpy(ptr, &m_world_x2, sizeof(m_world_x2)); ptr += sizeof(m_world_x2); memcpy(ptr, &m_world_y2, sizeof(m_world_y2)); ptr += sizeof(m_world_y2); @@ -210,7 +210,7 @@ namespace agg void deserialize(const int8u* ptr) { - memcpy(&m_world_x1, ptr, sizeof(m_world_x1)); ptr += sizeof(m_world_x1); + memcpy(&m_world_x1, ptr, sizeof(m_world_x1)); ptr += sizeof(m_world_x1); memcpy(&m_world_y1, ptr, sizeof(m_world_y1)); ptr += sizeof(m_world_y1); memcpy(&m_world_x2, ptr, sizeof(m_world_x2)); ptr += sizeof(m_world_x2); memcpy(&m_world_y2, ptr, sizeof(m_world_y2)); ptr += sizeof(m_world_y2); diff --git a/agg/inc/agg_trans_warp_magnifier.h b/agg/inc/agg_trans_warp_magnifier.h index d71f567af2ca..b4bf9d84cc15 100755 --- a/agg/inc/agg_trans_warp_magnifier.h +++ b/agg/inc/agg_trans_warp_magnifier.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. // @@ -28,7 +28,7 @@ namespace agg { public: trans_warp_magnifier() : m_xc(0.0), m_yc(0.0), m_magn(1.0), m_radius(1.0) {} - + void center(double x, double y) { m_xc = x; m_yc = y; } void magnification(double m) { m_magn = m; } void radius(double r) { m_radius = r; } diff --git a/agg/inc/agg_vcgen_bspline.h b/agg/inc/agg_vcgen_bspline.h index 7490a50a6764..33508f9341aa 100755 --- a/agg/inc/agg_vcgen_bspline.h +++ b/agg/inc/agg_vcgen_bspline.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. // diff --git a/agg/inc/agg_vcgen_contour.h b/agg/inc/agg_vcgen_contour.h index 1c5428206640..0d1fe9203e64 100755 --- a/agg/inc/agg_vcgen_contour.h +++ b/agg/inc/agg_vcgen_contour.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. // diff --git a/agg/inc/agg_vcgen_dash.h b/agg/inc/agg_vcgen_dash.h index cc4c86dea833..202bb13233b8 100755 --- a/agg/inc/agg_vcgen_dash.h +++ b/agg/inc/agg_vcgen_dash.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. // diff --git a/agg/inc/agg_vcgen_markers_term.h b/agg/inc/agg_vcgen_markers_term.h index 6f213811c290..e971e96b4b01 100755 --- a/agg/inc/agg_vcgen_markers_term.h +++ b/agg/inc/agg_vcgen_markers_term.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. // diff --git a/agg/inc/agg_vcgen_smooth_poly1.h b/agg/inc/agg_vcgen_smooth_poly1.h index 61ca14898328..80f56d8046e1 100755 --- a/agg/inc/agg_vcgen_smooth_poly1.h +++ b/agg/inc/agg_vcgen_smooth_poly1.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. // @@ -25,7 +25,7 @@ namespace agg //======================================================vcgen_smooth_poly1 // - // See Implementation agg_vcgen_smooth_poly1.cpp + // See Implementation agg_vcgen_smooth_poly1.cpp // Smooth polygon generator // //------------------------------------------------------------------------ @@ -64,8 +64,8 @@ namespace agg vcgen_smooth_poly1(const vcgen_smooth_poly1&); const vcgen_smooth_poly1& operator = (const vcgen_smooth_poly1&); - void calculate(const vertex_dist& v0, - const vertex_dist& v1, + void calculate(const vertex_dist& v0, + const vertex_dist& v1, const vertex_dist& v2, const vertex_dist& v3); diff --git a/agg/inc/agg_vcgen_stroke.h b/agg/inc/agg_vcgen_stroke.h index a73509acf3d9..d1aa0b897455 100755 --- a/agg/inc/agg_vcgen_stroke.h +++ b/agg/inc/agg_vcgen_stroke.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. // diff --git a/agg/inc/agg_vcgen_vertex_sequence.h b/agg/inc/agg_vcgen_vertex_sequence.h index 7c4e9e4253e5..a00d0f8267ac 100755 --- a/agg/inc/agg_vcgen_vertex_sequence.h +++ b/agg/inc/agg_vcgen_vertex_sequence.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. // @@ -93,15 +93,15 @@ namespace agg //------------------------------------------------------------------------ - inline void vcgen_vertex_sequence::rewind(unsigned) - { + inline void vcgen_vertex_sequence::rewind(unsigned) + { if(!m_ready) { m_src_vertices.close(is_closed(m_flags)); shorten_path(m_src_vertices, m_shorten, get_close_flag(m_flags)); } m_ready = true; - m_cur_vertex = 0; + m_cur_vertex = 0; } //------------------------------------------------------------------------ diff --git a/agg/inc/agg_vertex_iterator.h b/agg/inc/agg_vertex_iterator.h index f22af0acb888..63959fcbbde9 100755 --- a/agg/inc/agg_vertex_iterator.h +++ b/agg/inc/agg_vertex_iterator.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,8 +13,8 @@ // http://www.antigrain.com //---------------------------------------------------------------------------- // -// classes: vertex_iterator -// vertex_source_adaptor +// classes: vertex_iterator +// vertex_source_adaptor // vertex_source_adaptor_with_id // //---------------------------------------------------------------------------- @@ -39,7 +39,7 @@ namespace agg m_vs->rewind(id); m_vertex.cmd = m_vs->vertex(&m_vertex.x, &m_vertex.y); } - vertex_iterator& operator++() + vertex_iterator& operator++() { m_vertex.cmd = m_vs->vertex(&m_vertex.x, &m_vertex.y); return *this; @@ -48,9 +48,9 @@ namespace agg const vertex_type& operator*() const { return m_vertex; } const vertex_type* operator->() const { return &m_vertex; } - bool operator != (const vertex_iterator& i) - { - return m_vertex.cmd != i.m_vertex.cmd; + bool operator != (const vertex_iterator& i) + { + return m_vertex.cmd != i.m_vertex.cmd; } private: @@ -65,7 +65,7 @@ namespace agg public: vertex_source_adaptor(const VertexContainer& container) : m_container(&container) {} - + void rewind(unsigned) { m_iterator = m_container->begin(); @@ -99,7 +99,7 @@ namespace agg public: vertex_source_adaptor_with_id(const VertexContainer& container) : m_container(&container) {} - + void rewind(unsigned id) { m_iterator = m_container->begin(id); diff --git a/agg/inc/agg_vertex_sequence.h b/agg/inc/agg_vertex_sequence.h index 357a3df15fa4..774caa904f71 100755 --- a/agg/inc/agg_vertex_sequence.h +++ b/agg/inc/agg_vertex_sequence.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. // @@ -31,13 +31,13 @@ namespace agg // It means that the type T must expose: // // bool operator() (const T& val) - // + // // that is called every time new vertex is being added. The main purpose - // of this operator is the possibility to calculate some values during + // of this operator is the possibility to calculate some values during // adding and to return true if the vertex fits some criteria or false if - // it doesn't. In the last case the new vertex is not added. - // - // The simple example is filtering coinciding vertices with calculation + // it doesn't. In the last case the new vertex is not added. + // + // The simple example is filtering coinciding vertices with calculation // of the distance between the current and previous ones: // // struct vertex_dist @@ -60,10 +60,10 @@ namespace agg // } // }; // - // Function close() calls this operator and removes the last vertex if + // Function close() calls this operator and removes the last vertex if // necessary. //------------------------------------------------------------------------ - template<class T, unsigned S=6> + template<class T, unsigned S=6> class vertex_sequence : public pod_deque<T, S> { public: @@ -77,12 +77,12 @@ namespace agg //------------------------------------------------------------------------ - template<class T, unsigned S> + template<class T, unsigned S> void vertex_sequence<T, S>::add(const T& val) { if(base_type::size() > 1) { - if(!(*this)[base_type::size() - 2]((*this)[base_type::size() - 1])) + if(!(*this)[base_type::size() - 2]((*this)[base_type::size() - 1])) { base_type::remove_last(); } @@ -92,7 +92,7 @@ namespace agg //------------------------------------------------------------------------ - template<class T, unsigned S> + template<class T, unsigned S> void vertex_sequence<T, S>::modify_last(const T& val) { base_type::remove_last(); @@ -102,7 +102,7 @@ namespace agg //------------------------------------------------------------------------ - template<class T, unsigned S> + template<class T, unsigned S> void vertex_sequence<T, S>::close(bool closed) { while(base_type::size() > 1) @@ -129,7 +129,7 @@ namespace agg const double vertex_dist_epsilon = 1e-14; //-------------------------------------------------------------vertex_dist - // Vertex (x, y) with the distance to the next one. The last vertex has + // Vertex (x, y) with the distance to the next one. The last vertex has // distance between the last and the first points if the polygon is closed // and 0.0 if it's a polyline. struct vertex_dist diff --git a/agg/inc/agg_vpgen_clip_polygon.h b/agg/inc/agg_vpgen_clip_polygon.h index d5da460843e6..d0bcd466a88f 100755 --- a/agg/inc/agg_vpgen_clip_polygon.h +++ b/agg/inc/agg_vpgen_clip_polygon.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. // @@ -28,7 +28,7 @@ namespace agg class vpgen_clip_polygon { public: - vpgen_clip_polygon() : + vpgen_clip_polygon() : m_clip_box(0, 0, 1, 1), m_x1(0), m_y1(0), diff --git a/agg/inc/agg_vpgen_clip_polyline.h b/agg/inc/agg_vpgen_clip_polyline.h index f951966a3293..07e30e7bce20 100755 --- a/agg/inc/agg_vpgen_clip_polyline.h +++ b/agg/inc/agg_vpgen_clip_polyline.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. // @@ -28,7 +28,7 @@ namespace agg class vpgen_clip_polyline { public: - vpgen_clip_polyline() : + vpgen_clip_polyline() : m_clip_box(0, 0, 1, 1), m_x1(0), m_y1(0), @@ -73,7 +73,7 @@ namespace agg clip_y2 = 8 }; - // Determine the clipping code of the vertex according to the + // Determine the clipping code of the vertex according to the // Cyrus-Beck line clipping algorithm //-------------------------------------------------------------------- unsigned clipping_flags_x(double x) diff --git a/agg/inc/agg_vpgen_segmentator.h b/agg/inc/agg_vpgen_segmentator.h index 1acc3531cc6e..8a0e3e976c4e 100755 --- a/agg/inc/agg_vpgen_segmentator.h +++ b/agg/inc/agg_vpgen_segmentator.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. // @@ -23,7 +23,7 @@ namespace agg { //=======================================================vpgen_segmentator - // + // // See Implementation agg_vpgen_segmentator.cpp // class vpgen_segmentator diff --git a/agg/source/agg_arc.cpp b/agg/source/agg_arc.cpp index eb10f5f7f2fc..dd812a8bbfb4 100755 --- a/agg/source/agg_arc.cpp +++ b/agg/source/agg_arc.cpp @@ -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. // @@ -24,9 +24,9 @@ namespace agg { //------------------------------------------------------------------------ - arc::arc(double x, double y, - double rx, double ry, - double a1, double a2, + arc::arc(double x, double y, + double rx, double ry, + double a1, double a2, bool ccw) : m_x(x), m_y(y), m_rx(rx), m_ry(ry), m_scale(1.0) { @@ -34,16 +34,16 @@ namespace agg } //------------------------------------------------------------------------ - void arc::init(double x, double y, - double rx, double ry, - double a1, double a2, + void arc::init(double x, double y, + double rx, double ry, + double a1, double a2, bool ccw) { m_x = x; m_y = y; - m_rx = rx; m_ry = ry; + m_rx = rx; m_ry = ry; normalize(a1, a2, ccw); } - + //------------------------------------------------------------------------ void arc::approximation_scale(double s) { @@ -57,7 +57,7 @@ namespace agg //------------------------------------------------------------------------ void arc::rewind(unsigned) { - m_path_cmd = path_cmd_move_to; + m_path_cmd = path_cmd_move_to; m_angle = m_start; } diff --git a/agg/source/agg_arrowhead.cpp b/agg/source/agg_arrowhead.cpp index 694ed5ad887b..7f3a0272ce5c 100755 --- a/agg/source/agg_arrowhead.cpp +++ b/agg/source/agg_arrowhead.cpp @@ -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,7 +13,7 @@ // http://www.antigrain.com //---------------------------------------------------------------------------- // -// Simple arrowhead/arrowtail generator +// Simple arrowhead/arrowtail generator // //---------------------------------------------------------------------------- diff --git a/agg/source/agg_bezier_arc.cpp b/agg/source/agg_bezier_arc.cpp index 6b47fff76fc8..3517f168b387 100755 --- a/agg/source/agg_bezier_arc.cpp +++ b/agg/source/agg_bezier_arc.cpp @@ -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,7 +13,7 @@ // http://www.antigrain.com //---------------------------------------------------------------------------- // -// Arc generator. Produces at most 4 consecutive cubic bezier curves, i.e., +// Arc generator. Produces at most 4 consecutive cubic bezier curves, i.e., // 4, 7, 10, or 13 vertices. // //---------------------------------------------------------------------------- @@ -27,7 +27,7 @@ namespace agg { //------------------------------------------------------------arc_to_bezier - void arc_to_bezier(double cx, double cy, double rx, double ry, + void arc_to_bezier(double cx, double cy, double rx, double ry, double start_angle, double sweep_angle, double* curve) { @@ -60,9 +60,9 @@ namespace agg //------------------------------------------------------------------------ - void bezier_arc::init(double x, double y, - double rx, double ry, - double start_angle, + void bezier_arc::init(double x, double y, + double rx, double ry, + double start_angle, double sweep_angle) { start_angle = fmod(start_angle, 2.0 * pi); @@ -96,9 +96,9 @@ namespace agg } } - arc_to_bezier(x, y, rx, ry, - start_angle, - local_sweep, + arc_to_bezier(x, y, rx, ry, + start_angle, + local_sweep, m_vertices + m_num_vertices - 2); m_num_vertices += 6; @@ -111,8 +111,8 @@ namespace agg //-------------------------------------------------------------------- - void bezier_arc_svg::init(double x0, double y0, - double rx, double ry, + void bezier_arc_svg::init(double x0, double y0, + double rx, double ry, double angle, bool large_arc_flag, bool sweep_flag, @@ -123,7 +123,7 @@ namespace agg if(rx < 0.0) rx = -rx; if(ry < 0.0) ry = -rx; - // Calculate the middle point between + // Calculate the middle point between // the current and the final points //------------------------ double dx2 = (x0 - x2) / 2.0; @@ -149,7 +149,7 @@ namespace agg // Check that radii are large enough //------------------------ double radii_check = px1/prx + py1/pry; - if(radii_check > 1.0) + if(radii_check > 1.0) { rx = sqrt(radii_check) * rx; ry = sqrt(radii_check) * ry; @@ -201,12 +201,12 @@ namespace agg if(v < -1.0) v = -1.0; if(v > 1.0) v = 1.0; double sweep_angle = sign * acos(v); - if(!sweep_flag && sweep_angle > 0) + if(!sweep_flag && sweep_angle > 0) { sweep_angle -= pi * 2.0; - } - else - if (sweep_flag && sweep_angle < 0) + } + else + if (sweep_flag && sweep_angle < 0) { sweep_angle += pi * 2.0; } @@ -216,7 +216,7 @@ namespace agg m_arc.init(0.0, 0.0, rx, ry, start_angle, sweep_angle); trans_affine mtx = trans_affine_rotation(angle); mtx *= trans_affine_translation(cx, cy); - + for(unsigned i = 2; i < m_arc.num_vertices()-2; i += 2) { mtx.transform(m_arc.vertices() + i, m_arc.vertices() + i + 1); diff --git a/agg/source/agg_bspline.cpp b/agg/source/agg_bspline.cpp index 8635495ecc9e..5b7d7b640bb1 100755 --- a/agg/source/agg_bspline.cpp +++ b/agg/source/agg_bspline.cpp @@ -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. // @@ -65,7 +65,7 @@ namespace agg init(num, x, y); } - + //------------------------------------------------------------------------ void bspline::init(int max) { @@ -100,13 +100,13 @@ namespace agg if(m_num > 2) { int i, k, n1; - double* temp; - double* r; + double* temp; + double* r; double* s; - double* al; + double* al; double h, p, d, f, e; - - for(k = 0; k < m_num; k++) + + for(k = 0; k < m_num; k++) { m_am[k] = 0.0; } @@ -116,7 +116,7 @@ namespace agg al = new double[n1]; temp = al; - for(k = 0; k < n1; k++) + for(k = 0; k < n1; k++) { temp[k] = 0.0; } @@ -128,7 +128,7 @@ namespace agg d = m_x[1] - m_x[0]; e = (m_y[1] - m_y[0]) / d; - for(k = 1; k < n1; k++) + for(k = 1; k < n1; k++) { h = d; d = m_x[k + 1] - m_x[k]; @@ -139,18 +139,18 @@ namespace agg s[k] = 6.0 * (e - f) / (h + d); } - for(k = 1; k < n1; k++) + for(k = 1; k < n1; k++) { p = 1.0 / (r[k] * al[k - 1] + 2.0); al[k] *= -p; - s[k] = (s[k] - r[k] * s[k - 1]) * p; + s[k] = (s[k] - r[k] * s[k - 1]) * p; } m_am[n1] = 0.0; al[n1 - 1] = s[n1 - 1]; m_am[n1 - 1] = al[n1 - 1]; - for(k = n1 - 2, i = 0; i < m_num - 2; i++, k--) + for(k = n1 - 2, i = 0; i < m_num - 2; i++, k--) { al[k] = al[k] * al[k + 1] + s[k]; m_am[k] = al[k]; @@ -180,14 +180,14 @@ namespace agg //------------------------------------------------------------------------ - void bspline::bsearch(int n, const double *x, double x0, int *i) + void bspline::bsearch(int n, const double *x, double x0, int *i) { int j = n - 1; int k; - - for(*i = 0; (j - *i) > 1; ) + + for(*i = 0; (j - *i) > 1; ) { - if(x0 < x[k = (*i + j) >> 1]) j = k; + if(x0 < x[k = (*i + j) >> 1]) j = k; else *i = k; } } @@ -211,8 +211,8 @@ namespace agg double bspline::extrapolation_left(double x) const { double d = m_x[1] - m_x[0]; - return (-d * m_am[1] / 6 + (m_y[1] - m_y[0]) / d) * - (x - m_x[0]) + + return (-d * m_am[1] / 6 + (m_y[1] - m_y[0]) / d) * + (x - m_x[0]) + m_y[0]; } @@ -220,8 +220,8 @@ namespace agg double bspline::extrapolation_right(double x) const { double d = m_x[m_num - 1] - m_x[m_num - 2]; - return (d * m_am[m_num - 2] / 6 + (m_y[m_num - 1] - m_y[m_num - 2]) / d) * - (x - m_x[m_num - 1]) + + return (d * m_am[m_num - 2] / 6 + (m_y[m_num - 1] - m_y[m_num - 2]) / d) * + (x - m_x[m_num - 1]) + m_y[m_num - 1]; } @@ -263,15 +263,15 @@ namespace agg if(x < m_x[m_last_idx] || x > m_x[m_last_idx + 1]) { // Check if x between next points (most probably) - if(m_last_idx < m_num - 2 && + if(m_last_idx < m_num - 2 && x >= m_x[m_last_idx + 1] && x <= m_x[m_last_idx + 2]) { ++m_last_idx; } else - if(m_last_idx > 0 && - x >= m_x[m_last_idx - 1] && + if(m_last_idx > 0 && + x >= m_x[m_last_idx - 1] && x <= m_x[m_last_idx]) { // x is between pevious points diff --git a/agg/source/agg_curves.cpp b/agg/source/agg_curves.cpp index bae65f26b5a3..34659e6d2824 100755 --- a/agg/source/agg_curves.cpp +++ b/agg/source/agg_curves.cpp @@ -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. // @@ -24,8 +24,8 @@ namespace agg { //------------------------------------------------------------------------ - void curve3::init(double x1, double y1, - double x2, double y2, + void curve3::init(double x1, double y1, + double x2, double y2, double x3, double y3) { m_start_x = x1; @@ -38,13 +38,13 @@ namespace agg double dx2 = x3 - x2; double dy2 = y3 - y2; - double len = sqrt(dx1 * dx1 + dy1 * dy1) + sqrt(dx2 * dx2 + dy2 * dy2); + double len = sqrt(dx1 * dx1 + dy1 * dy1) + sqrt(dx2 * dx2 + dy2 * dy2); m_num_steps = int(len * 0.25 * m_scale); if(m_num_steps < 2) { - m_num_steps = 2; + m_num_steps = 2; } double subdivide_step = 1.0 / m_num_steps; @@ -55,7 +55,7 @@ namespace agg m_saved_fx = m_fx = x1; m_saved_fy = m_fy = y1; - + m_saved_dfx = m_dfx = tmpx + (x2 - x1) * (2.0 * subdivide_step); m_saved_dfy = m_dfy = tmpy + (y2 - y1) * (2.0 * subdivide_step); @@ -104,10 +104,10 @@ namespace agg --m_step; return path_cmd_line_to; } - m_fx += m_dfx; + m_fx += m_dfx; m_fy += m_dfy; - m_dfx += m_ddfx; - m_dfy += m_ddfy; + m_dfx += m_ddfx; + m_dfy += m_ddfy; *x = m_fx; *y = m_fy; --m_step; @@ -127,8 +127,8 @@ namespace agg //------------------------------------------------------------------------ - void curve4::init(double x1, double y1, - double x2, double y2, + void curve4::init(double x1, double y1, + double x2, double y2, double x3, double y3, double x4, double y4) { @@ -144,15 +144,15 @@ namespace agg double dx3 = x4 - x3; double dy3 = y4 - y3; - double len = sqrt(dx1 * dx1 + dy1 * dy1) + - sqrt(dx2 * dx2 + dy2 * dy2) + + double len = sqrt(dx1 * dx1 + dy1 * dy1) + + sqrt(dx2 * dx2 + dy2 * dy2) + sqrt(dx3 * dx3 + dy3 * dy3); m_num_steps = int(len * 0.25 * m_scale); if(m_num_steps < 2) { - m_num_steps = 2; + m_num_steps = 2; } double subdivide_step = 1.0 / m_num_steps; @@ -163,7 +163,7 @@ namespace agg double pre2 = 3.0 * subdivide_step2; double pre4 = 6.0 * subdivide_step2; double pre5 = 6.0 * subdivide_step3; - + double tmp1x = x1 - x2 * 2.0 + x3; double tmp1y = y1 - y2 * 2.0 + y3; @@ -227,12 +227,12 @@ namespace agg --m_step; return path_cmd_line_to; } - m_fx += m_dfx; + m_fx += m_dfx; m_fy += m_dfy; - m_dfx += m_ddfx; - m_dfy += m_ddfy; - m_ddfx += m_dddfx; - m_ddfy += m_dddfy; + m_dfx += m_ddfx; + m_dfy += m_ddfy; + m_ddfx += m_dddfx; + m_ddfy += m_dddfy; *x = m_fx; *y = m_fy; --m_step; diff --git a/agg/source/agg_embedded_raster_fonts.cpp b/agg/source/agg_embedded_raster_fonts.cpp index b1060fb7e176..587c854d37ad 100755 --- a/agg/source/agg_embedded_raster_fonts.cpp +++ b/agg/source/agg_embedded_raster_fonts.cpp @@ -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. // @@ -18,7 +18,7 @@ namespace agg { - const int8u gse4x6[] = + const int8u gse4x6[] = { 6, 0, 32, 128-32, @@ -324,7 +324,7 @@ namespace agg 0 }; - const int8u gse4x8[] = + const int8u gse4x8[] = { 8, 0, 32, 128-32, @@ -630,7 +630,7 @@ namespace agg 0 }; - const int8u gse5x7[] = + const int8u gse5x7[] = { 7, 0, 32, 128-32, @@ -936,7 +936,7 @@ namespace agg 0 }; - const int8u gse5x9[] = + const int8u gse5x9[] = { 9, 0, 32, 128-32, @@ -1242,7 +1242,7 @@ namespace agg 0 }; - const int8u gse6x12[] = + const int8u gse6x12[] = { 12, 0, 32, 128-32, @@ -1548,7 +1548,7 @@ namespace agg 0 }; - const int8u gse6x9[] = + const int8u gse6x9[] = { 9, 0, 32, 128-32, @@ -1854,7 +1854,7 @@ namespace agg 0 }; - const int8u gse7x11[] = + const int8u gse7x11[] = { 11, 0, 32, 128-32, @@ -2160,7 +2160,7 @@ namespace agg 0 }; - const int8u gse7x11_bold[] = + const int8u gse7x11_bold[] = { 11, 0, 32, 128-32, @@ -2466,7 +2466,7 @@ namespace agg 0 }; - const int8u gse7x15[] = + const int8u gse7x15[] = { 15, 0, 32, 128-32, @@ -2772,7 +2772,7 @@ namespace agg 0 }; - const int8u gse7x15_bold[] = + const int8u gse7x15_bold[] = { 15, 0, 32, 128-32, @@ -3078,7 +3078,7 @@ namespace agg 0 }; - const int8u gse8x16[] = + const int8u gse8x16[] = { 16, 0, 32, 128-32, @@ -3384,7 +3384,7 @@ namespace agg 0 }; - const int8u gse8x16_bold[] = + const int8u gse8x16_bold[] = { 16, 0, 32, 128-32, @@ -3690,7 +3690,7 @@ namespace agg 0 }; - const int8u mcs11_prop[] = + const int8u mcs11_prop[] = { 11, 2, 32, 128-32, 0x00,0x00,0x0C,0x00,0x18,0x00,0x24,0x00,0x30,0x00,0x3C,0x00,0x48,0x00,0x54,0x00,0x60,0x00, @@ -3996,7 +3996,7 @@ namespace agg 0 }; - const int8u mcs11_prop_condensed[] = + const int8u mcs11_prop_condensed[] = { 11, 2, 32, 128-32, 0x00,0x00,0x0C,0x00,0x18,0x00,0x24,0x00,0x30,0x00,0x3C,0x00,0x48,0x00,0x54,0x00,0x60,0x00, @@ -4302,7 +4302,7 @@ namespace agg 0 }; - const int8u mcs12_prop[] = + const int8u mcs12_prop[] = { 12, 3, 32, 128-32, 0x00,0x00,0x0D,0x00,0x1A,0x00,0x27,0x00,0x34,0x00,0x41,0x00,0x4E,0x00,0x5B,0x00,0x68,0x00, @@ -4608,7 +4608,7 @@ namespace agg 0 }; - const int8u mcs13_prop[] = + const int8u mcs13_prop[] = { 13, 4, 32, 128-32, 0x00,0x00,0x0E,0x00,0x1C,0x00,0x2A,0x00,0x38,0x00,0x46,0x00,0x54,0x00,0x62,0x00,0x70,0x00, @@ -4914,7 +4914,7 @@ namespace agg 0 }; - const int8u mcs5x10_mono[] = + const int8u mcs5x10_mono[] = { 10, 2, 32, 128-32, 0x00,0x00,0x0B,0x00,0x16,0x00,0x21,0x00,0x2C,0x00,0x37,0x00,0x42,0x00,0x4D,0x00,0x58,0x00, @@ -5220,7 +5220,7 @@ namespace agg 0 }; - const int8u mcs5x11_mono[] = + const int8u mcs5x11_mono[] = { 11, 3, 32, 128-32, 0x00,0x00,0x0C,0x00,0x18,0x00,0x24,0x00,0x30,0x00,0x3C,0x00,0x48,0x00,0x54,0x00,0x60,0x00, @@ -5526,7 +5526,7 @@ namespace agg 0 }; - const int8u mcs6x10_mono[] = + const int8u mcs6x10_mono[] = { 10, 3, 32, 128-32, 0x00,0x00,0x0B,0x00,0x16,0x00,0x21,0x00,0x2C,0x00,0x37,0x00,0x42,0x00,0x4D,0x00,0x58,0x00, @@ -5832,7 +5832,7 @@ namespace agg 0 }; - const int8u mcs6x11_mono[] = + const int8u mcs6x11_mono[] = { 11, 3, 32, 128-32, 0x00,0x00,0x0C,0x00,0x18,0x00,0x24,0x00,0x30,0x00,0x3C,0x00,0x48,0x00,0x54,0x00,0x60,0x00, @@ -6138,7 +6138,7 @@ namespace agg 0 }; - const int8u mcs7x12_mono_high[] = + const int8u mcs7x12_mono_high[] = { 12, 3, 32, 128-32, 0x00,0x00,0x0D,0x00,0x1A,0x00,0x27,0x00,0x34,0x00,0x41,0x00,0x4E,0x00,0x5B,0x00,0x68,0x00, @@ -6444,7 +6444,7 @@ namespace agg 0 }; - const int8u mcs7x12_mono_low[] = + const int8u mcs7x12_mono_low[] = { 12, 4, 32, 128-32, 0x00,0x00,0x0D,0x00,0x1A,0x00,0x27,0x00,0x34,0x00,0x41,0x00,0x4E,0x00,0x5B,0x00,0x68,0x00, @@ -6750,7 +6750,7 @@ namespace agg 0 }; - const int8u verdana12[] = + const int8u verdana12[] = { 12, 3, 32, 128-32, 0x00,0x00,0x0D,0x00,0x1A,0x00,0x27,0x00,0x34,0x00,0x41,0x00,0x5A,0x00,0x67,0x00,0x74,0x00, @@ -7056,7 +7056,7 @@ namespace agg 0 }; - const int8u verdana12_bold[] = + const int8u verdana12_bold[] = { 12, 3, 32, 128-32, 0x00,0x00,0x0D,0x00,0x1A,0x00,0x27,0x00,0x34,0x00,0x41,0x00,0x5A,0x00,0x67,0x00,0x74,0x00, @@ -7362,7 +7362,7 @@ namespace agg 0 }; - const int8u verdana13[] = + const int8u verdana13[] = { 13, 3, 32, 128-32, 0x00,0x00,0x0E,0x00,0x1C,0x00,0x2A,0x00,0x45,0x00,0x53,0x00,0x6E,0x00,0x7C,0x00,0x8A,0x00, @@ -7668,7 +7668,7 @@ namespace agg 0 }; - const int8u verdana13_bold[] = + const int8u verdana13_bold[] = { 13, 3, 32, 128-32, 0x00,0x00,0x0E,0x00,0x1C,0x00,0x2A,0x00,0x45,0x00,0x53,0x00,0x6E,0x00,0x89,0x00,0x97,0x00, @@ -7974,7 +7974,7 @@ namespace agg 0 }; - const int8u verdana14[] = + const int8u verdana14[] = { 14, 3, 32, 128-32, 0x00,0x00,0x0F,0x00,0x1E,0x00,0x2D,0x00,0x4A,0x00,0x59,0x00,0x76,0x00,0x93,0x00,0xA2,0x00, @@ -8280,7 +8280,7 @@ namespace agg 0 }; - const int8u verdana14_bold[] = + const int8u verdana14_bold[] = { 14, 3, 32, 128-32, 0x00,0x00,0x0F,0x00,0x1E,0x00,0x2D,0x00,0x4A,0x00,0x67,0x00,0x84,0x00,0xA1,0x00,0xB0,0x00, @@ -8586,7 +8586,7 @@ namespace agg 0 }; - const int8u verdana16[] = + const int8u verdana16[] = { 16, 4, 32, 128-32, 0x00,0x00,0x11,0x00,0x22,0x00,0x33,0x00,0x54,0x00,0x65,0x00,0x86,0x00,0xA7,0x00,0xB8,0x00, @@ -8892,7 +8892,7 @@ namespace agg 0 }; - const int8u verdana16_bold[] = + const int8u verdana16_bold[] = { 16, 4, 32, 128-32, 0x00,0x00,0x11,0x00,0x22,0x00,0x33,0x00,0x54,0x00,0x75,0x00,0xA6,0x00,0xC7,0x00,0xD8,0x00, @@ -9198,7 +9198,7 @@ namespace agg 0 }; - const int8u verdana17[] = + const int8u verdana17[] = { 17, 4, 32, 128-32, 0x00,0x00,0x12,0x00,0x24,0x00,0x36,0x00,0x59,0x00,0x7C,0x00,0x9F,0x00,0xC2,0x00,0xD4,0x00, @@ -9504,7 +9504,7 @@ namespace agg 0 }; - const int8u verdana17_bold[] = + const int8u verdana17_bold[] = { 17, 4, 32, 128-32, 0x00,0x00,0x12,0x00,0x24,0x00,0x36,0x00,0x59,0x00,0x7C,0x00,0xB0,0x00,0xD3,0x00,0xE5,0x00, @@ -9810,7 +9810,7 @@ namespace agg 0 }; - const int8u verdana18[] = + const int8u verdana18[] = { 18, 4, 32, 128-32, 0x00,0x00,0x13,0x00,0x26,0x00,0x39,0x00,0x5E,0x00,0x83,0x00,0xA8,0x00,0xCD,0x00,0xE0,0x00, @@ -10116,7 +10116,7 @@ namespace agg 0 }; - const int8u verdana18_bold[] = + const int8u verdana18_bold[] = { 18, 4, 32, 128-32, 0x00,0x00,0x13,0x00,0x26,0x00,0x4B,0x00,0x70,0x00,0x95,0x00,0xCC,0x00,0xF1,0x00,0x04,0x01, diff --git a/agg/source/agg_gsv_text.cpp b/agg/source/agg_gsv_text.cpp index fd522cd8de08..f597e1fbeb2b 100755 --- a/agg/source/agg_gsv_text.cpp +++ b/agg/source/agg_gsv_text.cpp @@ -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. // @@ -23,7 +23,7 @@ namespace agg { - int8u gsv_default_font[] = + int8u gsv_default_font[] = { 0x40,0x00,0x6c,0x0f,0x15,0x00,0x0e,0x00,0xf9,0xff, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, @@ -501,7 +501,7 @@ namespace agg m_line_space(0.0), m_text(m_chr), m_text_buf(0), - m_buf_size(0), + m_buf_size(0), m_cur_chr(m_chr), m_font(gsv_default_font), m_loaded_font(0), @@ -603,7 +603,7 @@ namespace agg { m_status = initial; if(m_font == 0) return; - + m_indices = (int8u*)m_font; double base_height = value(m_indices + 4); m_indices += value(m_indices); @@ -623,13 +623,13 @@ namespace agg int dx, dy; bool quit = false; - + while(!quit) { switch(m_status) { case initial: - if(m_font == 0) + if(m_font == 0) { quit = true; break; @@ -637,7 +637,7 @@ namespace agg m_status = next_char; case next_char: - if(*m_cur_chr == 0) + if(*m_cur_chr == 0) { quit = true; break; @@ -669,7 +669,7 @@ namespace agg } dx = int(*m_bglyph++); yf = (yc = *m_bglyph++) & 0x80; - yc <<= 1; + yc <<= 1; yc >>= 1; dy = int(yc); m_x += double(dx) * m_w; diff --git a/agg/source/agg_image_filters.cpp b/agg/source/agg_image_filters.cpp index 28dd0654eeb4..fa651f18ae12 100755 --- a/agg/source/agg_image_filters.cpp +++ b/agg/source/agg_image_filters.cpp @@ -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. // @@ -55,9 +55,9 @@ namespace agg //-------------------------------------------------------------------- - // This function normalizes integer values and corrects the rounding + // This function normalizes integer values and corrects the rounding // errors. It doesn't do anything with the source floating point values - // (m_weight_array_dbl), it corrects only integers according to the rule + // (m_weight_array_dbl), it corrects only integers according to the rule // of 1.0 which means that any sum of pixel weights must be equal to 1.0. // So, the filter function must produce a graph of the proper shape. //-------------------------------------------------------------------- @@ -83,7 +83,7 @@ namespace agg sum = 0; for(j = 0; j < m_diameter; j++) { - sum += m_weight_array[j * image_subpixel_size + i] = + sum += m_weight_array[j * image_subpixel_size + i] = int16(m_weight_array[j * image_subpixel_size + i] * k); } diff --git a/agg/source/agg_line_aa_basics.cpp b/agg/source/agg_line_aa_basics.cpp index 34103178d7b7..878811bc7ec3 100755 --- a/agg/source/agg_line_aa_basics.cpp +++ b/agg/source/agg_line_aa_basics.cpp @@ -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. // @@ -30,26 +30,26 @@ namespace agg // [1] | [0] // . (3)011 | 001(1) . // . | . - // . | . - // . | . + // . | . + // . | . // (2)010 .|. 000(0) // <2> ----------.+.----------- <0> // (6)110 . | . 100(4) // . | . // . | . // . | . - // (7)111 | 101(5) + // (7)111 | 101(5) // [2] | [3] - // <3> - // 0,1,2,3,4,5,6,7 + // <3> + // 0,1,2,3,4,5,6,7 int8u line_parameters::s_orthogonal_quadrant[8] = { 0,0,1,1,3,3,2,2 }; int8u line_parameters::s_diagonal_quadrant[8] = { 0,1,2,1,0,3,2,3 }; //------------------------------------------------------------------------- - void bisectrix(const line_parameters& l1, - const line_parameters& l2, + void bisectrix(const line_parameters& l1, + const line_parameters& l2, int* x, int* y) { double k = double(l2.len) / double(l1.len); diff --git a/agg/source/agg_line_profile_aa.cpp b/agg/source/agg_line_profile_aa.cpp index 1374475b663f..c880704ae0de 100755 --- a/agg/source/agg_line_profile_aa.cpp +++ b/agg/source/agg_line_profile_aa.cpp @@ -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. // @@ -30,7 +30,7 @@ namespace agg w -= m_smoother_width; double s = m_smoother_width; - if(w < 0.0) + if(w < 0.0) { s += w; w = 0.0; @@ -88,15 +88,15 @@ namespace agg for(i = 0; i < subpixel_smoother_width; i++) { - *ch_smoother++ = - m_gamma[unsigned((base_val - - base_val * + *ch_smoother++ = + m_gamma[unsigned((base_val - + base_val * (double(i) / subpixel_smoother_width)) * aa_mask)]; } - unsigned n_smoother = profile_size() - - subpixel_smoother_width - - subpixel_center_width - + unsigned n_smoother = profile_size() - + subpixel_smoother_width - + subpixel_center_width - subpixel_size*2; val = m_gamma[0]; diff --git a/agg/source/agg_path_storage.cpp b/agg/source/agg_path_storage.cpp index 60eafffff14f..1ae0d3252ef7 100755 --- a/agg/source/agg_path_storage.cpp +++ b/agg/source/agg_path_storage.cpp @@ -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. // @@ -55,7 +55,7 @@ namespace agg //------------------------------------------------------------------------ - path_storage::path_storage(const path_storage& ps) : + path_storage::path_storage(const path_storage& ps) : m_total_vertices(0), m_total_blocks(0), m_max_blocks(0), @@ -92,22 +92,22 @@ namespace agg //------------------------------------------------------------------------ void path_storage::allocate_block(unsigned nb) { - if(nb >= m_max_blocks) + if(nb >= m_max_blocks) { - double** new_coords = + double** new_coords = new double* [(m_max_blocks + block_pool) * 2]; - unsigned char** new_cmds = + unsigned char** new_cmds = (unsigned char**)(new_coords + m_max_blocks + block_pool); if(m_coord_blocks) { - memcpy(new_coords, - m_coord_blocks, + memcpy(new_coords, + m_coord_blocks, m_max_blocks * sizeof(double*)); - memcpy(new_cmds, - m_cmd_blocks, + memcpy(new_cmds, + m_cmd_blocks, m_max_blocks * sizeof(unsigned char*)); delete [] m_coord_blocks; @@ -116,12 +116,12 @@ namespace agg m_cmd_blocks = new_cmds; m_max_blocks += block_pool; } - m_coord_blocks[nb] = - new double [block_size * 2 + - block_size / + m_coord_blocks[nb] = + new double [block_size * 2 + + block_size / (sizeof(double) / sizeof(unsigned char))]; - m_cmd_blocks[nb] = + m_cmd_blocks[nb] = (unsigned char*)(m_coord_blocks[nb] + block_size * 2); m_total_blocks++; @@ -131,7 +131,7 @@ namespace agg //------------------------------------------------------------------------ void path_storage::rewind(unsigned path_id) { - m_iterator = path_id; + m_iterator = path_id; } @@ -155,7 +155,7 @@ namespace agg // Ensure radii are valid //------------------------- - if(rx < epsilon || ry < epsilon) + if(rx < epsilon || ry < epsilon) { line_to(x, y); return; @@ -197,7 +197,7 @@ namespace agg //------------------------------------------------------------------------ - void path_storage::curve3(double x_ctrl, double y_ctrl, + void path_storage::curve3(double x_ctrl, double y_ctrl, double x_to, double y_to) { add_vertex(x_ctrl, y_ctrl, path_cmd_curve3); @@ -205,7 +205,7 @@ namespace agg } //------------------------------------------------------------------------ - void path_storage::curve3_rel(double dx_ctrl, double dy_ctrl, + void path_storage::curve3_rel(double dx_ctrl, double dy_ctrl, double dx_to, double dy_to) { rel_to_abs(&dx_ctrl, &dy_ctrl); @@ -248,8 +248,8 @@ namespace agg //------------------------------------------------------------------------ - void path_storage::curve4(double x_ctrl1, double y_ctrl1, - double x_ctrl2, double y_ctrl2, + void path_storage::curve4(double x_ctrl1, double y_ctrl1, + double x_ctrl2, double y_ctrl2, double x_to, double y_to) { add_vertex(x_ctrl1, y_ctrl1, path_cmd_curve4); @@ -258,8 +258,8 @@ namespace agg } //------------------------------------------------------------------------ - void path_storage::curve4_rel(double dx_ctrl1, double dy_ctrl1, - double dx_ctrl2, double dy_ctrl2, + void path_storage::curve4_rel(double dx_ctrl1, double dy_ctrl1, + double dx_ctrl2, double dy_ctrl2, double dx_to, double dy_to) { rel_to_abs(&dx_ctrl1, &dy_ctrl1); @@ -272,7 +272,7 @@ namespace agg //------------------------------------------------------------------------ - void path_storage::curve4(double x_ctrl2, double y_ctrl2, + void path_storage::curve4(double x_ctrl2, double y_ctrl2, double x_to, double y_to) { double x0 = 0; @@ -298,7 +298,7 @@ namespace agg //------------------------------------------------------------------------ - void path_storage::curve4_rel(double dx_ctrl2, double dy_ctrl2, + void path_storage::curve4_rel(double dx_ctrl2, double dy_ctrl2, double dx_to, double dy_to) { rel_to_abs(&dx_ctrl2, &dy_ctrl2); @@ -389,7 +389,7 @@ namespace agg { unsigned i; unsigned tmp_cmd = command(_start); - + // Shift all commands to one position for(i = _start; i < _end; i++) { @@ -427,7 +427,7 @@ namespace agg //------------------------------------------------------------------------ - unsigned path_storage::arrange_orientations(unsigned path_id, + unsigned path_storage::arrange_orientations(unsigned path_id, path_flags_e new_orientation) { unsigned _end = m_total_vertices; @@ -441,17 +441,17 @@ namespace agg for(;;) { unsigned orientation; - _end = perceive_polygon_orientation(start + 1, xs, ys, + _end = perceive_polygon_orientation(start + 1, xs, ys, &orientation); if(_end > start + 2 && - orientation && + orientation && orientation != unsigned(new_orientation)) { reverse_polygon(start + inc, _end - 1); } if(_end >= m_total_vertices) break; cmd = command(_end); - if(is_stop(cmd)) + if(is_stop(cmd)) { ++_end; break; diff --git a/agg/source/agg_rasterizer_scanline_aa.cpp b/agg/source/agg_rasterizer_scanline_aa.cpp index 421c0187d0aa..ba2962bbeae4 100755 --- a/agg/source/agg_rasterizer_scanline_aa.cpp +++ b/agg/source/agg_rasterizer_scanline_aa.cpp @@ -2,13 +2,13 @@ // 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. // -// The author gratefully acknowleges the support of David Turner, -// Robert Wilhelm, and Werner Lemberg - the authors of the FreeType +// The author gratefully acknowleges the support of David Turner, +// Robert Wilhelm, and Werner Lemberg - the authors of the FreeType // libray - in producing this work. See http://www.freetype.org for details. // //---------------------------------------------------------------------------- @@ -19,17 +19,17 @@ // // Class outline_aa - implementation. // -// Initially the rendering algorithm was designed by David Turner and the -// other authors of the FreeType library - see the above notice. I nearly -// created a similar renderer, but still I was far from David's work. -// I completely redesigned the original code and adapted it for Anti-Grain -// ideas. Two functions - render_line and render_hline are the core of +// Initially the rendering algorithm was designed by David Turner and the +// other authors of the FreeType library - see the above notice. I nearly +// created a similar renderer, but still I was far from David's work. +// I completely redesigned the original code and adapted it for Anti-Grain +// ideas. Two functions - render_line and render_hline are the core of // the algorithm - they calculate the exact coverage of each pixel cell -// of the polygon. I left these functions almost as is, because there's +// of the polygon. I left these functions almost as is, because there's // no way to improve the perfection - hats off to David and his group! // -// All other code is very different from the original. -// +// All other code is very different from the original. +// //---------------------------------------------------------------------------- #include <string.h> @@ -112,8 +112,8 @@ namespace agg //------------------------------------------------------------------------ void outline_aa::reset() - { - m_num_cells = 0; + { + m_num_cells = 0; m_cur_block = 0; m_cur_cell.set(0x7FFF, 0x7FFF, 0, 0); m_sorted = false; @@ -297,7 +297,7 @@ namespace agg //Vertical line - we have to calculate start and end cells, //and then - the common values of the area and coverage for - //all cells of the line. We know exactly there's only one + //all cells of the line. We know exactly there's only one //cell, so, we don't have to call render_hline(). incr = 1; if(dx == 0) @@ -419,7 +419,7 @@ namespace agg m_sorted = false; } - + //------------------------------------------------------------------------ enum { @@ -447,7 +447,7 @@ namespace agg void outline_aa::qsort_cells(cell_aa** start, unsigned num) { cell_aa** stack[80]; - cell_aa*** top; + cell_aa*** top; cell_aa** limit; cell_aa** base; @@ -472,7 +472,7 @@ namespace agg i = base + 1; j = limit - 1; - // now ensure that *i <= *base <= *j + // now ensure that *i <= *base <= *j if(less_than(j, i)) { swap_cells(i, j); @@ -575,7 +575,7 @@ namespace agg { cell_ptr = *block_ptr++; i = cell_block_size; - while(i--) + while(i--) { *sorted_ptr++ = cell_ptr++; } @@ -583,7 +583,7 @@ namespace agg cell_ptr = *block_ptr++; i = m_num_cells & cell_block_mask; - while(i--) + while(i--) { *sorted_ptr++ = cell_ptr++; } diff --git a/agg/source/agg_rounded_rect.cpp b/agg/source/agg_rounded_rect.cpp index 8f6e532e7096..f49c4fb46fc3 100755 --- a/agg/source/agg_rounded_rect.cpp +++ b/agg/source/agg_rounded_rect.cpp @@ -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. // @@ -26,7 +26,7 @@ namespace agg //------------------------------------------------------------------------ rounded_rect::rounded_rect(double x1, double y1, double x2, double y2, double r) : m_x1(x1), m_y1(y1), m_x2(x2), m_y2(y2), - m_rx1(r), m_ry1(r), m_rx2(r), m_ry2(r), + m_rx1(r), m_ry1(r), m_rx2(r), m_ry2(r), m_rx3(r), m_ry3(r), m_rx4(r), m_ry4(r) { if(x1 > x2) { m_x1 = x2; m_x2 = x1; } @@ -47,31 +47,31 @@ namespace agg //-------------------------------------------------------------------- void rounded_rect::radius(double r) { - m_rx1 = m_ry1 = m_rx2 = m_ry2 = m_rx3 = m_ry3 = m_rx4 = m_ry4 = r; + m_rx1 = m_ry1 = m_rx2 = m_ry2 = m_rx3 = m_ry3 = m_rx4 = m_ry4 = r; } //-------------------------------------------------------------------- void rounded_rect::radius(double rx, double ry) { - m_rx1 = m_rx2 = m_rx3 = m_rx4 = rx; - m_ry1 = m_ry2 = m_ry3 = m_ry4 = ry; + m_rx1 = m_rx2 = m_rx3 = m_rx4 = rx; + m_ry1 = m_ry2 = m_ry3 = m_ry4 = ry; } //-------------------------------------------------------------------- - void rounded_rect::radius(double rx_bottom, double ry_bottom, + void rounded_rect::radius(double rx_bottom, double ry_bottom, double rx_top, double ry_top) { - m_rx1 = m_rx2 = rx_bottom; - m_rx3 = m_rx4 = rx_top; - m_ry1 = m_ry2 = ry_bottom; - m_ry3 = m_ry4 = ry_top; + m_rx1 = m_rx2 = rx_bottom; + m_rx3 = m_rx4 = rx_top; + m_ry1 = m_ry2 = ry_bottom; + m_ry3 = m_ry4 = ry_top; } //-------------------------------------------------------------------- - void rounded_rect::radius(double rx1, double ry1, double rx2, double ry2, + void rounded_rect::radius(double rx1, double ry1, double rx2, double ry2, double rx3, double ry3, double rx4, double ry4) { - m_rx1 = rx1; m_ry1 = ry1; m_rx2 = rx2; m_ry2 = ry2; + m_rx1 = rx1; m_ry1 = ry1; m_rx2 = rx2; m_ry2 = ry2; m_rx3 = rx3; m_ry3 = ry3; m_rx4 = rx4; m_ry4 = ry4; } @@ -83,10 +83,10 @@ namespace agg double k = 1.0; double t; - t = dx / (m_rx1 + m_rx2); if(t < k) k = t; - t = dx / (m_rx3 + m_rx4); if(t < k) k = t; - t = dy / (m_ry1 + m_ry2); if(t < k) k = t; - t = dy / (m_ry3 + m_ry4); if(t < k) k = t; + t = dx / (m_rx1 + m_rx2); if(t < k) k = t; + t = dx / (m_rx3 + m_rx4); if(t < k) k = t; + t = dy / (m_ry1 + m_ry2); if(t < k) k = t; + t = dy / (m_ry3 + m_ry4); if(t < k) k = t; if(k < 1.0) { diff --git a/agg/source/agg_sqrt_tables.cpp b/agg/source/agg_sqrt_tables.cpp index e2f88f5a7fef..d89cdfdc72c8 100755 --- a/agg/source/agg_sqrt_tables.cpp +++ b/agg/source/agg_sqrt_tables.cpp @@ -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. // @@ -21,7 +21,7 @@ namespace agg { - int16u g_sqrt_table[1024] = + int16u g_sqrt_table[1024] = { 0, 2048,2896,3547,4096,4579,5017,5418,5793,6144,6476,6792,7094,7384,7663,7932,8192,8444, @@ -100,7 +100,7 @@ namespace agg }; - int8 g_elder_bit_table[256] = + int8 g_elder_bit_table[256] = { 0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, @@ -111,5 +111,5 @@ namespace agg 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7 }; - + } diff --git a/agg/source/agg_trans_affine.cpp b/agg/source/agg_trans_affine.cpp index f81050d3e42f..907f44dd0e8b 100755 --- a/agg/source/agg_trans_affine.cpp +++ b/agg/source/agg_trans_affine.cpp @@ -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. // @@ -24,7 +24,7 @@ namespace agg { //------------------------------------------------------------------------ - const trans_affine& trans_affine::parl_to_parl(const double* src, + const trans_affine& trans_affine::parl_to_parl(const double* src, const double* dst) { m0 = src[2] - src[0]; @@ -34,15 +34,15 @@ namespace agg m4 = src[0]; m5 = src[1]; invert(); - multiply(trans_affine(dst[2] - dst[0], dst[3] - dst[1], + multiply(trans_affine(dst[2] - dst[0], dst[3] - dst[1], dst[4] - dst[0], dst[5] - dst[1], dst[0], dst[1])); return *this; } //------------------------------------------------------------------------ - const trans_affine& trans_affine::rect_to_parl(double x1, double y1, - double x2, double y2, + const trans_affine& trans_affine::rect_to_parl(double x1, double y1, + double x2, double y2, const double* parl) { double src[6]; @@ -54,8 +54,8 @@ namespace agg } //------------------------------------------------------------------------ - const trans_affine& trans_affine::parl_to_rect(const double* parl, - double x1, double y1, + const trans_affine& trans_affine::parl_to_rect(const double* parl, + double x1, double y1, double x2, double y2) { double dst[6]; @@ -122,7 +122,7 @@ namespace agg //------------------------------------------------------------------------ const trans_affine& trans_affine::reset() { - m0 = m3 = 1.0; + m0 = m3 = 1.0; m1 = m2 = m4 = m5 = 0.0; return *this; } @@ -138,7 +138,7 @@ namespace agg { return is_equal_eps(m0, 1.0, epsilon) && is_equal_eps(m1, 0.0, epsilon) && - is_equal_eps(m2, 0.0, epsilon) && + is_equal_eps(m2, 0.0, epsilon) && is_equal_eps(m3, 1.0, epsilon) && is_equal_eps(m4, 0.0, epsilon) && is_equal_eps(m5, 0.0, epsilon); @@ -149,7 +149,7 @@ namespace agg { return is_equal_eps(m0, m.m0, epsilon) && is_equal_eps(m1, m.m1, epsilon) && - is_equal_eps(m2, m.m2, epsilon) && + is_equal_eps(m2, m.m2, epsilon) && is_equal_eps(m3, m.m3, epsilon) && is_equal_eps(m4, m.m4, epsilon) && is_equal_eps(m5, m.m5, epsilon); diff --git a/agg/source/agg_trans_double_path.cpp b/agg/source/agg_trans_double_path.cpp index 5fc83ea50391..87ef94d3fad3 100755 --- a/agg/source/agg_trans_double_path.cpp +++ b/agg/source/agg_trans_double_path.cpp @@ -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. // @@ -103,13 +103,13 @@ namespace agg if(vertices.size() > 2) { - if(vertices[vertices.size() - 2].dist * 10.0 < + if(vertices[vertices.size() - 2].dist * 10.0 < vertices[vertices.size() - 3].dist) { - d = vertices[vertices.size() - 3].dist + + d = vertices[vertices.size() - 3].dist + vertices[vertices.size() - 2].dist; - vertices[vertices.size() - 2] = + vertices[vertices.size() - 2] = vertices[vertices.size() - 1]; vertices.remove_last(); @@ -149,7 +149,7 @@ namespace agg double trans_double_path::total_length1() const { if(m_base_length >= 1e-10) return m_base_length; - return (m_status1 == ready) ? + return (m_status1 == ready) ? m_src_vertices1[m_src_vertices1.size() - 1].dist : 0.0; } @@ -159,15 +159,15 @@ namespace agg double trans_double_path::total_length2() const { if(m_base_length >= 1e-10) return m_base_length; - return (m_status2 == ready) ? + return (m_status2 == ready) ? m_src_vertices2[m_src_vertices2.size() - 1].dist : 0.0; } //------------------------------------------------------------------------ - void trans_double_path::transform1(const vertex_storage& vertices, - double kindex, double kx, + void trans_double_path::transform1(const vertex_storage& vertices, + double kindex, double kx, double *x, double* y) const { double x1 = 0.0; @@ -211,13 +211,13 @@ namespace agg if(m_preserve_x_scale) { unsigned k; - for(i = 0; (j - i) > 1; ) + for(i = 0; (j - i) > 1; ) { - if(*x < vertices[k = (i + j) >> 1].dist) + if(*x < vertices[k = (i + j) >> 1].dist) { - j = k; + j = k; } - else + else { i = k; } @@ -250,7 +250,7 @@ namespace agg { if(m_base_length > 1e-10) { - *x *= m_src_vertices1[m_src_vertices1.size() - 1].dist / + *x *= m_src_vertices1[m_src_vertices1.size() - 1].dist / m_base_length; } diff --git a/agg/source/agg_trans_single_path.cpp b/agg/source/agg_trans_single_path.cpp index cc4fb5356267..012788625389 100755 --- a/agg/source/agg_trans_single_path.cpp +++ b/agg/source/agg_trans_single_path.cpp @@ -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. // @@ -72,13 +72,13 @@ namespace agg if(m_src_vertices.size() > 2) { - if(m_src_vertices[m_src_vertices.size() - 2].dist * 10.0 < + if(m_src_vertices[m_src_vertices.size() - 2].dist * 10.0 < m_src_vertices[m_src_vertices.size() - 3].dist) { - d = m_src_vertices[m_src_vertices.size() - 3].dist + + d = m_src_vertices[m_src_vertices.size() - 3].dist + m_src_vertices[m_src_vertices.size() - 2].dist; - m_src_vertices[m_src_vertices.size() - 2] = + m_src_vertices[m_src_vertices.size() - 2] = m_src_vertices[m_src_vertices.size() - 1]; m_src_vertices.remove_last(); @@ -106,7 +106,7 @@ namespace agg double trans_single_path::total_length() const { if(m_base_length >= 1e-10) return m_base_length; - return (m_status == ready) ? + return (m_status == ready) ? m_src_vertices[m_src_vertices.size() - 1].dist : 0.0; } @@ -119,7 +119,7 @@ namespace agg { if(m_base_length > 1e-10) { - *x *= m_src_vertices[m_src_vertices.size() - 1].dist / + *x *= m_src_vertices[m_src_vertices.size() - 1].dist / m_base_length; } @@ -163,13 +163,13 @@ namespace agg if(m_preserve_x_scale) { unsigned k; - for(i = 0; (j - i) > 1; ) + for(i = 0; (j - i) > 1; ) { - if(*x < m_src_vertices[k = (i + j) >> 1].dist) + if(*x < m_src_vertices[k = (i + j) >> 1].dist) { - j = k; + j = k; } - else + else { i = k; } diff --git a/agg/source/agg_trans_warp_magnifier.cpp b/agg/source/agg_trans_warp_magnifier.cpp index 4f9d28233907..5bde578a5611 100755 --- a/agg/source/agg_trans_warp_magnifier.cpp +++ b/agg/source/agg_trans_warp_magnifier.cpp @@ -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. // diff --git a/agg/source/agg_vcgen_bspline.cpp b/agg/source/agg_vcgen_bspline.cpp index 9ca4df9b44f4..8fa1f574532f 100755 --- a/agg/source/agg_vcgen_bspline.cpp +++ b/agg/source/agg_vcgen_bspline.cpp @@ -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. // diff --git a/agg/source/agg_vcgen_contour.cpp b/agg/source/agg_vcgen_contour.cpp index 979407417e75..0242d7a86eb5 100755 --- a/agg/source/agg_vcgen_contour.cpp +++ b/agg/source/agg_vcgen_contour.cpp @@ -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. // @@ -58,7 +58,7 @@ namespace agg //------------------------------------------------------------------------ void vcgen_contour::miter_limit_theta(double t) - { + { m_miter_limit = 1.0 / sin(t * 0.5) ; } @@ -82,7 +82,7 @@ namespace agg if(is_end_poly(cmd)) { m_closed = get_close_flag(cmd); - if(m_orientation == path_flags_none) + if(m_orientation == path_flags_none) { m_orientation = get_orientation(cmd); } @@ -103,8 +103,8 @@ namespace agg { if(!is_oriented(m_orientation)) { - m_orientation = (calc_polygon_area(m_src_vertices) > 0.0) ? - path_flags_ccw : + m_orientation = (calc_polygon_area(m_src_vertices) > 0.0) ? + path_flags_ccw : path_flags_cw; } } @@ -146,13 +146,13 @@ namespace agg m_status = end_poly; break; } - stroke_calc_join(m_out_vertices, - m_src_vertices.prev(m_src_vertex), - m_src_vertices.curr(m_src_vertex), - m_src_vertices.next(m_src_vertex), + stroke_calc_join(m_out_vertices, + m_src_vertices.prev(m_src_vertex), + m_src_vertices.curr(m_src_vertex), + m_src_vertices.next(m_src_vertex), m_src_vertices.prev(m_src_vertex).dist, m_src_vertices.curr(m_src_vertex).dist, - m_signed_width, + m_signed_width, m_line_join, m_inner_line_join, m_miter_limit, diff --git a/agg/source/agg_vcgen_dash.cpp b/agg/source/agg_vcgen_dash.cpp index 96783abe9952..f7f7710222b2 100755 --- a/agg/source/agg_vcgen_dash.cpp +++ b/agg/source/agg_vcgen_dash.cpp @@ -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. // @@ -169,8 +169,8 @@ namespace agg { double dash_rest = m_dashes[m_curr_dash] - m_curr_dash_start; - unsigned _cmd = (m_curr_dash & 1) ? - path_cmd_move_to : + unsigned _cmd = (m_curr_dash & 1) ? + path_cmd_move_to : path_cmd_line_to; if(m_curr_rest > dash_rest) @@ -200,7 +200,7 @@ namespace agg { m_v2 = &m_src_vertices [ - (m_src_vertex >= m_src_vertices.size()) ? 0 : + (m_src_vertex >= m_src_vertices.size()) ? 0 : m_src_vertex ]; } @@ -219,7 +219,7 @@ namespace agg } return _cmd; } - + // statement unreachable //break; diff --git a/agg/source/agg_vcgen_markers_term.cpp b/agg/source/agg_vcgen_markers_term.cpp index 0daa40793764..da503ce83bc1 100755 --- a/agg/source/agg_vcgen_markers_term.cpp +++ b/agg/source/agg_vcgen_markers_term.cpp @@ -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. // @@ -83,7 +83,7 @@ namespace agg //------------------------------------------------------------------------ unsigned vcgen_markers_term::vertex(double* x, double* y) { - if(m_curr_id > 2 || m_curr_idx >= m_markers.size()) + if(m_curr_id > 2 || m_curr_idx >= m_markers.size()) { return path_cmd_stop; } diff --git a/agg/source/agg_vcgen_smooth_poly1.cpp b/agg/source/agg_vcgen_smooth_poly1.cpp index 1df1edb5c72c..dca22e0048a8 100755 --- a/agg/source/agg_vcgen_smooth_poly1.cpp +++ b/agg/source/agg_vcgen_smooth_poly1.cpp @@ -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. // @@ -77,8 +77,8 @@ namespace agg //------------------------------------------------------------------------ - void vcgen_smooth_poly1::calculate(const vertex_dist& v0, - const vertex_dist& v1, + void vcgen_smooth_poly1::calculate(const vertex_dist& v0, + const vertex_dist& v1, const vertex_dist& v2, const vertex_dist& v3) { @@ -153,8 +153,8 @@ namespace agg } } - calculate(m_src_vertices.prev(m_src_vertex), - m_src_vertices.curr(m_src_vertex), + calculate(m_src_vertices.prev(m_src_vertex), + m_src_vertices.curr(m_src_vertex), m_src_vertices.next(m_src_vertex), m_src_vertices.next(m_src_vertex + 1)); @@ -165,8 +165,8 @@ namespace agg if(m_closed) { m_status = ctrl1; - return ((m_src_vertex == 1) ? - path_cmd_move_to : + return ((m_src_vertex == 1) ? + path_cmd_move_to : path_cmd_curve4); } else diff --git a/agg/source/agg_vcgen_stroke.cpp b/agg/source/agg_vcgen_stroke.cpp index a8a4481ec25b..93f6c04bf2cc 100755 --- a/agg/source/agg_vcgen_stroke.cpp +++ b/agg/source/agg_vcgen_stroke.cpp @@ -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. // @@ -45,7 +45,7 @@ namespace agg //------------------------------------------------------------------------ void vcgen_stroke::miter_limit_theta(double t) - { + { m_miter_limit = 1.0 / sin(t * 0.5) ; } @@ -121,8 +121,8 @@ namespace agg case cap1: stroke_calc_cap(m_out_vertices, - m_src_vertices[0], - m_src_vertices[1], + m_src_vertices[0], + m_src_vertices[1], m_src_vertices[0].dist, m_line_cap, m_width, @@ -135,8 +135,8 @@ namespace agg case cap2: stroke_calc_cap(m_out_vertices, - m_src_vertices[m_src_vertices.size() - 1], - m_src_vertices[m_src_vertices.size() - 2], + m_src_vertices[m_src_vertices.size() - 1], + m_src_vertices[m_src_vertices.size() - 2], m_src_vertices[m_src_vertices.size() - 2].dist, m_line_cap, m_width, @@ -164,13 +164,13 @@ namespace agg break; } } - stroke_calc_join(m_out_vertices, - m_src_vertices.prev(m_src_vertex), - m_src_vertices.curr(m_src_vertex), - m_src_vertices.next(m_src_vertex), + stroke_calc_join(m_out_vertices, + m_src_vertices.prev(m_src_vertex), + m_src_vertices.curr(m_src_vertex), + m_src_vertices.next(m_src_vertex), m_src_vertices.prev(m_src_vertex).dist, m_src_vertices.curr(m_src_vertex).dist, - m_width, + m_width, m_line_join, m_inner_line_join, m_miter_limit, @@ -196,12 +196,12 @@ namespace agg --m_src_vertex; stroke_calc_join(m_out_vertices, - m_src_vertices.next(m_src_vertex), - m_src_vertices.curr(m_src_vertex), - m_src_vertices.prev(m_src_vertex), - m_src_vertices.curr(m_src_vertex).dist, + m_src_vertices.next(m_src_vertex), + m_src_vertices.curr(m_src_vertex), + m_src_vertices.prev(m_src_vertex), + m_src_vertices.curr(m_src_vertex).dist, m_src_vertices.prev(m_src_vertex).dist, - m_width, + m_width, m_line_join, m_inner_line_join, m_miter_limit, diff --git a/agg/source/agg_vpgen_clip_polygon.cpp b/agg/source/agg_vpgen_clip_polygon.cpp index e3a0b71d821b..70f6e218c1e0 100755 --- a/agg/source/agg_vpgen_clip_polygon.cpp +++ b/agg/source/agg_vpgen_clip_polygon.cpp @@ -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. // @@ -20,7 +20,7 @@ namespace agg { //------------------------------------------------------------------------ - // Determine the clipping code of the vertex according to the + // Determine the clipping code of the vertex according to the // Cyrus-Beck line clipping algorithm // // | | @@ -36,17 +36,17 @@ namespace agg // | | // clip_box.x1 clip_box.x2 // - // + // unsigned vpgen_clip_polygon::clipping_flags(double x, double y) { - if(x < m_clip_box.x1) + if(x < m_clip_box.x1) { if(y > m_clip_box.y2) return 6; if(y < m_clip_box.y1) return 12; return 4; } - if(x > m_clip_box.x2) + if(x > m_clip_box.x2) { if(y > m_clip_box.y2) return 3; if(y < m_clip_box.y1) return 9; @@ -102,9 +102,9 @@ namespace agg } else { - m_num_vertices = clip_liang_barsky(m_x1, m_y1, - x, y, - m_clip_box, + m_num_vertices = clip_liang_barsky(m_x1, m_y1, + x, y, + m_clip_box, m_x, m_y); } diff --git a/agg/source/agg_vpgen_clip_polyline.cpp b/agg/source/agg_vpgen_clip_polyline.cpp index b3b60c96a70d..9b0bc0fc0e94 100755 --- a/agg/source/agg_vpgen_clip_polyline.cpp +++ b/agg/source/agg_vpgen_clip_polyline.cpp @@ -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. // @@ -51,18 +51,18 @@ namespace agg { double bound; - if(flags & (clip_x1 | clip_x2)) + if(flags & (clip_x1 | clip_x2)) { bound = (flags & clip_x1) ? m_clip_box.x1 : m_clip_box.x2; y = (bound - m_x1) * (m_y2 - m_y1) / (m_x2 - m_x1) + m_y1; x = bound; flags = clipping_flags_y(y); } - if(fabs(m_y2 - m_y1) < clip_epsilon && fabs(m_x2 - m_x1) < clip_epsilon) + if(fabs(m_y2 - m_y1) < clip_epsilon && fabs(m_x2 - m_x1) < clip_epsilon) { return false; } - if(flags & (clip_y1 | clip_y2)) + if(flags & (clip_y1 | clip_y2)) { bound = (flags & clip_y1) ? m_clip_box.y1 : m_clip_box.y2; x = (bound - m_y1) * (m_x2 - m_x1) / (m_y2 - m_y1) + m_x1; @@ -77,8 +77,8 @@ namespace agg { if((m_f1 & m_f2) == 0) { - if(m_f1) - { + if(m_f1) + { if(!move_point(m_x1, m_y1, m_f1)) return; if(m_f1) return; m_x[0] = m_x1; @@ -86,7 +86,7 @@ namespace agg m_cmd[0] = path_cmd_move_to; m_num_vertices = 1; } - if(m_f2) + if(m_f2) { // Move Point 2 if(!move_point(m_x2, m_y2, m_f2)) return; } diff --git a/agg/source/agg_vpgen_segmentator.cpp b/agg/source/agg_vpgen_segmentator.cpp index 97e76707c1cb..85301efa340d 100755 --- a/agg/source/agg_vpgen_segmentator.cpp +++ b/agg/source/agg_vpgen_segmentator.cpp @@ -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. // |