agg-2.5+dfsg1/ChangeLog0000644000000000000000000000003710703246330015030 0ustar00usergroup00000000000000Visit http://antigrain.com/newsagg-2.5+dfsg1/Makefile0000644000000000000000000000012510703246330014714 0ustar00usergroup00000000000000all: lib src/libagg.a: cd src; make lib: src/libagg.a clean: cd src; make clean agg-2.5+dfsg1/Makefile.AmigaOS0000644000000000000000000002624010703246330016201 0ustar00usergroup00000000000000# # Makefile for AmigaOS 4.0 # CXX = g++ CXXFLAGS = -mcrt=clib2 -O3 -Iinclude -Igpc -Ifont_freetype CXXLIBS = -Llib -lagg CC = gcc CFLAGS = -mcrt=clib2 -O3 -Igpc AR = ar ARFLAGS = cr STRIP = strip -R.comment LIBNAME = lib/libagg.a SVGNAME = bin/svg_test EXAMPLES =\ bin/aa_demo \ bin/aa_test \ bin/alpha_gradient \ bin/alpha_mask \ bin/alpha_mask2 \ bin/alpha_mask3 \ bin/bezier_div \ bin/bspline \ bin/circles \ bin/component_rendering \ bin/compositing \ bin/compositing2 \ bin/conv_contour \ bin/conv_dash_marker \ bin/conv_stroke \ bin/distortions \ bin/flash_rasterizer \ bin/flash_rasterizer2 \ bin/gamma_correction \ bin/gamma_ctrl \ bin/gamma_tuner \ bin/gouraud \ bin/gouraud_mesh \ bin/gpc_test \ bin/gradients \ bin/graph_test \ bin/idea \ bin/image_alpha \ bin/image_filters \ bin/image_filters2 \ bin/image_fltr_graph \ bin/image_perspective \ bin/image_resample \ bin/image_transforms \ bin/image1 \ bin/line_patterns_clip \ bin/line_patterns \ bin/lion \ bin/lion_lens \ bin/lion_outline \ bin/mol_view \ bin/multi_clip \ bin/pattern_fill \ bin/pattern_perspective \ bin/pattern_resample \ bin/perspective \ bin/polymorphic_renderer \ bin/raster_text \ bin/rasterizers \ bin/rasterizers2 \ bin/rounded_rect \ bin/scanline_boolean \ bin/scanline_boolean2 \ bin/simple_blur \ bin/trans_polar FREETYPE_EXAMPLES=\ bin/freetype_test \ bin/trans_curve1_ft \ bin/trans_curve2_ft PLATFORM_SRC=\ src/platform/AmigaOS/agg_platform_support.cpp FREETYPE_SRC=\ font_freetype/agg_font_freetype.cpp LIB_CXXSRC=\ src/agg_arc.cpp \ src/agg_arrowhead.cpp \ src/agg_bezier_arc.cpp \ src/agg_bspline.cpp \ src/agg_curves.cpp \ src/agg_embedded_raster_fonts.cpp \ src/agg_gsv_text.cpp \ src/agg_image_filters.cpp \ src/agg_line_aa_basics.cpp \ src/agg_line_profile_aa.cpp \ src/agg_rounded_rect.cpp \ src/agg_sqrt_tables.cpp \ src/agg_trans_affine.cpp \ src/agg_trans_double_path.cpp \ src/agg_trans_single_path.cpp \ src/agg_trans_warp_magnifier.cpp \ src/agg_vcgen_bspline.cpp \ src/agg_vcgen_contour.cpp \ src/agg_vcgen_dash.cpp \ src/agg_vcgen_markers_term.cpp \ src/agg_vcgen_smooth_poly1.cpp \ src/agg_vcgen_stroke.cpp \ src/agg_vpgen_clip_polygon.cpp \ src/agg_vpgen_clip_polyline.cpp \ src/agg_vpgen_segmentator.cpp \ src/ctrl/agg_bezier_ctrl.cpp \ src/ctrl/agg_cbox_ctrl.cpp \ src/ctrl/agg_gamma_ctrl.cpp \ src/ctrl/agg_gamma_spline.cpp \ src/ctrl/agg_polygon_ctrl.cpp \ src/ctrl/agg_rbox_ctrl.cpp \ src/ctrl/agg_scale_ctrl.cpp \ src/ctrl/agg_slider_ctrl.cpp \ src/ctrl/agg_spline_ctrl.cpp LIB_CSRC=\ gpc/gpc.c SVG_SRC=\ examples/svg_viewer/agg_svg_parser.cpp \ examples/svg_viewer/agg_svg_path_renderer.cpp \ examples/svg_viewer/agg_svg_path_tokenizer.cpp \ examples/svg_viewer/svg_test.cpp \ $(PLATFORM_SRC) PLATFORM_OBJ = $(PLATFORM_SRC:.cpp=.o) FREETYPE_OBJ = $(FREETYPE_SRC:.cpp=.o) LIB_OBJ = $(LIB_CXXSRC:.cpp=.o) $(LIB_CSRC:.c=.o) SVG_OBJ = $(SVG_SRC:.cpp=.o) # # Targets # .PHONY : help all lib examples svg freetype clean install wget help: @Echo Requirements: @Echo - AmigaOS 4.0 @Echo - SDK 51.22 @Echo - optional: libexpat.a for SVG viewer @Echo - optional: libft2.a for FreeType examples @Echo "" @Echo Targets: @Echo all - build AGG library and all tests/examples @Echo lib - build AGG library only @Echo examples - build AGG library and examples @Echo svg - build AGG library and SVG viewer @Echo freetype - build AGG library and FreeType examples @Echo clean - clean all build files @Echo install - build AGG library and install into SDK @Echo wget - download and install example test files with wget all: lib examples svg freetype $(STRIP) $(EXAMPLES) $(SVGNAME) $(FREETYPE_EXAMPLES) lib: $(LIBNAME) examples: lib $(EXAMPLES) svg: lib $(SVGNAME) freetype: lib $(FREETYPE_EXAMPLES) clean: -@Delete *>NIL: FORCE QUIET examples/#?.o -@Delete *>NIL: FORCE QUIET $(PLATFORM_OBJ) $(FREETYPE_OBJ) $(LIB_OBJ) $(SVG_OBJ) -@Delete *>NIL: FORCE QUIET ALL lib bin install: lib -@Copy CLONE $(LIBNAME) SDK:Local/clib2/lib -@Copy CLONE ALL include/#?.h SDK:Local/common/include/agg -@Copy CLONE ALL gpc/#?.h SDK:Local/common/include/gpc $(LIBNAME): $(LIB_OBJ) $(AR) $(ARFLAGS) $@ $^ $(SVGNAME): $(SVG_OBJ) $(CXX) $(CXXFLAGS) $^ -o $@ $(CXXLIBS) -lexpat # # Examples binaries # bin/aa_test: examples/aa_test.o $(PLATFORM_OBJ) $(CXX) $(CXXFLAGS) $^ -o $@ $(CXXLIBS) bin/aa_demo: examples/aa_demo.o $(PLATFORM_OBJ) $(CXX) $(CXXFLAGS) $^ -o $@ $(CXXLIBS) bin/alpha_gradient: examples/alpha_gradient.o $(PLATFORM_OBJ) $(CXX) $(CXXFLAGS) $^ -o $@ $(CXXLIBS) bin/alpha_mask: examples/alpha_mask.o examples/parse_lion.o $(PLATFORM_OBJ) $(CXX) $(CXXFLAGS) $^ -o $@ $(CXXLIBS) bin/alpha_mask2: examples/alpha_mask2.o examples/parse_lion.o $(PLATFORM_OBJ) $(CXX) $(CXXFLAGS) $^ -o $@ $(CXXLIBS) bin/alpha_mask3: examples/alpha_mask3.o examples/make_arrows.o examples/make_gb_poly.o $(PLATFORM_OBJ) $(CXX) $(CXXFLAGS) $^ -o $@ $(CXXLIBS) bin/bezier_div: examples/bezier_div.o $(PLATFORM_OBJ) $(CXX) $(CXXFLAGS) $^ -o $@ $(CXXLIBS) bin/bspline: examples/bspline.o examples/interactive_polygon.o $(PLATFORM_OBJ) $(CXX) $(CXXFLAGS) $^ -o $@ $(CXXLIBS) bin/circles: examples/circles.o $(PLATFORM_OBJ) $(CXX) $(CXXFLAGS) $^ -o $@ $(CXXLIBS) bin/component_rendering: examples/component_rendering.o $(PLATFORM_OBJ) $(CXX) $(CXXFLAGS) $^ -o $@ $(CXXLIBS) bin/compositing: examples/compositing.o $(PLATFORM_OBJ) $(CXX) $(CXXFLAGS) $^ -o $@ $(CXXLIBS) bin/compositing2: examples/compositing2.o $(PLATFORM_OBJ) $(CXX) $(CXXFLAGS) $^ -o $@ $(CXXLIBS) bin/conv_contour: examples/conv_contour.o $(PLATFORM_OBJ) $(CXX) $(CXXFLAGS) $^ -o $@ $(CXXLIBS) bin/conv_dash_marker: examples/conv_dash_marker.o $(PLATFORM_OBJ) $(CXX) $(CXXFLAGS) $^ -o $@ $(CXXLIBS) bin/conv_stroke: examples/conv_stroke.o $(PLATFORM_OBJ) $(CXX) $(CXXFLAGS) $^ -o $@ $(CXXLIBS) bin/distortions: examples/distortions.o $(PLATFORM_OBJ) $(CXX) $(CXXFLAGS) $^ -o $@ $(CXXLIBS) bin/flash_rasterizer: examples/flash_rasterizer.o $(PLATFORM_OBJ) $(CXX) $(CXXFLAGS) $^ -o $@ $(CXXLIBS) bin/flash_rasterizer2: examples/flash_rasterizer2.o $(PLATFORM_OBJ) $(CXX) $(CXXFLAGS) $^ -o $@ $(CXXLIBS) bin/gamma_correction: examples/gamma_correction.o $(PLATFORM_OBJ) $(CXX) $(CXXFLAGS) $^ -o $@ $(CXXLIBS) bin/gamma_ctrl: examples/gamma_ctrl.o $(PLATFORM_OBJ) $(CXX) $(CXXFLAGS) $^ -o $@ $(CXXLIBS) bin/gamma_tuner: examples/gamma_tuner.o $(PLATFORM_OBJ) $(CXX) $(CXXFLAGS) $^ -o $@ $(CXXLIBS) bin/gouraud: examples/gouraud.o $(PLATFORM_OBJ) $(CXX) $(CXXFLAGS) $^ -o $@ $(CXXLIBS) bin/gouraud_mesh: examples/gouraud_mesh.o $(PLATFORM_OBJ) $(CXX) $(CXXFLAGS) $^ -o $@ $(CXXLIBS) bin/gpc_test: examples/gpc_test.o examples/make_arrows.o examples/make_gb_poly.o $(PLATFORM_OBJ) $(CXX) $(CXXFLAGS) $^ -o $@ $(CXXLIBS) bin/gradients: examples/gradients.o $(PLATFORM_OBJ) $(CXX) $(CXXFLAGS) $^ -o $@ $(CXXLIBS) bin/graph_test: examples/graph_test.o $(PLATFORM_OBJ) $(CXX) $(CXXFLAGS) $^ -o $@ $(CXXLIBS) bin/idea: examples/idea.o $(PLATFORM_OBJ) $(CXX) $(CXXFLAGS) $^ -o $@ $(CXXLIBS) bin/image1: examples/image1.o $(PLATFORM_OBJ) $(CXX) $(CXXFLAGS) $^ -o $@ $(CXXLIBS) bin/image_alpha: examples/image_alpha.o $(PLATFORM_OBJ) $(CXX) $(CXXFLAGS) $^ -o $@ $(CXXLIBS) bin/image_filters: examples/image_filters.o $(PLATFORM_OBJ) $(CXX) $(CXXFLAGS) $^ -o $@ $(CXXLIBS) bin/image_filters2: examples/image_filters2.o $(PLATFORM_OBJ) $(CXX) $(CXXFLAGS) $^ -o $@ $(CXXLIBS) bin/image_fltr_graph: examples/image_fltr_graph.o $(PLATFORM_OBJ) $(CXX) $(CXXFLAGS) $^ -o $@ $(CXXLIBS) bin/image_perspective: examples/image_perspective.o examples/interactive_polygon.o $(PLATFORM_OBJ) $(CXX) $(CXXFLAGS) $^ -o $@ $(CXXLIBS) bin/image_resample: examples/image_resample.o examples/interactive_polygon.o $(PLATFORM_OBJ) $(CXX) $(CXXFLAGS) $^ -o $@ $(CXXLIBS) bin/image_transforms: examples/image_transforms.o $(PLATFORM_OBJ) $(CXX) $(CXXFLAGS) $^ -o $@ $(CXXLIBS) bin/line_patterns: examples/line_patterns.o $(PLATFORM_OBJ) $(CXX) $(CXXFLAGS) $^ -o $@ $(CXXLIBS) bin/line_patterns_clip: examples/line_patterns_clip.o $(PLATFORM_OBJ) $(CXX) $(CXXFLAGS) $^ -o $@ $(CXXLIBS) bin/lion: examples/lion.o examples/parse_lion.o $(PLATFORM_OBJ) $(CXX) $(CXXFLAGS) $^ -o $@ $(CXXLIBS) bin/lion_lens: examples/lion_lens.o examples/parse_lion.o $(PLATFORM_OBJ) $(CXX) $(CXXFLAGS) $^ -o $@ $(CXXLIBS) bin/lion_outline: examples/lion_outline.o examples/parse_lion.o $(PLATFORM_OBJ) $(CXX) $(CXXFLAGS) $^ -o $@ $(CXXLIBS) bin/mol_view: examples/mol_view.o $(PLATFORM_OBJ) $(CXX) $(CXXFLAGS) $^ -o $@ $(CXXLIBS) bin/multi_clip: examples/multi_clip.o examples/parse_lion.o $(PLATFORM_OBJ) $(CXX) $(CXXFLAGS) $^ -o $@ $(CXXLIBS) bin/pattern_fill: examples/pattern_fill.o $(PLATFORM_OBJ) $(CXX) $(CXXFLAGS) $^ -o $@ $(CXXLIBS) bin/pattern_perspective: examples/pattern_perspective.o examples/interactive_polygon.o $(PLATFORM_OBJ) $(CXX) $(CXXFLAGS) $^ -o $@ $(CXXLIBS) bin/pattern_resample: examples/pattern_resample.o examples/interactive_polygon.o $(PLATFORM_OBJ) $(CXX) $(CXXFLAGS) $^ -o $@ $(CXXLIBS) bin/perspective: examples/perspective.o examples/interactive_polygon.o examples/parse_lion.o $(PLATFORM_OBJ) $(CXX) $(CXXFLAGS) $^ -o $@ $(CXXLIBS) bin/polymorphic_renderer: examples/polymorphic_renderer.o $(PLATFORM_OBJ) $(CXX) $(CXXFLAGS) $^ -o $@ $(CXXLIBS) bin/rasterizers: examples/rasterizers.o $(PLATFORM_OBJ) $(CXX) $(CXXFLAGS) $^ -o $@ $(CXXLIBS) bin/rasterizers2: examples/rasterizers2.o $(PLATFORM_OBJ) $(CXX) $(CXXFLAGS) $^ -o $@ $(CXXLIBS) bin/raster_text: examples/raster_text.o $(PLATFORM_OBJ) $(CXX) $(CXXFLAGS) $^ -o $@ $(CXXLIBS) bin/rounded_rect: examples/rounded_rect.o $(PLATFORM_OBJ) $(CXX) $(CXXFLAGS) $^ -o $@ $(CXXLIBS) bin/scanline_boolean: examples/scanline_boolean.o examples/interactive_polygon.o $(PLATFORM_OBJ) $(CXX) $(CXXFLAGS) $^ -o $@ $(CXXLIBS) bin/scanline_boolean2: examples/scanline_boolean2.o examples/make_arrows.o examples/make_gb_poly.o $(PLATFORM_OBJ) $(CXX) $(CXXFLAGS) $^ -o $@ $(CXXLIBS) bin/simple_blur: examples/simple_blur.o examples/parse_lion.o $(PLATFORM_OBJ) $(CXX) $(CXXFLAGS) $^ -o $@ $(CXXLIBS) bin/trans_polar: examples/trans_polar.o $(PLATFORM_OBJ) $(CXX) $(CXXFLAGS) $^ -o $@ $(CXXLIBS) bin/freetype_test: examples/freetype_test.o $(FREETYPE_OBJ) $(PLATFORM_OBJ) $(CXX) $(CXXFLAGS) $^ -o $@ $(CXXLIBS) -lft2 bin/trans_curve1_ft: examples/trans_curve1_ft.o examples/interactive_polygon.o $(FREETYPE_OBJ) $(PLATFORM_OBJ) $(CXX) $(CXXFLAGS) $^ -o $@ $(CXXLIBS) -lft2 bin/trans_curve2_ft: examples/trans_curve2_ft.o examples/interactive_polygon.o $(FREETYPE_OBJ) $(PLATFORM_OBJ) $(CXX) $(CXXFLAGS) $^ -o $@ $(CXXLIBS) -lft2 # # Examples files # wget: wget http://www.antigrain.com/svg/tiger.svg move tiger.svg bin wget http://www.antigrain.com/agg.bmp move agg.bmp bin wget http://www.antigrain.com/compositing.bmp move compositing.bmp bin wget http://www.antigrain.com/spheres.bmp move spheres.bmp bin wget http://www.antigrain.com/shapes.txt move shapes.txt bin wget http://www.antigrain.com/1.sdf move 1.sdf bin wget http://www.antigrain.com/line_patterns.bmp.zip xadunfile line_patterns.bmp.zip bin overwrite delete line_patterns.bmp.zip wget http://www.antigrain.com/timesi.zip xadunfile timesi.zip bin overwrite delete timesi.zip # # Pattern Rules # %.o: %.cpp @MakeDir lib bin force $(CXX) -c $(CXXFLAGS) $< -o $@ %.o: %.c @MakeDir lib bin force $(CC) -c $(CFLAGS) $< -o $@ agg-2.5+dfsg1/Makefile.am0000644000000000000000000000112710703246330015313 0ustar00usergroup00000000000000SUBDIRS = gpc src font_freetype font_win32_tt include examples pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libagg.pc EXTRA_DIST = Makefile.AmigaOS \ Makefile.in.BeOS \ Makefile.in.CYGWIN_NT-5.0 \ Makefile.in.CYGWIN_NT-5.1 \ Makefile.in.Darwin \ Makefile.in.Darwin.SDL \ Makefile.in.IRIX64 \ Makefile.in.Linux \ Makefile.in.Linux.SDL \ Makefile.in.MINGW32_NT-5.0 \ Makefile.in.MINGW32_NT-5.1 \ Makefile.in.SunOS # M4 macro file for inclusion with autoconf m4datadir = $(datadir)/aclocal m4data_DATA = libagg.m4 agg-2.5+dfsg1/Makefile.in.BeOS0000644000000000000000000000012110703246330016104 0ustar00usergroup00000000000000AGGLIBS= -lagg AGGCXXFLAGS = -O1 CXX = g++ C = cc LIB = ar -cru .PHONY : clean agg-2.5+dfsg1/Makefile.in.CYGWIN_NT-5.00000644000000000000000000000020110703246330017214 0ustar00usergroup00000000000000AGGLIBS= -lagg AGGCXXFLAGS = -O3 -I/usr/X11R6/include -L/usr/X11R6/lib CXX = g++ C = gcc #CXX = icc LIB = ar cr .PHONY : clean agg-2.5+dfsg1/Makefile.in.CYGWIN_NT-5.10000644000000000000000000000020110703246330017215 0ustar00usergroup00000000000000AGGLIBS= -lagg AGGCXXFLAGS = -O3 -I/usr/X11R6/include -L/usr/X11R6/lib CXX = g++ C = gcc #CXX = icc LIB = ar cr .PHONY : clean agg-2.5+dfsg1/Makefile.in.Darwin0000644000000000000000000000020310703246330016541 0ustar00usergroup00000000000000AGGLIBS= -lagg AGGCXXFLAGS = -O3 -I/usr/X11R6/include -L/usr/X11R6/lib CXX = g++ C = gcc #CXX = icc LIB = ar cr -s .PHONY : clean agg-2.5+dfsg1/Makefile.in.Darwin.SDL0000644000000000000000000000033110703246330017164 0ustar00usergroup00000000000000AGGLIBS= -lagg -L/usr/local/lib -lSDLmain -lSDL -framework Cocoa -framework OpenGL AGGCXXFLAGS = -O3 -I/Library/Frameworks/SDL.framework/Headers -L/usr/lib CXX = g++ C = gcc #CXX = icc LIB = ar cr -s .PHONY : clean agg-2.5+dfsg1/Makefile.in.IRIX640000644000000000000000000000011610703246330016245 0ustar00usergroup00000000000000AGGLIBS= -lagg AGGCXXFLAGS = CXX = CC C = cc LIB = CC -ar -o .PHONY : clean agg-2.5+dfsg1/Makefile.in.Linux0000644000000000000000000000020110703246330016412 0ustar00usergroup00000000000000AGGLIBS= -lagg AGGCXXFLAGS = -O3 -I/usr/X11R6/include -L/usr/X11R6/lib CXX = g++ C = gcc #CXX = icc LIB = ar cr .PHONY : clean agg-2.5+dfsg1/Makefile.in.Linux.SDL0000644000000000000000000000017610703246330017046 0ustar00usergroup00000000000000AGGLIBS= -lagg -lSDL AGGCXXFLAGS = -O3 -I/usr/include/SDL -L/usr/lib CXX = g++ C = gcc #CXX = icc LIB = ar cr .PHONY : clean agg-2.5+dfsg1/Makefile.in.MINGW32_NT-5.00000644000000000000000000000013310703246330017246 0ustar00usergroup00000000000000AGGLIBS= -lagg AGGCXXFLAGS = -O3 CXX = g++ C = gcc #CXX = icc LIB = ar cr .PHONY : clean agg-2.5+dfsg1/Makefile.in.MINGW32_NT-5.10000644000000000000000000000013310703246330017247 0ustar00usergroup00000000000000AGGLIBS= -lagg AGGCXXFLAGS = -O3 CXX = g++ C = gcc #CXX = icc LIB = ar cr .PHONY : clean agg-2.5+dfsg1/Makefile.in.SunOS0000644000000000000000000000017510703246330016334 0ustar00usergroup00000000000000AGGLIBS= -lagg AGGCXXFLAGS = -O3 -I/usr/openwin/include -L/usr/openwin/lib CXX = CC C = cc LIB = CC -xar -o .PHONY : clean agg-2.5+dfsg1/authors0000644000000000000000000000017110703246330014665 0ustar00usergroup00000000000000Anti-Grain Geometry (AGG) - Version 2.5 A high quality rendering engine for C++ Copyright (C) 2002-2006 Maxim Shemanarev agg-2.5+dfsg1/autogen.sh0000644000000000000000000000052610703246330015257 0ustar00usergroup00000000000000# autogen.sh # # invoke the auto* tools to create the configuration/build system # build aclocal.m4 aclocal # build config.h autoheader # build the configure script autoconf # set up libtool libtoolize --force # invoke automake automake --foreign --add-missing --ignore-deps # and finally invoke our new configure ./configure $* # end agg-2.5+dfsg1/configure.in0000644000000000000000000001150610703246330015572 0ustar00usergroup00000000000000AC_INIT(src/agg_arc.cpp) # give me a source file, any source file... AC_CANONICAL_TARGET AC_CONFIG_HEADERS(include/config.h) AM_INIT_AUTOMAKE(agg, 2.5.0) dnl Checks for programs. AC_PROG_CC AC_PROG_CXX AC_ISC_POSIX AM_C_PROTOTYPES if test "x$U" != "x"; then AC_MSG_ERROR(Compiler not ANSI compliant) fi AM_PROG_LIBTOOL AC_PROG_INSTALL dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_ARG_ENABLE(examples, AC_HELP_STRING([--enable-examples],[Antigrain examples])) AM_CONDITIONAL(ENABLE_EXAMPLES,test x$enable_examples != xno) AC_ARG_ENABLE(ctrl, AC_HELP_STRING([--enable-ctrl],[a gui libray used in examples])) AC_ARG_ENABLE(platform, AC_HELP_STRING([--enable-platform],[portable platform layers])) if test x$enable_examples != xno ; then enable_platform="yes" fi if test x$enable_platform != xno ; then enable_ctrl="yes" fi AM_CONDITIONAL(ENABLE_CTRL,test x$enable_ctrl != xno) # used as platform library in examples: # todo, make the PREFERED_PLATFORM selectable, after the set of possible # Platforms to link the examples have been evaluated. PREFERED_PLATFORM=X11 case "$host" in *darwin* ) OSX_LIBS="-framework Carbon -framework QuickTime" OSX_CFLAGS="-I/System/Library/Frameworks/Carbon.framework/Headers -I/System/Library/Frameworks/QuickTime.framework/Headers " AC_SUBST(OSX_CFLAGS) AC_SUBST(OSX_LIBS) osx_host=yes PREFERED_PLATFORM=mac ;; dnl #### Check if we are compiling for win32 ##### *mingw*) win32_host=yes WINDOWS_LIBS=-lgdi32 WINDOWS_CFLAGS= AC_SUBST(WINDOWS_CFLAGS) AC_SUBST(WINDOWS_LIBS) PREFERED_PLATFORM=win32 ;; esac AM_CONDITIONAL(ENABLE_WIN32,[test x$win32_host = xyes -a x$enable_platform != xno ]) AM_CONDITIONAL(ENABLE_OSX,[test x$osx_host = xyes -a x$enable_platform != xno ]) dnl then enable font_win32tt AC_ARG_ENABLE(win32tt, AC_HELP_STRING([--enable-win32tt],[Win32 TrueType font support library]), enable_tt=$enable_win32tt, enable_tt=$win32_host) AM_CONDITIONAL(ENABLE_WIN32_TT, test x$enable_tt = xyes ) dnl ######### Check for FT2: ##################### ft_enabled="" PKG_CHECK_MODULES([FREETYPE], freetype2, [ft_enabled="yes"], AC_MSG_WARN([*** Freetype2 not found! Building without font library.]) ) AC_ARG_ENABLE(freetype, AC_HELP_STRING([--enable-freetype],[freetype font support library]), ft_enabled=$enable_freetype) AM_CONDITIONAL(ENABLE_FT,[test xyes = x$ft_enabled]) dnl ############################################### dnl ######### Ask for GPC: ####################### AC_ARG_ENABLE(gpc, AC_HELP_STRING([--enable-gpc],[gpc polygon clipper library]) ) AM_CONDITIONAL(ENABLE_GPC,[test xyes = x$enable_gpc]) dnl ############################################### dnl ######### Check for SDL: ##################### dnl the sdl script pollutes our global values: temp_LIBS="$LIBS" temp_CFLAGS="$CFLAGS" temp_CXXFLAGS="$CXXFLAGS" sdl_enabled="" SDL_VERSION=1.2.0 AM_PATH_SDL($SDL_VERSION, [sdl_enabled="yes"], AC_MSG_WARN([*** SDL version $SDL_VERSION not found! Omitting sdl layer.]) ) dnl ### Restore old values CFLAGS=$temp_CFLAGS CXXFLAGS=$temp_CXXFLAGS LIBS=$temp_LIBS dnl ### the sdl script already does that: dnl AC_SUBST(SDL_CFLAGS) dnl AC_SUBST(SDL_LIBS) AM_CONDITIONAL(ENABLE_SDL,[test xyes = x$sdl_enabled -a xno != x$enable_platform -a x$win32_host != xyes]) dnl ############################################### dnl ######### Checking for X11: ################## AC_PATH_X if test "$no_x" = "yes"; then AC_MSG_WARN([*** X11 not found! Omitting X11 layer.]) fi AM_CONDITIONAL(ENABLE_X11,[test x$no_x = x -a xno != x$enable_platform -a x$win32_host != xyes]) AC_SUBST(x_includes) AC_SUBST(x_libraries) dnl ############################################### dnl Settung up library version AGG_LIB_VERSION="2:4:0" dnl current-´ / / dnl revision--´ / dnl age---´ dnl Update the version information only immediately before a public release of antigrain dnl If the library source code has changed, increment revision (c:r:a becomes c:r+1:a). dnl If any interfaces have been added, removed, or changed since the last update, dnl increment current, and set revision to 0. dnl If any interfaces have been added since the last public release, then increment age. dnl If any interfaces have been removed since the last public release, then set age to 0. AC_SUBST(AGG_LIB_VERSION) AC_SUBST(PREFERED_PLATFORM) AC_OUTPUT( Makefile libagg.pc gpc/Makefile font_freetype/Makefile font_win32_tt/Makefile src/Makefile src/ctrl/Makefile src/platform/Makefile src/platform/X11/Makefile src/platform/sdl/Makefile src/platform/mac/Makefile src/platform/win32/Makefile src/platform/BeOS/Makefile src/platform/AmigaOS/Makefile include/Makefile include/ctrl/Makefile include/util/Makefile include/platform/Makefile examples/Makefile ) agg-2.5+dfsg1/copying0000644000000000000000000004310310703246330014652 0ustar00usergroup00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. agg-2.5+dfsg1/distclean0000755000000000000000000000152010703246330015150 0ustar00usergroup00000000000000#! /bin/sh find . -iname '*.[oa]' -exec \rm -f {} \; find . -iname '*.ppm' -exec \rm -f {} \; find . -iname '*~' -exec \rm -f {} \; find . -iname 'gamma.*' -exec \rm -f {} \; find . -iname Debug -exec \rm -rf {} \; find . -iname Release -exec \rm -rf {} \; find . -iname '*.exe' -exec \rm -rf {} \; find . -iname '*.lib' -exec \rm -rf {} \; find . -iname '*.dll' -exec \rm -rf {} \; find . -iname '*.obj' -exec \rm -rf {} \; find . -iname '*.aps' -exec \rm -rf {} \; find . -iname '*.clw' -exec \rm -rf {} \; find . -iname '*.ilk' -exec \rm -rf {} \; find . -iname '*.ncb' -exec \rm -rf {} \; find . -iname '*.opt' -exec \rm -rf {} \; find . -iname '*.plg' -exec \rm -rf {} \; find . -iname '*.pch' -exec \rm -rf {} \; find . -iname '*.idb' -exec \rm -rf {} \; find . -iname '*.pdb' -exec \rm -rf {} \; find . -iname '*.res' -exec \rm -rf {} \; agg-2.5+dfsg1/examples/0000755000000000000000000000000010703246330015074 5ustar00usergroup00000000000000agg-2.5+dfsg1/examples/BeOS/0000755000000000000000000000000010703246330015664 5ustar00usergroup00000000000000agg-2.5+dfsg1/examples/BeOS/Makefile0000644000000000000000000003201610703246330017326 0ustar00usergroup00000000000000include ../../Makefile.in.$(shell uname) PLATFORM=BeOS PLATFORMSOURCES=../../src/platform/$(PLATFORM)/agg_platform_support.o CXXFLAGS= $(AGGCXXFLAGS) -I../../include \ -L../../src \ $(PIXFMT) CXXFREETYPEFLAGS= $(AGGCXXFLAGS) -Wall \ -I../../include \ -I../../font_freetype \ -I/boot/home/config/include/ \ -L../../src \ -L/boot/home/config/lib/ \ $(PIXFMT) LIBS = $(AGGLIBS) -lroot -lbe -ltranslation base: cd ../../src/; make make aa_demo make aa_test make alpha_gradient make alpha_mask make alpha_mask2 make alpha_mask3 make bezier_div make blur make blend_color make bspline make circles make component_rendering make conv_contour make conv_dash_marker make conv_stroke make flash_rasterizer make flash_rasterizer2 make gamma_correction make gamma_ctrl make gamma_tuner make gouraud make gouraud_mesh make gradient_focal make gradients make graph_test make idea make lion make lion_lens make lion_outline make multi_clip make pattern_fill make perspective make polymorphic_renderer make raster_text make rasterizers make rasterizers2 make rasterizer_compound make rounded_rect make scanline_boolean make scanline_boolean2 make simple_blur make trans_polar make image_alpha make image_filters make image_filters2 make image_fltr_graph make image_perspective make image_resample make image_transforms make image1 make distortions make pattern_perspective make compositing make compositing2 make line_patterns make line_patterns_clip make mol_view freetype: make freetype_test make trans_curve1_ft make trans_curve2_ft gpc: make gpc_test all: make base make freetype make gpc aa_demo: ../aa_demo.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o aa_demo $(LIBS) aa_test: ../aa_test.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o aa_test $(LIBS) alpha_gradient: ../alpha_gradient.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o alpha_gradient $(LIBS) alpha_mask: ../alpha_mask.o ../parse_lion.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o alpha_mask $(LIBS) alpha_mask2: ../alpha_mask2.o ../parse_lion.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o alpha_mask2 $(LIBS) alpha_mask3: ../alpha_mask3.o ../make_arrows.o ../make_gb_poly.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o alpha_mask3 $(LIBS) bezier_div: ../bezier_div.o ../interactive_polygon.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o bezier_div $(LIBS) blur: ../blur.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o blur $(LIBS) blend_color: ../blend_color.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o blend_color $(LIBS) bspline: ../bspline.o ../interactive_polygon.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o bspline $(LIBS) circles: ../circles.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o circles $(LIBS) component_rendering: ../component_rendering.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o component_rendering $(LIBS) compositing: ../compositing.o $(PLATFORMSOURCES) compositing.ppm $(CXX) $(CXXFLAGS) ../compositing.o $(PLATFORMSOURCES) -o compositing $(LIBS) compositing2: ../compositing2.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o compositing2 $(LIBS) conv_contour: ../conv_contour.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o conv_contour $(LIBS) conv_dash_marker: ../conv_dash_marker.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o conv_dash_marker $(LIBS) conv_stroke: ../conv_stroke.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o conv_stroke $(LIBS) distortions: ../distortions.o $(PLATFORMSOURCES) spheres.ppm $(CXX) $(CXXFLAGS) ../distortions.o $(PLATFORMSOURCES) -o distortions $(LIBS) flash_rasterizer: ../flash_rasterizer.o $(PLATFORMSOURCES) shapes.txt $(CXX) $(CXXFLAGS) ../flash_rasterizer.o $(PLATFORMSOURCES) -o flash_rasterizer $(LIBS) flash_rasterizer2: ../flash_rasterizer2.o $(PLATFORMSOURCES) shapes.txt $(CXX) $(CXXFLAGS) ../flash_rasterizer2.o $(PLATFORMSOURCES) -o flash_rasterizer2 $(LIBS) gamma_correction: ../gamma_correction.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o gamma_correction $(LIBS) gamma_ctrl: ../gamma_ctrl.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o gamma_ctrl $(LIBS) gamma_tuner: ../gamma_tuner.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o gamma_tuner $(LIBS) gouraud: ../gouraud.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o gouraud $(LIBS) gouraud_mesh: ../gouraud_mesh.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o gouraud_mesh $(LIBS) gradient_focal: ../gradient_focal.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o gradient_focal $(LIBS) gradients: ../gradients.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o gradients $(LIBS) graph_test: ../graph_test.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o graph_test $(LIBS) idea: ../idea.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o idea $(LIBS) image_alpha: ../image_alpha.o $(PLATFORMSOURCES) spheres.ppm $(CXX) $(CXXFLAGS) ../image_alpha.o $(PLATFORMSOURCES) -o image_alpha $(LIBS) image_filters: ../image_filters.o $(PLATFORMSOURCES) spheres.ppm $(CXX) $(CXXFLAGS) ../image_filters.o $(PLATFORMSOURCES) -o image_filters $(LIBS) image_filters2: ../image_filters2.o $(PLATFORMSOURCES) spheres.ppm $(CXX) $(CXXFLAGS) ../image_filters2.o $(PLATFORMSOURCES) -o image_filters2 $(LIBS) image_fltr_graph: ../image_fltr_graph.o $(PLATFORMSOURCES) spheres.ppm $(CXX) $(CXXFLAGS) ../image_fltr_graph.o $(PLATFORMSOURCES) -o image_fltr_graph $(LIBS) image_perspective: ../image_perspective.o ../interactive_polygon.o $(PLATFORMSOURCES) spheres.ppm $(CXX) $(CXXFLAGS) ../image_perspective.o ../interactive_polygon.o $(PLATFORMSOURCES) -o image_perspective $(LIBS) image_resample: ../image_resample.o ../interactive_polygon.o $(PLATFORMSOURCES) spheres.ppm $(CXX) $(CXXFLAGS) ../image_resample.o ../interactive_polygon.o $(PLATFORMSOURCES) -o image_resample $(LIBS) image_transforms: ../image_transforms.o $(PLATFORMSOURCES) spheres.ppm $(CXX) $(CXXFLAGS) ../image_transforms.o $(PLATFORMSOURCES) -o image_transforms $(LIBS) image1: ../image1.o $(PLATFORMSOURCES) spheres.ppm $(CXX) $(CXXFLAGS) ../image1.o $(PLATFORMSOURCES) -o image1 $(LIBS) line_patterns: ../line_patterns.o $(PLATFORMSOURCES) 1.ppm 2.ppm 3.ppm 4.ppm 5.ppm 6.ppm 7.ppm 8.ppm 9.ppm $(CXX) $(CXXFLAGS) ../line_patterns.o $(PLATFORMSOURCES) -o line_patterns $(LIBS) line_patterns_clip: ../line_patterns_clip.o $(PLATFORMSOURCES) 1.ppm $(CXX) $(CXXFLAGS) ../line_patterns_clip.o $(PLATFORMSOURCES) -o line_patterns_clip $(LIBS) lion: ../lion.o ../parse_lion.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o lion $(LIBS) lion_lens: ../lion_lens.o ../parse_lion.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o lion_lens $(LIBS) lion_outline: ../lion_outline.o ../parse_lion.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o lion_outline $(LIBS) mol_view: ../mol_view.o $(PLATFORMSOURCES) 1.sdf $(CXX) $(CXXFLAGS) ../mol_view.o $(PLATFORMSOURCES) -o mol_view $(LIBS) multi_clip: ../multi_clip.o ../parse_lion.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o multi_clip $(LIBS) pattern_fill: ../pattern_fill.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o pattern_fill $(LIBS) pattern_perspective: ../pattern_perspective.o ../interactive_polygon.o $(PLATFORMSOURCES) agg.ppm $(CXX) $(CXXFLAGS) ../pattern_perspective.o ../interactive_polygon.o $(PLATFORMSOURCES) -o pattern_perspective $(LIBS) perspective: ../perspective.o ../interactive_polygon.o ../parse_lion.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o perspective $(LIBS) polymorphic_renderer: ../polymorphic_renderer.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o polymorphic_renderer $(LIBS) raster_text: ../raster_text.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o raster_text $(LIBS) rasterizers: ../rasterizers.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o rasterizers $(LIBS) rasterizers2: ../rasterizers2.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o rasterizers2 $(LIBS) rasterizer_compound: ../rasterizer_compound.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o rasterizer_compound $(LIBS) rounded_rect: ../rounded_rect.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o rounded_rect $(LIBS) scanline_boolean: ../scanline_boolean.o ../interactive_polygon.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o scanline_boolean $(LIBS) scanline_boolean2: ../scanline_boolean2.o ../make_arrows.o ../make_gb_poly.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o scanline_boolean2 $(LIBS) simple_blur: ../simple_blur.o ../parse_lion.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o simple_blur $(LIBS) trans_polar: ../trans_polar.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o trans_polar $(LIBS) freetype_test: ../freetype_test.o ../../font_freetype/agg_font_freetype.o $(PLATFORMSOURCES) timesi.ttf $(CXX) $(CXXFREETYPEFLAGS) ../freetype_test.o ../../font_freetype/agg_font_freetype.o $(PLATFORMSOURCES) -o freetype_test $(LIBS) -lfreetype trans_curve1_ft: ../trans_curve1_ft.o ../../font_freetype/agg_font_freetype.o ../interactive_polygon.o $(PLATFORMSOURCES) timesi.ttf $(CXX) $(CXXFLAGS) ../trans_curve1_ft.o ../../font_freetype/agg_font_freetype.o ../interactive_polygon.o $(PLATFORMSOURCES) -o trans_curve1_ft $(LIBS) -lfreetype trans_curve2_ft: ../trans_curve2_ft.o ../../font_freetype/agg_font_freetype.o ../interactive_polygon.o $(PLATFORMSOURCES) timesi.ttf $(CXX) $(CXXFLAGS) ../trans_curve2_ft.o ../../font_freetype/agg_font_freetype.o ../interactive_polygon.o $(PLATFORMSOURCES) -o trans_curve2_ft $(LIBS) -lfreetype gpc_test: ../gpc_test.o ../make_arrows.o ../make_gb_poly.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o gpc_test $(LIBS) clean: rm -f ../*.o rm -f ../../src/platform/$(PLATFORM)/agg_platform_support.o rm -rf aa_demo rm -rf aa_test rm -rf alpha_gradient rm -rf alpha_mask rm -rf alpha_mask2 rm -rf alpha_mask3 rm -rf bezier_div rm -rf bspline rm -rf blur rn -rf blend_color rm -rf circles rm -rf component_rendering rm -rf conv_contour rm -rf conv_dash_marker rm -rf conv_stroke rm -rf flash_rasterizer rm -rf flash_rasterizer2 rm -rf gamma_correction rm -rf gamma_ctrl rm -rf gamma_tuner rm -rf gouraud rm -rf gouraud_mesh rm -rf gradient_focal rm -rf gradients rm -rf graph_test rm -rf idea rm -rf lion rm -rf lion_lens rm -rf lion_outline rm -rf multi_clip rm -rf pattern_fill rm -rf perspective rm -rf polymorphic_renderer rm -rf raster_text rm -rf rasterizers rm -rf rasterizers2 rm -rf rounded_rect rm -rf scanline_boolean rm -rf scanline_boolean2 rm -rf simple_blur rm -rf trans_polar rm -rf image_alpha rm -rf image_filters rm -rf image_filters2 rm -rf image_fltr_graph rm -rf image_perspective rm -rf image_resample rm -rf image_transforms rm -rf image1 rm -rf distortions rm -rf pattern_perspective rm -rf compositing rm -rf line_patterns rm -rf line_patterns_clip rm -rf mol_view rm -rf freetype_test rm -rf trans_curve1_ft rm -rf trans_curve2_ft rm -rf gpc_test agg.ppm: @echo "Required file missing!!" @echo "Please download http://www.antigrain.com/agg.ppm to /examples/X11/" @echo "Attempting to retrieve via wget: (will fail if wget is not installed)" wget http://www.antigrain.com/agg.ppm compositing.ppm: @echo "Required file missing!!" @echo "Please download http://www.antigrain.com/compositing.ppm to /examples/X11/" @echo "Attempting to retrieve via wget: (will fail if wget is not installed)" wget http://www.antigrain.com/compositing.ppm spheres.ppm: @echo "Required file missing!!" @echo "Please download http://www.antigrain.com/spheres.ppm to /examples/X11/" @echo "Attempting to retrieve file: (will fail if wget is not installed)" wget http://www.antigrain.com/spheres.ppm shapes.txt: @echo "Required file missing!!" @echo "Please download http://www.antigrain.com/shapes.txt to /examples/X11/" @echo "Attempting to retrieve file: (will fail if wget is not installed)" wget http://www.antigrain.com/shapes.txt 1.sdf: @echo "Required file missing!!" @echo "Please download http://www.antigrain.com/1.sdf to /examples/macosx_carbon/" @echo "Attempting to retrieve file: (will fail if wget is not installed)" wget http://www.antigrain.com/1.sdf 1.ppm: @echo "Required file missing!!" @echo "Please download http://www.antigrain.com/line_patterns.tar.gz to /examples/X11/ and decompress it" @echo "Attempting to retrieve file: (will fail if wget is not installed)" wget http://www.antigrain.com/line_patterns.tar.gz gunzip line_patterns.tar.gz tar -xvf line_patterns.tar timesi.ttf: @echo "Required file missing!!" @echo "Please download http://www.antigrain.com/timesi.zip to /examples/X11/ and decompress it" @echo "Attempting to retrieve file: (will fail if wget is not installed)" wget http://www.antigrain.com/timesi.zip unzip -o timesi.zip ../freetype_test.o: ../freetype_test.cpp @echo \< $*.cpp \> $(CXX) -c $(CXXFREETYPEFLAGS) $*.cpp -o $@ ../trans_curve1_ft.o: ../trans_curve1_ft.cpp @echo \< $*.cpp \> $(CXX) -c $(CXXFREETYPEFLAGS) $*.cpp -o $@ ../trans_curve2_ft.o: ../trans_curve2_ft.cpp @echo \< $*.cpp \> $(CXX) -c $(CXXFREETYPEFLAGS) $*.cpp -o $@ ../../font_freetype/agg_font_freetype.o: ../../font_freetype/agg_font_freetype.cpp @echo \< $*.cpp \> $(CXX) -c $(CXXFREETYPEFLAGS) $*.cpp -o $@ ../gpc_test.o: ../gpc_test.cpp @echo \< $*.cpp \> $(CXX) -c $(CXXFLAGS) -I../../gpc $*.cpp -o $@ %.o: %.cpp @echo \< $*.cpp \> $(CXX) -c $(CXXFLAGS) $*.cpp -o $@ .PHONY : clean agg-2.5+dfsg1/examples/BeOS/readme.txt0000644000000000000000000000173310703246330017666 0ustar00usergroup00000000000000The Anti-Grain Geometry Project A high quality rendering engine for C++ http://antigrain.com Anti-Grain Geometry Copyright (C) 2002-2005 Maxim Shemanarev (McSeem) 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. By default only the examples that do not require extra dependancies are built. with the following commands: cd (AGGDIRECTORY)/examples/BeOS make clean make Some examples (freetype_test, trans_curve1_ft and trans_curve2_ft) require the Freetype Library, and can be built with: make freetype There is also an example (gpc_test) that requires the GPC library, build it with: make gpc Of course, to build ALL examples run: make all Alternatively you can also build the examples one by one, using the example name directly: make aa_demo make aa_test ... agg-2.5+dfsg1/examples/Makefile.am0000644000000000000000000004367110703246330017143 0ustar00usergroup00000000000000EXTRA_DIST= X11/Makefile interactive_polygon.h pixel_formats.h win32_api/aa_demo/Makefile win32_api/aa_demo/aa_demo.dsp win32_api/aa_demo/aa_demo.dsw win32_api/Makefile win32_api/examples.dsw win32_api/aa_test/Makefile win32_api/aa_test/aa_test.dsp win32_api/aa_test/aa_test.dsw win32_api/alpha_gradient/Makefile win32_api/alpha_gradient/alpha_gradient.dsp win32_api/alpha_gradient/alpha_gradient.dsw win32_api/alpha_mask/Makefile win32_api/alpha_mask/alpha_mask.dsp win32_api/alpha_mask/alpha_mask.dsw win32_api/alpha_mask2/Makefile win32_api/alpha_mask2/alpha_mask2.dsp win32_api/alpha_mask2/alpha_mask2.dsw win32_api/alpha_mask3/Makefile win32_api/alpha_mask3/alpha_mask3.dsp win32_api/alpha_mask3/alpha_mask3.dsw win32_api/bezier_div/Makefile win32_api/bezier_div/bezier_div.dsp win32_api/bezier_div/bezier_div.dsw win32_api/bspline/Makefile win32_api/bspline/bspline.dsp win32_api/bspline/bspline.dsw win32_api/circles/Makefile win32_api/circles/circles.dsp win32_api/circles/circles.dsw win32_api/component_rendering/Makefile win32_api/component_rendering/component_rendering.dsp win32_api/component_rendering/component_rendering.dsw win32_api/compositing/Makefile win32_api/compositing/compositing.dsp win32_api/compositing/compositing.dsw win32_api/compositing/readme win32_api/conv_contour/Makefile win32_api/conv_contour/conv_contour.dsp win32_api/conv_contour/conv_contour.dsw win32_api/conv_dash_marker/Makefile win32_api/conv_dash_marker/conv_dash_marker.dsp win32_api/conv_dash_marker/conv_dash_marker.dsw win32_api/conv_stroke/Makefile win32_api/conv_stroke/conv_stroke.dsp win32_api/conv_stroke/conv_stroke.dsw win32_api/distortions/Makefile win32_api/distortions/distortions.dsp win32_api/distortions/distortions.dsw win32_api/distortions/readme win32_api/freetype_test/Makefile win32_api/freetype_test/freetype_test.dsp win32_api/freetype_test/freetype_test.dsw win32_api/freetype_test/readme win32_api/gamma_correction/Makefile win32_api/gamma_correction/gamma_correction.dsp win32_api/gamma_correction/gamma_correction.dsw win32_api/gamma_ctrl/Makefile win32_api/gamma_ctrl/gamma_ctrl.dsp win32_api/gamma_ctrl/gamma_ctrl.dsw win32_api/gouraud/Makefile win32_api/gouraud/gouraud.dsp win32_api/gouraud/gouraud.dsw win32_api/gpc_test/Makefile win32_api/gpc_test/gpc_test.dsp win32_api/gpc_test/gpc_test.dsw win32_api/gradients/Makefile win32_api/gradients/gradients.dsp win32_api/gradients/gradients.dsw win32_api/gradients/settings.dat win32_api/graph_test/Makefile win32_api/graph_test/graph_test.dsp win32_api/graph_test/graph_test.dsw win32_api/idea/Makefile win32_api/idea/idea.dsp win32_api/idea/idea.dsw win32_api/image1/Makefile win32_api/image1/image1.dsp win32_api/image1/image1.dsw win32_api/image1/readme win32_api/image_alpha/Makefile win32_api/image_alpha/image_alpha.dsp win32_api/image_alpha/image_alpha.dsw win32_api/image_alpha/readme win32_api/image_filters/Makefile win32_api/image_filters/image_filters.dsp win32_api/image_filters/image_filters.dsw win32_api/image_filters/readme win32_api/image_filters2/Makefile win32_api/image_filters2/image_filters2.dsp win32_api/image_filters2/image_filters2.dsw win32_api/image_filters2/readme win32_api/image_fltr_graph/Makefile win32_api/image_fltr_graph/image_fltr_graph.dsp win32_api/image_fltr_graph/image_fltr_graph.dsw win32_api/image_perspective/Makefile win32_api/image_perspective/image_perspective.dsp win32_api/image_perspective/image_perspective.dsw win32_api/image_perspective/readme win32_api/image_resample/Makefile win32_api/image_resample/image_resample.dsp win32_api/image_resample/image_resample.dsw win32_api/image_resample/readme win32_api/image_transforms/Makefile win32_api/image_transforms/image_transforms.dsp win32_api/image_transforms/image_transforms.dsw win32_api/image_transforms/readme! win32_api/line_patterns/Makefile win32_api/line_patterns/line_patterns.dsp win32_api/line_patterns/line_patterns.dsw win32_api/lion/Makefile win32_api/lion/lion.dsp win32_api/lion/lion.dsw win32_api/lion_lens/Makefile win32_api/lion_lens/lion_lens.dsp win32_api/lion_lens/lion_lens.dsw win32_api/lion_outline/Makefile win32_api/lion_outline/lion_outline.dsp win32_api/lion_outline/lion_outline.dsw win32_api/mol_view/Makefile win32_api/mol_view/mol_view.dsp win32_api/mol_view/mol_view.dsw win32_api/mol_view/readme win32_api/multi_clip/Makefile win32_api/multi_clip/multi_clip.dsp win32_api/multi_clip/multi_clip.dsw win32_api/pattern_fill/Makefile win32_api/pattern_fill/pattern_fill.dsp win32_api/pattern_fill/pattern_fill.dsw win32_api/pattern_perspective/pattern_perspective.dsp win32_api/pattern_perspective/pattern_perspective.dsw win32_api/pattern_resample/Makefile win32_api/pattern_resample/pattern_resample.dsp win32_api/pattern_resample/pattern_resample.dsw win32_api/perspective/Makefile win32_api/perspective/perspective.dsp win32_api/perspective/perspective.dsw win32_api/polymorphic_renderer/Makefile win32_api/polymorphic_renderer/polymorphic_renderer.dsp win32_api/polymorphic_renderer/polymorphic_renderer.dsw win32_api/pure_api/StdAfx.cpp win32_api/pure_api/StdAfx.h win32_api/pure_api/pure_api.cpp win32_api/pure_api/pure_api.dsp win32_api/pure_api/pure_api.dsw win32_api/pure_api/pure_api.h win32_api/pure_api/pure_api.ico win32_api/pure_api/pure_api.rc win32_api/pure_api/resource.h win32_api/pure_api/small.ico win32_api/raster_text/Makefile win32_api/raster_text/raster_text.dsp win32_api/raster_text/raster_text.dsw win32_api/rasterizers/Makefile win32_api/rasterizers/rasterizers.dsp win32_api/rasterizers/rasterizers.dsw win32_api/rasterizers2/Makefile win32_api/rasterizers2/rasterizers2.dsp win32_api/rasterizers2/rasterizers2.dsw win32_api/rounded_rect/Makefile win32_api/rounded_rect/rounded_rect.dsp win32_api/rounded_rect/rounded_rect.dsw win32_api/scanline_boolean/Makefile win32_api/scanline_boolean/scanline_boolean.dsp win32_api/scanline_boolean/scanline_boolean.dsw win32_api/scanline_boolean2/Makefile win32_api/scanline_boolean2/scanline_boolean2.dsp win32_api/scanline_boolean2/scanline_boolean2.dsw win32_api/simple_blur/Makefile win32_api/simple_blur/simple_blur.dsp win32_api/simple_blur/simple_blur.dsw win32_api/trans_curve1/Makefile win32_api/trans_curve1/trans_curve1.dsp win32_api/trans_curve1/trans_curve1.dsw win32_api/trans_curve2/Makefile win32_api/trans_curve2/trans_curve2.dsp win32_api/trans_curve2/trans_curve2.dsw win32_api/trans_polar/Makefile win32_api/trans_polar/trans_polar.dsp win32_api/trans_polar/trans_polar.dsw win32_api/truetype_test/Makefile win32_api/truetype_test/truetype_test.dsp win32_api/truetype_test/truetype_test.dsw if ENABLE_EXAMPLES if ENABLE_WIN32_TT W32TTP=truetype_test trans_curve1 trans_curve2 endif if ENABLE_FT FTP=freetype_test ### these dont work : trans_curve2_ft trans_curve1_ft endif if ENABLE_GPC GPCP=gpc_test endif INCLUDES=-I$(top_srcdir)/include -I$(top_srcdir)/font_freetype/ -I$(top_srcdir)/gpc -I$(top_srcdir)/font_win32_tt noinst_LTLIBRARIES=libexamples.la libexamples_la_SOURCES=parse_lion.cpp make_gb_poly.cpp make_arrows.cpp interactive_polygon.cpp noinst_PROGRAMS=aa_demo aa_test alpha_gradient alpha_mask2 alpha_mask3 alpha_mask bezier_div bspline circles component_rendering compositing conv_contour conv_dash_marker conv_stroke distortions gamma_correction gamma_ctrl gouraud gradients graph_test idea image1 image_alpha image_filters2 image_filters image_fltr_graph image_perspective image_resample image_transforms line_patterns lion lion_lens lion_outline mol_view multi_clip pattern_fill pattern_perspective pattern_resample perspective polymorphic_renderer rasterizers2 rasterizers raster_text rounded_rect scanline_boolean2 scanline_boolean simple_blur trans_polar $(GPCP) $(W32TTP) $(FTP) aa_demo_SOURCES=aa_demo.cpp aa_demo_LDFLAGS= $(top_builddir)/src/platform/@PREFERED_PLATFORM@/libaggplatform@PREFERED_PLATFORM@.la $(top_builddir)/src/libagg.la aa_test_SOURCES=aa_test.cpp aa_test_LDFLAGS= $(top_builddir)/src/platform/@PREFERED_PLATFORM@/libaggplatform@PREFERED_PLATFORM@.la $(top_builddir)/src/libagg.la alpha_gradient_SOURCES=alpha_gradient.cpp alpha_gradient_LDFLAGS= $(top_builddir)/src/platform/@PREFERED_PLATFORM@/libaggplatform@PREFERED_PLATFORM@.la $(top_builddir)/src/libagg.la alpha_mask2_SOURCES=alpha_mask2.cpp alpha_mask2_LDFLAGS= libexamples.la $(top_builddir)/src/platform/@PREFERED_PLATFORM@/libaggplatform@PREFERED_PLATFORM@.la $(top_builddir)/src/libagg.la alpha_mask3_SOURCES=alpha_mask3.cpp alpha_mask3_LDFLAGS= libexamples.la $(top_builddir)/src/platform/@PREFERED_PLATFORM@/libaggplatform@PREFERED_PLATFORM@.la $(top_builddir)/src/libagg.la alpha_mask_SOURCES=alpha_mask.cpp alpha_mask_LDFLAGS= libexamples.la $(top_builddir)/src/platform/@PREFERED_PLATFORM@/libaggplatform@PREFERED_PLATFORM@.la $(top_builddir)/src/libagg.la bezier_div_SOURCES=bezier_div.cpp bezier_div_LDFLAGS= libexamples.la $(top_builddir)/src/platform/@PREFERED_PLATFORM@/libaggplatform@PREFERED_PLATFORM@.la $(top_builddir)/src/libagg.la bspline_SOURCES=bspline.cpp bspline_LDFLAGS= libexamples.la $(top_builddir)/src/platform/@PREFERED_PLATFORM@/libaggplatform@PREFERED_PLATFORM@.la $(top_builddir)/src/libagg.la circles_SOURCES=circles.cpp circles_LDFLAGS= $(top_builddir)/src/platform/@PREFERED_PLATFORM@/libaggplatform@PREFERED_PLATFORM@.la $(top_builddir)/src/libagg.la component_rendering_SOURCES=component_rendering.cpp component_rendering_LDFLAGS= $(top_builddir)/src/platform/@PREFERED_PLATFORM@/libaggplatform@PREFERED_PLATFORM@.la $(top_builddir)/src/libagg.la compositing_SOURCES=compositing.cpp compositing_LDFLAGS= $(top_builddir)/src/platform/@PREFERED_PLATFORM@/libaggplatform@PREFERED_PLATFORM@.la $(top_builddir)/src/libagg.la conv_contour_SOURCES=conv_contour.cpp conv_contour_LDFLAGS= $(top_builddir)/src/platform/@PREFERED_PLATFORM@/libaggplatform@PREFERED_PLATFORM@.la $(top_builddir)/src/libagg.la conv_dash_marker_SOURCES=conv_dash_marker.cpp conv_dash_marker_LDFLAGS= $(top_builddir)/src/platform/@PREFERED_PLATFORM@/libaggplatform@PREFERED_PLATFORM@.la $(top_builddir)/src/libagg.la conv_stroke_SOURCES=conv_stroke.cpp conv_stroke_LDFLAGS= $(top_builddir)/src/platform/@PREFERED_PLATFORM@/libaggplatform@PREFERED_PLATFORM@.la $(top_builddir)/src/libagg.la distortions_SOURCES=distortions.cpp distortions_LDFLAGS= $(top_builddir)/src/platform/@PREFERED_PLATFORM@/libaggplatform@PREFERED_PLATFORM@.la $(top_builddir)/src/libagg.la gamma_correction_SOURCES=gamma_correction.cpp gamma_correction_LDFLAGS= $(top_builddir)/src/platform/@PREFERED_PLATFORM@/libaggplatform@PREFERED_PLATFORM@.la $(top_builddir)/src/libagg.la gamma_ctrl_SOURCES=gamma_ctrl.cpp gamma_ctrl_LDFLAGS= $(top_builddir)/src/platform/@PREFERED_PLATFORM@/libaggplatform@PREFERED_PLATFORM@.la $(top_builddir)/src/libagg.la gouraud_SOURCES=gouraud.cpp gouraud_LDFLAGS= $(top_builddir)/src/platform/@PREFERED_PLATFORM@/libaggplatform@PREFERED_PLATFORM@.la $(top_builddir)/src/libagg.la gradients_SOURCES=gradients.cpp gradients_LDFLAGS= $(top_builddir)/src/platform/@PREFERED_PLATFORM@/libaggplatform@PREFERED_PLATFORM@.la $(top_builddir)/src/libagg.la graph_test_SOURCES=graph_test.cpp graph_test_LDFLAGS= $(top_builddir)/src/platform/@PREFERED_PLATFORM@/libaggplatform@PREFERED_PLATFORM@.la $(top_builddir)/src/libagg.la idea_SOURCES=idea.cpp idea_LDFLAGS= $(top_builddir)/src/platform/@PREFERED_PLATFORM@/libaggplatform@PREFERED_PLATFORM@.la $(top_builddir)/src/libagg.la image1_SOURCES=image1.cpp image1_LDFLAGS= $(top_builddir)/src/platform/@PREFERED_PLATFORM@/libaggplatform@PREFERED_PLATFORM@.la $(top_builddir)/src/libagg.la image_alpha_SOURCES=image_alpha.cpp image_alpha_LDFLAGS= $(top_builddir)/src/platform/@PREFERED_PLATFORM@/libaggplatform@PREFERED_PLATFORM@.la $(top_builddir)/src/libagg.la image_filters2_SOURCES=image_filters2.cpp image_filters2_LDFLAGS= $(top_builddir)/src/platform/@PREFERED_PLATFORM@/libaggplatform@PREFERED_PLATFORM@.la $(top_builddir)/src/libagg.la image_filters_SOURCES=image_filters.cpp image_filters_LDFLAGS= $(top_builddir)/src/platform/@PREFERED_PLATFORM@/libaggplatform@PREFERED_PLATFORM@.la $(top_builddir)/src/libagg.la image_fltr_graph_SOURCES=image_fltr_graph.cpp image_fltr_graph_LDFLAGS= $(top_builddir)/src/platform/@PREFERED_PLATFORM@/libaggplatform@PREFERED_PLATFORM@.la $(top_builddir)/src/libagg.la image_perspective_SOURCES=image_perspective.cpp image_perspective_LDFLAGS= libexamples.la $(top_builddir)/src/platform/@PREFERED_PLATFORM@/libaggplatform@PREFERED_PLATFORM@.la $(top_builddir)/src/libagg.la image_resample_SOURCES=image_resample.cpp image_resample_LDFLAGS= libexamples.la $(top_builddir)/src/platform/@PREFERED_PLATFORM@/libaggplatform@PREFERED_PLATFORM@.la $(top_builddir)/src/libagg.la image_transforms_SOURCES=image_transforms.cpp image_transforms_LDFLAGS= $(top_builddir)/src/platform/@PREFERED_PLATFORM@/libaggplatform@PREFERED_PLATFORM@.la $(top_builddir)/src/libagg.la line_patterns_SOURCES=line_patterns.cpp line_patterns_LDFLAGS= $(top_builddir)/src/platform/@PREFERED_PLATFORM@/libaggplatform@PREFERED_PLATFORM@.la $(top_builddir)/src/libagg.la lion_SOURCES=lion.cpp lion_LDFLAGS= libexamples.la $(top_builddir)/src/platform/@PREFERED_PLATFORM@/libaggplatform@PREFERED_PLATFORM@.la $(top_builddir)/src/libagg.la lion_lens_SOURCES=lion_lens.cpp lion_lens_LDFLAGS= libexamples.la $(top_builddir)/src/platform/@PREFERED_PLATFORM@/libaggplatform@PREFERED_PLATFORM@.la $(top_builddir)/src/libagg.la lion_outline_SOURCES=lion_outline.cpp lion_outline_LDFLAGS= libexamples.la $(top_builddir)/src/platform/@PREFERED_PLATFORM@/libaggplatform@PREFERED_PLATFORM@.la $(top_builddir)/src/libagg.la mol_view_SOURCES=mol_view.cpp mol_view_LDFLAGS= $(top_builddir)/src/platform/@PREFERED_PLATFORM@/libaggplatform@PREFERED_PLATFORM@.la $(top_builddir)/src/libagg.la multi_clip_SOURCES=multi_clip.cpp multi_clip_LDFLAGS= libexamples.la $(top_builddir)/src/platform/@PREFERED_PLATFORM@/libaggplatform@PREFERED_PLATFORM@.la $(top_builddir)/src/libagg.la pattern_fill_SOURCES=pattern_fill.cpp pattern_fill_LDFLAGS= $(top_builddir)/src/platform/@PREFERED_PLATFORM@/libaggplatform@PREFERED_PLATFORM@.la $(top_builddir)/src/libagg.la pattern_perspective_SOURCES=pattern_perspective.cpp pattern_perspective_LDFLAGS= libexamples.la $(top_builddir)/src/platform/@PREFERED_PLATFORM@/libaggplatform@PREFERED_PLATFORM@.la $(top_builddir)/src/libagg.la pattern_resample_SOURCES=pattern_resample.cpp pattern_resample_LDFLAGS= libexamples.la $(top_builddir)/src/platform/@PREFERED_PLATFORM@/libaggplatform@PREFERED_PLATFORM@.la $(top_builddir)/src/libagg.la perspective_SOURCES=perspective.cpp perspective_LDFLAGS= libexamples.la $(top_builddir)/src/platform/@PREFERED_PLATFORM@/libaggplatform@PREFERED_PLATFORM@.la $(top_builddir)/src/libagg.la polymorphic_renderer_SOURCES=polymorphic_renderer.cpp polymorphic_renderer_LDFLAGS= $(top_builddir)/src/platform/@PREFERED_PLATFORM@/libaggplatform@PREFERED_PLATFORM@.la $(top_builddir)/src/libagg.la rasterizers2_SOURCES=rasterizers2.cpp rasterizers2_LDFLAGS= $(top_builddir)/src/platform/@PREFERED_PLATFORM@/libaggplatform@PREFERED_PLATFORM@.la $(top_builddir)/src/libagg.la rasterizers_SOURCES=rasterizers.cpp rasterizers_LDFLAGS= $(top_builddir)/src/platform/@PREFERED_PLATFORM@/libaggplatform@PREFERED_PLATFORM@.la $(top_builddir)/src/libagg.la raster_text_SOURCES=raster_text.cpp raster_text_LDFLAGS= $(top_builddir)/src/platform/@PREFERED_PLATFORM@/libaggplatform@PREFERED_PLATFORM@.la $(top_builddir)/src/libagg.la rounded_rect_SOURCES=rounded_rect.cpp rounded_rect_LDFLAGS= $(top_builddir)/src/platform/@PREFERED_PLATFORM@/libaggplatform@PREFERED_PLATFORM@.la $(top_builddir)/src/libagg.la scanline_boolean2_SOURCES=scanline_boolean2.cpp scanline_boolean2_LDFLAGS= libexamples.la $(top_builddir)/src/platform/@PREFERED_PLATFORM@/libaggplatform@PREFERED_PLATFORM@.la $(top_builddir)/src/libagg.la scanline_boolean_SOURCES=scanline_boolean.cpp scanline_boolean_LDFLAGS= libexamples.la $(top_builddir)/src/platform/@PREFERED_PLATFORM@/libaggplatform@PREFERED_PLATFORM@.la $(top_builddir)/src/libagg.la simple_blur_SOURCES=simple_blur.cpp simple_blur_LDFLAGS= libexamples.la $(top_builddir)/src/platform/@PREFERED_PLATFORM@/libaggplatform@PREFERED_PLATFORM@.la $(top_builddir)/src/libagg.la trans_polar_SOURCES=trans_polar.cpp trans_polar_LDFLAGS= $(top_builddir)/src/platform/@PREFERED_PLATFORM@/libaggplatform@PREFERED_PLATFORM@.la $(top_builddir)/src/libagg.la freetype_test_SOURCES=freetype_test.cpp freetype_test_CXXFLAGS=@FREETYPE_CFLAGS@ freetype_test_LDFLAGS= $(top_builddir)/font_freetype/libaggfontfreetype.la $(top_builddir)/src/platform/@PREFERED_PLATFORM@/libaggplatform@PREFERED_PLATFORM@.la $(top_builddir)/src/libagg.la trans_curve2_ft_SOURCES=trans_curve2_ft.cpp trans_curve2_ft_CXXFLAGS=@FREETYPE_CFLAGS@ trans_curve2_ft_LDFLAGS= $(top_builddir)/font_freetype/libaggfontfreetype.la $(top_builddir)/src/platform/@PREFERED_PLATFORM@/libaggplatform@PREFERED_PLATFORM@.la $(top_builddir)/src/libagg.la trans_curve1_ft_SOURCES=trans_curve1_ft.cpp trans_curve1_ft_CXXFLAGS=@FREETYPE_CFLAGS@ trans_curve1_ft_LDFLAGS= $(top_builddir)/font_freetype/libaggfontfreetype.la $(top_builddir)/src/platform/@PREFERED_PLATFORM@/libaggplatform@PREFERED_PLATFORM@.la $(top_builddir)/src/libagg.la gpc_test_SOURCES=gpc_test.cpp gpc_test_LDFLAGS= libexamples.la $(top_builddir)/gpc/libagggpc.la $(top_builddir)/src/platform/@PREFERED_PLATFORM@/libaggplatform@PREFERED_PLATFORM@.la $(top_builddir)/src/libagg.la truetype_test_SOURCES=truetype_test.cpp truetype_test_LDFLAGS= $(top_builddir)/font_win32_tt/libaggfontwin32tt.la $(top_builddir)/src/platform/@PREFERED_PLATFORM@/libaggplatform@PREFERED_PLATFORM@.la $(top_builddir)/src/libagg.la trans_curve1_SOURCES=trans_curve1.cpp trans_curve1_LDFLAGS= libexamples.la $(top_builddir)/font_win32_tt/libaggfontwin32tt.la $(top_builddir)/src/platform/@PREFERED_PLATFORM@/libaggplatform@PREFERED_PLATFORM@.la $(top_builddir)/src/libagg.la trans_curve2_SOURCES=trans_curve2.cpp trans_curve2_LDFLAGS= libexamples.la $(top_builddir)/font_win32_tt/libaggfontwin32tt.la $(top_builddir)/src/platform/@PREFERED_PLATFORM@/libaggplatform@PREFERED_PLATFORM@.la $(top_builddir)/src/libagg.la endif agg-2.5+dfsg1/examples/X11/0000755000000000000000000000000010703246330015445 5ustar00usergroup00000000000000agg-2.5+dfsg1/examples/X11/Makefile0000644000000000000000000003002110703246330017101 0ustar00usergroup00000000000000include ../../Makefile.in.$(shell uname) PLATFORM=X11 PLATFORMSOURCES=../../src/platform/$(PLATFORM)/agg_platform_support.o CXXFLAGS= $(AGGCXXFLAGS) -I../../include \ -L../../src \ $(PIXFMT) CXXFREETYPEFLAGS= $(AGGCXXFLAGS) -Wall \ -I../../include \ -I../../font_freetype \ -I/usr/local/include/freetype2 \ -L../../src \ $(PIXFMT) LIBS = $(AGGLIBS) -lm -lX11 base: cd ../../src/; make make aa_demo make aa_test make alpha_gradient make alpha_mask make alpha_mask2 make alpha_mask3 make bezier_div make bspline make circles make component_rendering make conv_contour make conv_dash_marker make conv_stroke make flash_rasterizer make flash_rasterizer2 make gamma_correction make gamma_ctrl make gamma_tuner make gouraud make gouraud_mesh make gradient_focal make gradients make graph_test make idea make lion make lion_lens make lion_outline make multi_clip make pattern_fill make perspective make polymorphic_renderer make raster_text make rasterizers make rasterizers2 make rounded_rect make scanline_boolean make scanline_boolean2 make simple_blur make trans_polar make image_alpha make image_filters make image_filters2 make image_fltr_graph make image_perspective make image_resample make image_transforms make image1 make distortions make pattern_perspective make compositing make compositing2 make line_patterns make line_patterns_clip make mol_view make blur make rasterizer_compound make blend_color freetype: make freetype_test make trans_curve1_ft make trans_curve2_ft gpc: make gpc_test all: make base make freetype make gpc make svg_test aa_demo: ../aa_demo.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o aa_demo $(LIBS) aa_test: ../aa_test.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o aa_test $(LIBS) alpha_gradient: ../alpha_gradient.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o alpha_gradient $(LIBS) alpha_mask: ../alpha_mask.o ../parse_lion.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o alpha_mask $(LIBS) alpha_mask2: ../alpha_mask2.o ../parse_lion.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o alpha_mask2 $(LIBS) alpha_mask3: ../alpha_mask3.o ../make_arrows.o ../make_gb_poly.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o alpha_mask3 $(LIBS) bezier_div: ../bezier_div.o ../interactive_polygon.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o bezier_div $(LIBS) blur: ../blur.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o blur $(LIBS) bspline: ../bspline.o ../interactive_polygon.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o bspline $(LIBS) circles: ../circles.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o circles $(LIBS) component_rendering: ../component_rendering.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o component_rendering $(LIBS) compositing: ../compositing.o $(PLATFORMSOURCES) compositing.ppm $(CXX) $(CXXFLAGS) ../compositing.o $(PLATFORMSOURCES) -o compositing $(LIBS) compositing2: ../compositing2.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o compositing2 $(LIBS) conv_contour: ../conv_contour.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o conv_contour $(LIBS) conv_dash_marker: ../conv_dash_marker.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o conv_dash_marker $(LIBS) conv_stroke: ../conv_stroke.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o conv_stroke $(LIBS) distortions: ../distortions.o $(PLATFORMSOURCES) spheres.ppm $(CXX) $(CXXFLAGS) ../distortions.o $(PLATFORMSOURCES) -o distortions $(LIBS) flash_rasterizer: ../flash_rasterizer.o $(PLATFORMSOURCES) shapes.txt $(CXX) $(CXXFLAGS) ../flash_rasterizer.o $(PLATFORMSOURCES) -o flash_rasterizer $(LIBS) flash_rasterizer2: ../flash_rasterizer2.o $(PLATFORMSOURCES) shapes.txt $(CXX) $(CXXFLAGS) ../flash_rasterizer2.o $(PLATFORMSOURCES) -o flash_rasterizer2 $(LIBS) gamma_correction: ../gamma_correction.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o gamma_correction $(LIBS) gamma_ctrl: ../gamma_ctrl.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o gamma_ctrl $(LIBS) gamma_tuner: ../gamma_tuner.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o gamma_tuner $(LIBS) gouraud: ../gouraud.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o gouraud $(LIBS) gouraud_mesh: ../gouraud_mesh.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o gouraud_mesh $(LIBS) gradient_focal: ../gradient_focal.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o gradient_focal $(LIBS) gradients: ../gradients.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o gradients $(LIBS) graph_test: ../graph_test.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o graph_test $(LIBS) idea: ../idea.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o idea $(LIBS) image_alpha: ../image_alpha.o $(PLATFORMSOURCES) spheres.ppm $(CXX) $(CXXFLAGS) ../image_alpha.o $(PLATFORMSOURCES) -o image_alpha $(LIBS) image_filters: ../image_filters.o $(PLATFORMSOURCES) spheres.ppm $(CXX) $(CXXFLAGS) ../image_filters.o $(PLATFORMSOURCES) -o image_filters $(LIBS) image_filters2: ../image_filters2.o $(PLATFORMSOURCES) spheres.ppm $(CXX) $(CXXFLAGS) ../image_filters2.o $(PLATFORMSOURCES) -o image_filters2 $(LIBS) image_fltr_graph: ../image_fltr_graph.o $(PLATFORMSOURCES) spheres.ppm $(CXX) $(CXXFLAGS) ../image_fltr_graph.o $(PLATFORMSOURCES) -o image_fltr_graph $(LIBS) image_perspective: ../image_perspective.o ../interactive_polygon.o $(PLATFORMSOURCES) spheres.ppm $(CXX) $(CXXFLAGS) ../image_perspective.o ../interactive_polygon.o $(PLATFORMSOURCES) -o image_perspective $(LIBS) image_resample: ../image_resample.o ../interactive_polygon.o $(PLATFORMSOURCES) spheres.ppm $(CXX) $(CXXFLAGS) ../image_resample.o ../interactive_polygon.o $(PLATFORMSOURCES) -o image_resample $(LIBS) image_transforms: ../image_transforms.o $(PLATFORMSOURCES) spheres.ppm $(CXX) $(CXXFLAGS) ../image_transforms.o $(PLATFORMSOURCES) -o image_transforms $(LIBS) image1: ../image1.o $(PLATFORMSOURCES) spheres.ppm $(CXX) $(CXXFLAGS) ../image1.o $(PLATFORMSOURCES) -o image1 $(LIBS) line_patterns: ../line_patterns.o $(PLATFORMSOURCES) 1.ppm 2.ppm 3.ppm 4.ppm 5.ppm 6.ppm 7.ppm 8.ppm 9.ppm $(CXX) $(CXXFLAGS) ../line_patterns.o $(PLATFORMSOURCES) -o line_patterns $(LIBS) line_patterns_clip: ../line_patterns_clip.o $(PLATFORMSOURCES) 1.ppm $(CXX) $(CXXFLAGS) ../line_patterns_clip.o $(PLATFORMSOURCES) -o line_patterns_clip $(LIBS) lion: ../lion.o ../parse_lion.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o lion $(LIBS) lion_lens: ../lion_lens.o ../parse_lion.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o lion_lens $(LIBS) lion_outline: ../lion_outline.o ../parse_lion.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o lion_outline $(LIBS) mol_view: ../mol_view.o $(PLATFORMSOURCES) 1.sdf $(CXX) $(CXXFLAGS) ../mol_view.o $(PLATFORMSOURCES) -o mol_view $(LIBS) multi_clip: ../multi_clip.o ../parse_lion.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o multi_clip $(LIBS) pattern_fill: ../pattern_fill.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o pattern_fill $(LIBS) pattern_perspective: ../pattern_perspective.o ../interactive_polygon.o $(PLATFORMSOURCES) agg.ppm $(CXX) $(CXXFLAGS) ../pattern_perspective.o ../interactive_polygon.o $(PLATFORMSOURCES) -o pattern_perspective $(LIBS) perspective: ../perspective.o ../interactive_polygon.o ../parse_lion.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o perspective $(LIBS) polymorphic_renderer: ../polymorphic_renderer.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o polymorphic_renderer $(LIBS) raster_text: ../raster_text.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o raster_text $(LIBS) rasterizers: ../rasterizers.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o rasterizers $(LIBS) rasterizers2: ../rasterizers2.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o rasterizers2 $(LIBS) rasterizer_compound: ../rasterizer_compound.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o rasterizer_compound $(LIBS) blend_color: ../blend_color.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o blend_color $(LIBS) rounded_rect: ../rounded_rect.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o rounded_rect $(LIBS) scanline_boolean: ../scanline_boolean.o ../interactive_polygon.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o scanline_boolean $(LIBS) scanline_boolean2: ../scanline_boolean2.o ../make_arrows.o ../make_gb_poly.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o scanline_boolean2 $(LIBS) simple_blur: ../simple_blur.o ../parse_lion.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o simple_blur $(LIBS) trans_polar: ../trans_polar.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o trans_polar $(LIBS) freetype_test: ../freetype_test.o ../../font_freetype/agg_font_freetype.o $(PLATFORMSOURCES) timesi.ttf $(CXX) $(CXXFREETYPEFLAGS) ../freetype_test.o ../../font_freetype/agg_font_freetype.o $(PLATFORMSOURCES) -o freetype_test $(LIBS) -lfreetype trans_curve1_ft: ../trans_curve1_ft.o ../../font_freetype/agg_font_freetype.o ../interactive_polygon.o $(PLATFORMSOURCES) timesi.ttf $(CXX) $(CXXFLAGS) ../trans_curve1_ft.o ../../font_freetype/agg_font_freetype.o ../interactive_polygon.o $(PLATFORMSOURCES) -o trans_curve1_ft $(LIBS) -lfreetype trans_curve2_ft: ../trans_curve2_ft.o ../../font_freetype/agg_font_freetype.o ../interactive_polygon.o $(PLATFORMSOURCES) timesi.ttf $(CXX) $(CXXFLAGS) ../trans_curve2_ft.o ../../font_freetype/agg_font_freetype.o ../interactive_polygon.o $(PLATFORMSOURCES) -o trans_curve2_ft $(LIBS) -lfreetype gpc_test: ../gpc_test.o ../make_arrows.o ../make_gb_poly.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o gpc_test $(LIBS) svg_test: ../svg_viewer/agg_svg_parser.o ../svg_viewer/agg_svg_path_renderer.o ../svg_viewer/agg_svg_path_tokenizer.o ../svg_viewer/svg_test.o $(PLATFORMSOURCES) tiger.svg $(CXX) $(CXXFLAGS) ../svg_viewer/agg_svg_parser.o ../svg_viewer/agg_svg_path_renderer.o ../svg_viewer/agg_svg_path_tokenizer.o ../svg_viewer/svg_test.o $(PLATFORMSOURCES) -o svg_test $(LIBS) -lfreetype -lexpat clean: rm -f ../*.o rm -f ../svg_viewer/*.o rm -f ../../src/platform/$(PLATFORM)/agg_platform_support.o agg.ppm: @echo "Please download http://www.antigrain.com/agg.ppm" @echo "Attempting to retrieve via wget: (will fail if wget is not installed)" wget http://www.antigrain.com/agg.ppm compositing.ppm: @echo "Please download http://www.antigrain.com/compositing.ppm" @echo "Attempting to retrieve via wget: (will fail if wget is not installed)" wget http://www.antigrain.com/compositing.ppm spheres.ppm: @echo "Please download http://www.antigrain.com/spheres.ppm" @echo "Attempting to retrieve file: (will fail if wget is not installed)" wget http://www.antigrain.com/spheres.ppm shapes.txt: @echo "Please download http://www.antigrain.com/shapes.txt" @echo "Attempting to retrieve file: (will fail if wget is not installed)" wget http://www.antigrain.com/shapes.txt 1.sdf: @echo "Please download http://www.antigrain.com/1.sdf" @echo "Attempting to retrieve file: (will fail if wget is not installed)" wget http://www.antigrain.com/1.sdf 1.ppm: @echo "Please download http://www.antigrain.com/line_patterns.tar.gz and decompress it" @echo "Attempting to retrieve file: (will fail if wget is not installed)" wget http://www.antigrain.com/line_patterns.tar.gz gunzip line_patterns.tar.gz tar -xvf line_patterns.tar timesi.ttf: @echo "Please download http://www.antigrain.com/timesi.zip and decompress it" @echo "Attempting to retrieve file: (will fail if wget is not installed)" wget http://www.antigrain.com/timesi.zip unzip -o timesi.zip tiger.svg: @echo "Please download http://www.antigrain.com/svg/tiger.svg" @echo "Attempting to retrieve file: (will fail if wget is not installed)" wget http://www.antigrain.com/svg/tiger.svg ../freetype_test.o: ../freetype_test.cpp @echo \< $*.cpp \> $(CXX) -c $(CXXFREETYPEFLAGS) $*.cpp -o $@ ../trans_curve1_ft.o: ../trans_curve1_ft.cpp @echo \< $*.cpp \> $(CXX) -c $(CXXFREETYPEFLAGS) $*.cpp -o $@ ../trans_curve2_ft.o: ../trans_curve2_ft.cpp @echo \< $*.cpp \> $(CXX) -c $(CXXFREETYPEFLAGS) $*.cpp -o $@ ../../font_freetype/agg_font_freetype.o: ../../font_freetype/agg_font_freetype.cpp @echo \< $*.cpp \> $(CXX) -c $(CXXFREETYPEFLAGS) $*.cpp -o $@ ../gpc_test.o: ../gpc_test.cpp @echo \< $*.cpp \> $(CXX) -c $(CXXFLAGS) -I../../gpc $*.cpp -o $@ %.o: %.cpp @echo \< $*.cpp \> $(CXX) -c $(CXXFLAGS) $*.cpp -o $@ .PHONY : clean agg-2.5+dfsg1/examples/X11/readme.txt0000644000000000000000000000173110703246330017445 0ustar00usergroup00000000000000The Anti-Grain Geometry Project A high quality rendering engine for C++ http://antigrain.com Anti-Grain Geometry Copyright (C) 2002-2005 Maxim Shemanarev (McSeem) 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. By default only the examples that do not require extra dependancies are built. with the following commands: cd (AGGDIRECTORY)/examples/X11 make clean make Some examples (freetype_test, trans_curve1_ft and trans_curve2_ft) require the Freetype Library, and can be built with: make freetype There is also an example (gpc_test) that requires the GPC library, build it with: make gpc Of course, to build ALL examples run: make all Alternatively you can also build the examples one by one, using the example name directly: make aa_demo make aa_test ...agg-2.5+dfsg1/examples/aa_demo.cpp0000644000000000000000000001636510703246330017200 0ustar00usergroup00000000000000#include "agg_basics.h" #include "agg_rendering_buffer.h" #include "agg_rasterizer_scanline_aa.h" #include "agg_scanline_u.h" #include "agg_renderer_scanline.h" #include "agg_pixfmt_rgb.h" #include "platform/agg_platform_support.h" #include "ctrl/agg_slider_ctrl.h" #include "ctrl/agg_cbox_ctrl.h" enum flip_y_e { flip_y = true }; namespace agg { class square { public: square(double size) : m_size(size) {} template void draw(Rasterizer& ras, Scanline& sl, Renderer& ren, ColorT color, double x, double y) { ras.reset(); ras.move_to_d(x*m_size, y*m_size); ras.line_to_d(x*m_size+m_size, y*m_size); ras.line_to_d(x*m_size+m_size, y*m_size+m_size); ras.line_to_d(x*m_size, y*m_size+m_size); agg::render_scanlines_aa_solid(ras, sl, ren, color); } private: double m_size; }; template class renderer_enlarged { public: renderer_enlarged(Renderer& ren, double size) : m_ren(ren), m_square(size), m_size(size) {} //-------------------------------------------------------------------- void color(rgba8 c) { m_color = c; } //-------------------------------------------------------------------- void prepare() {} //-------------------------------------------------------------------- template void render(const Scanline& sl) { int y = sl.y(); unsigned num_spans = sl.num_spans(); typename Scanline::const_iterator span = sl.begin(); do { int x = span->x; const typename Scanline::cover_type* covers = span->covers; int num_pix = span->len; do { int a = (*covers++ * m_color.a) >> 8; m_square.draw(m_ras, m_sl, m_ren, rgba8(m_color.r, m_color.g, m_color.b, a), x, y); ++x; } while(--num_pix); } while(--num_spans); } private: rasterizer_scanline_aa<> m_ras; scanline_u8 m_sl; Renderer& m_ren; square m_square; rgba8 m_color; double m_size; }; }; class the_application : public agg::platform_support { double m_x[3]; double m_y[3]; double m_dx; double m_dy; int m_idx; agg::slider_ctrl m_slider1; agg::slider_ctrl m_slider2; public: the_application(agg::pix_format_e format, bool flip_y) : agg::platform_support(format, flip_y), m_slider1(80, 10, 600-10, 19, !flip_y), m_slider2(80, 10+20, 600-10, 19+20, !flip_y) { m_idx = -1; m_x[0] = 57; m_y[0] = 100; m_x[1] = 369; m_y[1] = 170; m_x[2] = 143; m_y[2] = 310; add_ctrl(m_slider1); add_ctrl(m_slider2); m_slider1.range(8.0, 100.0); m_slider1.num_steps(23); m_slider1.value(32.0); m_slider2.range(0.1, 3.0); m_slider2.value(1.0); m_slider1.label("Pixel size=%1.0f"); m_slider2.label("Gamma=%4.3f"); m_slider1.no_transform(); m_slider2.no_transform(); } virtual ~the_application() { } virtual void on_init() { } virtual void on_draw() { typedef agg::renderer_base ren_base; agg::pixfmt_bgr24 pixf(rbuf_window()); ren_base ren(pixf); agg::scanline_u8 sl; ren.clear(agg::rgba(1,1,1)); agg::rasterizer_scanline_aa<> ras; int size_mul = int(m_slider1.value()); ras.gamma(agg::gamma_power(m_slider2.value())); agg::renderer_enlarged ren_en(ren, size_mul); ras.reset(); ras.move_to_d(m_x[0]/size_mul, m_y[0]/size_mul); ras.line_to_d(m_x[1]/size_mul, m_y[1]/size_mul); ras.line_to_d(m_x[2]/size_mul, m_y[2]/size_mul); ren_en.color(agg::rgba8(0,0,0, 255)); agg::render_scanlines(ras, sl, ren_en); agg::render_scanlines_aa_solid(ras, sl, ren, agg::rgba8(0,0,0)); ras.gamma(agg::gamma_none()); agg::path_storage ps; agg::conv_stroke pg(ps); pg.width(2.0); ps.remove_all(); ps.move_to(m_x[0], m_y[0]); ps.line_to(m_x[1], m_y[1]); ras.add_path(pg); agg::render_scanlines_aa_solid(ras, sl, ren, agg::rgba8(0,150,160, 200)); ps.remove_all(); ps.move_to(m_x[1], m_y[1]); ps.line_to(m_x[2], m_y[2]); ras.add_path(pg); agg::render_scanlines_aa_solid(ras, sl, ren, agg::rgba8(0,150,160, 200)); ps.remove_all(); ps.move_to(m_x[2], m_y[2]); ps.line_to(m_x[0], m_y[0]); ras.add_path(pg); agg::render_scanlines_aa_solid(ras, sl, ren, agg::rgba8(0,150,160, 200)); // Render the controls agg::render_ctrl(ras, sl, ren, m_slider1); agg::render_ctrl(ras, sl, ren, m_slider2); } virtual void on_mouse_button_down(int x, int y, unsigned flags) { if(flags & agg::mouse_left) { unsigned i; for (i = 0; i < 3; i++) { if(sqrt( (x-m_x[i]) * (x-m_x[i]) + (y-m_y[i]) * (y-m_y[i]) ) < 10.0) { m_dx = x - m_x[i]; m_dy = y - m_y[i]; m_idx = i; break; } } if(i == 3) { if(agg::point_in_triangle(m_x[0], m_y[0], m_x[1], m_y[1], m_x[2], m_y[2], x, y)) { m_dx = x - m_x[0]; m_dy = y - m_y[0]; m_idx = 3; } } } } virtual void on_mouse_move(int x, int y, unsigned flags) { if(flags & agg::mouse_left) { if(m_idx == 3) { double dx = x - m_dx; double dy = y - m_dy; m_x[1] -= m_x[0] - dx; m_y[1] -= m_y[0] - dy; m_x[2] -= m_x[0] - dx; m_y[2] -= m_y[0] - dy; m_x[0] = dx; m_y[0] = dy; force_redraw(); return; } if(m_idx >= 0) { m_x[m_idx] = x - m_dx; m_y[m_idx] = y - m_dy; force_redraw(); } } else { on_mouse_button_up(x, y, flags); } } virtual void on_mouse_button_up(int x, int y, unsigned flags) { m_idx = -1; } }; int agg_main(int argc, char* argv[]) { the_application app(agg::pix_format_bgr24, flip_y); app.caption("AGG Example. Anti-Aliasing Demo"); if(app.init(600, 400, agg::window_resize)) { return app.run(); } return 1; } agg-2.5+dfsg1/examples/aa_test.cpp0000644000000000000000000004552510703246330017233 0ustar00usergroup00000000000000#include #include "agg_basics.h" #include "agg_rendering_buffer.h" #include "agg_rasterizer_scanline_aa.h" #include "agg_scanline_u.h" #include "agg_renderer_scanline.h" #include "agg_pixfmt_rgb.h" #include "agg_gamma_lut.h" #include "agg_conv_dash.h" #include "agg_conv_stroke.h" #include "agg_span_gradient.h" #include "agg_span_interpolator_linear.h" #include "agg_span_gouraud_rgba.h" #include "agg_span_allocator.h" #include "platform/agg_platform_support.h" #include "ctrl/agg_slider_ctrl.h" #include "ctrl/agg_cbox_ctrl.h" enum flip_y_e { flip_y = false }; typedef agg::gamma_lut gamma_lut_type; typedef agg::pixfmt_bgr24_gamma pixfmt_type; typedef pixfmt_type::color_type color_type; typedef agg::renderer_base renderer_base_type; typedef agg::renderer_scanline_aa_solid renderer_scanline_type; typedef agg::scanline_u8 scanline_type; typedef agg::rasterizer_scanline_aa<> rasterizer_type; template T min(T a, T b) { return (a < b) ? a : b; } inline double frand(double x) { return ((((rand() << 15) | rand()) & 0x3FFFFFFF) % 1000000) * x / 1000000.0; } class simple_vertex_source { public: simple_vertex_source() : m_num_vertices(0), m_count(0) { m_cmd[0] = agg::path_cmd_stop; } simple_vertex_source(double x1, double y1, double x2, double y2) { init(x1, y1, x2, y2); } simple_vertex_source(double x1, double y1, double x2, double y2, double x3, double y3) { init(x1, y1, x2, y2, x3, y3); } void init(double x1, double y1, double x2, double y2) { m_num_vertices = 2; m_count = 0; m_x[0] = x1; m_y[0] = y1; m_x[1] = x2; m_y[1] = y2; m_cmd[0] = agg::path_cmd_move_to; m_cmd[1] = agg::path_cmd_line_to; m_cmd[2] = agg::path_cmd_stop; } void init(double x1, double y1, double x2, double y2, double x3, double y3) { m_num_vertices = 3; m_count = 0; m_x[0] = x1; m_y[0] = y1; m_x[1] = x2; m_y[1] = y2; m_x[2] = x3; m_y[2] = y3; m_x[3] = m_y[3] = m_x[4] = m_y[4] = 0.0; m_cmd[0] = agg::path_cmd_move_to; m_cmd[1] = agg::path_cmd_line_to; m_cmd[2] = agg::path_cmd_line_to; m_cmd[3] = agg::path_cmd_end_poly | agg::path_flags_close; m_cmd[4] = agg::path_cmd_stop; } void rewind(unsigned) { m_count = 0; } unsigned vertex(double* x, double* y) { *x = m_x[m_count]; *y = m_y[m_count]; return m_cmd[m_count++]; } private: unsigned m_num_vertices; unsigned m_count; double m_x[8]; double m_y[8]; unsigned m_cmd[8]; }; template class dashed_line { public: dashed_line(Ras& ras, Ren& ren, Scanline& sl) : m_ras(ras), m_ren(ren), m_sl(sl), m_src(), m_dash(m_src), m_stroke(m_src), m_dash_stroke(m_dash) {} void draw(double x1, double y1, double x2, double y2, double line_width, double dash_length) { m_src.init(x1 + 0.5, y1 + 0.5, x2 + 0.5, y2 + 0.5); m_ras.reset(); if(dash_length > 0.0) { m_dash.remove_all_dashes(); m_dash.add_dash(dash_length, dash_length); m_dash_stroke.width(line_width); m_dash_stroke.line_cap(agg::round_cap); m_ras.add_path(m_dash_stroke); } else { m_stroke.width(line_width); m_stroke.line_cap(agg::round_cap); m_ras.add_path(m_stroke); } agg::render_scanlines(m_ras, m_sl, m_ren); } private: Ras& m_ras; Ren& m_ren; Scanline& m_sl; simple_vertex_source m_src; agg::conv_dash m_dash; agg::conv_stroke m_stroke; agg::conv_stroke > m_dash_stroke; }; // Calculate the affine transformation matrix for the linear gradient // from (x1, y1) to (x2, y2). gradient_d2 is the "base" to scale the // gradient. Here d1 must be 0.0, and d2 must equal gradient_d2. //--------------------------------------------------------------- void calc_linear_gradient_transform(double x1, double y1, double x2, double y2, agg::trans_affine& mtx, double gradient_d2 = 100.0) { double dx = x2 - x1; double dy = y2 - y1; mtx.reset(); mtx *= agg::trans_affine_scaling(sqrt(dx * dx + dy * dy) / gradient_d2); mtx *= agg::trans_affine_rotation(atan2(dy, dx)); mtx *= agg::trans_affine_translation(x1 + 0.5, y1 + 0.5); mtx.invert(); } // A simple function to form the gradient color array // consisting of 3 colors, "begin", "middle", "end" //--------------------------------------------------- template void fill_color_array(ColorArrayT& array, color_type begin, color_type end) { unsigned i; for(i = 0; i < 256; ++i) { array[i] = begin.gradient(end, i / 255.0); } } class the_application : public agg::platform_support { gamma_lut_type m_gamma; agg::slider_ctrl m_slider_gamma; public: the_application(agg::pix_format_e format, bool flip_y) : agg::platform_support(format, flip_y), m_gamma(1.0), m_slider_gamma(3, 3, 480-3, 8, !flip_y) { add_ctrl(m_slider_gamma); m_slider_gamma.range(0.1, 3.0); m_slider_gamma.value(1.6); m_slider_gamma.label("Gamma=%4.3f"); } virtual ~the_application() { } virtual void on_init() { } virtual void on_draw() { pixfmt_type pixf(rbuf_window(), m_gamma); renderer_base_type ren_base(pixf); renderer_scanline_type ren_sl(ren_base); scanline_type sl; rasterizer_type ras; ren_base.clear(agg::rgba(0,0,0)); // gamma correction //ras.gamma(agg::gamma_power()); m_gamma.gamma(m_slider_gamma.value()); int i; // radial line test //------------------------- dashed_line dash(ras, ren_sl, sl); double cx = width() / 2.0; double cy = height() / 2.0; ren_sl.color(agg::rgba(1.0, 1.0, 1.0, 0.2)); for(i = 180; i > 0; i--) { double n = 2.0 * agg::pi * i / 180.0; dash.draw(cx + min(cx, cy) * sin(n), cy + min(cx, cy) * cos(n), cx, cy, 1.0, (i < 90) ? i : 0.0); } typedef agg::gradient_x gradient_func_type; typedef agg::span_interpolator_linear<> interpolator_type; typedef agg::span_allocator span_allocator_type; typedef agg::pod_auto_array color_array_type; typedef agg::span_gradient span_gradient_type; typedef agg::renderer_scanline_aa renderer_gradient_type; gradient_func_type gradient_func; // The gradient function agg::trans_affine gradient_mtx; // Affine transformer interpolator_type span_interpolator(gradient_mtx); // Span interpolator span_allocator_type span_allocator; // Span Allocator color_array_type gradient_colors; // The gradient colors span_gradient_type span_gradient(span_interpolator, gradient_func, gradient_colors, 0, 100); renderer_gradient_type ren_gradient(ren_base, span_allocator, span_gradient); dashed_line dash_gradient(ras, ren_gradient, sl); double x1, y1, x2, y2; for(i = 1; i <= 20; i++) { ren_sl.color(agg::rgba(1,1,1)); // integral point sizes 1..20 //---------------- agg::ellipse ell; ell.init(20 + i * (i + 1) + 0.5, 20.5, i / 2.0, i / 2.0, 8 + i); ras.reset(); ras.add_path(ell); agg::render_scanlines(ras, sl, ren_sl); // fractional point sizes 0..2 //---------------- ell.init(18 + i * 4 + 0.5, 33 + 0.5, i/20.0, i/20.0, 8); ras.reset(); ras.add_path(ell); agg::render_scanlines(ras, sl, ren_sl); // fractional point positioning //--------------- ell.init(18 + i * 4 + (i-1) / 10.0 + 0.5, 27 + (i - 1) / 10.0 + 0.5, 0.5, 0.5, 8); ras.reset(); ras.add_path(ell); agg::render_scanlines(ras, sl, ren_sl); // integral line widths 1..20 //---------------- fill_color_array(gradient_colors, agg::rgba(1,1,1), agg::rgba(i % 2, (i % 3) * 0.5, (i % 5) * 0.25)); x1 = 20 + i* (i + 1); y1 = 40.5; x2 = 20 + i * (i + 1) + (i - 1) * 4; y2 = 100.5; calc_linear_gradient_transform(x1, y1, x2, y2, gradient_mtx); dash_gradient.draw(x1, y1, x2, y2, i, 0); fill_color_array(gradient_colors, agg::rgba(1,0,0), agg::rgba(0,0,1)); // fractional line lengths H (red/blue) //---------------- x1 = 17.5 + i * 4; y1 = 107; x2 = 17.5 + i * 4 + i/6.66666667; y2 = 107; calc_linear_gradient_transform(x1, y1, x2, y2, gradient_mtx); dash_gradient.draw(x1, y1, x2, y2, 1.0, 0); // fractional line lengths V (red/blue) //--------------- x1 = 18 + i * 4; y1 = 112.5; x2 = 18 + i * 4; y2 = 112.5 + i / 6.66666667; calc_linear_gradient_transform(x1, y1, x2, y2, gradient_mtx); dash_gradient.draw(x1, y1, x2, y2, 1.0, 0); // fractional line positioning (red) //--------------- fill_color_array(gradient_colors, agg::rgba(1,0,0), agg::rgba(1,1,1)); x1 = 21.5; y1 = 120 + (i - 1) * 3.1; x2 = 52.5; y2 = 120 + (i - 1) * 3.1; calc_linear_gradient_transform(x1, y1, x2, y2, gradient_mtx); dash_gradient.draw(x1, y1, x2, y2, 1.0, 0); // fractional line width 2..0 (green) fill_color_array(gradient_colors, agg::rgba(0,1,0), agg::rgba(1,1,1)); x1 = 52.5; y1 = 118 + i * 3; x2 = 83.5; y2 = 118 + i * 3; calc_linear_gradient_transform(x1, y1, x2, y2, gradient_mtx); dash_gradient.draw(x1, y1, x2, y2, 2.0 - (i - 1) / 10.0, 0); // stippled fractional width 2..0 (blue) fill_color_array(gradient_colors, agg::rgba(0,0,1), agg::rgba(1,1,1)); x1 = 83.5; y1 = 119 + i * 3; x2 = 114.5; y2 = 119 + i * 3; calc_linear_gradient_transform(x1, y1, x2, y2, gradient_mtx); dash_gradient.draw(x1, y1, x2, y2, 2.0 - (i - 1) / 10.0, 3.0); ren_sl.color(agg::rgba(1,1,1)); if(i <= 10) { // integral line width, horz aligned (mipmap test) //------------------- dash.draw(125.5, 119.5 + (i + 2) * (i / 2.0), 135.5, 119.5 + (i + 2) * (i / 2.0), i, 0.0); } // fractional line width 0..2, 1 px H //----------------- dash.draw(17.5 + i * 4, 192, 18.5 + i * 4, 192, i / 10.0, 0); // fractional line positioning, 1 px H //----------------- dash.draw(17.5 + i * 4 + (i - 1) / 10.0, 186, 18.5 + i * 4 + (i - 1) / 10.0, 186, 1.0, 0); } // Triangles //--------------- for (i = 1; i <= 13; i++) { fill_color_array(gradient_colors, agg::rgba(1,1,1), agg::rgba(i % 2, (i % 3) * 0.5, (i % 5) * 0.25)); calc_linear_gradient_transform(width() - 150, height() - 20 - i * (i + 1.5), width() - 20, height() - 20 - i * (i + 1), gradient_mtx); ras.reset(); ras.move_to_d(width() - 150, height() - 20 - i * (i + 1.5)); ras.line_to_d(width() - 20, height() - 20 - i * (i + 1)); ras.line_to_d(width() - 20, height() - 20 - i * (i + 2)); agg::render_scanlines(ras, sl, ren_gradient); } // Reset AA Gamma and render the controls ras.gamma(agg::gamma_power(1.0)); agg::render_ctrl(ras, sl, ren_base, m_slider_gamma); } virtual void on_mouse_button_down(int x, int y, unsigned flags) { srand(123); pixfmt_type pixf(rbuf_window(), m_gamma); renderer_base_type ren_base(pixf); renderer_scanline_type ren_sl(ren_base); scanline_type sl; rasterizer_type ras; ren_base.clear(agg::rgba(0,0,0)); int i; double w = width(); double h = height(); agg::ellipse ell; start_timer(); for(i = 0; i < 20000; i++) { double r = frand(20.0) + 1.0; ell.init(frand(w), frand(h), r/2, r/2, int(r) + 10); ras.reset(); ras.add_path(ell); agg::render_scanlines(ras, sl, ren_sl); ren_sl.color(agg::rgba(frand(1.0), frand(1.0), frand(1.0), 0.5+frand(0.5))); } double t1 = elapsed_time(); typedef agg::gradient_x gradient_func_type; typedef agg::span_interpolator_linear<> interpolator_type; typedef agg::span_allocator span_allocator_type; typedef agg::pod_auto_array color_array_type; typedef agg::span_gradient span_gradient_type; typedef agg::renderer_scanline_aa renderer_gradient_type; gradient_func_type gradient_func; // The gradient function agg::trans_affine gradient_mtx; // Affine transformer interpolator_type span_interpolator(gradient_mtx); // Span interpolator span_allocator_type span_allocator; // Span Allocator color_array_type gradient_colors; span_gradient_type span_gradient(span_interpolator, gradient_func, gradient_colors, 0, 100); renderer_gradient_type ren_gradient(ren_base, span_allocator, span_gradient); dashed_line dash_gradient(ras, ren_gradient, sl); double x1, y1, x2, y2, x3, y3; start_timer(); for(i = 0; i < 2000; i++) { x1 = frand(w); y1 = frand(h); x2 = x1 + frand(w * 0.5) - w * 0.25; y2 = y1 + frand(h * 0.5) - h * 0.25; fill_color_array(gradient_colors, agg::rgba(frand(1.0), frand(1.0), frand(1.0), 0.5+frand(0.5)), agg::rgba(frand(1.0), frand(1.0), frand(1.0), frand(1.0))); calc_linear_gradient_transform(x1, y1, x2, y2, gradient_mtx); dash_gradient.draw(x1, y1, x2, y2, 10.0, 0); } double t2 = elapsed_time(); typedef agg::span_gouraud_rgba gouraud_span_gen_type; typedef agg::renderer_scanline_aa renderer_gouraud_type; gouraud_span_gen_type span_gouraud; renderer_gouraud_type ren_gouraud(ren_base, span_allocator, span_gouraud); start_timer(); for(i = 0; i < 2000; i++) { x1 = frand(w); y1 = frand(h); x2 = x1 + frand(w * 0.4) - w * 0.2; y2 = y1 + frand(h * 0.4) - h * 0.2; x3 = x1 + frand(w * 0.4) - w * 0.2; y3 = y1 + frand(h * 0.4) - h * 0.2; span_gouraud.colors(agg::rgba(frand(1.0), frand(1.0), frand(1.0), 0.5+frand(0.5)), agg::rgba(frand(1.0), frand(1.0), frand(1.0), frand(1.0)), agg::rgba(frand(1.0), frand(1.0), frand(1.0), frand(1.0))); span_gouraud.triangle(x1, y1, x2, y2, x3, y3, 0.0); ras.add_path(span_gouraud); agg::render_scanlines(ras, sl, ren_gouraud); } double t3 = elapsed_time(); char buf[256]; sprintf(buf, "Points=%.2fK/sec, Lines=%.2fK/sec, Triangles=%.2fK/sec", 20000.0/t1, 2000.0/t2, 2000.0/t3); message(buf); update_window(); } virtual void on_mouse_move(int x, int y, unsigned flags) { } virtual void on_mouse_button_up(int x, int y, unsigned flags) { } }; int agg_main(int argc, char* argv[]) { the_application app(agg::pix_format_bgr24, flip_y); app.caption("AGG Example. Anti-Aliasing Test"); if(app.init(480, 350, agg::window_resize)) { return app.run(); } return 1; } agg-2.5+dfsg1/examples/alpha_gradient.cpp0000644000000000000000000003032310703246330020543 0ustar00usergroup00000000000000#include #include "agg_basics.h" #include "agg_rendering_buffer.h" #include "agg_rasterizer_scanline_aa.h" #include "agg_scanline_u.h" #include "agg_renderer_scanline.h" #include "agg_span_gradient.h" #include "agg_span_gradient_alpha.h" #include "agg_span_interpolator_linear.h" #include "agg_span_allocator.h" #include "agg_span_converter.h" #include "agg_ellipse.h" #include "agg_pixfmt_rgb.h" #include "agg_vcgen_stroke.h" #include "platform/agg_platform_support.h" #include "ctrl/agg_spline_ctrl.h" enum flip_y_e { flip_y = true }; #define pix_format agg::pix_format_bgr24 typedef agg::pixfmt_bgr24 pixfmt_type; typedef pixfmt_type::color_type color_type; typedef color_type::value_type color_value_type; class the_application : public agg::platform_support { double m_x[3]; double m_y[3]; double m_dx; double m_dy; int m_idx; agg::spline_ctrl m_alpha; public: the_application(agg::pix_format_e format, bool flip_y) : agg::platform_support(format, flip_y), m_idx(-1), m_alpha(2, 2, 200, 30, 6, !flip_y) { m_x[0] = 257; m_y[0] = 60; m_x[1] = 369; m_y[1] = 170; m_x[2] = 143; m_y[2] = 310; m_alpha.point(0, 0.0, 0.0); m_alpha.point(1, 1.0/5.0, 1.0 - 4.0/5.0); m_alpha.point(2, 2.0/5.0, 1.0 - 3.0/5.0); m_alpha.point(3, 3.0/5.0, 1.0 - 2.0/5.0); m_alpha.point(4, 4.0/5.0, 1.0 - 1.0/5.0); m_alpha.point(5, 1.0, 1.0); m_alpha.update_spline(); add_ctrl(m_alpha); } // A simple function to form the gradient color array // consisting of 3 colors, "begin", "middle", "end" //--------------------------------------------------- template static void fill_color_array(ColorArrayT& array, color_type begin, color_type middle, color_type end) { unsigned i; for(i = 0; i < 128; ++i) { array[i] = begin.gradient(middle, i / 128.0); } for(; i < 256; ++i) { array[i] = middle.gradient(end, (i - 128) / 128.0); } } virtual void on_draw() { typedef agg::renderer_base base_ren_type; pixfmt_type pf(rbuf_window()); base_ren_type ren_base(pf); ren_base.clear(agg::rgba(1,1,1)); agg::scanline_u8 sl; agg::rasterizer_scanline_aa<> ras; // Draw some background agg::ellipse ell; srand(1234); unsigned i; unsigned w = unsigned(width()); unsigned h = unsigned(height()); for(i = 0; i < 100; i++) { ell.init(rand() % w, rand() % h, rand() % 60 + 5, rand() % 60 + 5, 50); ras.add_path(ell); agg::render_scanlines_aa_solid(ras, sl, ren_base, agg::rgba(rand() / double(RAND_MAX), rand() / double(RAND_MAX), rand() / double(RAND_MAX), rand() / double(RAND_MAX) / 2.0)); } double parallelogram[6]; parallelogram[0] = m_x[0]; parallelogram[1] = m_y[0]; parallelogram[2] = m_x[1]; parallelogram[3] = m_y[1]; parallelogram[4] = m_x[2]; parallelogram[5] = m_y[2]; // Gradient shape function (linear, radial, custom, etc) //----------------- typedef agg::gradient_circle gradient_func_type; // Alpha gradient shape function (linear, radial, custom, etc) //----------------- typedef agg::gradient_xy gradient_alpha_func_type; // Span interpolator. This object is used in all span generators // that operate with transformations during iterating of the spans, // for example, image transformers use the interpolator too. //----------------- typedef agg::span_interpolator_linear<> interpolator_type; // Span allocator is an object that allocates memory for // the array of colors that will be used to render the // color spans. One object can be shared between different // span generators. //----------------- typedef agg::span_allocator span_allocator_type; // Gradient colors array adaptor //----------------- typedef agg::pod_auto_array gradient_colors_type; // Finally, the gradient span generator working with the color_type // color type. //----------------- typedef agg::span_gradient span_gradient_type; // Gradient alpha array adaptor //----------------- typedef agg::pod_auto_array gradient_alpha_type; // The alpha gradient span converter working with the color_type // color type. //----------------- typedef agg::span_gradient_alpha span_gradient_alpha_type; // Span converter type //----------------- typedef agg::span_converter span_conv_type; // The gradient objects declarations //---------------- gradient_func_type gradient_func; // The gradient function gradient_alpha_func_type alpha_func; // The gradient function agg::trans_affine gradient_mtx; // Gradient affine transformer agg::trans_affine alpha_mtx; // Alpha affine transformer interpolator_type span_interpolator(gradient_mtx); // Span gradient interpolator interpolator_type span_interpolator_alpha(alpha_mtx); // Span alpha interpolator span_allocator_type span_allocator; // Span Allocator gradient_colors_type color_array; // The gradient colors // Declare the gradient span itself. // The last two arguments are so called "d1" and "d2" // defining two distances in pixels, where the gradient starts // and where it ends. The actual meaning of "d1" and "d2" depands // on the gradient function. //---------------- span_gradient_type span_gradient(span_interpolator, gradient_func, color_array, 0, 150); // Declare the gradient span itself. // The last two arguments are so called "d1" and "d2" // defining two distances in pixels, where the gradient starts // and where it ends. The actual meaning of "d1" and "d2" depands // on the gradient function. //---------------- gradient_alpha_type alpha_array; span_gradient_alpha_type span_gradient_alpha(span_interpolator_alpha, alpha_func, alpha_array, 0, 100); // Span converter declaration span_conv_type span_conv(span_gradient, span_gradient_alpha); // Finally we can draw a circle. //---------------- gradient_mtx *= agg::trans_affine_scaling(0.75, 1.2); gradient_mtx *= agg::trans_affine_rotation(-agg::pi/3.0); gradient_mtx *= agg::trans_affine_translation(width()/2, height()/2); gradient_mtx.invert(); alpha_mtx.parl_to_rect(parallelogram, -100, -100, 100, 100); fill_color_array(color_array, agg::rgba(0, 0.19, 0.19), agg::rgba(0.7, 0.7, 0.19), agg::rgba(0.31, 0, 0)); // Fill Alpha array //---------------- for(i = 0; i < 256; i++) { alpha_array[i] = color_value_type(m_alpha.value(i / 255.0) * double(color_type::base_mask)); } ell.init(width()/2, height()/2, 150, 150, 100); ras.add_path(ell); // Render the circle with gradient plus alpha-gradient agg::render_scanlines_aa(ras, sl, ren_base, span_allocator, span_conv); // Draw the control points and the parallelogram //----------------- agg::rgba color_pnt(0, 0.4, 0.4, 0.31); ell.init(m_x[0], m_y[0], 5, 5, 20); ras.add_path(ell); agg::render_scanlines_aa_solid(ras, sl, ren_base, color_pnt); ell.init(m_x[1], m_y[1], 5, 5, 20); ras.add_path(ell); agg::render_scanlines_aa_solid(ras, sl, ren_base, color_pnt); ell.init(m_x[2], m_y[2], 5, 5, 20); ras.add_path(ell); agg::render_scanlines_aa_solid(ras, sl, ren_base, color_pnt); agg::vcgen_stroke stroke; stroke.add_vertex(m_x[0], m_y[0], agg::path_cmd_move_to); stroke.add_vertex(m_x[1], m_y[1], agg::path_cmd_line_to); stroke.add_vertex(m_x[2], m_y[2], agg::path_cmd_line_to); stroke.add_vertex(m_x[0]+m_x[2]-m_x[1], m_y[0]+m_y[2]-m_y[1], agg::path_cmd_line_to); stroke.add_vertex(0, 0, agg::path_cmd_end_poly | agg::path_flags_close); ras.add_path(stroke); agg::render_scanlines_aa_solid(ras, sl, ren_base, agg::rgba(0, 0, 0)); agg::render_ctrl(ras, sl, ren_base, m_alpha); } virtual void on_mouse_button_down(int x, int y, unsigned flags) { unsigned i; if(flags & agg::mouse_left) { for (i = 0; i < 3; i++) { if(sqrt( (x-m_x[i]) * (x-m_x[i]) + (y-m_y[i]) * (y-m_y[i]) ) < 10.0) { m_dx = x - m_x[i]; m_dy = y - m_y[i]; m_idx = i; break; } } if(i == 3) { if(agg::point_in_triangle(m_x[0], m_y[0], m_x[1], m_y[1], m_x[2], m_y[2], x, y)) { m_dx = x - m_x[0]; m_dy = y - m_y[0]; m_idx = 3; } } } } virtual void on_mouse_move(int x, int y, unsigned flags) { if(flags & agg::mouse_left) { if(m_idx == 3) { double dx = x - m_dx; double dy = y - m_dy; m_x[1] -= m_x[0] - dx; m_y[1] -= m_y[0] - dy; m_x[2] -= m_x[0] - dx; m_y[2] -= m_y[0] - dy; m_x[0] = dx; m_y[0] = dy; force_redraw(); return; } if(m_idx >= 0) { m_x[m_idx] = x - m_dx; m_y[m_idx] = y - m_dy; force_redraw(); } } else { on_mouse_button_up(x, y, flags); } } virtual void on_mouse_button_up(int x, int y, unsigned flags) { m_idx = -1; } virtual void on_key(int x, int y, unsigned key, unsigned flags) { double dx = 0; double dy = 0; switch(key) { case agg::key_left: dx = -0.1; break; case agg::key_right: dx = 0.1; break; case agg::key_up: dy = 0.1; break; case agg::key_down: dy = -0.1; break; } m_x[0] += dx; m_y[0] += dy; m_x[1] += dx; m_y[1] += dy; force_redraw(); } }; int agg_main(int argc, char* argv[]) { the_application app(pix_format, flip_y); app.caption("AGG Example. Alpha channel gradient"); if(app.init(400, 320, agg::window_resize)) { return app.run(); } return 1; } agg-2.5+dfsg1/examples/alpha_mask.cpp0000644000000000000000000001165110703246330017704 0ustar00usergroup00000000000000#include #include #include #include "agg_basics.h" #include "agg_rendering_buffer.h" #include "agg_rasterizer_scanline_aa.h" #include "agg_path_storage.h" #include "agg_conv_transform.h" #include "agg_bounding_rect.h" #include "agg_renderer_scanline.h" #include "agg_pixfmt_rgb.h" #include "agg_pixfmt_gray.h" #include "agg_alpha_mask_u8.h" #include "agg_scanline_u.h" #include "agg_scanline_p.h" #include "agg_ellipse.h" #include "platform/agg_platform_support.h" enum flip_y_e { flip_y = true }; agg::path_storage g_path; agg::rgba8 g_colors[100]; unsigned g_path_idx[100]; unsigned g_npaths = 0; double g_x1 = 0; double g_y1 = 0; double g_x2 = 0; double g_y2 = 0; double g_base_dx = 0; double g_base_dy = 0; double g_angle = 0; double g_scale = 1.0; double g_skew_x = 0; double g_skew_y = 0; int g_nclick = 0; unsigned parse_lion(agg::path_storage& ps, agg::rgba8* colors, unsigned* path_idx); void parse_lion() { g_npaths = parse_lion(g_path, g_colors, g_path_idx); agg::pod_array_adaptor path_idx(g_path_idx, 100); agg::bounding_rect(g_path, path_idx, 0, g_npaths, &g_x1, &g_y1, &g_x2, &g_y2); g_base_dx = (g_x2 - g_x1) / 2.0; g_base_dy = (g_y2 - g_y1) / 2.0; } agg::rendering_buffer g_alpha_mask_rbuf; agg::alpha_mask_gray8 g_alpha_mask(g_alpha_mask_rbuf); agg::rasterizer_scanline_aa<> g_rasterizer; class the_application : public agg::platform_support { unsigned char* m_alpha_buf; agg::rendering_buffer m_alpha_rbuf; public: virtual ~the_application() { delete [] m_alpha_buf; } the_application(agg::pix_format_e format, bool flip_y) : agg::platform_support(format, flip_y), m_alpha_buf(0) { parse_lion(); } void generate_alpha_mask(int cx, int cy) { delete [] m_alpha_buf; m_alpha_buf = new unsigned char[cx * cy]; g_alpha_mask_rbuf.attach(m_alpha_buf, cx, cy, cx); typedef agg::renderer_base ren_base; typedef agg::renderer_scanline_aa_solid renderer; agg::pixfmt_gray8 pixf(g_alpha_mask_rbuf); ren_base rb(pixf); renderer r(rb); agg::scanline_p8 sl; rb.clear(agg::gray8(0)); agg::ellipse ell; int i; for(i = 0; i < 10; i++) { ell.init(rand() % cx, rand() % cy, rand() % 100 + 20, rand() % 100 + 20, 100); g_rasterizer.add_path(ell); r.color(agg::gray8(rand() & 0xFF, rand() & 0xFF)); agg::render_scanlines(g_rasterizer, sl, r); } } virtual void on_resize(int cx, int cy) { generate_alpha_mask(cx, cy); } virtual void on_draw() { int width = rbuf_window().width(); int height = rbuf_window().height(); typedef agg::scanline_u8_am scanline_type; typedef agg::renderer_base ren_base; typedef agg::renderer_scanline_aa_solid renderer; agg::pixfmt_bgr24 pixf(rbuf_window()); ren_base rb(pixf); renderer r(rb); scanline_type sl(g_alpha_mask); rb.clear(agg::rgba8(255, 255, 255)); agg::trans_affine mtx; mtx *= agg::trans_affine_translation(-g_base_dx, -g_base_dy); mtx *= agg::trans_affine_scaling(g_scale, g_scale); mtx *= agg::trans_affine_rotation(g_angle + agg::pi); mtx *= agg::trans_affine_skewing(g_skew_x/1000.0, g_skew_y/1000.0); mtx *= agg::trans_affine_translation(width/2, height/2); agg::conv_transform trans(g_path, mtx); agg::render_all_paths(g_rasterizer, sl, r, trans, g_colors, g_path_idx, g_npaths); } void transform(double width, double height, double x, double y) { x -= width / 2; y -= height / 2; g_angle = atan2(y, x); g_scale = sqrt(y * y + x * x) / 100.0; } virtual void on_mouse_button_down(int x, int y, unsigned flags) { if(flags & agg::mouse_left) { int width = rbuf_window().width(); int height = rbuf_window().height(); transform(width, height, x, y); force_redraw(); } if(flags & agg::mouse_right) { g_skew_x = x; g_skew_y = y; force_redraw(); } } virtual void on_mouse_move(int x, int y, unsigned flags) { on_mouse_button_down(x, y, flags); } }; int agg_main(int argc, char* argv[]) { the_application app(agg::pix_format_bgr24, flip_y); app.caption("AGG Example. Lion with Alpha-Masking"); if(app.init(512, 400, agg::window_resize)) { return app.run(); } return 1; } agg-2.5+dfsg1/examples/alpha_mask2.cpp0000644000000000000000000002726410703246330017775 0ustar00usergroup00000000000000#include #include #include #include "agg_basics.h" #include "agg_rendering_buffer.h" #include "agg_rasterizer_scanline_aa.h" #include "agg_scanline_u.h" #include "agg_scanline_p.h" #include "agg_color_gray.h" #include "agg_renderer_mclip.h" #include "agg_renderer_scanline.h" #include "agg_path_storage.h" #include "agg_conv_transform.h" #include "agg_bounding_rect.h" #include "agg_renderer_outline_aa.h" #include "agg_pixfmt_gray.h" #include "agg_pixfmt_amask_adaptor.h" #include "agg_renderer_primitives.h" #include "agg_renderer_markers.h" #include "agg_span_allocator.h" #include "agg_span_gradient.h" #include "agg_span_interpolator_linear.h" #include "agg_rasterizer_outline_aa.h" #include "agg_alpha_mask_u8.h" #include "agg_ellipse.h" #include "ctrl/agg_slider_ctrl.h" #include "platform/agg_platform_support.h" //#define AGG_GRAY8 //#define AGG_BGR24 //#define AGG_RGB24 #define AGG_BGRA32 //#define AGG_RGBA32 //#define AGG_ARGB32 //#define AGG_ABGR32 //#define AGG_RGB565 //#define AGG_RGB555 #include "pixel_formats.h" enum flip_y_e { flip_y = true }; agg::rasterizer_scanline_aa<> g_rasterizer; agg::scanline_u8 g_scanline; agg::path_storage g_path; agg::rgba8 g_colors[100]; unsigned g_path_idx[100]; unsigned g_npaths = 0; double g_x1 = 0; double g_y1 = 0; double g_x2 = 0; double g_y2 = 0; double g_base_dx = 0; double g_base_dy = 0; double g_angle = 0; double g_scale = 1.0; double g_skew_x = 0; double g_skew_y = 0; int g_nclick = 0; unsigned parse_lion(agg::path_storage& ps, agg::rgba8* colors, unsigned* path_idx); void parse_lion() { g_npaths = parse_lion(g_path, g_colors, g_path_idx); agg::pod_array_adaptor path_idx(g_path_idx, 100); agg::bounding_rect(g_path, path_idx, 0, g_npaths, &g_x1, &g_y1, &g_x2, &g_y2); g_base_dx = (g_x2 - g_x1) / 2.0; g_base_dy = (g_y2 - g_y1) / 2.0; } namespace agg { // Specializations of the gradient_linear_color for rgba8 and gray8 // color types. Only for the sake of performance. //======================================================================== template<> struct gradient_linear_color { typedef rgba8 color_type; gradient_linear_color() {} gradient_linear_color(const color_type& c1, const color_type& c2) : m_c1(c1), m_c2(c2) {} static unsigned size() { return 256; } color_type operator [] (unsigned v) const { color_type c; c.r = (int8u)((((m_c2.r - m_c1.r) * int(v)) + (m_c1.r << 8)) >> 8); c.g = (int8u)((((m_c2.g - m_c1.g) * int(v)) + (m_c1.g << 8)) >> 8); c.b = (int8u)((((m_c2.b - m_c1.b) * int(v)) + (m_c1.b << 8)) >> 8); c.a = (int8u)((((m_c2.a - m_c1.a) * int(v)) + (m_c1.a << 8)) >> 8); return c; } void colors(const color_type& c1, const color_type& c2) { m_c1 = c1; m_c2 = c2; } color_type m_c1; color_type m_c2; }; //======================================================================== template<> struct gradient_linear_color { typedef gray8 color_type; gradient_linear_color() {} gradient_linear_color(const color_type& c1, const color_type& c2) : m_c1(c1), m_c2(c2) {} static unsigned size() { return 256; } color_type operator [] (unsigned v) const { color_type c; c.v = (int8u)((((m_c2.v - m_c1.v) * int(v)) + (m_c1.v << 8)) >> 8); c.a = (int8u)((((m_c2.a - m_c1.a) * int(v)) + (m_c1.a << 8)) >> 8); return c; } void colors(const color_type& c1, const color_type& c2) { m_c1 = c1; m_c2 = c2; } color_type m_c1; color_type m_c2; }; } class the_application : public agg::platform_support { agg::slider_ctrl m_num_cb; typedef agg::amask_no_clip_gray8 alpha_mask_type; //typedef agg::alpha_mask_gray8 alpha_mask_type; unsigned char* m_alpha_buf; agg::rendering_buffer m_alpha_mask_rbuf; alpha_mask_type m_alpha_mask; double m_slider_value; public: ~the_application() { delete [] m_alpha_buf; } the_application(agg::pix_format_e format, bool flip_y) : agg::platform_support(format, flip_y), m_num_cb(5, 5, 150, 12, !flip_y), m_alpha_buf(0), m_alpha_mask_rbuf(), m_alpha_mask(m_alpha_mask_rbuf), m_slider_value(0.0) { parse_lion(); add_ctrl(m_num_cb); m_num_cb.range(5, 100); m_num_cb.value(10); m_num_cb.label("N=%.2f"); m_num_cb.no_transform(); } void generate_alpha_mask(int cx, int cy) { delete [] m_alpha_buf; m_alpha_buf = new unsigned char[cx * cy]; m_alpha_mask_rbuf.attach(m_alpha_buf, cx, cy, cx); typedef agg::renderer_base ren_base; typedef agg::renderer_scanline_aa_solid renderer; agg::pixfmt_gray8 pixf(m_alpha_mask_rbuf); ren_base rb(pixf); renderer r(rb); agg::scanline_p8 sl; rb.clear(agg::gray8(0)); agg::ellipse ell; srand(1432); int i; for(i = 0; i < (int)m_num_cb.value(); i++) { ell.init(rand() % cx, rand() % cy, rand() % 100 + 20, rand() % 100 + 20, 100); g_rasterizer.add_path(ell); r.color(agg::gray8((rand() & 127) + 128, (rand() & 127) + 128)); agg::render_scanlines(g_rasterizer, sl, r); } } virtual void on_resize(int cx, int cy) { generate_alpha_mask(cx, cy); } virtual void on_draw() { unsigned i; int width = rbuf_window().width(); int height = rbuf_window().height(); if(m_num_cb.value() != m_slider_value) { generate_alpha_mask(width, height); m_slider_value = m_num_cb.value(); } pixfmt pf(rbuf_window()); typedef agg::pixfmt_amask_adaptor pixfmt_amask_type; typedef agg::renderer_base amask_ren_type; typedef agg::renderer_base base_ren_type; pixfmt_amask_type pfa(pf, m_alpha_mask); amask_ren_type r(pfa); base_ren_type rbase(pf); agg::renderer_scanline_aa_solid rs(r); agg::renderer_scanline_aa_solid rb(rbase); agg::trans_affine mtx; mtx *= agg::trans_affine_translation(-g_base_dx, -g_base_dy); mtx *= agg::trans_affine_scaling(g_scale, g_scale); mtx *= agg::trans_affine_rotation(g_angle + agg::pi); mtx *= agg::trans_affine_skewing(g_skew_x/1000.0, g_skew_y/1000.0); mtx *= agg::trans_affine_translation(width/2, height/2); rbase.clear(agg::rgba(1, 1, 1)); int x, y; // Render the lion agg::conv_transform trans(g_path, mtx); agg::render_all_paths(g_rasterizer, g_scanline, rs, trans, g_colors, g_path_idx, g_npaths); // Render random Bresenham lines and markers agg::renderer_markers m(r); for(i = 0; i < 50; i++) { m.line_color(agg::rgba8(rand() & 0x7F, rand() & 0x7F, rand() & 0x7F, (rand() & 0x7F) + 0x7F)); m.fill_color(agg::rgba8(rand() & 0x7F, rand() & 0x7F, rand() & 0x7F, (rand() & 0x7F) + 0x7F)); m.line(m.coord(rand() % width), m.coord(rand() % height), m.coord(rand() % width), m.coord(rand() % height)); m.marker(rand() % width, rand() % height, rand() % 10 + 5, agg::marker_e(rand() % agg::end_of_markers)); } // Render random anti-aliased lines double w = 5.0; agg::line_profile_aa profile; profile.width(w); typedef agg::renderer_outline_aa renderer_type; renderer_type ren(r, profile); typedef agg::rasterizer_outline_aa rasterizer_type; rasterizer_type ras(ren); ras.round_cap(true); for(i = 0; i < 50; i++) { ren.color(agg::rgba8(rand() & 0x7F, rand() & 0x7F, rand() & 0x7F, //255)); (rand() & 0x7F) + 0x7F)); ras.move_to_d(rand() % width, rand() % height); ras.line_to_d(rand() % width, rand() % height); ras.render(false); } // Render random circles with gradient typedef agg::gradient_linear_color grad_color; typedef agg::gradient_circle grad_func; typedef agg::span_interpolator_linear<> interpolator_type; typedef agg::span_gradient span_grad_type; agg::trans_affine grm; grad_func grf; grad_color grc(agg::rgba8(0,0,0), agg::rgba8(0,0,0)); agg::ellipse ell; agg::span_allocator sa; interpolator_type inter(grm); span_grad_type sg(inter, grf, grc, 0, 10); agg::renderer_scanline_aa, span_grad_type> rg(r, sa, sg); for(i = 0; i < 50; i++) { x = rand() % width; y = rand() % height; double r = rand() % 10 + 5; grm.reset(); grm *= agg::trans_affine_scaling(r / 10.0); grm *= agg::trans_affine_translation(x, y); grm.invert(); grc.colors(agg::rgba8(255, 255, 255, 0), agg::rgba8(rand() & 0x7F, rand() & 0x7F, rand() & 0x7F, 255)); sg.color_function(grc); ell.init(x, y, r, r, 32); g_rasterizer.add_path(ell); agg::render_scanlines(g_rasterizer, g_scanline, rg); } agg::render_ctrl(g_rasterizer, g_scanline, rbase, m_num_cb); } void transform(double width, double height, double x, double y) { x -= width / 2; y -= height / 2; g_angle = atan2(y, x); g_scale = sqrt(y * y + x * x) / 100.0; } virtual void on_mouse_button_down(int x, int y, unsigned flags) { if(flags & agg::mouse_left) { int width = rbuf_window().width(); int height = rbuf_window().height(); transform(width, height, x, y); force_redraw(); } if(flags & agg::mouse_right) { g_skew_x = x; g_skew_y = y; force_redraw(); } } virtual void on_mouse_move(int x, int y, unsigned flags) { on_mouse_button_down(x, y, flags); } }; int agg_main(int argc, char* argv[]) { the_application app(pix_format, flip_y); app.caption("AGG Example. Clipping to multiple rectangle regions"); if(app.init(512, 400, agg::window_resize)) { return app.run(); } return 1; } agg-2.5+dfsg1/examples/alpha_mask3.cpp0000644000000000000000000004131110703246330017763 0ustar00usergroup00000000000000#include #include "agg_basics.h" #include "agg_rendering_buffer.h" #include "agg_rasterizer_scanline_aa.h" #include "agg_scanline_p.h" #include "agg_renderer_scanline.h" #include "agg_renderer_primitives.h" #include "agg_conv_curve.h" #include "agg_conv_stroke.h" #include "agg_gsv_text.h" #include "agg_pixfmt_rgb.h" #include "agg_pixfmt_gray.h" #include "agg_pixfmt_amask_adaptor.h" #include "agg_span_allocator.h" #include "agg_alpha_mask_u8.h" #include "platform/agg_platform_support.h" #include "ctrl/agg_slider_ctrl.h" #include "ctrl/agg_cbox_ctrl.h" #include "ctrl/agg_rbox_ctrl.h" enum flip_y_e { flip_y = true }; class spiral { public: spiral(double x, double y, double r1, double r2, double step, double start_angle=0) : m_x(x), m_y(y), m_r1(r1), m_r2(r2), m_step(step), m_start_angle(start_angle), m_angle(start_angle), m_da(agg::deg2rad(4.0)), m_dr(m_step / 90.0) { } void rewind(unsigned) { m_angle = m_start_angle; m_curr_r = m_r1; m_start = true; } unsigned vertex(double* x, double* y) { if(m_curr_r > m_r2) return agg::path_cmd_stop; *x = m_x + cos(m_angle) * m_curr_r; *y = m_y + sin(m_angle) * m_curr_r; m_curr_r += m_dr; m_angle += m_da; if(m_start) { m_start = false; return agg::path_cmd_move_to; } return agg::path_cmd_line_to; } private: double m_x; double m_y; double m_r1; double m_r2; double m_step; double m_start_angle; double m_angle; double m_curr_r; double m_da; double m_dr; bool m_start; }; void make_gb_poly(agg::path_storage& ps); void make_arrows(agg::path_storage& ps); class the_application : public agg::platform_support { agg::rbox_ctrl m_polygons; agg::rbox_ctrl m_operation; typedef agg::amask_no_clip_gray8 alpha_mask_type; //typedef agg::alpha_mask_gray8 alpha_mask_type; typedef agg::pixfmt_bgr24 pixfmt_type; unsigned char* m_alpha_buf; agg::rendering_buffer m_alpha_mask_rbuf; alpha_mask_type m_alpha_mask; agg::rasterizer_scanline_aa<> m_ras; agg::scanline_p8 m_sl; double m_x; double m_y; public: ~the_application() { delete [] m_alpha_buf; } the_application(agg::pix_format_e format, bool flip_y) : agg::platform_support(format, flip_y), m_polygons (5.0, 5.0, 5.0+205.0, 110.0, !flip_y), m_operation(555.0, 5.0, 555.0+80.0, 55.0, !flip_y), m_alpha_buf(0), m_alpha_mask_rbuf(), m_alpha_mask(m_alpha_mask_rbuf), m_x(0), m_y(0) { m_operation.add_item("AND"); m_operation.add_item("SUB"); m_operation.cur_item(0); add_ctrl(m_operation); m_operation.no_transform(); m_polygons.add_item("Two Simple Paths"); m_polygons.add_item("Closed Stroke"); m_polygons.add_item("Great Britain and Arrows"); m_polygons.add_item("Great Britain and Spiral"); m_polygons.add_item("Spiral and Glyph"); m_polygons.cur_item(3); add_ctrl(m_polygons); m_polygons.no_transform(); } void draw_text(double x, double y, const char* str) { pixfmt_type pf(rbuf_window()); agg::renderer_base rb(pf); agg::renderer_scanline_aa_solid > ren(rb); agg::gsv_text txt; agg::conv_stroke txt_stroke(txt); txt_stroke.width(1.5); txt_stroke.line_cap(agg::round_cap); txt.size(10.0); txt.start_point(x, y); txt.text(str); m_ras.add_path(txt_stroke); ren.color(agg::rgba(0.0, 0.0, 0.0)); agg::render_scanlines(m_ras, m_sl, ren); } template void generate_alpha_mask(VertexSource& vs) { unsigned cx = (unsigned)width(); unsigned cy = (unsigned)height(); delete [] m_alpha_buf; m_alpha_buf = new unsigned char[cx * cy]; m_alpha_mask_rbuf.attach(m_alpha_buf, cx, cy, cx); typedef agg::renderer_base ren_base; typedef agg::renderer_scanline_aa_solid renderer; agg::pixfmt_gray8 pixf(m_alpha_mask_rbuf); ren_base rb(pixf); renderer ren(rb); start_timer(); if(m_operation.cur_item() == 0) { rb.clear(agg::gray8(0)); ren.color(agg::gray8(255)); } else { rb.clear(agg::gray8(255)); ren.color(agg::gray8(0)); } m_ras.add_path(vs); agg::render_scanlines(m_ras, m_sl, ren); double t1 = elapsed_time(); char buf[100]; sprintf(buf, "Generate AlphaMask: %.3fms", t1); draw_text(250, 20, buf); } template void perform_rendering(VertexSource& vs) { pixfmt_type pixf(rbuf_window()); typedef agg::pixfmt_amask_adaptor pixfmt_amask_type; typedef agg::renderer_base amask_ren_type; pixfmt_amask_type pixfa(pixf, m_alpha_mask); amask_ren_type rbase(pixfa); agg::renderer_scanline_aa_solid ren(rbase); ren.color(agg::rgba(0.5, 0.0, 0, 0.5)); start_timer(); m_ras.reset(); m_ras.add_path(vs); agg::render_scanlines(m_ras, m_sl, ren); double t1 = elapsed_time(); char buf[100]; sprintf(buf, "Render with AlphaMask: %.3fms", t1); draw_text(250, 5, buf); } unsigned render() { pixfmt_type pf(rbuf_window()); agg::renderer_base rb(pf); agg::renderer_scanline_aa_solid > ren(rb); switch(m_polygons.cur_item()) { case 0: { //------------------------------------ // Two simple paths // agg::path_storage ps1; agg::path_storage ps2; double x = m_x - initial_width()/2 + 100; double y = m_y - initial_height()/2 + 100; ps1.move_to(x+140, y+145); ps1.line_to(x+225, y+44); ps1.line_to(x+296, y+219); ps1.close_polygon(); ps1.line_to(x+226, y+289); ps1.line_to(x+82, y+292); ps1.move_to(x+220, y+222); ps1.line_to(x+363, y+249); ps1.line_to(x+265, y+331); ps1.move_to(x+242, y+243); ps1.line_to(x+268, y+309); ps1.line_to(x+325, y+261); ps1.move_to(x+259, y+259); ps1.line_to(x+273, y+288); ps1.line_to(x+298, y+266); ps2.move_to(100+32, 100+77); ps2.line_to(100+473, 100+263); ps2.line_to(100+351, 100+290); ps2.line_to(100+354, 100+374); m_ras.reset(); m_ras.add_path(ps1); ren.color(agg::rgba(0, 0, 0, 0.1)); agg::render_scanlines(m_ras, m_sl, ren); m_ras.reset(); m_ras.add_path(ps2); ren.color(agg::rgba(0, 0.6, 0, 0.1)); agg::render_scanlines(m_ras, m_sl, ren); generate_alpha_mask(ps1); perform_rendering(ps2); } break; case 1: { //------------------------------------ // Closed stroke // agg::path_storage ps1; agg::path_storage ps2; agg::conv_stroke stroke(ps2); stroke.width(10.0); double x = m_x - initial_width()/2 + 100; double y = m_y - initial_height()/2 + 100; ps1.move_to(x+140, y+145); ps1.line_to(x+225, y+44); ps1.line_to(x+296, y+219); ps1.close_polygon(); ps1.line_to(x+226, y+289); ps1.line_to(x+82, y+292); ps1.move_to(x+220-50, y+222); ps1.line_to(x+265-50, y+331); ps1.line_to(x+363-50, y+249); ps1.close_polygon(agg::path_flags_ccw); ps2.move_to(100+32, 100+77); ps2.line_to(100+473, 100+263); ps2.line_to(100+351, 100+290); ps2.line_to(100+354, 100+374); ps2.close_polygon(); m_ras.reset(); m_ras.add_path(ps1); ren.color(agg::rgba(0, 0, 0, 0.1)); agg::render_scanlines(m_ras, m_sl, ren); m_ras.reset(); m_ras.add_path(stroke); ren.color(agg::rgba(0, 0.6, 0, 0.1)); agg::render_scanlines(m_ras, m_sl, ren); generate_alpha_mask(ps1); perform_rendering(stroke); } break; case 2: { //------------------------------------ // Great Britain and Arrows // agg::path_storage gb_poly; agg::path_storage arrows; make_gb_poly(gb_poly); make_arrows(arrows); agg::trans_affine mtx1; agg::trans_affine mtx2; mtx1 *= agg::trans_affine_translation(-1150, -1150); mtx1 *= agg::trans_affine_scaling(2.0); mtx2 = mtx1; mtx2 *= agg::trans_affine_translation(m_x - initial_width()/2, m_y - initial_height()/2); agg::conv_transform trans_gb_poly(gb_poly, mtx1); agg::conv_transform trans_arrows(arrows, mtx2); m_ras.add_path(trans_gb_poly); ren.color(agg::rgba(0.5, 0.5, 0, 0.1)); agg::render_scanlines(m_ras, m_sl, ren); agg::conv_stroke > stroke_gb_poly(trans_gb_poly); stroke_gb_poly.width(0.1); m_ras.add_path(stroke_gb_poly); ren.color(agg::rgba(0, 0, 0)); agg::render_scanlines(m_ras, m_sl, ren); m_ras.add_path(trans_arrows); ren.color(agg::rgba(0.0, 0.5, 0.5, 0.1)); agg::render_scanlines(m_ras, m_sl, ren); generate_alpha_mask(trans_gb_poly); perform_rendering(trans_arrows); } break; case 3: { //------------------------------------ // Great Britain and a Spiral // spiral sp(m_x, m_y, 10, 150, 30, 0.0); agg::conv_stroke stroke(sp); stroke.width(15.0); agg::path_storage gb_poly; make_gb_poly(gb_poly); agg::trans_affine mtx; mtx *= agg::trans_affine_translation(-1150, -1150); mtx *= agg::trans_affine_scaling(2.0); agg::conv_transform trans_gb_poly(gb_poly, mtx); m_ras.add_path(trans_gb_poly); ren.color(agg::rgba(0.5, 0.5, 0, 0.1)); agg::render_scanlines(m_ras, m_sl, ren); agg::conv_stroke > stroke_gb_poly(trans_gb_poly); stroke_gb_poly.width(0.1); m_ras.add_path(stroke_gb_poly); ren.color(agg::rgba(0, 0, 0)); agg::render_scanlines(m_ras, m_sl, ren); m_ras.add_path(stroke); ren.color(agg::rgba(0.0, 0.5, 0.5, 0.1)); agg::render_scanlines(m_ras, m_sl, ren); generate_alpha_mask(trans_gb_poly); perform_rendering(stroke); } break; case 4: { //------------------------------------ // Spiral and glyph // spiral sp(m_x, m_y, 10, 150, 30, 0.0); agg::conv_stroke stroke(sp); stroke.width(15.0); agg::path_storage glyph; glyph.move_to(28.47, 6.45); glyph.curve3(21.58, 1.12, 19.82, 0.29); glyph.curve3(17.19, -0.93, 14.21, -0.93); glyph.curve3(9.57, -0.93, 6.57, 2.25); glyph.curve3(3.56, 5.42, 3.56, 10.60); glyph.curve3(3.56, 13.87, 5.03, 16.26); glyph.curve3(7.03, 19.58, 11.99, 22.51); glyph.curve3(16.94, 25.44, 28.47, 29.64); glyph.line_to(28.47, 31.40); glyph.curve3(28.47, 38.09, 26.34, 40.58); glyph.curve3(24.22, 43.07, 20.17, 43.07); glyph.curve3(17.09, 43.07, 15.28, 41.41); glyph.curve3(13.43, 39.75, 13.43, 37.60); glyph.line_to(13.53, 34.77); glyph.curve3(13.53, 32.52, 12.38, 31.30); glyph.curve3(11.23, 30.08, 9.38, 30.08); glyph.curve3(7.57, 30.08, 6.42, 31.35); glyph.curve3(5.27, 32.62, 5.27, 34.81); glyph.curve3(5.27, 39.01, 9.57, 42.53); glyph.curve3(13.87, 46.04, 21.63, 46.04); glyph.curve3(27.59, 46.04, 31.40, 44.04); glyph.curve3(34.28, 42.53, 35.64, 39.31); glyph.curve3(36.52, 37.21, 36.52, 30.71); glyph.line_to(36.52, 15.53); glyph.curve3(36.52, 9.13, 36.77, 7.69); glyph.curve3(37.01, 6.25, 37.57, 5.76); glyph.curve3(38.13, 5.27, 38.87, 5.27); glyph.curve3(39.65, 5.27, 40.23, 5.62); glyph.curve3(41.26, 6.25, 44.19, 9.18); glyph.line_to(44.19, 6.45); glyph.curve3(38.72, -0.88, 33.74, -0.88); glyph.curve3(31.35, -0.88, 29.93, 0.78); glyph.curve3(28.52, 2.44, 28.47, 6.45); glyph.close_polygon(); glyph.move_to(28.47, 9.62); glyph.line_to(28.47, 26.66); glyph.curve3(21.09, 23.73, 18.95, 22.51); glyph.curve3(15.09, 20.36, 13.43, 18.02); glyph.curve3(11.77, 15.67, 11.77, 12.89); glyph.curve3(11.77, 9.38, 13.87, 7.06); glyph.curve3(15.97, 4.74, 18.70, 4.74); glyph.curve3(22.41, 4.74, 28.47, 9.62); glyph.close_polygon(); agg::trans_affine mtx; mtx *= agg::trans_affine_scaling(4.0); mtx *= agg::trans_affine_translation(220, 200); agg::conv_transform trans(glyph, mtx); agg::conv_curve > curve(trans); m_ras.reset(); m_ras.add_path(stroke); ren.color(agg::rgba(0, 0, 0, 0.1)); agg::render_scanlines(m_ras, m_sl, ren); m_ras.reset(); m_ras.add_path(curve); ren.color(agg::rgba(0, 0.6, 0, 0.1)); agg::render_scanlines(m_ras, m_sl, ren); generate_alpha_mask(stroke); perform_rendering(curve); } break; } return 0; } virtual void on_init() { m_x = width() / 2.0; m_y = height() / 2.0; } virtual void on_draw() { typedef agg::renderer_base base_ren_type; pixfmt_type pf(rbuf_window()); base_ren_type ren_base(pf); ren_base.clear(agg::rgba(1,1,1)); render(); agg::render_ctrl(m_ras, m_sl, ren_base, m_polygons); agg::render_ctrl(m_ras, m_sl, ren_base, m_operation); } virtual void on_mouse_button_down(int x, int y, unsigned flags) { if(flags & agg::mouse_left) { m_x = x; m_y = y; force_redraw(); } if(flags & agg::mouse_right) { char buf[100]; sprintf(buf, "%d %d", x, y); message(buf); } } virtual void on_mouse_move(int x, int y, unsigned flags) { if(flags & agg::mouse_left) { m_x = x; m_y = y; force_redraw(); } } }; int agg_main(int argc, char* argv[]) { the_application app(agg::pix_format_bgr24, flip_y); app.caption("AGG Example. Alpha-Mask as a Polygon Clipper"); if(app.init(640, 520, agg::window_resize)) { return app.run(); } return 1; } agg-2.5+dfsg1/examples/bezier_div.cpp0000644000000000000000000005101110703246330017720 0ustar00usergroup00000000000000#include #include #include #include "agg_rendering_buffer.h" #include "agg_conv_transform.h" #include "agg_conv_stroke.h" #include "agg_conv_dash.h" #include "agg_scanline_u.h" #include "agg_renderer_scanline.h" #include "agg_rasterizer_outline_aa.h" #include "agg_rasterizer_scanline_aa.h" #include "agg_pattern_filters_rgba.h" #include "agg_renderer_outline_aa.h" #include "agg_renderer_outline_image.h" #include "agg_arc.h" #include "agg_bezier_arc.h" #include "agg_pixfmt_rgb.h" #include "ctrl/agg_slider_ctrl.h" #include "ctrl/agg_bezier_ctrl.h" #include "ctrl/agg_rbox_ctrl.h" #include "ctrl/agg_cbox_ctrl.h" #include "platform/agg_platform_support.h" enum flip_y_e { flip_y = true }; typedef agg::pixfmt_bgr24 pixfmt; void bezier4_point(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4, double mu, double* x, double* y) { double mum1, mum13, mu3; mum1 = 1 - mu; mum13 = mum1 * mum1 * mum1; mu3 = mu * mu * mu; *x = mum13*x1 + 3*mu*mum1*mum1*x2 + 3*mu*mu*mum1*x3 + mu3*x4; *y = mum13*y1 + 3*mu*mum1*mum1*y2 + 3*mu*mu*mum1*y3 + mu3*y4; } class the_application : public agg::platform_support { agg::rgba8 m_ctrl_color; agg::bezier_ctrl m_curve1; agg::slider_ctrl m_angle_tolerance; agg::slider_ctrl m_approximation_scale; agg::slider_ctrl m_cusp_limit; agg::slider_ctrl m_width; agg::cbox_ctrl m_show_points; agg::cbox_ctrl m_show_outline; agg::rbox_ctrl m_curve_type; agg::rbox_ctrl m_case_type; agg::rbox_ctrl m_inner_join; agg::rbox_ctrl m_line_join; agg::rbox_ctrl m_line_cap; int m_cur_case_type; public: typedef agg::renderer_base renderer_base; typedef agg::renderer_scanline_aa_solid renderer_scanline; typedef agg::rasterizer_scanline_aa<> rasterizer_scanline; typedef agg::scanline_u8 scanline; the_application(agg::pix_format_e format, bool flip_y) : agg::platform_support(format, flip_y), m_ctrl_color(agg::rgba(0, 0.3, 0.5, 0.8)), m_angle_tolerance (5.0, 5.0, 240.0, 12.0, !flip_y), m_approximation_scale(5.0, 17+5.0, 240.0, 17+12.0, !flip_y), m_cusp_limit (5.0, 17+17+5.0, 240.0, 17+17+12.0, !flip_y), m_width (245.0, 5.0, 495.0, 12.0, !flip_y), m_show_points (250.0, 15+5, "Show Points", !flip_y), m_show_outline (250.0, 30+5, "Show Stroke Outline", !flip_y), m_curve_type (535.0, 5.0, 535.0+115.0, 55.0, !flip_y), m_case_type (535.0, 60.0, 535.0+115.0, 195.0, !flip_y), m_inner_join (535.0, 200.0, 535.0+115.0, 290.0, !flip_y), m_line_join (535.0, 295.0, 535.0+115.0, 385.0, !flip_y), m_line_cap (535.0, 395.0, 535.0+115.0, 455.0, !flip_y), m_cur_case_type(-1) { m_curve1.line_color(m_ctrl_color); m_curve1.curve(170, 424, 13, 87, 488, 423, 26, 333); //m_curve1.curve(26.000, 333.000, 276.000, 126.000, 402.000, 479.000, 26.000, 333.000); // Loop with p1==p4 //m_curve1.curve(378.000, 439.000, 378.000, 497.000, 487.000, 432.000, 14.000, 338.000); // Narrow loop //m_curve1.curve(288.000, 283.000, 232.000, 89.000, 66.000, 197.000, 456.000, 241.000); // Loop //m_curve1.curve(519.000, 142.000, 97.000, 147.000, 69.000, 147.000, 30.000, 144.000); // Almost straight //m_curve1.curve(100, 100, 200, 100, 100, 200, 200, 200); // A "Z" case //m_curve1.curve(150, 150, 350, 150, 150, 150, 350, 150); // Degenerate //m_curve1.curve(409, 330, 300, 200, 200, 200, 401, 263); // Strange cusp //m_curve1.curve(129, 233, 172, 320, 414, 253, 344, 236); // Curve cap //m_curve1.curve(100,100, 100,200, 100,100, 110,100); // A "boot" //m_curve1.curve(225, 150, 60, 150, 460, 150, 295, 150); // 2----1----4----3 //m_curve1.curve(162.2, 248.801, 162.2, 248.801, 266, 284, 394, 335); // Coinciding 1-2 //m_curve1.curve(162.200, 248.801, 162.200, 248.801, 257.000, 301.000, 394.000, 335.000); // Coinciding 1-2 //m_curve1.curve(394.000, 335.000, 257.000, 301.000, 162.200, 248.801, 162.200, 248.801); // Coinciding 3-4 //m_curve1.curve(84.200000,302.80100, 84.200000,302.80100, 79.000000,292.40100, 97.001000,304.40100); // From tiger.svg //m_curve1.curve(97.001000,304.40100, 79.000000,292.40100, 84.200000,302.80100, 84.200000,302.80100); // From tiger.svg opposite dir //m_curve1.curve(475, 157, 200, 100, 453, 100, 222, 157); // Cusp, failure for Adobe SVG add_ctrl(m_curve1); m_curve1.no_transform(); m_angle_tolerance.label("Angle Tolerance=%.0f deg"); m_angle_tolerance.range(0, 90); m_angle_tolerance.value(15); add_ctrl(m_angle_tolerance); m_angle_tolerance.no_transform(); m_approximation_scale.label("Approximation Scale=%.3f"); m_approximation_scale.range(0.1, 5); m_approximation_scale.value(1.0); add_ctrl(m_approximation_scale); m_approximation_scale.no_transform(); m_cusp_limit.label("Cusp Limit=%.0f deg"); m_cusp_limit.range(0, 90); m_cusp_limit.value(0); add_ctrl(m_cusp_limit); m_cusp_limit.no_transform(); m_width.label("Width=%.2f"); m_width.range(-50, 100); m_width.value(50.0); add_ctrl(m_width); m_width.no_transform(); add_ctrl(m_show_points); m_show_points.no_transform(); m_show_points.status(true); add_ctrl(m_show_outline); m_show_outline.no_transform(); m_show_outline.status(true); m_curve_type.add_item("Incremental"); m_curve_type.add_item("Subdiv"); m_curve_type.cur_item(1); add_ctrl(m_curve_type); m_curve_type.no_transform(); m_case_type.text_size(7); m_case_type.text_thickness(1.0); m_case_type.add_item("Random"); m_case_type.add_item("13---24"); m_case_type.add_item("Smooth Cusp 1"); m_case_type.add_item("Smooth Cusp 2"); m_case_type.add_item("Real Cusp 1"); m_case_type.add_item("Real Cusp 2"); m_case_type.add_item("Fancy Stroke"); m_case_type.add_item("Jaw"); m_case_type.add_item("Ugly Jaw"); add_ctrl(m_case_type); m_case_type.no_transform(); m_inner_join.text_size(8); m_inner_join.add_item("Inner Bevel"); m_inner_join.add_item("Inner Miter"); m_inner_join.add_item("Inner Jag"); m_inner_join.add_item("Inner Round"); m_inner_join.cur_item(3); add_ctrl(m_inner_join); m_inner_join.no_transform(); m_line_join.text_size(8); m_line_join.add_item("Miter Join"); m_line_join.add_item("Miter Revert"); m_line_join.add_item("Round Join"); m_line_join.add_item("Bevel Join"); m_line_join.add_item("Miter Round"); m_line_join.cur_item(1); add_ctrl(m_line_join); m_line_join.no_transform(); m_line_cap.text_size(8); m_line_cap.add_item("Butt Cap"); m_line_cap.add_item("Square Cap"); m_line_cap.add_item("Round Cap"); m_line_cap.cur_item(0); add_ctrl(m_line_cap); m_line_cap.no_transform(); } template double measure_time(Curve& curve) { start_timer(); for(int i = 0; i < 100; i++) { double x, y; curve.init(m_curve1.x1(), m_curve1.y1(), m_curve1.x2(), m_curve1.y2(), m_curve1.x3(), m_curve1.y3(), m_curve1.x4(), m_curve1.y4()); curve.rewind(0); while(!agg::is_stop(curve.vertex(&x, &y))); } return elapsed_time() * 10; } template bool find_point(const Path& path, double dist, unsigned* i, unsigned* j) { int k; *j = path.size() - 1; for(*i = 0; (*j - *i) > 1; ) { if(dist < path[k = (*i + *j) >> 1].dist) *j = k; else *i = k; } return true; } struct curve_point { curve_point() {} curve_point(double x1, double y1, double mu1) : x(x1), y(y1), mu(mu1) {} double x, y, dist, mu; }; template double calc_max_error(Curve& curve, double scale, double* max_angle_error) { curve.approximation_scale(m_approximation_scale.value() * scale); curve.init(m_curve1.x1(), m_curve1.y1(), m_curve1.x2(), m_curve1.y2(), m_curve1.x3(), m_curve1.y3(), m_curve1.x4(), m_curve1.y4()); agg::pod_bvector curve_points; unsigned cmd; double x, y; curve.rewind(0); while(!agg::is_stop(cmd = curve.vertex(&x, &y))) { if(agg::is_vertex(cmd)) { curve_points.add(agg::vertex_dist(x, y)); } } unsigned i; double curve_dist = 0; for(i = 1; i < curve_points.size(); i++) { curve_points[i - 1].dist = curve_dist; curve_dist += agg::calc_distance(curve_points[i-1].x, curve_points[i-1].y, curve_points[i].x, curve_points[i].y); } curve_points[curve_points.size() - 1].dist = curve_dist; agg::pod_bvector reference_points; for(i = 0; i < 4096; i++) { double mu = i / 4095.0; bezier4_point(m_curve1.x1(), m_curve1.y1(), m_curve1.x2(), m_curve1.y2(), m_curve1.x3(), m_curve1.y3(), m_curve1.x4(), m_curve1.y4(), mu, &x, &y); reference_points.add(curve_point(x, y, mu)); } double reference_dist = 0; for(i = 1; i < reference_points.size(); i++) { reference_points[i - 1].dist = reference_dist; reference_dist += agg::calc_distance(reference_points[i-1].x, reference_points[i-1].y, reference_points[i].x, reference_points[i].y); } reference_points[reference_points.size() - 1].dist = reference_dist; unsigned idx1 = 0; unsigned idx2 = 1; double max_error = 0; for(i = 0; i < reference_points.size(); i++) { if(find_point(curve_points, reference_points[i].dist, &idx1, &idx2)) { double err = fabs(agg::calc_line_point_distance(curve_points[idx1].x, curve_points[idx1].y, curve_points[idx2].x, curve_points[idx2].y, reference_points[i].x, reference_points[i].y)); if(err > max_error) max_error = err; } } double aerr = 0; for(i = 2; i < curve_points.size(); i++) { double a1 = atan2(curve_points[i-1].y - curve_points[i-2].y, curve_points[i-1].x - curve_points[i-2].x); double a2 = atan2(curve_points[i].y - curve_points[i-1].y, curve_points[i].x - curve_points[i-1].x); double da = fabs(a1 - a2); if(da >= agg::pi) da = 2*agg::pi - da; if(da > aerr) aerr = da; } *max_angle_error = aerr * 180.0 / agg::pi; return max_error * scale; } virtual void on_draw() { pixfmt pf(rbuf_window()); renderer_base ren_base(pf); ren_base.clear(agg::rgba(1.0, 1.0, 0.95)); renderer_scanline ren(ren_base); rasterizer_scanline ras; scanline sl; agg::path_storage path; double x, y; double curve_time = 0; path.remove_all(); agg::curve4 curve; curve.approximation_method(agg::curve_approximation_method_e(m_curve_type.cur_item())); curve.approximation_scale(m_approximation_scale.value()); curve.angle_tolerance(agg::deg2rad(m_angle_tolerance.value())); curve.cusp_limit(agg::deg2rad(m_cusp_limit.value())); curve_time = measure_time(curve); double max_angle_error_01 = 0; double max_angle_error_1 = 0; double max_angle_error1 = 0; double max_angle_error_10 = 0; double max_angle_error_100 = 0; double max_error_01 = 0; double max_error_1 = 0; double max_error1 = 0; double max_error_10 = 0; double max_error_100 = 0; max_error_01 = calc_max_error(curve, 0.01, &max_angle_error_01); max_error_1 = calc_max_error(curve, 0.1, &max_angle_error_1); max_error1 = calc_max_error(curve, 1, &max_angle_error1); max_error_10 = calc_max_error(curve, 10, &max_angle_error_10); max_error_100 = calc_max_error(curve, 100, &max_angle_error_100); curve.approximation_scale(m_approximation_scale.value()); curve.angle_tolerance(agg::deg2rad(m_angle_tolerance.value())); curve.cusp_limit(agg::deg2rad(m_cusp_limit.value())); curve.init(m_curve1.x1(), m_curve1.y1(), m_curve1.x2(), m_curve1.y2(), m_curve1.x3(), m_curve1.y3(), m_curve1.x4(), m_curve1.y4()); path.concat_path(curve); //path.move_to(m_curve1.x1(), m_curve1.y1()); //path.line_to(m_curve1.x2(), m_curve1.y2()); //path.line_to(m_curve1.x3(), m_curve1.y3()); //path.line_to(m_curve1.x4(), m_curve1.y4()); agg::conv_stroke stroke(path); stroke.width(m_width.value()); stroke.line_join(agg::line_join_e(m_line_join.cur_item())); stroke.line_cap(agg::line_cap_e(m_line_cap.cur_item())); stroke.inner_join(agg::inner_join_e(m_inner_join.cur_item())); stroke.inner_miter_limit(1.01); ras.add_path(stroke); ren.color(agg::rgba(0, 0.5, 0, 0.5)); agg::render_scanlines(ras, sl, ren); unsigned cmd; unsigned num_points1 = 0; path.rewind(0); while(!agg::is_stop(cmd = path.vertex(&x, &y))) { if(m_show_points.status()) { agg::ellipse ell(x, y, 1.5, 1.5, 8); ras.add_path(ell); ren.color(agg::rgba(0,0,0, 0.5)); agg::render_scanlines(ras, sl, ren); } ++num_points1; } if(m_show_outline.status()) { // Draw a stroke of the stroke to see the internals //-------------- agg::conv_stroke > stroke2(stroke); ras.add_path(stroke2); ren.color(agg::rgba(0,0,0, 0.5)); agg::render_scanlines(ras, sl, ren); } // Check ellipse and arc for the number of points //--------------- //agg::ellipse a(100, 100, m_width.value(), m_width.value(), 0); //ras.add_path(a); //ren.color(agg::rgba(0.5,0,0, 0.5)); //agg::render_scanlines(ras, sl, ren); //a.rewind(0); //while(!agg::is_stop(cmd = a.vertex(&x, &y))) //{ // if(agg::is_vertex(cmd)) // { // agg::ellipse ell(x, y, 1.5, 1.5, 8); // ras.add_path(ell); // ren.color(agg::rgba(0,0,0,0.5)); // agg::render_scanlines(ras, sl, ren); // } //} // Check a circle with huge radius (10,000,000) and high approximation accuracy //--------------- //double circle_pnt_count = 0; //agg::bezier_arc ell(0,0, 10000000, 10000000, 0, 2*agg::pi); //agg::conv_curve crv(ell); //crv.approximation_scale(10.0); //crv.rewind(0); //while(crv.vertex(&x, &y)) ++circle_pnt_count; char buf[512]; agg::gsv_text t; t.size(8.0); agg::conv_stroke pt(t); pt.line_cap(agg::round_cap); pt.line_join(agg::round_join); pt.width(1.5); sprintf(buf, "Num Points=%d Time=%.2fmks\n\n" " Dist Error: x0.01=%.5f x0.1=%.5f x1=%.5f x10=%.5f x100=%.5f\n\n" "Angle Error: x0.01=%.1f x0.1=%.1f x1=%.1f x10=%.1f x100=%.1f", num_points1, curve_time, max_error_01, max_error_1, max_error1, max_error_10, max_error_100, max_angle_error_01, max_angle_error_1, max_angle_error1, max_angle_error_10, max_angle_error_100); t.start_point(10.0, 85.0); t.text(buf); ras.add_path(pt); ren.color(agg::rgba(0,0,0)); agg::render_scanlines(ras, sl, ren); agg::render_ctrl(ras, sl, ren_base, m_curve1); agg::render_ctrl(ras, sl, ren_base, m_angle_tolerance); agg::render_ctrl(ras, sl, ren_base, m_approximation_scale); agg::render_ctrl(ras, sl, ren_base, m_cusp_limit); agg::render_ctrl(ras, sl, ren_base, m_width); agg::render_ctrl(ras, sl, ren_base, m_show_points); agg::render_ctrl(ras, sl, ren_base, m_show_outline); agg::render_ctrl(ras, sl, ren_base, m_curve_type); agg::render_ctrl(ras, sl, ren_base, m_case_type); agg::render_ctrl(ras, sl, ren_base, m_inner_join); agg::render_ctrl(ras, sl, ren_base, m_line_join); agg::render_ctrl(ras, sl, ren_base, m_line_cap); } virtual void on_key(int x, int y, unsigned key, unsigned flags) { if(key == ' ') { FILE* fd = fopen(full_file_name("coord"), "w"); fprintf(fd, "%.3f, %.3f, %.3f, %.3f, %.3f, %.3f, %.3f, %.3f", m_curve1.x1(), m_curve1.y1(), m_curve1.x2(), m_curve1.y2(), m_curve1.x3(), m_curve1.y3(), m_curve1.x4(), m_curve1.y4()); fclose(fd); } } virtual void on_ctrl_change() { if(m_case_type.cur_item() != m_cur_case_type) { switch(m_case_type.cur_item()) { case 0: //m_case_type.add_item("Random"); { int w = int(width() - 120); int h = int(height() - 80); m_curve1.curve(rand() % w, rand() % h + 80, rand() % w, rand() % h + 80, rand() % w, rand() % h + 80, rand() % w, rand() % h + 80); } break; case 1: //m_case_type.add_item("13---24"); m_curve1.curve(150, 150, 350, 150, 150, 150, 350, 150); //m_curve1.curve(252, 227, 16, 227, 506, 227, 285, 227); //m_curve1.curve(252, 227, 16, 227, 387, 227, 285, 227); break; case 2: //m_case_type.add_item("Smooth Cusp 1"); m_curve1.curve(50, 142, 483, 251, 496, 62, 26, 333); break; case 3: //m_case_type.add_item("Smooth Cusp 2"); m_curve1.curve(50, 142, 484, 251, 496, 62, 26, 333); break; case 4: //m_case_type.add_item("Real Cusp 1"); m_curve1.curve(100, 100, 300, 200, 200, 200, 200, 100); break; case 5: //m_case_type.add_item("Real Cusp 2"); m_curve1.curve(475, 157, 200, 100, 453, 100, 222, 157); break; case 6: //m_case_type.add_item("Fancy Stroke"); m_curve1.curve(129, 233, 32, 283, 258, 285, 159, 232); m_width.value(100); break; case 7: //m_case_type.add_item("Jaw"); m_curve1.curve(100, 100, 300, 200, 264, 286, 264, 284); break; case 8: //m_case_type.add_item("Ugly Jaw"); m_curve1.curve(100, 100, 413, 304, 264, 286, 264, 284); break; } force_redraw(); m_cur_case_type = m_case_type.cur_item(); } } }; int agg_main(int argc, char* argv[]) { the_application app(agg::pix_format_bgr24, flip_y); app.caption("AGG Example"); if(app.init(655, 520, agg::window_resize)) { return app.run(); } return 1; } agg-2.5+dfsg1/examples/blend_color.cpp0000644000000000000000000003676310703246330020101 0ustar00usergroup00000000000000#include #include #include "agg_basics.h" #include "agg_rendering_buffer.h" #include "agg_rasterizer_scanline_aa.h" #include "agg_conv_curve.h" #include "agg_conv_contour.h" #include "agg_conv_stroke.h" #include "agg_scanline_p.h" #include "agg_renderer_scanline.h" #include "agg_pixfmt_rgb.h" #include "agg_pixfmt_rgba.h" #include "agg_pixfmt_gray.h" #include "agg_bounding_rect.h" #include "agg_trans_perspective.h" #include "agg_blur.h" #include "ctrl/agg_slider_ctrl.h" #include "ctrl/agg_rbox_ctrl.h" #include "ctrl/agg_cbox_ctrl.h" #include "ctrl/agg_polygon_ctrl.h" #include "platform/agg_platform_support.h" //#define AGG_GRAY8 #define AGG_BGR24 //#define AGG_BGR48 //#define AGG_RGB_AAA //#define AGG_BGRA32 //#define AGG_RGBA32 //#define AGG_ARGB32 //#define AGG_ABGR32 //#define AGG_RGB565 //#define AGG_RGB555 #include "pixel_formats.h" static agg::int8u g_gradient_colors[] = { 255, 255, 255, 255, 255, 255, 254, 255, 255, 255, 254, 255, 255, 255, 254, 255, 255, 255, 253, 255, 255, 255, 253, 255, 255, 255, 252, 255, 255, 255, 251, 255, 255, 255, 250, 255, 255, 255, 248, 255, 255, 255, 246, 255, 255, 255, 244, 255, 255, 255, 241, 255, 255, 255, 238, 255, 255, 255, 235, 255, 255, 255, 231, 255, 255, 255, 227, 255, 255, 255, 222, 255, 255, 255, 217, 255, 255, 255, 211, 255, 255, 255, 206, 255, 255, 255, 200, 255, 255, 254, 194, 255, 255, 253, 188, 255, 255, 252, 182, 255, 255, 250, 176, 255, 255, 249, 170, 255, 255, 247, 164, 255, 255, 246, 158, 255, 255, 244, 152, 255, 254, 242, 146, 255, 254, 240, 141, 255, 254, 238, 136, 255, 254, 236, 131, 255, 253, 234, 126, 255, 253, 232, 121, 255, 253, 229, 116, 255, 252, 227, 112, 255, 252, 224, 108, 255, 251, 222, 104, 255, 251, 219, 100, 255, 251, 216, 96, 255, 250, 214, 93, 255, 250, 211, 89, 255, 249, 208, 86, 255, 249, 205, 83, 255, 248, 202, 80, 255, 247, 199, 77, 255, 247, 196, 74, 255, 246, 193, 72, 255, 246, 190, 69, 255, 245, 187, 67, 255, 244, 183, 64, 255, 244, 180, 62, 255, 243, 177, 60, 255, 242, 174, 58, 255, 242, 170, 56, 255, 241, 167, 54, 255, 240, 164, 52, 255, 239, 161, 51, 255, 239, 157, 49, 255, 238, 154, 47, 255, 237, 151, 46, 255, 236, 147, 44, 255, 235, 144, 43, 255, 235, 141, 41, 255, 234, 138, 40, 255, 233, 134, 39, 255, 232, 131, 37, 255, 231, 128, 36, 255, 230, 125, 35, 255, 229, 122, 34, 255, 228, 119, 33, 255, 227, 116, 31, 255, 226, 113, 30, 255, 225, 110, 29, 255, 224, 107, 28, 255, 223, 104, 27, 255, 222, 101, 26, 255, 221, 99, 25, 255, 220, 96, 24, 255, 219, 93, 23, 255, 218, 91, 22, 255, 217, 88, 21, 255, 216, 86, 20, 255, 215, 83, 19, 255, 214, 81, 18, 255, 213, 79, 17, 255, 212, 77, 17, 255, 211, 74, 16, 255, 210, 72, 15, 255, 209, 70, 14, 255, 207, 68, 13, 255, 206, 66, 13, 255, 205, 64, 12, 255, 204, 62, 11, 255, 203, 60, 10, 255, 202, 58, 10, 255, 201, 56, 9, 255, 199, 55, 9, 255, 198, 53, 8, 255, 197, 51, 7, 255, 196, 50, 7, 255, 195, 48, 6, 255, 193, 46, 6, 255, 192, 45, 5, 255, 191, 43, 5, 255, 190, 42, 4, 255, 188, 41, 4, 255, 187, 39, 3, 255, 186, 38, 3, 255, 185, 37, 2, 255, 183, 35, 2, 255, 182, 34, 1, 255, 181, 33, 1, 255, 179, 32, 1, 255, 178, 30, 0, 255, 177, 29, 0, 255, 175, 28, 0, 255, 174, 27, 0, 255, 173, 26, 0, 255, 171, 25, 0, 255, 170, 24, 0, 255, 168, 23, 0, 255, 167, 22, 0, 255, 165, 21, 0, 255, 164, 21, 0, 255, 163, 20, 0, 255, 161, 19, 0, 255, 160, 18, 0, 255, 158, 17, 0, 255, 156, 17, 0, 255, 155, 16, 0, 255, 153, 15, 0, 255, 152, 14, 0, 255, 150, 14, 0, 255, 149, 13, 0, 255, 147, 12, 0, 255, 145, 12, 0, 255, 144, 11, 0, 255, 142, 11, 0, 255, 140, 10, 0, 255, 139, 10, 0, 255, 137, 9, 0, 255, 135, 9, 0, 255, 134, 8, 0, 255, 132, 8, 0, 255, 130, 7, 0, 255, 128, 7, 0, 255, 126, 6, 0, 255, 125, 6, 0, 255, 123, 5, 0, 255, 121, 5, 0, 255, 119, 4, 0, 255, 117, 4, 0, 255, 115, 4, 0, 255, 113, 3, 0, 255, 111, 3, 0, 255, 109, 2, 0, 255, 107, 2, 0, 255, 105, 2, 0, 255, 103, 1, 0, 255, 101, 1, 0, 255, 99, 1, 0, 255, 97, 0, 0, 255, 95, 0, 0, 255, 93, 0, 0, 255, 91, 0, 0, 255, 90, 0, 0, 255, 88, 0, 0, 255, 86, 0, 0, 255, 84, 0, 0, 255, 82, 0, 0, 255, 80, 0, 0, 255, 78, 0, 0, 255, 77, 0, 0, 255, 75, 0, 0, 255, 73, 0, 0, 255, 72, 0, 0, 255, 70, 0, 0, 255, 68, 0, 0, 255, 67, 0, 0, 255, 65, 0, 0, 255, 64, 0, 0, 255, 63, 0, 0, 255, 61, 0, 0, 255, 60, 0, 0, 255, 59, 0, 0, 255, 58, 0, 0, 255, 57, 0, 0, 255, 56, 0, 0, 255, 55, 0, 0, 255, 54, 0, 0, 255, 53, 0, 0, 255, 53, 0, 0, 255, 52, 0, 0, 255, 52, 0, 0, 255, 51, 0, 0, 255, 51, 0, 0, 255, 51, 0, 0, 255, 50, 0, 0, 255, 50, 0, 0, 255, 51, 0, 0, 255, 51, 0, 0, 255, 51, 0, 0, 255, 51, 0, 0, 255, 52, 0, 0, 255, 52, 0, 0, 255, 53, 0, 0, 255, 54, 1, 0, 255, 55, 2, 0, 255, 56, 3, 0, 255, 57, 4, 0, 255, 58, 5, 0, 255, 59, 6, 0, 255, 60, 7, 0, 255, 62, 8, 0, 255, 63, 9, 0, 255, 64, 11, 0, 255, 66, 12, 0, 255, 68, 13, 0, 255, 69, 14, 0, 255, 71, 16, 0, 255, 73, 17, 0, 255, 75, 18, 0, 255, 77, 20, 0, 255, 79, 21, 0, 255, 81, 23, 0, 255, 83, 24, 0, 255, 85, 26, 0, 255, 87, 28, 0, 255, 90, 29, 0, 255, 92, 31, 0, 255, 94, 33, 0, 255, 97, 34, 0, 255, 99, 36, 0, 255, 102, 38, 0, 255, 104, 40, 0, 255, 107, 41, 0, 255, 109, 43, 0, 255, 112, 45, 0, 255, 115, 47, 0, 255, 117, 49, 0, 255, 120, 51, 0, 255, 123, 52, 0, 255, 126, 54, 0, 255, 128, 56, 0, 255, 131, 58, 0, 255, 134, 60, 0, 255, 137, 62, 0, 255, 140, 64, 0, 255, 143, 66, 0, 255, 145, 68, 0, 255, 148, 70, 0, 255, 151, 72, 0, 255, 154, 74, 0, 255 }; enum flip_y_e { flip_y = true }; class the_application : public agg::platform_support { agg::rbox_ctrl m_method; agg::slider_ctrl m_radius; agg::polygon_ctrl m_shadow_ctrl; agg::path_storage m_path; typedef agg::conv_curve shape_type; shape_type m_shape; agg::rasterizer_scanline_aa<> m_ras; agg::scanline_p8 m_sl; agg::rect_d m_shape_bounds; agg::pod_array m_gray8_buf; agg::rendering_buffer m_gray8_rbuf; agg::rendering_buffer m_gray8_rbuf2; agg::pod_array m_color_lut; public: the_application(agg::pix_format_e format, bool flip_y) : agg::platform_support(format, flip_y), m_method (10.0, 10.0, 130.0, 55.0, !flip_y), m_radius (130 + 10.0, 10.0 + 4.0, 130 + 300.0, 10.0 + 8.0 + 4.0, !flip_y), m_shadow_ctrl(4), m_shape(m_path) { add_ctrl(m_method); m_method.text_size(8); m_method.add_item("Single Color"); m_method.add_item("Color LUT"); m_method.cur_item(1); add_ctrl(m_radius); m_radius.range(0.0, 40.0); m_radius.value(15.0); m_radius.label("Blur Radius=%1.2f"); add_ctrl(m_shadow_ctrl); m_path.remove_all(); m_path.move_to(28.47, 6.45); m_path.curve3(21.58, 1.12, 19.82, 0.29); m_path.curve3(17.19, -0.93, 14.21, -0.93); m_path.curve3(9.57, -0.93, 6.57, 2.25); m_path.curve3(3.56, 5.42, 3.56, 10.60); m_path.curve3(3.56, 13.87, 5.03, 16.26); m_path.curve3(7.03, 19.58, 11.99, 22.51); m_path.curve3(16.94, 25.44, 28.47, 29.64); m_path.line_to(28.47, 31.40); m_path.curve3(28.47, 38.09, 26.34, 40.58); m_path.curve3(24.22, 43.07, 20.17, 43.07); m_path.curve3(17.09, 43.07, 15.28, 41.41); m_path.curve3(13.43, 39.75, 13.43, 37.60); m_path.line_to(13.53, 34.77); m_path.curve3(13.53, 32.52, 12.38, 31.30); m_path.curve3(11.23, 30.08, 9.38, 30.08); m_path.curve3(7.57, 30.08, 6.42, 31.35); m_path.curve3(5.27, 32.62, 5.27, 34.81); m_path.curve3(5.27, 39.01, 9.57, 42.53); m_path.curve3(13.87, 46.04, 21.63, 46.04); m_path.curve3(27.59, 46.04, 31.40, 44.04); m_path.curve3(34.28, 42.53, 35.64, 39.31); m_path.curve3(36.52, 37.21, 36.52, 30.71); m_path.line_to(36.52, 15.53); m_path.curve3(36.52, 9.13, 36.77, 7.69); m_path.curve3(37.01, 6.25, 37.57, 5.76); m_path.curve3(38.13, 5.27, 38.87, 5.27); m_path.curve3(39.65, 5.27, 40.23, 5.62); m_path.curve3(41.26, 6.25, 44.19, 9.18); m_path.line_to(44.19, 6.45); m_path.curve3(38.72, -0.88, 33.74, -0.88); m_path.curve3(31.35, -0.88, 29.93, 0.78); m_path.curve3(28.52, 2.44, 28.47, 6.45); m_path.close_polygon(); m_path.move_to(28.47, 9.62); m_path.line_to(28.47, 26.66); m_path.curve3(21.09, 23.73, 18.95, 22.51); m_path.curve3(15.09, 20.36, 13.43, 18.02); m_path.curve3(11.77, 15.67, 11.77, 12.89); m_path.curve3(11.77, 9.38, 13.87, 7.06); m_path.curve3(15.97, 4.74, 18.70, 4.74); m_path.curve3(22.41, 4.74, 28.47, 9.62); m_path.close_polygon(); agg::trans_affine shape_mtx; shape_mtx *= agg::trans_affine_scaling(4.0); shape_mtx *= agg::trans_affine_translation(150, 100); m_path.transform(shape_mtx); agg::bounding_rect_single(m_shape, 0, &m_shape_bounds.x1, &m_shape_bounds.y1, &m_shape_bounds.x2, &m_shape_bounds.y2); m_shadow_ctrl.xn(0) = m_shape_bounds.x1; m_shadow_ctrl.yn(0) = m_shape_bounds.y1; m_shadow_ctrl.xn(1) = m_shape_bounds.x2; m_shadow_ctrl.yn(1) = m_shape_bounds.y1; m_shadow_ctrl.xn(2) = m_shape_bounds.x2; m_shadow_ctrl.yn(2) = m_shape_bounds.y2; m_shadow_ctrl.xn(3) = m_shape_bounds.x1; m_shadow_ctrl.yn(3) = m_shape_bounds.y2; m_shadow_ctrl.line_color(agg::rgba(0, 0.3, 0.5, 0.3)); m_color_lut.resize(256); unsigned i; const agg::int8u* p = g_gradient_colors; for(i = 0; i < 256; i++) { m_color_lut[i] = agg::rgba8(p[0], p[1], p[2], (i > 63) ? 255 : i * 4);//p[3]); //m_color_lut[i].premultiply(); p += 4; } } virtual void on_resize(int sx, int sy) { m_gray8_buf.resize(sx * sy); m_gray8_rbuf.attach(m_gray8_buf.data(), sx, sy, sx); } virtual void on_draw() { typedef agg::pixfmt_gray8 pixfmt_gray8; typedef agg::renderer_base ren_base_gray8; m_ras.clip_box(0,0, width(), height()); pixfmt_gray8 pixf_gray8(m_gray8_rbuf); ren_base_gray8 renb_gray8(pixf_gray8); renb_gray8.clear(agg::gray8(0)); // Testing enhanced compositing operations. // Uncomment and replace renb.blend_from_* to renb_blend.blend_from_* //---------------- //typedef agg::comp_op_rgba_minus blender_type; //typedef agg::comp_adaptor_rgba blend_adaptor_type; //typedef agg::pixfmt_custom_blend_rgba pixfmt_type; //typedef agg::renderer_base ren_base; //pixfmt_type pixf_blend(rbuf_window()); //agg::renderer_base renb_blend(pixf_blend); pixfmt pixf(rbuf_window()); agg::renderer_base renb(pixf); renb.clear(agg::rgba(1, 0.95, 0.95)); agg::trans_perspective shadow_persp(m_shape_bounds.x1, m_shape_bounds.y1, m_shape_bounds.x2, m_shape_bounds.y2, m_shadow_ctrl.polygon()); agg::conv_transform shadow_trans(m_shape, shadow_persp); start_timer(); // Render shadow m_ras.add_path(shadow_trans); agg::render_scanlines_aa_solid(m_ras, m_sl, renb_gray8, agg::gray8(255)); // Calculate the bounding box and extend it by the blur radius agg::rect_d bbox; agg::bounding_rect_single(shadow_trans, 0, &bbox.x1, &bbox.y1, &bbox.x2, &bbox.y2); bbox.x1 -= m_radius.value(); bbox.y1 -= m_radius.value(); bbox.x2 += m_radius.value(); bbox.y2 += m_radius.value(); if(bbox.clip(agg::rect_d(0, 0, width(), height()))) { // Create a new pixel renderer and attach it to the main one as a child image. // It returns true if the attachment suceeded. It fails if the rectangle // (bbox) is fully clipped. //------------------ pixfmt_gray8 pixf2(m_gray8_rbuf2); if(pixf2.attach(pixf_gray8, int(bbox.x1), int(bbox.y1), int(bbox.x2), int(bbox.y2))) { // Blur it agg::stack_blur_gray8(pixf2, agg::uround(m_radius.value()), agg::uround(m_radius.value())); } if(m_method.cur_item() == 0) { renb.blend_from_color(pixf2, agg::rgba8(0, 100, 0), 0, int(bbox.x1), int(bbox.y1)); } else { renb.blend_from_lut(pixf2, m_color_lut.data(), 0, int(bbox.x1), int(bbox.y1)); } } double tm = elapsed_time(); char buf[64]; agg::gsv_text t; t.size(10.0); agg::conv_stroke st(t); st.width(1.5); sprintf(buf, "%3.2f ms", tm); t.start_point(140.0, 30.0); t.text(buf); m_ras.add_path(st); agg::render_scanlines_aa_solid(m_ras, m_sl, renb, agg::rgba(0,0,0)); agg::render_ctrl(m_ras, m_sl, renb, m_method); agg::render_ctrl(m_ras, m_sl, renb, m_radius); agg::render_ctrl(m_ras, m_sl, renb, m_shadow_ctrl); } }; int agg_main(int argc, char* argv[]) { the_application app(pix_format, flip_y); app.caption("AGG Example. Gaussian and Stack Blur"); if(app.init(440, 330, 0)) { return app.run(); } return 1; } agg-2.5+dfsg1/examples/blur.cpp0000644000000000000000000002655710703246330016563 0ustar00usergroup00000000000000#include #include #include "agg_basics.h" #include "agg_rendering_buffer.h" #include "agg_rasterizer_scanline_aa.h" #include "agg_conv_curve.h" #include "agg_conv_contour.h" #include "agg_conv_stroke.h" #include "agg_scanline_p.h" #include "agg_renderer_scanline.h" #include "agg_pixfmt_rgb.h" #include "agg_pixfmt_rgba.h" #include "agg_pixfmt_gray.h" #include "agg_bounding_rect.h" #include "agg_trans_perspective.h" #include "agg_blur.h" #include "ctrl/agg_slider_ctrl.h" #include "ctrl/agg_rbox_ctrl.h" #include "ctrl/agg_cbox_ctrl.h" #include "ctrl/agg_polygon_ctrl.h" #include "platform/agg_platform_support.h" enum flip_y_e { flip_y = true }; class the_application : public agg::platform_support { agg::rbox_ctrl m_method; agg::slider_ctrl m_radius; agg::polygon_ctrl m_shadow_ctrl; agg::cbox_ctrl m_channel_r; agg::cbox_ctrl m_channel_g; agg::cbox_ctrl m_channel_b; agg::path_storage m_path; typedef agg::conv_curve shape_type; shape_type m_shape; agg::rasterizer_scanline_aa<> m_ras; agg::scanline_p8 m_sl; agg::rendering_buffer m_rbuf2; agg::stack_blur > m_stack_blur; agg::recursive_blur > m_recursive_blur; agg::rect_d m_shape_bounds; public: the_application(agg::pix_format_e format, bool flip_y) : agg::platform_support(format, flip_y), m_method (10.0, 10.0, 130.0, 70.0, !flip_y), m_radius (130 + 10.0, 10.0 + 4.0, 130 + 300.0, 10.0 + 8.0 + 4.0, !flip_y), m_shadow_ctrl(4), m_channel_r (10.0, 80.0, "Red", !flip_y), m_channel_g (10.0, 95.0, "Green", !flip_y), m_channel_b (10.0, 110.0, "Blue", !flip_y), m_shape(m_path) { add_ctrl(m_method); m_method.text_size(8); m_method.add_item("Stack Blur"); m_method.add_item("Recursive Blur"); m_method.add_item("Channels"); m_method.cur_item(0); add_ctrl(m_radius); m_radius.range(0.0, 40.0); m_radius.value(15.0); m_radius.label("Blur Radius=%1.2f"); add_ctrl(m_shadow_ctrl); add_ctrl(m_channel_r); add_ctrl(m_channel_g); add_ctrl(m_channel_b); m_channel_g.status(true); m_path.remove_all(); m_path.move_to(28.47, 6.45); m_path.curve3(21.58, 1.12, 19.82, 0.29); m_path.curve3(17.19, -0.93, 14.21, -0.93); m_path.curve3(9.57, -0.93, 6.57, 2.25); m_path.curve3(3.56, 5.42, 3.56, 10.60); m_path.curve3(3.56, 13.87, 5.03, 16.26); m_path.curve3(7.03, 19.58, 11.99, 22.51); m_path.curve3(16.94, 25.44, 28.47, 29.64); m_path.line_to(28.47, 31.40); m_path.curve3(28.47, 38.09, 26.34, 40.58); m_path.curve3(24.22, 43.07, 20.17, 43.07); m_path.curve3(17.09, 43.07, 15.28, 41.41); m_path.curve3(13.43, 39.75, 13.43, 37.60); m_path.line_to(13.53, 34.77); m_path.curve3(13.53, 32.52, 12.38, 31.30); m_path.curve3(11.23, 30.08, 9.38, 30.08); m_path.curve3(7.57, 30.08, 6.42, 31.35); m_path.curve3(5.27, 32.62, 5.27, 34.81); m_path.curve3(5.27, 39.01, 9.57, 42.53); m_path.curve3(13.87, 46.04, 21.63, 46.04); m_path.curve3(27.59, 46.04, 31.40, 44.04); m_path.curve3(34.28, 42.53, 35.64, 39.31); m_path.curve3(36.52, 37.21, 36.52, 30.71); m_path.line_to(36.52, 15.53); m_path.curve3(36.52, 9.13, 36.77, 7.69); m_path.curve3(37.01, 6.25, 37.57, 5.76); m_path.curve3(38.13, 5.27, 38.87, 5.27); m_path.curve3(39.65, 5.27, 40.23, 5.62); m_path.curve3(41.26, 6.25, 44.19, 9.18); m_path.line_to(44.19, 6.45); m_path.curve3(38.72, -0.88, 33.74, -0.88); m_path.curve3(31.35, -0.88, 29.93, 0.78); m_path.curve3(28.52, 2.44, 28.47, 6.45); m_path.close_polygon(); m_path.move_to(28.47, 9.62); m_path.line_to(28.47, 26.66); m_path.curve3(21.09, 23.73, 18.95, 22.51); m_path.curve3(15.09, 20.36, 13.43, 18.02); m_path.curve3(11.77, 15.67, 11.77, 12.89); m_path.curve3(11.77, 9.38, 13.87, 7.06); m_path.curve3(15.97, 4.74, 18.70, 4.74); m_path.curve3(22.41, 4.74, 28.47, 9.62); m_path.close_polygon(); agg::trans_affine shape_mtx; shape_mtx *= agg::trans_affine_scaling(4.0); shape_mtx *= agg::trans_affine_translation(150, 100); m_path.transform(shape_mtx); agg::bounding_rect_single(m_shape, 0, &m_shape_bounds.x1, &m_shape_bounds.y1, &m_shape_bounds.x2, &m_shape_bounds.y2); m_shadow_ctrl.xn(0) = m_shape_bounds.x1; m_shadow_ctrl.yn(0) = m_shape_bounds.y1; m_shadow_ctrl.xn(1) = m_shape_bounds.x2; m_shadow_ctrl.yn(1) = m_shape_bounds.y1; m_shadow_ctrl.xn(2) = m_shape_bounds.x2; m_shadow_ctrl.yn(2) = m_shape_bounds.y2; m_shadow_ctrl.xn(3) = m_shape_bounds.x1; m_shadow_ctrl.yn(3) = m_shape_bounds.y2; m_shadow_ctrl.line_color(agg::rgba(0, 0.3, 0.5, 0.3)); } virtual void on_draw() { typedef agg::renderer_base ren_base; agg::pixfmt_bgr24 pixf(rbuf_window()); ren_base renb(pixf); renb.clear(agg::rgba(1, 1, 1)); m_ras.clip_box(0,0, width(), height()); agg::trans_perspective shadow_persp(m_shape_bounds.x1, m_shape_bounds.y1, m_shape_bounds.x2, m_shape_bounds.y2, m_shadow_ctrl.polygon()); agg::conv_transform shadow_trans(m_shape, shadow_persp); // Render shadow m_ras.add_path(shadow_trans); agg::render_scanlines_aa_solid(m_ras, m_sl, renb, agg::rgba(0.2,0.3,0)); // Calculate the bounding box and extend it by the blur radius agg::rect_d bbox; agg::bounding_rect_single(shadow_trans, 0, &bbox.x1, &bbox.y1, &bbox.x2, &bbox.y2); bbox.x1 -= m_radius.value(); bbox.y1 -= m_radius.value(); bbox.x2 += m_radius.value(); bbox.y2 += m_radius.value(); if(m_method.cur_item() == 1) { // The recursive blur method represents the true Gussian Blur, // with theoretically infinite kernel. The restricted window size // results in extra influence of edge pixels. It's impossible to // solve correctly, but extending the right and top areas to another // radius value produces fair result. //------------------ bbox.x2 += m_radius.value(); bbox.y2 += m_radius.value(); } start_timer(); if(m_method.cur_item() != 2) { // Create a new pixel renderer and attach it to the main one as a child image. // It returns true if the attachment suceeded. It fails if the rectangle // (bbox) is fully clipped. //------------------ agg::pixfmt_bgr24 pixf2(m_rbuf2); if(pixf2.attach(pixf, int(bbox.x1), int(bbox.y1), int(bbox.x2), int(bbox.y2))) { // Blur it if(m_method.cur_item() == 0) { // More general method, but 30-40% slower. //------------------ //m_stack_blur.blur(pixf2, agg::uround(m_radius.value())); // Faster, but bore specific. // Works only for 8 bits per channel and only with radii <= 254. //------------------ agg::stack_blur_rgb24(pixf2, agg::uround(m_radius.value()), agg::uround(m_radius.value())); } else { // True Gaussian Blur, 3-5 times slower than Stack Blur, // but still constant time of radius. Very sensitive // to precision, doubles are must here. //------------------ m_recursive_blur.blur(pixf2, m_radius.value()); } } } else { // Blur separate channels //------------------ if(m_channel_r.status()) { typedef agg::pixfmt_alpha_blend_gray< agg::blender_gray8, agg::rendering_buffer, 3, 2> pixfmt_gray8r; pixfmt_gray8r pixf2r(m_rbuf2); if(pixf2r.attach(pixf, int(bbox.x1), int(bbox.y1), int(bbox.x2), int(bbox.y2))) { agg::stack_blur_gray8(pixf2r, agg::uround(m_radius.value()), agg::uround(m_radius.value())); } } if(m_channel_g.status()) { typedef agg::pixfmt_alpha_blend_gray< agg::blender_gray8, agg::rendering_buffer, 3, 1> pixfmt_gray8g; pixfmt_gray8g pixf2g(m_rbuf2); if(pixf2g.attach(pixf, int(bbox.x1), int(bbox.y1), int(bbox.x2), int(bbox.y2))) { agg::stack_blur_gray8(pixf2g, agg::uround(m_radius.value()), agg::uround(m_radius.value())); } } if(m_channel_b.status()) { typedef agg::pixfmt_alpha_blend_gray< agg::blender_gray8, agg::rendering_buffer, 3, 0> pixfmt_gray8b; pixfmt_gray8b pixf2b(m_rbuf2); if(pixf2b.attach(pixf, int(bbox.x1), int(bbox.y1), int(bbox.x2), int(bbox.y2))) { agg::stack_blur_gray8(pixf2b, agg::uround(m_radius.value()), agg::uround(m_radius.value())); } } } double tm = elapsed_time(); agg::render_ctrl(m_ras, m_sl, renb, m_shadow_ctrl); // Render the shape itself //------------------ m_ras.add_path(m_shape); agg::render_scanlines_aa_solid(m_ras, m_sl, renb, agg::rgba(0.6,0.9,0.7, 0.8)); char buf[64]; agg::gsv_text t; t.size(10.0); agg::conv_stroke st(t); st.width(1.5); sprintf(buf, "%3.2f ms", tm); t.start_point(140.0, 30.0); t.text(buf); m_ras.add_path(st); agg::render_scanlines_aa_solid(m_ras, m_sl, renb, agg::rgba(0,0,0)); agg::render_ctrl(m_ras, m_sl, renb, m_method); agg::render_ctrl(m_ras, m_sl, renb, m_radius); agg::render_ctrl(m_ras, m_sl, renb, m_channel_r); agg::render_ctrl(m_ras, m_sl, renb, m_channel_g); agg::render_ctrl(m_ras, m_sl, renb, m_channel_b); } }; int agg_main(int argc, char* argv[]) { the_application app(agg::pix_format_bgr24, flip_y); app.caption("AGG Example. Gaussian and Stack Blur"); if(app.init(440, 330, 0)) { return app.run(); } return 1; } agg-2.5+dfsg1/examples/bspline.cpp0000644000000000000000000001120110703246330017227 0ustar00usergroup00000000000000#include #include #include #include "agg_rendering_buffer.h" #include "agg_rasterizer_scanline_aa.h" #include "agg_scanline_p.h" #include "agg_renderer_scanline.h" #include "agg_conv_bspline.h" #include "ctrl/agg_cbox_ctrl.h" #include "ctrl/agg_slider_ctrl.h" #include "platform/agg_platform_support.h" #include "interactive_polygon.h" #define AGG_BGR24 //#define AGG_RGB24 //#define AGG_BGRA32 //#define AGG_RGBA32 //#define AGG_ARGB32 //#define AGG_ABGR32 //#define AGG_RGB565 //#define AGG_RGB555 #include "pixel_formats.h" enum flip_y_e { flip_y = true }; class the_application : public agg::platform_support { public: typedef agg::renderer_base renderer_base; typedef agg::scanline_p8 scanline_type; agg::interactive_polygon m_poly; agg::slider_ctrl m_num_points; agg::cbox_ctrl m_close; int m_flip; the_application(agg::pix_format_e format, bool flip_y) : agg::platform_support(format, flip_y), m_poly(6, 5.0), m_num_points(5.0, 5.0, 340.0, 12.0, !flip_y), m_close (350, 5.0, "Close", !flip_y), m_flip(0) { add_ctrl(m_close); m_num_points.range(1.0, 40.0); m_num_points.value(20.0); m_num_points.label("Number of intermediate Points = %.3f"); add_ctrl(m_num_points); } virtual void on_init() { if(m_flip) { m_poly.xn(0) = 100; m_poly.yn(0) = height() - 100; m_poly.xn(1) = width() - 100; m_poly.yn(1) = height() - 100; m_poly.xn(2) = width() - 100; m_poly.yn(2) = 100; m_poly.xn(3) = 100; m_poly.yn(3) = 100; } else { m_poly.xn(0) = 100; m_poly.yn(0) = 100; m_poly.xn(1) = width() - 100; m_poly.yn(1) = 100; m_poly.xn(2) = width() - 100; m_poly.yn(2) = height() - 100; m_poly.xn(3) = 100; m_poly.yn(3) = height() - 100; } m_poly.xn(4) = width() / 2; m_poly.yn(4) = height() / 2; m_poly.xn(5) = width() / 2; m_poly.yn(5) = height() / 3; } virtual void on_draw() { pixfmt pixf(rbuf_window()); renderer_base rb(pixf); rb.clear(agg::rgba(1, 1, 1)); scanline_type sl; agg::rasterizer_scanline_aa<> ras; agg::simple_polygon_vertex_source path(m_poly.polygon(), m_poly.num_points(), false, m_close.status()); typedef agg::conv_bspline conv_bspline_type; conv_bspline_type bspline(path); bspline.interpolation_step(1.0 / m_num_points.value()); typedef agg::conv_stroke conv_stroke_type; conv_stroke_type stroke(bspline); stroke.width(2.0); ras.add_path(stroke); agg::render_scanlines_aa_solid(ras, sl, rb, agg::rgba(0, 0, 0)); //-------------------------- // Render the "poly" tool and controls ras.add_path(m_poly); agg::render_scanlines_aa_solid(ras, sl, rb, agg::rgba(0, 0.3, 0.5, 0.6)); agg::render_ctrl(ras, sl, rb, m_close); agg::render_ctrl(ras, sl, rb, m_num_points); //-------------------------- } virtual void on_mouse_button_down(int x, int y, unsigned flags) { if(flags & agg::mouse_left) { if(m_poly.on_mouse_button_down(x, y)) { force_redraw(); } } } virtual void on_mouse_move(int x, int y, unsigned flags) { if(flags & agg::mouse_left) { if(m_poly.on_mouse_move(x, y)) { force_redraw(); } } if((flags & agg::mouse_left) == 0) { on_mouse_button_up(x, y, flags); } } virtual void on_mouse_button_up(int x, int y, unsigned flags) { if(m_poly.on_mouse_button_up(x, y)) { force_redraw(); } } virtual void on_key(int x, int y, unsigned key, unsigned flags) { if(key == ' ') { m_flip ^= 1; on_init(); force_redraw(); } } }; int agg_main(int argc, char* argv[]) { the_application app(pix_format, flip_y); app.caption("AGG Example. BSpline Interpolator"); if(app.init(600, 600, agg::window_resize)) { return app.run(); } return 1; } agg-2.5+dfsg1/examples/circles.cpp0000644000000000000000000001637210703246330017235 0ustar00usergroup00000000000000#include #include #include "agg_rendering_buffer.h" #include "agg_rasterizer_scanline_aa.h" #include "agg_conv_transform.h" #include "agg_bspline.h" #include "agg_ellipse.h" #include "agg_gsv_text.h" #include "agg_scanline_p.h" #include "agg_renderer_scanline.h" #include "ctrl/agg_slider_ctrl.h" #include "ctrl/agg_scale_ctrl.h" #include "platform/agg_platform_support.h" #define AGG_BGR24 //#define AGG_RGB24 //#define AGG_BGRA32 //#define AGG_RGBA32 //#define AGG_ARGB32 //#define AGG_ABGR32 //#define AGG_RGB565 //#define AGG_RGB555 #include "pixel_formats.h" enum flip_y_e { flip_y = true }; enum default_num_points_e { default_num_points = 10000 }; enum start_size_e { start_width = 400, start_height = 400 }; static double spline_r_x[] = { 0.000000, 0.200000, 0.400000, 0.910484, 0.957258, 1.000000 }; static double spline_r_y[] = { 1.000000, 0.800000, 0.600000, 0.066667, 0.169697, 0.600000 }; static double spline_g_x[] = { 0.000000, 0.292244, 0.485655, 0.564859, 0.795607, 1.000000 }; static double spline_g_y[] = { 0.000000, 0.607260, 0.964065, 0.892558, 0.435571, 0.000000 }; static double spline_b_x[] = { 0.000000, 0.055045, 0.143034, 0.433082, 0.764859, 1.000000 }; static double spline_b_y[] = { 0.385480, 0.128493, 0.021416, 0.271507, 0.713974, 1.000000 }; struct scatter_point { double x; double y; double z; agg::rgba color; }; double random_dbl(double start, double end) { unsigned r = rand() & 0x7FFF; return double(r) * (end - start) / 32768.0 + start; } class the_application : public agg::platform_support { unsigned m_num_points; scatter_point* m_points; agg::scale_ctrl m_scale_ctrl_z; agg::slider_ctrl m_slider_ctrl_sel; agg::slider_ctrl m_slider_ctrl_size; agg::bspline m_spline_r; agg::bspline m_spline_g; agg::bspline m_spline_b; public: virtual ~the_application() { delete [] m_points; } the_application(agg::pix_format_e format, bool flip_y, unsigned num_points) : agg::platform_support(format, flip_y), m_num_points(num_points), m_points(new scatter_point [num_points]), m_scale_ctrl_z (5, 5, start_width-5, 12, !flip_y), m_slider_ctrl_sel (5, 20, start_width-5, 27, !flip_y), m_slider_ctrl_size(5, 35, start_width-5, 42, !flip_y) { m_spline_r.init(6, spline_r_x, spline_r_y); m_spline_g.init(6, spline_g_x, spline_g_y); m_spline_b.init(6, spline_b_x, spline_b_y); add_ctrl(m_scale_ctrl_z); add_ctrl(m_slider_ctrl_sel); add_ctrl(m_slider_ctrl_size); m_slider_ctrl_size.label("Size"); m_slider_ctrl_sel.label("Selectivity"); } void generate() { unsigned i; double rx = initial_width()/3.5; double ry = initial_height()/3.5; for(i = 0; i < m_num_points; i++) { double z = m_points[i].z = random_dbl(0.0, 1.0); double x = cos(z * 2.0 * agg::pi) * rx; double y = sin(z * 2.0 * agg::pi) * ry; double dist = random_dbl(0.0, rx/2.0); double angle = random_dbl(0.0, agg::pi * 2.0); m_points[i].x = initial_width()/2.0 + x + cos(angle) * dist; m_points[i].y = initial_height()/2.0 + y + sin(angle) * dist; m_points[i].color = agg::rgba(m_spline_r.get(z)*0.8, m_spline_g.get(z)*0.8, m_spline_b.get(z)*0.8, 1.0); } } virtual void on_init() { generate(); } virtual void on_draw() { agg::rasterizer_scanline_aa<> pf; agg::scanline_p8 sl; typedef agg::renderer_base renderer_base; pixfmt pixf(rbuf_window()); renderer_base rb(pixf); rb.clear(agg::rgba(1,1,1)); agg::ellipse e1; agg::conv_transform t1(e1, trans_affine_resizing()); unsigned i; unsigned n_drawn = 0; for(i = 0; i < m_num_points; i++) { double z = m_points[i].z; double alpha = 1.0; if(z < m_scale_ctrl_z.value1()) { alpha = 1.0 - (m_scale_ctrl_z.value1() - z) * m_slider_ctrl_sel.value() * 100.0; } if(z > m_scale_ctrl_z.value2()) { alpha = 1.0 - (z - m_scale_ctrl_z.value2()) * m_slider_ctrl_sel.value() * 100.0; } if(alpha > 1.0) alpha = 1.0; if(alpha < 0.0) alpha = 0.0; if(alpha > 0.0) { e1.init(m_points[i].x, m_points[i].y, m_slider_ctrl_size.value() * 5.0, m_slider_ctrl_size.value() * 5.0, 8); pf.add_path(t1); agg::render_scanlines_aa_solid( pf, sl, rb, agg::rgba(m_points[i].color.r, m_points[i].color.g, m_points[i].color.b, alpha)); n_drawn++; } } agg::render_ctrl(pf, sl, rb, m_scale_ctrl_z); agg::render_ctrl(pf, sl, rb, m_slider_ctrl_sel); agg::render_ctrl(pf, sl, rb, m_slider_ctrl_size); char buf[10]; sprintf(buf, "%08u", n_drawn); agg::gsv_text txt; txt.size(15.0); txt.text(buf); txt.start_point(10.0, initial_height() - 20.0); agg::gsv_text_outline<> txt_o(txt, trans_affine_resizing()); pf.add_path(txt_o); agg::render_scanlines_aa_solid(pf, sl, rb, agg::rgba(0,0,0)); } virtual void on_idle() { unsigned i; for(i = 0; i < m_num_points; i++) { m_points[i].x += random_dbl(0, m_slider_ctrl_sel.value()) - m_slider_ctrl_sel.value()*0.5; m_points[i].y += random_dbl(0, m_slider_ctrl_sel.value()) - m_slider_ctrl_sel.value()*0.5; m_points[i].z += random_dbl(0, m_slider_ctrl_sel.value()*0.01) - m_slider_ctrl_sel.value()*0.005; if(m_points[i].z < 0.0) m_points[i].z = 0.0; if(m_points[i].z > 1.0) m_points[i].z = 1.0; } force_redraw(); } virtual void on_mouse_button_down(int x, int y, unsigned flags) { if(flags & agg::mouse_left) { generate(); force_redraw(); } if(flags & agg::mouse_right) { wait_mode(!wait_mode()); } } }; int agg_main(int argc, char* argv[]) { unsigned num_points = default_num_points; if(argc > 1) { num_points = atoi(argv[1]); if(num_points == 0) num_points = default_num_points; if(num_points > 20000) num_points = 20000; } the_application app(pix_format, flip_y, num_points); app.caption("AGG Drawing random circles - A scatter plot prototype"); if(app.init(start_width, start_height, agg::window_resize | agg::window_keep_aspect_ratio)) { return app.run(); } return 1; } agg-2.5+dfsg1/examples/component_rendering.cpp0000644000000000000000000000522210703246330021640 0ustar00usergroup00000000000000#include "agg_basics.h" #include "agg_rendering_buffer.h" #include "agg_rasterizer_scanline_aa.h" #include "agg_scanline_p.h" #include "agg_renderer_scanline.h" #include "agg_ellipse.h" #include "agg_pixfmt_gray.h" #include "agg_pixfmt_rgb.h" #include "ctrl/agg_slider_ctrl.h" #include "platform/agg_platform_support.h" enum flip_y_e { flip_y = true }; class the_application : public agg::platform_support { agg::slider_ctrl m_alpha; public: the_application(agg::pix_format_e format, bool flip_y) : agg::platform_support(format, flip_y), m_alpha(5, 5, 320-5, 10+5, !flip_y) { m_alpha.label("Alpha=%1.0f"); m_alpha.range(0, 255); m_alpha.value(255); add_ctrl(m_alpha); } virtual void on_draw() { agg::pixfmt_bgr24 pf(rbuf_window()); typedef agg::pixfmt_alpha_blend_gray pixfmt_gray8_bgr24r; typedef agg::pixfmt_alpha_blend_gray pixfmt_gray8_bgr24g; typedef agg::pixfmt_alpha_blend_gray pixfmt_gray8_bgr24b; pixfmt_gray8_bgr24r pfr(rbuf_window()); pixfmt_gray8_bgr24g pfg(rbuf_window()); pixfmt_gray8_bgr24b pfb(rbuf_window()); agg::renderer_base rbase(pf); agg::renderer_base rbr(pfr); agg::renderer_base rbg(pfg); agg::renderer_base rbb(pfb); agg::rasterizer_scanline_aa<> ras; agg::scanline_p8 sl; rbase.clear(agg::rgba(1,1,1)); agg::ellipse er(width() / 2 - 0.87*50, height() / 2 - 0.5*50, 100, 100, 100); ras.add_path(er); agg::render_scanlines_aa_solid(ras, sl, rbr, agg::gray8(0, unsigned(m_alpha.value()))); agg::ellipse eg(width() / 2 + 0.87*50, height() / 2 - 0.5*50, 100, 100, 100); ras.add_path(eg); agg::render_scanlines_aa_solid(ras, sl, rbg, agg::gray8(0, unsigned(m_alpha.value()))); agg::ellipse eb(width() / 2, height() / 2 + 50, 100, 100, 100); ras.add_path(eb); agg::render_scanlines_aa_solid(ras, sl, rbb, agg::gray8(0, unsigned(m_alpha.value()))); agg::render_ctrl(ras, sl, rbase, m_alpha); } }; int agg_main(int argc, char* argv[]) { the_application app(agg::pix_format_bgr24, flip_y); app.caption("AGG Example. Component Rendering"); if(app.init(320, 320, 0)) { return app.run(); } return 1; } agg-2.5+dfsg1/examples/compositing.cpp0000644000000000000000000003467510703246330020152 0ustar00usergroup00000000000000#include #include "agg_rendering_buffer.h" #include "agg_renderer_base.h" #include "agg_rasterizer_scanline_aa.h" #include "agg_scanline_u.h" #include "agg_renderer_scanline.h" #include "agg_rounded_rect.h" #include "agg_pixfmt_rgba.h" #include "agg_span_allocator.h" #include "agg_span_gradient.h" #include "agg_gsv_text.h" #include "agg_span_interpolator_linear.h" #include "platform/agg_platform_support.h" #include "ctrl/agg_slider_ctrl.h" #include "ctrl/agg_rbox_ctrl.h" enum flip_y_e { flip_y = true }; typedef agg::rgba8 color; typedef color::value_type value_type; typedef agg::order_bgra order; typedef agg::int32u pixel_type; typedef agg::rendering_buffer rbuf_type; #define pix_format agg::pix_format_bgra32 typedef agg::blender_rgba prim_blender_type; typedef agg::pixfmt_alpha_blend_rgba prim_pixfmt_type; typedef agg::renderer_base prim_ren_base_type; void force_comp_op_link() { // For unknown reason Digital Mars C++ doesn't want to link these // functions if they are not specified explicitly. value_type p[4] = {0}; agg::comp_op_rgba_invert_rgb ::blend_pix(p,0,0,0,0,0); agg::comp_op_rgba_invert ::blend_pix(p,0,0,0,0,0); agg::comp_op_rgba_contrast ::blend_pix(p,0,0,0,0,0); agg::comp_op_rgba_darken ::blend_pix(p,0,0,0,0,0); agg::comp_op_rgba_lighten ::blend_pix(p,0,0,0,0,0); agg::comp_op_rgba_color_dodge::blend_pix(p,0,0,0,0,0); agg::comp_op_rgba_color_burn ::blend_pix(p,0,0,0,0,0); agg::comp_op_rgba_hard_light ::blend_pix(p,0,0,0,0,0); agg::comp_op_rgba_soft_light ::blend_pix(p,0,0,0,0,0); agg::comp_op_rgba_difference ::blend_pix(p,0,0,0,0,0); agg::comp_op_rgba_exclusion ::blend_pix(p,0,0,0,0,0); agg::comp_op_rgba_src_atop ::blend_pix(p,0,0,0,0,0); agg::comp_op_rgba_dst_atop ::blend_pix(p,0,0,0,0,0); agg::comp_op_rgba_xor ::blend_pix(p,0,0,0,0,0); agg::comp_op_rgba_plus ::blend_pix(p,0,0,0,0,0); agg::comp_op_rgba_minus ::blend_pix(p,0,0,0,0,0); agg::comp_op_rgba_multiply ::blend_pix(p,0,0,0,0,0); agg::comp_op_rgba_screen ::blend_pix(p,0,0,0,0,0); agg::comp_op_rgba_overlay ::blend_pix(p,0,0,0,0,0); agg::comp_op_rgba_src ::blend_pix(p,0,0,0,0,0); agg::comp_op_rgba_dst ::blend_pix(p,0,0,0,0,0); agg::comp_op_rgba_src_over ::blend_pix(p,0,0,0,0,0); agg::comp_op_rgba_dst_over ::blend_pix(p,0,0,0,0,0); agg::comp_op_rgba_src_in ::blend_pix(p,0,0,0,0,0); agg::comp_op_rgba_dst_in ::blend_pix(p,0,0,0,0,0); agg::comp_op_rgba_src_out ::blend_pix(p,0,0,0,0,0); agg::comp_op_rgba_dst_out ::blend_pix(p,0,0,0,0,0); agg::comp_op_rgba_clear ::blend_pix(p,0,0,0,0,0); } namespace agg { //======================================================================== template<> struct gradient_linear_color { typedef color color_type; enum base_scale_e { base_shift = color_type::base_shift }; gradient_linear_color() {} gradient_linear_color(const color_type& c1, const color_type& c2) : m_c1(c1), m_c2(c2) {} static unsigned size() { return 256; } color_type operator [] (unsigned v) const { color_type c; typedef color_type::value_type value_type; v <<= base_shift - 8; c.r = (value_type)((((m_c2.r - m_c1.r) * v) + (m_c1.r << base_shift)) >> base_shift); c.g = (value_type)((((m_c2.g - m_c1.g) * v) + (m_c1.g << base_shift)) >> base_shift); c.b = (value_type)((((m_c2.b - m_c1.b) * v) + (m_c1.b << base_shift)) >> base_shift); c.a = (value_type)((((m_c2.a - m_c1.a) * v) + (m_c1.a << base_shift)) >> base_shift); return c; } void colors(const color_type& c1, const color_type& c2) { m_c1 = c1; m_c2 = c2; } color_type m_c1; color_type m_c2; }; } agg::trans_affine gradient_affine(double x1, double y1, double x2, double y2, double gradient_d2 = 100.0) { agg::trans_affine mtx; double dx = x2 - x1; double dy = y2 - y1; mtx.reset(); mtx *= agg::trans_affine_scaling(sqrt(dx * dx + dy * dy) / gradient_d2); mtx *= agg::trans_affine_rotation(atan2(dy, dx)); mtx *= agg::trans_affine_translation(x1, y1); mtx.invert(); return mtx; } template void circle(RenBase& rbase, color c1, color c2, double x1, double y1, double x2, double y2, double shadow_alpha) { typedef RenBase renderer_base_type; typedef agg::gradient_x gradient_func_type; typedef agg::gradient_linear_color color_func_type; typedef agg::span_interpolator_linear<> interpolator_type; typedef agg::span_allocator span_allocator_type; typedef agg::span_gradient span_gradient_type; gradient_func_type gradient_func; // The gradient function agg::trans_affine gradient_mtx = gradient_affine(x1, y1, x2, y2, 100); interpolator_type span_interpolator(gradient_mtx); // Span interpolator span_allocator_type span_allocator; // Span Allocator color_func_type color_func(c1, c2); span_gradient_type span_gradient(span_interpolator, gradient_func, color_func, 0, 100); agg::rasterizer_scanline_aa<> ras; agg::scanline_u8 sl; double r = agg::calc_distance(x1, y1, x2, y2) / 2; agg::ellipse ell((x1+x2)/2+5, (y1+y2)/2-3, r, r, 100); ras.add_path(ell); agg::render_scanlines_aa_solid(ras, sl, rbase, agg::rgba(0.6, 0.6, 0.6, 0.7*shadow_alpha)); ell.init((x1+x2)/2, (y1+y2)/2, r, r, 100); ras.add_path(ell); agg::render_scanlines_aa(ras, sl, rbase, span_allocator, span_gradient); } template void src_shape(RenBase& rbase, color c1, color c2, double x1, double y1, double x2, double y2) { typedef RenBase renderer_base_type; typedef agg::gradient_x gradient_func_type; typedef agg::gradient_linear_color color_func_type; typedef agg::span_interpolator_linear<> interpolator_type; typedef agg::span_allocator span_allocator_type; typedef agg::span_gradient span_gradient_type; gradient_func_type gradient_func; // The gradient function agg::trans_affine gradient_mtx = gradient_affine(x1, y1, x2, y2, 100); interpolator_type span_interpolator(gradient_mtx); // Span interpolator span_allocator_type span_allocator; // Span Allocator color_func_type color_func(c1, c2); span_gradient_type span_gradient(span_interpolator, gradient_func, color_func, 0, 100); agg::rasterizer_scanline_aa<> ras; agg::scanline_u8 sl; agg::rounded_rect shape(x1, y1, x2, y2, 40); // agg::ellipse shape((x1+x2)/2, (y1+y2)/2, fabs(x2-x1)/2, fabs(y2-y1)/2, 100); ras.add_path(shape); agg::render_scanlines_aa(ras, sl, rbase, span_allocator, span_gradient); } class the_application : public agg::platform_support { agg::slider_ctrl m_alpha_src; agg::slider_ctrl m_alpha_dst; agg::rbox_ctrl m_comp_op; public: the_application(agg::pix_format_e format, bool flip_y) : agg::platform_support(format, flip_y), m_alpha_src(5, 5, 400, 11, !flip_y), m_alpha_dst(5, 5+15, 400, 11+15, !flip_y), m_comp_op(420, 5.0, 420+170.0, 395.0, !flip_y) { m_alpha_src.label("Src Alpha=%.2f"); m_alpha_src.value(0.75); add_ctrl(m_alpha_src); m_alpha_dst.label("Dst Alpha=%.2f"); m_alpha_dst.value(1.0); add_ctrl(m_alpha_dst); m_comp_op.text_size(6.8); m_comp_op.add_item("clear"); m_comp_op.add_item("src"); m_comp_op.add_item("dst"); m_comp_op.add_item("src-over"); m_comp_op.add_item("dst-over"); m_comp_op.add_item("src-in"); m_comp_op.add_item("dst-in"); m_comp_op.add_item("src-out"); m_comp_op.add_item("dst-out"); m_comp_op.add_item("src-atop"); m_comp_op.add_item("dst-atop"); m_comp_op.add_item("xor"); m_comp_op.add_item("plus"); m_comp_op.add_item("minus"); m_comp_op.add_item("multiply"); m_comp_op.add_item("screen"); m_comp_op.add_item("overlay"); m_comp_op.add_item("darken"); m_comp_op.add_item("lighten"); m_comp_op.add_item("color-dodge"); m_comp_op.add_item("color-burn"); m_comp_op.add_item("hard-light"); m_comp_op.add_item("soft-light"); m_comp_op.add_item("difference"); m_comp_op.add_item("exclusion"); m_comp_op.add_item("contrast"); m_comp_op.add_item("invert"); m_comp_op.add_item("invert-rgb"); m_comp_op.cur_item(3); add_ctrl(m_comp_op); } virtual ~the_application() { } virtual void on_init() { } void render_scene(rbuf_type& rbuf, prim_pixfmt_type& pixf) { typedef agg::comp_op_adaptor_rgba blender_type; typedef agg::pixfmt_custom_blend_rgba pixfmt_type; typedef agg::renderer_base renderer_type; pixfmt_type ren_pixf(rbuf); renderer_type renderer(ren_pixf); agg::renderer_base rb(pixf); rb.blend_from(prim_pixfmt_type(rbuf_img(1)), 0, 250, 180, unsigned(m_alpha_dst.value() * 255)); circle(rb, agg::rgba8(0xFD, 0xF0, 0x6F, unsigned(m_alpha_dst.value() * 255)), agg::rgba8(0xFE, 0x9F, 0x34, unsigned(m_alpha_dst.value() * 255)), 70*3, 100+24*3, 37*3, 100+79*3, m_alpha_dst.value()); ren_pixf.comp_op(m_comp_op.cur_item()); if(m_comp_op.cur_item() == 25) // Contrast { double v = m_alpha_src.value(); src_shape(renderer, agg::rgba(v, v, v), agg::rgba(v, v, v), 300+50, 100+24*3, 107+50, 100+79*3); } else { src_shape(renderer, agg::rgba8(0x7F, 0xC1, 0xFF, unsigned(m_alpha_src.value() * 255)), agg::rgba8(0x05, 0x00, 0x5F, unsigned(m_alpha_src.value() * 255)), 300+50, 100+24*3, 107+50, 100+79*3); /* src_shape(renderer, agg::rgba8(0xFF, 0xFF, 0xFF, unsigned(m_alpha_src.value() * 255)), agg::rgba8(0xFF, 0xFF, 0xFF, unsigned(m_alpha_src.value() * 255)), 300+50, 100+24*3, 107+50, 100+79*3); */ } } virtual void on_draw() { prim_pixfmt_type pixf(rbuf_window()); prim_ren_base_type rb(pixf); rb.clear(agg::rgba8(255, 255, 255)); unsigned y; for(y = 0; y < rb.height(); y += 8) { unsigned x; for(x = ((y >> 3) & 1) << 3; x < rb.width(); x += 16) { rb.copy_bar(x, y, x+7, y+7, agg::rgba8(0xdf, 0xdf, 0xdf)); } } create_img(0, rbuf_window().width(), rbuf_window().height()); // agg_platform_support functionality prim_pixfmt_type pixf2(rbuf_img(0)); prim_ren_base_type rb2(pixf2); rb2.clear(agg::rgba8(0,0,0,0)); //rb2.clear(agg::rgba8(255,255,255,255)); typedef agg::blender_rgba_pre blender_type_pre; typedef agg::pixfmt_alpha_blend_rgba pixfmt_pre; typedef agg::renderer_base ren_base_pre; pixfmt_pre pixf_pre(rbuf_window()); ren_base_pre rb_pre(pixf_pre); start_timer(); render_scene(rbuf_img(0), pixf2); double tm = elapsed_time(); rb_pre.blend_from(pixf2); agg::rasterizer_scanline_aa<> ras; agg::scanline_u8 sl; agg::renderer_scanline_aa_solid ren(rb); char buf[64]; agg::gsv_text t; t.size(10.0); agg::conv_stroke pt(t); pt.width(1.5); sprintf(buf, "%3.2f ms", tm); t.start_point(10.0, 35.0); t.text(buf); ras.add_path(pt); ren.color(agg::rgba(0,0,0)); agg::render_scanlines(ras, sl, ren); agg::render_ctrl_rs(ras, sl, ren, m_alpha_src); agg::render_ctrl_rs(ras, sl, ren, m_alpha_dst); agg::render_ctrl_rs(ras, sl, ren, m_comp_op); } virtual void on_mouse_button_down(int x, int y, unsigned flags) { } virtual void on_mouse_move(int x, int y, unsigned flags) { } virtual void on_mouse_button_up(int x, int y, unsigned flags) { } }; int agg_main(int argc, char* argv[]) { force_comp_op_link(); the_application app(pix_format, flip_y); app.caption("AGG Example. Compositing Modes"); const char* img_name = "compositing"; if(argc >= 2) img_name = argv[1]; if(!app.load_img(1, img_name)) { char buf[256]; if(strcmp(img_name, "compositing") == 0) { sprintf(buf, "File not found: %s%s. Download http://www.antigrain.com/%s%s\n" "or copy it from another directory if available.", img_name, app.img_ext(), img_name, app.img_ext()); } else { sprintf(buf, "File not found: %s%s", img_name, app.img_ext()); } app.message(buf); return 1; } if(app.init(600, 400, agg::window_resize)) { return app.run(); } return 1; } agg-2.5+dfsg1/examples/compositing2.cpp0000644000000000000000000002257410703246330020227 0ustar00usergroup00000000000000#include #include "agg_rendering_buffer.h" #include "agg_rasterizer_scanline_aa.h" #include "agg_scanline_u.h" #include "agg_renderer_scanline.h" #include "agg_rounded_rect.h" #include "agg_pixfmt_rgba.h" #include "agg_span_allocator.h" #include "agg_span_gradient.h" #include "agg_gsv_text.h" #include "agg_span_interpolator_linear.h" #include "platform/agg_platform_support.h" #include "ctrl/agg_slider_ctrl.h" #include "ctrl/agg_rbox_ctrl.h" enum flip_y_e { flip_y = true }; typedef agg::rgba8 color; typedef agg::order_bgra order; typedef agg::pixel32_type pixel_type; #define pix_format agg::pix_format_bgra32 typedef agg::blender_rgba prim_blender_type; typedef agg::pixfmt_alpha_blend_rgba prim_pixfmt_type; typedef agg::renderer_base prim_ren_base_type; void force_comp_op_link() { // For unknown reason Digital Mars C++ doesn't want to link these // functions if they are not specified explicitly. agg::int8u p[4] = {0}; agg::comp_op_rgba_invert_rgb ::blend_pix(p,0,0,0,0,0); agg::comp_op_rgba_invert ::blend_pix(p,0,0,0,0,0); agg::comp_op_rgba_contrast ::blend_pix(p,0,0,0,0,0); agg::comp_op_rgba_darken ::blend_pix(p,0,0,0,0,0); agg::comp_op_rgba_lighten ::blend_pix(p,0,0,0,0,0); agg::comp_op_rgba_color_dodge::blend_pix(p,0,0,0,0,0); agg::comp_op_rgba_color_burn ::blend_pix(p,0,0,0,0,0); agg::comp_op_rgba_hard_light ::blend_pix(p,0,0,0,0,0); agg::comp_op_rgba_soft_light ::blend_pix(p,0,0,0,0,0); agg::comp_op_rgba_difference ::blend_pix(p,0,0,0,0,0); agg::comp_op_rgba_exclusion ::blend_pix(p,0,0,0,0,0); agg::comp_op_rgba_src_atop ::blend_pix(p,0,0,0,0,0); agg::comp_op_rgba_dst_atop ::blend_pix(p,0,0,0,0,0); agg::comp_op_rgba_xor ::blend_pix(p,0,0,0,0,0); agg::comp_op_rgba_plus ::blend_pix(p,0,0,0,0,0); agg::comp_op_rgba_minus ::blend_pix(p,0,0,0,0,0); agg::comp_op_rgba_multiply ::blend_pix(p,0,0,0,0,0); agg::comp_op_rgba_screen ::blend_pix(p,0,0,0,0,0); agg::comp_op_rgba_overlay ::blend_pix(p,0,0,0,0,0); agg::comp_op_rgba_src ::blend_pix(p,0,0,0,0,0); agg::comp_op_rgba_dst ::blend_pix(p,0,0,0,0,0); agg::comp_op_rgba_src_over ::blend_pix(p,0,0,0,0,0); agg::comp_op_rgba_dst_over ::blend_pix(p,0,0,0,0,0); agg::comp_op_rgba_src_in ::blend_pix(p,0,0,0,0,0); agg::comp_op_rgba_dst_in ::blend_pix(p,0,0,0,0,0); agg::comp_op_rgba_src_out ::blend_pix(p,0,0,0,0,0); agg::comp_op_rgba_dst_out ::blend_pix(p,0,0,0,0,0); agg::comp_op_rgba_clear ::blend_pix(p,0,0,0,0,0); } template void generate_color_ramp(Container& c, ColorT c1, ColorT c2, ColorT c3, ColorT c4) { unsigned i; for(i = 0; i < 85; i++) { c[i] = c1.gradient(c2, i/85.0); } for(; i < 170; i++) { c[i] = c2.gradient(c3, (i - 85)/85.0); } for(; i < 256; i++) { c[i] = c3.gradient(c4, (i - 170)/85.0); } } class the_application : public agg::platform_support { agg::slider_ctrl m_alpha_dst; agg::slider_ctrl m_alpha_src; agg::rbox_ctrl m_comp_op; agg::pod_auto_array m_ramp1; agg::pod_auto_array m_ramp2; agg::rasterizer_scanline_aa<> m_ras; agg::scanline_u8 m_sl; public: the_application(agg::pix_format_e format, bool flip_y) : agg::platform_support(format, flip_y), m_alpha_dst(5, 5, 400, 11, !flip_y), m_alpha_src(5, 5+15, 400, 11+15, !flip_y), m_comp_op(420, 5.0, 420+170.0, 395.0, !flip_y) { m_alpha_dst.label("Dst Alpha=%.2f"); m_alpha_dst.value(1.0); add_ctrl(m_alpha_dst); m_alpha_src.label("Src Alpha=%.2f"); m_alpha_src.value(1.0); add_ctrl(m_alpha_src); m_comp_op.text_size(6.8); m_comp_op.add_item("clear"); m_comp_op.add_item("src"); m_comp_op.add_item("dst"); m_comp_op.add_item("src-over"); m_comp_op.add_item("dst-over"); m_comp_op.add_item("src-in"); m_comp_op.add_item("dst-in"); m_comp_op.add_item("src-out"); m_comp_op.add_item("dst-out"); m_comp_op.add_item("src-atop"); m_comp_op.add_item("dst-atop"); m_comp_op.add_item("xor"); m_comp_op.add_item("plus"); m_comp_op.add_item("minus"); m_comp_op.add_item("multiply"); m_comp_op.add_item("screen"); m_comp_op.add_item("overlay"); m_comp_op.add_item("darken"); m_comp_op.add_item("lighten"); m_comp_op.add_item("color-dodge"); m_comp_op.add_item("color-burn"); m_comp_op.add_item("hard-light"); m_comp_op.add_item("soft-light"); m_comp_op.add_item("difference"); m_comp_op.add_item("exclusion"); m_comp_op.add_item("contrast"); m_comp_op.add_item("invert"); m_comp_op.add_item("invert-rgb"); m_comp_op.cur_item(3); add_ctrl(m_comp_op); } template void radial_shape(RenBase& rbase, const ColorRamp& colors, double x1, double y1, double x2, double y2) { typedef RenBase renderer_base_type; typedef agg::gradient_radial gradient_func_type; typedef ColorRamp color_func_type; typedef agg::span_interpolator_linear<> interpolator_type; typedef agg::span_allocator span_allocator_type; typedef agg::span_gradient span_gradient_type; gradient_func_type gradient_func; // The gradient function agg::trans_affine gradient_mtx; interpolator_type span_interpolator(gradient_mtx); // Span interpolator span_allocator_type span_allocator; // Span Allocator span_gradient_type span_gradient(span_interpolator, gradient_func, colors, 0, 100); double cx = (x1 + x2) / 2.0; double cy = (y1 + y2) / 2.0; double r = 0.5 * (((x2 - x1) < (y2 - y1)) ? (x2 - x1) : (y2 - y1)); gradient_mtx *= agg::trans_affine_scaling(r / 100.0); gradient_mtx *= agg::trans_affine_translation(cx, cy); gradient_mtx *= trans_affine_resizing(); gradient_mtx.invert(); agg::ellipse ell(cx, cy, r, r, 100); agg::conv_transform trans(ell, trans_affine_resizing()); m_ras.add_path(trans); agg::render_scanlines_aa(m_ras, m_sl, rbase, span_allocator, span_gradient); } template void render_scene(RenBase& rb) { typedef agg::comp_op_adaptor_rgba blender_type; typedef agg::pixfmt_custom_blend_rgba pixfmt_type; typedef agg::renderer_base renderer_type; pixfmt_type pixf(rbuf_window()); renderer_type ren(pixf); pixf.comp_op(agg::comp_op_difference); radial_shape(ren, m_ramp1, 50, 50, 50+320, 50+320); pixf.comp_op(m_comp_op.cur_item()); double cx = 50; double cy = 50; radial_shape(ren, m_ramp2, cx+120-70, cy+120-70, cx+120+70, cy+120+70); radial_shape(ren, m_ramp2, cx+200-70, cy+120-70, cx+200+70, cy+120+70); radial_shape(ren, m_ramp2, cx+120-70, cy+200-70, cx+120+70, cy+200+70); radial_shape(ren, m_ramp2, cx+200-70, cy+200-70, cx+200+70, cy+200+70); } virtual void on_draw() { prim_pixfmt_type pixf(rbuf_window()); prim_ren_base_type rb(pixf); rb.clear(agg::rgba8(255, 255, 255)); generate_color_ramp(m_ramp1, agg::rgba(0, 0, 0, m_alpha_dst.value()), agg::rgba(0, 0, 1, m_alpha_dst.value()), agg::rgba(0, 1, 0, m_alpha_dst.value()), agg::rgba(1, 0, 0, 0)); generate_color_ramp(m_ramp2, agg::rgba(0, 0, 0, m_alpha_src.value()), agg::rgba(0, 0, 1, m_alpha_src.value()), agg::rgba(0, 1, 0, m_alpha_src.value()), agg::rgba(1, 0, 0, 0)); render_scene(rb); agg::renderer_scanline_aa_solid ren(rb); agg::render_ctrl_rs(m_ras, m_sl, ren, m_alpha_dst); agg::render_ctrl_rs(m_ras, m_sl, ren, m_alpha_src); agg::render_ctrl_rs(m_ras, m_sl, ren, m_comp_op); } }; int agg_main(int argc, char* argv[]) { force_comp_op_link(); the_application app(pix_format, flip_y); app.caption("AGG Example. Compositing Modes"); if(app.init(600, 400, agg::window_resize|agg::window_keep_aspect_ratio)) { return app.run(); } return 1; } agg-2.5+dfsg1/examples/conv_contour.cpp0000644000000000000000000001221210703246330020314 0ustar00usergroup00000000000000#include #include #include "agg_basics.h" #include "agg_rendering_buffer.h" #include "agg_rasterizer_scanline_aa.h" #include "agg_conv_curve.h" #include "agg_conv_contour.h" #include "agg_conv_stroke.h" #include "agg_scanline_p.h" #include "agg_renderer_scanline.h" #include "agg_pixfmt_rgb.h" #include "ctrl/agg_slider_ctrl.h" #include "ctrl/agg_rbox_ctrl.h" #include "ctrl/agg_cbox_ctrl.h" #include "platform/agg_platform_support.h" enum flip_y_e { flip_y = true }; class the_application : public agg::platform_support { agg::rbox_ctrl m_close; agg::slider_ctrl m_width; agg::cbox_ctrl m_auto_detect; agg::path_storage m_path; public: the_application(agg::pix_format_e format, bool flip_y) : agg::platform_support(format, flip_y), m_close (10.0, 10.0, 130.0, 80.0, !flip_y), m_width (130 + 10.0, 10.0 + 4.0, 130 + 300.0, 10.0 + 8.0 + 4.0, !flip_y), m_auto_detect(130 + 10.0, 10.0 + 4.0 + 16.0, "Autodetect orientation if not defined", !flip_y) { add_ctrl(m_close); m_close.add_item("Close"); m_close.add_item("Close CW"); m_close.add_item("Close CCW"); m_close.cur_item(0); add_ctrl(m_width); m_width.range(-100.0, 100.0); m_width.value(0.0); m_width.label("Width=%1.2f"); add_ctrl(m_auto_detect); } void compose_path() { unsigned flag = 0; if (m_close.cur_item() == 1) flag = agg::path_flags_cw; if (m_close.cur_item() == 2) flag = agg::path_flags_ccw; m_path.remove_all(); m_path.move_to(28.47, 6.45); m_path.curve3(21.58, 1.12, 19.82, 0.29); m_path.curve3(17.19, -0.93, 14.21, -0.93); m_path.curve3(9.57, -0.93, 6.57, 2.25); m_path.curve3(3.56, 5.42, 3.56, 10.60); m_path.curve3(3.56, 13.87, 5.03, 16.26); m_path.curve3(7.03, 19.58, 11.99, 22.51); m_path.curve3(16.94, 25.44, 28.47, 29.64); m_path.line_to(28.47, 31.40); m_path.curve3(28.47, 38.09, 26.34, 40.58); m_path.curve3(24.22, 43.07, 20.17, 43.07); m_path.curve3(17.09, 43.07, 15.28, 41.41); m_path.curve3(13.43, 39.75, 13.43, 37.60); m_path.line_to(13.53, 34.77); m_path.curve3(13.53, 32.52, 12.38, 31.30); m_path.curve3(11.23, 30.08, 9.38, 30.08); m_path.curve3(7.57, 30.08, 6.42, 31.35); m_path.curve3(5.27, 32.62, 5.27, 34.81); m_path.curve3(5.27, 39.01, 9.57, 42.53); m_path.curve3(13.87, 46.04, 21.63, 46.04); m_path.curve3(27.59, 46.04, 31.40, 44.04); m_path.curve3(34.28, 42.53, 35.64, 39.31); m_path.curve3(36.52, 37.21, 36.52, 30.71); m_path.line_to(36.52, 15.53); m_path.curve3(36.52, 9.13, 36.77, 7.69); m_path.curve3(37.01, 6.25, 37.57, 5.76); m_path.curve3(38.13, 5.27, 38.87, 5.27); m_path.curve3(39.65, 5.27, 40.23, 5.62); m_path.curve3(41.26, 6.25, 44.19, 9.18); m_path.line_to(44.19, 6.45); m_path.curve3(38.72, -0.88, 33.74, -0.88); m_path.curve3(31.35, -0.88, 29.93, 0.78); m_path.curve3(28.52, 2.44, 28.47, 6.45); m_path.close_polygon(flag); m_path.move_to(28.47, 9.62); m_path.line_to(28.47, 26.66); m_path.curve3(21.09, 23.73, 18.95, 22.51); m_path.curve3(15.09, 20.36, 13.43, 18.02); m_path.curve3(11.77, 15.67, 11.77, 12.89); m_path.curve3(11.77, 9.38, 13.87, 7.06); m_path.curve3(15.97, 4.74, 18.70, 4.74); m_path.curve3(22.41, 4.74, 28.47, 9.62); m_path.close_polygon(flag); } virtual void on_draw() { typedef agg::renderer_base ren_base; agg::pixfmt_bgr24 pixf(rbuf_window()); ren_base renb(pixf); renb.clear(agg::rgba(1, 1, 1)); agg::rasterizer_scanline_aa<> ras; agg::scanline_p8 sl; agg::trans_affine mtx; mtx *= agg::trans_affine_scaling(4.0); mtx *= agg::trans_affine_translation(150, 100); agg::conv_transform trans(m_path, mtx); agg::conv_curve > curve(trans); agg::conv_contour > > contour(curve); contour.width(m_width.value()); //contour.inner_join(agg::inner_bevel); //contour.line_join(agg::miter_join); //contour.inner_line_join(agg::miter_join); //contour.inner_miter_limit(4.0); contour.auto_detect_orientation(m_auto_detect.status()); compose_path(); ras.add_path(contour); agg::render_scanlines_aa_solid(ras, sl, renb, agg::rgba(0,0,0)); agg::render_ctrl(ras, sl, renb, m_close); agg::render_ctrl(ras, sl, renb, m_width); agg::render_ctrl(ras, sl, renb, m_auto_detect); } }; int agg_main(int argc, char* argv[]) { the_application app(agg::pix_format_bgr24, flip_y); app.caption("AGG Example. Contour Tool & Polygon Orientation"); if(app.init(440, 330, 0)) { return app.run(); } return 1; } agg-2.5+dfsg1/examples/conv_dash_marker.cpp0000644000000000000000000002023010703246330021102 0ustar00usergroup00000000000000#include #include #include "agg_basics.h" #include "agg_rendering_buffer.h" #include "agg_rasterizer_scanline_aa.h" #include "agg_conv_stroke.h" #include "agg_conv_dash.h" #include "agg_conv_curve.h" #include "agg_conv_contour.h" #include "agg_conv_smooth_poly1.h" #include "agg_conv_marker.h" #include "agg_arrowhead.h" #include "agg_vcgen_markers_term.h" #include "agg_scanline_u.h" #include "agg_renderer_scanline.h" #include "agg_pixfmt_rgb.h" #include "ctrl/agg_slider_ctrl.h" #include "ctrl/agg_rbox_ctrl.h" #include "ctrl/agg_cbox_ctrl.h" #include "platform/agg_platform_support.h" enum flip_y_e { flip_y = true }; class the_application : public agg::platform_support { double m_x[3]; double m_y[3]; double m_dx; double m_dy; int m_idx; agg::rbox_ctrl m_cap; agg::slider_ctrl m_width; agg::slider_ctrl m_smooth; agg::cbox_ctrl m_close; agg::cbox_ctrl m_even_odd; public: the_application(agg::pix_format_e format, bool flip_y) : agg::platform_support(format, flip_y), m_idx(-1), m_cap(10.0, 10.0, 130.0, 80.0, !flip_y), m_width(130 + 10.0, 10.0 + 4.0, 130 + 150.0, 10.0 + 8.0 + 4.0, !flip_y), m_smooth(130 + 150.0 + 10.0, 10.0 + 4.0, 500 - 10.0, 10.0 + 8.0 + 4.0, !flip_y), m_close(130 + 10.0, 10.0 + 4.0 + 16.0, "Close Polygons", !flip_y), m_even_odd(130 + 150.0 + 10.0, 10.0 + 4.0 + 16.0, "Even-Odd Fill", !flip_y) { m_x[0] = 57 + 100; m_y[0] = 60; m_x[1] = 369 + 100; m_y[1] = 170; m_x[2] = 143 + 100; m_y[2] = 310; add_ctrl(m_cap); m_cap.add_item("Butt Cap"); m_cap.add_item("Square Cap"); m_cap.add_item("Round Cap"); m_cap.cur_item(0); m_cap.no_transform(); add_ctrl(m_width); m_width.range(0.0, 10.0); m_width.value(3.0); m_width.label("Width=%1.2f"); m_width.no_transform(); add_ctrl(m_smooth); m_smooth.range(0.0, 2.0); m_smooth.value(1.0); m_smooth.label("Smooth=%1.2f"); m_smooth.no_transform(); add_ctrl(m_close); m_close.no_transform(); add_ctrl(m_even_odd); m_even_odd.no_transform(); } virtual void on_init() { } virtual void on_draw() { typedef agg::renderer_base ren_base; agg::pixfmt_bgr24 pixf(rbuf_window()); ren_base renb(pixf); renb.clear(agg::rgba(1, 1, 1)); agg::rasterizer_scanline_aa<> ras; agg::scanline_u8 sl; agg::line_cap_e cap = agg::butt_cap; if(m_cap.cur_item() == 1) cap = agg::square_cap; if(m_cap.cur_item() == 2) cap = agg::round_cap; // Here we declare a very cheap-in-use path storage. // It allocates space for at most 20 vertices in stack and // never allocates memory. But be aware that adding more than // 20 vertices is fatal! //------------------------ typedef agg::path_base< agg::vertex_stl_storage< agg::pod_auto_vector< agg::vertex_d, 20> > > path_storage_type; path_storage_type path; path.move_to(m_x[0], m_y[0]); path.line_to(m_x[1], m_y[1]); path.line_to((m_x[0]+m_x[1]+m_x[2]) / 3.0, (m_y[0]+m_y[1]+m_y[2]) / 3.0); path.line_to(m_x[2], m_y[2]); if(m_close.status()) path.close_polygon(); path.move_to((m_x[0] + m_x[1]) / 2, (m_y[0] + m_y[1]) / 2); path.line_to((m_x[1] + m_x[2]) / 2, (m_y[1] + m_y[2]) / 2); path.line_to((m_x[2] + m_x[0]) / 2, (m_y[2] + m_y[0]) / 2); if(m_close.status()) path.close_polygon(); if(m_even_odd.status()) ras.filling_rule(agg::fill_even_odd); // (1) ras.add_path(path); agg::render_scanlines_aa_solid(ras, sl, renb, agg::rgba(0.7, 0.5, 0.1, 0.5)); // (1) // Start of (2, 3, 4) agg::conv_smooth_poly1 smooth(path); smooth.smooth_value(m_smooth.value()); // (2) ras.add_path(smooth); agg::render_scanlines_aa_solid(ras, sl, renb, agg::rgba(0.1, 0.5, 0.7, 0.1)); // (2) // (3) agg::conv_stroke > smooth_outline(smooth); ras.add_path(smooth_outline); agg::render_scanlines_aa_solid(ras, sl, renb, agg::rgba(0.0, 0.6, 0.0, 0.8)); // (3) // (4) agg::conv_curve > curve(smooth); agg::conv_dash >, agg::vcgen_markers_term> dash(curve); agg::conv_stroke >, agg::vcgen_markers_term> > stroke(dash); stroke.line_cap(cap); stroke.width(m_width.value()); double k = ::pow(m_width.value(), 0.7); agg::arrowhead ah; ah.head(4 * k, 4 * k, 3 * k, 2 * k); if(!m_close.status()) ah.tail(1 * k, 1.5 * k, 3 * k, 5 * k); agg::conv_marker arrow(dash.markers(), ah); dash.add_dash(20.0, 5.0); dash.add_dash(5.0, 5.0); dash.add_dash(5.0, 5.0); dash.dash_start(10); ras.add_path(stroke); ras.add_path(arrow); agg::render_scanlines_aa_solid(ras, sl, renb, agg::rgba(0.0, 0.0, 0.0)); // (4) ras.filling_rule(agg::fill_non_zero); agg::render_ctrl(ras, sl, renb, m_cap); agg::render_ctrl(ras, sl, renb, m_width); agg::render_ctrl(ras, sl, renb, m_smooth); agg::render_ctrl(ras, sl, renb, m_close); agg::render_ctrl(ras, sl, renb, m_even_odd); } virtual void on_mouse_button_down(int x, int y, unsigned flags) { if(flags & agg::mouse_left) { unsigned i; for (i = 0; i < 3; i++) { if(sqrt( (x-m_x[i]) * (x-m_x[i]) + (y-m_y[i]) * (y-m_y[i]) ) < 20.0) { m_dx = x - m_x[i]; m_dy = y - m_y[i]; m_idx = i; break; } } if(i == 3) { if(agg::point_in_triangle(m_x[0], m_y[0], m_x[1], m_y[1], m_x[2], m_y[2], x, y)) { m_dx = x - m_x[0]; m_dy = y - m_y[0]; m_idx = 3; } } } } virtual void on_mouse_move(int x, int y, unsigned flags) { if(flags & agg::mouse_left) { if(m_idx == 3) { double dx = x - m_dx; double dy = y - m_dy; m_x[1] -= m_x[0] - dx; m_y[1] -= m_y[0] - dy; m_x[2] -= m_x[0] - dx; m_y[2] -= m_y[0] - dy; m_x[0] = dx; m_y[0] = dy; force_redraw(); return; } if(m_idx >= 0) { m_x[m_idx] = x - m_dx; m_y[m_idx] = y - m_dy; force_redraw(); } } else { on_mouse_button_up(x, y, flags); } } virtual void on_mouse_button_up(int x, int y, unsigned flags) { m_idx = -1; } virtual void on_key(int x, int y, unsigned key, unsigned flags) { double dx = 0; double dy = 0; switch(key) { case agg::key_left: dx = -0.1; break; case agg::key_right: dx = 0.1; break; case agg::key_up: dy = 0.1; break; case agg::key_down: dy = -0.1; break; } m_x[0] += dx; m_y[0] += dy; m_x[1] += dx; m_y[1] += dy; force_redraw(); } }; int agg_main(int argc, char* argv[]) { the_application app(agg::pix_format_bgr24, flip_y); app.caption("AGG Example. Line Join"); if(app.init(500, 330, 0)) { return app.run(); } return 1; } agg-2.5+dfsg1/examples/conv_stroke.cpp0000644000000000000000000001677610703246330020155 0ustar00usergroup00000000000000#include #include #include "agg_basics.h" #include "agg_rendering_buffer.h" #include "agg_rasterizer_scanline_aa.h" #include "agg_conv_stroke.h" #include "agg_conv_dash.h" #include "agg_conv_curve.h" #include "agg_conv_contour.h" #include "agg_conv_smooth_poly1.h" #include "agg_conv_marker.h" #include "agg_arrowhead.h" #include "agg_vcgen_markers_term.h" #include "agg_scanline_p.h" #include "agg_renderer_scanline.h" #include "agg_pixfmt_rgb.h" #include "platform/agg_platform_support.h" #include "ctrl/agg_slider_ctrl.h" #include "ctrl/agg_rbox_ctrl.h" enum flip_y_e { flip_y = true }; class the_application : public agg::platform_support { double m_x[3]; double m_y[3]; double m_dx; double m_dy; int m_idx; agg::rbox_ctrl m_join; agg::rbox_ctrl m_cap; agg::slider_ctrl m_width; agg::slider_ctrl m_miter_limit; public: the_application(agg::pix_format_e format, bool flip_y) : agg::platform_support(format, flip_y), m_idx(-1), m_join(10.0, 10.0, 133.0, 80.0, !flip_y), m_cap(10.0, 80.0 + 10.0, 133.0, 80.0 + 80.0, !flip_y), m_width(130 + 10.0, 10.0 + 4.0, 500.0 - 10.0, 10.0 + 8.0 + 4.0, !flip_y), m_miter_limit(130 + 10.0, 20.0 + 10.0 + 4.0, 500.0 - 10.0, 20.0 + 10.0 + 8.0 + 4.0, !flip_y) { m_x[0] = 57 + 100; m_y[0] = 60; m_x[1] = 369 + 100; m_y[1] = 170; m_x[2] = 143 + 100; m_y[2] = 310; add_ctrl(m_join); m_join.text_size(7.5); m_join.text_thickness(1.0); m_join.add_item("Miter Join"); m_join.add_item("Miter Join Revert"); m_join.add_item("Round Join"); m_join.add_item("Bevel Join"); m_join.cur_item(2); add_ctrl(m_cap); m_cap.add_item("Butt Cap"); m_cap.add_item("Square Cap"); m_cap.add_item("Round Cap"); m_cap.cur_item(2); add_ctrl(m_width); m_width.range(3.0, 40.0); m_width.value(20.0); m_width.label("Width=%1.2f"); add_ctrl(m_miter_limit); m_miter_limit.range(1.0, 10.0); m_miter_limit.value(4.0); m_miter_limit.label("Miter Limit=%1.2f"); m_join.no_transform(); m_cap.no_transform(); m_width.no_transform(); m_miter_limit.no_transform(); } virtual void on_init() { } virtual void on_draw() { typedef agg::renderer_base ren_base; agg::pixfmt_bgr24 pixf(rbuf_window()); ren_base renb(pixf); renb.clear(agg::rgba(1, 1, 1)); agg::rasterizer_scanline_aa<> ras; agg::scanline_p8 sl; agg::path_storage path; path.move_to(m_x[0], m_y[0]); path.line_to((m_x[0] + m_x[1]) / 2, (m_y[0] + m_y[1]) / 2); // This point is added only to check for numerical stability path.line_to(m_x[1], m_y[1]); path.line_to(m_x[2], m_y[2]); path.line_to(m_x[2], m_y[2]); // This point is added only to check for numerical stability path.move_to((m_x[0] + m_x[1]) / 2, (m_y[0] + m_y[1]) / 2); path.line_to((m_x[1] + m_x[2]) / 2, (m_y[1] + m_y[2]) / 2); path.line_to((m_x[2] + m_x[0]) / 2, (m_y[2] + m_y[0]) / 2); path.close_polygon(); agg::line_cap_e cap = agg::butt_cap; if(m_cap.cur_item() == 1) cap = agg::square_cap; if(m_cap.cur_item() == 2) cap = agg::round_cap; agg::line_join_e join = agg::miter_join; if(m_join.cur_item() == 1) join = agg::miter_join_revert; if(m_join.cur_item() == 2) join = agg::round_join; if(m_join.cur_item() == 3) join = agg::bevel_join; // (1) agg::conv_stroke stroke(path); stroke.line_join(join); stroke.line_cap(cap); stroke.miter_limit(m_miter_limit.value()); stroke.width(m_width.value()); ras.add_path(stroke); agg::render_scanlines_aa_solid(ras, sl, renb, agg::rgba(0.8, 0.7, 0.6)); // (1) // (2) agg::conv_stroke poly1(path); poly1.width(1.5); ras.add_path(poly1); agg::render_scanlines_aa_solid(ras, sl, renb, agg::rgba(0,0,0)); // (2) // (3) agg::conv_dash > poly2_dash(stroke); agg::conv_stroke > > poly2(poly2_dash); poly2.miter_limit(4.0); poly2.width(m_width.value() / 5.0); poly2.line_cap(cap); poly2.line_join(join); poly2_dash.add_dash(20.0, m_width.value() / 2.5); ras.add_path(poly2); agg::render_scanlines_aa_solid(ras, sl, renb, agg::rgba(0,0,0.3)); // (3) // (4) ras.add_path(path); agg::render_scanlines_aa_solid(ras, sl, renb, agg::rgba(0.0, 0.0, 0.0, 0.2)); // (4) agg::render_ctrl(ras, sl, renb, m_join); agg::render_ctrl(ras, sl, renb, m_cap); agg::render_ctrl(ras, sl, renb, m_width); agg::render_ctrl(ras, sl, renb, m_miter_limit); } virtual void on_mouse_button_down(int x, int y, unsigned flags) { if(flags & agg::mouse_left) { unsigned i; for (i = 0; i < 3; i++) { if(sqrt( (x-m_x[i]) * (x-m_x[i]) + (y-m_y[i]) * (y-m_y[i]) ) < 20.0) { m_dx = x - m_x[i]; m_dy = y - m_y[i]; m_idx = i; break; } } if(i == 3) { if(agg::point_in_triangle(m_x[0], m_y[0], m_x[1], m_y[1], m_x[2], m_y[2], x, y)) { m_dx = x - m_x[0]; m_dy = y - m_y[0]; m_idx = 3; } } } } virtual void on_mouse_move(int x, int y, unsigned flags) { if(flags & agg::mouse_left) { if(m_idx == 3) { double dx = x - m_dx; double dy = y - m_dy; m_x[1] -= m_x[0] - dx; m_y[1] -= m_y[0] - dy; m_x[2] -= m_x[0] - dx; m_y[2] -= m_y[0] - dy; m_x[0] = dx; m_y[0] = dy; force_redraw(); return; } if(m_idx >= 0) { m_x[m_idx] = x - m_dx; m_y[m_idx] = y - m_dy; force_redraw(); } } else { on_mouse_button_up(x, y, flags); } } virtual void on_mouse_button_up(int x, int y, unsigned flags) { m_idx = -1; } virtual void on_key(int x, int y, unsigned key, unsigned flags) { double dx = 0; double dy = 0; switch(key) { case agg::key_left: dx = -0.1; break; case agg::key_right: dx = 0.1; break; case agg::key_up: dy = 0.1; break; case agg::key_down: dy = -0.1; break; } m_x[0] += dx; m_y[0] += dy; m_x[1] += dx; m_y[1] += dy; force_redraw(); } }; int agg_main(int argc, char* argv[]) { the_application app(agg::pix_format_bgr24, flip_y); app.caption("AGG Example. Line Join"); if(app.init(500, 330, 0)) { return app.run(); } return 1; } agg-2.5+dfsg1/examples/distortions.cpp0000644000000000000000000004677210703246330020201 0ustar00usergroup00000000000000#include #include #include #include "agg_rendering_buffer.h" #include "agg_rasterizer_scanline_aa.h" #include "agg_ellipse.h" #include "agg_trans_affine.h" #include "agg_conv_transform.h" #include "agg_pixfmt_rgb.h" #include "agg_span_allocator.h" #include "agg_span_image_filter_rgb.h" #include "agg_scanline_u.h" #include "agg_renderer_scanline.h" #include "agg_span_interpolator_linear.h" #include "agg_span_interpolator_adaptor.h" #include "agg_span_gradient.h" #include "agg_image_accessors.h" #include "ctrl/agg_slider_ctrl.h" #include "ctrl/agg_rbox_ctrl.h" #include "platform/agg_platform_support.h" enum flip_y_e { flip_y = true }; static agg::int8u g_gradient_colors[] = { 255, 255, 255, 255, 255, 255, 254, 255, 255, 255, 254, 255, 255, 255, 254, 255, 255, 255, 253, 255, 255, 255, 253, 255, 255, 255, 252, 255, 255, 255, 251, 255, 255, 255, 250, 255, 255, 255, 248, 255, 255, 255, 246, 255, 255, 255, 244, 255, 255, 255, 241, 255, 255, 255, 238, 255, 255, 255, 235, 255, 255, 255, 231, 255, 255, 255, 227, 255, 255, 255, 222, 255, 255, 255, 217, 255, 255, 255, 211, 255, 255, 255, 206, 255, 255, 255, 200, 255, 255, 254, 194, 255, 255, 253, 188, 255, 255, 252, 182, 255, 255, 250, 176, 255, 255, 249, 170, 255, 255, 247, 164, 255, 255, 246, 158, 255, 255, 244, 152, 255, 254, 242, 146, 255, 254, 240, 141, 255, 254, 238, 136, 255, 254, 236, 131, 255, 253, 234, 126, 255, 253, 232, 121, 255, 253, 229, 116, 255, 252, 227, 112, 255, 252, 224, 108, 255, 251, 222, 104, 255, 251, 219, 100, 255, 251, 216, 96, 255, 250, 214, 93, 255, 250, 211, 89, 255, 249, 208, 86, 255, 249, 205, 83, 255, 248, 202, 80, 255, 247, 199, 77, 255, 247, 196, 74, 255, 246, 193, 72, 255, 246, 190, 69, 255, 245, 187, 67, 255, 244, 183, 64, 255, 244, 180, 62, 255, 243, 177, 60, 255, 242, 174, 58, 255, 242, 170, 56, 255, 241, 167, 54, 255, 240, 164, 52, 255, 239, 161, 51, 255, 239, 157, 49, 255, 238, 154, 47, 255, 237, 151, 46, 255, 236, 147, 44, 255, 235, 144, 43, 255, 235, 141, 41, 255, 234, 138, 40, 255, 233, 134, 39, 255, 232, 131, 37, 255, 231, 128, 36, 255, 230, 125, 35, 255, 229, 122, 34, 255, 228, 119, 33, 255, 227, 116, 31, 255, 226, 113, 30, 255, 225, 110, 29, 255, 224, 107, 28, 255, 223, 104, 27, 255, 222, 101, 26, 255, 221, 99, 25, 255, 220, 96, 24, 255, 219, 93, 23, 255, 218, 91, 22, 255, 217, 88, 21, 255, 216, 86, 20, 255, 215, 83, 19, 255, 214, 81, 18, 255, 213, 79, 17, 255, 212, 77, 17, 255, 211, 74, 16, 255, 210, 72, 15, 255, 209, 70, 14, 255, 207, 68, 13, 255, 206, 66, 13, 255, 205, 64, 12, 255, 204, 62, 11, 255, 203, 60, 10, 255, 202, 58, 10, 255, 201, 56, 9, 255, 199, 55, 9, 255, 198, 53, 8, 255, 197, 51, 7, 255, 196, 50, 7, 255, 195, 48, 6, 255, 193, 46, 6, 255, 192, 45, 5, 255, 191, 43, 5, 255, 190, 42, 4, 255, 188, 41, 4, 255, 187, 39, 3, 255, 186, 38, 3, 255, 185, 37, 2, 255, 183, 35, 2, 255, 182, 34, 1, 255, 181, 33, 1, 255, 179, 32, 1, 255, 178, 30, 0, 255, 177, 29, 0, 255, 175, 28, 0, 255, 174, 27, 0, 255, 173, 26, 0, 255, 171, 25, 0, 255, 170, 24, 0, 255, 168, 23, 0, 255, 167, 22, 0, 255, 165, 21, 0, 255, 164, 21, 0, 255, 163, 20, 0, 255, 161, 19, 0, 255, 160, 18, 0, 255, 158, 17, 0, 255, 156, 17, 0, 255, 155, 16, 0, 255, 153, 15, 0, 255, 152, 14, 0, 255, 150, 14, 0, 255, 149, 13, 0, 255, 147, 12, 0, 255, 145, 12, 0, 255, 144, 11, 0, 255, 142, 11, 0, 255, 140, 10, 0, 255, 139, 10, 0, 255, 137, 9, 0, 255, 135, 9, 0, 255, 134, 8, 0, 255, 132, 8, 0, 255, 130, 7, 0, 255, 128, 7, 0, 255, 126, 6, 0, 255, 125, 6, 0, 255, 123, 5, 0, 255, 121, 5, 0, 255, 119, 4, 0, 255, 117, 4, 0, 255, 115, 4, 0, 255, 113, 3, 0, 255, 111, 3, 0, 255, 109, 2, 0, 255, 107, 2, 0, 255, 105, 2, 0, 255, 103, 1, 0, 255, 101, 1, 0, 255, 99, 1, 0, 255, 97, 0, 0, 255, 95, 0, 0, 255, 93, 0, 0, 255, 91, 0, 0, 255, 90, 0, 0, 255, 88, 0, 0, 255, 86, 0, 0, 255, 84, 0, 0, 255, 82, 0, 0, 255, 80, 0, 0, 255, 78, 0, 0, 255, 77, 0, 0, 255, 75, 0, 0, 255, 73, 0, 0, 255, 72, 0, 0, 255, 70, 0, 0, 255, 68, 0, 0, 255, 67, 0, 0, 255, 65, 0, 0, 255, 64, 0, 0, 255, 63, 0, 0, 255, 61, 0, 0, 255, 60, 0, 0, 255, 59, 0, 0, 255, 58, 0, 0, 255, 57, 0, 0, 255, 56, 0, 0, 255, 55, 0, 0, 255, 54, 0, 0, 255, 53, 0, 0, 255, 53, 0, 0, 255, 52, 0, 0, 255, 52, 0, 0, 255, 51, 0, 0, 255, 51, 0, 0, 255, 51, 0, 0, 255, 50, 0, 0, 255, 50, 0, 0, 255, 51, 0, 0, 255, 51, 0, 0, 255, 51, 0, 0, 255, 51, 0, 0, 255, 52, 0, 0, 255, 52, 0, 0, 255, 53, 0, 0, 255, 54, 1, 0, 255, 55, 2, 0, 255, 56, 3, 0, 255, 57, 4, 0, 255, 58, 5, 0, 255, 59, 6, 0, 255, 60, 7, 0, 255, 62, 8, 0, 255, 63, 9, 0, 255, 64, 11, 0, 255, 66, 12, 0, 255, 68, 13, 0, 255, 69, 14, 0, 255, 71, 16, 0, 255, 73, 17, 0, 255, 75, 18, 0, 255, 77, 20, 0, 255, 79, 21, 0, 255, 81, 23, 0, 255, 83, 24, 0, 255, 85, 26, 0, 255, 87, 28, 0, 255, 90, 29, 0, 255, 92, 31, 0, 255, 94, 33, 0, 255, 97, 34, 0, 255, 99, 36, 0, 255, 102, 38, 0, 255, 104, 40, 0, 255, 107, 41, 0, 255, 109, 43, 0, 255, 112, 45, 0, 255, 115, 47, 0, 255, 117, 49, 0, 255, 120, 51, 0, 255, 123, 52, 0, 255, 126, 54, 0, 255, 128, 56, 0, 255, 131, 58, 0, 255, 134, 60, 0, 255, 137, 62, 0, 255, 140, 64, 0, 255, 143, 66, 0, 255, 145, 68, 0, 255, 148, 70, 0, 255, 151, 72, 0, 255, 154, 74, 0, 255 }; class periodic_distortion { public: periodic_distortion() : m_cx(0.0), m_cy(0.0), m_period(0.5), m_amplitude(0.5), m_phase(0.0) {} void center(double x, double y) { m_cx = x; m_cy = y; } void period(double v) { m_period = v; } void amplitude(double v) { m_amplitude = 1.0 / v; } void phase(double v) { m_phase = v; } virtual void calculate(int* x, int* y) const = 0; protected: double m_cx; double m_cy; double m_period; double m_amplitude; double m_phase; }; inline void calculate_wave(int* x, int* y, double cx, double cy, double period, double amplitude, double phase) { double xd = double(*x) / agg::image_subpixel_scale - cx; double yd = double(*y) / agg::image_subpixel_scale - cy; double d = sqrt(xd*xd + yd*yd); if(d > 1) { double a = cos(d / (16.0 * period) - phase) * (1.0 / (amplitude * d)) + 1.0; *x = int((xd * a + cx) * agg::image_subpixel_scale); *y = int((yd * a + cy) * agg::image_subpixel_scale); } } inline void calculate_swirl(int* x, int* y, double cx, double cy, double amplitude, double phase) { double xd = double(*x) / agg::image_subpixel_scale - cx; double yd = double(*y) / agg::image_subpixel_scale - cy; double a = double(100.0 - sqrt(xd * xd + yd * yd)) / 100.0 * (0.1 / -amplitude); double sa = sin(a - phase/25.0); double ca = cos(a - phase/25.0); *x = int((xd * ca - yd * sa + cx) * agg::image_subpixel_scale); *y = int((xd * sa + yd * ca + cy) * agg::image_subpixel_scale); } class distortion_wave : public periodic_distortion { virtual void calculate(int* x, int* y) const { calculate_wave(x, y, m_cx, m_cy, m_period, m_amplitude, m_phase); } }; class distortion_swirl : public periodic_distortion { virtual void calculate(int* x, int* y) const { calculate_swirl(x, y, m_cx, m_cy, m_amplitude, m_phase); } }; class distortion_swirl_wave : public periodic_distortion { virtual void calculate(int* x, int* y) const { calculate_swirl(x, y, m_cx, m_cy, m_amplitude, m_phase); calculate_wave(x, y, m_cx, m_cy, m_period, m_amplitude, m_phase); } }; class distortion_wave_swirl : public periodic_distortion { virtual void calculate(int* x, int* y) const { calculate_wave(x, y, m_cx, m_cy, m_period, m_amplitude, m_phase); calculate_swirl(x, y, m_cx, m_cy, m_amplitude, m_phase); } }; class the_application : public agg::platform_support { agg::slider_ctrl m_angle; agg::slider_ctrl m_scale; agg::slider_ctrl m_amplitude; agg::slider_ctrl m_period; agg::rbox_ctrl m_distortion; double m_center_x; double m_center_y; double m_phase; typedef agg::pod_auto_array color_array_type; color_array_type m_gradient_colors; public: the_application(agg::pix_format_e format, bool flip_y) : agg::platform_support(format, flip_y), m_angle (5, 5, 150, 12, !flip_y), m_scale (5, 5+15, 150, 12+15, !flip_y), m_period (5+170, 5, 150+170, 12, !flip_y), m_amplitude (5+170, 5+15, 150+170, 12+15, !flip_y), m_distortion(480, 5, 600, 90, !flip_y), m_center_x(0.0), m_center_y(0.0), m_phase(0.0) { add_ctrl(m_angle); add_ctrl(m_scale); add_ctrl(m_amplitude); add_ctrl(m_period); add_ctrl(m_distortion); m_angle.label("Angle=%3.2f"); m_scale.label("Scale=%3.2f"); m_angle.range(-180.0, 180.0); m_angle.value(20.0); m_scale.range(0.1, 5.0); m_scale.value(1.0); m_amplitude.label("Amplitude=%3.2f"); m_period.label("Period=%3.2f"); m_amplitude.range(0.1, 40.0); m_period.range(0.1, 2.0); m_amplitude.value(10.0); m_period.value(1.0); m_distortion.add_item("Wave"); m_distortion.add_item("Swirl"); m_distortion.add_item("Wave-Swirl"); m_distortion.add_item("Swirl-Wave"); m_distortion.cur_item(0); unsigned i; const agg::int8u* p = g_gradient_colors; for(i = 0; i < 256; i++) { m_gradient_colors[i] = agg::rgba8(p[0], p[1], p[2], p[3]); p += 4; } } virtual ~the_application() { } virtual void on_init() { m_center_x = rbuf_img(0).width() / 2.0 + 10; m_center_y = rbuf_img(0).height() / 2.0 + 10 + 40; } virtual void on_draw() { double img_width = rbuf_img(0).width(); double img_height = rbuf_img(0).height(); typedef agg::pixfmt_bgr24 pixfmt; typedef agg::renderer_base renderer_base; pixfmt pixf(rbuf_window()); pixfmt img_pixf(rbuf_img(0)); renderer_base rb(pixf); rb.clear(agg::rgba(1.0, 1.0, 1.0)); agg::trans_affine src_mtx; src_mtx *= agg::trans_affine_translation(-img_width/2, -img_height/2); src_mtx *= agg::trans_affine_rotation(m_angle.value() * agg::pi / 180.0); src_mtx *= agg::trans_affine_translation(img_width/2 + 10, img_height/2 + 10 + 40); src_mtx *= trans_affine_resizing(); agg::trans_affine img_mtx; img_mtx *= agg::trans_affine_translation(-img_width/2, -img_height/2); img_mtx *= agg::trans_affine_rotation(m_angle.value() * agg::pi / 180.0); img_mtx *= agg::trans_affine_scaling(m_scale.value()); img_mtx *= agg::trans_affine_translation(img_width/2 + 10, img_height/2 + 10 + 40); img_mtx *= trans_affine_resizing(); img_mtx.invert(); typedef agg::span_allocator span_alloc_type; span_alloc_type sa; typedef agg::span_interpolator_adaptor, periodic_distortion> interpolator_type; periodic_distortion* dist = 0; distortion_wave dist_wave; distortion_swirl dist_swirl; distortion_wave_swirl dist_wave_swirl; distortion_swirl_wave dist_swirl_wave; switch(m_distortion.cur_item()) { case 0: dist = &dist_wave; break; case 1: dist = &dist_swirl; break; case 2: dist = &dist_wave_swirl; break; case 3: dist = &dist_swirl_wave; break; } dist->period(m_period.value()); dist->amplitude(m_amplitude.value()); dist->phase(m_phase); double cx = m_center_x; double cy = m_center_y; img_mtx.transform(&cx, &cy); dist->center(cx, cy); interpolator_type interpolator(img_mtx, *dist); typedef agg::image_accessor_clip img_source_type; img_source_type img_src(img_pixf, agg::rgba(1,1,1)); /* // Version without filtering (nearest neighbor) //------------------------------------------ typedef agg::span_image_filter_rgb_nn span_gen_type; span_gen_type sg(img_src, interpolator); //------------------------------------------ */ // Version with "hardcoded" bilinear filter and without // image_accessor (direct filter, the old variant) //------------------------------------------ typedef agg::span_image_filter_rgb_bilinear_clip span_gen_type; span_gen_type sg(img_pixf, agg::rgba(1,1,1), interpolator); //------------------------------------------ /* // Version with arbitrary 2x2 filter //------------------------------------------ typedef agg::span_image_filter_rgb_2x2 span_gen_type; agg::image_filter filter; span_gen_type sg(img_src, interpolator, filter); //------------------------------------------ */ /* // Version with arbitrary filter //------------------------------------------ typedef agg::span_image_filter_rgb span_gen_type; agg::image_filter filter; span_gen_type sg(img_src, interpolator, filter); //------------------------------------------ */ agg::rasterizer_scanline_aa<> ras; agg::scanline_u8 sl; double r = img_width; if(img_height < r) r = img_height; agg::ellipse ell(img_width / 2.0, img_height / 2.0, r / 2.0 - 20.0, r / 2.0 - 20.0, 200); agg::conv_transform tr(ell, src_mtx); ras.add_path(tr); agg::render_scanlines_aa(ras, sl, rb, sa, sg); src_mtx *= ~trans_affine_resizing(); src_mtx *= agg::trans_affine_translation(img_width - img_width/10, 0.0); src_mtx *= trans_affine_resizing(); ras.add_path(tr); agg::render_scanlines_aa_solid(ras, sl, rb, agg::rgba8(0,0,0)); typedef agg::span_gradient gradient_span_gen; agg::gradient_circle gradient_function; color_array_type gradient_colors(m_gradient_colors); gradient_span_gen span_gradient(interpolator, gradient_function, gradient_colors, 0, 180); agg::trans_affine gr1_mtx; gr1_mtx *= agg::trans_affine_translation(-img_width/2, -img_height/2); gr1_mtx *= agg::trans_affine_scaling(0.8); gr1_mtx *= agg::trans_affine_rotation(m_angle.value() * agg::pi / 180.0); gr1_mtx *= agg::trans_affine_translation(img_width - img_width/10 + img_width/2 + 10, img_height/2 + 10 + 40); gr1_mtx *= trans_affine_resizing(); agg::trans_affine gr2_mtx; gr2_mtx *= agg::trans_affine_rotation(m_angle.value() * agg::pi / 180.0); gr2_mtx *= agg::trans_affine_scaling(m_scale.value()); gr2_mtx *= agg::trans_affine_translation(img_width - img_width/10 + img_width/2 + 10 + 50, img_height/2 + 10 + 40 + 50); gr2_mtx *= trans_affine_resizing(); gr2_mtx.invert(); cx = m_center_x + img_width - img_width/10; cy = m_center_y; gr2_mtx.transform(&cx, &cy); dist->center(cx, cy); interpolator.transformer(gr2_mtx); agg::conv_transform tr2(ell, gr1_mtx); ras.add_path(tr2); agg::render_scanlines_aa(ras, sl, rb, sa, span_gradient); agg::render_ctrl(ras, sl, rb, m_angle); agg::render_ctrl(ras, sl, rb, m_scale); agg::render_ctrl(ras, sl, rb, m_amplitude); agg::render_ctrl(ras, sl, rb, m_period); agg::render_ctrl(ras, sl, rb, m_distortion); } virtual void on_mouse_button_down(int x, int y, unsigned flags) { if(flags) { m_center_x = x; m_center_y = y; force_redraw(); } } virtual void on_mouse_move(int x, int y, unsigned flags) { if(flags & 1) { m_center_x = x; m_center_y = y; force_redraw(); } } virtual void on_idle() { m_phase += 15.0 * agg::pi / 180.0; if(m_phase > agg::pi * 200.0) m_phase -= agg::pi * 200.0; force_redraw(); } }; int agg_main(int argc, char* argv[]) { the_application app(agg::pix_format_bgr24, flip_y); app.caption("Image and Gradient Distortions"); const char* img_name = "spheres"; if(argc >= 2) img_name = argv[1]; if(!app.load_img(0, img_name)) { char buf[256]; if(strcmp(img_name, "spheres") == 0) { sprintf(buf, "File not found: %s%s. Download http://www.antigrain.com/%s%s\n" "or copy it from another directory if available.", img_name, app.img_ext(), img_name, app.img_ext()); } else { sprintf(buf, "File not found: %s%s", img_name, app.img_ext()); } app.message(buf); return 1; } if(app.init(app.rbuf_img(0).width() + 300, app.rbuf_img(0).height() + 40 + 20, agg::window_resize)) { app.wait_mode(false); return app.run(); } return 0; } agg-2.5+dfsg1/examples/flash_rasterizer.cpp0000644000000000000000000003666610703246330021170 0ustar00usergroup00000000000000#include #include #include #include #include "agg_rendering_buffer.h" #include "agg_trans_viewport.h" #include "agg_path_storage.h" #include "agg_conv_transform.h" #include "agg_conv_curve.h" #include "agg_conv_stroke.h" #include "agg_gsv_text.h" #include "agg_scanline_u.h" #include "agg_scanline_bin.h" #include "agg_renderer_scanline.h" #include "agg_rasterizer_scanline_aa.h" #include "agg_rasterizer_compound_aa.h" #include "agg_span_allocator.h" #include "agg_gamma_lut.h" #include "agg_pixfmt_rgba.h" #include "agg_bounding_rect.h" #include "agg_color_gray.h" #include "platform/agg_platform_support.h" enum { flip_y = false }; typedef agg::pixfmt_bgra32_pre pixfmt; namespace agg { struct path_style { unsigned path_id; int left_fill; int right_fill; int line; }; class compound_shape { public: ~compound_shape() { if(m_fd) { fclose(m_fd); } } compound_shape() : m_path(), m_affine(), m_curve(m_path), m_trans(m_curve, m_affine), m_styles() {} bool open(const char* fname) { m_fd = fopen(fname, "r"); return m_fd != 0; } bool read_next() { m_path.remove_all(); m_styles.remove_all(); const char space[] = " \t\n\r"; double ax, ay, cx, cy; if(m_fd) { char buf[1024]; char* ts; for(;;) { if(fgets(buf, 1022, m_fd) == 0) return false; if(buf[0] == '=') break; } while(fgets(buf, 1022, m_fd)) { if(buf[0] == '!') break; if(buf[0] == 'P') { // BeginPath path_style style; style.path_id = m_path.start_new_path(); ts = strtok(buf, space); // Path; ts = strtok(0, space); // left_style style.left_fill = atoi(ts); ts = strtok(0, space); // right_style style.right_fill = atoi(ts); ts = strtok(0, space); // line_style style.line = atoi(ts); ts = strtok(0, space); // ax ax = atof(ts); ts = strtok(0, space); // ay ay = atof(ts); m_path.move_to(ax, ay); m_styles.add(style); } if(buf[0] == 'C') { ts = strtok(buf, space); // Curve; ts = strtok(0, space); // cx cx = atof(ts); ts = strtok(0, space); // cy cy = atof(ts); ts = strtok(0, space); // ax ax = atof(ts); ts = strtok(0, space); // ay ay = atof(ts); m_path.curve3(cx, cy, ax, ay); } if(buf[0] == 'L') { ts = strtok(buf, space); // Line; ts = strtok(0, space); // ax ax = atof(ts); ts = strtok(0, space); // ay ay = atof(ts); m_path.line_to(ax, ay); } if(buf[0] == '<') { // EndPath } } return true; } return false; } unsigned operator [] (unsigned i) const { return m_styles[i].path_id; } unsigned paths() const { return m_styles.size(); } const path_style& style(unsigned i) const { return m_styles[i]; } void rewind(unsigned path_id) { m_trans.rewind(path_id); } unsigned vertex(double* x, double* y) { return m_trans.vertex(x, y); } double scale() const { return m_affine.scale(); } void scale(double w, double h) { m_affine.reset(); double x1, y1, x2, y2; bounding_rect(m_path, *this, 0, m_styles.size(), &x1, &y1, &x2, &y2); if(x1 < x2 && y1 < y2) { trans_viewport vp; vp.preserve_aspect_ratio(0.5, 0.5, aspect_ratio_meet); vp.world_viewport(x1, y1, x2, y2); vp.device_viewport(0, 0, w, h); m_affine = vp.to_affine(); } m_curve.approximation_scale(m_affine.scale()); } void approximation_scale(double s) { m_curve.approximation_scale(m_affine.scale() * s); } int hit_test(double x, double y, double r) { m_affine.inverse_transform(&x, &y); r /= m_affine.scale(); unsigned i; for(i = 0; i < m_path.total_vertices(); i++) { double vx, vy; unsigned cmd = m_path.vertex(i, &vx, &vy); if(is_vertex(cmd)) { if(calc_distance(x, y, vx, vy) <= r) { return i; } } } return -1; } void modify_vertex(unsigned i, double x, double y) { m_affine.inverse_transform(&x, &y); m_path.modify_vertex(i, x, y); } private: path_storage m_path; trans_affine m_affine; conv_curve m_curve; conv_transform > m_trans; pod_bvector m_styles; double m_x1, m_y1, m_x2, m_y2; FILE* m_fd; }; // Testing class, color provider and span generator //------------------------------------------------- class test_styles { public: test_styles(const rgba8* solid_colors, const rgba8* gradient) : m_solid_colors(solid_colors), m_gradient(gradient) {} // Suppose that style=1 is a gradient //--------------------------------------------- bool is_solid(unsigned style) const { return true;//style != 1; } // Just returns a color //--------------------------------------------- const rgba8& color(unsigned style) const { return m_solid_colors[style]; } // Generate span. In our test case only one style (style=1) // can be a span generator, so that, parameter "style" // isn't used here. //--------------------------------------------- void generate_span(rgba8* span, int x, int y, unsigned len, unsigned style) { memcpy(span, m_gradient + x, sizeof(rgba8) * len); } private: const rgba8* m_solid_colors; const rgba8* m_gradient; }; } class the_application : public agg::platform_support { public: agg::compound_shape m_shape; agg::rgba8 m_colors[100]; agg::trans_affine m_scale; agg::gamma_lut<> m_gamma; agg::pod_array m_gradient; int m_point_idx; int m_hit_x; int m_hit_y; the_application(agg::pix_format_e format, bool flip_y) : agg::platform_support(format, flip_y), m_point_idx(-1), m_hit_x(-1), m_hit_y(-1) { m_gamma.gamma(2.0); for(unsigned i = 0; i < 100; i++) { m_colors[i] = agg::rgba8( (rand() & 0xFF), (rand() & 0xFF), (rand() & 0xFF), 230); m_colors[i].apply_gamma_dir(m_gamma); m_colors[i].premultiply(); } } bool open(const char* fname) { return m_shape.open(full_file_name(fname)); } void read_next() { m_shape.read_next(); m_shape.scale(width(), height()); } virtual void on_draw() { typedef agg::renderer_base renderer_base; typedef agg::renderer_scanline_aa_solid renderer_scanline; typedef agg::scanline_u8 scanline; pixfmt pixf(rbuf_window()); renderer_base ren_base(pixf); ren_base.clear(agg::rgba(1.0, 1.0, 0.95)); renderer_scanline ren(ren_base); unsigned i; unsigned w = unsigned(width()); m_gradient.resize(w); agg::rgba8 c1(255, 0, 0, 180); agg::rgba8 c2(0, 0, 255, 180); for(i = 0; i < w; i++) { m_gradient[i] = c1.gradient(c2, i / width()); m_gradient[i].premultiply(); } agg::rasterizer_scanline_aa ras; agg::rasterizer_compound_aa rasc; agg::scanline_u8 sl; agg::scanline_bin sl_bin; agg::conv_transform shape(m_shape, m_scale); agg::conv_stroke > stroke(shape); agg::test_styles style_handler(m_colors, m_gradient.data()); agg::span_allocator alloc; m_shape.approximation_scale(m_scale.scale()); // Fill shape //---------------------- rasc.clip_box(0, 0, width(), height()); rasc.reset(); //rasc.filling_rule(agg::fill_even_odd); start_timer(); for(i = 0; i < m_shape.paths(); i++) { if(m_shape.style(i).left_fill >= 0 || m_shape.style(i).right_fill >= 0) { rasc.styles(m_shape.style(i).left_fill, m_shape.style(i).right_fill); rasc.add_path(shape, m_shape.style(i).path_id); } } agg::render_scanlines_compound(rasc, sl, sl_bin, ren_base, alloc, style_handler); double tfill = elapsed_time(); // Hit-test test bool draw_strokes = true; if(m_hit_x >= 0 && m_hit_y >= 0) { if(rasc.hit_test(m_hit_x, m_hit_y)) { draw_strokes = false; } } // Draw strokes //---------------------- start_timer(); if(draw_strokes) { ras.clip_box(0, 0, width(), height()); stroke.width(sqrt(m_scale.scale())); stroke.line_join(agg::round_join); stroke.line_cap(agg::round_cap); for(i = 0; i < m_shape.paths(); i++) { ras.reset(); if(m_shape.style(i).line >= 0) { ras.add_path(stroke, m_shape.style(i).path_id); ren.color(agg::rgba8(0,0,0, 128)); agg::render_scanlines(ras, sl, ren); } } } double tstroke = elapsed_time(); char buf[256]; agg::gsv_text t; t.size(8.0); t.flip(true); agg::conv_stroke ts(t); ts.width(1.6); ts.line_cap(agg::round_cap); sprintf(buf, "Fill=%.2fms (%dFPS) Stroke=%.2fms (%dFPS) Total=%.2fms (%dFPS)\n\n" "Space: Next Shape\n\n" "+/- : ZoomIn/ZoomOut (with respect to the mouse pointer)", tfill, int(1000.0 / tfill), tstroke, int(1000.0 / tstroke), tfill+tstroke, int(1000.0 / (tfill+tstroke))); t.start_point(10.0, 20.0); t.text(buf); ras.add_path(ts); ren.color(agg::rgba(0,0,0)); agg::render_scanlines(ras, sl, ren); if(m_gamma.gamma() != 1.0) { pixf.apply_gamma_inv(m_gamma); } } virtual void on_key(int x, int y, unsigned key, unsigned flags) { if(key == ' ') { m_shape.read_next(); m_shape.scale(width(), height()); force_redraw(); } if(key == '+' || key == agg::key_kp_plus) { m_scale *= agg::trans_affine_translation(-x, -y); m_scale *= agg::trans_affine_scaling(1.1); m_scale *= agg::trans_affine_translation(x, y); force_redraw(); } if(key == '-' || key == agg::key_kp_minus) { m_scale *= agg::trans_affine_translation(-x, -y); m_scale *= agg::trans_affine_scaling(1/1.1); m_scale *= agg::trans_affine_translation(x, y); force_redraw(); } if(key == agg::key_left) { m_scale *= agg::trans_affine_translation(-x, -y); m_scale *= agg::trans_affine_rotation(-agg::pi / 20.0); m_scale *= agg::trans_affine_translation(x, y); force_redraw(); } if(key == agg::key_right) { m_scale *= agg::trans_affine_translation(-x, -y); m_scale *= agg::trans_affine_rotation(agg::pi / 20.0); m_scale *= agg::trans_affine_translation(x, y); force_redraw(); } } void on_mouse_move(int x, int y, unsigned flags) { if((flags & 3) == 0) { on_mouse_button_up(x, y, flags); } else { if(m_point_idx >= 0) { double xd = x; double yd = y; m_scale.inverse_transform(&xd, &yd); m_shape.modify_vertex(m_point_idx, xd, yd); force_redraw(); } } } void on_mouse_button_down(int x, int y, unsigned flags) { if(flags & 1) { double xd = x; double yd = y; double r = 4.0 / m_scale.scale(); m_scale.inverse_transform(&xd, &yd); m_point_idx = m_shape.hit_test(xd, yd, r); force_redraw(); } if(flags & 2) { m_hit_x = x; m_hit_y = y; force_redraw(); } } void on_mouse_button_up(int x, int y, unsigned flags) { m_point_idx = -1; m_hit_x = -1; m_hit_y = -1; force_redraw(); } }; int agg_main(int argc, char* argv[]) { the_application app(agg::pix_format_bgra32, flip_y); app.caption("AGG Example - Flash Rasterizer"); const char* fname = "shapes.txt"; if(argc > 1) fname = argv[1]; if(!app.open(fname)) { char buf[256]; if(strcmp(fname, "shapes.txt") == 0) { sprintf(buf, "File not found: %s. Download http://www.antigrain.com/%s\n" "or copy it from another directory if available.", fname, fname); } else { sprintf(buf, "File not found: %s", fname); } app.message(buf); return 1; } if(app.init(655, 520, agg::window_resize)) { app.read_next(); return app.run(); } return 1; } agg-2.5+dfsg1/examples/flash_rasterizer2.cpp0000644000000000000000000004006510703246330021236 0ustar00usergroup00000000000000#include #include #include #include "agg_rendering_buffer.h" #include "agg_trans_viewport.h" #include "agg_path_storage.h" #include "agg_conv_transform.h" #include "agg_conv_curve.h" #include "agg_conv_stroke.h" #include "agg_gsv_text.h" #include "agg_scanline_u.h" #include "agg_scanline_bin.h" #include "agg_renderer_scanline.h" #include "agg_rasterizer_outline_aa.h" #include "agg_rasterizer_scanline_aa.h" #include "agg_span_allocator.h" #include "agg_gamma_lut.h" #include "agg_pixfmt_rgba.h" #include "agg_bounding_rect.h" #include "platform/agg_platform_support.h" enum { flip_y = false }; typedef agg::pixfmt_bgra32_pre pixfmt; namespace agg { struct path_style { unsigned path_id; int left_fill; int right_fill; int line; }; class compound_shape { public: ~compound_shape() { if(m_fd) { fclose(m_fd); } } compound_shape() : m_path(), m_affine(), m_curve(m_path), m_trans(m_curve, m_affine), m_styles(), m_min_style(0x7FFFFFFF), m_max_style(-0x7FFFFFFF) {} bool open(const char* fname) { m_fd = fopen(fname, "r"); return m_fd != 0; } bool read_next() { m_path.remove_all(); m_styles.remove_all(); m_min_style = 0x7FFFFFFF; m_max_style = -0x7FFFFFFF; const char space[] = " \t\n\r"; double ax, ay, cx, cy; if(m_fd) { char buf[1024]; char* ts; for(;;) { if(fgets(buf, 1022, m_fd) == 0) return false; if(buf[0] == '=') break; } while(fgets(buf, 1022, m_fd)) { if(buf[0] == '!') break; if(buf[0] == 'P') { // BeginPath path_style style; style.path_id = m_path.start_new_path(); ts = strtok(buf, space); // Path; ts = strtok(0, space); // left_style style.left_fill = atoi(ts); ts = strtok(0, space); // right_style style.right_fill = atoi(ts); ts = strtok(0, space); // line_style style.line = atoi(ts); ts = strtok(0, space); // ax ax = atof(ts); ts = strtok(0, space); // ay ay = atof(ts); m_path.move_to(ax, ay); m_styles.add(style); if(style.left_fill >= 0) { if(style.left_fill < m_min_style) m_min_style = style.left_fill; if(style.left_fill > m_max_style) m_max_style = style.left_fill; } if(style.right_fill >= 0) { if(style.right_fill < m_min_style) m_min_style = style.right_fill; if(style.right_fill > m_max_style) m_max_style = style.right_fill; } } if(buf[0] == 'C') { ts = strtok(buf, space); // Curve; ts = strtok(0, space); // cx cx = atof(ts); ts = strtok(0, space); // cy cy = atof(ts); ts = strtok(0, space); // ax ax = atof(ts); ts = strtok(0, space); // ay ay = atof(ts); m_path.curve3(cx, cy, ax, ay); } if(buf[0] == 'L') { ts = strtok(buf, space); // Line; ts = strtok(0, space); // ax ax = atof(ts); ts = strtok(0, space); // ay ay = atof(ts); m_path.line_to(ax, ay); } if(buf[0] == '<') { // EndPath } } return true; } return false; } unsigned operator [] (unsigned i) const { return m_styles[i].path_id; } unsigned paths() const { return m_styles.size(); } const path_style& style(unsigned i) const { return m_styles[i]; } int min_style() const { return m_min_style; } int max_style() const { return m_max_style; } void rewind(unsigned path_id) { m_trans.rewind(path_id); } unsigned vertex(double* x, double* y) { return m_trans.vertex(x, y); } double scale() const { return m_affine.scale(); } void scale(double w, double h) { m_affine.reset(); double x1, y1, x2, y2; bounding_rect(m_path, *this, 0, m_styles.size(), &x1, &y1, &x2, &y2); if(x1 < x2 && y1 < y2) { trans_viewport vp; vp.preserve_aspect_ratio(0.5, 0.5, aspect_ratio_meet); vp.world_viewport(x1, y1, x2, y2); vp.device_viewport(0, 0, w, h); m_affine = vp.to_affine(); } m_curve.approximation_scale(m_affine.scale()); } void approximation_scale(double s) { m_curve.approximation_scale(m_affine.scale() * s); } int hit_test(double x, double y, double r) { m_affine.inverse_transform(&x, &y); r /= m_affine.scale(); unsigned i; for(i = 0; i < m_path.total_vertices(); i++) { double vx, vy; unsigned cmd = m_path.vertex(i, &vx, &vy); if(is_vertex(cmd)) { if(calc_distance(x, y, vx, vy) <= r) { return i; } } } return -1; } void modify_vertex(unsigned i, double x, double y) { m_affine.inverse_transform(&x, &y); m_path.modify_vertex(i, x, y); } private: path_storage m_path; trans_affine m_affine; conv_curve m_curve; conv_transform > m_trans; pod_bvector m_styles; double m_x1, m_y1, m_x2, m_y2; int m_min_style; int m_max_style; FILE* m_fd; }; } class the_application : public agg::platform_support { public: agg::compound_shape m_shape; agg::rgba8 m_colors[100]; agg::trans_affine m_scale; agg::gamma_lut<> m_gamma; int m_point_idx; the_application(agg::pix_format_e format, bool flip_y) : agg::platform_support(format, flip_y), m_point_idx(-1) { m_gamma.gamma(2.0); for(unsigned i = 0; i < 100; i++) { m_colors[i] = agg::rgba8( (rand() & 0xFF), (rand() & 0xFF), (rand() & 0xFF), 230); m_colors[i].apply_gamma_dir(m_gamma); m_colors[i].premultiply(); } } bool open(const char* fname) { return m_shape.open(full_file_name(fname)); } void read_next() { m_shape.read_next(); m_shape.scale(width(), height()); } virtual void on_draw() { typedef agg::renderer_base renderer_base; typedef agg::renderer_scanline_aa_solid renderer_scanline; typedef agg::scanline_u8 scanline; pixfmt pixf(rbuf_window()); renderer_base ren_base(pixf); ren_base.clear(agg::rgba(1.0, 1.0, 0.95)); renderer_scanline ren(ren_base); agg::rasterizer_scanline_aa ras; agg::scanline_u8 sl; agg::conv_transform shape(m_shape, m_scale); agg::conv_stroke > stroke(shape); m_shape.approximation_scale(m_scale.scale()); unsigned i; agg::path_storage tmp_path; ras.clip_box(0, 0, width(), height()); // This is an alternative method of Flash rasterization. // We decompose the compound shape into separate paths // and select the ones that fit the given style (left or right). // So that, we form a sub-shape and draw it as a whole. // // Here the regular scanline rasterizer is used, but it doesn't // automatically close the polygons. So that, the rasterizer // actually works with a set of polylines instead of polygons. // Of course, the data integrity must be preserved, that is, // the polylines must eventually form a closed contour // (or a set of closed contours). So that, first we set // auto_close(false); // // The second important thing is that one path can be rasterized // twice, if it has both, left and right fill. Sometimes the // path has equal left and right fill, so that, the same path // will be added twice even for a single sub-shape. If the // rasterizer can tolerate these degenerates you can add them, // but it's also fine just to omit them. // // The third thing is that for one side (left or right) // you should invert the direction of the paths. // // The main disadvantage of this method is imperfect stitching // of the adjacent polygons. The problem can be solved if we use // compositing operation "plus" instead of alpha-blend. But // in this case we are forced to use an RGBA buffer, clean it with // zero, rasterize using "plus" operation, and then alpha-blend // the result over the final scene. It can be too expensive. //------------------------------------------------------------ ras.auto_close(false); //ras.filling_rule(agg::fill_even_odd); start_timer(); for(int s = m_shape.min_style(); s <= m_shape.max_style(); s++) { ras.reset(); for(i = 0; i < m_shape.paths(); i++) { const agg::path_style& style = m_shape.style(i); if(style.left_fill != style.right_fill) { if(style.left_fill == s) { ras.add_path(shape, style.path_id); } if(style.right_fill == s) { tmp_path.remove_all(); tmp_path.concat_path(shape, style.path_id); tmp_path.invert_polygon(0); ras.add_path(tmp_path); } } } agg::render_scanlines_aa_solid(ras, sl, ren_base, m_colors[s]); } double tfill = elapsed_time(); ras.auto_close(true); // Draw strokes //---------------------- start_timer(); stroke.width(sqrt(m_scale.scale())); stroke.line_join(agg::round_join); stroke.line_cap(agg::round_cap); for(i = 0; i < m_shape.paths(); i++) { ras.reset(); if(m_shape.style(i).line >= 0) { ras.add_path(stroke, m_shape.style(i).path_id); ren.color(agg::rgba8(0,0,0, 128)); agg::render_scanlines(ras, sl, ren); } } double tstroke = elapsed_time(); char buf[256]; agg::gsv_text t; t.size(8.0); t.flip(true); agg::conv_stroke ts(t); ts.width(1.6); ts.line_cap(agg::round_cap); sprintf(buf, "Fill=%.2fms (%dFPS) Stroke=%.2fms (%dFPS) Total=%.2fms (%dFPS)\n\n" "Space: Next Shape\n\n" "+/- : ZoomIn/ZoomOut (with respect to the mouse pointer)", tfill, int(1000.0 / tfill), tstroke, int(1000.0 / tstroke), tfill+tstroke, int(1000.0 / (tfill+tstroke))); t.start_point(10.0, 20.0); t.text(buf); ras.add_path(ts); ren.color(agg::rgba(0,0,0)); agg::render_scanlines(ras, sl, ren); if(m_gamma.gamma() != 1.0) { pixf.apply_gamma_inv(m_gamma); } } virtual void on_key(int x, int y, unsigned key, unsigned flags) { if(key == ' ') { m_shape.read_next(); m_shape.scale(width(), height()); force_redraw(); } if(key == '+' || key == agg::key_kp_plus) { m_scale *= agg::trans_affine_translation(-x, -y); m_scale *= agg::trans_affine_scaling(1.1); m_scale *= agg::trans_affine_translation(x, y); force_redraw(); } if(key == '-' || key == agg::key_kp_minus) { m_scale *= agg::trans_affine_translation(-x, -y); m_scale *= agg::trans_affine_scaling(1/1.1); m_scale *= agg::trans_affine_translation(x, y); force_redraw(); } if(key == agg::key_left) { m_scale *= agg::trans_affine_translation(-x, -y); m_scale *= agg::trans_affine_rotation(-agg::pi / 20.0); m_scale *= agg::trans_affine_translation(x, y); force_redraw(); } if(key == agg::key_right) { m_scale *= agg::trans_affine_translation(-x, -y); m_scale *= agg::trans_affine_rotation(agg::pi / 20.0); m_scale *= agg::trans_affine_translation(x, y); force_redraw(); } } void on_mouse_move(int x, int y, unsigned flags) { if((flags & 1) == 0) { on_mouse_button_up(x, y, flags); } else { if(m_point_idx >= 0) { double xd = x; double yd = y; m_scale.inverse_transform(&xd, &yd); m_shape.modify_vertex(m_point_idx, xd, yd); force_redraw(); } } } void on_mouse_button_down(int x, int y, unsigned flags) { if(flags & 1) { double xd = x; double yd = y; double r = 4.0 / m_scale.scale(); m_scale.inverse_transform(&xd, &yd); m_point_idx = m_shape.hit_test(xd, yd, r); force_redraw(); } } void on_mouse_button_up(int x, int y, unsigned flags) { m_point_idx = -1; } }; int agg_main(int argc, char* argv[]) { the_application app(agg::pix_format_bgra32, flip_y); app.caption("AGG Example - Flash Rasterizer"); const char* fname = "shapes.txt"; if(argc > 1) fname = argv[1]; if(!app.open(fname)) { char buf[256]; if(strcmp(fname, "shapes.txt") == 0) { sprintf(buf, "File not found: %s. Download http://www.antigrain.com/%s\n" "or copy it from another directory if available.", fname, fname); } else { sprintf(buf, "File not found: %s", fname); } app.message(buf); return 1; } if(app.init(655, 520, agg::window_resize)) { app.read_next(); return app.run(); } return 1; } agg-2.5+dfsg1/examples/freetype_test.cpp0000644000000000000000000004410510703246330020466 0ustar00usergroup00000000000000#include #include "agg_basics.h" #include "agg_rendering_buffer.h" #include "agg_scanline_u.h" #include "agg_scanline_bin.h" #include "agg_renderer_scanline.h" #include "agg_renderer_primitives.h" #include "agg_rasterizer_scanline_aa.h" #include "agg_conv_curve.h" #include "agg_conv_contour.h" #include "agg_pixfmt_rgb.h" #include "agg_font_freetype.h" #include "platform/agg_platform_support.h" #include "ctrl/agg_slider_ctrl.h" #include "ctrl/agg_cbox_ctrl.h" #include "ctrl/agg_rbox_ctrl.h" enum flip_y_e { flip_y = true }; bool font_flip_y = !flip_y; #define pix_format agg::pix_format_bgr24 typedef agg::pixfmt_bgr24 pixfmt_type; static char text[] = "Anti-Grain Geometry is designed as a set of loosely coupled " "algorithms and class templates united with a common idea, " "so that all the components can be easily combined. Also, " "the template based design allows you to replace any part of " "the library without the necessity to modify a single byte in " "the existing code. " "AGG is designed keeping in mind extensibility and flexibility. " "Basically I just wanted to create a toolkit that would allow me " "(and anyone else) to add new fancy algorithms very easily. " "AGG does not dictate you any style of its use, you are free to " "use any part of it. However, AGG is often associated with a tool " "for rendering images in memory. That is not quite true, but it can " "be a good starting point in studying. The tutorials describe the " "use of AGG starting from the low level functionality that deals with " "frame buffers and pixels. Then you will gradually understand how to " "abstract different parts of the library and how to use them separately. " "Remember, the raster picture is often not the only thing you want to " "obtain, you will probably want to print your graphics with highest " "possible quality and in this case you can easily combine the \"vectorial\" " "part of the library with some API like Windows GDI, having a common " "external interface. If that API can render multi-polygons with non-zero " "and even-odd filling rules it's all you need to incorporate AGG into " "your application. For example, Windows API PolyPolygon perfectly fits " "these needs, except certain advanced things like gradient filling, " "Gouraud shading, image transformations, and so on. Or, as an alternative, " "you can use all AGG algorithms producing high resolution pixel images and " "then to send the result to the printer as a pixel map." "Below is a typical brief scheme of the AGG rendering pipeline. " "Please note that any component between the Vertex Source " "and Screen Output is not mandatory. It all depends on your " "particular needs. For example, you can use your own rasterizer, " "based on Windows API. In this case you won't need the AGG rasterizer " "and renderers. Or, if you need to draw only lines, you can use the " "AGG outline rasterizer that has certain restrictions but works faster. " "The number of possibilities is endless. " "Vertex Source is some object that produces polygons or polylines as " "a set of consecutive 2D vertices with commands like MoveTo, LineTo. " "It can be a container or some other object that generates vertices " "on demand. " "Coordinate conversion pipeline consists of a number of coordinate " "converters. It always works with vectorial data (X,Y) represented " "as floating point numbers (double). For example, it can contain an " "affine transformer, outline (stroke) generator, some marker " "generator (like arrowheads/arrowtails), dashed lines generator, " "and so on. The pipeline can have branches and you also can have " "any number of different pipelines. You also can write your own " "converter and include it into the pipeline. " "Scanline Rasterizer converts vectorial data into a number of " "horizontal scanlines. The scanlines usually (but not obligatory) " "carry information about Anti-Aliasing as coverage values. " "Renderers render scanlines, sorry for the tautology. The simplest " "example is solid filling. The renderer just adds a color to the " "scanline and writes the result into the rendering buffer. " "More complex renderers can produce multi-color result, " "like gradients, Gouraud shading, image transformations, " "patterns, and so on. Rendering Buffer is a buffer in memory " "that will be displayed afterwards. Usually but not obligatory " "it contains pixels in format that fits your video system. " "For example, 24 bits B-G-R, 32 bits B-G-R-A, or 15 " "bits R-G-B-555 for Windows. But in general, there're no " "restrictions on pixel formats or color space if you write " "your own low level class that supports that format. " "Colors in AGG appear only in renderers, that is, when you " "actually put some data to the rendering buffer. In general, " "there's no general purpose structure or class like color, " "instead, AGG always operates with concrete color space. " "There are plenty of color spaces in the world, like RGB, " "HSV, CMYK, etc., and all of them have certain restrictions. " "For example, the RGB color space is just a poor subset of " "colors that a human eye can recognize. If you look at the full " "CIE Chromaticity Diagram, you will see that the RGB triangle " "is just a little part of it. " "In other words there are plenty of colors in the real world " "that cannot be reproduced with RGB, CMYK, HSV, etc. Any color " "space except the one existing in Nature is restrictive. Thus, " "it was decided not to introduce such an object like color in " "order not to restrict the possibilities in advance. Instead, " "there are objects that operate with concrete color spaces. " "Currently there are agg::rgba and agg::rgba8 that operate " "with the most popular RGB color space (strictly speaking there's " "RGB plus Alpha). The RGB color space is used with different " "pixel formats, like 24-bit RGB or 32-bit RGBA with different " "order of color components. But the common property of all of " "them is that they are essentially RGB. Although, AGG doesn't " "explicitly support any other color spaces, there is at least " "a potential possibility of adding them. It means that all " "class and function templates that depend on the color type " "are parameterized with the ColorT argument. " "Basically, AGG operates with coordinates of the output device. " "On your screen there are pixels. But unlike many other libraries " "and APIs AGG initially supports Subpixel Accuracy. It means " "that the coordinates are represented as doubles, where fractional " "values actually take effect. AGG doesn't have an embedded " "conversion mechanism from world to screen coordinates in order " "not to restrict your freedom. It's very important where and when " "you do that conversion, so, different applications can require " "different approaches. AGG just provides you a transformer of " "that kind, namely, that can convert your own view port to the " "device one. And it's your responsibility to include it into " "the proper place of the pipeline. You can also write your " "own very simple class that will allow you to operate with " "millimeters, inches, or any other physical units. " "Internally, the rasterizers use integer coordinates of the " "format 24.8 bits, that is, 24 bits for the integer part and 8 " "bits for the fractional one. In other words, all the internal " "coordinates are multiplied by 256. If you intend to use AGG in " "some embedded system that has inefficient floating point " "processing, you still can use the rasterizers with their " "integer interfaces. Although, you won't be able to use the " "floating point coordinate pipelines in this case. "; template void dump_path(VS& path) { FILE* fd = fopen("dump_path", "a"); fprintf(fd, "-------\n"); path.rewind(0); unsigned cmd; double x, y; while(!agg::is_stop(cmd = path.vertex(&x, &y))) { fprintf(fd, "%02X %8.2f %8.2f\n", cmd, x, y); } fclose(fd); } class the_application : public agg::platform_support { typedef agg::renderer_base base_ren_type; typedef agg::renderer_scanline_aa_solid renderer_solid; typedef agg::renderer_scanline_bin_solid renderer_bin; typedef agg::font_engine_freetype_int32 font_engine_type; typedef agg::font_cache_manager font_manager_type; agg::rbox_ctrl m_ren_type; agg::slider_ctrl m_height; agg::slider_ctrl m_width; agg::slider_ctrl m_weight; agg::slider_ctrl m_gamma; agg::cbox_ctrl m_hinting; agg::cbox_ctrl m_kerning; agg::cbox_ctrl m_performance; font_engine_type m_feng; font_manager_type m_fman; double m_old_height; // Pipeline to process the vectors glyph paths (curves + contour) agg::conv_curve m_curves; agg::conv_contour > m_contour; public: the_application(agg::pix_format_e format, bool flip_y) : agg::platform_support(format, flip_y), m_ren_type (5.0, 5.0, 5.0+150.0, 110.0, !flip_y), m_height (160, 10.0, 640-5.0, 18.0, !flip_y), m_width (160, 30.0, 640-5.0, 38.0, !flip_y), m_weight (160, 50.0, 640-5.0, 58.0, !flip_y), m_gamma (260, 70.0, 640-5.0, 78.0, !flip_y), m_hinting (160, 65.0, "Hinting", !flip_y), m_kerning (160, 80.0, "Kerning", !flip_y), m_performance (160, 95.0, "Test Performance", !flip_y), m_feng(), m_fman(m_feng), m_old_height(0.0), m_curves(m_fman.path_adaptor()), m_contour(m_curves) { m_ren_type.add_item("Native Mono"); m_ren_type.add_item("Native Gray 8"); m_ren_type.add_item("Outline"); m_ren_type.add_item("AGG Mono"); m_ren_type.add_item("AGG Gray 8"); m_ren_type.cur_item(1); add_ctrl(m_ren_type); m_ren_type.no_transform(); m_height.label("Font Height=%.2f"); m_height.range(8, 32); m_height.num_steps(32-8); m_height.value(18); m_height.text_thickness(1.5); add_ctrl(m_height); m_height.no_transform(); m_width.label("Font Width=%.2f"); m_width.range(8, 32); m_width.num_steps(32-8); m_width.text_thickness(1.5); m_width.value(18); add_ctrl(m_width); m_width.no_transform(); m_weight.label("Font Weight=%.2f"); m_weight.range(-1, 1); m_weight.text_thickness(1.5); add_ctrl(m_weight); m_weight.no_transform(); m_gamma.label("Gamma=%.2f"); m_gamma.range(0.1, 2.0); m_gamma.value(1.0); m_gamma.text_thickness(1.5); add_ctrl(m_gamma); m_gamma.no_transform(); add_ctrl(m_hinting); m_hinting.status(true); m_hinting.no_transform(); add_ctrl(m_kerning); m_kerning.status(true); m_kerning.no_transform(); add_ctrl(m_performance); m_performance.no_transform(); m_curves.approximation_scale(2.0); m_contour.auto_detect_orientation(false); } template unsigned draw_text(Rasterizer& ras, Scanline& sl, RenSolid& ren_solid, RenBin& ren_bin) { agg::glyph_rendering gren = agg::glyph_ren_native_mono; switch(m_ren_type.cur_item()) { case 0: gren = agg::glyph_ren_native_mono; break; case 1: gren = agg::glyph_ren_native_gray8; break; case 2: gren = agg::glyph_ren_outline; break; case 3: gren = agg::glyph_ren_agg_mono; break; case 4: gren = agg::glyph_ren_agg_gray8; break; } unsigned num_glyphs = 0; m_contour.width(-m_weight.value() * m_height.value() * 0.05); if(m_feng.load_font(full_file_name("timesi.ttf"), 0, gren)) { m_feng.hinting(m_hinting.status()); m_feng.height(m_height.value()); m_feng.width(m_width.value()); m_feng.flip_y(font_flip_y); agg::trans_affine mtx; mtx *= agg::trans_affine_rotation(agg::deg2rad(-4.0)); //mtx *= agg::trans_affine_skewing(-0.4, 0); //mtx *= agg::trans_affine_translation(1, 0); m_feng.transform(mtx); double x = 10.0; double y0 = height() - m_height.value() - 10.0; double y = y0; const char* p = text; while(*p) { const agg::glyph_cache* glyph = m_fman.glyph(*p); if(glyph) { if(m_kerning.status()) { m_fman.add_kerning(&x, &y); } if(x >= width() - m_height.value()) { x = 10.0; y0 -= m_height.value(); if(y0 <= 120) break; y = y0; } m_fman.init_embedded_adaptors(glyph, x, y); switch(glyph->data_type) { default: break; case agg::glyph_data_mono: ren_bin.color(agg::rgba8(0, 0, 0)); agg::render_scanlines(m_fman.mono_adaptor(), m_fman.mono_scanline(), ren_bin); break; case agg::glyph_data_gray8: ren_solid.color(agg::rgba8(0, 0, 0)); agg::render_scanlines(m_fman.gray8_adaptor(), m_fman.gray8_scanline(), ren_solid); break; case agg::glyph_data_outline: ras.reset(); if(fabs(m_weight.value()) <= 0.01) { // For the sake of efficiency skip the // contour converter if the weight is about zero. //----------------------- ras.add_path(m_curves); } else { ras.add_path(m_contour); } ren_solid.color(agg::rgba8(0, 0, 0)); agg::render_scanlines(ras, sl, ren_solid); //dump_path(m_fman.path_adaptor()); break; } // increment pen position x += glyph->advance_x; y += glyph->advance_y; ++num_glyphs; } ++p; } } else { message("Please copy file timesi.ttf to the current directory\n" "or download it from http://www.antigrain.com/timesi.zip"); } return num_glyphs; } virtual void on_draw() { pixfmt_type pf(rbuf_window()); base_ren_type ren_base(pf); renderer_solid ren_solid(ren_base); renderer_bin ren_bin(ren_base); ren_base.clear(agg::rgba(1,1,1)); agg::scanline_u8 sl; agg::rasterizer_scanline_aa<> ras; if(m_height.value() != m_old_height) { m_width.value(m_old_height = m_height.value()); } if(m_ren_type.cur_item() == 3) { // When rendering in mono format, // Set threshold gamma = 0.5 //------------------- m_feng.gamma(agg::gamma_threshold(m_gamma.value() / 2.0)); } else { m_feng.gamma(agg::gamma_power(m_gamma.value())); } if(m_ren_type.cur_item() == 2) { // For outline cache set gamma for the rasterizer //------------------- ras.gamma(agg::gamma_power(m_gamma.value())); } //ren_base.copy_hline(0, int(height() - m_height.value()) - 10, 100, agg::rgba(0,0,0)); draw_text(ras, sl, ren_solid, ren_bin); ras.gamma(agg::gamma_power(1.0)); agg::render_ctrl(ras, sl, ren_base, m_ren_type); agg::render_ctrl(ras, sl, ren_base, m_height); agg::render_ctrl(ras, sl, ren_base, m_width); agg::render_ctrl(ras, sl, ren_base, m_weight); agg::render_ctrl(ras, sl, ren_base, m_gamma); agg::render_ctrl(ras, sl, ren_base, m_hinting); agg::render_ctrl(ras, sl, ren_base, m_kerning); agg::render_ctrl(ras, sl, ren_base, m_performance); } virtual void on_ctrl_change() { if(m_performance.status()) { pixfmt_type pf(rbuf_window()); base_ren_type ren_base(pf); renderer_solid ren_solid(ren_base); renderer_bin ren_bin(ren_base); ren_base.clear(agg::rgba(1,1,1)); agg::scanline_u8 sl; agg::rasterizer_scanline_aa<> ras; unsigned num_glyphs = 0; start_timer(); for(int i = 0; i < 50; i++) { num_glyphs += draw_text(ras, sl, ren_solid, ren_bin); } double t = elapsed_time(); char buf[100]; sprintf(buf, "Glyphs=%u, Time=%.3fms, %.3f glyps/sec, %.3f microsecond/glyph", num_glyphs, t, (num_glyphs / t) * 1000.0, (t / num_glyphs) * 1000.0); message(buf); m_performance.status(false); force_redraw(); } } virtual void on_key(int x, int y, unsigned key, unsigned flags) { if(key == ' ') { font_flip_y = !font_flip_y; force_redraw(); } } }; int agg_main(int argc, char* argv[]) { the_application app(pix_format, flip_y); app.caption("AGG Example. Rendering Fonts with FreeType"); if(app.init(640, 520, agg::window_resize)) { return app.run(); } return 1; } agg-2.5+dfsg1/examples/gamma_correction.cpp0000644000000000000000000001151310703246330021112 0ustar00usergroup00000000000000#include #include "agg_trans_affine.h" #include "agg_conv_stroke.h" #include "agg_rasterizer_scanline_aa.h" #include "agg_rendering_buffer.h" #include "agg_scanline_u.h" #include "agg_renderer_scanline.h" #include "agg_gamma_lut.h" #include "ctrl/agg_slider_ctrl.h" #include "platform/agg_platform_support.h" #define AGG_BGR24 //#define AGG_RGB24 //#define AGG_BGRA32 //#define AGG_RGBA32 //#define AGG_ARGB32 //#define AGG_ABGR32 //#define AGG_RGB565 //#define AGG_RGB555 #include "pixel_formats.h" enum flip_y_e { flip_y = true }; class the_application : public agg::platform_support { agg::slider_ctrl m_thickness; agg::slider_ctrl m_gamma; agg::slider_ctrl m_contrast; double m_rx; double m_ry; public: the_application(agg::pix_format_e format, bool flip_y) : agg::platform_support(format, flip_y), m_thickness(5, 5, 400-5, 11, !flip_y), m_gamma (5, 5+15, 400-5, 11+15, !flip_y), m_contrast (5, 5+30, 400-5, 11+30, !flip_y) { add_ctrl(m_thickness); add_ctrl(m_gamma); add_ctrl(m_contrast); m_thickness.label("Thickness=%3.2f"); m_gamma.label("Gamma=%3.2f"); m_contrast.label("Contrast"); m_thickness.range(0.0, 3.0); m_gamma.range(0.5, 3.0); m_contrast.range(0.0, 1.0); m_thickness.value(1.0); m_gamma.value(1.0); m_contrast.value(1.0); } virtual void on_init() { m_rx = width() / 3.0; m_ry = height() / 3.0; } virtual void on_draw() { typedef agg::gamma_lut gamma_type; typedef pixfmt_gamma pixfmt_type; typedef agg::renderer_base ren_base; double g = m_gamma.value(); gamma_type gamma(g); pixfmt_type pixf(rbuf_window(), gamma); ren_base renb(pixf); renb.clear(agg::rgba(1, 1, 1)); double dark = 1.0 - m_contrast.value(); double light = m_contrast.value(); renb.copy_bar(0,0,int(width())/2, int(height()), agg::rgba(dark,dark,dark)); renb.copy_bar(int(width())/2+1,0, int(width()), int(height()), agg::rgba(light,light,light)); renb.copy_bar(0,int(height())/2+1, int(width()), int(height()), agg::rgba(1.0,dark,dark)); agg::rasterizer_scanline_aa<> ras; agg::scanline_u8 sl; agg::path_storage path; unsigned i; double x = (width() - 256.0) / 2.0; double y = 50.0; path.remove_all(); agg::gamma_power gp(g); for(i = 0; i < 256; i++) { double v = double(i) / 255.0; double gval = gp(v); double dy = gval * 255.0; if(i == 0) path.move_to(x + i, y + dy); else path.line_to(x + i, y + dy); } agg::conv_stroke gpoly(path); gpoly.width(2.0); ras.reset(); ras.add_path(gpoly); agg::render_scanlines_aa_solid(ras, sl, renb, agg::rgba8(80,127,80)); agg::ellipse ell(width() / 2, height() / 2, m_rx, m_ry, 150); agg::conv_stroke poly(ell); poly.width(m_thickness.value()); ras.reset(); ras.add_path(poly); agg::render_scanlines_aa_solid(ras, sl, renb, agg::rgba8(255,0,0)); ell.init(width() / 2, height() / 2, m_rx-5.0, m_ry-5.0, 150); ras.reset(); ras.add_path(poly); agg::render_scanlines_aa_solid(ras, sl, renb, agg::rgba8(0,255,0)); ell.init(width() / 2, height() / 2, m_rx-10.0, m_ry-10.0, 150); ras.reset(); ras.add_path(poly); agg::render_scanlines_aa_solid(ras, sl, renb, agg::rgba8(0,0,255)); ell.init(width() / 2, height() / 2, m_rx-15.0, m_ry-15.0, 150); ras.reset(); ras.add_path(poly); agg::render_scanlines_aa_solid(ras, sl, renb, agg::rgba8(0,0,0)); ell.init(width() / 2, height() / 2, m_rx-20.0, m_ry-20.0, 150); ras.reset(); ras.add_path(poly); agg::render_scanlines_aa_solid(ras, sl, renb, agg::rgba8(255,255,255)); agg::render_ctrl(ras, sl, renb, m_thickness); agg::render_ctrl(ras, sl, renb, m_gamma); agg::render_ctrl(ras, sl, renb, m_contrast); } virtual void on_mouse_button_down(int x, int y, unsigned flags) { if(flags & agg::mouse_left) { m_rx = fabs(width()/2 - x); m_ry = fabs(height()/2 - y); force_redraw(); } } virtual void on_mouse_move(int x, int y, unsigned flags) { on_mouse_button_down(x, y, flags); } }; int agg_main(int argc, char* argv[]) { the_application app(pix_format, flip_y); app.caption("AGG Example. Thin red ellipse"); if(app.init(400, 320, 0)) { return app.run(); } return 1; } agg-2.5+dfsg1/examples/gamma_ctrl.cpp0000644000000000000000000001476110703246330017717 0ustar00usergroup00000000000000#include #include #include "agg_rendering_buffer.h" #include "agg_rasterizer_scanline_aa.h" #include "agg_scanline_p.h" #include "agg_renderer_scanline.h" #include "agg_gsv_text.h" #include "agg_conv_stroke.h" #include "agg_path_storage.h" #include "ctrl/agg_gamma_ctrl.h" #include "platform/agg_platform_support.h" #define AGG_BGR24 //#define AGG_RGB24 //#define AGG_BGRA32 //#define AGG_RGBA32 //#define AGG_ARGB32 //#define AGG_ABGR32 //#define AGG_RGB565 //#define AGG_RGB555 #include "pixel_formats.h" enum flip_y_e { flip_y = true }; agg::gamma_ctrl g_ctrl(10.0, 10.0, 300.0, 200.0, !flip_y); void read_gamma(const char* fname) { FILE* fd = fopen(fname, "rb"); if(fd) { char buf[32]; double kx1, ky1, kx2, ky2; fgets(buf, 30, fd); kx1 = atof(buf); fgets(buf, 30, fd); ky1 = atof(buf); fgets(buf, 30, fd); kx2 = atof(buf); fgets(buf, 30, fd); ky2 = atof(buf); g_ctrl.values(kx1, ky1, kx2, ky2); fclose(fd); } } void write_gamma_bin(const char* fname) { const unsigned char* gamma = g_ctrl.gamma(); FILE* fd = fopen(fname, "wb"); if(fd) { fwrite(gamma, 256, 1, fd); fclose(fd); } } void write_gamma_txt(const char* fname) { const unsigned char* gamma = g_ctrl.gamma(); FILE* fd = fopen(fname, "w"); if(fd) { double kx1, ky1, kx2, ky2; g_ctrl.values(&kx1, &ky1, &kx2, &ky2); fprintf(fd, "%5.3f\n", kx1); fprintf(fd, "%5.3f\n", ky1); fprintf(fd, "%5.3f\n", kx2); fprintf(fd, "%5.3f\n", ky2); for(int i = 0; i < 16; i++) { for(int j = 0; j < 16; j++) { fprintf(fd, "%3d,", gamma[i*16 + j]); } fprintf(fd, "\n"); } fclose(fd); } } class the_application : public agg::platform_support { public: the_application(agg::pix_format_e format, bool flip_y) : agg::platform_support(format, flip_y) { add_ctrl(g_ctrl); } virtual void on_init() { read_gamma(full_file_name("gamma.txt")); } virtual ~the_application() { write_gamma_txt(full_file_name("gamma.txt")); write_gamma_bin(full_file_name("gamma.bin")); } virtual void on_draw() { double ewidth = initial_width() / 2 - 10; double ecenter = initial_width() / 2; typedef agg::renderer_base ren_base; pixfmt pixf(rbuf_window()); ren_base rb(pixf); agg::rgba8 color; rb.clear(agg::rgba(1, 1, 1)); g_ctrl.text_size(10.0, 12.0); agg::rasterizer_scanline_aa<> ras; agg::scanline_p8 sl; agg::render_ctrl(ras, sl, rb, g_ctrl); ras.gamma(g_ctrl); agg::ellipse ellipse; agg::conv_stroke poly(ellipse); agg::conv_transform > tpoly(poly, trans_affine_resizing()); color = agg::rgba8(0, 0, 0); ellipse.init(ecenter, 220, ewidth, 15, 100); poly.width(2.0); ras.add_path(tpoly, 0); agg::render_scanlines_aa_solid(ras, sl, rb, color); ellipse.init(ecenter, 220, 11, 11, 100); poly.width(2.0); ras.add_path(tpoly, 0); agg::render_scanlines_aa_solid(ras, sl, rb, color); color = agg::rgba8(127, 127, 127); ellipse.init(ecenter, 260, ewidth, 15, 100); poly.width(2.0); ras.add_path(tpoly, 0); agg::render_scanlines_aa_solid(ras, sl, rb, color); ellipse.init(ecenter, 260, 11, 11, 100); poly.width(2.0); ras.add_path(tpoly, 0); agg::render_scanlines_aa_solid(ras, sl, rb, color); color = agg::rgba8(192, 192, 192); ellipse.init(ecenter, 300, ewidth, 15, 100); poly.width(2.0); ras.add_path(tpoly, 0); agg::render_scanlines_aa_solid(ras, sl, rb, color); ellipse.init(ecenter, 300, 11, 11, 100); poly.width(2.0); ras.add_path(tpoly, 0); agg::render_scanlines_aa_solid(ras, sl, rb, color); color = agg::rgba(0.0, 0.0, 0.4); ellipse.init(ecenter, 340, ewidth, 15.5, 100); poly.width(1.0); ras.add_path(tpoly, 0); agg::render_scanlines_aa_solid(ras, sl, rb, color); ellipse.init(ecenter, 340, 10.5, 10.5, 100); poly.width(1.0); ras.add_path(tpoly, 0); agg::render_scanlines_aa_solid(ras, sl, rb, color); ellipse.init(ecenter, 380, ewidth, 15.5, 100); poly.width(0.4); ras.add_path(tpoly, 0); agg::render_scanlines_aa_solid(ras, sl, rb, color); ellipse.init(ecenter, 380, 10.5, 10.5, 100); poly.width(0.4); ras.add_path(tpoly, 0); agg::render_scanlines_aa_solid(ras, sl, rb, color); ellipse.init(ecenter, 420, ewidth, 15.5, 100); poly.width(0.1); ras.add_path(tpoly, 0); agg::render_scanlines_aa_solid(ras, sl, rb, color); ellipse.init(ecenter, 420, 10.5, 10.5, 100); poly.width(0.1); ras.add_path(tpoly, 0); agg::render_scanlines_aa_solid(ras, sl, rb, color); agg::trans_affine mtx; mtx *= agg::trans_affine_skewing(0.15, 0.0); mtx *= trans_affine_resizing(); agg::gsv_text text; agg::gsv_text_outline text1(text, mtx); text.text("Text 2345"); text.size(50, 20); text1.width(2.0); text.start_point(320, 10); color = agg::rgba(0.0, 0.5, 0.0); ras.add_path(text1, 0); agg::render_scanlines_aa_solid(ras, sl, rb, color); color = agg::rgba(0.5, 0.0, 0.0); agg::path_storage path; path.move_to(30, -1.0); path.line_to(60, 0.0); path.line_to(30, 1.0); path.move_to(27, -1.0); path.line_to(10, 0.0); path.line_to(27, 1.0); agg::conv_transform trans(path, mtx); for(int i = 0; i < 35; i++) { mtx.reset(); mtx *= agg::trans_affine_rotation(double(i) / 35.0 * agg::pi * 2.0); mtx *= agg::trans_affine_translation(400, 130); mtx *= trans_affine_resizing(); ras.add_path(trans, 0); agg::render_scanlines_aa_solid(ras, sl, rb, color); } } }; int agg_main(int argc, char* argv[]) { the_application app(pix_format, flip_y); app.caption("Anti-Aliasing Gamma Correction"); if(app.init(500, 400, agg::window_resize)) { return app.run(); } return 1; } agg-2.5+dfsg1/examples/gamma_tuner.cpp0000644000000000000000000001504310703246330020102 0ustar00usergroup00000000000000#include #include "agg_trans_affine.h" #include "agg_conv_stroke.h" #include "agg_rasterizer_scanline_aa.h" #include "agg_rendering_buffer.h" #include "agg_scanline_u.h" #include "agg_renderer_scanline.h" #include "agg_gamma_lut.h" #include "ctrl/agg_slider_ctrl.h" #include "ctrl/agg_rbox_ctrl.h" #include "platform/agg_platform_support.h" #include "agg_pixfmt_rgb.h" #define pix_format agg::pix_format_bgr24 typedef agg::pixfmt_bgr24 pixfmt; typedef agg::pixfmt_bgr24_pre pixfmt_pre; #define pixfmt_gamma agg::pixfmt_bgr24_gamma typedef agg::rgba8 color_type; typedef agg::order_bgr component_order; enum flip_y_e { flip_y = true }; class the_application : public agg::platform_support { agg::slider_ctrl m_gamma; agg::slider_ctrl m_r; agg::slider_ctrl m_g; agg::slider_ctrl m_b; agg::rbox_ctrl m_pattern; public: the_application(agg::pix_format_e format, bool flip_y) : agg::platform_support(format, flip_y), m_gamma (5, 5, 350-5, 11, !flip_y), m_r (5, 5+15, 350-5, 11+15, !flip_y), m_g (5, 5+30, 350-5, 11+30, !flip_y), m_b (5, 5+45, 350-5, 11+45, !flip_y), m_pattern (355, 1, 495, 60, !flip_y) { m_pattern.text_size(8); m_pattern.add_item("Horizontal"); m_pattern.add_item("Vertical"); m_pattern.add_item("Checkered"); m_pattern.cur_item(2); add_ctrl(m_gamma); add_ctrl(m_r); add_ctrl(m_g); add_ctrl(m_b); add_ctrl(m_pattern); m_gamma.range(0.5, 4.0); m_gamma.value(2.2); m_gamma.label("Gamma=%.2f"); m_r.value(1.0); m_g.value(1.0); m_b.value(1.0); m_r.label("R=%.2f"); m_g.label("G=%.2f"); m_b.label("B=%.2f"); } virtual void on_init() { } virtual void on_draw() { typedef agg::gamma_lut gamma_type; typedef pixfmt_gamma pixfmt_type; typedef agg::renderer_base ren_base; double g = m_gamma.value(); gamma_type gamma(g); pixfmt_type pixf(rbuf_window(), gamma); ren_base renb(pixf); agg::rasterizer_scanline_aa<> ras; agg::scanline_u8 sl; enum { square_size = 400, ver_strips = 5 }; color_type span1[square_size]; color_type span2[square_size]; color_type color(agg::rgba(m_r.value(), m_g.value(), m_b.value())); unsigned i, j; // Draw vertical gradient //----------------------- unsigned w = (unsigned)width(); unsigned h = (unsigned)height(); for(i = 0; i < h; i++) { double k = (i - 80) / double(square_size - 1); if(i < 80) k = 0.0; if(i >= 80+square_size) k = 1.0; k = 1 - pow(k/2, 1/m_gamma.value()); color_type c = color.gradient(color_type(0,0,0), k); renb.copy_hline(0, i, w-1, c); } // Calculate spans //----------------------- switch(m_pattern.cur_item()) { case 0: for(i = 0; i < square_size; i++) { span1[i] = span2[i] = color; span1[i].a = i * color_type::base_mask / square_size; span2[i].a = color_type::base_mask - span1[i].a; } break; case 1: for(i = 0; i < square_size; i++) { span1[i] = span2[i] = color; if(i & 1) { span1[i].a = i * color_type::base_mask / square_size; span2[i].a = span1[i].a; } else { span1[i].a = color_type::base_mask - i * color_type::base_mask / square_size; span2[i].a = span1[i].a; } } break; case 2: for(i = 0; i < square_size; i++) { span1[i] = span2[i] = color; if(i & 1) { span1[i].a = i * color_type::base_mask / square_size; span2[i].a = color_type::base_mask - span1[i].a; } else { span2[i].a = i * color_type::base_mask / square_size; span1[i].a = color_type::base_mask - span2[i].a; } } break; } // Clear the area //--------------------- renb.copy_bar(50, 80, 50+square_size-1, 80+square_size-1, agg::rgba(0,0,0)); // Draw the patern //--------------------- for(i = 0; i < square_size; i += 2) { double k = i / double(square_size - 1); k = 1 - pow(k, 1/m_gamma.value()); color_type c = color.gradient(agg::rgba(0,0,0), k); for(j = 0; j < square_size; j++) { span1[j].r = span2[j].r = c.r; span1[j].g = span2[j].g = c.g; span1[j].b = span2[j].b = c.b; } renb.blend_color_hspan(50, i + 80 + 0, square_size, span1, 0, 255); renb.blend_color_hspan(50, i + 80 + 1, square_size, span2, 0, 255); } // Draw vertical strips //--------------------- for(i = 0; i < square_size; i++) { double k = i / double(square_size - 1); k = 1 - pow(k/2, 1/m_gamma.value()); color_type c = color.gradient(color_type(0,0,0), k); for(j = 0; j < ver_strips; j++) { int xc = square_size * (j + 1) / (ver_strips + 1); renb.copy_hline(50+xc-10, i+80, 50+xc+10, c); } } agg::render_ctrl(ras, sl, renb, m_gamma); agg::render_ctrl(ras, sl, renb, m_r); agg::render_ctrl(ras, sl, renb, m_g); agg::render_ctrl(ras, sl, renb, m_b); agg::render_ctrl(ras, sl, renb, m_pattern); } virtual void on_mouse_button_down(int x, int y, unsigned flags) { } virtual void on_mouse_move(int x, int y, unsigned flags) { } }; int agg_main(int argc, char* argv[]) { the_application app(pix_format, flip_y); app.caption("AGG Example. Gamma Tuner"); if(app.init(500, 500, 0)) { return app.run(); } return 1; } agg-2.5+dfsg1/examples/gouraud.cpp0000644000000000000000000002136210703246330017252 0ustar00usergroup00000000000000#include #include "agg_basics.h" #include "agg_rendering_buffer.h" #include "agg_rasterizer_scanline_aa.h" #include "agg_scanline_u.h" #include "agg_scanline_p.h" #include "agg_renderer_scanline.h" #include "agg_span_allocator.h" #include "agg_span_gouraud_rgba.h" #include "agg_span_gouraud_gray.h" #include "agg_span_solid.h" #include "platform/agg_platform_support.h" #include "ctrl/agg_slider_ctrl.h" //#define AGG_GRAY8 #define AGG_BGR24 //#define AGG_RGB24 //#define AGG_BGRA32 //#define AGG_RGBA32 //#define AGG_ARGB32 //#define AGG_ABGR32 //#define AGG_RGB565 //#define AGG_RGB555 #include "pixel_formats.h" enum flip_y_e { flip_y = true }; #include "agg_math.h" #include "agg_dda_line.h" class the_application : public agg::platform_support { double m_x[3]; double m_y[3]; double m_dx; double m_dy; int m_idx; agg::slider_ctrl m_dilation; agg::slider_ctrl m_gamma; agg::slider_ctrl m_alpha; public: the_application(agg::pix_format_e format, bool flip_y) : agg::platform_support(format, flip_y), m_idx(-1), m_dilation(5, 5, 400-5, 11, !flip_y), m_gamma (5, 5+15, 400-5, 11+15, !flip_y), m_alpha (5, 5+30, 400-5, 11+30, !flip_y) { m_x[0] = 57; m_y[0] = 60; m_x[1] = 369; m_y[1] = 170; m_x[2] = 143; m_y[2] = 310; add_ctrl(m_dilation); add_ctrl(m_gamma); add_ctrl(m_alpha); m_dilation.label("Dilation=%3.2f"); m_gamma.label("Linear gamma=%3.2f"); m_alpha.label("Opacity=%3.2f"); m_dilation.value(0.175); m_gamma.value(0.809); m_alpha.value(1.0); } template void render_gouraud(Scanline& sl, Ras& ras) { double alpha = m_alpha.value(); double brc = 1; typedef agg::renderer_base base_ren_type; #ifdef AGG_GRAY8 typedef agg::span_gouraud_gray span_gen_type; #else typedef agg::span_gouraud_rgba span_gen_type; #endif typedef agg::span_allocator span_alloc_type; pixfmt pf(rbuf_window()); base_ren_type ren_base(pf); span_alloc_type span_alloc; span_gen_type span_gen; ras.gamma(agg::gamma_linear(0.0, m_gamma.value())); double d = m_dilation.value(); // Single triangle //span_gen.colors(agg::rgba(1, 0, 0, alpha), // agg::rgba(0, 1, 0, alpha), // agg::rgba(0, 0, 1, alpha)); //span_gen.triangle(m_x[0], m_y[0], m_x[1], m_y[1], m_x[2], m_y[2], d); //ras.add_path(span_gen); //agg::render_scanlines_aa(ras, sl, ren_base, span_alloc, span_gen); // Six triangles double xc = (m_x[0] + m_x[1] + m_x[2]) / 3.0; double yc = (m_y[0] + m_y[1] + m_y[2]) / 3.0; double x1 = (m_x[1] + m_x[0]) / 2 - (xc - (m_x[1] + m_x[0]) / 2); double y1 = (m_y[1] + m_y[0]) / 2 - (yc - (m_y[1] + m_y[0]) / 2); double x2 = (m_x[2] + m_x[1]) / 2 - (xc - (m_x[2] + m_x[1]) / 2); double y2 = (m_y[2] + m_y[1]) / 2 - (yc - (m_y[2] + m_y[1]) / 2); double x3 = (m_x[0] + m_x[2]) / 2 - (xc - (m_x[0] + m_x[2]) / 2); double y3 = (m_y[0] + m_y[2]) / 2 - (yc - (m_y[0] + m_y[2]) / 2); span_gen.colors(agg::rgba(1, 0, 0, alpha), agg::rgba(0, 1, 0, alpha), agg::rgba(brc, brc, brc, alpha)); span_gen.triangle(m_x[0], m_y[0], m_x[1], m_y[1], xc, yc, d); ras.add_path(span_gen); agg::render_scanlines_aa(ras, sl, ren_base, span_alloc, span_gen); span_gen.colors(agg::rgba(0, 1, 0, alpha), agg::rgba(0, 0, 1, alpha), agg::rgba(brc, brc, brc, alpha)); span_gen.triangle(m_x[1], m_y[1], m_x[2], m_y[2], xc, yc, d); ras.add_path(span_gen); agg::render_scanlines_aa(ras, sl, ren_base, span_alloc, span_gen); span_gen.colors(agg::rgba(0, 0, 1, alpha), agg::rgba(1, 0, 0, alpha), agg::rgba(brc, brc, brc, alpha)); span_gen.triangle(m_x[2], m_y[2], m_x[0], m_y[0], xc, yc, d); ras.add_path(span_gen); agg::render_scanlines_aa(ras, sl, ren_base, span_alloc, span_gen); brc = 1-brc; span_gen.colors(agg::rgba(1, 0, 0, alpha), agg::rgba(0, 1, 0, alpha), agg::rgba(brc, brc, brc, alpha)); span_gen.triangle(m_x[0], m_y[0], m_x[1], m_y[1], x1, y1, d); ras.add_path(span_gen); agg::render_scanlines_aa(ras, sl, ren_base, span_alloc, span_gen); span_gen.colors(agg::rgba(0, 1, 0, alpha), agg::rgba(0, 0, 1, alpha), agg::rgba(brc, brc, brc, alpha)); span_gen.triangle(m_x[1], m_y[1], m_x[2], m_y[2], x2, y2, d); ras.add_path(span_gen); agg::render_scanlines_aa(ras, sl, ren_base, span_alloc, span_gen); span_gen.colors(agg::rgba(0, 0, 1, alpha), agg::rgba(1, 0, 0, alpha), agg::rgba(brc, brc, brc, alpha)); span_gen.triangle(m_x[2], m_y[2], m_x[0], m_y[0], x3, y3, d); ras.add_path(span_gen); agg::render_scanlines_aa(ras, sl, ren_base, span_alloc, span_gen); } virtual void on_draw() { typedef agg::renderer_base base_ren_type; pixfmt pf(rbuf_window()); base_ren_type ren_base(pf); ren_base.clear(agg::rgba(1,1,1)); agg::scanline_u8 sl; agg::rasterizer_scanline_aa<> ras; render_gouraud(sl, ras); ras.gamma(agg::gamma_none()); agg::render_ctrl(ras, sl, ren_base, m_dilation); agg::render_ctrl(ras, sl, ren_base, m_gamma); agg::render_ctrl(ras, sl, ren_base, m_alpha); } virtual void on_mouse_button_down(int x, int y, unsigned flags) { unsigned i; if(flags & agg::mouse_right) { agg::scanline_u8 sl; agg::rasterizer_scanline_aa<> ras; start_timer(); for(i = 0; i < 100; i++) { render_gouraud(sl, ras); } char buf[100]; sprintf(buf, "Time=%2.2f ms", elapsed_time()); message(buf); } if(flags & agg::mouse_left) { for (i = 0; i < 3; i++) { if(sqrt( (x-m_x[i]) * (x-m_x[i]) + (y-m_y[i]) * (y-m_y[i]) ) < 10.0) { m_dx = x - m_x[i]; m_dy = y - m_y[i]; m_idx = i; break; } } if(i == 3) { if(agg::point_in_triangle(m_x[0], m_y[0], m_x[1], m_y[1], m_x[2], m_y[2], x, y)) { m_dx = x - m_x[0]; m_dy = y - m_y[0]; m_idx = 3; } } } } virtual void on_mouse_move(int x, int y, unsigned flags) { if(flags & agg::mouse_left) { if(m_idx == 3) { double dx = x - m_dx; double dy = y - m_dy; m_x[1] -= m_x[0] - dx; m_y[1] -= m_y[0] - dy; m_x[2] -= m_x[0] - dx; m_y[2] -= m_y[0] - dy; m_x[0] = dx; m_y[0] = dy; force_redraw(); return; } if(m_idx >= 0) { m_x[m_idx] = x - m_dx; m_y[m_idx] = y - m_dy; force_redraw(); } } else { on_mouse_button_up(x, y, flags); } } virtual void on_mouse_button_up(int x, int y, unsigned flags) { m_idx = -1; } virtual void on_key(int x, int y, unsigned key, unsigned flags) { double dx = 0; double dy = 0; switch(key) { case agg::key_left: dx = -0.1; break; case agg::key_right: dx = 0.1; break; case agg::key_up: dy = 0.1; break; case agg::key_down: dy = -0.1; break; } m_x[0] += dx; m_y[0] += dy; m_x[1] += dx; m_y[1] += dy; force_redraw(); } }; int agg_main(int argc, char* argv[]) { the_application app(pix_format, flip_y); app.caption("AGG Example. Gouraud Shading"); if(app.init(400, 320, agg::window_resize)) { return app.run(); } return 1; } agg-2.5+dfsg1/examples/gouraud_mesh.cpp0000644000000000000000000003276410703246330020276 0ustar00usergroup00000000000000#include #include #include #include "agg_rendering_buffer.h" #include "agg_conv_transform.h" #include "agg_conv_stroke.h" #include "agg_conv_clip_polyline.h" #include "agg_scanline_u.h" #include "agg_scanline_bin.h" #include "agg_renderer_scanline.h" #include "agg_rasterizer_outline_aa.h" #include "agg_rasterizer_scanline_aa.h" #include "agg_span_allocator.h" #include "agg_span_gouraud_rgba.h" #include "agg_gamma_lut.h" #include "agg_arc.h" #include "agg_bezier_arc.h" #include "agg_pixfmt_rgb.h" #include "agg_pixfmt_rgba.h" #include "agg_bounding_rect.h" #include "agg_vpgen_clip_polygon.h" #include "ctrl/agg_slider_ctrl.h" #include "ctrl/agg_bezier_ctrl.h" #include "ctrl/agg_rbox_ctrl.h" #include "ctrl/agg_cbox_ctrl.h" #include "platform/agg_platform_support.h" #include "agg_rasterizer_compound_aa.h" enum { flip_y = true }; typedef agg::pixfmt_bgra32_pre pixfmt; namespace agg { struct mesh_point { double x,y; double dx,dy; rgba8 color; rgba8 dc; mesh_point() {} mesh_point(double x_, double y_, double dx_, double dy_, rgba8 c, rgba8 dc_) : x(x_), y(y_), dx(dx_), dy(dy_), color(c), dc(dc_) {} }; struct mesh_triangle { unsigned p1, p2, p3; mesh_triangle() {} mesh_triangle(unsigned i, unsigned j, unsigned k) : p1(i), p2(j), p3(k) {} }; struct mesh_edge { unsigned p1, p2; int tl, tr; mesh_edge() {} mesh_edge(unsigned p1_, unsigned p2_, int tl_, int tr_) : p1(p1_), p2(p2_), tl(tl_), tr(tr_) {} }; static double random(double v1, double v2) { return (v2 - v1) * (rand() % 1000) / 999.0 + v1; } class mesh_ctrl { public: mesh_ctrl(); void generate(unsigned cols, unsigned rows, double cell_w, double cell_h, double start_x, double start_y); void randomize_points(double delta); void rotate_colors(); bool on_mouse_button_down(double x, double y, unsigned flags); bool on_mouse_move(double x, double y, unsigned flags); bool on_mouse_button_up(double x, double y, unsigned flags); unsigned num_vertices() const { return m_vertices.size(); } const mesh_point& vertex(unsigned i) const { return m_vertices[i]; } mesh_point& vertex(unsigned i) { return m_vertices[i]; } const mesh_point& vertex(unsigned x, unsigned y) const { return m_vertices[y * m_rows + x]; } mesh_point& vertex(unsigned x, unsigned y) { return m_vertices[y * m_rows + x]; } unsigned num_triangles() const { return m_triangles.size(); } const mesh_triangle& triangle(unsigned i) const { return m_triangles[i]; } mesh_triangle& triangle(unsigned i) { return m_triangles[i]; } unsigned num_edges() const { return m_edges.size(); } const mesh_edge& edge(unsigned i) const { return m_edges[i]; } mesh_edge& edge(unsigned i) { return m_edges[i]; } private: unsigned m_cols; unsigned m_rows; int m_drag_idx; double m_drag_dx; double m_drag_dy; double m_cell_w; double m_cell_h; double m_start_x; double m_start_y; pod_bvector m_vertices; pod_bvector m_triangles; pod_bvector m_edges; }; mesh_ctrl::mesh_ctrl() : m_cols(0), m_rows(0), m_drag_idx(-1), m_drag_dx(0), m_drag_dy(0) {} void mesh_ctrl::generate(unsigned cols, unsigned rows, double cell_w, double cell_h, double start_x, double start_y) { m_cols = cols; m_rows = rows; m_cell_w = cell_w; m_cell_h = cell_h; m_start_x = start_x; m_start_y = start_y; m_vertices.remove_all(); unsigned i, j; for(i = 0; i < m_rows; i++) { double x = start_x; for(j = 0; j < m_cols; j++) { double dx = random(-0.5, 0.5); double dy = random(-0.5, 0.5); rgba8 c(rand() & 0xFF, rand() & 0xFF, rand() & 0xFF); rgba8 dc(rand() & 1, rand() & 1, rand() & 1); m_vertices.add(mesh_point(x, start_y, dx, dy, c, dc)); x += cell_w; } start_y += cell_h; } // 4---3 // |t2/| // | / | // |/t1| // 1---2 m_triangles.remove_all(); m_edges.remove_all(); for(i = 0; i < m_rows - 1; i++) { for(j = 0; j < m_cols - 1; j++) { int p1 = i * m_cols + j; int p2 = p1 + 1; int p3 = p2 + m_cols; int p4 = p1 + m_cols; m_triangles.add(mesh_triangle(p1, p2, p3)); m_triangles.add(mesh_triangle(p3, p4, p1)); int curr_cell = i * (m_cols - 1) + j; int left_cell = j ? int(curr_cell - 1) : -1; int bott_cell = i ? int(curr_cell - (m_cols - 1)) : -1; int curr_t1 = curr_cell * 2; int curr_t2 = curr_t1 + 1; int left_t1 = (left_cell >= 0) ? left_cell * 2 : -1; int left_t2 = (left_cell >= 0) ? left_t1 + 1 : -1; int bott_t1 = (bott_cell >= 0) ? bott_cell * 2 : -1; int bott_t2 = (bott_cell >= 0) ? bott_t1 + 1 : -1; m_edges.add(mesh_edge(p1, p2, curr_t1, bott_t2)); m_edges.add(mesh_edge(p1, p3, curr_t2, curr_t1)); m_edges.add(mesh_edge(p1, p4, left_t1, curr_t2)); if(j == m_cols - 2) // Last column { m_edges.add(mesh_edge(p2, p3, curr_t1, -1)); } if(i == m_rows - 2) // Last row { m_edges.add(mesh_edge(p3, p4, curr_t2, -1)); } } } } void mesh_ctrl::randomize_points(double delta) { unsigned i, j; for(i = 0; i < m_rows; i++) { for(j = 0; j < m_cols; j++) { double xc = j * m_cell_w + m_start_x; double yc = i * m_cell_h + m_start_y; double x1 = xc - m_cell_w / 4; double y1 = yc - m_cell_h / 4; double x2 = xc + m_cell_w / 4; double y2 = yc + m_cell_h / 4; mesh_point& p = vertex(j, i); p.x += p.dx; p.y += p.dy; if(p.x < x1) { p.x = x1; p.dx = -p.dx; } if(p.y < y1) { p.y = y1; p.dy = -p.dy; } if(p.x > x2) { p.x = x2; p.dx = -p.dx; } if(p.y > y2) { p.y = y2; p.dy = -p.dy; } } } } void mesh_ctrl::rotate_colors() { unsigned i; for(i = 1; i < m_vertices.size(); i++) { rgba8& c = m_vertices[i].color; rgba8& dc = m_vertices[i].dc; int r = c.r + (dc.r ? 5 : -5); int g = c.g + (dc.g ? 5 : -5); int b = c.b + (dc.b ? 5 : -5); if(r < 0) { r = 0; dc.r ^= 1; } if(r > 255) { r = 255; dc.r ^= 1; } if(g < 0) { g = 0; dc.g ^= 1; } if(g > 255) { g = 255; dc.g ^= 1; } if(b < 0) { b = 0; dc.b ^= 1; } if(b > 255) { b = 255; dc.b ^= 1; } c.r = r; c.g = g; c.b = b; } } bool mesh_ctrl::on_mouse_button_down(double x, double y, unsigned flags) { if(flags & 1) { unsigned i; for(i = 0; i < m_vertices.size(); i++) { if(calc_distance(x, y, m_vertices[i].x, m_vertices[i].y) < 5) { m_drag_idx = i; m_drag_dx = x - m_vertices[i].x; m_drag_dy = y - m_vertices[i].y; return true; } } } return false; } bool mesh_ctrl::on_mouse_move(double x, double y, unsigned flags) { if(flags & 1) { if(m_drag_idx >= 0) { m_vertices[m_drag_idx].x = x - m_drag_dx; m_vertices[m_drag_idx].y = y - m_drag_dy; return true; } } else { return on_mouse_button_up(x, y, flags); } return false; } bool mesh_ctrl::on_mouse_button_up(double x, double y, unsigned flags) { bool ret = m_drag_idx >= 0; m_drag_idx = -1; return ret; } class styles_gouraud { public: typedef span_gouraud_rgba gouraud_type; template styles_gouraud(const mesh_ctrl& mesh, const Gamma& gamma) { unsigned i; for(i = 0; i < mesh.num_triangles(); i++) { const agg::mesh_triangle& t = mesh.triangle(i); const agg::mesh_point& p1 = mesh.vertex(t.p1); const agg::mesh_point& p2 = mesh.vertex(t.p2); const agg::mesh_point& p3 = mesh.vertex(t.p3); agg::rgba8 c1 = p1.color; agg::rgba8 c2 = p2.color; agg::rgba8 c3 = p3.color; c1.apply_gamma_dir(gamma); c2.apply_gamma_dir(gamma); c3.apply_gamma_dir(gamma); gouraud_type gouraud(c1, c2, c3, p1.x, p1.y, p2.x, p2.y, p3.x, p3.y); gouraud.prepare(); m_triangles.add(gouraud); } } bool is_solid(unsigned style) const { return false; } rgba8 color(unsigned style) const { return rgba8(0,0,0,0); } void generate_span(rgba8* span, int x, int y, unsigned len, unsigned style) { m_triangles[style].generate(span, x, y, len); } private: pod_bvector m_triangles; }; } class the_application : public agg::platform_support { public: typedef agg::renderer_base renderer_base; typedef agg::renderer_scanline_aa_solid renderer_scanline; typedef agg::rasterizer_scanline_aa<> rasterizer_scanline; typedef agg::scanline_u8 scanline; agg::mesh_ctrl m_mesh; agg::gamma_lut<> m_gamma; the_application(agg::pix_format_e format, bool flip_y) : agg::platform_support(format, flip_y) { // m_gamma.gamma(2.0); } virtual void on_init() { m_mesh.generate(20, 20, 17, 17, 40, 40); } virtual void on_draw() { pixfmt pf(rbuf_window()); renderer_base ren_base(pf); ren_base.clear(agg::rgba(0, 0, 0)); renderer_scanline ren(ren_base); rasterizer_scanline ras; agg::scanline_u8 sl; agg::scanline_bin sl_bin; agg::rasterizer_compound_aa<> rasc; agg::span_allocator alloc; unsigned i; agg::styles_gouraud styles(m_mesh, m_gamma); start_timer(); rasc.reset(); //rasc.clip_box(40, 40, width() - 40, height() - 40); for(i = 0; i < m_mesh.num_edges(); i++) { const agg::mesh_edge& e = m_mesh.edge(i); const agg::mesh_point& p1 = m_mesh.vertex(e.p1); const agg::mesh_point& p2 = m_mesh.vertex(e.p2); rasc.styles(e.tl, e.tr); rasc.move_to_d(p1.x, p1.y); rasc.line_to_d(p2.x, p2.y); } agg::render_scanlines_compound(rasc, sl, sl_bin, ren_base, alloc, styles); double tm = elapsed_time(); char buf[256]; agg::gsv_text t; t.size(10.0); agg::conv_stroke pt(t); pt.width(1.5); pt.line_cap(agg::round_cap); pt.line_join(agg::round_join); sprintf(buf, "%3.2f ms, %d triangles, %.0f tri/sec", tm, m_mesh.num_triangles(), m_mesh.num_triangles() / tm * 1000.0); t.start_point(10.0, 10.0); t.text(buf); ras.add_path(pt); agg::render_scanlines_aa_solid(ras, sl, ren_base, agg::rgba(1,1,1)); if(m_gamma.gamma() != 1.0) { pf.apply_gamma_inv(m_gamma); } } virtual void on_mouse_move(int x, int y, unsigned flags) { if(m_mesh.on_mouse_move(x, y, flags)) { force_redraw(); } } virtual void on_mouse_button_down(int x, int y, unsigned flags) { if(m_mesh.on_mouse_button_down(x, y, flags)) { force_redraw(); } } virtual void on_mouse_button_up(int x, int y, unsigned flags) { if(m_mesh.on_mouse_button_up(x, y, flags)) { force_redraw(); } } virtual void on_key(int x, int y, unsigned key, unsigned flags) { } void on_idle() { m_mesh.randomize_points(1.0); m_mesh.rotate_colors(); force_redraw(); } virtual void on_ctrl_change() { } }; int agg_main(int argc, char* argv[]) { the_application app(agg::pix_format_bgra32, flip_y); app.caption("AGG Example"); if(app.init(400, 400, 0))//agg::window_resize)) { app.wait_mode(false); return app.run(); } return 1; } agg-2.5+dfsg1/examples/gpc_test.cpp0000644000000000000000000005031710703246330017416 0ustar00usergroup00000000000000#include #include "agg_conv_gpc.h" #include "agg_basics.h" #include "agg_rendering_buffer.h" #include "agg_rasterizer_scanline_aa.h" #include "agg_scanline_u.h" #include "agg_scanline_p.h" #include "agg_renderer_scanline.h" #include "agg_renderer_primitives.h" #include "agg_conv_curve.h" #include "agg_conv_stroke.h" #include "agg_conv_clip_polygon.h" #include "agg_gsv_text.h" #include "agg_pixfmt_rgb.h" #include "platform/agg_platform_support.h" #include "ctrl/agg_slider_ctrl.h" #include "ctrl/agg_cbox_ctrl.h" #include "ctrl/agg_rbox_ctrl.h" enum flip_y_e { flip_y = true }; class spiral { public: spiral(double x, double y, double r1, double r2, double step, double start_angle=0) : m_x(x), m_y(y), m_r1(r1), m_r2(r2), m_step(step), m_start_angle(start_angle), m_angle(start_angle), m_da(agg::deg2rad(4.0)), m_dr(m_step / 90.0) { } void rewind(unsigned) { m_angle = m_start_angle; m_curr_r = m_r1; m_start = true; } unsigned vertex(double* x, double* y) { if(m_curr_r > m_r2) return agg::path_cmd_stop; *x = m_x + cos(m_angle) * m_curr_r; *y = m_y + sin(m_angle) * m_curr_r; m_curr_r += m_dr; m_angle += m_da; if(m_start) { m_start = false; return agg::path_cmd_move_to; } return agg::path_cmd_line_to; } private: double m_x; double m_y; double m_r1; double m_r2; double m_step; double m_start_angle; double m_angle; double m_curr_r; double m_da; double m_dr; bool m_start; }; namespace agg { // A simple counter of points and contours template struct conv_poly_counter { unsigned m_contours; unsigned m_points; conv_poly_counter(Src& src) : m_src(&src), m_contours(0), m_points(0) {} void rewind(unsigned path_id) { m_contours = 0; m_points = 0; m_src->rewind(path_id); } unsigned vertex(double* x, double* y) { unsigned cmd = m_src->vertex(x, y); if(is_vertex(cmd)) ++m_points; if(is_move_to(cmd)) ++m_contours; return cmd; } private: Src* m_src; }; } void make_gb_poly(agg::path_storage& ps); void make_arrows(agg::path_storage& ps); class the_application : public agg::platform_support { agg::rbox_ctrl m_polygons; agg::rbox_ctrl m_operation; double m_x; double m_y; public: the_application(agg::pix_format_e format, bool flip_y) : agg::platform_support(format, flip_y), m_polygons (5.0, 5.0, 5.0+205.0, 110.0, !flip_y), m_operation(555.0, 5.0, 555.0+80.0, 130.0, !flip_y) { m_operation.add_item("None"); m_operation.add_item("OR"); m_operation.add_item("AND"); m_operation.add_item("XOR"); m_operation.add_item("A-B"); m_operation.add_item("B-A"); m_operation.cur_item(2); add_ctrl(m_operation); m_polygons.add_item("Two Simple Paths"); m_polygons.add_item("Closed Stroke"); m_polygons.add_item("Great Britain and Arrows"); m_polygons.add_item("Great Britain and Spiral"); m_polygons.add_item("Spiral and Glyph"); m_polygons.cur_item(3); add_ctrl(m_polygons); } template void perform_rendering(Scanline& sl, Ras& ras, Ren& ren, Gpc& gpc) { if(m_operation.cur_item() > 0) { ras.reset(); switch(m_operation.cur_item()) { case 1: gpc.operation(agg::gpc_or); break; case 2: gpc.operation(agg::gpc_and); break; case 3: gpc.operation(agg::gpc_xor); break; case 4: gpc.operation(agg::gpc_a_minus_b); break; case 5: gpc.operation(agg::gpc_b_minus_a); break; } agg::conv_poly_counter counter(gpc); start_timer(); counter.rewind(0); double t1 = elapsed_time(); ras.reset(); double x; double y; unsigned cmd; start_timer(); while(!agg::is_stop(cmd = counter.vertex(&x, &y))) { ras.add_vertex(x, y, cmd); } ren.color(agg::rgba(0.5, 0.0, 0, 0.5)); agg::render_scanlines(ras, sl, ren); double t2 = elapsed_time(); char buf[100]; sprintf(buf, "Contours: %d Points: %d", counter.m_contours, counter.m_points); agg::gsv_text txt; agg::conv_stroke txt_stroke(txt); txt_stroke.width(1.5); txt_stroke.line_cap(agg::round_cap); txt.size(10.0); txt.start_point(250, 5); txt.text(buf); ras.add_path(txt_stroke); ren.color(agg::rgba(0.0, 0.0, 0.0)); agg::render_scanlines(ras, sl, ren); sprintf(buf, "GPC=%.3fms Render=%.3fms", t1, t2); txt.start_point(250, 20); txt.text(buf); ras.add_path(txt_stroke); ren.color(agg::rgba(0.0, 0.0, 0.0)); agg::render_scanlines(ras, sl, ren); } } template unsigned render_gpc(Scanline& sl, Ras& ras) { agg::pixfmt_bgr24 pf(rbuf_window()); agg::renderer_base rb(pf); agg::renderer_scanline_aa_solid > ren(rb); switch(m_polygons.cur_item()) { case 0: { //------------------------------------ // Two simple paths // agg::path_storage ps1; agg::path_storage ps2; agg::conv_gpc gpc(ps1, ps2); double x = m_x - initial_width()/2 + 100; double y = m_y - initial_height()/2 + 100; ps1.move_to(x+140, y+145); ps1.line_to(x+225, y+44); ps1.line_to(x+296, y+219); ps1.close_polygon(); ps1.line_to(x+226, y+289); ps1.line_to(x+82, y+292); ps1.move_to(x+220, y+222); ps1.line_to(x+363, y+249); ps1.line_to(x+265, y+331); ps1.move_to(x+242, y+243); ps1.line_to(x+268, y+309); ps1.line_to(x+325, y+261); ps1.move_to(x+259, y+259); ps1.line_to(x+273, y+288); ps1.line_to(x+298, y+266); ps2.move_to(100+32, 100+77); ps2.line_to(100+473, 100+263); ps2.line_to(100+351, 100+290); ps2.line_to(100+354, 100+374); ras.reset(); ras.add_path(ps1); ren.color(agg::rgba(0, 0, 0, 0.1)); agg::render_scanlines(ras, sl, ren); ras.reset(); ras.add_path(ps2); ren.color(agg::rgba(0, 0.6, 0, 0.1)); agg::render_scanlines(ras, sl, ren); perform_rendering(sl, ras, ren, gpc); } break; case 1: { //------------------------------------ // Closed stroke // agg::path_storage ps1; agg::path_storage ps2; agg::conv_stroke stroke(ps2); stroke.width(10.0); agg::conv_gpc > gpc(ps1, stroke); double x = m_x - initial_width()/2 + 100; double y = m_y - initial_height()/2 + 100; ps1.move_to(x+140, y+145); ps1.line_to(x+225, y+44); ps1.line_to(x+296, y+219); ps1.close_polygon(); ps1.line_to(x+226, y+289); ps1.line_to(x+82, y+292); ps1.move_to(x+220-50, y+222); ps1.line_to(x+265-50, y+331); ps1.line_to(x+363-50, y+249); ps1.close_polygon(agg::path_flags_ccw); ps2.move_to(100+32, 100+77); ps2.line_to(100+473, 100+263); ps2.line_to(100+351, 100+290); ps2.line_to(100+354, 100+374); ps2.close_polygon(); ras.reset(); ras.add_path(ps1); ren.color(agg::rgba(0, 0, 0, 0.1)); agg::render_scanlines(ras, sl, ren); ras.reset(); ras.add_path(stroke); ren.color(agg::rgba(0, 0.6, 0, 0.1)); agg::render_scanlines(ras, sl, ren); perform_rendering(sl, ras, ren, gpc); } break; case 2: { //------------------------------------ // Great Britain and Arrows // agg::path_storage gb_poly; agg::path_storage arrows; make_gb_poly(gb_poly); make_arrows(arrows); agg::trans_affine mtx1; agg::trans_affine mtx2; mtx1 *= agg::trans_affine_translation(-1150, -1150); mtx1 *= agg::trans_affine_scaling(2.0); mtx2 = mtx1; mtx2 *= agg::trans_affine_translation(m_x - initial_width()/2, m_y - initial_height()/2); agg::conv_transform trans_gb_poly(gb_poly, mtx1); agg::conv_transform trans_arrows(arrows, mtx2); agg::conv_gpc, agg::conv_transform > gpc(trans_gb_poly, trans_arrows); ras.add_path(trans_gb_poly); ren.color(agg::rgba(0.5, 0.5, 0, 0.1)); agg::render_scanlines(ras, sl, ren); agg::conv_stroke > stroke_gb_poly(trans_gb_poly); stroke_gb_poly.width(0.1); ras.add_path(stroke_gb_poly); ren.color(agg::rgba(0, 0, 0)); agg::render_scanlines(ras, sl, ren); ras.add_path(trans_arrows); ren.color(agg::rgba(0.0, 0.5, 0.5, 0.1)); agg::render_scanlines(ras, sl, ren); perform_rendering(sl, ras, ren, gpc); } break; case 3: { //------------------------------------ // Great Britain and a Spiral // spiral sp(m_x, m_y, 10, 150, 30, 0.0); agg::conv_stroke stroke(sp); stroke.width(15.0); agg::path_storage gb_poly; make_gb_poly(gb_poly); agg::trans_affine mtx; mtx *= agg::trans_affine_translation(-1150, -1150); mtx *= agg::trans_affine_scaling(2.0); agg::conv_transform trans_gb_poly(gb_poly, mtx); agg::conv_gpc, agg::conv_stroke > gpc(trans_gb_poly, stroke); /* FILE* fd = fopen("contours.txt", "w"); if(fd) { unsigned cmd; double x, y; trans_gb_poly.rewind(0); while(!agg::is_stop(cmd = trans_gb_poly.vertex(&x, &y))) { if(agg::is_move_to(cmd)) { fprintf(fd, "\npoly[] = {\n"); } fprintf(fd, " %.3f, %.3f,\n", x, y); } stroke.rewind(0); while(!agg::is_stop(cmd = stroke.vertex(&x, &y))) { if(agg::is_move_to(cmd)) { fprintf(fd, "\nspiral[] = {\n"); } fprintf(fd, " %.3f, %.3f,\n", x, y); } fclose(fd); } */ ras.add_path(trans_gb_poly); ren.color(agg::rgba(0.5, 0.5, 0, 0.1)); agg::render_scanlines(ras, sl, ren); agg::conv_stroke > stroke_gb_poly(trans_gb_poly); stroke_gb_poly.width(0.1); ras.add_path(stroke_gb_poly); ren.color(agg::rgba(0, 0, 0)); agg::render_scanlines(ras, sl, ren); ras.add_path(stroke); ren.color(agg::rgba(0.0, 0.5, 0.5, 0.1)); agg::render_scanlines(ras, sl, ren); perform_rendering(sl, ras, ren, gpc); } break; case 4: { //------------------------------------ // Spiral and glyph // spiral sp(m_x, m_y, 10, 150, 30, 0.0); agg::conv_stroke stroke(sp); stroke.width(15.0); agg::path_storage glyph; glyph.move_to(28.47, 6.45); glyph.curve3(21.58, 1.12, 19.82, 0.29); glyph.curve3(17.19, -0.93, 14.21, -0.93); glyph.curve3(9.57, -0.93, 6.57, 2.25); glyph.curve3(3.56, 5.42, 3.56, 10.60); glyph.curve3(3.56, 13.87, 5.03, 16.26); glyph.curve3(7.03, 19.58, 11.99, 22.51); glyph.curve3(16.94, 25.44, 28.47, 29.64); glyph.line_to(28.47, 31.40); glyph.curve3(28.47, 38.09, 26.34, 40.58); glyph.curve3(24.22, 43.07, 20.17, 43.07); glyph.curve3(17.09, 43.07, 15.28, 41.41); glyph.curve3(13.43, 39.75, 13.43, 37.60); glyph.line_to(13.53, 34.77); glyph.curve3(13.53, 32.52, 12.38, 31.30); glyph.curve3(11.23, 30.08, 9.38, 30.08); glyph.curve3(7.57, 30.08, 6.42, 31.35); glyph.curve3(5.27, 32.62, 5.27, 34.81); glyph.curve3(5.27, 39.01, 9.57, 42.53); glyph.curve3(13.87, 46.04, 21.63, 46.04); glyph.curve3(27.59, 46.04, 31.40, 44.04); glyph.curve3(34.28, 42.53, 35.64, 39.31); glyph.curve3(36.52, 37.21, 36.52, 30.71); glyph.line_to(36.52, 15.53); glyph.curve3(36.52, 9.13, 36.77, 7.69); glyph.curve3(37.01, 6.25, 37.57, 5.76); glyph.curve3(38.13, 5.27, 38.87, 5.27); glyph.curve3(39.65, 5.27, 40.23, 5.62); glyph.curve3(41.26, 6.25, 44.19, 9.18); glyph.line_to(44.19, 6.45); glyph.curve3(38.72, -0.88, 33.74, -0.88); glyph.curve3(31.35, -0.88, 29.93, 0.78); glyph.curve3(28.52, 2.44, 28.47, 6.45); glyph.close_polygon(); glyph.move_to(28.47, 9.62); glyph.line_to(28.47, 26.66); glyph.curve3(21.09, 23.73, 18.95, 22.51); glyph.curve3(15.09, 20.36, 13.43, 18.02); glyph.curve3(11.77, 15.67, 11.77, 12.89); glyph.curve3(11.77, 9.38, 13.87, 7.06); glyph.curve3(15.97, 4.74, 18.70, 4.74); glyph.curve3(22.41, 4.74, 28.47, 9.62); glyph.close_polygon(); agg::trans_affine mtx; mtx *= agg::trans_affine_scaling(4.0); mtx *= agg::trans_affine_translation(220, 200); agg::conv_transform trans(glyph, mtx); agg::conv_curve > curve(trans); agg::conv_gpc, agg::conv_curve< agg::conv_transform< agg::path_storage> > > gpc(stroke, curve); ras.reset(); ras.add_path(stroke); ren.color(agg::rgba(0, 0, 0, 0.1)); agg::render_scanlines(ras, sl, ren); ras.reset(); ras.add_path(curve); ren.color(agg::rgba(0, 0.6, 0, 0.1)); agg::render_scanlines(ras, sl, ren); perform_rendering(sl, ras, ren, gpc); } break; } return 0; } virtual void on_init() { m_x = width() / 2.0; m_y = height() / 2.0; } virtual void on_draw() { typedef agg::renderer_base base_ren_type; agg::pixfmt_bgr24 pf(rbuf_window()); base_ren_type ren_base(pf); ren_base.clear(agg::rgba(1,1,1)); agg::scanline_u8 sl; agg::rasterizer_scanline_aa<> ras; render_gpc(sl, ras); agg::render_ctrl(ras, sl, ren_base, m_polygons); agg::render_ctrl(ras, sl, ren_base, m_operation); } /* // Stress-test. // Works quite well on random polygons, no crashes, no memory leaks! // Sometimes takes long to produce the result double random(double min, double max) { int r = (rand() << 15) | rand(); return ((r & 0xFFFFFFF) / double(0xFFFFFFF + 1)) * (max - min) + min; } virtual void on_mouse_button_down(int x, int y, unsigned flags) { agg::scanline_u8 sl; agg::rasterizer_scanline_aa<> ras; typedef agg::renderer_base base_ren_type; typedef agg::renderer_scanline_aa_solid renderer_solid; agg::pixfmt_bgr24 pf(rbuf_window()); base_ren_type ren_base(pf); renderer_solid ren_solid(ren_base); agg::path_storage ps1; agg::path_storage ps2; agg::conv_gpc gpc(ps1, ps2); unsigned i; for(i = 0; i < 1000; i++) { ren_base.clear(agg::rgba(1,1,1)); unsigned num_poly1 = rand() % 10 + 1; unsigned num_poly2 = rand() % 10 + 1; unsigned j; ps1.remove_all(); ps2.remove_all(); for(j = 0; j < num_poly1; j++) { ps1.move_to(random(0, width()), random(0, height())); unsigned k; unsigned np = rand() % 20 + 2; for(k = 0; k < np; k++) { ps1.line_to(random(0, width()), random(0, height())); } } for(j = 0; j < num_poly2; j++) { ps2.move_to(random(0, width()), random(0, height())); unsigned k; unsigned np = rand() % 20 + 2; for(k = 0; k < np; k++) { ps2.line_to(random(0, width()), random(0, height())); } } unsigned op = rand() % 5; switch(op) { case 0: gpc.operation(agg::gpc_or); break; case 1: gpc.operation(agg::gpc_and); break; case 2: gpc.operation(agg::gpc_xor); break; case 3: gpc.operation(agg::gpc_a_minus_b); break; case 4: gpc.operation(agg::gpc_b_minus_a); break; } ras.add_path(gpc); ren_solid.color(agg::rgba(0.5, 0.0, 0, 0.5)); agg::render_scanlines(ras, sl, ren_solid); update_window(); } message("Done"); } */ virtual void on_mouse_button_down(int x, int y, unsigned flags) { if(flags & agg::mouse_left) { m_x = x; m_y = y; force_redraw(); } if(flags & agg::mouse_right) { char buf[100]; sprintf(buf, "%d %d", x, y); message(buf); } } virtual void on_mouse_move(int x, int y, unsigned flags) { if(flags & agg::mouse_left) { m_x = x; m_y = y; force_redraw(); } } }; int agg_main(int argc, char* argv[]) { the_application app(agg::pix_format_bgr24, flip_y); app.caption("AGG Example. General Polygon Clipping (GPC)"); if(app.init(640, 520, agg::window_resize)) { return app.run(); } return 1; } agg-2.5+dfsg1/examples/gradient_focal.cpp0000644000000000000000000002034310703246330020543 0ustar00usergroup00000000000000#include #include #include #include "agg_rendering_buffer.h" #include "agg_rasterizer_scanline_aa.h" #include "agg_scanline_u.h" #include "agg_renderer_scanline.h" #include "agg_span_allocator.h" #include "agg_span_gradient.h" #include "agg_gradient_lut.h" #include "agg_gamma_lut.h" #include "agg_span_interpolator_linear.h" #include "ctrl/agg_slider_ctrl.h" #include "platform/agg_platform_support.h" #include "agg_pixfmt_rgb.h" #define pix_format agg::pix_format_bgr24 typedef agg::pixfmt_bgr24 pixfmt; typedef agg::rgba8 color_type; typedef agg::order_bgr component_order; enum { flip_y = true }; class the_application : public agg::platform_support { typedef agg::renderer_base renderer_base; typedef agg::renderer_scanline_aa_solid renderer_solid; typedef agg::gamma_lut gamma_lut_type; typedef agg::gradient_radial_focus gradient_func_type; typedef agg::gradient_reflect_adaptor gradient_adaptor_type; typedef agg::gradient_lut, 1024> color_func_type; typedef agg::span_interpolator_linear<> interpolator_type; typedef agg::span_allocator span_allocator_type; typedef agg::span_gradient span_gradient_type; agg::slider_ctrl m_gamma; agg::scanline_u8 m_scanline; agg::rasterizer_scanline_aa<> m_rasterizer; span_allocator_type m_alloc; color_func_type m_gradient_lut; gamma_lut_type m_gamma_lut; double m_mouse_x, m_mouse_y; double m_old_gamma; public: the_application(agg::pix_format_e format, bool flip_y) : agg::platform_support(format, flip_y), m_gamma(5.0, 5.0, 340.0, 12.0, !flip_y), m_mouse_x(200), m_mouse_y(200) { m_gamma.range(0.5, 2.5); m_gamma.value(1.8); m_gamma.label("Gamma = %.3f"); add_ctrl(m_gamma); m_gamma.no_transform(); m_gamma_lut.gamma(m_gamma.value()); m_old_gamma = m_gamma.value(); build_gradient_lut(); } virtual void on_init() { m_mouse_y = initial_height() / 2; m_mouse_x = initial_width() / 2; } void build_gradient_lut() { m_gradient_lut.remove_all(); m_gradient_lut.add_color(0.0, agg::rgba8_gamma_dir(agg::rgba8(0, 255, 0), m_gamma_lut)); m_gradient_lut.add_color(0.2, agg::rgba8_gamma_dir(agg::rgba8(120, 0, 0), m_gamma_lut)); m_gradient_lut.add_color(0.7, agg::rgba8_gamma_dir(agg::rgba8(120, 120, 0), m_gamma_lut)); m_gradient_lut.add_color(1.0, agg::rgba8_gamma_dir(agg::rgba8(0, 0, 255), m_gamma_lut)); //m_gradient_lut.add_color(0.0, agg::rgba8::from_wavelength(380, m_gamma.value())); //m_gradient_lut.add_color(0.1, agg::rgba8::from_wavelength(420, m_gamma.value())); //m_gradient_lut.add_color(0.2, agg::rgba8::from_wavelength(460, m_gamma.value())); //m_gradient_lut.add_color(0.3, agg::rgba8::from_wavelength(500, m_gamma.value())); //m_gradient_lut.add_color(0.4, agg::rgba8::from_wavelength(540, m_gamma.value())); //m_gradient_lut.add_color(0.5, agg::rgba8::from_wavelength(580, m_gamma.value())); //m_gradient_lut.add_color(0.6, agg::rgba8::from_wavelength(620, m_gamma.value())); //m_gradient_lut.add_color(0.7, agg::rgba8::from_wavelength(660, m_gamma.value())); //m_gradient_lut.add_color(0.8, agg::rgba8::from_wavelength(700, m_gamma.value())); //m_gradient_lut.add_color(0.9, agg::rgba8::from_wavelength(740, m_gamma.value())); //m_gradient_lut.add_color(1.0, agg::rgba8::from_wavelength(780, m_gamma.value())); m_gradient_lut.build_lut(); } virtual void on_draw() { pixfmt pixf(rbuf_window()); renderer_base rb(pixf); renderer_solid rs(rb); rb.clear(agg::rgba(1, 1, 1)); // When Gamma changes rebuild the gamma and gradient LUTs //------------------ if(m_old_gamma != m_gamma.value()) { m_gamma_lut.gamma(m_gamma.value()); build_gradient_lut(); m_old_gamma = m_gamma.value(); } // Gradient center. All gradient functions assume the // center being in the origin (0,0) and you can't // change it. But you can apply arbitrary transformations // to the gradient (see below). //------------------ double cx = initial_width() / 2; double cy = initial_height() / 2; double r = 100; // Focal center. Defined in the gradient coordinates, // that is, with respect to the origin (0,0) //------------------ double fx = m_mouse_x - cx; double fy = m_mouse_y - cy; gradient_func_type gradient_func(r, fx, fy); gradient_adaptor_type gradient_adaptor(gradient_func); agg::trans_affine gradient_mtx; // Making the affine matrix. Move to (cx,cy), // apply the resizing transformations and invert // the matrix. Gradients and images always assume the // inverse transformations. //------------------ gradient_mtx.translate(cx, cy); gradient_mtx *= trans_affine_resizing(); gradient_mtx.invert(); interpolator_type span_interpolator(gradient_mtx); span_gradient_type span_gradient(span_interpolator, gradient_adaptor, m_gradient_lut, 0, r); // Form the simple rectangle //------------------ m_rasterizer.reset(); m_rasterizer.move_to_d(0,0); m_rasterizer.line_to_d(width(), 0); m_rasterizer.line_to_d(width(), height()); m_rasterizer.line_to_d(0, height()); // Render the gradient to the whole screen and measure the time //------------------ start_timer(); agg::render_scanlines_aa(m_rasterizer, m_scanline, rb, m_alloc, span_gradient); double tm = elapsed_time(); // Draw the transformed circle that shows the gradient boundary //------------------ agg::ellipse e(cx, cy, r, r); agg::conv_stroke estr(e); agg::conv_transform< agg::conv_stroke< agg::ellipse> > etrans(estr, trans_affine_resizing()); m_rasterizer.add_path(etrans); agg::render_scanlines_aa_solid(m_rasterizer, m_scanline, rb, agg::rgba(1,1,1)); // Show the gradient time //------------------ char buf[64]; agg::gsv_text t; t.size(10.0); agg::conv_stroke pt(t); pt.width(1.5); sprintf(buf, "%3.2f ms", tm); t.start_point(10.0, 35.0); t.text(buf); m_rasterizer.add_path(pt); agg::render_scanlines_aa_solid(m_rasterizer, m_scanline, rb, agg::rgba(0,0,0)); // Show the controls //------------------ agg::render_ctrl(m_rasterizer, m_scanline, rb, m_gamma); // Apply the inverse gamma to the whole buffer // (transform the colors to the perceptually uniform space) //------------------ pixf.apply_gamma_inv(m_gamma_lut); } virtual void on_mouse_move(int x, int y, unsigned flags) { if(flags & agg::mouse_left) { m_mouse_x = x; m_mouse_y = y; trans_affine_resizing().inverse_transform(&m_mouse_x, &m_mouse_y); force_redraw(); } } virtual void on_mouse_button_down(int x, int y, unsigned flags) { if(flags & agg::mouse_left) { m_mouse_x = x; m_mouse_y = y; trans_affine_resizing().inverse_transform(&m_mouse_x, &m_mouse_y); force_redraw(); } } }; int agg_main(int argc, char* argv[]) { the_application app(pix_format, flip_y); app.caption("AGG Example. PDF linear and radial gradients"); if(app.init(600, 400, agg::window_resize)) { return app.run(); } return 1; } agg-2.5+dfsg1/examples/gradients.cpp0000644000000000000000000004310710703246330017565 0ustar00usergroup00000000000000#include #include #include "agg_rendering_buffer.h" #include "agg_rasterizer_scanline_aa.h" #include "agg_scanline_u.h" #include "agg_scanline_p.h" #include "agg_conv_transform.h" #include "agg_color_rgba.h" #include "agg_color_gray.h" #include "agg_span_allocator.h" #include "agg_span_gradient.h" #include "agg_span_interpolator_linear.h" #include "agg_renderer_scanline.h" #include "ctrl/agg_rbox_ctrl.h" #include "ctrl/agg_spline_ctrl.h" #include "ctrl/agg_gamma_ctrl.h" #include "platform/agg_platform_support.h" //#define AGG_GRAY16 #define AGG_BGR24 //#define AGG_RGB24 //#define AGG_RGB_AAA //#define AGG_RGBA32 //#define AGG_ARGB32 //#define AGG_ABGR32 //#define AGG_RGB565 //#define AGG_RGB555 #include "pixel_formats.h" enum flip_y_e { flip_y = true }; const double center_x = 350; const double center_y = 280; class gradient_polymorphic_wrapper_base { public: virtual int calculate(int x, int y, int) const = 0; }; template class gradient_polymorphic_wrapper : public gradient_polymorphic_wrapper_base { public: gradient_polymorphic_wrapper() : m_adaptor(m_gradient) {} virtual int calculate(int x, int y, int d) const { return m_adaptor.calculate(x, y, d); } GradientF m_gradient; agg::gradient_reflect_adaptor m_adaptor; }; struct color_function_profile { color_function_profile() {} color_function_profile(const color_type* colors, const agg::int8u* profile) : m_colors(colors), m_profile(profile) {} static unsigned size() { return 256; } const color_type& operator [] (unsigned v) const { return m_colors[m_profile[v]]; } const color_type* m_colors; const agg::int8u* m_profile; }; class the_application : public agg::platform_support { agg::gamma_ctrl m_profile; agg::spline_ctrl m_spline_r; agg::spline_ctrl m_spline_g; agg::spline_ctrl m_spline_b; agg::spline_ctrl m_spline_a; agg::rbox_ctrl m_rbox; double m_pdx; double m_pdy; double m_center_x; double m_center_y; double m_scale; double m_prev_scale; double m_angle; double m_prev_angle; double m_scale_x; double m_prev_scale_x; double m_scale_y; double m_prev_scale_y; bool m_mouse_move; public: virtual ~the_application() { FILE* fd = fopen(full_file_name("settings.dat"), "w"); fprintf(fd, "%f\n", m_center_x); fprintf(fd, "%f\n", m_center_y); fprintf(fd, "%f\n", m_scale); fprintf(fd, "%f\n", m_angle); fprintf(fd, "%f\n", m_spline_r.x(0)); fprintf(fd, "%f\n", m_spline_r.y(0)); fprintf(fd, "%f\n", m_spline_r.x(1)); fprintf(fd, "%f\n", m_spline_r.y(1)); fprintf(fd, "%f\n", m_spline_r.x(2)); fprintf(fd, "%f\n", m_spline_r.y(2)); fprintf(fd, "%f\n", m_spline_r.x(3)); fprintf(fd, "%f\n", m_spline_r.y(3)); fprintf(fd, "%f\n", m_spline_r.x(4)); fprintf(fd, "%f\n", m_spline_r.y(4)); fprintf(fd, "%f\n", m_spline_r.x(5)); fprintf(fd, "%f\n", m_spline_r.y(5)); fprintf(fd, "%f\n", m_spline_g.x(0)); fprintf(fd, "%f\n", m_spline_g.y(0)); fprintf(fd, "%f\n", m_spline_g.x(1)); fprintf(fd, "%f\n", m_spline_g.y(1)); fprintf(fd, "%f\n", m_spline_g.x(2)); fprintf(fd, "%f\n", m_spline_g.y(2)); fprintf(fd, "%f\n", m_spline_g.x(3)); fprintf(fd, "%f\n", m_spline_g.y(3)); fprintf(fd, "%f\n", m_spline_g.x(4)); fprintf(fd, "%f\n", m_spline_g.y(4)); fprintf(fd, "%f\n", m_spline_g.x(5)); fprintf(fd, "%f\n", m_spline_g.y(5)); fprintf(fd, "%f\n", m_spline_b.x(0)); fprintf(fd, "%f\n", m_spline_b.y(0)); fprintf(fd, "%f\n", m_spline_b.x(1)); fprintf(fd, "%f\n", m_spline_b.y(1)); fprintf(fd, "%f\n", m_spline_b.x(2)); fprintf(fd, "%f\n", m_spline_b.y(2)); fprintf(fd, "%f\n", m_spline_b.x(3)); fprintf(fd, "%f\n", m_spline_b.y(3)); fprintf(fd, "%f\n", m_spline_b.x(4)); fprintf(fd, "%f\n", m_spline_b.y(4)); fprintf(fd, "%f\n", m_spline_b.x(5)); fprintf(fd, "%f\n", m_spline_b.y(5)); fprintf(fd, "%f\n", m_spline_a.x(0)); fprintf(fd, "%f\n", m_spline_a.y(0)); fprintf(fd, "%f\n", m_spline_a.x(1)); fprintf(fd, "%f\n", m_spline_a.y(1)); fprintf(fd, "%f\n", m_spline_a.x(2)); fprintf(fd, "%f\n", m_spline_a.y(2)); fprintf(fd, "%f\n", m_spline_a.x(3)); fprintf(fd, "%f\n", m_spline_a.y(3)); fprintf(fd, "%f\n", m_spline_a.x(4)); fprintf(fd, "%f\n", m_spline_a.y(4)); fprintf(fd, "%f\n", m_spline_a.x(5)); fprintf(fd, "%f\n", m_spline_a.y(5)); double x1,y1,x2,y2; m_profile.values(&x1, &y1, &x2, &y2); fprintf(fd, "%f\n", x1); fprintf(fd, "%f\n", y1); fprintf(fd, "%f\n", x2); fprintf(fd, "%f\n", y2); fclose(fd); } the_application(agg::pix_format_e format, bool flip_y) : agg::platform_support(format, flip_y), m_profile(10.0, 10.0, 200.0, 170.0-5.0, !flip_y), m_spline_r(210, 10, 210+250, 5+40, 6, !flip_y), m_spline_g(210, 10+40, 210+250, 5+80, 6, !flip_y), m_spline_b(210, 10+80, 210+250, 5+120, 6, !flip_y), m_spline_a(210, 10+120, 210+250, 5+160, 6, !flip_y), m_rbox(10.0, 180.0, 200.0, 300.0, !flip_y), m_pdx(0.0), m_pdy(0.0), m_center_x(center_x), m_center_y(center_y), m_scale(1.0), m_prev_scale(1.0), m_angle(0.0), m_prev_angle(0.0), m_scale_x(1.0), m_prev_scale_x(1.0), m_scale_y(1.0), m_prev_scale_y(1.0), m_mouse_move(false) { add_ctrl(m_profile); add_ctrl(m_spline_r); add_ctrl(m_spline_g); add_ctrl(m_spline_b); add_ctrl(m_spline_a); add_ctrl(m_rbox); m_profile.border_width(2.0, 2.0); m_spline_r.background_color(agg::rgba(1.0, 0.8, 0.8)); m_spline_g.background_color(agg::rgba(0.8, 1.0, 0.8)); m_spline_b.background_color(agg::rgba(0.8, 0.8, 1.0)); m_spline_a.background_color(agg::rgba(1.0, 1.0, 1.0)); m_spline_r.border_width(1.0, 2.0); m_spline_g.border_width(1.0, 2.0); m_spline_b.border_width(1.0, 2.0); m_spline_a.border_width(1.0, 2.0); m_rbox.border_width(2.0, 2.0); m_spline_r.point(0, 0.0, 1.0); m_spline_r.point(1, 1.0/5.0, 1.0 - 1.0/5.0); m_spline_r.point(2, 2.0/5.0, 1.0 - 2.0/5.0); m_spline_r.point(3, 3.0/5.0, 1.0 - 3.0/5.0); m_spline_r.point(4, 4.0/5.0, 1.0 - 4.0/5.0); m_spline_r.point(5, 1.0, 0.0); m_spline_r.update_spline(); m_spline_g.point(0, 0.0, 1.0); m_spline_g.point(1, 1.0/5.0, 1.0 - 1.0/5.0); m_spline_g.point(2, 2.0/5.0, 1.0 - 2.0/5.0); m_spline_g.point(3, 3.0/5.0, 1.0 - 3.0/5.0); m_spline_g.point(4, 4.0/5.0, 1.0 - 4.0/5.0); m_spline_g.point(5, 1.0, 0.0); m_spline_g.update_spline(); m_spline_b.point(0, 0.0, 1.0); m_spline_b.point(1, 1.0/5.0, 1.0 - 1.0/5.0); m_spline_b.point(2, 2.0/5.0, 1.0 - 2.0/5.0); m_spline_b.point(3, 3.0/5.0, 1.0 - 3.0/5.0); m_spline_b.point(4, 4.0/5.0, 1.0 - 4.0/5.0); m_spline_b.point(5, 1.0, 0.0); m_spline_b.update_spline(); m_spline_a.point(0, 0.0, 1.0); m_spline_a.point(1, 1.0/5.0, 1.0); m_spline_a.point(2, 2.0/5.0, 1.0); m_spline_a.point(3, 3.0/5.0, 1.0); m_spline_a.point(4, 4.0/5.0, 1.0); m_spline_a.point(5, 1.0, 1.0); m_spline_a.update_spline(); m_rbox.add_item("Circular"); m_rbox.add_item("Diamond"); m_rbox.add_item("Linear"); m_rbox.add_item("XY"); m_rbox.add_item("sqrt(XY)"); m_rbox.add_item("Conic"); m_rbox.cur_item(0); FILE* fd = fopen(full_file_name("settings.dat"), "r"); if(fd) { float x; float y; float x2; float y2; float t; fscanf(fd, "%f\n", &t); m_center_x = t; fscanf(fd, "%f\n", &t); m_center_y = t; fscanf(fd, "%f\n", &t); m_scale = t; fscanf(fd, "%f\n", &t); m_angle = t; fscanf(fd, "%f\n", &x); fscanf(fd, "%f\n", &y); m_spline_r.point(0, x, y); fscanf(fd, "%f\n", &x); fscanf(fd, "%f\n", &y); m_spline_r.point(1, x, y); fscanf(fd, "%f\n", &x); fscanf(fd, "%f\n", &y); m_spline_r.point(2, x, y); fscanf(fd, "%f\n", &x); fscanf(fd, "%f\n", &y); m_spline_r.point(3, x, y); fscanf(fd, "%f\n", &x); fscanf(fd, "%f\n", &y); m_spline_r.point(4, x, y); fscanf(fd, "%f\n", &x); fscanf(fd, "%f\n", &y); m_spline_r.point(5, x, y); fscanf(fd, "%f\n", &x); fscanf(fd, "%f\n", &y); m_spline_g.point(0, x, y); fscanf(fd, "%f\n", &x); fscanf(fd, "%f\n", &y); m_spline_g.point(1, x, y); fscanf(fd, "%f\n", &x); fscanf(fd, "%f\n", &y); m_spline_g.point(2, x, y); fscanf(fd, "%f\n", &x); fscanf(fd, "%f\n", &y); m_spline_g.point(3, x, y); fscanf(fd, "%f\n", &x); fscanf(fd, "%f\n", &y); m_spline_g.point(4, x, y); fscanf(fd, "%f\n", &x); fscanf(fd, "%f\n", &y); m_spline_g.point(5, x, y); fscanf(fd, "%f\n", &x); fscanf(fd, "%f\n", &y); m_spline_b.point(0, x, y); fscanf(fd, "%f\n", &x); fscanf(fd, "%f\n", &y); m_spline_b.point(1, x, y); fscanf(fd, "%f\n", &x); fscanf(fd, "%f\n", &y); m_spline_b.point(2, x, y); fscanf(fd, "%f\n", &x); fscanf(fd, "%f\n", &y); m_spline_b.point(3, x, y); fscanf(fd, "%f\n", &x); fscanf(fd, "%f\n", &y); m_spline_b.point(4, x, y); fscanf(fd, "%f\n", &x); fscanf(fd, "%f\n", &y); m_spline_b.point(5, x, y); fscanf(fd, "%f\n", &x); fscanf(fd, "%f\n", &y); m_spline_a.point(0, x, y); fscanf(fd, "%f\n", &x); fscanf(fd, "%f\n", &y); m_spline_a.point(1, x, y); fscanf(fd, "%f\n", &x); fscanf(fd, "%f\n", &y); m_spline_a.point(2, x, y); fscanf(fd, "%f\n", &x); fscanf(fd, "%f\n", &y); m_spline_a.point(3, x, y); fscanf(fd, "%f\n", &x); fscanf(fd, "%f\n", &y); m_spline_a.point(4, x, y); fscanf(fd, "%f\n", &x); fscanf(fd, "%f\n", &y); m_spline_a.point(5, x, y); m_spline_r.update_spline(); m_spline_g.update_spline(); m_spline_b.update_spline(); m_spline_a.update_spline(); fscanf(fd, "%f\n", &x); fscanf(fd, "%f\n", &y); fscanf(fd, "%f\n", &x2); fscanf(fd, "%f\n", &y2); m_profile.values(x, y, x2, y2); fclose(fd); } } virtual void on_draw() { agg::rasterizer_scanline_aa<> ras; typedef agg::renderer_base renderer_base; agg::scanline_u8 sl; pixfmt pixf(rbuf_window()); renderer_base rb(pixf); rb.clear(agg::rgba(0, 0, 0)); m_profile.text_size(8.0); agg::render_ctrl(ras, sl, rb, m_profile); agg::render_ctrl(ras, sl, rb, m_spline_r); agg::render_ctrl(ras, sl, rb, m_spline_g); agg::render_ctrl(ras, sl, rb, m_spline_b); agg::render_ctrl(ras, sl, rb, m_spline_a); agg::render_ctrl(ras, sl, rb, m_rbox); double ini_scale = 1.0; agg::trans_affine mtx1; mtx1 *= agg::trans_affine_scaling(ini_scale, ini_scale); mtx1 *= agg::trans_affine_rotation(agg::deg2rad(0.0)); mtx1 *= agg::trans_affine_translation(center_x, center_y); mtx1 *= trans_affine_resizing(); agg::ellipse e1; e1.init(0.0, 0.0, 110.0, 110.0, 64); agg::trans_affine mtx_g1; mtx_g1 *= agg::trans_affine_scaling(ini_scale, ini_scale); mtx_g1 *= agg::trans_affine_scaling(m_scale, m_scale); mtx_g1 *= agg::trans_affine_scaling(m_scale_x, m_scale_y); mtx_g1 *= agg::trans_affine_rotation(m_angle); mtx_g1 *= agg::trans_affine_translation(m_center_x, m_center_y); mtx_g1 *= trans_affine_resizing(); mtx_g1.invert(); color_type color_profile[256]; // color_type is defined in pixel_formats.h int i; for(i = 0; i < 256; i++) { color_profile[i] = color_type(agg::rgba(m_spline_r.spline()[i], m_spline_g.spline()[i], m_spline_b.spline()[i], m_spline_a.spline()[i])); } agg::conv_transform t1(e1, mtx1); gradient_polymorphic_wrapper gr_circle; gradient_polymorphic_wrapper gr_diamond; gradient_polymorphic_wrapper gr_x; gradient_polymorphic_wrapper gr_xy; gradient_polymorphic_wrapper gr_sqrt_xy; gradient_polymorphic_wrapper gr_conic; gradient_polymorphic_wrapper_base* gr_ptr = &gr_circle; // gr_circle.m_gradient.init(150, 80, 80); switch(m_rbox.cur_item()) { case 1: gr_ptr = &gr_diamond; break; case 2: gr_ptr = &gr_x; break; case 3: gr_ptr = &gr_xy; break; case 4: gr_ptr = &gr_sqrt_xy; break; case 5: gr_ptr = &gr_conic; break; } typedef agg::span_interpolator_linear<> interpolator_type; typedef agg::span_gradient gradient_span_gen; typedef agg::span_allocator gradient_span_alloc; gradient_span_alloc span_alloc; color_function_profile colors(color_profile, m_profile.gamma()); interpolator_type inter(mtx_g1); gradient_span_gen span_gen(inter, *gr_ptr, colors, 0, 150); ras.add_path(t1); agg::render_scanlines_aa(ras, sl, rb, span_alloc, span_gen); } virtual void on_mouse_move(int x, int y, unsigned flags) { if(m_mouse_move) { double x2 = x; double y2 = y; trans_affine_resizing().inverse_transform(&x2, &y2); if(flags & agg::kbd_ctrl) { double dx = x2 - m_center_x; double dy = y2 - m_center_y; m_scale_x = m_prev_scale_x * dx / m_pdx; m_scale_y = m_prev_scale_y * dy / m_pdy; force_redraw(); } else { if(flags & agg::mouse_left) { m_center_x = x2 + m_pdx; m_center_y = y2 + m_pdy; force_redraw(); } if(flags & agg::mouse_right) { double dx = x2 - m_center_x; double dy = y2 - m_center_y; m_scale = m_prev_scale * sqrt(dx * dx + dy * dy) / sqrt(m_pdx * m_pdx + m_pdy * m_pdy); m_angle = m_prev_angle + atan2(dy, dx) - atan2(m_pdy, m_pdx); force_redraw(); } } } } virtual void on_mouse_button_down(int x, int y, unsigned flags) { m_mouse_move = true; double x2 = x; double y2 = y; trans_affine_resizing().inverse_transform(&x2, &y2); m_pdx = m_center_x - x2; m_pdy = m_center_y - y2; m_prev_scale = m_scale; m_prev_angle = m_angle + agg::pi; m_prev_scale_x = m_scale_x; m_prev_scale_y = m_scale_y; force_redraw(); } virtual void on_mouse_button_up(int x, int y, unsigned flags) { m_mouse_move = false; } virtual void on_key(int x, int y, unsigned key, unsigned flags) { if(key == agg::key_f1) { FILE* fd = fopen(full_file_name("colors.dat"), "w"); int i; for(i = 0; i < 256; i++) { color_type c = agg::rgba(m_spline_r.spline()[i], m_spline_g.spline()[i], m_spline_b.spline()[i], m_spline_a.spline()[i]); fprintf(fd, " %3d, %3d, %3d, %3d,\n", c.r, c.g, c.b, c.a); } fclose(fd); fd = fopen(full_file_name("profile.dat"), "w"); for(i = 0; i < 256; i++) { fprintf(fd, "%3d, ", unsigned(m_profile.gamma()[i])); if((i & 0xF) == 0xF) fprintf(fd, "\n"); } fclose(fd); } } }; int agg_main(int argc, char* argv[]) { //#ifdef _WIN32 // FILE* fd = fopen("stdout.txt", "w"); fclose(fd); //#endif //AGG_WATCHDOGGY(wd1, false); the_application app(pix_format, flip_y); app.caption("AGG gradients with Mach bands compensation"); if(app.init(512, 400, agg::window_resize | agg::window_hw_buffer)) { return app.run(); } return 1; } agg-2.5+dfsg1/examples/graph_test.cpp0000644000000000000000000006373710703246330017760 0ustar00usergroup00000000000000#include #include #include "agg_basics.h" #include "agg_rendering_buffer.h" #include "agg_rasterizer_scanline_aa.h" #include "agg_rasterizer_outline.h" #include "agg_conv_stroke.h" #include "agg_conv_dash.h" #include "agg_conv_curve.h" #include "agg_conv_contour.h" #include "agg_conv_marker.h" #include "agg_conv_shorten_path.h" #include "agg_conv_marker_adaptor.h" #include "agg_conv_concat.h" #include "agg_arrowhead.h" #include "agg_vcgen_markers_term.h" #include "agg_scanline_p.h" #include "agg_scanline_u.h" #include "agg_renderer_scanline.h" #include "agg_renderer_primitives.h" #include "agg_span_allocator.h" #include "agg_span_gradient.h" #include "agg_span_interpolator_linear.h" #include "agg_pixfmt_rgb.h" #include "ctrl/agg_slider_ctrl.h" #include "ctrl/agg_rbox_ctrl.h" #include "ctrl/agg_cbox_ctrl.h" #include "platform/agg_platform_support.h" enum flip_y_e { flip_y = true }; typedef agg::pixfmt_bgr24 pixfmt; typedef pixfmt::color_type color_type; typedef agg::renderer_base base_renderer; typedef agg::renderer_primitives primitives_renderer; typedef agg::renderer_scanline_aa_solid solid_renderer; typedef agg::renderer_scanline_bin_solid draft_renderer; typedef agg::gradient_radial_d gradient_function; typedef agg::span_interpolator_linear<> interpolator; typedef agg::pod_auto_array color_array_type; typedef agg::span_gradient gradient_span_gen; typedef agg::span_allocator gradient_span_alloc; typedef agg::renderer_scanline_aa gradient_renderer; typedef agg::rasterizer_scanline_aa<> scanline_rasterizer; typedef agg::rasterizer_outline outline_rasterizer; //============================================================================ class graph { public: struct node { double x, y; node() {} node(double x_, double y_) : x(x_), y(y_) {} }; struct edge { int node1; int node2; edge() {} edge(int n1, int n2) : node1(n1), node2(n2) {} }; ~graph() { delete [] m_edges; delete [] m_nodes; } graph(int num_nodes, int num_edges) : m_num_nodes(num_nodes), m_num_edges(num_edges), m_nodes(new node[num_nodes]), m_edges(new edge[num_edges]) { int i; srand(100); for(i = 0; i < m_num_nodes; i++) { m_nodes[i].x = (double(rand()) / RAND_MAX) * 0.75 + 0.2; m_nodes[i].y = (double(rand()) / RAND_MAX) * 0.85 + 0.1; } for(i = 0; i < m_num_edges; i++) { m_edges[i].node1 = rand() % m_num_nodes; m_edges[i].node2 = rand() % m_num_nodes; if(m_edges[i].node1 == m_edges[i].node2) i--; } } int get_num_nodes() const { return m_num_nodes; } int get_num_edges() const { return m_num_edges; } node get_node(int idx, double w, double h) const { node p(0.0, 0.0); if(idx < m_num_nodes) { p = m_nodes[idx]; p.x = p.x * w; p.y = p.y * h; } return p; } edge get_edge(int idx) const { edge b(0,0); if(idx < m_num_edges) { b = m_edges[idx]; } return b; } private: graph(const graph&); const graph& operator = (const graph&); int m_num_nodes; int m_num_edges; node* m_nodes; edge* m_edges; }; //============================================================================ struct line { double x1, y1, x2, y2; int f; line(double x1_, double y1_, double x2_, double y2_) : x1(x1_), y1(y1_), x2(x2_), y2(y2_), f(0) {} void rewind(unsigned) { f = 0; } unsigned vertex(double* x, double* y) { if(f == 0) { ++f; *x = x1; *y = y1; return agg::path_cmd_move_to; } if(f == 1) { ++f; *x = x2; *y = y2; return agg::path_cmd_line_to; } return agg::path_cmd_stop; } }; //============================================================================ struct curve { agg::curve4 c; curve(double x1, double y1, double x2, double y2, double k=0.5) { c.init(x1, y1, x1 - (y2 - y1) * k, y1 + (x2 - x1) * k, x2 + (y2 - y1) * k, y2 - (x2 - x1) * k, x2, y2); } void rewind(unsigned path_id) { c.rewind(path_id); } unsigned vertex(double* x, double* y) { return c.vertex(x, y); } }; //============================================================================ template struct stroke_draft_simple { Source& s; stroke_draft_simple(Source& src, double w) : s(src) { } void rewind(unsigned path_id) { s.rewind(path_id); } unsigned vertex(double* x, double* y) { return s.vertex(x, y); } }; //============================================================================ template struct stroke_draft_arrow { typedef agg::conv_marker_adaptor stroke_type; typedef agg::conv_marker marker_type; typedef agg::conv_concat concat_type; stroke_type s; agg::arrowhead ah; marker_type m; concat_type c; stroke_draft_arrow(Source& src, double w) : s(src), ah(), m(s.markers(), ah), c(s, m) { ah.head(0, 10, 5, 0); s.shorten(10.0); } void rewind(unsigned path_id) { c.rewind(path_id); } unsigned vertex(double* x, double* y) { return c.vertex(x, y); } }; //============================================================================ template struct stroke_fine_simple { typedef agg::conv_stroke stroke_type; stroke_type s; stroke_fine_simple(Source& src, double w) : s(src) { s.width(w); } void rewind(unsigned path_id) { s.rewind(path_id); } unsigned vertex(double* x, double* y) { return s.vertex(x, y); } }; //============================================================================ template struct stroke_fine_arrow { typedef agg::conv_stroke stroke_type; typedef agg::conv_marker marker_type; typedef agg::conv_concat concat_type; stroke_type s; agg::arrowhead ah; marker_type m; concat_type c; stroke_fine_arrow(Source& src, double w) : s(src), ah(), m(s.markers(), ah), c(s, m) { s.width(w); ah.head(0, 10, 5, 0); s.shorten(w * 2.0); } void rewind(unsigned path_id) { c.rewind(path_id); } unsigned vertex(double* x, double* y) { return c.vertex(x, y); } }; //============================================================================ template struct dash_stroke_draft_simple { typedef agg::conv_dash dash_type; dash_type d; dash_stroke_draft_simple(Source& src, double dash_len, double gap_len, double w) : d(src) { d.add_dash(dash_len, gap_len); } void rewind(unsigned path_id) { d.rewind(path_id); } unsigned vertex(double* x, double* y) { return d.vertex(x, y); } }; //============================================================================ template struct dash_stroke_draft_arrow { typedef agg::conv_dash dash_type; typedef agg::conv_marker marker_type; typedef agg::conv_concat concat_type; dash_type d; agg::arrowhead ah; marker_type m; concat_type c; dash_stroke_draft_arrow(Source& src, double dash_len, double gap_len, double w) : d(src), ah(), m(d.markers(), ah), c(d, m) { d.add_dash(dash_len, gap_len); ah.head(0, 10, 5, 0); d.shorten(10.0); } void rewind(unsigned path_id) { c.rewind(path_id); } unsigned vertex(double* x, double* y) { return c.vertex(x, y); } }; //============================================================================ template struct dash_stroke_fine_simple { typedef agg::conv_dash dash_type; typedef agg::conv_stroke stroke_type; dash_type d; stroke_type s; dash_stroke_fine_simple(Source& src, double dash_len, double gap_len, double w) : d(src), s(d) { d.add_dash(dash_len, gap_len); s.width(w); } void rewind(unsigned path_id) { s.rewind(path_id); } unsigned vertex(double* x, double* y) { return s.vertex(x, y); } }; //============================================================================ template struct dash_stroke_fine_arrow { typedef agg::conv_dash dash_type; typedef agg::conv_stroke stroke_type; typedef agg::conv_marker marker_type; typedef agg::conv_concat concat_type; dash_type d; stroke_type s; agg::arrowhead ah; marker_type m; concat_type c; dash_stroke_fine_arrow(Source& src, double dash_len, double gap_len, double w) : d(src), s(d), ah(), m(d.markers(), ah), c(s, m) { d.add_dash(dash_len, gap_len); s.width(w); ah.head(0, 10, 5, 0); d.shorten(w * 2.0); } void rewind(unsigned path_id) { c.rewind(path_id); } unsigned vertex(double* x, double* y) { return c.vertex(x, y); } }; //#define stroke_draft stroke_draft_simple //#define dash_stroke_draft dash_stroke_draft_simple //#define stroke_fine stroke_fine_simple //#define dash_stroke_fine dash_stroke_fine_simple #define stroke_draft stroke_draft_arrow #define dash_stroke_draft dash_stroke_draft_arrow #define stroke_fine stroke_fine_arrow #define dash_stroke_fine dash_stroke_fine_arrow class the_application : public agg::platform_support { agg::rbox_ctrl m_type; agg::slider_ctrl m_width; agg::cbox_ctrl m_benchmark; agg::cbox_ctrl m_draw_nodes; agg::cbox_ctrl m_draw_edges; agg::cbox_ctrl m_draft; agg::cbox_ctrl m_translucent; graph m_graph; color_array_type m_gradient_colors; int m_draw; agg::scanline_u8 m_sl; public: the_application(agg::pix_format_e format, bool flip_y) : agg::platform_support(format, flip_y), m_type(-1, -1, -1, -1, !flip_y), m_width(110+80, 8.0, 110+200.0+80, 8.0 + 7.0, !flip_y), m_benchmark(110+200+80+8, 8.0-2.0, "Benchmark", !flip_y), m_draw_nodes(110+200+80+8, 8.0-2.0+15.0, "Draw Nodes", !flip_y), m_draw_edges(200+200+80+8, 8.0-2.0+15.0, "Draw Edges", !flip_y), m_draft(200+200+80+8, 8.0-2.0, "Draft Mode", !flip_y), m_translucent(110+80, 8.0-2.0+15.0, "Translucent Mode", !flip_y), m_graph(200, 100), m_gradient_colors(), m_draw(3) { add_ctrl(m_type); m_type.text_size(8.0); m_type.add_item("Solid lines"); m_type.add_item("Bezier curves"); m_type.add_item("Dashed curves"); m_type.add_item("Poygons AA"); m_type.add_item("Poygons Bin"); m_type.cur_item(0); add_ctrl(m_width); m_width.num_steps(20); m_width.range(0.0, 5.0); m_width.value(2.0); m_width.label("Width=%1.2f"); m_benchmark.text_size(8.0); m_draw_nodes.text_size(8.0); m_draft.text_size(8.0); m_draw_nodes.status(true); m_draw_edges.status(true); add_ctrl(m_benchmark); add_ctrl(m_draw_nodes); add_ctrl(m_draw_edges); add_ctrl(m_draft); add_ctrl(m_translucent); agg::rgba c1(1, 1, 0, 0.25); agg::rgba c2(0, 0, 1); int i; for(i = 0; i < 256; i++) { m_gradient_colors[i] = c1.gradient(c2, double(i) / 255.0); } } //------------------------------------------------------------------------ void draw_nodes_draft() { pixfmt pixf(rbuf_window()); base_renderer rb(pixf); primitives_renderer prim(rb); int i; for(i = 0; i < m_graph.get_num_nodes(); i++) { graph::node n = m_graph.get_node(i, width(), height()); prim.fill_color(m_gradient_colors[147]); prim.line_color(m_gradient_colors[255]); prim.outlined_ellipse(int(n.x), int(n.y), 10, 10); prim.fill_color(m_gradient_colors[50]); prim.solid_ellipse(int(n.x), int(n.y), 4, 4); } } //------------------------------------------------------------------------ void draw_nodes_fine(scanline_rasterizer& ras) { gradient_span_alloc sa; pixfmt pixf(rbuf_window()); base_renderer rb(pixf); int i; for(i = 0; i < m_graph.get_num_nodes(); i++) { graph::node n = m_graph.get_node(i, width(), height()); agg::ellipse ell(n.x, n.y, 5.0 * m_width.value(), 5.0 * m_width.value()); double x, y; switch(m_draw) { case 0: ell.rewind(0); while(!agg::is_stop(ell.vertex(&x, &y))); break; case 1: ras.reset(); ras.add_path(ell); break; case 2: ras.reset(); ras.add_path(ell); ras.sort(); break; case 3: { gradient_function gf; agg::trans_affine mtx; mtx *= agg::trans_affine_scaling(m_width.value() / 2.0); mtx *= agg::trans_affine_translation(n.x, n.y); mtx.invert(); interpolator inter(mtx); gradient_span_gen sg(inter, gf, m_gradient_colors, 0.0, 10.0); gradient_renderer ren(rb, sa, sg); ras.add_path(ell); agg::render_scanlines(ras, m_sl, ren); } break; } } } //------------------------------------------------------------------------ template void render_edge_fine(scanline_rasterizer& ras, solid_renderer& ren_fine, draft_renderer& ren_draft, Source& src) { double x, y; switch(m_draw) { case 0: src.rewind(0); while(!agg::is_stop(src.vertex(&x, &y))); break; case 1: ras.reset(); ras.add_path(src); break; case 2: ras.reset(); ras.add_path(src); ras.sort(); break; case 3: { int r = rand() & 0x7F; int g = rand() & 0x7F; int b = rand() & 0x7F; int a = 255; if(m_translucent.status()) a = 80; ras.add_path(src); if(m_type.cur_item() < 4) { ren_fine.color(agg::rgba8(r, g, b, a)); agg::render_scanlines(ras, m_sl, ren_fine); } else { ren_draft.color(agg::rgba8(r, g, b, a)); agg::render_scanlines(ras, m_sl, ren_draft); } } break; } } //------------------------------------------------------------------------ void draw_lines_draft() { pixfmt pixf(rbuf_window()); base_renderer rb(pixf); primitives_renderer prim(rb); outline_rasterizer ras(prim); int i; for(i = 0; i < m_graph.get_num_edges(); i++) { graph::edge e = m_graph.get_edge(i); graph::node n1 = m_graph.get_node(e.node1, width(), height()); graph::node n2 = m_graph.get_node(e.node2, width(), height()); line l(n1.x, n1.y, n2.x, n2.y); stroke_draft s(l, m_width.value()); int r = rand() & 0x7F; int g = rand() & 0x7F; int b = rand() & 0x7F; int a = 255; if(m_translucent.status()) a = 80; prim.line_color(agg::rgba8(r, g, b, a)); ras.add_path(s); } } //------------------------------------------------------------------------ void draw_curves_draft() { pixfmt pixf(rbuf_window()); base_renderer rb(pixf); primitives_renderer prim(rb); outline_rasterizer ras(prim); int i; for(i = 0; i < m_graph.get_num_edges(); i++) { graph::edge e = m_graph.get_edge(i); graph::node n1 = m_graph.get_node(e.node1, width(), height()); graph::node n2 = m_graph.get_node(e.node2, width(), height()); curve c(n1.x, n1.y, n2.x, n2.y); stroke_draft s(c, m_width.value()); int r = rand() & 0x7F; int g = rand() & 0x7F; int b = rand() & 0x7F; int a = 255; if(m_translucent.status()) a = 80; prim.line_color(agg::rgba8(r, g, b, a)); ras.add_path(s); } } //------------------------------------------------------------------------ void draw_dashes_draft() { pixfmt pixf(rbuf_window()); base_renderer rb(pixf); primitives_renderer prim(rb); outline_rasterizer ras(prim); int i; for(i = 0; i < m_graph.get_num_edges(); i++) { graph::edge e = m_graph.get_edge(i); graph::node n1 = m_graph.get_node(e.node1, width(), height()); graph::node n2 = m_graph.get_node(e.node2, width(), height()); curve c(n1.x, n1.y, n2.x, n2.y); dash_stroke_draft s(c, 6.0, 3.0, m_width.value()); int r = rand() & 0x7F; int g = rand() & 0x7F; int b = rand() & 0x7F; int a = 255; if(m_translucent.status()) a = 80; prim.line_color(agg::rgba8(r, g, b, a)); ras.add_path(s); } } //------------------------------------------------------------------------ void draw_lines_fine(scanline_rasterizer& ras, solid_renderer& solid, draft_renderer& draft) { int i; for(i = 0; i < m_graph.get_num_edges(); i++) { graph::edge b = m_graph.get_edge(i); graph::node n1 = m_graph.get_node(b.node1, width(), height()); graph::node n2 = m_graph.get_node(b.node2, width(), height()); line l(n1.x, n1.y, n2.x, n2.y); stroke_fine s(l, m_width.value()); render_edge_fine(ras, solid, draft, s); } } //------------------------------------------------------------------------ void draw_curves_fine(scanline_rasterizer& ras, solid_renderer& solid, draft_renderer& draft) { int i; for(i = 0; i < m_graph.get_num_edges(); i++) { graph::edge b = m_graph.get_edge(i); graph::node n1 = m_graph.get_node(b.node1, width(), height()); graph::node n2 = m_graph.get_node(b.node2, width(), height()); curve c(n1.x, n1.y, n2.x, n2.y); stroke_fine s(c, m_width.value()); render_edge_fine(ras, solid, draft, s); } } //------------------------------------------------------------------------ void draw_dashes_fine(scanline_rasterizer& ras, solid_renderer& solid, draft_renderer& draft) { int i; for(i = 0; i < m_graph.get_num_edges(); i++) { graph::edge b = m_graph.get_edge(i); graph::node n1 = m_graph.get_node(b.node1, width(), height()); graph::node n2 = m_graph.get_node(b.node2, width(), height()); curve c(n1.x, n1.y, n2.x, n2.y); dash_stroke_fine s(c, 6.0, 3.0, m_width.value()); render_edge_fine(ras, solid, draft, s); } } //------------------------------------------------------------------------ void draw_polygons(scanline_rasterizer& ras, solid_renderer& solid, draft_renderer& draft) { int i; if(m_type.cur_item() == 4) { ras.gamma(agg::gamma_threshold(0.5)); } for(i = 0; i < m_graph.get_num_edges(); i++) { graph::edge b = m_graph.get_edge(i); graph::node n1 = m_graph.get_node(b.node1, width(), height()); graph::node n2 = m_graph.get_node(b.node2, width(), height()); curve c(n1.x, n1.y, n2.x, n2.y); render_edge_fine(ras, solid, draft, c); } ras.gamma(agg::gamma_none()); } //------------------------------------------------------------------------ void draw_scene(scanline_rasterizer& ras, solid_renderer& solid, draft_renderer& draft) { ras.gamma(agg::gamma_none()); srand(100); if(m_draw_nodes.status()) { if(m_draft.status()) { draw_nodes_draft(); } else { draw_nodes_fine(ras); } } if(m_draw_edges.status()) { if(m_draft.status()) { switch(m_type.cur_item()) { case 0: draw_lines_draft(); break; case 1: draw_curves_draft(); break; case 2: draw_dashes_draft(); break; } } else { switch(m_type.cur_item()) { case 0: draw_lines_fine(ras, solid, draft); break; case 1: draw_curves_fine(ras, solid, draft); break; case 2: draw_dashes_fine(ras, solid, draft); break; case 3: case 4: draw_polygons(ras, solid, draft); break; } } } } //------------------------------------------------------------------------ virtual void on_draw() { scanline_rasterizer ras; pixfmt pixf(rbuf_window()); base_renderer rb(pixf); solid_renderer solid(rb); draft_renderer draft(rb); rb.clear(agg::rgba(1, 1, 1)); draw_scene(ras, solid, draft); ras.filling_rule(agg::fill_non_zero); agg::render_ctrl(ras, m_sl, rb, m_type); agg::render_ctrl(ras, m_sl, rb, m_width); agg::render_ctrl(ras, m_sl, rb, m_benchmark); agg::render_ctrl(ras, m_sl, rb, m_draw_nodes); agg::render_ctrl(ras, m_sl, rb, m_draw_edges); agg::render_ctrl(ras, m_sl, rb, m_draft); agg::render_ctrl(ras, m_sl, rb, m_translucent); } virtual void on_ctrl_change() { if(m_benchmark.status()) { int i; on_draw(); update_window(); scanline_rasterizer ras; pixfmt pixf(rbuf_window()); base_renderer rb(pixf); solid_renderer solid(rb); draft_renderer draft(rb); char buf[256]; if(m_draft.status()) { start_timer(); for(i = 0; i < 10; i++) { draw_scene(ras, solid, draft); } sprintf(buf, "%3.3f milliseconds", elapsed_time()); } else { double times[5]; for(m_draw = 0; m_draw < 4; m_draw++) { start_timer(); for(i = 0; i < 10; i++) { draw_scene(ras, solid, draft); } times[m_draw] = elapsed_time(); } m_draw = 3; times[4] = times[3]; times[3] -= times[2]; times[2] -= times[1]; times[1] -= times[0]; FILE* fd = fopen(full_file_name("benchmark"), "a"); fprintf(fd, "%10.3f %10.3f %10.3f %10.3f %10.3f\n", times[0], times[1], times[2], times[3], times[4]); fclose(fd); sprintf(buf, " pipeline add_path sort render total\n" "%10.3f %10.3f %10.3f %10.3f %10.3f", times[0], times[1], times[2], times[3], times[4]); } message(buf); m_benchmark.status(false); force_redraw(); } } }; int agg_main(int argc, char* argv[]) { the_application app(agg::pix_format_bgr24, flip_y); app.caption("AGG Example. Line Join"); if(app.init(600+100, 500+30, agg::window_resize)) { return app.run(); } return 1; } agg-2.5+dfsg1/examples/idea.cpp0000644000000000000000000002457710703246330016521 0ustar00usergroup00000000000000#include "agg_basics.h" #include "agg_rendering_buffer.h" #include "agg_rasterizer_scanline_aa.h" #include "agg_scanline_p.h" #include "agg_renderer_scanline.h" #include "agg_trans_affine.h" #include "agg_conv_stroke.h" #include "agg_conv_transform.h" #include "ctrl/agg_cbox_ctrl.h" #include "ctrl/agg_slider_ctrl.h" #include "platform/agg_platform_support.h" #define AGG_BGR24 //#define AGG_RGB24 //#define AGG_BGRA32 //#define AGG_RGBA32 //#define AGG_ARGB32 //#define AGG_ABGR32 //#define AGG_RGB565 //#define AGG_RGB555 #include "pixel_formats.h" enum flip_y_e { flip_y = false }; struct path_attributes { unsigned index; agg::rgba8 fill_color; agg::rgba8 stroke_color; double stroke_width; path_attributes() {} path_attributes(unsigned idx, const agg::rgba8& fill, const agg::rgba8& stroke, double width) : index(idx), fill_color(fill), stroke_color(stroke), stroke_width(width) { } }; static double g_poly_bulb[] = { -6,-67, -6,-71, -7,-74, -8,-76, -10,-79, -10,-82, -9,-84, -6,-86, -4,-87, -2,-86, -1,-86, 1,-84, 2,-82, 2,-79, 0,-77, -2,-73, -2,-71, -2,-69, -3,-67, -4,-65 }; static double g_poly_beam1[] = { -14,-84,-22,-85,-23,-87,-22,-88,-21,-88 }; static double g_poly_beam2[] = { -10,-92, -14,-96, -14,-98, -12,-99, -11,-97 }; static double g_poly_beam3[] = { -1,-92, -2,-98, 0,-100, 2,-100, 1,-98 }; static double g_poly_beam4[] = { 5,-89, 11,-94, 13,-93, 13,-92, 12,-91 }; static double g_poly_fig1[] = { 1,-48,-3,-54,-7,-58,-12,-58,-17,-55,-20,-52,-21,-47, -20,-40,-17,-33,-11,-28,-6,-26,-2,-25,2,-26,4,-28,5, -33,5,-39,3,-44,12,-48,12,-50,12,-51,3,-46 }; static double g_poly_fig2[] = { 11,-27,6,-23,4,-22,3,-19,5, -16,6,-15,11,-17,19,-23,25,-30,32,-38,32,-41,32,-50,30,-64,32,-72, 32,-75,31,-77,28,-78,26,-80,28,-87,27,-89,25,-88,24,-79,24,-76,23, -75,20,-76,17,-76,17,-74,19,-73,22,-73,24,-71,26,-69,27,-64,28,-55, 28,-47,28,-40,26,-38,20,-33,14,-30 }; static double g_poly_fig3[] = { -6,-20,-9,-21,-15,-21,-20,-17, -28,-8,-32,-1,-32,1,-30,6,-26,8,-20,10,-16,12,-14,14,-15,16,-18,20, -22,20,-25,19,-27,20,-26,22,-23,23,-18,23,-14,22,-11,20,-10,17,-9,14, -11,11,-16,9,-22,8,-26,5,-28,2,-27,-2,-23,-8,-19,-11,-12,-14,-6,-15, -6,-18 }; static double g_poly_fig4[] = { 11,-6,8,-16,5,-21,-1,-23,-7, -22,-10,-17,-9,-10,-8,0,-8,10,-10,18,-11,22,-10,26,-7,28,-3,30,0,31, 5,31,10,27,14,18,14,11,11,2 }; static double g_poly_fig5[] = { 0,22,-5,21,-8,22,-9,26,-8,49, -8,54,-10,64,-10,75,-9,81,-10,84,-16,89,-18,95,-18,97,-13,100,-12,99, -12,95,-10,90,-8,87,-6,86,-4,83,-3,82,-5,80,-6,79,-7,74,-6,63,-3,52, 0,42,1,31 }; static double g_poly_fig6[] = { 12,31,12,24,8,21,3,21,2,24,3, 30,5,40,8,47,10,56,11,64,11,71,10,76,8,77,8,79,10,81,13,82,17,82,26, 84,28,87,32,86,33,81,32,80,25,79,17,79,14,79,13,76,14,72,14,64,13,55, 12,44,12,34 }; static path_attributes g_attr[3]; static agg::path_storage g_path; static unsigned g_npaths = 0; static agg::filling_rule_e g_pflag = agg::fill_non_zero; static agg::rasterizer_scanline_aa<> g_rasterizer; static agg::scanline_p8 g_scanline; static double g_angle = 0.0; #define AGG_POLY_SIZE(p) (sizeof(p) / (sizeof(*p) * 2)) struct trans_roundoff { static void transform(double* x, double* y) { *x = floor(*x + 0.5); *y = floor(*y + 0.5); } }; class the_application : public agg::platform_support { double m_dx; double m_dy; agg::cbox_ctrl m_rotate; agg::cbox_ctrl m_even_odd; agg::cbox_ctrl m_draft; agg::cbox_ctrl m_roundoff; agg::slider_ctrl m_angle_delta; bool m_redraw_flag; public: the_application(agg::pix_format_e format, bool flip_y) : agg::platform_support(format, flip_y), m_rotate(10, 3, "Rotate", !flip_y), m_even_odd(60, 3, "Even-Odd", !flip_y), m_draft(130, 3, "Draft", !flip_y), m_roundoff(175, 3, "Roundoff", !flip_y), m_angle_delta(10, 21, 250-10, 27, !flip_y), m_redraw_flag(true) { m_angle_delta.label("Step=%4.3f degree"); g_attr[g_npaths++] = path_attributes(g_path.start_new_path(), agg::rgba8(255, 255, 0), agg::rgba8(0, 0, 0), 1.0); g_path.concat_poly(g_poly_bulb, AGG_POLY_SIZE(g_poly_bulb), true); g_attr[g_npaths++] = path_attributes(g_path.start_new_path(), agg::rgba8(255, 255, 200), agg::rgba8(90, 0, 0), 0.7); g_path.concat_poly(g_poly_beam1, AGG_POLY_SIZE(g_poly_beam1), true); g_path.concat_poly(g_poly_beam2, AGG_POLY_SIZE(g_poly_beam2), true); g_path.concat_poly(g_poly_beam3, AGG_POLY_SIZE(g_poly_beam3), true); g_path.concat_poly(g_poly_beam4, AGG_POLY_SIZE(g_poly_beam4), true); g_attr[g_npaths++] = path_attributes(g_path.start_new_path(), agg::rgba8(0, 0, 0), agg::rgba8(0, 0, 0), 0.0); g_path.concat_poly(g_poly_fig1, AGG_POLY_SIZE(g_poly_fig1), true); g_path.concat_poly(g_poly_fig2, AGG_POLY_SIZE(g_poly_fig2), true); g_path.concat_poly(g_poly_fig3, AGG_POLY_SIZE(g_poly_fig3), true); g_path.concat_poly(g_poly_fig4, AGG_POLY_SIZE(g_poly_fig4), true); g_path.concat_poly(g_poly_fig5, AGG_POLY_SIZE(g_poly_fig5), true); g_path.concat_poly(g_poly_fig6, AGG_POLY_SIZE(g_poly_fig6), true); m_rotate.text_size(7); m_even_odd.text_size(7); m_draft.text_size(7); m_roundoff.text_size(7); add_ctrl(m_rotate); add_ctrl(m_even_odd); add_ctrl(m_draft); add_ctrl(m_roundoff); add_ctrl(m_angle_delta); m_angle_delta.value(0.01); } virtual void on_init() { m_dx = rbuf_window().width(); m_dy = rbuf_window().height(); } virtual void on_resize(int, int) { m_redraw_flag = true; } virtual void on_draw() { typedef agg::renderer_base ren_base; pixfmt pixf(rbuf_window()); ren_base rbase(pixf); trans_roundoff roundoff; if(m_redraw_flag) { g_rasterizer.gamma(agg::gamma_none()); rbase.clear(agg::rgba8(255,255,255)); g_rasterizer.filling_rule(agg::fill_non_zero); agg::render_ctrl(g_rasterizer, g_scanline, rbase, m_rotate); agg::render_ctrl(g_rasterizer, g_scanline, rbase, m_even_odd); agg::render_ctrl(g_rasterizer, g_scanline, rbase, m_draft); agg::render_ctrl(g_rasterizer, g_scanline, rbase, m_roundoff); agg::render_ctrl(g_rasterizer, g_scanline, rbase, m_angle_delta); m_redraw_flag = false; } else { rbase.copy_bar(0, int(32.0 * rbuf_window().height() / m_dy), rbuf_window().width(), rbuf_window().height(), agg::rgba8(255,255,255)); } if(m_draft.status()) { g_rasterizer.gamma(agg::gamma_threshold(0.4)); } agg::trans_affine mtx; mtx.reset(); mtx *= agg::trans_affine_rotation(g_angle * agg::pi / 180.0); mtx *= agg::trans_affine_translation(m_dx / 2, m_dy / 2 + 10); mtx *= agg::trans_affine_scaling(rbuf_window().width() / m_dx, rbuf_window().height() / m_dy); agg::conv_transform fill(g_path, mtx); agg::conv_transform < agg::conv_transform, trans_roundoff > fill_roundoff(fill, roundoff); agg::conv_stroke < agg::conv_transform > stroke(fill); agg::conv_stroke < agg::conv_transform < agg::conv_transform, trans_roundoff > > stroke_roundoff(fill_roundoff); g_pflag = m_even_odd.status() ? agg::fill_even_odd : agg::fill_non_zero; unsigned i; for(i = 0; i < g_npaths; i++) { g_rasterizer.filling_rule(g_pflag); if(m_roundoff.status()) g_rasterizer.add_path(fill_roundoff, g_attr[i].index); else g_rasterizer.add_path(fill, g_attr[i].index); if(m_draft.status()) { agg::render_scanlines_bin_solid(g_rasterizer, g_scanline, rbase, g_attr[i].fill_color); } else { agg::render_scanlines_aa_solid(g_rasterizer, g_scanline, rbase, g_attr[i].fill_color); } if(g_attr[i].stroke_width > 0.001) { stroke.width(g_attr[i].stroke_width * mtx.scale()); stroke_roundoff.width(g_attr[i].stroke_width * mtx.scale()); if(m_roundoff.status()) g_rasterizer.add_path(stroke_roundoff, g_attr[i].index); else g_rasterizer.add_path(stroke, g_attr[i].index); if(m_draft.status()) { agg::render_scanlines_bin_solid(g_rasterizer, g_scanline, rbase, g_attr[i].stroke_color); } else { agg::render_scanlines_aa_solid(g_rasterizer, g_scanline, rbase, g_attr[i].stroke_color); } } } } virtual void on_idle() { g_angle += m_angle_delta.value(); if(g_angle > 360.0) g_angle -= 360.0; force_redraw(); } virtual void on_ctrl_change() { wait_mode(!m_rotate.status()); m_redraw_flag = true; } }; int agg_main(int argc, char* argv[]) { the_application app(pix_format, flip_y); app.caption("AGG Example. Idea"); if(app.init(250, 280, agg::window_resize)) { return app.run(); } return 1; } agg-2.5+dfsg1/examples/image1.cpp0000644000000000000000000001663510703246330016756 0ustar00usergroup00000000000000#include #include #include #include "agg_rendering_buffer.h" #include "agg_rasterizer_scanline_aa.h" #include "agg_ellipse.h" #include "agg_trans_affine.h" #include "agg_conv_transform.h" #include "agg_span_image_filter_rgb.h" #include "agg_span_image_filter_rgba.h" #include "agg_span_image_filter_gray.h" #include "agg_pixfmt_rgba.h" #include "agg_scanline_u.h" #include "agg_renderer_scanline.h" #include "agg_span_allocator.h" #include "agg_span_interpolator_linear.h" #include "agg_image_accessors.h" #include "ctrl/agg_slider_ctrl.h" #include "platform/agg_platform_support.h" enum flip_y_e { flip_y = true }; #define AGG_BGR24 #include "pixel_formats.h" class the_application : public agg::platform_support { agg::slider_ctrl m_angle; agg::slider_ctrl m_scale; public: the_application(agg::pix_format_e format, bool flip_y) : agg::platform_support(format, flip_y), m_angle(5, 5, 300, 12, !flip_y), m_scale(5, 5+15, 300, 12+15, !flip_y) { add_ctrl(m_angle); add_ctrl(m_scale); m_angle.label("Angle=%3.2f"); m_scale.label("Scale=%3.2f"); m_angle.range(-180.0, 180.0); m_angle.value(0.0); m_scale.range(0.1, 5.0); m_scale.value(1.0); } virtual ~the_application() { } virtual void on_draw() { typedef agg::renderer_base renderer_base; typedef agg::renderer_base renderer_base_pre; pixfmt pixf(rbuf_window()); pixfmt_pre pixf_pre(rbuf_window()); renderer_base rb(pixf); renderer_base_pre rb_pre(pixf_pre); rb.clear(agg::rgba(1.0, 1.0, 1.0)); agg::trans_affine src_mtx; src_mtx *= agg::trans_affine_translation(-initial_width()/2 - 10, -initial_height()/2 - 20 - 10); src_mtx *= agg::trans_affine_rotation(m_angle.value() * agg::pi / 180.0); src_mtx *= agg::trans_affine_scaling(m_scale.value()); src_mtx *= agg::trans_affine_translation(initial_width()/2, initial_height()/2 + 20); src_mtx *= trans_affine_resizing(); agg::trans_affine img_mtx; img_mtx *= agg::trans_affine_translation(-initial_width()/2 + 10, -initial_height()/2 + 20 + 10); img_mtx *= agg::trans_affine_rotation(m_angle.value() * agg::pi / 180.0); img_mtx *= agg::trans_affine_scaling(m_scale.value()); img_mtx *= agg::trans_affine_translation(initial_width()/2, initial_height()/2 + 20); img_mtx *= trans_affine_resizing(); img_mtx.invert(); agg::span_allocator sa; typedef agg::span_interpolator_linear<> interpolator_type; interpolator_type interpolator(img_mtx); typedef agg::image_accessor_clip img_source_type; pixfmt img_pixf(rbuf_img(0)); img_source_type img_src(img_pixf, agg::rgba_pre(0, 0.4, 0, 0.5)); /* // Version without filtering (nearest neighbor) //------------------------------------------ typedef agg::span_image_filter_rgb_nn span_gen_type; span_gen_type sg(img_src, interpolator); //------------------------------------------ */ // Version with "hardcoded" bilinear filter and without // image_accessor (direct filter, the old variant) //------------------------------------------ typedef agg::span_image_filter_rgb_bilinear_clip span_gen_type; span_gen_type sg(img_pixf, agg::rgba_pre(0, 0.4, 0, 0.5), interpolator); //------------------------------------------ /* // Version with arbitrary 2x2 filter //------------------------------------------ typedef agg::span_image_filter_rgb_2x2 span_gen_type; agg::image_filter filter; span_gen_type sg(img_src, interpolator, filter); //------------------------------------------ */ /* // Version with arbitrary filter //------------------------------------------ typedef agg::span_image_filter_rgb span_gen_type; agg::image_filter filter; span_gen_type sg(img_src, interpolator, filter); //------------------------------------------ */ agg::rasterizer_scanline_aa<> ras; ras.clip_box(0, 0, width(), height()); agg::scanline_u8 sl; double r = initial_width(); if(initial_height() - 60 < r) r = initial_height() - 60; agg::ellipse ell(initial_width() / 2.0 + 10, initial_height() / 2.0 + 20 + 10, r / 2.0 + 16.0, r / 2.0 + 16.0, 200); agg::conv_transform tr(ell, src_mtx); ras.add_path(tr); agg::render_scanlines_aa(ras, sl, rb_pre, sa, sg); agg::render_ctrl(ras, sl, rb, m_angle); agg::render_ctrl(ras, sl, rb, m_scale); } }; int agg_main(int argc, char* argv[]) { the_application app(pix_format, flip_y); app.caption("Image Affine Transformations with filtering"); const char* img_name = "spheres"; if(argc >= 2) img_name = argv[1]; if(!app.load_img(0, img_name)) { char buf[256]; if(strcmp(img_name, "spheres") == 0) { sprintf(buf, "File not found: %s%s. Download http://www.antigrain.com/%s%s\n" "or copy it from another directory if available.", img_name, app.img_ext(), img_name, app.img_ext()); } else { sprintf(buf, "File not found: %s%s", img_name, app.img_ext()); } app.message(buf); return 1; } if(app.init(app.rbuf_img(0).width() + 20, app.rbuf_img(0).height() + 40 + 20, agg::window_resize)) { // Test the plain/premultiplied issue //------------------- //typedef agg::pixfmt_bgra32 pixfmt; //typedef agg::renderer_base renderer_base; //pixfmt pixf(app.rbuf_img(0)); //renderer_base rb(pixf); //for(unsigned i = 0; i < app.rbuf_img(0).height(); i += 2) //{ // // Fully transparent // rb.copy_hline(0, i, app.rbuf_img(0).width(), agg::rgba(0, 0, 0, 0)); // if(i + 1 < app.rbuf_img(0).height()) // { // // Fully opaque white // rb.copy_hline(0, i + 1, app.rbuf_img(0).width(), agg::rgba(1, 1, 1, 1)); // } //} return app.run(); } return 0; } /* E:\agg23\examples\image1.cpp(111) : error C2664: '__thiscall agg::span_image_filter_gray_bilinear >::agg::span_image_filter_gray_bilinear >(class agg::span_interpolator_linear &,const class agg::row_ptr_cache &,const struct agg::gray8 &,struct agg::order_bgra &)' : cannot convert parameter 1 from 'class agg::span_allocator' to 'class agg::span_interpolator_linear &' */ agg-2.5+dfsg1/examples/image_alpha.cpp0000644000000000000000000001504710703246330020036 0ustar00usergroup00000000000000#include #include #include #include "agg_ellipse.h" #include "agg_trans_affine.h" #include "agg_conv_transform.h" #include "agg_rendering_buffer.h" #include "agg_pixfmt_rgb.h" #include "agg_span_allocator.h" #include "agg_span_image_filter_rgb.h" #include "agg_image_accessors.h" #include "agg_span_interpolator_linear.h" #include "agg_span_converter.h" #include "agg_scanline_u.h" #include "agg_renderer_scanline.h" #include "agg_rasterizer_scanline_aa.h" #include "ctrl/agg_spline_ctrl.h" #include "platform/agg_platform_support.h" enum flip_y_e { flip_y = true }; namespace agg { //-------------------------------------------------------------------- class span_conv_brightness_alpha_rgb8 { public: typedef rgba8 color_type; typedef int8u alpha_type; enum array_size_e { array_size = 256 * 3 }; span_conv_brightness_alpha_rgb8(const alpha_type* alpha_array) : m_alpha_array(alpha_array) { } void prepare() {} void generate(color_type* span, int x, int y, unsigned len) const { do { span->a = m_alpha_array[span->r + span->g + span->b]; ++span; } while(--len); } private: const alpha_type* m_alpha_array; }; } class the_application : public agg::platform_support { agg::spline_ctrl m_alpha; double m_x[50]; double m_y[50]; double m_rx[50]; double m_ry[50]; agg::rgba8 m_colors[50]; public: the_application(agg::pix_format_e format, bool flip_y) : agg::platform_support(format, flip_y), m_alpha(2, 2, 200, 30, 6, !flip_y) { m_alpha.value(0, 1.0); m_alpha.value(1, 1.0); m_alpha.value(2, 1.0); m_alpha.value(3, 0.5); m_alpha.value(4, 0.5); m_alpha.value(5, 1.0); m_alpha.update_spline(); add_ctrl(m_alpha); } virtual ~the_application() { } virtual void on_init() { unsigned i; for(i = 0; i < 50; i++) { m_x[i] = rand() % int(width()); m_y[i] = rand() % int(height()); m_rx[i] = rand() % 60 + 10; m_ry[i] = rand() % 60 + 10; m_colors[i] = agg::rgba8(rand() & 0xFF, rand() & 0xFF, rand() & 0xFF, rand() & 0xFF); } } virtual void on_draw() { typedef agg::pixfmt_bgr24 pixfmt; typedef agg::renderer_base renderer_base; pixfmt pixf(rbuf_window()); renderer_base rb(pixf); rb.clear(agg::rgba(1.0, 1.0, 1.0)); agg::trans_affine src_mtx; src_mtx *= agg::trans_affine_translation(-initial_width()/2, -initial_height()/2); src_mtx *= agg::trans_affine_rotation(10.0 * agg::pi / 180.0); src_mtx *= agg::trans_affine_translation(initial_width()/2, initial_height()/2); src_mtx *= trans_affine_resizing(); agg::trans_affine img_mtx = src_mtx; img_mtx.invert(); typedef agg::span_allocator span_alloc; unsigned i; unsigned char brightness_alpha_array[agg::span_conv_brightness_alpha_rgb8::array_size]; for(i = 0; i < agg::span_conv_brightness_alpha_rgb8::array_size; i++) { brightness_alpha_array[i] = agg::int8u(m_alpha.value(double(i) / double(agg::span_conv_brightness_alpha_rgb8::array_size)) * 255.0); } agg::span_conv_brightness_alpha_rgb8 color_alpha(brightness_alpha_array); typedef agg::image_accessor_clip img_source_type; typedef agg::span_interpolator_linear<> interpolator_type; typedef agg::span_image_filter_rgb_bilinear span_gen; typedef agg::span_converter span_conv; span_alloc sa; interpolator_type interpolator(img_mtx); pixfmt img_pixf(rbuf_img(0)); img_source_type img_src(img_pixf, agg::rgba(0,0,0,0)); span_gen sg(img_src, interpolator); span_conv sc(sg, color_alpha); agg::ellipse ell; agg::rasterizer_scanline_aa<> ras; agg::scanline_u8 sl; for(i = 0; i < 50; i++) { ell.init(m_x[i], m_y[i], m_rx[i], m_ry[i], 50); ras.add_path(ell); agg::render_scanlines_aa_solid(ras, sl, rb, m_colors[i]); } ell.init(initial_width() / 2.0, initial_height() / 2.0, initial_width() / 1.9, initial_height() / 1.9, 200); agg::conv_transform tr(ell, src_mtx); ras.add_path(tr); agg::render_scanlines_aa(ras, sl, rb, sa, sc); agg::render_ctrl(ras, sl, rb, m_alpha); } virtual void on_key(int x, int y, unsigned key, unsigned flags) { if(key == ' ') { FILE* fd = fopen(full_file_name("alpha"), "w"); int i; for(i = 0; i < agg::span_conv_brightness_alpha_rgb8::array_size; i++) { int alpha = agg::int8u(m_alpha.value(double(i) / double(agg::span_conv_brightness_alpha_rgb8::array_size)) * 255.0); if(i % 32 == 0) fprintf(fd, "\n"); fprintf(fd, "%3d, ", alpha); } fclose(fd); } } }; int agg_main(int argc, char* argv[]) { the_application app(agg::pix_format_bgr24, flip_y); app.caption("Image Affine Transformations with Alpha-function"); const char* img_name = "spheres"; if(argc >= 2) img_name = argv[1]; if(!app.load_img(0, img_name)) { char buf[256]; if(strcmp(img_name, "spheres") == 0) { sprintf(buf, "File not found: %s%s. Download http://www.antigrain.com/%s%s\n" "or copy it from another directory if available.", img_name, app.img_ext(), img_name, app.img_ext()); } else { sprintf(buf, "File not found: %s%s", img_name, app.img_ext()); } app.message(buf); return 1; } if(app.init(app.rbuf_img(0).width(), app.rbuf_img(0).height(), agg::window_resize)) { return app.run(); } return 0; } agg-2.5+dfsg1/examples/image_filters.cpp0000644000000000000000000003214510703246330020417 0ustar00usergroup00000000000000#include #include #include #include #include "agg_rendering_buffer.h" #include "agg_rasterizer_scanline_aa.h" #include "agg_ellipse.h" #include "agg_trans_affine.h" #include "agg_conv_transform.h" #include "agg_scanline_u.h" #include "agg_scanline_p.h" #include "agg_image_accessors.h" #include "agg_renderer_scanline.h" #include "agg_span_allocator.h" #include "agg_span_interpolator_linear.h" #include "ctrl/agg_slider_ctrl.h" #include "ctrl/agg_rbox_ctrl.h" #include "ctrl/agg_cbox_ctrl.h" #include "platform/agg_platform_support.h" #include "agg_pixfmt_rgb.h" #include "agg_span_image_filter_rgb.h" #define span_image_filter span_image_filter_rgb #define span_image_filter_nn span_image_filter_rgb_nn #define span_image_filter_bilinear span_image_filter_rgb_bilinear_clip #define span_image_filter_2x2 span_image_filter_rgb_2x2 #define pix_format agg::pix_format_bgr24 typedef agg::pixfmt_bgr24 pixfmt; typedef agg::pixfmt_bgr24_pre pixfmt_pre; typedef pixfmt::color_type color_type; enum flip_y_e { flip_y = true }; // Uncomment this for more accurate timings. // Well, it currently works well only on Windows, where there's // high accuracy QueryPerformanceCounter is available. On Unix // it uses regular clock() anyway, so, it won't work for short // time periods and will give you totally wrong result (probably #INF). #define AGG_ACCURATE_TIME class the_application : public agg::platform_support { typedef agg::renderer_base renderer_base; typedef agg::renderer_base renderer_base_pre; agg::slider_ctrl m_radius; agg::slider_ctrl m_step; agg::rbox_ctrl m_filters; agg::cbox_ctrl m_normalize; agg::cbox_ctrl m_run; agg::cbox_ctrl m_single_step; agg::cbox_ctrl m_refresh; double m_cur_angle; int m_cur_filter; int m_num_steps; double m_num_pix; double m_time1; double m_time2; public: the_application(agg::pix_format_e format, bool flip_y) : agg::platform_support(format, flip_y), m_step (115, 5, 400, 11, !flip_y), m_radius(115, 5+15, 400, 11+15, !flip_y), m_filters(0.0, 0.0, 110.0, 210.0, !flip_y), m_normalize (8.0, 215.0, "Normalize Filter", !flip_y), m_run (8.0, 245.0, "RUN Test!", !flip_y), m_single_step(8.0, 230.0, "Single Step", !flip_y), m_refresh (8.0, 265.0, "Refresh", !flip_y), m_cur_angle(0.0), m_cur_filter(1), m_num_steps(0), m_num_pix(0.0), m_time1(0), m_time2(0) { add_ctrl(m_radius); add_ctrl(m_step); add_ctrl(m_filters); add_ctrl(m_run); add_ctrl(m_single_step); add_ctrl(m_normalize); add_ctrl(m_refresh); m_run.text_size(7.5); m_single_step.text_size(7.5); m_normalize.text_size(7.5); m_refresh.text_size(7.5); m_normalize.status(true); m_radius.label("Filter Radius=%.3f"); m_step.label("Step=%3.2f"); m_radius.range(2.0, 8.0); m_radius.value(4.0); m_step.range(1.0, 10.0); m_step.value(5.0); m_filters.add_item("simple (NN)"); m_filters.add_item("bilinear"); m_filters.add_item("bicubic"); m_filters.add_item("spline16"); m_filters.add_item("spline36"); m_filters.add_item("hanning"); m_filters.add_item("hamming"); m_filters.add_item("hermite"); m_filters.add_item("kaiser"); m_filters.add_item("quadric"); m_filters.add_item("catrom"); m_filters.add_item("gaussian"); m_filters.add_item("bessel"); m_filters.add_item("mitchell"); m_filters.add_item("sinc"); m_filters.add_item("lanczos"); m_filters.add_item("blackman"); m_filters.cur_item(1); m_filters.border_width(0, 0); m_filters.background_color(agg::rgba(0.0, 0.0, 0.0, 0.1)); m_filters.text_size(6.0); m_filters.text_thickness(0.85); } virtual ~the_application() { } virtual void on_draw() { pixfmt pixf(rbuf_window()); renderer_base rb(pixf); rb.clear(agg::rgba(1.0, 1.0, 1.0)); rb.copy_from(rbuf_img(0), 0, 110, 35); agg::rasterizer_scanline_aa<> ras; agg::scanline_p8 sl; char buf[64]; sprintf(buf, "NSteps=%d", m_num_steps); agg::gsv_text t; t.start_point(10.0, 295.0); t.size(10.0); t.text(buf); agg::conv_stroke pt(t); pt.width(1.5); ras.add_path(pt); agg::render_scanlines_aa_solid(ras, sl, rb, agg::rgba(0,0,0)); if(m_time1 != m_time2 && m_num_pix > 0.0) { #ifdef AGG_ACCURATE_TIME sprintf(buf, "%3.2f Kpix/sec", m_num_pix / (m_time2 - m_time1)); #else sprintf(buf, "%3.2f Kpix/sec", m_num_pix / 1000.0 / (double(m_time2 - m_time1) / CLOCKS_PER_SEC)); #endif t.start_point(10.0, 310.0); t.text(buf); ras.add_path(pt); agg::render_scanlines_aa_solid(ras, sl, rb, agg::rgba(0,0,0)); } if(m_filters.cur_item() >= 14) { agg::render_ctrl(ras, sl, rb, m_radius); } agg::render_ctrl(ras, sl, rb, m_step); agg::render_ctrl(ras, sl, rb, m_filters); agg::render_ctrl(ras, sl, rb, m_run); agg::render_ctrl(ras, sl, rb, m_normalize); agg::render_ctrl(ras, sl, rb, m_single_step); agg::render_ctrl(ras, sl, rb, m_refresh); } void transform_image(double angle) { double width = rbuf_img(0).width(); double height = rbuf_img(0).height(); pixfmt pixf(rbuf_img(0)); pixfmt_pre pixf_pre(rbuf_img(0)); renderer_base rb(pixf); renderer_base_pre rb_pre(pixf_pre); rb.clear(agg::rgba(1.0, 1.0, 1.0)); agg::rasterizer_scanline_aa<> ras; agg::scanline_u8 sl; agg::span_allocator sa; agg::trans_affine src_mtx; src_mtx *= agg::trans_affine_translation(-width/2.0, -height/2.0); src_mtx *= agg::trans_affine_rotation(angle * agg::pi / 180.0); src_mtx *= agg::trans_affine_translation(width/2.0, height/2.0); agg::trans_affine img_mtx = src_mtx; img_mtx.invert(); double r = width; if(height < r) r = height; r *= 0.5; r -= 4.0; agg::ellipse ell(width / 2.0, height / 2.0, r, r, 200); agg::conv_transform tr(ell, src_mtx); m_num_pix += r * r * agg::pi; typedef agg::span_interpolator_linear<> interpolator_type; interpolator_type interpolator(img_mtx); agg::image_filter_lut filter; bool norm = m_normalize.status(); typedef agg::image_accessor_clip source_type; pixfmt pixf_img(rbuf_img(1)); source_type source(pixf_img, agg::rgba_pre(0,0,0,0)); switch(m_filters.cur_item()) { case 0: { typedef agg::span_image_filter_nn span_gen_type; span_gen_type sg(source, interpolator); ras.add_path(tr); agg::render_scanlines_aa(ras, sl, rb_pre, sa, sg); } break; case 1: { typedef agg::span_image_filter_bilinear span_gen_type; span_gen_type sg(pixf_img, agg::rgba_pre(0,0,0,0), interpolator); ras.add_path(tr); agg::render_scanlines_aa(ras, sl, rb_pre, sa, sg); } break; case 5: case 6: case 7: { switch(m_filters.cur_item()) { case 5: filter.calculate(agg::image_filter_hanning(), norm); break; case 6: filter.calculate(agg::image_filter_hamming(), norm); break; case 7: filter.calculate(agg::image_filter_hermite(), norm); break; } typedef agg::span_image_filter_2x2 span_gen_type; span_gen_type sg(source, interpolator, filter); ras.add_path(tr); agg::render_scanlines_aa(ras, sl, rb_pre, sa, sg); } break; case 2: case 3: case 4: case 8: case 9: case 10: case 11: case 12: case 13: case 14: case 15: case 16: { switch(m_filters.cur_item()) { case 2: filter.calculate(agg::image_filter_bicubic(), norm); break; case 3: filter.calculate(agg::image_filter_spline16(), norm); break; case 4: filter.calculate(agg::image_filter_spline36(), norm); break; case 8: filter.calculate(agg::image_filter_kaiser(), norm); break; case 9: filter.calculate(agg::image_filter_quadric(), norm); break; case 10: filter.calculate(agg::image_filter_catrom(), norm); break; case 11: filter.calculate(agg::image_filter_gaussian(), norm); break; case 12: filter.calculate(agg::image_filter_bessel(), norm); break; case 13: filter.calculate(agg::image_filter_mitchell(), norm); break; case 14: filter.calculate(agg::image_filter_sinc(m_radius.value()), norm); break; case 15: filter.calculate(agg::image_filter_lanczos(m_radius.value()), norm); break; case 16: filter.calculate(agg::image_filter_blackman(m_radius.value()), norm); break; } typedef agg::span_image_filter span_gen_type; span_gen_type sg(source, interpolator, filter); ras.add_path(tr); agg::render_scanlines_aa(ras, sl, rb_pre, sa, sg); } break; } } void on_ctrl_change() { if(m_single_step.status()) { m_cur_angle += m_step.value(); copy_img_to_img(1, 0); transform_image(m_step.value()); m_num_steps++; force_redraw(); m_single_step.status(false); } if(m_run.status()) { #ifdef AGG_ACCURATE_TIME start_timer(); m_time1 = m_time2 = elapsed_time(); #else m_time1 = m_time2 = clock(); #endif m_num_pix = 0.0; wait_mode(false); } if(m_refresh.status() || m_filters.cur_item() != m_cur_filter) { #ifdef AGG_ACCURATE_TIME start_timer(); m_time1 = m_time2 = 0; #else m_time1 = m_time2 = clock(); #endif m_num_pix = 0.0; m_cur_angle = 0.0; copy_img_to_img(1, 2); transform_image(0.0); m_refresh.status(false); m_cur_filter = m_filters.cur_item(); m_num_steps = 0; force_redraw(); } } void on_idle() { if(m_run.status()) { if(m_cur_angle < 360.0) { m_cur_angle += m_step.value(); copy_img_to_img(1, 0); #ifdef AGG_ACCURATE_TIME start_timer(); #endif transform_image(m_step.value()); #ifdef AGG_ACCURATE_TIME m_time2 += elapsed_time(); #endif m_num_steps++; } else { m_cur_angle = 0.0; #ifndef AGG_ACCURATE_TIME m_time2 = clock(); #endif wait_mode(true); m_run.status(false); } force_redraw(); } else { wait_mode(true); } } }; int agg_main(int argc, char* argv[]) { the_application app(pix_format, flip_y); app.caption("Image transformation filters comparison"); const char* img_name = "spheres"; if(argc >= 2) img_name = argv[1]; if(!app.load_img(0, img_name)) { char buf[256]; if(strcmp(img_name, "spheres") == 0) { sprintf(buf, "File not found: %s%s. Download http://www.antigrain.com/%s%s\n" "or copy it from another directory if available.", img_name, app.img_ext(), img_name, app.img_ext()); } else { sprintf(buf, "File not found: %s%s", img_name, app.img_ext()); } app.message(buf); return 1; } app.copy_img_to_img(1, 0); app.copy_img_to_img(2, 0); app.transform_image(0.0); unsigned w = app.rbuf_img(0).width() + 110; unsigned h = app.rbuf_img(0).height() + 40; if(w < 305) w = 305; if(h < 325) h = 325; if(app.init(w, h, 0)) { return app.run(); } return 0; } agg-2.5+dfsg1/examples/image_filters2.cpp0000644000000000000000000002311710703246330020500 0ustar00usergroup00000000000000#include #include #include #include #include "agg_rendering_buffer.h" #include "agg_rasterizer_scanline_aa.h" #include "agg_ellipse.h" #include "agg_trans_affine.h" #include "agg_conv_transform.h" #include "agg_scanline_u.h" #include "agg_scanline_p.h" #include "agg_renderer_scanline.h" #include "agg_pixfmt_rgba.h" #include "agg_gamma_lut.h" #include "agg_span_allocator.h" #include "agg_span_image_filter_rgba.h" #include "agg_span_interpolator_linear.h" #include "agg_image_accessors.h" #include "ctrl/agg_slider_ctrl.h" #include "ctrl/agg_rbox_ctrl.h" #include "ctrl/agg_cbox_ctrl.h" #include "platform/agg_platform_support.h" enum flip_y_e { flip_y = true }; enum { l = 255 }; static agg::int8u g_image[] = { 0,l,0,l, 0,0,l,l, l,l,l,l, l,0,0,l, l,0,0,l, 0,0,0,l, l,l,l,l, l,l,l,l, l,l,l,l, l,l,l,l, 0,0,l,l, l,0,0,l, 0,0,l,l, l,l,l,l, 0,0,0,l, 0,l,0,l }; class the_application : public agg::platform_support { typedef agg::pixfmt_bgra32 pixfmt; typedef agg::pixfmt_bgra32_pre pixfmt_pre; typedef agg::renderer_base renderer_base; typedef agg::renderer_base renderer_base_pre; agg::slider_ctrl m_gamma; agg::slider_ctrl m_radius; agg::rbox_ctrl m_filters; agg::cbox_ctrl m_normalize; double m_cur_angle; int m_cur_filter; int m_num_steps; double m_num_pix; clock_t m_time1; clock_t m_time2; public: the_application(agg::pix_format_e format, bool flip_y) : agg::platform_support(format, flip_y), m_gamma (115, 5, 500-5, 11, !flip_y), m_radius(115, 5+15, 500-5, 11+15, !flip_y), m_filters(0.0, 0.0, 110.0, 210.0, !flip_y), m_normalize (8.0, 215.0, "Normalize Filter", !flip_y), m_cur_angle(0.0), m_cur_filter(1), m_num_steps(0), m_num_pix(0.0), m_time1(0), m_time2(0) { add_ctrl(m_gamma); add_ctrl(m_radius); add_ctrl(m_filters); add_ctrl(m_normalize); m_normalize.text_size(7.5); m_normalize.status(true); m_radius.label("Filter Radius=%.3f"); m_radius.range(2.0, 8.0); m_radius.value(4.0); m_gamma.label("Gamma=%.3f"); m_gamma.range(0.5, 3.0); m_gamma.value(1.0); m_filters.add_item("simple (NN)"); m_filters.add_item("bilinear"); m_filters.add_item("bicubic"); m_filters.add_item("spline16"); m_filters.add_item("spline36"); m_filters.add_item("hanning"); m_filters.add_item("hamming"); m_filters.add_item("hermite"); m_filters.add_item("kaiser"); m_filters.add_item("quadric"); m_filters.add_item("catrom"); m_filters.add_item("gaussian"); m_filters.add_item("bessel"); m_filters.add_item("mitchell"); m_filters.add_item("sinc"); m_filters.add_item("lanczos"); m_filters.add_item("blackman"); m_filters.cur_item(1); m_filters.border_width(0, 0); m_filters.background_color(agg::rgba(0.0, 0.0, 0.0, 0.1)); m_filters.text_size(6.0); m_filters.text_thickness(0.85); } virtual ~the_application() { } virtual void on_draw() { pixfmt pixf(rbuf_window()); renderer_base rb(pixf); rb.clear(agg::rgba(1.0, 1.0, 1.0)); rb.copy_from(rbuf_img(0), 0, 110, 35); agg::rasterizer_scanline_aa<> ras; agg::scanline_u8 sl; agg::rendering_buffer img_rbuf(g_image, 4, 4, 4*4); double para[] = { 200, 40, 200+300, 40, 200+300, 40+300, 200, 40+300 }; agg::trans_affine img_mtx(para, 0,0,4,4); typedef agg::span_interpolator_linear<> interpolator_type; interpolator_type interpolator(img_mtx); agg::span_allocator sa; pixfmt img_pixf(img_rbuf); typedef agg::image_accessor_clone img_source_type; img_source_type source(img_pixf); ras.reset(); ras.move_to_d(para[0], para[1]); ras.line_to_d(para[2], para[3]); ras.line_to_d(para[4], para[5]); ras.line_to_d(para[6], para[7]); switch(m_filters.cur_item()) { case 0: { typedef agg::span_image_filter_rgba_nn span_gen_type; span_gen_type sg(source, interpolator); agg::render_scanlines_aa(ras, sl, rb, sa, sg); } break; case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8: case 9: case 10: case 11: case 12: case 13: case 14: case 15: case 16: { agg::image_filter_lut filter; bool norm = m_normalize.status(); switch(m_filters.cur_item()) { case 1: filter.calculate(agg::image_filter_bilinear(), norm); break; case 2: filter.calculate(agg::image_filter_bicubic(), norm); break; case 3: filter.calculate(agg::image_filter_spline16(), norm); break; case 4: filter.calculate(agg::image_filter_spline36(), norm); break; case 5: filter.calculate(agg::image_filter_hanning(), norm); break; case 6: filter.calculate(agg::image_filter_hamming(), norm); break; case 7: filter.calculate(agg::image_filter_hermite(), norm); break; case 8: filter.calculate(agg::image_filter_kaiser(), norm); break; case 9: filter.calculate(agg::image_filter_quadric(), norm); break; case 10: filter.calculate(agg::image_filter_catrom(), norm); break; case 11: filter.calculate(agg::image_filter_gaussian(), norm); break; case 12: filter.calculate(agg::image_filter_bessel(), norm); break; case 13: filter.calculate(agg::image_filter_mitchell(), norm); break; case 14: filter.calculate(agg::image_filter_sinc(m_radius.value()), norm); break; case 15: filter.calculate(agg::image_filter_lanczos(m_radius.value()), norm); break; case 16: filter.calculate(agg::image_filter_blackman(m_radius.value()), norm); break; } typedef agg::span_image_filter_rgba span_gen_type; span_gen_type sg(source, interpolator, filter); agg::render_scanlines_aa(ras, sl, rb, sa, sg); agg::gamma_lut gamma(m_gamma.value()); pixf.apply_gamma_inv(gamma); double x_start = 5.0; double x_end = 195.0; double y_start = 235.0; double y_end = initial_height() - 5.0; double x_center = (x_start + x_end) / 2; agg::path_storage p; agg::conv_stroke stroke(p); stroke.width(0.8); unsigned i; for(i = 0; i <= 16; i++) { double x = x_start + (x_end - x_start) * i / 16.0; p.remove_all(); p.move_to(x+0.5, y_start); p.line_to(x+0.5, y_end); ras.add_path(stroke); agg::render_scanlines_aa_solid(ras, sl, rb, agg::rgba8(0, 0, 0, i == 8 ? 255 : 100)); } double ys = y_start + (y_end - y_start) / 6.0; p.remove_all(); p.move_to(x_start, ys); p.line_to(x_end, ys); ras.add_path(stroke); agg::render_scanlines_aa_solid(ras, sl, rb, agg::rgba8(0, 0, 0)); double radius = filter.radius(); unsigned n = unsigned(radius * 256 * 2); double dx = (x_end - x_start) * radius / 8.0; double dy = y_end - ys; const agg::int16* weights = filter.weight_array(); double xs = (x_end + x_start)/2.0 - (filter.diameter() * (x_end - x_start) / 32.0); unsigned nn = filter.diameter() * 256; p.remove_all(); p.move_to(xs+0.5, ys + dy * weights[0] / agg::image_filter_scale); for(i = 1; i < nn; i++) { p.line_to(xs + dx * i / n + 0.5, ys + dy * weights[i] / agg::image_filter_scale); } ras.add_path(stroke); agg::render_scanlines_aa_solid(ras, sl, rb, agg::rgba8(100, 0, 0)); } break; } agg::render_ctrl(ras, sl, rb, m_gamma); if(m_filters.cur_item() >= 14) { agg::render_ctrl(ras, sl, rb, m_radius); } agg::render_ctrl(ras, sl, rb, m_filters); agg::render_ctrl(ras, sl, rb, m_normalize); } }; int agg_main(int argc, char* argv[]) { the_application app(agg::pix_format_bgra32, flip_y); app.caption("Image transformation filters comparison"); if(app.init(500, 340, 0)) { return app.run(); } return 0; } agg-2.5+dfsg1/examples/image_fltr_graph.cpp0000644000000000000000000002640310703246330021077 0ustar00usergroup00000000000000#include #include #include #include #include "agg_rendering_buffer.h" #include "agg_rasterizer_scanline_aa.h" #include "agg_ellipse.h" #include "agg_trans_affine.h" #include "agg_conv_transform.h" #include "agg_conv_stroke.h" #include "agg_pixfmt_rgb.h" #include "agg_scanline_p.h" #include "agg_renderer_scanline.h" #include "agg_image_filters.h" #include "ctrl/agg_slider_ctrl.h" #include "ctrl/agg_rbox_ctrl.h" #include "ctrl/agg_cbox_ctrl.h" #include "platform/agg_platform_support.h" enum flip_y_e { flip_y = true }; struct filter_base { virtual double radius() const = 0; virtual void set_radius(double r) = 0; virtual double calc_weight(double x) const = 0; }; template struct image_filter_const_radius_adaptor : filter_base { virtual double radius() const { return m_filter.radius(); } virtual void set_radius(double r) {} virtual double calc_weight(double x) const { return m_filter.calc_weight(fabs(x)); } Filter m_filter; }; template struct image_filter_variable_radius_adaptor : filter_base { virtual double radius() const { return m_filter.radius(); } virtual double calc_weight(double x) const { return m_filter.calc_weight(fabs(x)); } virtual void set_radius(double r) { m_filter = Filter(r); } image_filter_variable_radius_adaptor() : m_filter(2.0) {} Filter m_filter; }; class the_application : public agg::platform_support { agg::slider_ctrl m_radius; agg::cbox_ctrl m_bilinear; agg::cbox_ctrl m_bicubic; agg::cbox_ctrl m_spline16; agg::cbox_ctrl m_spline36; agg::cbox_ctrl m_hanning; agg::cbox_ctrl m_hamming; agg::cbox_ctrl m_hermite; agg::cbox_ctrl m_kaiser; agg::cbox_ctrl m_quadric; agg::cbox_ctrl m_catrom; agg::cbox_ctrl m_gaussian; agg::cbox_ctrl m_bessel; agg::cbox_ctrl m_mitchell; agg::cbox_ctrl m_sinc; agg::cbox_ctrl m_lanczos; agg::cbox_ctrl m_blackman; agg::cbox_ctrl* m_filters[32]; image_filter_const_radius_adaptor m_filter_bilinear; image_filter_const_radius_adaptor m_filter_bicubic; image_filter_const_radius_adaptor m_filter_spline16; image_filter_const_radius_adaptor m_filter_spline36; image_filter_const_radius_adaptor m_filter_hanning; image_filter_const_radius_adaptor m_filter_hamming; image_filter_const_radius_adaptor m_filter_hermite; image_filter_const_radius_adaptor m_filter_kaiser; image_filter_const_radius_adaptor m_filter_quadric; image_filter_const_radius_adaptor m_filter_catrom; image_filter_const_radius_adaptor m_filter_gaussian; image_filter_const_radius_adaptor m_filter_bessel; image_filter_const_radius_adaptor m_filter_mitchell; image_filter_variable_radius_adaptor m_filter_sinc; image_filter_variable_radius_adaptor m_filter_lanczos; image_filter_variable_radius_adaptor m_filter_blackman; filter_base* m_filter_func[32]; unsigned m_num_filters; public: the_application(agg::pix_format_e format, bool flip_y) : agg::platform_support(format, flip_y), m_radius (5.0, 5.0, 780-5, 10.0, !flip_y), m_bilinear (8.0, 30.0+15*0, "bilinear", !flip_y), m_bicubic (8.0, 30.0+15*1, "bicubic ", !flip_y), m_spline16 (8.0, 30.0+15*2, "spline16", !flip_y), m_spline36 (8.0, 30.0+15*3, "spline36", !flip_y), m_hanning (8.0, 30.0+15*4, "hanning ", !flip_y), m_hamming (8.0, 30.0+15*5, "hamming ", !flip_y), m_hermite (8.0, 30.0+15*6, "hermite ", !flip_y), m_kaiser (8.0, 30.0+15*7, "kaiser ", !flip_y), m_quadric (8.0, 30.0+15*8, "quadric ", !flip_y), m_catrom (8.0, 30.0+15*9, "catrom ", !flip_y), m_gaussian (8.0, 30.0+15*10, "gaussian", !flip_y), m_bessel (8.0, 30.0+15*11, "bessel ", !flip_y), m_mitchell (8.0, 30.0+15*12, "mitchell", !flip_y), m_sinc (8.0, 30.0+15*13, "sinc ", !flip_y), m_lanczos (8.0, 30.0+15*14, "lanczos ", !flip_y), m_blackman (8.0, 30.0+15*15, "blackman", !flip_y), m_num_filters(0) { m_filters[m_num_filters++] = &m_bilinear; m_filters[m_num_filters++] = &m_bicubic; m_filters[m_num_filters++] = &m_spline16; m_filters[m_num_filters++] = &m_spline36; m_filters[m_num_filters++] = &m_hanning; m_filters[m_num_filters++] = &m_hamming; m_filters[m_num_filters++] = &m_hermite; m_filters[m_num_filters++] = &m_kaiser; m_filters[m_num_filters++] = &m_quadric; m_filters[m_num_filters++] = &m_catrom; m_filters[m_num_filters++] = &m_gaussian; m_filters[m_num_filters++] = &m_bessel; m_filters[m_num_filters++] = &m_mitchell; m_filters[m_num_filters++] = &m_sinc; m_filters[m_num_filters++] = &m_lanczos; m_filters[m_num_filters++] = &m_blackman; unsigned i = 0; m_filter_func[i++] = &m_filter_bilinear; m_filter_func[i++] = &m_filter_bicubic; m_filter_func[i++] = &m_filter_spline16; m_filter_func[i++] = &m_filter_spline36; m_filter_func[i++] = &m_filter_hanning; m_filter_func[i++] = &m_filter_hamming; m_filter_func[i++] = &m_filter_hermite; m_filter_func[i++] = &m_filter_kaiser; m_filter_func[i++] = &m_filter_quadric; m_filter_func[i++] = &m_filter_catrom; m_filter_func[i++] = &m_filter_gaussian; m_filter_func[i++] = &m_filter_bessel; m_filter_func[i++] = &m_filter_mitchell; m_filter_func[i++] = &m_filter_sinc; m_filter_func[i++] = &m_filter_lanczos; m_filter_func[i++] = &m_filter_blackman; for(i = 0; i < m_num_filters; i++) { add_ctrl(*m_filters[i]); } m_radius.range(2.0, 8.0); m_radius.value(4.0); m_radius.label("Radius=%.3f"); add_ctrl(m_radius); } virtual ~the_application() { } virtual void on_draw() { typedef agg::pixfmt_bgr24 pixfmt; typedef agg::renderer_base renderer_base; typedef agg::renderer_scanline_aa_solid renderer_solid; pixfmt pixf(rbuf_window()); renderer_base rb(pixf); renderer_solid rs(rb); rb.clear(agg::rgba(1.0, 1.0, 1.0)); agg::rasterizer_scanline_aa<> ras; agg::scanline_p8 sl; double x_start = 125.0; double x_end = initial_width() - 15.0; double y_start = 10.0; double y_end = initial_height() - 10.0; double x_center = (x_start + x_end) / 2; unsigned i; agg::path_storage p; agg::conv_stroke pl(p); agg::conv_transform > tr(pl, trans_affine_resizing()); for(i = 0; i <= 16; i++) { double x = x_start + (x_end - x_start) * i / 16.0; p.remove_all(); p.move_to(x+0.5, y_start); p.line_to(x+0.5, y_end); ras.add_path(tr); rs.color(agg::rgba8(0, 0, 0, i == 8 ? 255 : 100)); agg::render_scanlines(ras, sl, rs); } double ys = y_start + (y_end - y_start) / 6.0; p.remove_all(); p.move_to(x_start, ys); p.line_to(x_end, ys); ras.add_path(tr); rs.color(agg::rgba8(0, 0, 0)); agg::render_scanlines(ras, sl, rs); pl.width(1.0); for(i = 0; i < m_num_filters; i++) { if(m_filters[i]->status()) { m_filter_func[i]->set_radius(m_radius.value()); unsigned j; double radius = m_filter_func[i]->radius(); unsigned n = unsigned(radius * 256 * 2); double dy = y_end - ys; double xs = (x_end + x_start)/2.0 - (radius * (x_end - x_start) / 16.0); double dx = (x_end - x_start) * radius / 8.0; p.remove_all(); p.move_to(xs+0.5, ys + dy * m_filter_func[i]->calc_weight(-radius)); for(j = 1; j < n; j++) { p.line_to(xs + dx * j / n + 0.5, ys + dy * m_filter_func[i]->calc_weight(j / 256.0 - radius)); } ras.add_path(tr); rs.color(agg::rgba8(100, 0, 0)); agg::render_scanlines(ras, sl, rs); p.remove_all(); unsigned xint; int ir = int(ceil(radius) + 0.1); for(xint = 0; xint < 256; xint++) { int xfract; double sum = 0; for(xfract = -ir; xfract < ir; xfract++) { double xf = xint/256.0 + xfract; if(xf >= -radius || xf <= radius) { sum += m_filter_func[i]->calc_weight(xf); } } double x = x_center + ((-128.0 + xint) / 128.0) * radius * (x_end - x_start) / 16.0; double y = ys + sum * 256 - 256; if(xint == 0) p.move_to(x, y); else p.line_to(x, y); } ras.add_path(tr); rs.color(agg::rgba8(0, 100, 0)); agg::render_scanlines(ras, sl, rs); agg::image_filter_lut normalized(*m_filter_func[i]); const agg::int16* weights = normalized.weight_array(); xs = (x_end + x_start)/2.0 - (normalized.diameter() * (x_end - x_start) / 32.0); unsigned nn = normalized.diameter() * 256; p.remove_all(); p.move_to(xs+0.5, ys + dy * weights[0] / agg::image_filter_scale); for(j = 1; j < nn; j++) { p.line_to(xs + dx * j / n + 0.5, ys + dy * weights[j] / agg::image_filter_scale); } ras.add_path(tr); rs.color(agg::rgba8(0, 0, 100, 255)); agg::render_scanlines(ras, sl, rs); } } for(i = 0; i < m_num_filters; i++) { agg::render_ctrl(ras, sl, rb, *m_filters[i]); } if(m_sinc.status() || m_lanczos.status() || m_blackman.status()) { agg::render_ctrl(ras, sl, rb, m_radius); } } }; int agg_main(int argc, char* argv[]) { the_application app(agg::pix_format_bgr24, flip_y); app.caption("Image filters' shape comparison"); if(app.init(780, 300, agg::window_resize)) { return app.run(); } return 0; } agg-2.5+dfsg1/examples/image_perspective.cpp0000644000000000000000000002546010703246330021302 0ustar00usergroup00000000000000#include #include #include #include "agg_basics.h" #include "agg_rendering_buffer.h" #include "agg_rasterizer_scanline_aa.h" #include "agg_scanline_u.h" #include "agg_renderer_scanline.h" #include "agg_path_storage.h" #include "agg_conv_transform.h" #include "agg_trans_affine.h" #include "agg_trans_bilinear.h" #include "agg_trans_perspective.h" #include "agg_span_allocator.h" #include "agg_span_interpolator_linear.h" #include "agg_span_interpolator_trans.h" #include "agg_span_subdiv_adaptor.h" #include "agg_pixfmt_rgba.h" #include "agg_image_accessors.h" #include "agg_span_image_filter_rgba.h" #include "ctrl/agg_rbox_ctrl.h" #include "platform/agg_platform_support.h" #include "interactive_polygon.h" enum flip_y_e { flip_y = true }; agg::rasterizer_scanline_aa<> g_rasterizer; agg::scanline_u8 g_scanline; double g_x1 = 0; double g_y1 = 0; double g_x2 = 0; double g_y2 = 0; class the_application : public agg::platform_support { public: typedef agg::pixfmt_bgra32 pixfmt; typedef pixfmt::color_type color_type; typedef agg::renderer_base renderer_base; typedef agg::renderer_scanline_aa_solid renderer_solid; typedef agg::pixfmt_bgra32_pre pixfmt_pre; typedef agg::renderer_base renderer_base_pre; agg::interactive_polygon m_quad; agg::rbox_ctrl m_trans_type; the_application(agg::pix_format_e format, bool flip_y) : agg::platform_support(format, flip_y), m_quad(4, 5.0), m_trans_type(420, 5.0, 420+170.0, 70.0, !flip_y) { m_trans_type.add_item("Affine Parallelogram"); m_trans_type.add_item("Bilinear"); m_trans_type.add_item("Perspective"); m_trans_type.cur_item(2); add_ctrl(m_trans_type); } virtual void on_init() { double d = 0.0; g_x1 = d; g_y1 = d; g_x2 = rbuf_img(0).width() - d; g_y2 = rbuf_img(0).height() - d; m_quad.xn(0) = 100; m_quad.yn(0) = 100; m_quad.xn(1) = width() - 100; m_quad.yn(1) = 100; m_quad.xn(2) = width() - 100; m_quad.yn(2) = height() - 100; m_quad.xn(3) = 100; m_quad.yn(3) = height() - 100; } virtual void on_draw() { pixfmt pixf(rbuf_window()); pixfmt_pre pixf_pre(rbuf_window()); renderer_base rb(pixf); renderer_base_pre rb_pre(pixf_pre); renderer_solid r(rb); rb.clear(agg::rgba(1, 1, 1)); if(m_trans_type.cur_item() == 0) { // For the affine parallelogram transformations we // calculate the 4-th (implicit) point of the parallelogram m_quad.xn(3) = m_quad.xn(0) + (m_quad.xn(2) - m_quad.xn(1)); m_quad.yn(3) = m_quad.yn(0) + (m_quad.yn(2) - m_quad.yn(1)); } //-------------------------- // Render the "quad" tool and controls g_rasterizer.add_path(m_quad); agg::render_scanlines_aa_solid(g_rasterizer, g_scanline, rb, agg::rgba(0, 0.3, 0.5, 0.6)); // Prepare the polygon to rasterize. Here we need to fill // the destination (transformed) polygon. g_rasterizer.clip_box(0, 0, width(), height()); g_rasterizer.reset(); g_rasterizer.move_to_d(m_quad.xn(0), m_quad.yn(0)); g_rasterizer.line_to_d(m_quad.xn(1), m_quad.yn(1)); g_rasterizer.line_to_d(m_quad.xn(2), m_quad.yn(2)); g_rasterizer.line_to_d(m_quad.xn(3), m_quad.yn(3)); agg::span_allocator sa; agg::image_filter_bilinear filter_kernel; agg::image_filter_lut filter(filter_kernel, false); pixfmt pixf_img(rbuf_img(0)); //typedef agg::image_accessor_wrap img_accessor_type; //img_accessor_type ia(pixf_img); //typedef agg::image_accessor_clip img_accessor_type; //img_accessor_type ia(pixf_img, agg::rgba(1,1,1)); typedef agg::image_accessor_clone img_accessor_type; img_accessor_type ia(pixf_img); start_timer(); switch(m_trans_type.cur_item()) { case 0: { // Note that we consruct an affine matrix that transforms // a parallelogram to a rectangle, i.e., it's inverted. // It's actually the same as: // tr(g_x1, g_y1, g_x2, g_y2, m_triangle.polygon()); // tr.invert(); agg::trans_affine tr(m_quad.polygon(), g_x1, g_y1, g_x2, g_y2); // Also note that we can use the linear interpolator instead of // arbitrary span_interpolator_trans. It works much faster, // but the transformations must be linear and parellel. typedef agg::span_interpolator_linear interpolator_type; interpolator_type interpolator(tr); typedef agg::span_image_filter_rgba_nn span_gen_type; span_gen_type sg(ia, interpolator); agg::render_scanlines_aa(g_rasterizer, g_scanline, rb_pre, sa, sg); break; } case 1: { agg::trans_bilinear tr(m_quad.polygon(), g_x1, g_y1, g_x2, g_y2); if(tr.is_valid()) { typedef agg::span_interpolator_linear interpolator_type; interpolator_type interpolator(tr); typedef agg::span_image_filter_rgba_2x2 span_gen_type; span_gen_type sg(ia, interpolator, filter); agg::render_scanlines_aa(g_rasterizer, g_scanline, rb_pre, sa, sg); } break; } case 2: { agg::trans_perspective tr(m_quad.polygon(), g_x1, g_y1, g_x2, g_y2); if(tr.is_valid()) { // Subdivision and linear interpolation (faster, but less accurate) //----------------------- //typedef agg::span_interpolator_linear interpolator_type; //typedef agg::span_subdiv_adaptor subdiv_adaptor_type; //interpolator_type interpolator(tr); //subdiv_adaptor_type subdiv_adaptor(interpolator); // //typedef agg::span_image_filter_rgba_2x2 span_gen_type; //span_gen_type sg(ia, subdiv_adaptor, filter); //----------------------- // Direct calculations of the coordinates //----------------------- typedef agg::span_interpolator_trans interpolator_type; interpolator_type interpolator(tr); typedef agg::span_image_filter_rgba_2x2 span_gen_type; span_gen_type sg(ia, interpolator, filter); //----------------------- agg::render_scanlines_aa(g_rasterizer, g_scanline, rb_pre, sa, sg); } break; } } double tm = elapsed_time(); char buf[128]; agg::gsv_text t; t.size(10.0); agg::conv_stroke pt(t); pt.width(1.5); sprintf(buf, "%3.2f ms", tm); t.start_point(10.0, 10.0); t.text(buf); g_rasterizer.add_path(pt); agg::render_scanlines_aa_solid(g_rasterizer, g_scanline, rb, agg::rgba(0,0,0)); //-------------------------- agg::render_ctrl(g_rasterizer, g_scanline, rb, m_trans_type); } virtual void on_mouse_button_down(int x, int y, unsigned flags) { if(flags & agg::mouse_left) { if(m_quad.on_mouse_button_down(x, y)) { force_redraw(); } } } virtual void on_mouse_move(int x, int y, unsigned flags) { if(flags & agg::mouse_left) { if(m_quad.on_mouse_move(x, y)) { force_redraw(); } } if((flags & agg::mouse_left) == 0) { on_mouse_button_up(x, y, flags); } } virtual void on_mouse_button_up(int x, int y, unsigned flags) { if(m_quad.on_mouse_button_up(x, y)) { force_redraw(); } } }; int agg_main(int argc, char* argv[]) { the_application app(agg::pix_format_bgra32, flip_y); app.caption("AGG Example. Image Perspective Transformations"); const char* img_name = "spheres"; if(argc >= 2) img_name = argv[1]; if(!app.load_img(0, img_name)) { char buf[256]; if(strcmp(img_name, "spheres") == 0) { sprintf(buf, "File not found: %s%s. Download http://www.antigrain.com/%s%s\n" "or copy it from another directory if available.", img_name, app.img_ext(), img_name, app.img_ext()); } else { sprintf(buf, "File not found: %s%s", img_name, app.img_ext()); } app.message(buf); return 1; } /* // Testing the "black border" issue with alpha channel //---------------------------------------- the_application::pixfmt pixf(app.rbuf_img(0)); the_application::renderer_base rbase(pixf); rbase.clear(agg::rgba8(0,0,0,0)); unsigned i; for(i = 0; i < 50; i++) { agg::ellipse ell(rand() % rbase.width(), rand() % rbase.height(), rand() % 20 + 5, rand() % 20 + 5, 100); g_rasterizer.add_path(ell); agg::render_scanlines_aa_solid(g_rasterizer, g_scanline, rbase, agg::rgba8((rand() & 0x7F) + 127, (rand() & 0x7F) + 127, (rand() & 0x7F) + 127, 255)); } */ if(app.init(600, 600, agg::window_resize)) { return app.run(); } return 1; } agg-2.5+dfsg1/examples/image_resample.cpp0000644000000000000000000003175310703246330020563 0ustar00usergroup00000000000000#include #include #include #include "agg_rendering_buffer.h" #include "agg_rasterizer_scanline_aa.h" #include "agg_scanline_u.h" #include "agg_renderer_scanline.h" #include "agg_path_storage.h" #include "agg_conv_transform.h" #include "agg_trans_affine.h" #include "agg_span_allocator.h" #include "agg_span_interpolator_linear.h" #include "agg_span_interpolator_trans.h" #include "agg_span_interpolator_persp.h" #include "agg_span_subdiv_adaptor.h" #include "agg_image_accessors.h" #include "agg_gamma_lut.h" #include "ctrl/agg_rbox_ctrl.h" #include "ctrl/agg_slider_ctrl.h" #include "platform/agg_platform_support.h" #include "interactive_polygon.h" int global_offset = 0; enum flip_y_e { flip_y = true }; agg::rasterizer_scanline_aa<> g_rasterizer; agg::scanline_u8 g_scanline; double g_x1 = 0; double g_y1 = 0; double g_x2 = 0; double g_y2 = 0; #include "agg_pixfmt_rgba.h" #include "agg_span_image_filter_rgba.h" #define pix_format agg::pix_format_bgra32 typedef agg::pixfmt_bgra32 pixfmt; typedef agg::pixfmt_bgra32_pre pixfmt_pre; #define image_filter_2x2_type agg::span_image_filter_rgba_2x2 #define image_resample_affine_type agg::span_image_resample_rgba_affine #define image_resample_type agg::span_image_resample_rgba typedef pixfmt::color_type color_type; typedef color_type::value_type value_type; typedef agg::renderer_base renderer_base; typedef agg::renderer_base renderer_base_pre; typedef agg::renderer_scanline_aa_solid renderer_solid; enum base_scale_e { base_shift = color_type::base_shift }; class the_application : public agg::platform_support { public: agg::gamma_lut m_gamma_lut; agg::interactive_polygon m_quad; agg::rbox_ctrl m_trans_type; agg::slider_ctrl m_gamma; agg::slider_ctrl m_blur; double m_old_gamma; the_application(agg::pix_format_e format, bool flip_y) : agg::platform_support(format, flip_y), m_gamma_lut(2.0), m_quad(4, 5.0), m_trans_type(400, 5.0, 430+170.0, 100.0, !flip_y), m_gamma(5.0, 5.0+15*0, 400-5, 10.0+15*0, !flip_y), m_blur (5.0, 5.0+15*1, 400-5, 10.0+15*1, !flip_y), m_old_gamma(2.0) { m_trans_type.text_size(7); m_trans_type.add_item("Affine No Resample"); m_trans_type.add_item("Affine Resample"); m_trans_type.add_item("Perspective No Resample LERP"); m_trans_type.add_item("Perspective No Resample Exact"); m_trans_type.add_item("Perspective Resample LERP"); m_trans_type.add_item("Perspective Resample Exact"); m_trans_type.cur_item(4); add_ctrl(m_trans_type); m_gamma.range(0.5, 3.0); m_gamma.value(2.0); m_gamma.label("Gamma=%.3f"); add_ctrl(m_gamma); m_blur.range(0.5, 5.0); m_blur.value(1.0); m_blur.label("Blur=%.3f"); add_ctrl(m_blur); } virtual void on_init() { g_x1 = 0.0; g_y1 = 0.0; g_x2 = rbuf_img(0).width(); g_y2 = rbuf_img(0).height(); double x1 = g_x1;// * 100.0; double y1 = g_y1;// * 100.0; double x2 = g_x2;// * 100.0; double y2 = g_y2;// * 100.0; double dx = width() / 2.0 - (x2 - x1) / 2.0; double dy = height() / 2.0 - (y2 - y1) / 2.0; m_quad.xn(0) = floor(x1 + dx); m_quad.yn(0) = floor(y1 + dy);// - 150; m_quad.xn(1) = floor(x2 + dx); m_quad.yn(1) = floor(y1 + dy);// - 110; m_quad.xn(2) = floor(x2 + dx); m_quad.yn(2) = floor(y2 + dy);// - 300; m_quad.xn(3) = floor(x1 + dx); m_quad.yn(3) = floor(y2 + dy);// - 200; pixfmt pixf(rbuf_img(0)); pixf.apply_gamma_dir(m_gamma_lut); } virtual void on_draw() { if(m_gamma.value() != m_old_gamma) { m_gamma_lut.gamma(m_gamma.value()); load_img(0, "spheres"); pixfmt pixf(rbuf_img(0)); pixf.apply_gamma_dir(m_gamma_lut); m_old_gamma = m_gamma.value(); } pixfmt pixf(rbuf_window()); pixfmt_pre pixf_pre(rbuf_window()); renderer_base rb(pixf); renderer_base_pre rb_pre(pixf_pre); renderer_solid r(rb); rb.clear(agg::rgba(1, 1, 1)); if(m_trans_type.cur_item() < 2) { // For the affine parallelogram transformations we // calculate the 4-th (implicit) point of the parallelogram m_quad.xn(3) = m_quad.xn(0) + (m_quad.xn(2) - m_quad.xn(1)); m_quad.yn(3) = m_quad.yn(0) + (m_quad.yn(2) - m_quad.yn(1)); } //-------------------------- // Render the "quad" tool and controls g_rasterizer.add_path(m_quad); r.color(agg::rgba(0, 0.3, 0.5, 0.1)); agg::render_scanlines(g_rasterizer, g_scanline, r); // Prepare the polygon to rasterize. Here we need to fill // the destination (transformed) polygon. g_rasterizer.clip_box(0, 0, width(), height()); g_rasterizer.reset(); int b = 0; g_rasterizer.move_to_d(m_quad.xn(0)-b, m_quad.yn(0)-b); g_rasterizer.line_to_d(m_quad.xn(1)+b, m_quad.yn(1)-b); g_rasterizer.line_to_d(m_quad.xn(2)+b, m_quad.yn(2)+b); g_rasterizer.line_to_d(m_quad.xn(3)-b, m_quad.yn(3)+b); typedef agg::span_allocator span_alloc_type; span_alloc_type sa; agg::image_filter_bilinear filter_kernel; agg::image_filter_lut filter(filter_kernel, true); pixfmt pixf_img(rbuf_img(0)); typedef agg::image_accessor_clone source_type; source_type source(pixf_img); start_timer(); switch(m_trans_type.cur_item()) { case 0: { agg::trans_affine tr(m_quad.polygon(), g_x1, g_y1, g_x2, g_y2); typedef agg::span_interpolator_linear interpolator_type; interpolator_type interpolator(tr); typedef image_filter_2x2_type span_gen_type; span_gen_type sg(source, interpolator, filter); agg::render_scanlines_aa(g_rasterizer, g_scanline, rb_pre, sa, sg); break; } case 1: { agg::trans_affine tr(m_quad.polygon(), g_x1, g_y1, g_x2, g_y2); typedef agg::span_interpolator_linear interpolator_type; typedef image_resample_affine_type span_gen_type; interpolator_type interpolator(tr); span_gen_type sg(source, interpolator, filter); sg.blur(m_blur.value()); agg::render_scanlines_aa(g_rasterizer, g_scanline, rb_pre, sa, sg); break; } case 2: { agg::trans_perspective tr(m_quad.polygon(), g_x1, g_y1, g_x2, g_y2); if(tr.is_valid()) { typedef agg::span_interpolator_linear_subdiv interpolator_type; interpolator_type interpolator(tr); typedef image_filter_2x2_type span_gen_type; span_gen_type sg(source, interpolator, filter); agg::render_scanlines_aa(g_rasterizer, g_scanline, rb_pre, sa, sg); } break; } case 3: { agg::trans_perspective tr(m_quad.polygon(), g_x1, g_y1, g_x2, g_y2); if(tr.is_valid()) { typedef agg::span_interpolator_trans interpolator_type; interpolator_type interpolator(tr); typedef image_filter_2x2_type span_gen_type; span_gen_type sg(source, interpolator, filter); agg::render_scanlines_aa(g_rasterizer, g_scanline, rb_pre, sa, sg); } break; } case 4: { typedef agg::span_interpolator_persp_lerp<> interpolator_type; typedef agg::span_subdiv_adaptor subdiv_adaptor_type; interpolator_type interpolator(m_quad.polygon(), g_x1, g_y1, g_x2, g_y2); subdiv_adaptor_type subdiv_adaptor(interpolator); if(interpolator.is_valid()) { typedef image_resample_type span_gen_type; span_gen_type sg(source, subdiv_adaptor, filter); sg.blur(m_blur.value()); agg::render_scanlines_aa(g_rasterizer, g_scanline, rb_pre, sa, sg); } break; } case 5: { typedef agg::span_interpolator_persp_exact<> interpolator_type; typedef agg::span_subdiv_adaptor subdiv_adaptor_type; interpolator_type interpolator(m_quad.polygon(), g_x1, g_y1, g_x2, g_y2); subdiv_adaptor_type subdiv_adaptor(interpolator); if(interpolator.is_valid()) { typedef image_resample_type span_gen_type; span_gen_type sg(source, subdiv_adaptor, filter); sg.blur(m_blur.value()); agg::render_scanlines_aa(g_rasterizer, g_scanline, rb_pre, sa, sg); } break; } } double tm = elapsed_time(); pixf.apply_gamma_inv(m_gamma_lut); char buf[64]; agg::gsv_text t; t.size(10.0); agg::conv_stroke pt(t); pt.width(1.5); sprintf(buf, "%3.2f ms", tm); t.start_point(10.0, 70.0); t.text(buf); g_rasterizer.add_path(pt); r.color(agg::rgba(0,0,0)); agg::render_scanlines(g_rasterizer, g_scanline, r); //-------------------------- agg::render_ctrl(g_rasterizer, g_scanline, rb, m_trans_type); agg::render_ctrl(g_rasterizer, g_scanline, rb, m_gamma); agg::render_ctrl(g_rasterizer, g_scanline, rb, m_blur); } virtual void on_mouse_button_down(int x, int y, unsigned flags) { if(flags & agg::mouse_left) { if(m_quad.on_mouse_button_down(x, y)) { force_redraw(); } } } virtual void on_mouse_move(int x, int y, unsigned flags) { if(flags & agg::mouse_left) { if(m_quad.on_mouse_move(x, y)) { force_redraw(); } } if((flags & agg::mouse_left) == 0) { on_mouse_button_up(x, y, flags); } } virtual void on_mouse_button_up(int x, int y, unsigned flags) { if(m_quad.on_mouse_button_up(x, y)) { force_redraw(); } } virtual void on_key(int x, int y, unsigned key, unsigned flags) { if(key == ' ') { double cx = (m_quad.xn(0) + m_quad.xn(1) + m_quad.xn(2) + m_quad.xn(3)) / 4; double cy = (m_quad.yn(0) + m_quad.yn(1) + m_quad.yn(2) + m_quad.yn(3)) / 4; agg::trans_affine tr = agg::trans_affine_translation(-cx, -cy); tr *= agg::trans_affine_rotation(agg::pi / 2.0); tr *= agg::trans_affine_translation(cx, cy); tr.transform(&m_quad.xn(0), &m_quad.yn(0)); tr.transform(&m_quad.xn(1), &m_quad.yn(1)); tr.transform(&m_quad.xn(2), &m_quad.yn(2)); tr.transform(&m_quad.xn(3), &m_quad.yn(3)); force_redraw(); } } }; int agg_main(int argc, char* argv[]) { the_application app(pix_format, flip_y); app.caption("AGG Example. Image Transformations with Resampling"); const char* img_name = "spheres"; if(argc >= 2) img_name = argv[1]; if(!app.load_img(0, img_name)) { char buf[256]; if(strcmp(img_name, "spheres") == 0) { sprintf(buf, "File not found: %s%s. Download http://www.antigrain.com/%s%s\n" "or copy it from another directory if available.", img_name, app.img_ext(), img_name, app.img_ext()); } else { sprintf(buf, "File not found: %s%s", img_name, app.img_ext()); } app.message(buf); return 1; } if(app.init(600, 600, agg::window_resize)) { return app.run(); } return 1; } agg-2.5+dfsg1/examples/image_transforms.cpp0000644000000000000000000003275010703246330021147 0ustar00usergroup00000000000000#include #include #include #include "agg_rendering_buffer.h" #include "agg_rasterizer_scanline_aa.h" #include "agg_path_storage.h" #include "agg_trans_affine.h" #include "agg_conv_transform.h" #include "agg_pixfmt_rgba.h" #include "agg_span_image_filter_rgba.h" #include "agg_span_interpolator_linear.h" #include "agg_scanline_u.h" #include "agg_renderer_scanline.h" #include "agg_span_allocator.h" #include "ctrl/agg_slider_ctrl.h" #include "ctrl/agg_rbox_ctrl.h" #include "ctrl/agg_cbox_ctrl.h" #include "platform/agg_platform_support.h" enum flip_y_e { flip_y = true }; class the_application : public agg::platform_support { agg::slider_ctrl m_polygon_angle; agg::slider_ctrl m_polygon_scale; agg::slider_ctrl m_image_angle; agg::slider_ctrl m_image_scale; agg::cbox_ctrl m_rotate_polygon; agg::cbox_ctrl m_rotate_image; agg::rbox_ctrl m_example; double m_image_center_x; double m_image_center_y; double m_polygon_cx; double m_polygon_cy; double m_image_cx; double m_image_cy; double m_dx; double m_dy; int m_flag; public: //------------------------------------------------------------------------ the_application(agg::pix_format_e format, bool flip_y) : agg::platform_support(format, flip_y), m_polygon_angle(5, 5, 145, 11, !flip_y), m_polygon_scale(5, 5+14, 145, 12+14, !flip_y), m_image_angle (155, 5, 300, 12, !flip_y), m_image_scale (155, 5+14, 300, 12+14, !flip_y), m_rotate_polygon(5, 5+14+14, "Rotate Polygon", !flip_y), m_rotate_image (5, 5+14+14+14, "Rotate Image", !flip_y), m_example(-3.0, 14+14+14+14, -3.0, 14+14+14+14, !flip_y), m_flag(0) { add_ctrl(m_polygon_angle); add_ctrl(m_polygon_scale); add_ctrl(m_image_angle); add_ctrl(m_image_scale); add_ctrl(m_rotate_polygon); add_ctrl(m_rotate_image); add_ctrl(m_example); m_polygon_angle.label("Polygon Angle=%3.2f"); m_polygon_scale.label("Polygon Scale=%3.2f"); m_polygon_angle.range(-180.0, 180.0); m_polygon_scale.range(0.1, 5.0); m_polygon_scale.value(1.0); m_image_angle.label("Image Angle=%3.2f"); m_image_scale.label("Image Scale=%3.2f"); m_image_angle.range(-180.0, 180.0); m_image_scale.range(0.1, 5.0); m_image_scale.value(1.0); m_example.add_item("0"); m_example.add_item("1"); m_example.add_item("2"); m_example.add_item("3"); m_example.add_item("4"); m_example.add_item("5"); m_example.add_item("6"); m_example.cur_item(0); } //------------------------------------------------------------------------ virtual ~the_application() { } //------------------------------------------------------------------------ virtual void on_init() { m_image_center_x = initial_width() / 2.0; m_image_center_y = initial_height() / 2.0; m_polygon_cx = m_image_cx = initial_width() / 2.0; m_polygon_cy = m_image_cy = initial_height() / 2.0; } //------------------------------------------------------------------------ void create_star(agg::path_storage& ps) { double r = initial_width(); if(initial_height() < r) r = initial_height(); double r1 = r / 3 - 8.0; double r2 = r1 / 1.45; unsigned nr = 14; unsigned i; for(i = 0; i < nr; i++) { double a = agg::pi * 2.0 * i / nr - agg::pi / 2.0; double dx = cos(a); double dy = sin(a); if(i & 1) { ps.line_to(m_polygon_cx + dx * r1, m_polygon_cy + dy * r1); } else { if(i) ps.line_to(m_polygon_cx + dx * r2, m_polygon_cy + dy * r2); else ps.move_to(m_polygon_cx + dx * r2, m_polygon_cy + dy * r2); } } } //------------------------------------------------------------------------ virtual void on_draw() { typedef agg::pixfmt_bgra32 pixfmt; typedef pixfmt::color_type color_type; typedef agg::renderer_base renderer_base; typedef agg::renderer_scanline_aa_solid renderer_solid; pixfmt pixf(rbuf_window()); pixfmt pixf_img(rbuf_img(0)); renderer_base rb(pixf); renderer_solid rs(rb); rb.clear(agg::rgba(1.0, 1.0, 1.0)); agg::trans_affine image_mtx; agg::trans_affine polygon_mtx; polygon_mtx *= agg::trans_affine_translation(-m_polygon_cx, -m_polygon_cy); polygon_mtx *= agg::trans_affine_rotation(m_polygon_angle.value() * agg::pi / 180.0); polygon_mtx *= agg::trans_affine_scaling(m_polygon_scale.value()); polygon_mtx *= agg::trans_affine_translation(m_polygon_cx, m_polygon_cy); switch(m_example.cur_item()) { default: case 0: // --------------(Example 0, Identity matrix) break; case 1: // --------------(Example 1) image_mtx *= agg::trans_affine_translation(-m_image_center_x, -m_image_center_y); image_mtx *= agg::trans_affine_rotation(m_polygon_angle.value() * agg::pi / 180.0); image_mtx *= agg::trans_affine_scaling(m_polygon_scale.value()); image_mtx *= agg::trans_affine_translation(m_polygon_cx, m_polygon_cy); image_mtx.invert(); break; case 2: // --------------(Example 2) image_mtx *= agg::trans_affine_translation(-m_image_center_x, -m_image_center_y); image_mtx *= agg::trans_affine_rotation(m_image_angle.value() * agg::pi / 180.0); image_mtx *= agg::trans_affine_scaling(m_image_scale.value()); image_mtx *= agg::trans_affine_translation(m_image_cx, m_image_cy); image_mtx.invert(); break; case 3: // --------------(Example 3) image_mtx *= agg::trans_affine_translation(-m_image_center_x, -m_image_center_y); image_mtx *= agg::trans_affine_rotation(m_image_angle.value() * agg::pi / 180.0); image_mtx *= agg::trans_affine_scaling(m_image_scale.value()); image_mtx *= agg::trans_affine_translation(m_polygon_cx, m_polygon_cy); image_mtx.invert(); break; case 4: // --------------(Example 4) image_mtx *= agg::trans_affine_translation(-m_image_cx, -m_image_cy); image_mtx *= agg::trans_affine_rotation(m_polygon_angle.value() * agg::pi / 180.0); image_mtx *= agg::trans_affine_scaling(m_polygon_scale.value()); image_mtx *= agg::trans_affine_translation(m_polygon_cx, m_polygon_cy); image_mtx.invert(); break; case 5: // --------------(Example 5) image_mtx *= agg::trans_affine_translation(-m_image_center_x, -m_image_center_y); image_mtx *= agg::trans_affine_rotation(m_image_angle.value() * agg::pi / 180.0); image_mtx *= agg::trans_affine_rotation(m_polygon_angle.value() * agg::pi / 180.0); image_mtx *= agg::trans_affine_scaling(m_image_scale.value()); image_mtx *= agg::trans_affine_scaling(m_polygon_scale.value()); image_mtx *= agg::trans_affine_translation(m_image_cx, m_image_cy); image_mtx.invert(); break; case 6: // --------------(Example 6) image_mtx *= agg::trans_affine_translation(-m_image_cx, -m_image_cy); image_mtx *= agg::trans_affine_rotation(m_image_angle.value() * agg::pi / 180.0); image_mtx *= agg::trans_affine_scaling(m_image_scale.value()); image_mtx *= agg::trans_affine_translation(m_image_cx, m_image_cy); image_mtx.invert(); break; } typedef agg::span_interpolator_linear<> interpolator_type; interpolator_type interpolator(image_mtx); agg::span_allocator sa; // "hardcoded" bilinear filter //------------------------------------------ typedef agg::span_image_filter_rgba_bilinear_clip span_gen_type; span_gen_type sg(pixf_img, agg::rgba(1,1,1), interpolator); //------------------------------------------ agg::rasterizer_scanline_aa<> ras; agg::scanline_u8 sl; agg::path_storage ps; create_star(ps); agg::conv_transform tr(ps, polygon_mtx); ras.add_path(tr); agg::render_scanlines_aa(ras, sl, rb, sa, sg); agg::ellipse e1(m_image_cx, m_image_cy, 5, 5, 20); agg::ellipse e2(m_image_cx, m_image_cy, 2, 2, 20); agg::conv_stroke c1(e1); rs.color(agg::rgba(0.7,0.8,0)); ras.add_path(e1); agg::render_scanlines(ras, sl, rs); rs.color(agg::rgba(0,0,0)); ras.add_path(c1); agg::render_scanlines(ras, sl, rs); ras.add_path(e2); agg::render_scanlines(ras, sl, rs); agg::render_ctrl(ras, sl, rb, m_polygon_angle); agg::render_ctrl(ras, sl, rb, m_polygon_scale); agg::render_ctrl(ras, sl, rb, m_image_angle); agg::render_ctrl(ras, sl, rb, m_image_scale); agg::render_ctrl(ras, sl, rb, m_rotate_polygon); agg::render_ctrl(ras, sl, rb, m_rotate_image); agg::render_ctrl(ras, sl, rb, m_example); } //------------------------------------------------------------------------ virtual void on_mouse_button_down(int x, int y, unsigned flags) { if(flags & agg::mouse_left) { if(sqrt((x - m_image_cx) * (x - m_image_cx) + (y - m_image_cy) * (y - m_image_cy) ) < 5.0) { m_dx = x - m_image_cx; m_dy = y - m_image_cy; m_flag = 1; } else { agg::rasterizer_scanline_aa<> ras; agg::trans_affine polygon_mtx; polygon_mtx *= agg::trans_affine_translation(-m_polygon_cx, -m_polygon_cy); polygon_mtx *= agg::trans_affine_rotation(m_polygon_angle.value() * agg::pi / 180.0); polygon_mtx *= agg::trans_affine_scaling(m_polygon_scale.value(), m_polygon_scale.value()); polygon_mtx *= agg::trans_affine_translation(m_polygon_cx, m_polygon_cy); agg::path_storage ps; create_star(ps); agg::conv_transform tr(ps, polygon_mtx); ras.add_path(tr); if(ras.hit_test(x, y)) { m_dx = x - m_polygon_cx; m_dy = y - m_polygon_cy; m_flag = 2; } } } } //------------------------------------------------------------------------ virtual void on_mouse_move(int x, int y, unsigned flags) { if(flags & agg::mouse_left) { if(m_flag == 1) { m_image_cx = x - m_dx; m_image_cy = y - m_dy; force_redraw(); } if(m_flag == 2) { m_polygon_cx = x - m_dx; m_polygon_cy = y - m_dy; force_redraw(); } } else { on_mouse_button_up(x, y, flags); } } //------------------------------------------------------------------------ virtual void on_mouse_button_up(int x, int y, unsigned flags) { m_flag = 0; } //------------------------------------------------------------------------ virtual void on_ctrl_change() { if(m_rotate_polygon.status() || m_rotate_image.status()) { wait_mode(false); } else { wait_mode(true); } force_redraw(); } //------------------------------------------------------------------------ virtual void on_idle() { bool redraw = false; if(m_rotate_polygon.status()) { m_polygon_angle.value(m_polygon_angle.value() + 0.5); if(m_polygon_angle.value() >= 180.0) { m_polygon_angle.value(m_polygon_angle.value() - 360.0); } redraw = true; } if(m_rotate_image.status()) { m_image_angle.value(m_image_angle.value() + 0.5); if(m_image_angle.value() >= 180.0) { m_image_angle.value(m_image_angle.value() - 360.0); } redraw = true; } if(redraw) force_redraw(); } }; int agg_main(int argc, char* argv[]) { the_application app(agg::pix_format_bgra32, flip_y); app.caption("Image Affine Transformations with filtering"); const char* img_name = "spheres"; if(argc >= 2) img_name = argv[1]; if(!app.load_img(0, img_name)) { char buf[256]; if(strcmp(img_name, "spheres") == 0) { sprintf(buf, "File not found: %s%s. Download http://www.antigrain.com/%s%s\n" "or copy it from another directory if available.", img_name, app.img_ext(), img_name, app.img_ext()); } else { sprintf(buf, "File not found: %s%s", img_name, app.img_ext()); } app.message(buf); return 1; } if(app.init(app.rbuf_img(0).width(), app.rbuf_img(0).height(), 0)) { return app.run(); } return 0; } agg-2.5+dfsg1/examples/interactive_polygon.cpp0000644000000000000000000002153610703246330021673 0ustar00usergroup00000000000000#include "agg_basics.h" #include "interactive_polygon.h" namespace agg { interactive_polygon::interactive_polygon(unsigned np, double point_radius) : m_polygon(np * 2), m_num_points(np), m_node(-1), m_edge(-1), m_vs(&m_polygon[0], m_num_points, false), m_stroke(m_vs), m_point_radius(point_radius), m_status(0), m_dx(0.0), m_dy(0.0) { m_stroke.width(1.0); } void interactive_polygon::rewind(unsigned) { m_status = 0; m_stroke.rewind(0); } unsigned interactive_polygon::vertex(double* x, double* y) { unsigned cmd = path_cmd_stop; double r = m_point_radius; if(m_status == 0) { cmd = m_stroke.vertex(x, y); if(!is_stop(cmd)) return cmd; if(m_node >= 0 && m_node == int(m_status)) r *= 1.2; m_ellipse.init(xn(m_status), yn(m_status), r, r, 32); ++m_status; } cmd = m_ellipse.vertex(x, y); if(!is_stop(cmd)) return cmd; if(m_status >= m_num_points) return path_cmd_stop; if(m_node >= 0 && m_node == int(m_status)) r *= 1.2; m_ellipse.init(xn(m_status), yn(m_status), r, r, 32); ++m_status; return m_ellipse.vertex(x, y); } bool interactive_polygon::check_edge(unsigned i, double x, double y) const { bool ret = false; unsigned n1 = i; unsigned n2 = (i + m_num_points - 1) % m_num_points; double x1 = xn(n1); double y1 = yn(n1); double x2 = xn(n2); double y2 = yn(n2); double dx = x2 - x1; double dy = y2 - y1; if(sqrt(dx*dx + dy*dy) > 0.0000001) { double x3 = x; double y3 = y; double x4 = x3 - dy; double y4 = y3 + dx; double den = (y4-y3) * (x2-x1) - (x4-x3) * (y2-y1); double u1 = ((x4-x3) * (y1-y3) - (y4-y3) * (x1-x3)) / den; double xi = x1 + u1 * (x2 - x1); double yi = y1 + u1 * (y2 - y1); dx = xi - x; dy = yi - y; if (u1 > 0.0 && u1 < 1.0 && sqrt(dx*dx + dy*dy) <= m_point_radius) { ret = true; } } return ret; } bool interactive_polygon::on_mouse_button_down(double x, double y) { unsigned i; bool ret = false; m_node = -1; m_edge = -1; for (i = 0; i < m_num_points; i++) { if(sqrt( (x-xn(i)) * (x-xn(i)) + (y-yn(i)) * (y-yn(i)) ) < m_point_radius) { m_dx = x - xn(i); m_dy = y - yn(i); m_node = int(i); ret = true; break; } } if(!ret) { for (i = 0; i < m_num_points; i++) { if(check_edge(i, x, y)) { m_dx = x; m_dy = y; m_edge = int(i); ret = true; break; } } } if(!ret) { if(point_in_polygon(x, y)) { m_dx = x; m_dy = y; m_node = int(m_num_points); ret = true; } } return ret; } bool interactive_polygon::on_mouse_move(double x, double y) { bool ret = false; double dx; double dy; if(m_node == int(m_num_points)) { dx = x - m_dx; dy = y - m_dy; unsigned i; for(i = 0; i < m_num_points; i++) { xn(i) += dx; yn(i) += dy; } m_dx = x; m_dy = y; ret = true; } else { if(m_edge >= 0) { unsigned n1 = m_edge; unsigned n2 = (n1 + m_num_points - 1) % m_num_points; dx = x - m_dx; dy = y - m_dy; xn(n1) += dx; yn(n1) += dy; xn(n2) += dx; yn(n2) += dy; m_dx = x; m_dy = y; ret = true; } else { if(m_node >= 0) { xn(m_node) = x - m_dx; yn(m_node) = y - m_dy; ret = true; } } } return ret; } bool interactive_polygon::on_mouse_button_up(double x, double y) { bool ret = (m_node >= 0) || (m_edge >= 0); m_node = -1; m_edge = -1; return ret; } //======= Crossings Multiply algorithm of InsideTest ======================== // // By Eric Haines, 3D/Eye Inc, erich@eye.com // // This version is usually somewhat faster than the original published in // Graphics Gems IV; by turning the division for testing the X axis crossing // into a tricky multiplication test this part of the test became faster, // which had the additional effect of making the test for "both to left or // both to right" a bit slower for triangles than simply computing the // intersection each time. The main increase is in triangle testing speed, // which was about 15% faster; all other polygon complexities were pretty much // the same as before. On machines where division is very expensive (not the // case on the HP 9000 series on which I tested) this test should be much // faster overall than the old code. Your mileage may (in fact, will) vary, // depending on the machine and the test data, but in general I believe this // code is both shorter and faster. This test was inspired by unpublished // Graphics Gems submitted by Joseph Samosky and Mark Haigh-Hutchinson. // Related work by Samosky is in: // // Samosky, Joseph, "SectionView: A system for interactively specifying and // visualizing sections through three-dimensional medical image data", // M.S. Thesis, Department of Electrical Engineering and Computer Science, // Massachusetts Institute of Technology, 1993. // // Shoot a test ray along +X axis. The strategy is to compare vertex Y values // to the testing point's Y and quickly discard edges which are entirely to one // side of the test ray. Note that CONVEX and WINDING code can be added as // for the CrossingsTest() code; it is left out here for clarity. // // Input 2D polygon _pgon_ with _numverts_ number of vertices and test point // _point_, returns 1 if inside, 0 if outside. bool interactive_polygon::point_in_polygon(double tx, double ty) const { if(m_num_points < 3) return false; unsigned j; int yflag0, yflag1, inside_flag; double vtx0, vty0, vtx1, vty1; vtx0 = xn(m_num_points - 1); vty0 = yn(m_num_points - 1); // get test bit for above/below X axis yflag0 = (vty0 >= ty); vtx1 = xn(0); vty1 = yn(0); inside_flag = 0; for (j = 1; j <= m_num_points; ++j) { yflag1 = (vty1 >= ty); // Check if endpoints straddle (are on opposite sides) of X axis // (i.e. the Y's differ); if so, +X ray could intersect this edge. // The old test also checked whether the endpoints are both to the // right or to the left of the test point. However, given the faster // intersection point computation used below, this test was found to // be a break-even proposition for most polygons and a loser for // triangles (where 50% or more of the edges which survive this test // will cross quadrants and so have to have the X intersection computed // anyway). I credit Joseph Samosky with inspiring me to try dropping // the "both left or both right" part of my code. if (yflag0 != yflag1) { // Check intersection of pgon segment with +X ray. // Note if >= point's X; if so, the ray hits it. // The division operation is avoided for the ">=" test by checking // the sign of the first vertex wrto the test point; idea inspired // by Joseph Samosky's and Mark Haigh-Hutchinson's different // polygon inclusion tests. if ( ((vty1-ty) * (vtx0-vtx1) >= (vtx1-tx) * (vty0-vty1)) == yflag1 ) { inside_flag ^= 1; } } // Move to the next pair of vertices, retaining info as possible. yflag0 = yflag1; vtx0 = vtx1; vty0 = vty1; unsigned k = (j >= m_num_points) ? j - m_num_points : j; vtx1 = xn(k); vty1 = yn(k); } return inside_flag != 0; } } agg-2.5+dfsg1/examples/interactive_polygon.h0000644000000000000000000000572110703246330021336 0ustar00usergroup00000000000000#ifndef INTERACTIVE_POLYGON_INCLUDED #define INTERACTIVE_POLYGON_INCLUDED #include "agg_array.h" #include "agg_conv_stroke.h" #include "agg_ellipse.h" namespace agg { class simple_polygon_vertex_source { public: simple_polygon_vertex_source(const double* polygon, unsigned np, bool roundoff = false, bool close = true) : m_polygon(polygon), m_num_points(np), m_vertex(0), m_roundoff(roundoff), m_close(close) { } void close(bool f) { m_close = f; } bool close() const { return m_close; } void rewind(unsigned) { m_vertex = 0; } unsigned vertex(double* x, double* y) { if(m_vertex > m_num_points) return path_cmd_stop; if(m_vertex == m_num_points) { ++m_vertex; return path_cmd_end_poly | (m_close ? path_flags_close : 0); } *x = m_polygon[m_vertex * 2]; *y = m_polygon[m_vertex * 2 + 1]; if(m_roundoff) { *x = floor(*x) + 0.5; *y = floor(*y) + 0.5; } ++m_vertex; return (m_vertex == 1) ? path_cmd_move_to : path_cmd_line_to; } private: const double* m_polygon; unsigned m_num_points; unsigned m_vertex; bool m_roundoff; bool m_close; }; class interactive_polygon { public: interactive_polygon(unsigned np, double point_radius); unsigned num_points() const { return m_num_points; } double xn(unsigned n) const { return m_polygon[n * 2]; } double yn(unsigned n) const { return m_polygon[n * 2 + 1]; } double& xn(unsigned n) { return m_polygon[n * 2]; } double& yn(unsigned n) { return m_polygon[n * 2 + 1]; } const double* polygon() const { return &m_polygon[0]; } int node() const { return m_node; } void node(int n) { m_node = n; } void close(bool f) { m_vs.close(f); } bool close() const { return m_vs.close(); } void rewind(unsigned); unsigned vertex(double* x, double* y); bool on_mouse_button_down(double x, double y); bool on_mouse_move(double x, double y); bool on_mouse_button_up(double x, double y); private: bool check_edge(unsigned i, double x, double y) const; bool point_in_polygon(double x, double y) const; pod_array m_polygon; unsigned m_num_points; int m_node; int m_edge; simple_polygon_vertex_source m_vs; conv_stroke m_stroke; ellipse m_ellipse; double m_point_radius; unsigned m_status; double m_dx; double m_dy; }; } #endif agg-2.5+dfsg1/examples/line_patterns.cpp0000644000000000000000000003273110703246330020455 0ustar00usergroup00000000000000#include #include #include #include "agg_basics.h" #include "agg_rendering_buffer.h" #include "agg_conv_transform.h" #include "agg_conv_stroke.h" #include "agg_conv_clip_polyline.h" #include "agg_scanline_p.h" #include "agg_renderer_scanline.h" #include "agg_rasterizer_outline_aa.h" #include "agg_rasterizer_scanline_aa.h" #include "agg_pattern_filters_rgba.h" #include "agg_renderer_outline_aa.h" #include "agg_renderer_outline_image.h" #include "agg_pixfmt_rgb.h" #include "ctrl/agg_slider_ctrl.h" #include "ctrl/agg_bezier_ctrl.h" #include "platform/agg_platform_support.h" enum flip_y_e { flip_y = true }; typedef agg::pixfmt_bgr24 pixfmt; static agg::int8u brightness_to_alpha[256 * 3] = { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 254, 254, 254, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 251, 251, 251, 251, 251, 251, 251, 251, 251, 250, 250, 250, 250, 250, 250, 250, 250, 249, 249, 249, 249, 249, 249, 249, 248, 248, 248, 248, 248, 248, 248, 247, 247, 247, 247, 247, 246, 246, 246, 246, 246, 246, 245, 245, 245, 245, 245, 244, 244, 244, 244, 243, 243, 243, 243, 243, 242, 242, 242, 242, 241, 241, 241, 241, 240, 240, 240, 239, 239, 239, 239, 238, 238, 238, 238, 237, 237, 237, 236, 236, 236, 235, 235, 235, 234, 234, 234, 233, 233, 233, 232, 232, 232, 231, 231, 230, 230, 230, 229, 229, 229, 228, 228, 227, 227, 227, 226, 226, 225, 225, 224, 224, 224, 223, 223, 222, 222, 221, 221, 220, 220, 219, 219, 219, 218, 218, 217, 217, 216, 216, 215, 214, 214, 213, 213, 212, 212, 211, 211, 210, 210, 209, 209, 208, 207, 207, 206, 206, 205, 204, 204, 203, 203, 202, 201, 201, 200, 200, 199, 198, 198, 197, 196, 196, 195, 194, 194, 193, 192, 192, 191, 190, 190, 189, 188, 188, 187, 186, 186, 185, 184, 183, 183, 182, 181, 180, 180, 179, 178, 177, 177, 176, 175, 174, 174, 173, 172, 171, 171, 170, 169, 168, 167, 166, 166, 165, 164, 163, 162, 162, 161, 160, 159, 158, 157, 156, 156, 155, 154, 153, 152, 151, 150, 149, 148, 148, 147, 146, 145, 144, 143, 142, 141, 140, 139, 138, 137, 136, 135, 134, 133, 132, 131, 130, 129, 128, 128, 127, 125, 124, 123, 122, 121, 120, 119, 118, 117, 116, 115, 114, 113, 112, 111, 110, 109, 108, 107, 106, 105, 104, 102, 101, 100, 99, 98, 97, 96, 95, 94, 93, 91, 90, 89, 88, 87, 86, 85, 84, 82, 81, 80, 79, 78, 77, 75, 74, 73, 72, 71, 70, 69, 67, 66, 65, 64, 63, 61, 60, 59, 58, 57, 56, 54, 53, 52, 51, 50, 48, 47, 46, 45, 44, 42, 41, 40, 39, 37, 36, 35, 34, 33, 31, 30, 29, 28, 27, 25, 24, 23, 22, 20, 19, 18, 17, 15, 14, 13, 12, 11, 9, 8, 7, 6, 4, 3, 2, 1 }; class pattern_src_brightness_to_alpha_rgba8 { public: pattern_src_brightness_to_alpha_rgba8(agg::rendering_buffer& rb) : m_rb(&rb), m_pf(*m_rb) {} unsigned width() const { return m_pf.width(); } unsigned height() const { return m_pf.height(); } agg::rgba8 pixel(int x, int y) const { agg::rgba8 c = m_pf.pixel(x, y); c.a = brightness_to_alpha[c.r + c.g + c.b]; return c; } private: agg::rendering_buffer* m_rb; pixfmt m_pf; }; class the_application : public agg::platform_support { agg::rgba8 m_ctrl_color; agg::bezier_ctrl m_curve1; agg::bezier_ctrl m_curve2; agg::bezier_ctrl m_curve3; agg::bezier_ctrl m_curve4; agg::bezier_ctrl m_curve5; agg::bezier_ctrl m_curve6; agg::bezier_ctrl m_curve7; agg::bezier_ctrl m_curve8; agg::bezier_ctrl m_curve9; agg::slider_ctrl m_scale_x; agg::slider_ctrl m_start_x; public: typedef agg::renderer_base renderer_base; typedef agg::renderer_scanline_aa_solid renderer_scanline; typedef agg::rasterizer_scanline_aa<> rasterizer_scanline; typedef agg::scanline_p8 scanline; the_application(agg::pix_format_e format, bool flip_y) : agg::platform_support(format, flip_y), m_ctrl_color(agg::rgba(0, 0.3, 0.5, 0.3)), m_scale_x(5.0, 5.0, 240.0, 12.0, !flip_y), m_start_x(250.0, 5.0, 495.0, 12.0, !flip_y) { m_curve1.line_color(m_ctrl_color); m_curve2.line_color(m_ctrl_color); m_curve3.line_color(m_ctrl_color); m_curve4.line_color(m_ctrl_color); m_curve5.line_color(m_ctrl_color); m_curve6.line_color(m_ctrl_color); m_curve7.line_color(m_ctrl_color); m_curve8.line_color(m_ctrl_color); m_curve9.line_color(m_ctrl_color); m_curve1.curve(64, 19, 14, 126, 118, 266, 19, 265); m_curve2.curve(112, 113, 178, 32, 200, 132, 125, 438); m_curve3.curve(401, 24, 326, 149, 285, 11, 177, 77); m_curve4.curve(188, 427, 129, 295, 19, 283, 25, 410); m_curve5.curve(451, 346, 302, 218, 265, 441, 459, 400); m_curve6.curve(454, 198, 14, 13, 220, 291, 483, 283); m_curve7.curve(301, 398, 355, 231, 209, 211, 170, 353); m_curve8.curve(484, 101, 222, 33, 486, 435, 487, 138); m_curve9.curve(143, 147, 11, 45, 83, 427, 132, 197); add_ctrl(m_curve1); add_ctrl(m_curve2); add_ctrl(m_curve3); add_ctrl(m_curve4); add_ctrl(m_curve5); add_ctrl(m_curve6); add_ctrl(m_curve7); add_ctrl(m_curve8); add_ctrl(m_curve9); m_curve1.no_transform(); m_curve2.no_transform(); m_curve3.no_transform(); m_curve4.no_transform(); m_curve5.no_transform(); m_curve6.no_transform(); m_curve7.no_transform(); m_curve8.no_transform(); m_curve9.no_transform(); m_scale_x.label("Scale X=%.2f"); m_scale_x.range(0.2, 3.0); m_scale_x.value(1.0); m_scale_x.no_transform(); add_ctrl(m_scale_x); m_start_x.label("Start X=%.2f"); m_start_x.range(0.0, 10.0); m_start_x.value(0.0); m_start_x.no_transform(); add_ctrl(m_start_x); } template void draw_curve(Pattern& patt, Rasterizer& ras, Renderer& ren, PatternSource& src, VertexSource& vs) { patt.create(src); ren.scale_x(m_scale_x.value()); ren.start_x(m_start_x.value()); ras.add_path(vs); } virtual void on_draw() { pixfmt pf(rbuf_window()); renderer_base ren_base(pf); ren_base.clear(agg::rgba(1.0, 1.0, 0.95)); renderer_scanline ren(ren_base); rasterizer_scanline ras; scanline sl; // Pattern source. Must have an interface: // width() const // height() const // pixel(int x, int y) const // Any agg::renderer_base<> or derived // is good for the use as a source. //----------------------------------- pattern_src_brightness_to_alpha_rgba8 p1(rbuf_img(0)); pattern_src_brightness_to_alpha_rgba8 p2(rbuf_img(1)); pattern_src_brightness_to_alpha_rgba8 p3(rbuf_img(2)); pattern_src_brightness_to_alpha_rgba8 p4(rbuf_img(3)); pattern_src_brightness_to_alpha_rgba8 p5(rbuf_img(4)); pattern_src_brightness_to_alpha_rgba8 p6(rbuf_img(5)); pattern_src_brightness_to_alpha_rgba8 p7(rbuf_img(6)); pattern_src_brightness_to_alpha_rgba8 p8(rbuf_img(7)); pattern_src_brightness_to_alpha_rgba8 p9(rbuf_img(8)); agg::pattern_filter_bilinear_rgba8 fltr; // Filtering functor // agg::line_image_pattern is the main container for the patterns. It creates // a copy of the patterns extended according to the needs of the filter. // agg::line_image_pattern can operate with arbitrary image width, but if the // width of the pattern is power of 2, it's better to use the modified // version agg::line_image_pattern_pow2 because it works about 15-25 percent // faster than agg::line_image_pattern (because of using simple masking instead // of expensive '%' operation). typedef agg::line_image_pattern pattern_type; typedef agg::renderer_base base_ren_type; typedef agg::renderer_outline_image renderer_type; typedef agg::rasterizer_outline_aa rasterizer_type; //-- Create with specifying the source //pattern_type patt(fltr, src); //-- Create uninitialized and set the source pattern_type patt(fltr); renderer_type ren_img(ren_base, patt); rasterizer_type ras_img(ren_img); draw_curve(patt, ras_img, ren_img, p1, m_curve1.curve()); draw_curve(patt, ras_img, ren_img, p2, m_curve2.curve()); draw_curve(patt, ras_img, ren_img, p3, m_curve3.curve()); draw_curve(patt, ras_img, ren_img, p4, m_curve4.curve()); draw_curve(patt, ras_img, ren_img, p5, m_curve5.curve()); draw_curve(patt, ras_img, ren_img, p6, m_curve6.curve()); draw_curve(patt, ras_img, ren_img, p7, m_curve7.curve()); draw_curve(patt, ras_img, ren_img, p8, m_curve8.curve()); draw_curve(patt, ras_img, ren_img, p9, m_curve9.curve()); agg::render_ctrl(ras, sl, ren_base, m_curve1); agg::render_ctrl(ras, sl, ren_base, m_curve2); agg::render_ctrl(ras, sl, ren_base, m_curve3); agg::render_ctrl(ras, sl, ren_base, m_curve4); agg::render_ctrl(ras, sl, ren_base, m_curve5); agg::render_ctrl(ras, sl, ren_base, m_curve6); agg::render_ctrl(ras, sl, ren_base, m_curve7); agg::render_ctrl(ras, sl, ren_base, m_curve8); agg::render_ctrl(ras, sl, ren_base, m_curve9); agg::render_ctrl(ras, sl, ren_base, m_scale_x); agg::render_ctrl(ras, sl, ren_base, m_start_x); } virtual void on_key(int x, int y, unsigned key, unsigned flags) { if(key == ' ') { FILE* fd = fopen(full_file_name("coord"), "w"); fprintf(fd, "%.0f, %.0f, %.0f, %.0f, %.0f, %.0f, %.0f, %.0f", m_curve1.x1(), m_curve1.y1(), m_curve1.x2(), m_curve1.y2(), m_curve1.x3(), m_curve1.y3(), m_curve1.x4(), m_curve1.y4()); fclose(fd); } } virtual void on_ctrl_change() { } }; int agg_main(int argc, char* argv[]) { the_application app(agg::pix_format_bgr24, flip_y); app.caption("AGG Example. Drawing Lines with Image Patterns"); if(!app.load_img(0, "1") || !app.load_img(1, "2") || !app.load_img(2, "3") || !app.load_img(3, "4") || !app.load_img(4, "5") || !app.load_img(5, "6") || !app.load_img(6, "7") || !app.load_img(7, "8") || !app.load_img(8, "9")) { char buf[256]; sprintf(buf, "There must be files 1%s...9%s\n" "Download and unzip:\n" "http://www.antigrain.com/line_patterns.bmp.zip\n" "or\n" "http://www.antigrain.com/line_patterns.ppm.tar.gz\n", app.img_ext(), app.img_ext()); app.message(buf); return 1; } if(app.init(500, 450, agg::window_resize)) { return app.run(); } return 1; } agg-2.5+dfsg1/examples/line_patterns_clip.cpp0000644000000000000000000003334410703246330021465 0ustar00usergroup00000000000000#include #include #include #include "agg_math.h" #include "agg_rendering_buffer.h" #include "agg_conv_transform.h" #include "agg_conv_stroke.h" #include "agg_conv_clip_polyline.h" #include "agg_scanline_p.h" #include "agg_renderer_scanline.h" #include "agg_rasterizer_outline_aa.h" #include "agg_rasterizer_scanline_aa.h" #include "agg_pattern_filters_rgba.h" #include "agg_renderer_outline_aa.h" #include "agg_renderer_outline_image.h" #include "agg_path_storage.h" #include "agg_pixfmt_rgb.h" #include "ctrl/agg_slider_ctrl.h" #include "ctrl/agg_bezier_ctrl.h" #include "platform/agg_platform_support.h" enum flip_y_e { flip_y = true }; typedef agg::pixfmt_bgr24 pixfmt; static agg::int8u brightness_to_alpha[256 * 3] = { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 254, 254, 254, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 251, 251, 251, 251, 251, 251, 251, 251, 251, 250, 250, 250, 250, 250, 250, 250, 250, 249, 249, 249, 249, 249, 249, 249, 248, 248, 248, 248, 248, 248, 248, 247, 247, 247, 247, 247, 246, 246, 246, 246, 246, 246, 245, 245, 245, 245, 245, 244, 244, 244, 244, 243, 243, 243, 243, 243, 242, 242, 242, 242, 241, 241, 241, 241, 240, 240, 240, 239, 239, 239, 239, 238, 238, 238, 238, 237, 237, 237, 236, 236, 236, 235, 235, 235, 234, 234, 234, 233, 233, 233, 232, 232, 232, 231, 231, 230, 230, 230, 229, 229, 229, 228, 228, 227, 227, 227, 226, 226, 225, 225, 224, 224, 224, 223, 223, 222, 222, 221, 221, 220, 220, 219, 219, 219, 218, 218, 217, 217, 216, 216, 215, 214, 214, 213, 213, 212, 212, 211, 211, 210, 210, 209, 209, 208, 207, 207, 206, 206, 205, 204, 204, 203, 203, 202, 201, 201, 200, 200, 199, 198, 198, 197, 196, 196, 195, 194, 194, 193, 192, 192, 191, 190, 190, 189, 188, 188, 187, 186, 186, 185, 184, 183, 183, 182, 181, 180, 180, 179, 178, 177, 177, 176, 175, 174, 174, 173, 172, 171, 171, 170, 169, 168, 167, 166, 166, 165, 164, 163, 162, 162, 161, 160, 159, 158, 157, 156, 156, 155, 154, 153, 152, 151, 150, 149, 148, 148, 147, 146, 145, 144, 143, 142, 141, 140, 139, 138, 137, 136, 135, 134, 133, 132, 131, 130, 129, 128, 128, 127, 125, 124, 123, 122, 121, 120, 119, 118, 117, 116, 115, 114, 113, 112, 111, 110, 109, 108, 107, 106, 105, 104, 102, 101, 100, 99, 98, 97, 96, 95, 94, 93, 91, 90, 89, 88, 87, 86, 85, 84, 82, 81, 80, 79, 78, 77, 75, 74, 73, 72, 71, 70, 69, 67, 66, 65, 64, 63, 61, 60, 59, 58, 57, 56, 54, 53, 52, 51, 50, 48, 47, 46, 45, 44, 42, 41, 40, 39, 37, 36, 35, 34, 33, 31, 30, 29, 28, 27, 25, 24, 23, 22, 20, 19, 18, 17, 15, 14, 13, 12, 11, 9, 8, 7, 6, 4, 3, 2, 1 }; class pattern_src_brightness_to_alpha_rgba8 { public: pattern_src_brightness_to_alpha_rgba8(agg::rendering_buffer& rb) : m_rb(&rb), m_pf(*m_rb) {} unsigned width() const { return m_pf.width(); } unsigned height() const { return m_pf.height(); } agg::rgba8 pixel(int x, int y) const { agg::rgba8 c = m_pf.pixel(x, y); c.a = brightness_to_alpha[c.r + c.g + c.b]; return c; } private: agg::rendering_buffer* m_rb; pixfmt m_pf; }; class the_application : public agg::platform_support { agg::rgba8 m_ctrl_color; agg::polygon_ctrl m_line1; agg::slider_ctrl m_scale_x; agg::slider_ctrl m_start_x; agg::trans_affine m_scale; public: typedef agg::renderer_base renderer_base; typedef agg::renderer_scanline_aa_solid renderer_scanline; typedef agg::rasterizer_scanline_aa rasterizer_scanline; typedef agg::scanline_p8 scanline; the_application(agg::pix_format_e format, bool flip_y) : agg::platform_support(format, flip_y), m_ctrl_color(agg::rgba(0, 0.3, 0.5, 0.3)), m_line1(5), m_scale_x(5.0, 5.0, 240.0, 12.0, !flip_y), m_start_x(250.0, 5.0, 495.0, 12.0, !flip_y) { m_line1.line_color(m_ctrl_color); m_line1.xn(0) = 20; m_line1.yn(0) = 20; m_line1.xn(1) = 500-20; m_line1.yn(1) = 500-20; m_line1.xn(2) = 500-60; m_line1.yn(2) = 20; m_line1.xn(3) = 40; m_line1.yn(3) = 500-40; m_line1.xn(4) = 100; m_line1.yn(4) = 300; m_line1.close(false); add_ctrl(m_line1); m_line1.transform(m_scale); m_scale_x.label("Scale X=%.2f"); m_scale_x.range(0.2, 3.0); m_scale_x.value(1.0); add_ctrl(m_scale_x); m_scale_x.no_transform(); m_start_x.label("Start X=%.2f"); m_start_x.range(0.0, 10.0); m_start_x.value(0.0); add_ctrl(m_start_x); m_start_x.no_transform(); } template void draw_polyline(Rasterizer& ras, Renderer& ren, const double* polyline, int num_points) { agg::poly_plain_adaptor vs(polyline, num_points, m_line1.close()); agg::conv_transform > trans(vs, m_scale); ras.add_path(trans); } virtual void on_draw() { pixfmt pf(rbuf_window()); renderer_base ren_base(pf); ren_base.clear(agg::rgba(0.5, 0.75, 0.85)); renderer_scanline ren(ren_base); rasterizer_scanline ras; scanline sl; ras.clip_box(0, 0, width(), height()); // Pattern source. Must have an interface: // width() const // height() const // pixel(int x, int y) const // Any agg::renderer_base<> or derived // is good for the use as a source. //----------------------------------- pattern_src_brightness_to_alpha_rgba8 p1(rbuf_img(0)); agg::pattern_filter_bilinear_rgba8 fltr; // Filtering functor // agg::line_image_pattern is the main container for the patterns. It creates // a copy of the patterns extended according to the needs of the filter. // agg::line_image_pattern can operate with arbitrary image width, but if the // width of the pattern is power of 2, it's better to use the modified // version agg::line_image_pattern_pow2 because it works about 15-25 percent // faster than agg::line_image_pattern (because of using simple masking instead // of expensive '%' operation). typedef agg::line_image_pattern pattern_type; typedef agg::renderer_base base_ren_type; typedef agg::renderer_outline_image renderer_img_type; typedef agg::rasterizer_outline_aa rasterizer_img_type; typedef agg::renderer_outline_aa renderer_line_type; typedef agg::rasterizer_outline_aa rasterizer_line_type; //-- Create with specifying the source //pattern_type patt(fltr, src); //-- Create uninitialized and set the source pattern_type patt(fltr); patt.create(p1); renderer_img_type ren_img(ren_base, patt); rasterizer_img_type ras_img(ren_img); //-- create uninitialized and set parameters agg::line_profile_aa profile; profile.smoother_width(10.0); //optional profile.width(8.0); //mandatory! renderer_line_type ren_line(ren_base, profile); ren_line.color(agg::rgba8(0,0,127)); //mandatory! rasterizer_line_type ras_line(ren_line); ras_line.round_cap(true); //optional //ras_line.line_join(agg::outline_no_join); //optional // Calculate the dilation value so that, the line caps were // drawn correctly. //--------------- double w2 = 9.0;//p1.height() / 2 + 2; // Set the clip box a bit bigger than you expect. You need it // to draw the clipped line caps correctly. The correct result // is achieved with raster clipping. //------------------------ ren_img.scale_x(m_scale_x.value()); ren_img.start_x(m_start_x.value()); ren_img.clip_box (50-w2, 50-w2, width()-50+w2, height()-50+w2); ren_line.clip_box(50-w2, 50-w2, width()-50+w2, height()-50+w2); // First, draw polyline without raster clipping just to show the idea //------------------------ draw_polyline(ras_line, ren_line, m_line1.polygon(), m_line1.num_points()); draw_polyline(ras_img, ren_img, m_line1.polygon(), m_line1.num_points()); // Clear the area, almost opaque, but not completely //------------------------ ren_base.blend_bar(0, 0, (int)width(), (int)height(), agg::rgba(1,1,1), 200); // Set the raster clip box and then, draw again. // In reality there shouldn't be two calls above. // It's done only for demonstration //------------------------ ren_base.clip_box((int)50, (int)50, (int)width()-50, (int)height()-50); // This "copy_bar" is also for demonstration only //------------------------ ren_base.copy_bar(0, 0, (int)width(), (int)height(), agg::rgba(1,1,1)); // Finally draw polyline correctly clipped: We use double clipping, // first is vector clipping, with extended clip box, second is raster // clipping with normal clip box. //------------------------ ren_img.scale_x(m_scale_x.value()); ren_img.start_x(m_start_x.value()); draw_polyline(ras_line, ren_line, m_line1.polygon(), m_line1.num_points()); draw_polyline(ras_img, ren_img, m_line1.polygon(), m_line1.num_points()); // Reset clipping and draw the controls and stuff ren_base.reset_clipping(true); m_line1.line_width(1/m_scale.scale()); m_line1.point_radius(5/m_scale.scale()); agg::render_ctrl(ras, sl, ren_base, m_line1); agg::render_ctrl(ras, sl, ren_base, m_scale_x); agg::render_ctrl(ras, sl, ren_base, m_start_x); char buf[256]; agg::gsv_text t; t.size(10.0); agg::conv_stroke pt(t); pt.width(1.5); pt.line_cap(agg::round_cap); const double* p = m_line1.polygon(); sprintf(buf, "Len=%.2f", agg::calc_distance(p[0], p[1], p[2], p[3]) * m_scale.scale()); t.start_point(10.0, 30.0); t.text(buf); ras.add_path(pt); ren.color(agg::rgba(0,0,0)); agg::render_scanlines(ras, sl, ren); } virtual void on_key(int x, int y, unsigned key, unsigned flags) { if(key == '+' || key == agg::key_kp_plus) { m_scale *= agg::trans_affine_translation(-x, -y); m_scale *= agg::trans_affine_scaling(1.1); m_scale *= agg::trans_affine_translation(x, y); force_redraw(); } if(key == '-' || key == agg::key_kp_minus) { m_scale *= agg::trans_affine_translation(-x, -y); m_scale *= agg::trans_affine_scaling(1/1.1); m_scale *= agg::trans_affine_translation(x, y); force_redraw(); } } virtual void on_ctrl_change() { } }; int agg_main(int argc, char* argv[]) { the_application app(agg::pix_format_bgr24, flip_y); app.caption("AGG Example. Clipping Lines with Image Patterns"); if(!app.load_img(0, "1")) { char buf[256]; sprintf(buf, "There must be file 1%s\n", app.img_ext(), app.img_ext()); app.message(buf); return 1; } if(app.init(500, 500, agg::window_resize)) { return app.run(); } return 1; } agg-2.5+dfsg1/examples/lion.cpp0000644000000000000000000001047210703246330016545 0ustar00usergroup00000000000000#include #include #include #include "agg_basics.h" #include "agg_rendering_buffer.h" #include "agg_rasterizer_scanline_aa.h" #include "agg_scanline_p.h" #include "agg_renderer_scanline.h" #include "agg_path_storage.h" #include "agg_conv_transform.h" #include "agg_bounding_rect.h" #include "ctrl/agg_slider_ctrl.h" #include "platform/agg_platform_support.h" //#define AGG_GRAY16 //#define AGG_BGR24 //#define AGG_BGR48 //#define AGG_RGB_AAA #define AGG_BGRA32 //#define AGG_RGBA32 //#define AGG_ARGB32 //#define AGG_ABGR32 //#define AGG_RGB565 //#define AGG_RGB555 #include "pixel_formats.h" enum flip_y_e { flip_y = true }; agg::rasterizer_scanline_aa<> g_rasterizer; agg::scanline_p8 g_scanline; agg::path_storage g_path; agg::rgba8 g_colors[100]; unsigned g_path_idx[100]; unsigned g_npaths = 0; double g_x1 = 0; double g_y1 = 0; double g_x2 = 0; double g_y2 = 0; double g_base_dx = 0; double g_base_dy = 0; double g_angle = 0; double g_scale = 1.0; double g_skew_x = 0; double g_skew_y = 0; int g_nclick = 0; unsigned parse_lion(agg::path_storage& ps, agg::rgba8* colors, unsigned* path_idx); void parse_lion() { g_npaths = parse_lion(g_path, g_colors, g_path_idx); agg::pod_array_adaptor path_idx(g_path_idx, 100); agg::bounding_rect(g_path, path_idx, 0, g_npaths, &g_x1, &g_y1, &g_x2, &g_y2); g_base_dx = (g_x2 - g_x1) / 2.0; g_base_dy = (g_y2 - g_y1) / 2.0; } class the_application : public agg::platform_support { agg::slider_ctrl m_alpha_slider; public: typedef agg::renderer_base renderer_base; typedef agg::renderer_scanline_aa_solid renderer_solid; the_application(agg::pix_format_e format, bool flip_y) : agg::platform_support(format, flip_y), m_alpha_slider(5, 5, 512-5, 12, !flip_y) { parse_lion(); add_ctrl(m_alpha_slider); m_alpha_slider.no_transform(); m_alpha_slider.label("Alpha%3.3f"); m_alpha_slider.value(0.1); } virtual void on_resize(int cx, int cy) { pixfmt pf(rbuf_window()); renderer_base r(pf); r.clear(agg::rgba(1, 1, 1)); } virtual void on_draw() { int width = rbuf_window().width(); int height = rbuf_window().height(); unsigned i; for(i = 0; i < g_npaths; i++) { g_colors[i].a = agg::int8u(m_alpha_slider.value() * 255); } pixfmt pixf(rbuf_window()); renderer_base rb(pixf); renderer_solid r(rb); agg::trans_affine mtx; mtx *= agg::trans_affine_translation(-g_base_dx, -g_base_dy); mtx *= agg::trans_affine_scaling(g_scale, g_scale); mtx *= agg::trans_affine_rotation(g_angle + agg::pi); mtx *= agg::trans_affine_skewing(g_skew_x/1000.0, g_skew_y/1000.0); mtx *= agg::trans_affine_translation(width/2, height/2); // This code renders the lion: agg::conv_transform trans(g_path, mtx); agg::render_all_paths(g_rasterizer, g_scanline, r, trans, g_colors, g_path_idx, g_npaths); // Render the control agg::render_ctrl(g_rasterizer, g_scanline, rb, m_alpha_slider); } void transform(double width, double height, double x, double y) { x -= width / 2; y -= height / 2; g_angle = atan2(y, x); g_scale = sqrt(y * y + x * x) / 100.0; } virtual void on_mouse_button_down(int x, int y, unsigned flags) { if(flags & agg::mouse_left) { int width = rbuf_window().width(); int height = rbuf_window().height(); transform(width, height, x, y); force_redraw(); } if(flags & agg::mouse_right) { g_skew_x = x; g_skew_y = y; force_redraw(); } } virtual void on_mouse_move(int x, int y, unsigned flags) { on_mouse_button_down(x, y, flags); } }; int agg_main(int argc, char* argv[]) { the_application app(pix_format, flip_y); app.caption("AGG Example. Lion"); if(app.init(512, 400, agg::window_resize)) { return app.run(); } return 1; } agg-2.5+dfsg1/examples/lion_lens.cpp0000644000000000000000000001226510703246330017570 0ustar00usergroup00000000000000#include #include #include #include "agg_basics.h" #include "agg_rendering_buffer.h" #include "agg_rasterizer_scanline_aa.h" #include "agg_scanline_p.h" #include "agg_renderer_scanline.h" #include "agg_path_storage.h" #include "agg_conv_transform.h" #include "agg_trans_warp_magnifier.h" #include "agg_conv_segmentator.h" #include "agg_bounding_rect.h" #include "ctrl/agg_slider_ctrl.h" #include "ctrl/agg_cbox_ctrl.h" #include "platform/agg_platform_support.h" #define AGG_BGR24 //#define AGG_RGB24 //#define AGG_BGRA32 //#define AGG_RGBA32 //#define AGG_ARGB32 //#define AGG_ABGR32 //#define AGG_RGB565 //#define AGG_RGB555 //#define AGG_RGB_AAA #include "pixel_formats.h" enum flip_y_e { flip_y = true }; agg::rasterizer_scanline_aa<> g_rasterizer; agg::scanline_p8 g_scanline; agg::path_storage g_path; agg::rgba8 g_colors[100]; unsigned g_path_idx[100]; unsigned g_npaths = 0; double g_x1 = 0; double g_y1 = 0; double g_x2 = 0; double g_y2 = 0; double g_base_dx = 0; double g_base_dy = 0; double g_angle = 0; double g_scale = 1.0; double g_skew_x = 0; double g_skew_y = 0; int g_nclick = 0; unsigned parse_lion(agg::path_storage& ps, agg::rgba8* colors, unsigned* path_idx); void parse_lion() { g_npaths = parse_lion(g_path, g_colors, g_path_idx); agg::pod_array_adaptor path_idx(g_path_idx, 100); agg::bounding_rect(g_path, path_idx, 0, g_npaths, &g_x1, &g_y1, &g_x2, &g_y2); g_base_dx = (g_x2 - g_x1) / 2.0; g_base_dy = (g_y2 - g_y1) / 2.0; } class the_application : public agg::platform_support { agg::slider_ctrl m_magn_slider; agg::slider_ctrl m_radius_slider; public: typedef agg::renderer_base renderer_base; typedef agg::renderer_scanline_aa_solid renderer_solid; the_application(agg::pix_format_e format, bool flip_y) : agg::platform_support(format, flip_y), m_magn_slider (5, 5, 495, 12, !flip_y), m_radius_slider(5, 20, 495, 27, !flip_y) { parse_lion(); add_ctrl(m_magn_slider); m_magn_slider.no_transform(); m_magn_slider.range(0.01, 4.0); m_magn_slider.value(3.0); m_magn_slider.label("Scale=%3.2f"); add_ctrl(m_radius_slider); m_radius_slider.no_transform(); m_radius_slider.range(0.0, 100.0); m_radius_slider.value(70.0); m_radius_slider.label("Radius=%3.2f"); } virtual void on_init() { g_x1 = 200; g_y1 = 150; } virtual void on_resize(int cx, int cy) { } virtual void on_draw() { pixfmt pixf(rbuf_window()); renderer_base rb(pixf); renderer_solid r(rb); rb.clear(agg::rgba(1, 1, 1)); agg::trans_warp_magnifier lens; lens.center(g_x1, g_y1); lens.magnification(m_magn_slider.value()); lens.radius(m_radius_slider.value() / m_magn_slider.value()); agg::conv_segmentator segm(g_path); agg::trans_affine mtx; mtx *= agg::trans_affine_translation(-g_base_dx, -g_base_dy); mtx *= agg::trans_affine_rotation(g_angle + agg::pi); mtx *= agg::trans_affine_translation(width()/2, height()/2); agg::conv_transform< agg::conv_segmentator< agg::path_storage> > trans_mtx(segm, mtx); agg::conv_transform< agg::conv_transform< agg::conv_segmentator< agg::path_storage> >, agg::trans_warp_magnifier> trans_lens(trans_mtx, lens); agg::render_all_paths(g_rasterizer, g_scanline, r, trans_lens, g_colors, g_path_idx, g_npaths); agg::render_ctrl(g_rasterizer, g_scanline, rb, m_magn_slider); agg::render_ctrl(g_rasterizer, g_scanline, rb, m_radius_slider); // Testing inverse_transform() //-------------------- //double x, y; //for(y = 0; y < height(); y += 10) //{ // for(x = 0; x < height(); x += 10) // { // double x2 = x+0.5; // double y2 = y+0.5; // lens.transform(&x2, &y2); // lens.inverse_transform(&x2, &y2); // agg::ellipse e(x2, y2, 1, 1); // g_rasterizer.add_path(e); // r.color(agg::rgba8(0,0,0)); // agg::render_scanlines(g_rasterizer, g_scanline, r); // } //} } virtual void on_mouse_button_down(int x, int y, unsigned flags) { if(flags & agg::mouse_left) { g_x1 = x; g_y1 = y; force_redraw(); } if(flags & agg::mouse_right) { g_x2 = x; g_y2 = y; force_redraw(); } } virtual void on_mouse_move(int x, int y, unsigned flags) { on_mouse_button_down(x, y, flags); } }; int agg_main(int argc, char* argv[]) { the_application app(pix_format, flip_y); app.caption("AGG Example. Lion"); if(app.init(500, 600, agg::window_resize)) { return app.run(); } return 1; } agg-2.5+dfsg1/examples/lion_outline.cpp0000644000000000000000000001211210703246330020275 0ustar00usergroup00000000000000#include #include #include #include "agg_basics.h" #include "agg_rendering_buffer.h" #include "agg_rasterizer_scanline_aa.h" #include "agg_renderer_outline_aa.h" #include "agg_rasterizer_outline_aa.h" #include "agg_scanline_p.h" #include "agg_renderer_scanline.h" #include "agg_path_storage.h" #include "agg_conv_transform.h" #include "agg_bounding_rect.h" #include "ctrl/agg_slider_ctrl.h" #include "ctrl/agg_cbox_ctrl.h" #include "platform/agg_platform_support.h" #define AGG_BGR24 //#define AGG_RGB24 //#define AGG_BGRA32 //#define AGG_RGBA32 //#define AGG_ARGB32 //#define AGG_ABGR32 //#define AGG_RGB565 //#define AGG_RGB555 #include "pixel_formats.h" enum flip_y_e { flip_y = true }; agg::rasterizer_scanline_aa<> g_rasterizer; agg::scanline_p8 g_scanline; agg::path_storage g_path; agg::rgba8 g_colors[100]; unsigned g_path_idx[100]; unsigned g_npaths = 0; double g_x1 = 0; double g_y1 = 0; double g_x2 = 0; double g_y2 = 0; double g_base_dx = 0; double g_base_dy = 0; double g_angle = 0; double g_scale = 1.0; double g_skew_x = 0; double g_skew_y = 0; int g_nclick = 0; unsigned parse_lion(agg::path_storage& ps, agg::rgba8* colors, unsigned* path_idx); void parse_lion() { g_npaths = parse_lion(g_path, g_colors, g_path_idx); agg::pod_array_adaptor path_idx(g_path_idx, 100); agg::bounding_rect(g_path, path_idx, 0, g_npaths, &g_x1, &g_y1, &g_x2, &g_y2); g_base_dx = (g_x2 - g_x1) / 2.0; g_base_dy = (g_y2 - g_y1) / 2.0; } class the_application : public agg::platform_support { agg::slider_ctrl m_width_slider; agg::cbox_ctrl m_scanline; public: the_application(agg::pix_format_e format, bool flip_y) : agg::platform_support(format, flip_y), m_width_slider(5, 5, 150, 12, !flip_y), m_scanline(160, 5, "Use Scanline Rasterizer", !flip_y) { parse_lion(); add_ctrl(m_width_slider); m_width_slider.no_transform(); m_width_slider.range(0.0, 4.0); m_width_slider.value(1.0); m_width_slider.label("Width %3.2f"); add_ctrl(m_scanline); m_scanline.no_transform(); } virtual void on_draw() { int width = rbuf_window().width(); int height = rbuf_window().height(); typedef agg::renderer_base renderer_base; typedef agg::renderer_scanline_aa_solid renderer_solid; pixfmt pixf(rbuf_window()); renderer_base rb(pixf); renderer_solid r(rb); rb.clear(agg::rgba(1,1,1)); agg::trans_affine mtx; mtx *= agg::trans_affine_translation(-g_base_dx, -g_base_dy); mtx *= agg::trans_affine_scaling(g_scale, g_scale); mtx *= agg::trans_affine_rotation(g_angle + agg::pi); mtx *= agg::trans_affine_skewing(g_skew_x/1000.0, g_skew_y/1000.0); mtx *= agg::trans_affine_translation(width/2, height/2); if(m_scanline.status()) { agg::conv_stroke stroke(g_path); stroke.width(m_width_slider.value()); stroke.line_join(agg::round_join); agg::conv_transform > trans(stroke, mtx); agg::render_all_paths(g_rasterizer, g_scanline, r, trans, g_colors, g_path_idx, g_npaths); } else { typedef agg::renderer_outline_aa renderer_type; typedef agg::rasterizer_outline_aa rasterizer_type; double w = m_width_slider.value() * mtx.scale(); agg::line_profile_aa profile(w, agg::gamma_none()); renderer_type ren(rb, profile); rasterizer_type ras(ren); agg::conv_transform trans(g_path, mtx); ras.render_all_paths(trans, g_colors, g_path_idx, g_npaths); } agg::render_ctrl(g_rasterizer, g_scanline, rb, m_width_slider); agg::render_ctrl(g_rasterizer, g_scanline, rb, m_scanline); } void transform(double width, double height, double x, double y) { x -= width / 2; y -= height / 2; g_angle = atan2(y, x); g_scale = sqrt(y * y + x * x) / 100.0; } virtual void on_mouse_button_down(int x, int y, unsigned flags) { if(flags & agg::mouse_left) { int width = rbuf_window().width(); int height = rbuf_window().height(); transform(width, height, x, y); force_redraw(); } if(flags & agg::mouse_right) { g_skew_x = x; g_skew_y = y; force_redraw(); } } virtual void on_mouse_move(int x, int y, unsigned flags) { on_mouse_button_down(x, y, flags); } }; int agg_main(int argc, char* argv[]) { the_application app(pix_format, flip_y); app.caption("AGG Example. Lion"); if(app.init(512, 512, agg::window_resize)) { return app.run(); } return 1; } agg-2.5+dfsg1/examples/macosx_carbon/0000755000000000000000000000000010703246330017712 5ustar00usergroup00000000000000agg-2.5+dfsg1/examples/macosx_carbon/Makefile0000644000000000000000000003372710703246330021366 0ustar00usergroup00000000000000AGGLIBS= -lagg -framework Carbon -framework QuickTime AGGCXXFLAGS = -bind_at_load -O3 -I/Developer/Headers/FlatCarbon CXX = g++ C = gcc #CXX = icc LIB = ar cr -s PLATFORM=mac PLATFORMSOURCES=../../src/platform/$(PLATFORM)/agg_platform_support.o ../../src/platform/$(PLATFORM)/agg_mac_pmap.o CXXFLAGS= $(AGGCXXFLAGS) -I../../include \ -L../../src \ $(PIXFMT) LIBS = $(AGGLIBS) -lm all: cd ../../src/; make make aa_demo make aa_test make alpha_gradient make alpha_mask make alpha_mask2 make alpha_mask3 make bezier_div make blur make blend_color make bspline make circles make component_rendering make conv_contour make conv_dash_marker make conv_stroke make gamma_correction make gamma_ctrl make gouraud make gradient_focal make gradients make graph_test make idea make lion make lion_lens make lion_outline make multi_clip make pattern_fill make perspective make polymorphic_renderer make raster_text make rasterizers make rasterizers2 make rasterizer_compound make rounded_rect make scanline_boolean make scanline_boolean2 make simple_blur make trans_polar make image_alpha make image_filters make image_filters2 make image_fltr_graph make image_perspective make image_resample make image_transforms make image1 make distortions make pattern_perspective make compositing make line_patterns make mol_view aa_demo: ../aa_demo.o $(PLATFORMSOURCES) aa_demo.app $(CXX) $(CXXFLAGS) ../aa_demo.o $(PLATFORMSOURCES) -o aa_demo.app/Contents/MacOS/aa_demo $(LIBS) aa_test: ../aa_test.o $(PLATFORMSOURCES) aa_test.app $(CXX) $(CXXFLAGS) ../aa_test.o $(PLATFORMSOURCES) -o aa_test.app/Contents/MacOS/aa_test $(LIBS) alpha_gradient: ../alpha_gradient.o $(PLATFORMSOURCES) alpha_gradient.app $(CXX) $(CXXFLAGS) ../alpha_gradient.o $(PLATFORMSOURCES) -o alpha_gradient.app/Contents/MacOS/alpha_gradient $(LIBS) alpha_mask: ../alpha_mask.o ../parse_lion.o $(PLATFORMSOURCES) alpha_mask.app $(CXX) $(CXXFLAGS) ../alpha_mask.o ../parse_lion.o $(PLATFORMSOURCES) -o alpha_mask.app/Contents/MacOS/alpha_mask $(LIBS) alpha_mask2: ../alpha_mask2.o ../parse_lion.o $(PLATFORMSOURCES) alpha_mask2.app $(CXX) $(CXXFLAGS) ../alpha_mask2.o ../parse_lion.o $(PLATFORMSOURCES) -o alpha_mask2.app/Contents/MacOS/alpha_mask2 $(LIBS) alpha_mask3: ../alpha_mask3.o ../make_arrows.o ../make_gb_poly.o $(PLATFORMSOURCES) alpha_mask3.app $(CXX) $(CXXFLAGS) ../alpha_mask3.o ../make_arrows.o ../make_gb_poly.o $(PLATFORMSOURCES) -o alpha_mask3.app/Contents/MacOS/alpha_mask3 $(LIBS) bezier_div: ../bezier_div.o ../interactive_polygon.o $(PLATFORMSOURCES) bezier_div.app $(CXX) $(CXXFLAGS) ../bezier_div.o ../interactive_polygon.o $(PLATFORMSOURCES) -o bezier_div.app/Contents/MacOS/bezier_div $(LIBS) blur: ../blur.o $(PLATFORMSOURCES) blur.app $(CXX) $(CXXFLAGS) ../blur.o $(PLATFORMSOURCES) -o blur.app/Contents/MacOS/blur $(LIBS) blend_color: ../blend_color.o $(PLATFORMSOURCES) blend_color.app $(CXX) $(CXXFLAGS) ../blend_color.o $(PLATFORMSOURCES) -o blend_color.app/Contents/MacOS/blend_color $(LIBS) bspline: ../bspline.o ../interactive_polygon.o $(PLATFORMSOURCES) bspline.app $(CXX) $(CXXFLAGS) ../bspline.o ../interactive_polygon.o $(PLATFORMSOURCES) -o bspline.app/Contents/MacOS/bspline $(LIBS) circles: ../circles.o $(PLATFORMSOURCES) circles.app $(CXX) $(CXXFLAGS) ../circles.o $(PLATFORMSOURCES) -o circles.app/Contents/MacOS/circles $(LIBS) component_rendering: ../component_rendering.o $(PLATFORMSOURCES) component_rendering.app $(CXX) $(CXXFLAGS) ../component_rendering.o $(PLATFORMSOURCES) -o component_rendering.app/Contents/MacOS/component_rendering $(LIBS) compositing: ../compositing.o $(PLATFORMSOURCES) compositing.bmp compositing.app cp compositing.bmp compositing.app/Contents/MacOS/compositing.bmp $(CXX) $(CXXFLAGS) ../compositing.o $(PLATFORMSOURCES) -o compositing.app/Contents/MacOS/compositing $(LIBS) conv_contour: ../conv_contour.o $(PLATFORMSOURCES) conv_contour.app $(CXX) $(CXXFLAGS) ../conv_contour.o $(PLATFORMSOURCES) -o conv_contour.app/Contents/MacOS/conv_contour $(LIBS) conv_dash_marker: ../conv_dash_marker.o $(PLATFORMSOURCES) conv_dash_marker.app $(CXX) $(CXXFLAGS) ../conv_dash_marker.o $(PLATFORMSOURCES) -o conv_dash_marker.app/Contents/MacOS/conv_dash_marker $(LIBS) conv_stroke: ../conv_stroke.o $(PLATFORMSOURCES) conv_stroke.app $(CXX) $(CXXFLAGS) ../conv_stroke.o $(PLATFORMSOURCES) -o conv_stroke.app/Contents/MacOS/conv_stroke $(LIBS) distortions: ../distortions.o $(PLATFORMSOURCES) spheres.bmp distortions.app cp spheres.bmp distortions.app/Contents/MacOS/spheres.bmp $(CXX) $(CXXFLAGS) ../distortions.o $(PLATFORMSOURCES) -o distortions.app/Contents/MacOS/distortions $(LIBS) gamma_correction: ../gamma_correction.o $(PLATFORMSOURCES) gamma_correction.app $(CXX) $(CXXFLAGS) ../gamma_correction.o $(PLATFORMSOURCES) -o gamma_correction.app/Contents/MacOS/gamma_correction $(LIBS) gamma_ctrl: ../gamma_ctrl.o $(PLATFORMSOURCES) gamma_ctrl.app $(CXX) $(CXXFLAGS) ../gamma_ctrl.o $(PLATFORMSOURCES) -o gamma_ctrl.app/Contents/MacOS/gamma_ctrl $(LIBS) gouraud: ../gouraud.o $(PLATFORMSOURCES) gouraud.app $(CXX) $(CXXFLAGS) ../gouraud.o $(PLATFORMSOURCES) -o gouraud.app/Contents/MacOS/gouraud $(LIBS) gradient_focal: ../gradient_focal.o $(PLATFORMSOURCES) gradient_focal.app $(CXX) $(CXXFLAGS) ../gradient_focal.o $(PLATFORMSOURCES) -o gradient_focal.app/Contents/MacOS/gradient_focal $(LIBS) gradients: ../gradients.o $(PLATFORMSOURCES) gradients.app $(CXX) $(CXXFLAGS) ../gradients.o $(PLATFORMSOURCES) -o gradients.app/Contents/MacOS/gradients $(LIBS) graph_test: ../graph_test.o $(PLATFORMSOURCES) graph_test.app $(CXX) $(CXXFLAGS) ../graph_test.o $(PLATFORMSOURCES) -o graph_test.app/Contents/MacOS/graph_test $(LIBS) idea: ../idea.o $(PLATFORMSOURCES) idea.app $(CXX) $(CXXFLAGS) ../idea.o $(PLATFORMSOURCES) -o idea.app/Contents/MacOS/idea $(LIBS) image_alpha: ../image_alpha.o $(PLATFORMSOURCES) spheres.bmp image_alpha.app cp spheres.bmp image_alpha.app/Contents/MacOS/spheres.bmp $(CXX) $(CXXFLAGS) ../image_alpha.o $(PLATFORMSOURCES) -o image_alpha.app/Contents/MacOS/image_alpha $(LIBS) image_filters: ../image_filters.o $(PLATFORMSOURCES) spheres.bmp image_filters.app cp spheres.bmp image_filters.app/Contents/MacOS/spheres.bmp $(CXX) $(CXXFLAGS) ../image_filters.o $(PLATFORMSOURCES) -o image_filters.app/Contents/MacOS/image_filters $(LIBS) image_filters2: ../image_filters2.o $(PLATFORMSOURCES) spheres.bmp image_filters2.app cp spheres.bmp image_filters2.app/Contents/MacOS/spheres.bmp $(CXX) $(CXXFLAGS) ../image_filters2.o $(PLATFORMSOURCES) -o image_filters2.app/Contents/MacOS/image_filters2 $(LIBS) image_fltr_graph: ../image_fltr_graph.o $(PLATFORMSOURCES) spheres.bmp image_fltr_graph.app cp spheres.bmp image_fltr_graph.app/Contents/MacOS/spheres.bmp $(CXX) $(CXXFLAGS) ../image_fltr_graph.o $(PLATFORMSOURCES) -o image_fltr_graph.app/Contents/MacOS/image_fltr_graph $(LIBS) image_perspective: ../image_perspective.o ../interactive_polygon.o $(PLATFORMSOURCES) spheres.bmp image_perspective.app cp spheres.bmp image_perspective.app/Contents/MacOS/spheres.bmp $(CXX) $(CXXFLAGS) ../image_perspective.o ../interactive_polygon.o $(PLATFORMSOURCES) -o image_perspective.app/Contents/MacOS/image_perspective $(LIBS) image_resample: ../image_resample.o ../interactive_polygon.o $(PLATFORMSOURCES) spheres.bmp image_resample.app cp spheres.bmp image_resample.app/Contents/MacOS/spheres.bmp $(CXX) $(CXXFLAGS) ../image_resample.o ../interactive_polygon.o $(PLATFORMSOURCES) -o image_resample.app/Contents/MacOS/image_resample $(LIBS) image_transforms: ../image_transforms.o $(PLATFORMSOURCES) spheres.bmp image_transforms.app cp spheres.bmp image_transforms.app/Contents/MacOS/spheres.bmp $(CXX) $(CXXFLAGS) ../image_transforms.o $(PLATFORMSOURCES) -o image_transforms.app/Contents/MacOS/image_transforms $(LIBS) image1: ../image1.o $(PLATFORMSOURCES) spheres.bmp image1.app cp spheres.bmp image1.app/Contents/MacOS/spheres.bmp $(CXX) $(CXXFLAGS) ../image1.o $(PLATFORMSOURCES) -o image1.app/Contents/MacOS/image1 $(LIBS) line_patterns: ../line_patterns.o $(PLATFORMSOURCES) 1.bmp 2.bmp 3.bmp 4.bmp 5.bmp 6.bmp 7.bmp 8.bmp 9.bmp line_patterns.app cp 1.bmp line_patterns.app/Contents/MacOS/1.bmp cp 2.bmp line_patterns.app/Contents/MacOS/2.bmp cp 3.bmp line_patterns.app/Contents/MacOS/3.bmp cp 4.bmp line_patterns.app/Contents/MacOS/4.bmp cp 5.bmp line_patterns.app/Contents/MacOS/5.bmp cp 6.bmp line_patterns.app/Contents/MacOS/6.bmp cp 7.bmp line_patterns.app/Contents/MacOS/7.bmp cp 8.bmp line_patterns.app/Contents/MacOS/8.bmp cp 9.bmp line_patterns.app/Contents/MacOS/9.bmp $(CXX) $(CXXFLAGS) ../line_patterns.o $(PLATFORMSOURCES) -o line_patterns.app/Contents/MacOS/line_patterns $(LIBS) lion: ../lion.o ../parse_lion.o $(PLATFORMSOURCES) lion.app $(CXX) $(CXXFLAGS) ../lion.o ../parse_lion.o $(PLATFORMSOURCES) -o lion.app/Contents/MacOS/lion $(LIBS) lion_lens: ../lion_lens.o ../parse_lion.o $(PLATFORMSOURCES) lion_lens.app $(CXX) $(CXXFLAGS) ../lion_lens.o ../parse_lion.o $(PLATFORMSOURCES) -o lion_lens.app/Contents/MacOS/lion_lens $(LIBS) lion_outline: ../lion_outline.o ../parse_lion.o $(PLATFORMSOURCES) lion_outline.app $(CXX) $(CXXFLAGS) ../lion_outline.o ../parse_lion.o $(PLATFORMSOURCES) -o lion_outline.app/Contents/MacOS/lion_outline $(LIBS) mol_view: ../mol_view.o $(PLATFORMSOURCES) 1.sdf mol_view.app cp 1.sdf mol_view.app/Contents/MacOS/1.sdf $(CXX) $(CXXFLAGS) ../mol_view.o $(PLATFORMSOURCES) -o mol_view.app/Contents/MacOS/mol_view $(LIBS) multi_clip: ../multi_clip.o ../parse_lion.o $(PLATFORMSOURCES) multi_clip.app $(CXX) $(CXXFLAGS) ../multi_clip.o ../parse_lion.o $(PLATFORMSOURCES) -o multi_clip.app/Contents/MacOS/multi_clip $(LIBS) pattern_fill: ../pattern_fill.o $(PLATFORMSOURCES) pattern_fill.app $(CXX) $(CXXFLAGS) ../pattern_fill.o $(PLATFORMSOURCES) -o pattern_fill.app/Contents/MacOS/pattern_fill $(LIBS) pattern_perspective: ../pattern_perspective.o ../interactive_polygon.o $(PLATFORMSOURCES) agg.bmp pattern_perspective.app cp agg.bmp pattern_perspective.app/Contents/MacOS/agg.bmp $(CXX) $(CXXFLAGS) ../pattern_perspective.o ../interactive_polygon.o $(PLATFORMSOURCES) -o pattern_perspective.app/Contents/MacOS/pattern_perspective $(LIBS) perspective: ../perspective.o ../interactive_polygon.o ../parse_lion.o $(PLATFORMSOURCES) perspective.app $(CXX) $(CXXFLAGS) ../perspective.o ../interactive_polygon.o ../parse_lion.o $(PLATFORMSOURCES) -o perspective.app/Contents/MacOS/perspective $(LIBS) polymorphic_renderer: ../polymorphic_renderer.o $(PLATFORMSOURCES) polymorphic_renderer.app $(CXX) $(CXXFLAGS) ../polymorphic_renderer.o $(PLATFORMSOURCES) -o polymorphic_renderer.app/Contents/MacOS/polymorphic_renderer $(LIBS) raster_text: ../raster_text.o $(PLATFORMSOURCES) raster_text.app $(CXX) $(CXXFLAGS) ../raster_text.o $(PLATFORMSOURCES) -o raster_text.app/Contents/MacOS/raster_text $(LIBS) rasterizers: ../rasterizers.o $(PLATFORMSOURCES) rasterizers.app $(CXX) $(CXXFLAGS) ../rasterizers.o $(PLATFORMSOURCES) -o rasterizers.app/Contents/MacOS/rasterizers $(LIBS) rasterizers2: ../rasterizers2.o $(PLATFORMSOURCES) rasterizers2.app $(CXX) $(CXXFLAGS) ../rasterizers2.o $(PLATFORMSOURCES) -o rasterizers2.app/Contents/MacOS/rasterizers2 $(LIBS) rasterizer_compound: ../rasterizer_compound.o $(PLATFORMSOURCES) rasterizer_compound.app $(CXX) $(CXXFLAGS) ../rasterizer_compound.o $(PLATFORMSOURCES) -o rasterizer_compound.app/Contents/MacOS/rasterizer_compound $(LIBS) rounded_rect: ../rounded_rect.o $(PLATFORMSOURCES) rounded_rect.app $(CXX) $(CXXFLAGS) ../rounded_rect.o $(PLATFORMSOURCES) -o rounded_rect.app/Contents/MacOS/rounded_rect $(LIBS) scanline_boolean: ../scanline_boolean.o ../interactive_polygon.o $(PLATFORMSOURCES) scanline_boolean.app $(CXX) $(CXXFLAGS) ../scanline_boolean.o ../interactive_polygon.o $(PLATFORMSOURCES) -o scanline_boolean.app/Contents/MacOS/scanline_boolean $(LIBS) scanline_boolean2: ../scanline_boolean2.o ../make_arrows.o ../make_gb_poly.o $(PLATFORMSOURCES) scanline_boolean2.app $(CXX) $(CXXFLAGS) ../scanline_boolean2.o ../make_arrows.o ../make_gb_poly.o $(PLATFORMSOURCES) -o scanline_boolean2.app/Contents/MacOS/scanline_boolean2 $(LIBS) simple_blur: ../simple_blur.o ../parse_lion.o $(PLATFORMSOURCES) simple_blur.app $(CXX) $(CXXFLAGS) ../simple_blur.o ../parse_lion.o $(PLATFORMSOURCES) -o simple_blur.app/Contents/MacOS/simple_blur $(LIBS) trans_polar: ../trans_polar.o $(PLATFORMSOURCES) trans_polar.app $(CXX) $(CXXFLAGS) ../trans_polar.o $(PLATFORMSOURCES) -o trans_polar.app/Contents/MacOS/trans_polar $(LIBS) clean: rm -rf *.app rm -f ../*.o rm -f ../../src/platform/$(PLATFORM)/agg_platform_support.o rm -f ../../src/platform/$(PLATFORM)/agg_mac_pmap.o agg.bmp: @echo "Required file missing!!" @echo "Please download http://www.antigrain.com/agg.bmp to /examples/macosx_carbon/" @echo "Attempting to retrieve via curl: (will fail if curl is not installed)" curl -O http://www.antigrain.com/agg.bmp compositing.bmp: @echo "Required file missing!!" @echo "Please download http://www.antigrain.com/compositing.bmp to /examples/macosx_carbon/" @echo "Attempting to retrieve via curl: (will fail if curl is not installed)" curl -O http://www.antigrain.com/compositing.bmp spheres.bmp: @echo "Required file missing!!" @echo "Please download http://www.antigrain.com/spheres.bmp to /examples/macosx_carbon/" @echo "Attempting to retrieve file: (will fail if curl is not installed)" curl -O http://www.antigrain.com/spheres.bmp 1.sdf: @echo "Required file missing!!" @echo "Please download http://www.antigrain.com/1.sdf to /examples/macosx_carbon/" @echo "Attempting to retrieve file: (will fail if curl is not installed)" curl -O http://www.antigrain.com/1.sdf 1.bmp: @echo "Required file missing!!" @echo "Please download http://www.antigrain.com/line_patterns.bmp.zip to /examples/macosx_carbon/ and decoompress it" @echo "Attempting to retrieve file: (will fail if curl is not installed)" curl -O http://www.antigrain.com/line_patterns.bmp.zip unzip -o line_patterns.bmp.zip %.app: mkdir $*.app mkdir $*.app/Contents mkdir $*.app/Contents/MacOS %.o: %.cpp @echo \< $*.cpp \> $(CXX) -c $(CXXFLAGS) $*.cpp -o $@ .PHONY : clean agg-2.5+dfsg1/examples/macosx_carbon/readme.txt0000644000000000000000000000131510703246330021710 0ustar00usergroup00000000000000The Anti-Grain Geometry Project A high quality rendering engine for C++ http://antigrain.com Anti-Grain Geometry Copyright (C) 2002-2005 Maxim Shemanarev (McSeem) 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. By default only the examples that do not require extra dependancies are built. with the following commands: cd (AGGDIRECTORY)/examples/macosx_carbon make clean make Alternatively you can also build the examples one by one, using the example name directly: make aa_demo make aa_test ...agg-2.5+dfsg1/examples/macosx_sdl/0000755000000000000000000000000010703246330017230 5ustar00usergroup00000000000000agg-2.5+dfsg1/examples/macosx_sdl/Makefile0000644000000000000000000002731510703246330020700 0ustar00usergroup00000000000000include ../../Makefile.in.$(shell uname).SDL PLATFORM=sdl PLATFORMSOURCES=../../src/platform/$(PLATFORM)/agg_platform_support.o CXXFLAGS= $(AGGCXXFLAGS) -I../../include \ -L../../src \ $(PIXFMT) CXXFREETYPEFLAGS= $(AGGCXXFLAGS) -Wall \ -I../../include \ -I../../font_freetype \ -I/usr/local/include/freetype2 \ -L../../src \ $(PIXFMT) LIBS = $(AGGLIBS) -lm base: cd ../../src/; make make aa_demo make aa_test make alpha_gradient make alpha_mask make alpha_mask2 make alpha_mask3 make bspline make blur make blend_color make bezier_div make circles make component_rendering make conv_contour make conv_dash_marker make conv_stroke make gamma_correction make gamma_ctrl make gouraud make gradient_focal make gradients make graph_test make idea make lion make lion_lens make lion_outline make multi_clip make pattern_fill make perspective make polymorphic_renderer make raster_text make rasterizers make rasterizers2 make rasterizer_compound make rounded_rect make scanline_boolean make scanline_boolean2 make simple_blur make trans_polar make image_alpha make image_filters make image_filters2 make image_fltr_graph make image_perspective make image_resample make image_transforms make image1 make distortions make pattern_perspective make compositing make line_patterns make mol_view freetype: make freetype_test make trans_curve1_ft make trans_curve2_ft gpc: make gpc_test all: make base make freetype make gpc aa_demo: ../aa_demo.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o aa_demo $(LIBS) aa_test: ../aa_test.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o aa_test $(LIBS) alpha_gradient: ../alpha_gradient.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o alpha_gradient $(LIBS) alpha_mask: ../alpha_mask.o ../parse_lion.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o alpha_mask $(LIBS) alpha_mask2: ../alpha_mask2.o ../parse_lion.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o alpha_mask2 $(LIBS) alpha_mask3: ../alpha_mask3.o ../make_arrows.o ../make_gb_poly.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o alpha_mask3 $(LIBS) bezier_div: ../bezier_div.o ../interactive_polygon.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o bezier_div $(LIBS) blur: ../blur.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o blur $(LIBS) blend_color: ../blend_color.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o blend_color $(LIBS) bspline: ../bspline.o ../interactive_polygon.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o bspline $(LIBS) circles: ../circles.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o circles $(LIBS) component_rendering: ../component_rendering.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o component_rendering $(LIBS) compositing: ../compositing.o $(PLATFORMSOURCES) compositing.bmp $(CXX) $(CXXFLAGS) ../compositing.o $(PLATFORMSOURCES) -o compositing $(LIBS) conv_contour: ../conv_contour.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o conv_contour $(LIBS) conv_dash_marker: ../conv_dash_marker.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o conv_dash_marker $(LIBS) conv_stroke: ../conv_stroke.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o conv_stroke $(LIBS) distortions: ../distortions.o $(PLATFORMSOURCES) spheres.bmp $(CXX) $(CXXFLAGS) ../distortions.o $(PLATFORMSOURCES) -o distortions $(LIBS) gamma_correction: ../gamma_correction.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o gamma_correction $(LIBS) gamma_ctrl: ../gamma_ctrl.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o gamma_ctrl $(LIBS) gouraud: ../gouraud.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o gouraud $(LIBS) gradient_focal: ../gradient_focal.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o gradient_focal $(LIBS) gradients: ../gradients.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o gradients $(LIBS) graph_test: ../graph_test.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o graph_test $(LIBS) idea: ../idea.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o idea $(LIBS) image_alpha: ../image_alpha.o $(PLATFORMSOURCES) spheres.bmp $(CXX) $(CXXFLAGS) ../image_alpha.o $(PLATFORMSOURCES) -o image_alpha $(LIBS) image_filters: ../image_filters.o $(PLATFORMSOURCES) spheres.bmp $(CXX) $(CXXFLAGS) ../image_filters.o $(PLATFORMSOURCES) -o image_filters $(LIBS) image_filters2: ../image_filters2.o $(PLATFORMSOURCES) spheres.bmp $(CXX) $(CXXFLAGS) ../image_filters2.o $(PLATFORMSOURCES) -o image_filters2 $(LIBS) image_fltr_graph: ../image_fltr_graph.o $(PLATFORMSOURCES) spheres.bmp $(CXX) $(CXXFLAGS) ../image_fltr_graph.o $(PLATFORMSOURCES) -o image_fltr_graph $(LIBS) image_perspective: ../image_perspective.o ../interactive_polygon.o $(PLATFORMSOURCES) spheres.bmp $(CXX) $(CXXFLAGS) ../image_perspective.o ../interactive_polygon.o $(PLATFORMSOURCES) -o image_perspective $(LIBS) image_resample: ../image_resample.o ../interactive_polygon.o $(PLATFORMSOURCES) spheres.bmp $(CXX) $(CXXFLAGS) ../image_resample.o ../interactive_polygon.o $(PLATFORMSOURCES) -o image_resample $(LIBS) image_transforms: ../image_transforms.o $(PLATFORMSOURCES) spheres.bmp $(CXX) $(CXXFLAGS) ../image_transforms.o $(PLATFORMSOURCES) -o image_transforms $(LIBS) image1: ../image1.o $(PLATFORMSOURCES) spheres.bmp $(CXX) $(CXXFLAGS) ../image1.o $(PLATFORMSOURCES) -o image1 $(LIBS) line_patterns: ../line_patterns.o $(PLATFORMSOURCES) 1.bmp 2.bmp 3.bmp 4.bmp 5.bmp 6.bmp 7.bmp 8.bmp 9.bmp $(CXX) $(CXXFLAGS) ../line_patterns.o $(PLATFORMSOURCES) -o line_patterns $(LIBS) lion: ../lion.o ../parse_lion.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o lion $(LIBS) lion_lens: ../lion_lens.o ../parse_lion.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o lion_lens $(LIBS) lion_outline: ../lion_outline.o ../parse_lion.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o lion_outline $(LIBS) mol_view: ../mol_view.o $(PLATFORMSOURCES) 1.sdf $(CXX) $(CXXFLAGS) ../mol_view.o $(PLATFORMSOURCES) -o mol_view $(LIBS) multi_clip: ../multi_clip.o ../parse_lion.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o multi_clip $(LIBS) pattern_fill: ../pattern_fill.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o pattern_fill $(LIBS) pattern_perspective: ../pattern_perspective.o ../interactive_polygon.o $(PLATFORMSOURCES) agg.bmp $(CXX) $(CXXFLAGS) ../pattern_perspective.o ../interactive_polygon.o $(PLATFORMSOURCES) -o pattern_perspective $(LIBS) perspective: ../perspective.o ../interactive_polygon.o ../parse_lion.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o perspective $(LIBS) polymorphic_renderer: ../polymorphic_renderer.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o polymorphic_renderer $(LIBS) raster_text: ../raster_text.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o raster_text $(LIBS) rasterizers: ../rasterizers.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o rasterizers $(LIBS) rasterizers2: ../rasterizers2.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o rasterizers2 $(LIBS) rasterizer_compound: ../rasterizer_compound.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o rasterizer_compound $(LIBS) rounded_rect: ../rounded_rect.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o rounded_rect $(LIBS) scanline_boolean: ../scanline_boolean.o ../interactive_polygon.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o scanline_boolean $(LIBS) scanline_boolean2: ../scanline_boolean2.o ../make_arrows.o ../make_gb_poly.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o scanline_boolean2 $(LIBS) simple_blur: ../simple_blur.o ../parse_lion.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o simple_blur $(LIBS) trans_polar: ../trans_polar.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o trans_polar $(LIBS) freetype_test: ../freetype_test.o ../../font_freetype/agg_font_freetype.o $(PLATFORMSOURCES) timesi.ttf $(CXX) $(CXXFREETYPEFLAGS) ../freetype_test.o ../../font_freetype/agg_font_freetype.o $(PLATFORMSOURCES) -o freetype_test $(LIBS) -lfreetype trans_curve1_ft: ../trans_curve1_ft.o ../../font_freetype/agg_font_freetype.o ../interactive_polygon.o $(PLATFORMSOURCES) timesi.ttf $(CXX) $(CXXFLAGS) ../trans_curve1_ft.o ../../font_freetype/agg_font_freetype.o ../interactive_polygon.o $(PLATFORMSOURCES) -o trans_curve1_ft $(LIBS) -lfreetype trans_curve2_ft: ../trans_curve2_ft.o ../../font_freetype/agg_font_freetype.o ../interactive_polygon.o $(PLATFORMSOURCES) timesi.ttf $(CXX) $(CXXFLAGS) ../trans_curve2_ft.o ../../font_freetype/agg_font_freetype.o ../interactive_polygon.o $(PLATFORMSOURCES) -o trans_curve2_ft $(LIBS) -lfreetype gpc_test: ../gpc_test.o ../make_arrows.o ../make_gb_poly.o $(PLATFORMSOURCES) $(CXX) $(CXXFLAGS) $^ -o gpc_test $(LIBS) clean: rm -f ../*.o rm -f ../../src/platform/$(PLATFORM)/agg_platform_support.o rm -f aa_demo rm -f aa_test rm -f alpha_gradient rm -f alpha_mask rm -f alpha_mask2 rm -f alpha_mask3 rm -f blur rm -f blend_color rm -f bezier_div rm -f bspline rm -f circles rm -f component_rendering rm -f conv_contour rm -f conv_dash_marker rm -f conv_stroke rm -f gamma_correction rm -f gamma_ctrl rm -f gouraud rm -f gradients rm -f gradient_focal rm -f graph_test rm -f idea rm -f lion rm -f lion_lens rm -f lion_outline rm -f multi_clip rm -f pattern_fill rm -f perspective rm -f polymorphic_renderer rm -f raster_text rm -f rasterizers rm -f rasterizers2 rm -f rounded_rect rm -f scanline_boolean rm -f scanline_boolean2 rm -f simple_blur rm -f trans_polar rm -f image_alpha rm -f image_filters rm -f image_filters2 rm -f image_fltr_graph rm -f image_perspective rm -f image_resample rm -f image_transforms rm -f image1 rm -f distortions rm -f pattern_perspective rm -f compositing rm -f line_patterns rm -f mol_view rm -f freetype_test rm -f trans_curve1_ft rm -f trans_curve2_ft rm -f gpc_test agg.bmp: @echo "Required file missing!!" @echo "Please download http://www.antigrain.com/agg.bmp to /examples/sdl/" @echo "Attempting to retrieve via curl -O : (will fail if curl -O is not installed)" curl -O http://www.antigrain.com/agg.bmp compositing.bmp: @echo "Required file missing!!" @echo "Please download http://www.antigrain.com/compositing.bmp to /examples/sdl/" @echo "Attempting to retrieve via curl -O : (will fail if curl -O is not installed)" curl -O http://www.antigrain.com/compositing.bmp spheres.bmp: @echo "Required file missing!!" @echo "Please download http://www.antigrain.com/spheres.bmp to /examples/sdl/" @echo "Attempting to retrieve file: (will fail if curl -O is not installed)" curl -O http://www.antigrain.com/spheres.bmp 1.sdf: @echo "Required file missing!!" @echo "Please download http://www.antigrain.com/1.sdf to /examples/sdl/" @echo "Attempting to retrieve file: (will fail if curl -O is not installed)" curl -O http://www.antigrain.com/1.sdf 1.bmp: @echo "Required file missing!!" @echo "Please download http://www.antigrain.com/line_patterns.bmp.zip to /examples/sdl/ and decompress it" @echo "Attempting to retrieve file: (will fail if curl -O is not installed)" curl -O http://www.antigrain.com/line_patterns.bmp.zip unzip -o line_patterns.bmp.zip timesi.ttf: @echo "Required file missing!!" @echo "Please download http://www.antigrain.com/timesi.zip to /examples/sdl/ and decompress it" @echo "Attempting to retrieve file: (will fail if curl -O is not installed)" curl -O http://www.antigrain.com/timesi.zip unzip -o timesi.zip ../freetype_test.o: ../freetype_test.cpp @echo \< $*.cpp \> $(CXX) -c $(CXXFREETYPEFLAGS) $*.cpp -o $@ ../trans_curve1_ft.o: ../trans_curve1_ft.cpp @echo \< $*.cpp \> $(CXX) -c $(CXXFREETYPEFLAGS) $*.cpp -o $@ ../trans_curve2_ft.o: ../trans_curve2_ft.cpp @echo \< $*.cpp \> $(CXX) -c $(CXXFREETYPEFLAGS) $*.cpp -o $@ ../../font_freetype/agg_font_freetype.o: ../../font_freetype/agg_font_freetype.cpp @echo \< $*.cpp \> $(CXX) -c $(CXXFREETYPEFLAGS) $*.cpp -o $@ ../gpc_test.o: ../gpc_test.cpp @echo \< $*.cpp \> $(CXX) -c $(CXXFLAGS) -I../../gpc $*.cpp -o $@ %.o: %.cpp @echo \< $*.cpp \> $(CXX) -c $(CXXFLAGS) $*.cpp -o $@ .PHONY : clean agg-2.5+dfsg1/examples/macosx_sdl/readme.txt0000644000000000000000000000173110703246330021230 0ustar00usergroup00000000000000The Anti-Grain Geometry Project A high quality rendering engine for C++ http://antigrain.com Anti-Grain Geometry Copyright (C) 2002-2005 Maxim Shemanarev (McSeem) 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. By default only the examples that do not require extra dependancies are built. with the following commands: cd (AGGDIRECTORY)/examples/sdl make clean make Some examples (freetype_test, trans_curve1_ft and trans_curve2_ft) require the Freetype Library, and can be built with: make freetype There is also an example (gpc_test) that requires the GPC library, build it with: make gpc Of course, to build ALL examples run: make all Alternatively you can also build the examples one by one, using the example name directly: make aa_demo make aa_test ...agg-2.5+dfsg1/examples/make_arrows.cpp0000644000000000000000000000347110703246330020117 0ustar00usergroup00000000000000#include "agg_path_storage.h" void make_arrows(agg::path_storage& ps) { ps.remove_all(); ps.move_to(1330.599999999999909,1282.399999999999864); ps.line_to(1377.400000000000091,1282.399999999999864); ps.line_to(1361.799999999999955,1298.000000000000000); ps.line_to(1393.000000000000000,1313.599999999999909); ps.line_to(1361.799999999999955,1344.799999999999955); ps.line_to(1346.200000000000045,1313.599999999999909); ps.line_to(1330.599999999999909,1329.200000000000045); ps.close_polygon(); ps.move_to(1330.599999999999909,1266.799999999999955); ps.line_to(1377.400000000000091,1266.799999999999955); ps.line_to(1361.799999999999955,1251.200000000000045); ps.line_to(1393.000000000000000,1235.599999999999909); ps.line_to(1361.799999999999955,1204.399999999999864); ps.line_to(1346.200000000000045,1235.599999999999909); ps.line_to(1330.599999999999909,1220.000000000000000); ps.close_polygon(); ps.move_to(1315.000000000000000,1282.399999999999864); ps.line_to(1315.000000000000000,1329.200000000000045); ps.line_to(1299.400000000000091,1313.599999999999909); ps.line_to(1283.799999999999955,1344.799999999999955); ps.line_to(1252.599999999999909,1313.599999999999909); ps.line_to(1283.799999999999955,1298.000000000000000); ps.line_to(1268.200000000000045,1282.399999999999864); ps.close_polygon(); ps.move_to(1268.200000000000045,1266.799999999999955); ps.line_to(1315.000000000000000,1266.799999999999955); ps.line_to(1315.000000000000000,1220.000000000000000); ps.line_to(1299.400000000000091,1235.599999999999909); ps.line_to(1283.799999999999955,1204.399999999999864); ps.line_to(1252.599999999999909,1235.599999999999909); ps.line_to(1283.799999999999955,1251.200000000000045); ps.close_polygon(); } agg-2.5+dfsg1/examples/make_gb_poly.cpp0000644000000000000000000010313010703246330020226 0ustar00usergroup00000000000000#include "agg_path_storage.h" static double poly1[] = { 1250.8,1312.4, 1252.8,1311.6, 1254,1312, 1254.8,1313.6, 1254.8,1314.8, 1256,1314, 1257.6,1313.6, 1258.4,1314.4, 1260.4,1315.6, 1261.6,1315.6, 1262.4,1315.6, 1263.2,1315.6, 1264.8,1314.8, 1266,1315.2, 1266.8,1315.2, 1267.2,1312.8, 1266.8,1311.2, 1267.6,1310.8, 1268,1310.4, 1268,1308.8, 1268.8,1308.4, 1270,1307.2, 1270,1306.8, 1270,1305.6, 1270.8,1305.6, 1271.2,1304, 1271.2,1304, 1270.4,1305.6, 1270.8,1306.4, 1271.2,1306, 1271.6,1305.6, 1272,1304.8, 1271.6,1303.2, 1271.2,1302.8, 1269.2,1302, 1268.4,1300.4, 1268.4,1300, 1269.2,1300.4, 1270.8,1302.4, 1272.4,1302, 1273.2,1302, 1273.6,1300.4, 1274.8,1299.2, 1274.4,1298, 1275.2,1297.2, 1274.4,1295.6, 1274.4,1294.8, 1274.4,1294.4, 1274.4,1293.6, 1273.6,1293.6, 1273.6,1293.6, 1273.2,1295.2, 1273.6,1296.4, 1273.6,1297.6, 1273.2,1298, 1272,1299.2, 1271.6,1299.2, 1271.2,1298, 1272,1298, 1271.6,1297.6, 1272,1297.2, 1272.4,1295.6, 1270.8,1294, 1272.8,1294.8, 1273.2,1293.6, 1273.6,1293.2, 1272.8,1292.4, 1271.6,1291.2, 1271.2,1291.6, 1270.4,1292, 1268.8,1290.8, 1268.8,1289.2, 1268.4,1287.6, 1266,1286.4, 1265.2,1286.4, 1265.6,1287.2, 1264.4,1287.6, 1264,1287.6, 1263.2,1288, 1264,1287.6, 1264.4,1286.4, 1264.8,1286.4, 1265.2,1286, 1264,1285.2, 1262,1286.4, 1261.6,1286.4, 1261.6,1286.4, 1261.6,1285.6, 1261.2,1284, 1261.6,1283.2, 1262.8,1283.2, 1262.8,1281.6, 1263.2,1280.8, 1263.2,1280, 1263.2,1278.4, 1263.2,1277.6, 1265.2,1275.6, 1264.8,1274.4, 1264,1272.4, 1264.4,1271.2, 1265.2,1271.2, 1265.6,1270.4, 1264,1271.2, 1263.6,1270.4, 1263.2,1270.4, 1263.6,1269.2, 1264.4,1268.4, 1264.4,1266.8, 1265.2,1264.4, 1264.8,1261.6, 1266,1261.2, 1264.8,1258.4, 1264,1257.6, 1263.2,1256, 1262,1254, 1262.4,1251.6, 1260,1247.6, 1259.6,1246.8, 1258.8,1247.2, 1258.8,1246.8, 1258.8,1246, 1259.2,1245.6, 1259.2,1246, 1259.2,1244.4, 1260,1243.6, 1259.2,1242.4, 1258.8,1242.4, 1259.2,1242.8, 1258,1242.4, 1258,1242.8, 1257.6,1242.8, 1256,1242.4, 1254.4,1244, 1253.2,1243.2, 1253.6,1244, 1253.2,1244, 1252.8,1244, 1252.4,1243.6, 1252.8,1242.8, 1252.4,1242.8, 1251.6,1242, 1250.8,1241.2, 1250.8,1241.6, 1251.6,1242, 1251.6,1242.8, 1251.2,1243.6, 1250.8,1244, 1250.4,1245.2, 1250.8,1243.6, 1250.4,1242.8, 1250.8,1242.8, 1250,1241.6, 1248.4,1242, 1249.2,1243.2, 1248.4,1243.2, 1248.4,1243.2, 1248.4,1242.4, 1247.6,1242.4, 1247.2,1242, 1243.6,1242, 1242,1241.6, 1242,1241.2, 1241.2,1241.6, 1240.8,1241.2, 1241.2,1240.4, 1242,1240, 1241.6,1240, 1241.6,1239.2, 1239.6,1239.2, 1239.2,1238, 1238.4,1238, 1237.6,1238, 1237.2,1238.8, 1236.8,1238, 1236.4,1238, 1236.8,1236.8, 1235.2,1236.4, 1234.4,1235.6, 1234.8,1235.2, 1232.4,1234.8, 1231.2,1235.2, 1231.2,1235.6, 1232.4,1236, 1232.8,1236.8, 1230.8,1236.4, 1229.6,1237.2, 1229.2,1236.4, 1230,1236.4, 1230.8,1235.6, 1230.4,1234.8, 1230.4,1234.4, 1229.6,1233.2, 1228.4,1233.2, 1228,1232.8, 1226.8,1233.2, 1227.2,1232.8, 1226.4,1232, 1226.4,1230.8, 1226,1231.2, 1224.4,1231.2, 1224,1229.6, 1223.2,1229.6, 1223.2,1230.4, 1221.6,1230.8, 1221.2,1229.2, 1220.4,1229.2, 1220.4,1229.2, 1219.6,1230.4, 1218.4,1229.6, 1217.6,1230.8, 1218,1229.6, 1216.8,1229.6, 1216.8,1230, 1216.8,1228.8, 1216.4,1228.8, 1216,1228.8, 1216.4,1228.8, 1215.6,1229.2, 1215.6,1228.8, 1214.8,1228.8, 1214.4,1228.8, 1214,1229.2, 1214.4,1230.4, 1213.6,1231.6, 1213.6,1230.8, 1212.8,1230.4, 1212,1230.8, 1212,1229.6, 1211.6,1229.6, 1211.2,1229.2, 1210.8,1229.6, 1210.8,1230.8, 1209.6,1229.6, 1210,1229.6, 1208.8,1229.2, 1208.8,1230, 1208,1229.2, 1208,1230, 1208,1230, 1209.6,1231.2, 1210.8,1231.2, 1212.4,1232.8, 1212,1232.8, 1208.4,1231.2, 1208,1231.2, 1208.8,1232, 1209.6,1232.8, 1214,1234, 1214,1234, 1214,1234.4, 1213.6,1234.8, 1213.2,1235.6, 1212.8,1236, 1212.8,1235.6, 1212,1234, 1207.2,1233.6, 1206.8,1233.2, 1205.2,1233.2, 1204.8,1233.2, 1204,1233.2, 1203.6,1233.2, 1203.6,1233.2, 1203.6,1233.6, 1204.8,1233.2, 1204.8,1234, 1204.4,1234.4, 1204.8,1234.4, 1206.4,1234.8, 1206.8,1235.6, 1206,1235.6, 1206.4,1236.4, 1207.6,1236.8, 1208,1236.4, 1208,1236.8, 1209.6,1236.8, 1208.8,1237.2, 1210,1238.4, 1211.2,1238.8, 1212.4,1238.4, 1210.4,1238.8, 1209.2,1238, 1208.4,1238, 1208,1237.6, 1207.6,1238, 1204,1236.4, 1204,1236.8, 1202.8,1237.2, 1203.2,1237.6, 1203.6,1238.4, 1203.2,1239.2, 1202.4,1238.8, 1201.2,1238, 1201.6,1239.6, 1200.8,1239.6, 1200.4,1240.4, 1202.4,1240.8, 1202.8,1240.4, 1202.4,1241.2, 1202,1241.6, 1202.8,1242, 1202.8,1242.4, 1206.8,1243.6, 1207.6,1244.8, 1207.6,1244, 1208,1243.6, 1208.8,1245.6, 1209.2,1245.2, 1210.4,1245.2, 1208.8,1246, 1207.6,1246, 1207.6,1245.2, 1207.2,1246, 1204.4,1245.2, 1203.6,1246, 1202.8,1246, 1202.4,1246, 1203.2,1245.6, 1202.8,1245.2, 1201.2,1246, 1202,1245.6, 1200.8,1245.6, 1200,1246, 1200,1246.4, 1200,1246.8, 1200.4,1247.2, 1200,1247.6, 1200.8,1247.6, 1200.8,1247.2, 1201.6,1247.2, 1201.6,1248.8, 1202.4,1248.4, 1203.2,1249.2, 1204.8,1249.6, 1204.8,1248.4, 1206,1248, 1206.8,1249.6, 1206.4,1250, 1207.2,1250.4, 1206.8,1249.2, 1208,1248, 1209.2,1248, 1209.6,1248, 1209.6,1248, 1210.8,1248, 1210.8,1248.4, 1208.8,1248.8, 1208.8,1250, 1209.6,1249.6, 1209.6,1250, 1210,1251.2, 1208.4,1252, 1208.4,1252.4, 1211.2,1252.8, 1212.4,1254, 1213.2,1253.2, 1212.8,1254, 1212.4,1254, 1212.4,1254, 1212.8,1255.2, 1213.6,1255.6, 1215.6,1254.8, 1215.6,1255.2, 1217.6,1254.8, 1221.2,1256, 1221.2,1255.2, 1222,1255.2, 1222.8,1256.4, 1224.4,1256, 1224.8,1256.4, 1226,1256.4, 1224,1257.2, 1222.8,1257.2, 1222.8,1257.6, 1222.4,1258.8, 1221.2,1258.4, 1221.2,1257.6, 1219.6,1255.6, 1218.4,1256, 1217.6,1254.8, 1217.2,1255.6, 1218,1256.4, 1216,1256, 1214.8,1256.4, 1214.4,1257.2, 1214,1257.6, 1214.4,1256.4, 1212.4,1256.4, 1212.4,1255.6, 1209.6,1256, 1208.8,1256, 1210.4,1256.4, 1212.8,1258.4, 1214,1259.6, 1215.2,1259.6, 1215.2,1260.8, 1216,1261.2, 1216,1262.8, 1217.6,1263.6, 1217.2,1263.6, 1215.6,1264, 1215.6,1264, 1216.4,1264.4, 1218.8,1268, 1220.4,1267.6, 1221.6,1268, 1221.2,1268, 1222.8,1268, 1221.6,1268, 1223.2,1268, 1223.2,1268, 1223.6,1267.6, 1223.6,1267.6, 1223.6,1268.4, 1224.4,1269.6, 1223.6,1269.2, 1222.8,1269.6, 1223.2,1270, 1223.6,1270.4, 1224,1270.4, 1224,1271.2, 1222.4,1271.2, 1220.4,1270.4, 1216,1270.4, 1215.2,1270.8, 1215.2,1272.4, 1215.2,1272, 1214.8,1270.8, 1214.8,1270.8, 1214.8,1271.6, 1214.8,1272.4, 1214.8,1273.2, 1214.8,1273.2, 1215.2,1273.2, 1214.8,1273.6, 1214.8,1273.2, 1214.8,1273.6, 1214.4,1273.6, 1214.8,1274, 1214.4,1274, 1213.6,1273.2, 1213.2,1272.8, 1212,1273.6, 1211.2,1273.6, 1211.6,1274.4, 1211.2,1274.4, 1213.2,1275.2, 1213.2,1275.2, 1212.8,1275.2, 1212.8,1275.6, 1211.6,1275.6, 1211.6,1275.6, 1211.6,1275.6, 1211.2,1275.6, 1210.8,1275.6, 1210.4,1274.8, 1209.2,1275.6, 1208.8,1276, 1208,1275.6, 1207.6,1276.4, 1207.2,1276, 1208,1277.6, 1209.2,1277.2, 1208.4,1278, 1208.4,1278.8, 1208,1279.2, 1207.2,1279.6, 1208.8,1279.2, 1208.8,1280, 1210.4,1279.6, 1209.6,1281.2, 1212,1281.2, 1212,1282.4, 1212.4,1283.6, 1214,1284.4, 1215.6,1284, 1216.4,1284.8, 1215.6,1284.8, 1216,1285.2, 1215.6,1285.2, 1216,1286.4, 1216,1286.4, 1216.4,1286.8, 1214,1286.8, 1213.2,1286.8, 1212,1286.8, 1212,1286.8, 1212.4,1288.8, 1213.6,1288, 1214,1287.6, 1214,1287.6, 1214,1289.2, 1213.6,1289.2, 1213.6,1288.4, 1213.6,1289.2, 1213.6,1289.6, 1212.8,1290.4, 1212.8,1291.2, 1213.6,1291.6, 1213.2,1291.6, 1214,1292.4, 1213.2,1292.4, 1213.2,1291.6, 1212.4,1292, 1212,1292, 1212,1292, 1212.8,1292.8, 1212.4,1293.2, 1212.8,1293.6, 1212.4,1294, 1212.8,1294.4, 1212.8,1294.4, 1211.6,1295.2, 1211.6,1294.4, 1211.2,1294.4, 1211.6,1294, 1210.8,1294, 1210.8,1293.6, 1210.4,1293.2, 1210.8,1292, 1210,1292.4, 1210.4,1295.2, 1210.8,1295.2, 1210,1296, 1210.8,1296, 1210.8,1296.4, 1212,1297.6, 1212.4,1296.4, 1213.2,1295.6, 1212.8,1294.8, 1212,1295.6, 1212,1295.2, 1213.6,1294.8, 1213.6,1296, 1214,1295.6, 1214,1296.4, 1214,1296.4, 1213.6,1297.2, 1214,1297.6, 1215.6,1297.2, 1218.4,1296.8, 1219.6,1295.2, 1220.4,1296.4, 1221.2,1296, 1221.6,1295.2, 1222.4,1294.8, 1222,1294.4, 1222.4,1294, 1222,1293.6, 1222.8,1293.2, 1223.2,1292.8, 1224.4,1295.2, 1226,1295.2, 1227.6,1294, 1228.4,1294.4, 1228.8,1294.4, 1229.6,1294, 1230.8,1292.8, 1231.6,1292.8, 1230.8,1294, 1230.4,1294, 1231.2,1294.4, 1232.4,1294.4, 1231.2,1295.6, 1231.2,1295.6, 1232.4,1295.2, 1232.4,1295.6, 1231.6,1296, 1230.4,1295.6, 1230,1296, 1231.2,1296.8, 1231.2,1297.6, 1231.6,1297.6, 1232.8,1298, 1232.4,1298.8, 1232.8,1299.2, 1233.2,1298.8, 1235.2,1298.8, 1236,1300, 1236.4,1300.4, 1237.6,1302.4, 1238,1302.4, 1238.4,1302, 1238,1302.4, 1236,1302.4, 1235.6,1302.4, 1235.6,1302.4, 1235.6,1302.4, 1234.8,1302.4, 1233.2,1300.8, 1233.2,1302, 1234.4,1302.4, 1234.4,1302.4, 1233.2,1302.4, 1232.8,1302.4, 1231.6,1302.4, 1230.4,1302.4, 1228.8,1304, 1229.2,1304.4, 1228.8,1304.4, 1229.6,1304.4, 1229.2,1305.6, 1230.4,1306.4, 1234,1305.6, 1233.2,1306.4, 1232.4,1306.4, 1233.2,1306.4, 1234.4,1305.6, 1232.4,1307.6, 1233.2,1307.6, 1235.6,1307.6, 1234.8,1308.4, 1234.8,1308.8, 1235.6,1308.4, 1236,1308.4, 1235.6,1308.8, 1234.8,1309.2, 1234.8,1308.8, 1234,1309.2, 1234,1310.4, 1235.2,1310.4, 1234.8,1310.4, 1234,1312, 1234.8,1312, 1234.8,1312.8, 1235.6,1312.4, 1235.6,1313.2, 1236,1313.2, 1236,1313.2, 1236.4,1313.2, 1236.4,1313.6, 1236.8,1314.8, 1238.4,1314.4, 1238.8,1314.4, 1238.8,1314.4, 1238.4,1314, 1239.6,1314.4, 1240.4,1314.8, 1240.4,1316.4, 1240.8,1316.8, 1241.6,1316.4, 1241.6,1315.6, 1242,1315.6, 1242.4,1314.8, 1242,1314.4, 1242.8,1314.4, 1242,1314.4, 1242.8,1314.4, 1242.8,1314.4, 1243.2,1315.6, 1242.4,1315.6, 1242,1316.8, 1242.8,1316.8, 1243.2,1316.8, 1243.2,1314.8, 1244,1314.4, 1244.8,1314, 1244.8,1313.2, 1245.2,1314, 1244.8,1316.4, 1244.4,1314.4, 1244.4,1315.2, 1244.4,1316, 1243.6,1316.4, 1244,1316.8, 1244.4,1316.8, 1245.2,1317.6, 1246,1316.8, 1246,1315.2, 1246.8,1314, 1246.8,1314, 1246.8,1312.8, 1245.2,1311.6, 1246,1311.6, 1246.4,1311.6, 1245.2,1311.2, 1244.8,1310, 1246.4,1311.6, 1247.6,1312, 1247.6,1312.4, 1247.6,1314, 1246.8,1316, 1247.6,1316.4, 1246.8,1317.2, 1247.6,1317.2, 1247.6,1317.2, 1248,1317.2, 1249.2,1317.6, 1249.6,1317.6, 1249.6,1317.2, 1250.8,1317.2, 1249.6,1317.6, 1249.2,1318.4, 1249.6,1318.4, 1249.2,1319.2, 1248.8,1319.6, 1248.8,1319.6, 1250.8,1319.2, 1251.6,1318.4, 1252.4,1317.6, 1255.2,1316, 1255.2,1315.6, 1252,1314 }; static double poly2[] = { 1284,1396.4, 1284.4,1395.6, 1285.2,1395.6, 1286,1395.2, 1286,1394.8, 1286.8,1395.2, 1286.4,1395.2, 1286.4,1395.2, 1286.8,1394.8, 1288,1394, 1288,1393.6, 1286.8,1391.6, 1288,1392.8, 1288,1393.6, 1288.8,1393.6, 1288.8,1394.8, 1290,1394.4, 1290.8,1393.6, 1291.2,1393.2, 1290.4,1391.2, 1291.6,1393.6, 1292.8,1393.6, 1293.6,1392.8, 1293.6,1393.2, 1293.6,1394, 1294.4,1393.6, 1294.8,1394.4, 1295.6,1394, 1296,1394.8, 1296,1394.4, 1297.6,1394.4, 1298.8,1394.4, 1300.4,1394.8, 1302,1394.8, 1302,1394.4, 1302.4,1394.4, 1303.2,1395.2, 1304.4,1394.8, 1304.4,1395.2, 1303.6,1396.4, 1304.4,1396.8, 1304.4,1396.4, 1306.8,1396, 1306.8,1395.6, 1308.4,1396, 1308.8,1395.6, 1307.6,1392.8, 1307.6,1392, 1308.8,1392, 1307.6,1389.6, 1307.2,1389.2, 1306.4,1387.6, 1304.4,1387.2, 1302.8,1384, 1299.6,1382, 1298.8,1381.6, 1298,1380.8, 1296.4,1379.2, 1296,1377.6, 1295.2,1377.6, 1294.4,1377.2, 1293.6,1376.8, 1293.6,1376.4, 1295.2,1376.4, 1296.4,1376.8, 1296.8,1376.8, 1296.8,1376.4, 1298,1376.4, 1298.8,1377.6, 1299.2,1377.2, 1298,1375.2, 1296.4,1373.6, 1296,1373.6, 1296,1374, 1295.2,1374, 1294,1373.2, 1292.4,1373.6, 1292.4,1372.4, 1290.8,1371.2, 1290.4,1370.4, 1293.2,1372.8, 1295.2,1372.8, 1295.6,1373.6, 1296.4,1372.8, 1294.8,1371.2, 1294.8,1371.2, 1294.8,1370.4, 1294,1370, 1293.6,1369.6, 1292.8,1370, 1293.2,1369.6, 1292.8,1368.8, 1293.6,1368.4, 1294,1368.4, 1294,1368.4, 1295.6,1370, 1295.6,1370.4, 1295.2,1371.2, 1298,1371.2, 1300.4,1372, 1302,1372.4, 1302.8,1373.6, 1304.8,1374.4, 1308.8,1372.4, 1310.8,1373.6, 1311.2,1373.2, 1312.4,1373.2, 1316.8,1372.4, 1317.6,1372.4, 1318.4,1373.2, 1319.6,1372.4, 1320.4,1373.2, 1322,1373.2, 1322,1372.4, 1322.8,1372.8, 1323.6,1372.4, 1324,1371.6, 1324,1370.4, 1324.8,1368.8, 1324.4,1368.8, 1324.8,1368, 1325.2,1368, 1321.6,1363.2, 1320.8,1360.4, 1321.2,1359.6, 1319.6,1356, 1319.6,1354.4, 1318.4,1352.4, 1317.2,1351.2, 1316.8,1351.2, 1316.8,1349.2, 1316.8,1349.2, 1315.6,1348.4, 1316,1347.6, 1315.2,1346, 1312.8,1344.4, 1312.4,1344, 1311.6,1344, 1310.8,1343.6, 1310,1344, 1309.2,1343.6, 1308.4,1343.6, 1305.6,1342, 1304.8,1341.6, 1305.2,1341.2, 1306.4,1342, 1310.4,1343.6, 1311.6,1343.2, 1311.2,1342, 1311.2,1341.6, 1311.2,1341.6, 1312,1340.4, 1313.6,1340.4, 1314.8,1338.8, 1313.2,1338, 1311.6,1337.6, 1310,1337.6, 1309.6,1337.6, 1307.2,1335.2, 1306.8,1334.4, 1305.2,1334, 1303.6,1332.8, 1301.2,1334, 1299.6,1334, 1299.6,1332.8, 1300,1332.8, 1302,1332.8, 1304,1332.4, 1304.4,1332.8, 1305.2,1332.4, 1307.2,1332.4, 1307.6,1331.6, 1308.8,1331.6, 1309.6,1332.4, 1310,1332.4, 1310.8,1332.8, 1310.8,1333.6, 1311.6,1334.4, 1313.6,1334.4, 1314.8,1332.8, 1314.8,1332.8, 1316,1332.8, 1318.4,1330.8, 1320.8,1330.4, 1320.8,1330.4, 1321.6,1329.6, 1322.8,1326.8, 1324.8,1324.4, 1325.2,1324.4, 1325.6,1324, 1325.6,1323.6, 1325.6,1323.2, 1326.8,1323.2, 1327.2,1323.2, 1327.6,1321.6, 1328.4,1320.4, 1328.4,1319.2, 1328,1318, 1328.8,1316.8, 1328.4,1315.6, 1329.6,1313.2, 1329.6,1312.4, 1330.8,1309.2, 1331.6,1308, 1331.6,1307.2, 1332.8,1303.6, 1333.2,1302, 1334.4,1301.6, 1334,1301.6, 1334.4,1300.8, 1334.4,1299.6, 1334.4,1299.6, 1334.8,1299.6, 1334.8,1300, 1337.2,1299.2, 1339.6,1298.4, 1341.6,1297.2, 1342.8,1296.8, 1343.6,1296.4, 1343.6,1295.6, 1344.8,1294, 1346,1292, 1347.2,1291.2, 1347.6,1289.6, 1350,1288.8, 1348.8,1287.6, 1348,1286.4, 1349.6,1282.8, 1351.2,1280, 1352.8,1277.2, 1353.2,1275.6, 1353.2,1275.6, 1353.2,1276.4, 1352.8,1276.8, 1351.6,1277.2, 1351.2,1276.8, 1350.4,1276.8, 1349.6,1277.2, 1348,1279.2, 1347.2,1279.6, 1345.6,1278.4, 1343.6,1278, 1342.4,1278.8, 1341.2,1278, 1341.6,1277.6, 1342.8,1278, 1344,1277.6, 1344.8,1277.6, 1347.2,1278.4, 1348,1278, 1348.4,1277.2, 1350.4,1275.6, 1351.2,1275.6, 1351.6,1274.4, 1352.4,1273.2, 1353.6,1273.2, 1354,1272.4, 1354.8,1271.2, 1356,1267.6, 1356.8,1266, 1356.4,1264.4, 1354,1262, 1352.8,1259.6, 1352.4,1259.6, 1352,1259.2, 1352.8,1259.2, 1353.6,1259.2, 1354,1258.8, 1355.6,1257.2, 1357.2,1257.6, 1357.6,1256.4, 1357.6,1256.8, 1358,1258, 1358.8,1260.8, 1359.6,1261.6, 1360.4,1261.2, 1361.2,1261.6, 1364,1261.2, 1364.4,1261.6, 1364.8,1261.6, 1365.6,1261.6, 1366.4,1261.6, 1365.6,1262, 1366,1262, 1366.8,1262, 1367.6,1261.6, 1370.4,1261.2, 1372.4,1259.6, 1376,1257.2, 1376.4,1257.2, 1377.6,1254.4, 1377.6,1252.8, 1378,1251.6, 1377.6,1250, 1378,1248.8, 1376.4,1245.6, 1376.4,1243.6, 1376,1241.2, 1374,1240, 1372.8,1237.2, 1371.6,1238.8, 1371.6,1237.6, 1370,1238, 1369.6,1237.6, 1372,1237.6, 1370.8,1235.2, 1371.6,1235.2, 1371.6,1236, 1372,1235.2, 1372,1235.2, 1370.8,1234, 1369.6,1233.2, 1368.4,1233.6, 1367.6,1234, 1366.8,1234, 1366,1233.2, 1365.6,1232.4, 1363.6,1232, 1364.4,1231.6, 1364.8,1231.6, 1366.4,1232.8, 1367.2,1232.4, 1367.2,1231.2, 1366.8,1229.6, 1366.4,1229.6, 1365.2,1229.2, 1366,1229.6, 1366.4,1229.2, 1366.4,1229.6, 1367.2,1229.6, 1367.6,1229.2, 1365.2,1227.2, 1363.2,1227.2, 1362,1226, 1360.4,1226, 1360,1226, 1359.2,1225.2, 1360,1225.2, 1360.4,1226, 1361.6,1226, 1364,1226, 1364.4,1225.2, 1364,1224.8, 1363.2,1224.8, 1362.4,1224.4, 1361.6,1224.4, 1362.4,1223.6, 1363.2,1223.6, 1363.6,1223.6, 1364,1223.6, 1364,1224.4, 1364.4,1224, 1364.4,1224.4, 1364.4,1225.2, 1366.8,1224.8, 1367.6,1223.2, 1366.8,1223.2, 1365.2,1222.8, 1367.2,1222.8, 1371.6,1224, 1375.2,1224.4, 1374.8,1223.2, 1374,1222, 1374.8,1220.4, 1374.4,1218.4, 1374,1218, 1372,1217.2, 1371.6,1217.2, 1370.4,1216.4, 1369.2,1215.6, 1368.4,1214.4, 1368.8,1212.8, 1366,1212.8, 1364.8,1212.4, 1364,1211.6, 1359.2,1210, 1358.4,1208.4, 1357.6,1207.6, 1354.4,1208.8, 1351.2,1210, 1344,1208.4, 1343.6,1207.6, 1343.2,1208.4, 1343.2,1207.2, 1342.4,1207.2, 1340.8,1208.4, 1341.2,1208.4, 1340.8,1209.6, 1340.4,1209.2, 1340,1209.6, 1339.6,1209.6, 1340,1209.2, 1340.4,1208.4, 1338.8,1208.4, 1339.2,1208.4, 1339.2,1209.6, 1338.4,1209.2, 1338.4,1208, 1338,1208, 1337.6,1208, 1338,1209.2, 1338,1210, 1336.4,1209.2, 1337.2,1208.8, 1336.8,1208, 1334.4,1209.2, 1333.6,1210.4, 1332,1211.2, 1332,1210.8, 1333.2,1210.4, 1334.4,1208.8, 1333.6,1208, 1332.4,1208, 1331.2,1206.8, 1329.2,1206.8, 1328,1206.8, 1328.4,1206.8, 1328.4,1206.8, 1327.2,1206.8, 1326.4,1206.8, 1325.2,1205.6, 1325.2,1206.8, 1323.6,1206.8, 1323.2,1205.6, 1323.6,1206, 1323.6,1205.2, 1325.2,1205.2, 1325.2,1204.4, 1325.6,1204.4, 1325.2,1204, 1324.8,1203.2, 1323.6,1203.2, 1323.2,1203.2, 1321.2,1204, 1318,1204, 1317.6,1203.6, 1317.2,1202.8, 1318,1202, 1317.2,1201.2, 1317.2,1202.4, 1314.8,1204.4, 1312.4,1206, 1310.8,1206.4, 1309.6,1205.6, 1307.6,1205.6, 1306,1205.6, 1303.6,1203.2, 1302.8,1203.6, 1302,1205.2, 1302.4,1203.2, 1301.2,1201.2, 1301.6,1200, 1300.4,1199.2, 1300.8,1198.8, 1301.6,1198, 1301.2,1198, 1300.8,1197.6, 1300,1197.2, 1300,1196.8, 1299.2,1196.4, 1299.2,1195.6, 1299.2,1194.4, 1298,1194, 1297.2,1194.4, 1297.2,1194.4, 1296.4,1194.4, 1295.6,1196, 1294.4,1196.8, 1292.8,1196.8, 1291.6,1196.8, 1291.6,1197.6, 1290.4,1198, 1290.4,1198, 1291.2,1197.6, 1290.8,1196.8, 1290,1196.8, 1289.6,1198, 1288.8,1198, 1287.2,1198, 1286.4,1197.2, 1283.6,1197.2, 1283.2,1197.2, 1283.2,1197.6, 1282,1197.2, 1281.2,1194.8, 1280,1195.2, 1279.6,1194.4, 1278.8,1194.4, 1278.8,1192.8, 1278,1192.8, 1278.4,1192.8, 1278,1192.8, 1278,1195.2, 1277.6,1195.2, 1277.2,1194.4, 1277.6,1193.6, 1277.2,1192.8, 1277.6,1192.8, 1277.2,1192.8, 1277.2,1192, 1276.4,1192, 1277.2,1191.6, 1277.2,1190.8, 1276.8,1190, 1275.6,1190, 1275.2,1188.8, 1274.4,1190, 1274,1191.2, 1273.2,1191.6, 1270.8,1193.2, 1270,1192.8, 1270,1192, 1269.6,1191.2, 1268,1190.8, 1267.2,1191.6, 1267.6,1192, 1267.2,1193.6, 1268,1193.2, 1270,1195.2, 1271.6,1194.4, 1272.4,1195.2, 1273.2,1195.2, 1274,1196.4, 1274.8,1197.6, 1276,1198.4, 1276,1199.2, 1277.6,1199.6, 1278.4,1200.8, 1278,1201.6, 1278.4,1202.4, 1278.8,1202.4, 1279.6,1203.2, 1279.6,1202.8, 1280,1203.6, 1282,1203.6, 1282,1205.2, 1283.2,1206.4, 1283.6,1207.2, 1285.6,1208, 1285.6,1210.8, 1286.4,1213.2, 1286.8,1213.2, 1288.8,1212.8, 1289.2,1212.8, 1290.4,1213.6, 1291.2,1214.4, 1290,1216.4, 1290.4,1216.4, 1290.4,1216.8, 1290.8,1216.8, 1297.2,1218.8, 1300,1218.4, 1300.4,1218.4, 1302.4,1217.6, 1302.8,1217.2, 1304.4,1217.2, 1306,1217.6, 1308,1217.6, 1308.8,1218.4, 1308.8,1218.8, 1308.8,1220, 1309.2,1220, 1309.6,1222, 1310.4,1222.8, 1312.4,1224.4, 1313.2,1224.8, 1316.8,1230, 1318,1230.8, 1318,1231.6, 1318,1230.8, 1316.8,1230.8, 1313.2,1227.2, 1310.8,1226, 1309.6,1225.6, 1309.6,1225.6, 1309.6,1225.6, 1308.8,1225.6, 1307.2,1224.4, 1307.2,1223.6, 1306.4,1223.6, 1306.4,1222.8, 1305.2,1222.4, 1302.8,1222.4, 1300.8,1222.8, 1299.2,1224.4, 1298.4,1224.4, 1297.2,1225.6, 1296.4,1228, 1294,1228, 1294,1227.6, 1294,1226, 1291.6,1226, 1291.6,1226, 1290.8,1225.6, 1289.6,1226, 1289.6,1227.2, 1290,1227.6, 1290.4,1227.6, 1290.8,1227.6, 1292.4,1228, 1292.8,1228.8, 1293.2,1229.2, 1292,1228.8, 1291.2,1229.6, 1289.6,1229.2, 1289.6,1229.2, 1288.4,1230, 1288.4,1230.8, 1289.6,1230, 1288.8,1231.2, 1288.8,1232, 1288.4,1231.2, 1287.6,1231.6, 1287.6,1230.8, 1284.4,1230.4, 1283.6,1229.2, 1282.8,1229.2, 1282.4,1228.4, 1281.2,1228, 1280,1227.6, 1278.4,1228.4, 1278.4,1229.2, 1277.6,1229.2, 1277.6,1229.6, 1278.4,1229.2, 1278.8,1229.6, 1278.8,1229.6, 1279.6,1229.6, 1281.2,1230, 1279.6,1230.4, 1276.8,1230.4, 1276.8,1229.6, 1276,1230.4, 1275.6,1231.2, 1276.4,1231.2, 1276.8,1232, 1278,1232, 1277.6,1234, 1276.4,1234, 1274.4,1234.4, 1274.8,1236, 1276,1235.6, 1276.4,1236, 1278,1236.8, 1278,1237.6, 1279.6,1237.2, 1280,1237.2, 1280.8,1237.2, 1280.8,1238, 1281.2,1237.2, 1282,1237.6, 1282,1238.4, 1282.8,1238.8, 1283.6,1240, 1284,1240, 1284,1240.8, 1286.8,1240.4, 1288.8,1242.4, 1289.6,1242.4, 1290.8,1242.8, 1292,1244.8, 1292.8,1246.4, 1293.6,1249.6, 1294.4,1250, 1295.2,1250.4, 1293.6,1250.4, 1292.4,1251.6, 1293.6,1254, 1294.4,1255.2, 1293.6,1254.4, 1293.2,1255.2, 1292.4,1255.6, 1292,1256.4, 1292.8,1257.6, 1292,1258.4, 1288.8,1258.4, 1288,1257.6, 1287.6,1256.8, 1287.6,1256.4, 1286.8,1255.2, 1285.6,1256.8, 1285.2,1256.4, 1284,1256.8, 1283.6,1256, 1283.6,1256.8, 1284,1257.6, 1285.6,1258.8, 1286.8,1259.6, 1289.2,1261.6, 1289.2,1263.6, 1290,1263.6, 1290,1263.6, 1292,1266.4, 1292.8,1266.8, 1293.6,1266.8, 1296.4,1267.6, 1296.8,1267.6, 1296.4,1268.8, 1297.6,1268.4, 1298.4,1267.6, 1300,1268, 1303.6,1269.2, 1304.8,1269.2, 1304.8,1268.8, 1307.6,1266.4, 1308,1267.6, 1306,1270, 1306.4,1270, 1308.4,1271.2, 1308.8,1270.4, 1310,1268.4, 1311.2,1268, 1312.4,1268, 1312.8,1268.8, 1312,1268.8, 1310.4,1268.8, 1309.6,1270.4, 1307.6,1273.2, 1309.2,1277.2, 1311.2,1278.8, 1308.4,1278.8, 1308,1280.4, 1308.4,1282.8, 1310.4,1283.6, 1310.8,1283.2, 1311.2,1284.4, 1310.8,1284.4, 1310.8,1284.8, 1310.4,1284.8, 1310,1285.6, 1310.8,1286.8, 1311.6,1286.8, 1311.6,1287.6, 1311.2,1289.2, 1311.6,1290, 1310.8,1290, 1310,1288.4, 1309.6,1288.4, 1308.4,1290, 1307.6,1287.6, 1306.8,1286.4, 1307.2,1286.4, 1305.6,1287.6, 1305.6,1288.4, 1305.6,1288.8, 1306,1288.8, 1306.4,1291.2, 1305.6,1289.6, 1304.4,1289.6, 1303.2,1291.6, 1303.2,1292.8, 1300,1297.2, 1300.8,1299.2, 1301.2,1300.4, 1302,1302, 1302.8,1303.2, 1302.8,1304, 1303.6,1305.6, 1304.4,1306, 1304.4,1305.6, 1305.2,1305.6, 1305.6,1306, 1305.2,1306, 1305.2,1306.8, 1306,1307.6, 1307.6,1306.8, 1308.4,1307.2, 1308.4,1307.6, 1308,1307.6, 1308,1308, 1308.8,1308, 1308.8,1308.4, 1307.2,1308.4, 1305.6,1308, 1303.2,1308, 1302.8,1308, 1302,1308, 1301.6,1308, 1301.2,1308, 1301.2,1308, 1301.2,1305.6, 1300.8,1305.6, 1299.2,1306, 1298.4,1305.6, 1298,1306, 1297.6,1305.6, 1297.6,1306, 1298,1306, 1297.2,1305.2, 1297.6,1304.8, 1295.6,1303.2, 1294.4,1303.2, 1294.4,1304.8, 1294,1303.6, 1293.2,1303.6, 1292,1304.8, 1292.4,1306, 1291.6,1304.8, 1290.4,1306, 1290,1306.4, 1289.6,1307.2, 1289.6,1306, 1289.2,1306.4, 1289.2,1304.8, 1290.4,1304.4, 1290,1303.6, 1290.4,1301.6, 1290,1301.6, 1288,1301.6, 1286.8,1303.6, 1284.4,1304.8, 1284,1306, 1283.6,1306.4, 1282.4,1305.2, 1281.6,1304.4, 1282.4,1301.6, 1282.8,1301.6, 1283.2,1301.2, 1283.6,1300.4, 1283.2,1300.4, 1282,1301.2, 1282,1302.4, 1279.6,1306, 1278.8,1308, 1279.2,1309.6, 1280,1309.6, 1280.4,1309.6, 1280.8,1307.6, 1281.6,1306.4, 1281.6,1307.2, 1280.8,1309.6, 1280.8,1310, 1281.2,1312.4, 1283.6,1314.8, 1284,1317.2, 1284.8,1317.6, 1285.2,1319.2, 1286.8,1319.6, 1286.8,1320.4, 1286.4,1321.6, 1286,1321.6, 1286.4,1322, 1286,1323.2, 1284.4,1324, 1284.4,1324.4, 1283.2,1326, 1284,1326.8, 1283.6,1328.4, 1283.2,1330.8, 1283.6,1331.2, 1284.8,1332.4, 1285.6,1330.8, 1288.8,1330.8, 1286.8,1332, 1285.2,1333.2, 1284.4,1334.4, 1284.8,1333.2, 1285.2,1332.8, 1284.8,1332.8, 1284,1332.8, 1283.6,1334.4, 1284.8,1335.6, 1284,1335.2, 1284,1336, 1283.6,1336.4, 1283.2,1335.6, 1284,1334.8, 1283.6,1333.2, 1282.8,1333.2, 1283.2,1332.8, 1282,1330, 1281.2,1330, 1281.2,1331.2, 1280.8,1332.8, 1280.8,1330.8, 1279.6,1331.2, 1279.6,1332.8, 1279.6,1332.8, 1279.2,1330.8, 1278.8,1330.8, 1279.2,1329.2, 1277.6,1330, 1277.2,1330.8, 1277.6,1333.2, 1278.4,1334.8, 1279.6,1335.6, 1279.6,1336, 1281.2,1336.8, 1281.6,1338, 1283.2,1339.6, 1282,1338.8, 1281.2,1338.8, 1280.8,1337.2, 1278.8,1336, 1277.2,1333.2, 1276.4,1333.2, 1276,1333.2, 1276,1332, 1276.4,1331.2, 1276.4,1330, 1278,1328.4, 1277.6,1327.6, 1276.8,1327.2, 1276,1326, 1275.6,1324.8, 1275.2,1323.6, 1275.6,1323.2, 1275.2,1322.8, 1275.2,1322, 1274,1319.6, 1273.6,1319.6, 1274,1319.6, 1274.8,1318.4, 1274,1317.2, 1272,1316.4, 1270.8,1316.8, 1270.8,1319.2, 1272,1319.6, 1272.4,1322, 1272,1323.2, 1272.8,1324.4, 1272.8,1325.2, 1275.6,1329.2, 1274,1328, 1272.8,1328.4, 1272.8,1329.6, 1274.4,1331.6, 1272.8,1330.8, 1272.8,1331.6, 1274.8,1334.4, 1274,1333.6, 1272.8,1331.6, 1272.4,1331.6, 1272.8,1333.2, 1273.6,1333.6, 1273.6,1334.8, 1274.4,1335.2, 1275.2,1335.2, 1274.8,1336, 1275.2,1338, 1274.4,1336, 1274,1336.4, 1274.8,1338, 1274.4,1339.2, 1274.4,1341.2, 1275.2,1341.2, 1276.4,1344, 1279.2,1343.6, 1278,1344.8, 1277.2,1344.4, 1276.8,1344.8, 1276.8,1344.4, 1276.4,1344.8, 1276.8,1345.6, 1277.6,1345.2, 1278.4,1346, 1279.2,1346.4, 1277.6,1346, 1277.2,1346.4, 1278,1348.4, 1278.4,1348.8, 1278.4,1348.8, 1279.6,1349.2, 1280.8,1349.2, 1281.6,1349.6, 1280.8,1349.2, 1279.2,1349.6, 1281.2,1352.8, 1280,1351.6, 1279.6,1351.6, 1278.8,1350, 1278,1349.6, 1277.6,1349.6, 1276,1348, 1275.2,1346, 1273.2,1345.2, 1273.2,1345.2, 1272.4,1346, 1272.4,1346, 1270.4,1346.8, 1269.6,1347.6, 1269.2,1348.8, 1270,1349.2, 1270.8,1349.2, 1272.8,1350, 1274,1349.6, 1275.2,1349.2, 1273.6,1349.6, 1272.4,1350, 1271.6,1349.6, 1270.8,1350, 1266.8,1350, 1266.4,1350.4, 1267.6,1351.6, 1269.2,1351.6, 1270,1352, 1270.8,1351.6, 1271.2,1351.2, 1271.2,1352, 1271.2,1351.6, 1272.4,1352, 1272.4,1352, 1271.6,1353.2, 1271.6,1353.6, 1272.8,1353.6, 1273.2,1353.6, 1274,1354, 1273.6,1354, 1273.2,1353.6, 1272.8,1354, 1273.2,1354.8, 1270.8,1355.2, 1271.2,1354.8, 1272,1354.8, 1271.6,1355.2, 1272,1357.2, 1273.2,1357.6, 1273.2,1357.2, 1274,1356.4, 1276,1356.8, 1274.8,1356.8, 1274,1357.2, 1274,1357.6, 1274,1358.4, 1272.8,1358.8, 1272.8,1359.2, 1273.6,1360, 1274.4,1360, 1276,1358.8, 1277.2,1359.6, 1275.6,1359.2, 1275.6,1360, 1274.4,1361.2, 1274,1361.6, 1274.8,1361.6, 1274.8,1362.4, 1274.8,1362.8, 1274.8,1363.6, 1276,1363.6, 1276.4,1363.6, 1277.6,1362.4, 1278,1362.8, 1277.2,1362.8, 1276.4,1364, 1274,1364, 1273.6,1364, 1274.4,1365.2, 1276.4,1366.4, 1277.2,1367.6, 1276,1366.4, 1275.2,1365.2, 1274.8,1366.4, 1275.2,1366.4, 1275.2,1366.8, 1273.2,1365.6, 1272.4,1365.6, 1272.4,1366.8, 1272.8,1367.2, 1272.4,1367.2, 1272.8,1367.6, 1272,1368, 1272,1369.2, 1272.8,1370.8, 1273.2,1370.8, 1273.6,1370, 1274,1370.4, 1274.8,1369.2, 1274.8,1369.6, 1275.2,1369.2, 1276.4,1370, 1275.6,1370, 1274.8,1370.4, 1274.4,1370.8, 1274.4,1370.8, 1274,1371.6, 1274,1372.4, 1272.8,1372.4, 1273.2,1374.4, 1274.4,1374.4, 1274.4,1374.4, 1273.6,1374.4, 1272.8,1375.2, 1273.2,1376, 1272.8,1377.6, 1274.4,1378, 1274.8,1377.6, 1274.8,1376, 1275.2,1375.2, 1275.6,1376, 1276,1376, 1276,1377.6, 1275.2,1378, 1275.6,1379.6, 1276,1379.2, 1276.4,1379.6, 1276.4,1378, 1277.6,1378, 1278,1379.2, 1280.8,1377.6, 1280.4,1378, 1278.8,1379.6, 1278.4,1380, 1278.8,1380, 1279.6,1378.8, 1280.4,1379.2, 1281.6,1378, 1282.4,1377.2, 1282.4,1377.6, 1280.8,1379.2, 1281.2,1379.6, 1281.2,1379.6, 1280,1380.4, 1279.2,1381.2, 1278.4,1382.4, 1278.4,1382.4, 1278,1382.8, 1278,1383.6, 1279.2,1382.8, 1279.2,1382.8, 1280.4,1382.8, 1280.8,1382.8, 1280,1384, 1280.4,1384, 1280,1384.4, 1280.4,1384.4, 1280,1384.8, 1280,1384.8, 1279.2,1385.6, 1279.6,1385.6, 1278.8,1386.8, 1278.8,1387.6, 1280,1386, 1281.2,1387.2, 1281.6,1386.4, 1282.4,1387.2, 1284.4,1386.4, 1284,1386.8, 1284.4,1387.2, 1283.2,1387.2, 1282,1388, 1282.4,1388.4, 1282,1388.4, 1281.6,1388.8, 1282.4,1390.4, 1283.6,1390, 1283.2,1390.4, 1282.8,1390.8, 1283.2,1390.8, 1282.8,1391.2, 1283.6,1391.6, 1284.4,1391.2, 1284,1392, 1282.4,1392.8, 1282.4,1393.2, 1283.6,1393.6 }; void make_gb_poly(agg::path_storage& ps) { ps.remove_all(); unsigned i; const double* p = poly1; ps.move_to(p[0], p[1]); p += 2; for(i = 1; i < sizeof(poly1) / sizeof(double) / 2; i++) { ps.line_to(p[0], p[1]); p += 2; } ps.close_polygon(); p = poly2; ps.move_to(p[0], p[1]); p += 2; for(i = 1; i < sizeof(poly2) / sizeof(double) / 2; i++) { ps.line_to(p[0], p[1]); p += 2; } ps.close_polygon(); } agg-2.5+dfsg1/examples/mol_view.cpp0000644000000000000000000006224210703246330017427 0ustar00usergroup00000000000000#include #include #include #include "agg_rendering_buffer.h" #include "agg_rasterizer_scanline_aa.h" #include "agg_scanline_p.h" #include "agg_renderer_scanline.h" #include "agg_conv_transform.h" #include "agg_conv_stroke.h" #include "agg_bspline.h" #include "agg_ellipse.h" #include "agg_gsv_text.h" #include "ctrl/agg_slider_ctrl.h" #include "ctrl/agg_scale_ctrl.h" #include "platform/agg_platform_support.h" #define AGG_BGR24 //#define AGG_RGB24 //#define AGG_BGRA32 //#define AGG_RGBA32 //#define AGG_ARGB32 //#define AGG_ABGR32 //#define AGG_RGB565 //#define AGG_RGB555 #include "pixel_formats.h" enum flip_y_e { flip_y = true }; enum default_num_points_e { default_num_points = 20000 }; enum start_size_e { start_width = 400, start_height = 400 }; enum atom_color_e { atom_color_general = 0, atom_color_N = 1, atom_color_O = 2, atom_color_S = 3, atom_color_P = 4, atom_color_halogen = 5, end_of_atom_colors }; struct atom_type { double x; double y; char label[4]; int charge; unsigned color_idx; }; struct bond_type { unsigned idx1; unsigned idx2; double x1; double y1; double x2; double y2; unsigned order; int stereo; int topology; }; class molecule { public: ~molecule(); molecule(); bool read(FILE* fd); unsigned num_atoms() const { return m_num_atoms; } unsigned num_bonds() const { return m_num_bonds; } const atom_type& atom(unsigned idx) const { return m_atoms[idx]; } const bond_type& bond(unsigned idx) const { return m_bonds[idx]; } double average_bond_len() const { return m_avr_len; } const char* name() const { return m_name; } static int get_int(const char* buf, int pos, int len); static double get_dbl(const char* buf, int pos, int len); static char* get_str(char* dst, const char* buf, int pos, int len); private: atom_type* m_atoms; unsigned m_num_atoms; bond_type* m_bonds; unsigned m_num_bonds; char m_name[128]; double m_avr_len; }; molecule::~molecule() { delete [] m_bonds; delete [] m_atoms; } molecule::molecule() : m_atoms(0), m_num_atoms(0), m_bonds(0), m_num_bonds(0), m_avr_len(0) { m_name[0] = 0; } int molecule::get_int(const char* buf, int pos, int len) { char tmp[32]; return atoi(get_str(tmp, buf, pos, len)); } double molecule::get_dbl(const char* buf, int pos, int len) { char tmp[32]; return atof(get_str(tmp, buf, pos, len)); } char* molecule::get_str(char* dst, const char* buf, int pos, int len) { --pos; int buf_len = strlen(buf); buf += pos; while(pos + len < buf_len && isspace(*buf)) { ++buf; --len; } if(len >= 0) { if(len > 0) memcpy(dst, buf, len); dst[len] = 0; } char* ts = dst; while(*ts && !isspace(*ts)) ts++; *ts = 0; return dst; } unsigned trim_cr_lf(char* buf) { unsigned len = strlen(buf); // Trim "\n\r" at the beginning unsigned pos = 0; while(len && (buf[0] == '\n' || buf[0] == '\r')) { --len; ++pos; } if(pos) strcpy(buf, buf + pos); // Trim "\n\r" at the end while(len && (buf[len-1] == '\n' || buf[len-1] == '\r')) --len; buf[len] = 0; return len; } /* MFCD00191150 Mt7.00 09020210442D 23 23 0 0 1 0 0 0 0 0999 V2000 -2.6793 -0.2552 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 . . . 1 2 1 0 0 0 0 . . . M END > MFCD00191150 $$$$ */ bool molecule::read(FILE* fd) { char buf[512]; unsigned len; if(!fgets(buf, 510, fd)) return false; len = trim_cr_lf(buf); if(len > 128) len = 128; if(len) memcpy(m_name, buf, len); m_name[len] = 0; if(!fgets(buf, 510, fd)) return false; if(!fgets(buf, 510, fd)) return false; if(!fgets(buf, 510, fd)) return false; trim_cr_lf(buf); m_num_atoms = get_int(buf, 1, 3); m_num_bonds = get_int(buf, 4, 3); if(m_num_atoms == 0 || m_num_bonds == 0) return false; m_atoms = new atom_type[m_num_atoms]; m_bonds = new bond_type[m_num_bonds]; memset(m_atoms, 0, sizeof(atom_type) * m_num_atoms); memset(m_bonds, 0, sizeof(bond_type) * m_num_bonds); unsigned i; for(i = 0; i < m_num_atoms; i++) { if(!fgets(buf, 510, fd)) return false; trim_cr_lf(buf); /* -2.6793 -0.2552 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 */ m_atoms[i].x = get_dbl(buf, 1, 10); m_atoms[i].y = get_dbl(buf, 11, 10); get_str(m_atoms[i].label, buf, 32, 3); m_atoms[i].charge = get_int(buf, 39, 1); if(m_atoms[i].charge) m_atoms[i].charge = 4 - m_atoms[i].charge; if(strcmp(m_atoms[i].label, "N") == 0) m_atoms[i].color_idx = atom_color_N; if(strcmp(m_atoms[i].label, "O") == 0) m_atoms[i].color_idx = atom_color_O; if(strcmp(m_atoms[i].label, "S") == 0) m_atoms[i].color_idx = atom_color_S; if(strcmp(m_atoms[i].label, "P") == 0) m_atoms[i].color_idx = atom_color_P; if(strcmp(m_atoms[i].label, "F") == 0 || strcmp(m_atoms[i].label, "Cl") == 0 || strcmp(m_atoms[i].label, "Br") == 0 || strcmp(m_atoms[i].label, "I") == 0) m_atoms[i].color_idx = atom_color_halogen; } m_avr_len = 0.0; for(i = 0; i < m_num_bonds; i++) { if(!fgets(buf, 510, fd)) return false; trim_cr_lf(buf); /* 1 2 1 0 0 0 0 */ m_bonds[i].idx1 = get_int(buf, 1, 3) - 1; m_bonds[i].idx2 = get_int(buf, 4, 3) - 1; if(m_bonds[i].idx1 >= m_num_atoms || m_bonds[i].idx2 >= m_num_atoms) return false; m_bonds[i].x1 = m_atoms[m_bonds[i].idx1].x; m_bonds[i].y1 = m_atoms[m_bonds[i].idx1].y; m_bonds[i].x2 = m_atoms[m_bonds[i].idx2].x; m_bonds[i].y2 = m_atoms[m_bonds[i].idx2].y; m_bonds[i].order = get_int(buf, 7, 3); m_bonds[i].stereo = get_int(buf, 10, 3); m_bonds[i].topology = get_int(buf, 13, 3); m_avr_len += sqrt((m_bonds[i].x1 - m_bonds[i].x2) * (m_bonds[i].x1 - m_bonds[i].x2) + (m_bonds[i].y1 - m_bonds[i].y2) * (m_bonds[i].y1 - m_bonds[i].y2)); } m_avr_len /= double(m_num_bonds); while(fgets(buf, 510, fd)) { trim_cr_lf(buf); if(buf[0] == '$') return true; } return false; } namespace agg { class line { public: line() : m_x1(0.0), m_y1(0.0), m_x2(1.0), m_y2(0.0), m_thickness(0.1) { } line(double x1, double y1, double x2, double y2, double thickness) : m_x1(x1), m_y1(y1), m_x2(x2), m_y2(y2), m_thickness(thickness) { } void init(double x1, double y1, double x2, double y2) { m_x1 = x1; m_y1 = y1; m_x2 = x2; m_y2 = y2; } void thickness(double th) { m_thickness = th; } void rewind(unsigned start); unsigned vertex(double* x, double* y); private: double m_x1; double m_y1; double m_x2; double m_y2; double m_dx; double m_dy; double m_thickness; unsigned m_vertex; }; inline void line::rewind(unsigned) { calc_orthogonal(m_thickness*0.5, m_x1, m_y1, m_x2, m_y2, &m_dx, &m_dy); m_vertex = 0; } inline unsigned line::vertex(double* x, double* y) { switch(m_vertex) { case 0: *x = m_x1 - m_dx; *y = m_y1 - m_dy; m_vertex++; return path_cmd_move_to; case 1: *x = m_x2 - m_dx; *y = m_y2 - m_dy; m_vertex++; return path_cmd_line_to; case 2: *x = m_x2 + m_dx; *y = m_y2 + m_dy; m_vertex++; return path_cmd_line_to; case 3: *x = m_x1 + m_dx; *y = m_y1 + m_dy; m_vertex++; return path_cmd_line_to; } return path_cmd_stop; } class solid_wedge { public: solid_wedge() : m_x1(0.0), m_y1(0.0), m_x2(1.0), m_y2(0.0), m_thickness(0.1) { } solid_wedge(double x1, double y1, double x2, double y2, double thickness) : m_x1(x1), m_y1(y1), m_x2(x2), m_y2(y2), m_thickness(thickness) { } void init(double x1, double y1, double x2, double y2) { m_x1 = x1; m_y1 = y1; m_x2 = x2; m_y2 = y2; } void thickness(double th) { m_thickness = th; } void rewind(unsigned start); unsigned vertex(double* x, double* y); private: double m_x1; double m_y1; double m_x2; double m_y2; double m_dx; double m_dy; double m_thickness; unsigned m_vertex; }; inline void solid_wedge::rewind(unsigned) { calc_orthogonal(m_thickness*2.0, m_x1, m_y1, m_x2, m_y2, &m_dx, &m_dy); m_vertex = 0; } inline unsigned solid_wedge::vertex(double* x, double* y) { switch(m_vertex) { case 0: *x = m_x1; *y = m_y1; m_vertex++; return path_cmd_move_to; case 1: *x = m_x2 - m_dx; *y = m_y2 - m_dy; m_vertex++; return path_cmd_line_to; case 2: *x = m_x2 + m_dx; *y = m_y2 + m_dy; m_vertex++; return path_cmd_line_to; } return path_cmd_stop; } class dashed_wedge { public: dashed_wedge() : m_x1(0.0), m_y1(0.0), m_x2(1.0), m_y2(0.0), m_thickness(0.1), m_num_dashes(8) { } dashed_wedge(double x1, double y1, double x2, double y2, double thickness, unsigned num_dashes=8) : m_x1(x2), m_y1(y2), m_x2(x1), m_y2(y1), m_thickness(thickness), m_num_dashes(num_dashes) { } void init(double x1, double y1, double x2, double y2) { m_x1 = x2; m_y1 = y2; m_x2 = x1; m_y2 = y1; } void num_dashes(unsigned nd) { m_num_dashes = nd; } void thickness(double th) { m_thickness = th; } void rewind(unsigned start); unsigned vertex(double* x, double* y); private: double m_x1; double m_y1; double m_x2; double m_y2; double m_xt2; double m_yt2; double m_xt3; double m_yt3; double m_xd[4]; double m_yd[4]; double m_thickness; unsigned m_num_dashes; unsigned m_vertex; }; void dashed_wedge::rewind(unsigned) { double dx; double dy; calc_orthogonal(m_thickness*2.0, m_x1, m_y1, m_x2, m_y2, &dx, &dy); m_xt2 = m_x2 - dx; m_yt2 = m_y2 - dy; m_xt3 = m_x2 + dx; m_yt3 = m_y2 + dy; m_vertex = 0; } unsigned dashed_wedge::vertex(double* x, double* y) { if(m_vertex < m_num_dashes * 4) { if((m_vertex % 4) == 0) { double k1 = double(m_vertex / 4) / double(m_num_dashes); double k2 = k1 + 0.4 / double(m_num_dashes); m_xd[0] = m_x1 + (m_xt2 - m_x1) * k1; m_yd[0] = m_y1 + (m_yt2 - m_y1) * k1; m_xd[1] = m_x1 + (m_xt2 - m_x1) * k2; m_yd[1] = m_y1 + (m_yt2 - m_y1) * k2; m_xd[2] = m_x1 + (m_xt3 - m_x1) * k2; m_yd[2] = m_y1 + (m_yt3 - m_y1) * k2; m_xd[3] = m_x1 + (m_xt3 - m_x1) * k1; m_yd[3] = m_y1 + (m_yt3 - m_y1) * k1; *x = m_xd[0]; *y = m_yd[0]; m_vertex++; return path_cmd_move_to; } else { *x = m_xd[m_vertex % 4]; *y = m_yd[m_vertex % 4]; m_vertex++; return path_cmd_line_to; } } return path_cmd_stop; } } class bond_vertex_generator { enum bond_style_e { bond_single, bond_wedged_solid, bond_wedged_dashed, bond_double, bond_double_left, bond_double_right, bond_triple }; public: bond_vertex_generator(const bond_type& bond, double thickness) : m_bond(bond), m_thickness(thickness), m_style(bond_single) { if(bond.order == 1) { if(bond.stereo == 1) m_style = bond_wedged_solid; if(bond.stereo == 6) m_style = bond_wedged_dashed; } if(bond.order == 2) { m_style = bond_double; if(bond.topology == 1) m_style = bond_double_left; if(bond.topology == 2) m_style = bond_double_right; } if(bond.order == 3) m_style = bond_triple; m_line1.thickness(thickness); m_line2.thickness(thickness); m_line3.thickness(thickness); m_solid_wedge.thickness(thickness); m_dashed_wedge.thickness(thickness); } void rewind(unsigned) { double dx, dy, dx1, dy1, dx2, dy2; switch(m_style) { case bond_wedged_solid: m_solid_wedge.init(m_bond.x1, m_bond.y1, m_bond.x2, m_bond.y2); m_solid_wedge.rewind(0); break; case bond_wedged_dashed: m_dashed_wedge.init(m_bond.x1, m_bond.y1, m_bond.x2, m_bond.y2); m_dashed_wedge.rewind(0); break; case bond_double: case bond_double_left: case bond_double_right: agg::calc_orthogonal(m_thickness, m_bond.x1, m_bond.y1, m_bond.x2, m_bond.y2, &dx, &dy); dx1 = dy1 = 0; // To Do: ring perception and the proper drawing // of the double bonds in the aromatic rings. //if(m_style == bond_double) { dx1 = dx2 = dx; dy1 = dy2 = dy; } /* else if(m_style == bond_double_left) { dx2 = dx * 2.0; dy2 = dy * 2.0; } else { dx2 = -dx * 2.0; dy2 = -dy * 2.0; } */ m_line1.init(m_bond.x1 - dx1, m_bond.y1 - dy1, m_bond.x2 - dx1, m_bond.y2 - dy1); m_line1.rewind(0); m_line2.init(m_bond.x1 + dx2, m_bond.y1 + dy2, m_bond.x2 + dx2, m_bond.y2 + dy2); m_line2.rewind(0); m_status = 0; break; case bond_triple: // To Do: triple bonds drawing. default: m_line1.init(m_bond.x1, m_bond.y1, m_bond.x2, m_bond.y2); m_line1.rewind(0); break; } } unsigned vertex(double* x, double* y) { unsigned flag = agg::path_cmd_stop; switch(m_style) { case bond_wedged_solid: return m_solid_wedge.vertex(x, y); case bond_wedged_dashed: return m_dashed_wedge.vertex(x, y); case bond_double_left: case bond_double_right: case bond_double: if(m_status == 0) { flag = m_line1.vertex(x, y); if(flag == agg::path_cmd_stop) { m_status = 1; } } if(m_status == 1) { flag = m_line2.vertex(x, y); } return flag; case bond_triple: break; } return m_line1.vertex(x, y); } private: bond_vertex_generator(const bond_vertex_generator&); const bond_vertex_generator& operator = (const bond_vertex_generator&); const bond_type& m_bond; double m_thickness; bond_style_e m_style; agg::line m_line1; agg::line m_line2; agg::line m_line3; agg::solid_wedge m_solid_wedge; agg::dashed_wedge m_dashed_wedge; unsigned m_status; }; class the_application : public agg::platform_support { molecule* m_molecules; unsigned m_num_molecules; unsigned m_cur_molecule; agg::slider_ctrl m_thickness; agg::slider_ctrl m_text_size; double m_pdx; double m_pdy; double m_center_x; double m_center_y; double m_scale; double m_prev_scale; double m_angle; double m_prev_angle; bool m_mouse_move; agg::rgba8 m_atom_colors[end_of_atom_colors]; public: virtual ~the_application() { delete [] m_molecules; } the_application(agg::pix_format_e format, bool flip_y, const char* fname) : agg::platform_support(format, flip_y), m_molecules(new molecule [100]), m_num_molecules(0), m_cur_molecule(0), m_thickness(5, 5, start_width-5, 12), m_text_size(5, 20, start_width-5, 27), m_pdx(0.0), m_pdy(0.0), m_center_x(start_width / 2), m_center_y(start_height / 2), m_scale(1.0), m_prev_scale(1.0), m_angle(0.0), m_prev_angle(0.0), m_mouse_move(false) { m_thickness.label("Thickness=%3.2f"); m_text_size.label("Label Size=%3.2f"); add_ctrl(m_thickness); add_ctrl(m_text_size); FILE* fd = fopen(full_file_name(fname), "r"); if(fd) { unsigned i; for(i = 0; i < 100; i++) { if(!m_molecules[m_num_molecules].read(fd)) break; m_num_molecules++; } fclose(fd); } else { char buf[256]; sprintf(buf, "File not found: '%s'. Download http://www.antigrain.com/%s\n", fname, fname); message(buf); } memset(m_atom_colors, 0, sizeof(agg::rgba8) * end_of_atom_colors); m_atom_colors[atom_color_general] = agg::rgba8(0,0,0); m_atom_colors[atom_color_N] = agg::rgba8(0,0,120); m_atom_colors[atom_color_O] = agg::rgba8(200,0,0); m_atom_colors[atom_color_S] = agg::rgba8(120,120,0); m_atom_colors[atom_color_P] = agg::rgba8(80,50,0); m_atom_colors[atom_color_halogen] = agg::rgba8(0,200,0); } virtual void on_init() { } virtual void on_draw() { double width = initial_width(); double height = initial_height(); agg::rasterizer_scanline_aa<> ras; agg::scanline_p8 sl; typedef agg::renderer_base renderer_base; typedef agg::renderer_scanline_aa_solid renderer_solid; pixfmt pixf(rbuf_window()); renderer_base rb(pixf); renderer_solid rs(rb); ras.clip_box(0, 0, rb.width(), rb.height()); rb.clear(agg::rgba(1,1,1)); const molecule& mol = m_molecules[m_cur_molecule]; unsigned i; double min_x = 1e100; double max_x = -1e100; double min_y = 1e100; double max_y = -1e100; for(i = 0; i < mol.num_atoms(); i++) { if(mol.atom(i).x < min_x) min_x = mol.atom(i).x; if(mol.atom(i).y < min_y) min_y = mol.atom(i).y; if(mol.atom(i).x > max_x) max_x = mol.atom(i).x; if(mol.atom(i).y > max_y) max_y = mol.atom(i).y; } agg::trans_affine mtx; mtx *= agg::trans_affine_translation(-(max_x + min_x) * 0.5, -(max_y + min_y) * 0.5); double scale = width / (max_x - min_x); double t = height / (max_y - min_y); if(scale > t) scale = t; double text_size = mol.average_bond_len() * m_text_size.value() / 4.0; double thickness = mol.average_bond_len() / sqrt(m_scale < 0.0001 ? 0.0001 : m_scale) / 8.0; mtx *= agg::trans_affine_scaling(scale*0.80, scale*0.80); mtx *= agg::trans_affine_rotation(m_angle); mtx *= agg::trans_affine_scaling(m_scale, m_scale); mtx *= agg::trans_affine_translation(m_center_x, m_center_y); mtx *= trans_affine_resizing(); rs.color(agg::rgba(0,0,0)); for(i = 0; i < mol.num_bonds(); i++) { bond_vertex_generator bond(mol.bond(i), m_thickness.value() * thickness); agg::conv_transform tr(bond, mtx); ras.add_path(tr); agg::render_scanlines(ras, sl, rs); } agg::ellipse ell; agg::conv_transform tr(ell, mtx); for(i = 0; i < mol.num_atoms(); i++) { if(strcmp(mol.atom(i).label, "C") != 0) { ell.init(mol.atom(i).x, mol.atom(i).y, text_size * 2.5, text_size * 2.5, 20); ras.add_path(tr); rs.color(agg::rgba(1.0, 1.0, 1.0)); agg::render_scanlines(ras, sl, rs); } } text_size *= 3.0; agg::gsv_text label; agg::conv_stroke ls(label); agg::conv_transform > lo(ls, mtx); ls.line_join(agg::round_join); ls.line_cap(agg::round_cap); ls.approximation_scale(mtx.scale()); for(i = 0; i < mol.num_atoms(); i++) { if(strcmp(mol.atom(i).label, "C") != 0) { ls.width(m_thickness.value() * thickness); label.text(mol.atom(i).label); label.start_point(mol.atom(i).x - text_size/2, mol.atom(i).y - text_size/2); label.size(text_size); ras.add_path(lo); rs.color(m_atom_colors[mol.atom(i).color_idx]); agg::render_scanlines(ras, sl, rs); } } ls.approximation_scale(1.0); agg::conv_transform > name(ls, trans_affine_resizing()); ls.width(1.5); label.text(mol.name()); label.size(10.0); label.start_point(10.0, start_height - 20.0); ras.reset(); ras.add_path(name); rs.color(agg::rgba(0,0,0)); agg::render_scanlines(ras, sl, rs); agg::render_ctrl(ras, sl, rb, m_thickness); agg::render_ctrl(ras, sl, rb, m_text_size); } virtual void on_idle() { m_angle += agg::deg2rad(0.1); force_redraw(); } virtual void on_mouse_button_down(int x, int y, unsigned flags) { m_mouse_move = true; double x2 = x; double y2 = y; trans_affine_resizing().inverse_transform(&x2, &y2); m_pdx = m_center_x - x2; m_pdy = m_center_y - y2; m_prev_scale = m_scale; m_prev_angle = m_angle + agg::pi; force_redraw(); } virtual void on_mouse_button_up(int x, int y, unsigned flags) { m_mouse_move = false; } virtual void on_mouse_move(int x, int y, unsigned flags) { double x2 = x; double y2 = y; trans_affine_resizing().inverse_transform(&x2, &y2); if(m_mouse_move && (flags & agg::mouse_left) != 0) { double dx = x2 - m_center_x; double dy = y2 - m_center_y; m_scale = m_prev_scale * sqrt(dx * dx + dy * dy) / sqrt(m_pdx * m_pdx + m_pdy * m_pdy); m_angle = m_prev_angle + atan2(dy, dx) - atan2(m_pdy, m_pdx); force_redraw(); } if(m_mouse_move && (flags & agg::mouse_right) != 0) { m_center_x = x2 + m_pdx; m_center_y = y2 + m_pdy; force_redraw(); } } virtual void on_key(int, int, unsigned key, unsigned) { switch(key) { case agg::key_left: case agg::key_up: case agg::key_page_up: if(m_cur_molecule) --m_cur_molecule; force_redraw(); break; case agg::key_right: case agg::key_down: case agg::key_page_down: if(m_cur_molecule < m_num_molecules - 1) ++m_cur_molecule; force_redraw(); break; case ' ': wait_mode(!wait_mode()); break; } } }; int agg_main(int argc, char* argv[]) { const char* fname = "1.sdf"; if(argc > 1) { fname = argv[1]; } the_application app(pix_format, flip_y, fname); app.caption("AGG - A Simple SDF Molecular Viewer"); if(app.init(start_width, start_height, agg::window_resize)) { return app.run(); } return 1; } agg-2.5+dfsg1/examples/multi_clip.cpp0000644000000000000000000002544310703246330017751 0ustar00usergroup00000000000000#include #include #include #include "agg_basics.h" #include "agg_rendering_buffer.h" #include "agg_rasterizer_scanline_aa.h" #include "agg_scanline_u.h" #include "agg_color_gray.h" #include "agg_renderer_mclip.h" #include "agg_renderer_scanline.h" #include "agg_path_storage.h" #include "agg_conv_transform.h" #include "agg_bounding_rect.h" #include "agg_renderer_outline_aa.h" #include "agg_renderer_primitives.h" #include "agg_renderer_markers.h" #include "agg_span_allocator.h" #include "agg_span_gradient.h" #include "agg_span_interpolator_linear.h" #include "agg_rasterizer_outline_aa.h" #include "agg_ellipse.h" #include "ctrl/agg_slider_ctrl.h" #include "platform/agg_platform_support.h" //#define AGG_GRAY8 #define AGG_BGR24 //#define AGG_RGB24 //#define AGG_BGRA32 //#define AGG_RGBA32 //#define AGG_ARGB32 //#define AGG_ABGR32 //#define AGG_RGB565 //#define AGG_RGB555 #include "pixel_formats.h" enum flip_y_e { flip_y = true }; agg::rasterizer_scanline_aa<> g_rasterizer; agg::scanline_u8 g_scanline; agg::path_storage g_path; agg::rgba8 g_colors[100]; unsigned g_path_idx[100]; unsigned g_npaths = 0; double g_x1 = 0; double g_y1 = 0; double g_x2 = 0; double g_y2 = 0; double g_base_dx = 0; double g_base_dy = 0; double g_angle = 0; double g_scale = 1.0; double g_skew_x = 0; double g_skew_y = 0; int g_nclick = 0; unsigned parse_lion(agg::path_storage& ps, agg::rgba8* colors, unsigned* path_idx); void parse_lion() { g_npaths = parse_lion(g_path, g_colors, g_path_idx); agg::pod_array_adaptor path_idx(g_path_idx, 100); agg::bounding_rect(g_path, path_idx, 0, g_npaths, &g_x1, &g_y1, &g_x2, &g_y2); g_base_dx = (g_x2 - g_x1) / 2.0; g_base_dy = (g_y2 - g_y1) / 2.0; } namespace agg { // Specializations of the gradient_linear_color for rgba8 and gray8 // color types. Only for the sake of performance. //======================================================================== template<> struct gradient_linear_color { typedef rgba8 color_type; gradient_linear_color() {} gradient_linear_color(const color_type& c1, const color_type& c2) : m_c1(c1), m_c2(c2) {} static unsigned size() { return 256; } color_type operator [] (unsigned v) const { color_type c; c.r = (int8u)((((m_c2.r - m_c1.r) * int(v)) + (m_c1.r << 8)) >> 8); c.g = (int8u)((((m_c2.g - m_c1.g) * int(v)) + (m_c1.g << 8)) >> 8); c.b = (int8u)((((m_c2.b - m_c1.b) * int(v)) + (m_c1.b << 8)) >> 8); c.a = (int8u)((((m_c2.a - m_c1.a) * int(v)) + (m_c1.a << 8)) >> 8); return c; } void colors(const color_type& c1, const color_type& c2) { m_c1 = c1; m_c2 = c2; } color_type m_c1; color_type m_c2; }; //======================================================================== template<> struct gradient_linear_color { typedef gray8 color_type; gradient_linear_color() {} gradient_linear_color(const color_type& c1, const color_type& c2) : m_c1(c1), m_c2(c2) {} static unsigned size() { return 256; } color_type operator [] (unsigned v) const { color_type c; c.v = (int8u)((((m_c2.v - m_c1.v) * int(v)) + (m_c1.v << 8)) >> 8); c.a = (int8u)((((m_c2.a - m_c1.a) * int(v)) + (m_c1.a << 8)) >> 8); return c; } void colors(const color_type& c1, const color_type& c2) { m_c1 = c1; m_c2 = c2; } color_type m_c1; color_type m_c2; }; } class the_application : public agg::platform_support { agg::slider_ctrl m_num_cb; public: the_application(agg::pix_format_e format, bool flip_y) : agg::platform_support(format, flip_y), m_num_cb(5, 5, 150, 12, !flip_y) { parse_lion(); add_ctrl(m_num_cb); m_num_cb.range(2, 10); //m_num_cb.num_steps(8); m_num_cb.label("N=%.2f"); m_num_cb.no_transform(); } virtual void on_draw() { unsigned i; int width = rbuf_window().width(); int height = rbuf_window().height(); pixfmt pf(rbuf_window()); typedef agg::renderer_mclip base_ren_type; base_ren_type r(pf); agg::renderer_scanline_aa_solid rs(r); agg::trans_affine mtx; mtx *= agg::trans_affine_translation(-g_base_dx, -g_base_dy); mtx *= agg::trans_affine_scaling(g_scale, g_scale); mtx *= agg::trans_affine_rotation(g_angle + agg::pi); mtx *= agg::trans_affine_skewing(g_skew_x/1000.0, g_skew_y/1000.0); mtx *= agg::trans_affine_translation(width/2, height/2); r.clear(agg::rgba(1, 1, 1)); r.reset_clipping(false); // Visibility: "false" means "no visible regions" int x, y; double n = m_num_cb.value(); for(x = 0; x < n; x++) { for(y = 0; y < n; y++) { int x1 = int(width * x / n); int y1 = int(height * y / n); int x2 = int(width * (x + 1) / n); int y2 = int(height * (y + 1) / n); r.add_clip_box(x1 + 5, y1 + 5, x2 - 5, y2 - 5); } } // Render the lion agg::conv_transform trans(g_path, mtx); agg::render_all_paths(g_rasterizer, g_scanline, rs, trans, g_colors, g_path_idx, g_npaths); // The scanline rasterizer allows you to perform clipping to multiple // regions "manually", like in the following code, but the "embedded" method // shows much better performance. // //for(i = 0; i < g_npaths; i++) //{ // g_rasterizer.reset(); // g_rasterizer.add_path(trans, g_path_idx[i]); // rs.color(g_colors[i]); // // int x, y; // double n = m_num_cb.value(); // for(x = 0; x < n; x++) // { // for(y = 0; y < n; y++) // { // int x1 = int(width * x / n); // int y1 = int(height * y / n); // int x2 = int(width * (x + 1) / n); // int y2 = int(height * (y + 1) / n); // // r should be of type renderer_base<> // r.clip_box(agg::rect_i(x1 + 5, y1 + 5, x2 - 5, y2 - 5)); // agg::render_scanlines(g_rasterizer, g_scanline, rs); // } // } //} // Render random Bresenham lines and markers agg::renderer_markers m(r); for(i = 0; i < 50; i++) { m.line_color(agg::rgba8(rand() & 0x7F, rand() & 0x7F, rand() & 0x7F, (rand() & 0x7F) + 0x7F)); m.fill_color(agg::rgba8(rand() & 0x7F, rand() & 0x7F, rand() & 0x7F, (rand() & 0x7F) + 0x7F)); m.line(m.coord(rand() % width), m.coord(rand() % height), m.coord(rand() % width), m.coord(rand() % height)); m.marker(rand() % width, rand() % height, rand() % 10 + 5, agg::marker_e(rand() % agg::end_of_markers)); } // Render random anti-aliased lines double w = 5.0; agg::line_profile_aa profile; profile.width(w); typedef agg::renderer_outline_aa renderer_type; renderer_type ren(r, profile); typedef agg::rasterizer_outline_aa rasterizer_type; rasterizer_type ras(ren); ras.round_cap(true); for(i = 0; i < 50; i++) { ren.color(agg::rgba8(rand() & 0x7F, rand() & 0x7F, rand() & 0x7F, (rand() & 0x7F) + 0x7F)); ras.move_to_d(rand() % width, rand() % height); ras.line_to_d(rand() % width, rand() % height); ras.render(false); } // Render random circles with gradient typedef agg::gradient_linear_color grad_color; typedef agg::gradient_circle grad_func; typedef agg::span_interpolator_linear<> interpolator_type; typedef agg::span_gradient span_grad_type; agg::trans_affine grm; grad_func grf; grad_color grc(agg::rgba8(0,0,0), agg::rgba8(0,0,0)); agg::ellipse ell; agg::span_allocator sa; interpolator_type inter(grm); span_grad_type sg(inter, grf, grc, 0, 10); for(i = 0; i < 50; i++) { x = rand() % width; y = rand() % height; double radius = rand() % 10 + 5; grm.reset(); grm *= agg::trans_affine_scaling(radius / 10.0); grm *= agg::trans_affine_translation(x, y); grm.invert(); grc.colors(agg::rgba8(255, 255, 255, 0), agg::rgba8(rand() & 0x7F, rand() & 0x7F, rand() & 0x7F, 255)); sg.color_function(grc); ell.init(x, y, radius, radius, 32); g_rasterizer.add_path(ell); agg::render_scanlines_aa(g_rasterizer, g_scanline, r, sa, sg); } r.reset_clipping(true); // "true" means "all rendering buffer is visible". agg::render_ctrl(g_rasterizer, g_scanline, r, m_num_cb); } void transform(double width, double height, double x, double y) { x -= width / 2; y -= height / 2; g_angle = atan2(y, x); g_scale = sqrt(y * y + x * x) / 100.0; } virtual void on_mouse_button_down(int x, int y, unsigned flags) { if(flags & agg::mouse_left) { int width = rbuf_window().width(); int height = rbuf_window().height(); transform(width, height, x, y); force_redraw(); } if(flags & agg::mouse_right) { g_skew_x = x; g_skew_y = y; force_redraw(); } } virtual void on_mouse_move(int x, int y, unsigned flags) { on_mouse_button_down(x, y, flags); } }; int agg_main(int argc, char* argv[]) { the_application app(pix_format, flip_y); app.caption("AGG Example. Clipping to multiple rectangle regions"); if(app.init(512, 400, agg::window_resize)) { return app.run(); } return 1; } agg-2.5+dfsg1/examples/parse_lion.cpp0000644000000000000000000005677510703246330017757 0ustar00usergroup00000000000000#include #include #include #include "agg_color_rgba.h" #include "agg_path_storage.h" #include "agg_bounding_rect.h" static char g_lion[] = "f2cc99\n" "M 69,18 L 82,8 L 99,3 L 118,5 L 135,12 L 149,21 L 156,13 L 165,9 L 177,13 L 183,28 L 180,50 L 164,91 L 155,107 L 154,114 L 151,121 L 141,127 L 139,136 L 155,206 L 157,251 L 126,342 L 133,357 L 128,376 L 83,376 L 75,368 L 67,350 L 61,350 L 53,369 L 4,369 L 2,361 L 5,354 L 12,342 L 16,321 L 4,257 L 4,244 L 7,218 L 9,179 L 26,127 L 43,93 L 32,77 L 30,70 L 24,67 L 16,49 L 17,35 L 18,23 L 30,12 L 40,7 L 53,7 L 62,12 L 69,18 L 69,18 L 69,18\n" "e5b27f\n" "M 142,79 L 136,74 L 138,82 L 133,78 L 133,84 L 127,78 L 128,85 L 124,80 L 125,87 L 119,82 L 119,90 L 125,99 L 125,96 L 128,100 L 128,94 L 131,98 L 132,93 L 135,97 L 136,93 L 138,97 L 139,94 L 141,98 L 143,94 L 144,85 L 142,79 L 142,79 L 142,79\n" "eb8080\n" "M 127,101 L 132,100 L 137,99 L 144,101 L 143,105 L 135,110 L 127,101 L 127,101 L 127,101\n" "f2cc99\n" "M 178,229 L 157,248 L 139,296 L 126,349 L 137,356 L 158,357 L 183,342 L 212,332 L 235,288 L 235,261 L 228,252 L 212,250 L 188,251 L 178,229 L 178,229 L 178,229\n" "9c826b\n" "M 56,229 L 48,241 L 48,250 L 57,281 L 63,325 L 71,338 L 81,315 L 76,321 L 79,311 L 83,301 L 75,308 L 80,298 L 73,303 L 76,296 L 71,298 L 74,292 L 69,293 L 74,284 L 78,278 L 71,278 L 74,274 L 68,273 L 70,268 L 66,267 L 68,261 L 60,266 L 62,259 L 65,253 L 57,258 L 59,251 L 55,254 L 55,248 L 60,237 L 54,240 L 58,234 L 54,236 L 56,229 L 56,229 L 56,229\n" "M 74,363 L 79,368 L 81,368 L 85,362 L 89,363 L 92,370 L 96,373 L 101,372 L 108,361 L 110,371 L 113,373 L 116,371 L 120,358 L 122,363 L 123,371 L 126,371 L 129,367 L 132,357 L 135,361 L 130,376 L 127,377 L 94,378 L 84,376 L 76,371 L 74,363 L 74,363 L 74,363\n" "M 212,250 L 219,251 L 228,258 L 236,270 L 235,287 L 225,304 L 205,332 L 177,343 L 171,352 L 158,357 L 166,352 L 168,346 L 168,339 L 165,333 L 155,327 L 155,323 L 161,320 L 165,316 L 169,316 L 167,312 L 171,313 L 168,308 L 173,309 L 170,306 L 177,306 L 175,308 L 177,311 L 174,311 L 176,316 L 171,315 L 174,319 L 168,320 L 168,323 L 175,327 L 179,332 L 183,326 L 184,332 L 189,323 L 190,328 L 194,320 L 194,325 L 199,316 L 201,320 L 204,313 L 206,316 L 208,310 L 211,305 L 219,298 L 226,288 L 229,279 L 228,266 L 224,259 L 217,253 L 212,250 L 212,250 L 212,250\n" "M 151,205 L 151,238 L 149,252 L 141,268 L 128,282 L 121,301 L 130,300 L 126,313 L 118,324 L 116,337 L 120,346 L 133,352 L 133,340 L 137,333 L 145,329 L 156,327 L 153,319 L 153,291 L 157,271 L 170,259 L 178,277 L 193,250 L 174,216 L 151,205 L 151,205 L 151,205\n" "M 78,127 L 90,142 L 95,155 L 108,164 L 125,167 L 139,175 L 150,206 L 152,191 L 141,140 L 121,148 L 100,136 L 78,127 L 78,127 L 78,127\n" "M 21,58 L 35,63 L 38,68 L 32,69 L 42,74 L 40,79 L 47,80 L 54,83 L 45,94 L 34,81 L 32,73 L 24,66 L 21,58 L 21,58 L 21,58\n" "M 71,34 L 67,34 L 66,27 L 59,24 L 54,17 L 48,17 L 39,22 L 30,26 L 28,31 L 31,39 L 38,46 L 29,45 L 36,54 L 41,61 L 41,70 L 50,69 L 54,71 L 55,58 L 67,52 L 76,43 L 76,39 L 68,44 L 71,34 L 71,34 L 71,34\n" "M 139,74 L 141,83 L 143,89 L 144,104 L 148,104 L 155,106 L 154,86 L 157,77 L 155,72 L 150,77 L 144,77 L 139,74 L 139,74 L 139,74\n" "M 105,44 L 102,53 L 108,58 L 111,62 L 112,55 L 105,44 L 105,44 L 105,44\n" "M 141,48 L 141,54 L 144,58 L 139,62 L 137,66 L 136,59 L 137,52 L 141,48 L 141,48 L 141,48\n" "M 98,135 L 104,130 L 105,134 L 108,132 L 108,135 L 112,134 L 113,137 L 116,136 L 116,139 L 119,139 L 124,141 L 128,140 L 133,138 L 140,133 L 139,140 L 126,146 L 104,144 L 98,135 L 98,135 L 98,135\n" "M 97,116 L 103,119 L 103,116 L 111,118 L 116,117 L 122,114 L 127,107 L 135,111 L 142,107 L 141,114 L 145,118 L 149,121 L 145,125 L 140,124 L 127,121 L 113,125 L 100,124 L 97,116 L 97,116 L 97,116\n" "M 147,33 L 152,35 L 157,34 L 153,31 L 160,31 L 156,28 L 161,28 L 159,24 L 163,25 L 163,21 L 165,22 L 170,23 L 167,17 L 172,21 L 174,18 L 175,23 L 176,22 L 177,28 L 177,33 L 174,37 L 176,39 L 174,44 L 171,49 L 168,53 L 164,57 L 159,68 L 156,70 L 154,60 L 150,51 L 146,43 L 144,35 L 147,33 L 147,33 L 147,33\n" "M 85,72 L 89,74 L 93,75 L 100,76 L 105,75 L 102,79 L 94,79 L 88,76 L 85,72 L 85,72 L 85,72\n" "M 86,214 L 79,221 L 76,232 L 82,225 L 78,239 L 82,234 L 78,245 L 81,243 L 79,255 L 84,250 L 84,267 L 87,254 L 90,271 L 90,257 L 95,271 L 93,256 L 95,249 L 92,252 L 93,243 L 89,253 L 89,241 L 86,250 L 87,236 L 83,245 L 87,231 L 82,231 L 90,219 L 84,221 L 86,214 L 86,214 L 86,214\n" "ffcc7f\n" "M 93,68 L 96,72 L 100,73 L 106,72 L 108,66 L 105,63 L 100,62 L 93,68 L 93,68 L 93,68\n" "M 144,64 L 142,68 L 142,73 L 146,74 L 150,73 L 154,64 L 149,62 L 144,64 L 144,64 L 144,64\n" "9c826b\n" "M 57,91 L 42,111 L 52,105 L 41,117 L 53,112 L 46,120 L 53,116 L 50,124 L 57,119 L 55,127 L 61,122 L 60,130 L 67,126 L 66,134 L 71,129 L 72,136 L 77,130 L 76,137 L 80,133 L 82,138 L 86,135 L 96,135 L 94,129 L 86,124 L 83,117 L 77,123 L 79,117 L 73,120 L 75,112 L 68,116 L 71,111 L 65,114 L 69,107 L 63,110 L 68,102 L 61,107 L 66,98 L 61,103 L 63,97 L 57,99 L 57,91 L 57,91 L 57,91\n" "M 83,79 L 76,79 L 67,82 L 75,83 L 65,88 L 76,87 L 65,92 L 76,91 L 68,96 L 77,95 L 70,99 L 80,98 L 72,104 L 80,102 L 76,108 L 85,103 L 92,101 L 87,98 L 93,96 L 86,94 L 91,93 L 85,91 L 93,89 L 99,89 L 105,93 L 107,85 L 102,82 L 92,80 L 83,79 L 83,79 L 83,79\n" "M 109,77 L 111,83 L 109,89 L 113,94 L 117,90 L 117,81 L 114,78 L 109,77 L 109,77 L 109,77\n" "M 122,128 L 127,126 L 134,127 L 136,129 L 134,130 L 130,128 L 124,129 L 122,128 L 122,128 L 122,128\n" "M 78,27 L 82,32 L 80,33 L 82,36 L 78,37 L 82,40 L 78,42 L 81,46 L 76,47 L 78,49 L 74,50 L 82,52 L 87,50 L 83,48 L 91,46 L 86,45 L 91,42 L 88,40 L 92,37 L 86,34 L 90,31 L 86,29 L 89,26 L 78,27 L 78,27 L 78,27\n" "M 82,17 L 92,20 L 79,21 L 90,25 L 81,25 L 94,28 L 93,26 L 101,30 L 101,26 L 107,33 L 108,28 L 111,40 L 113,34 L 115,45 L 117,39 L 119,54 L 121,46 L 124,58 L 126,47 L 129,59 L 130,49 L 134,58 L 133,44 L 137,48 L 133,37 L 137,40 L 133,32 L 126,20 L 135,26 L 132,19 L 138,23 L 135,17 L 142,18 L 132,11 L 116,6 L 94,6 L 78,11 L 92,12 L 80,14 L 90,16 L 82,17 L 82,17 L 82,17\n" "M 142,234 L 132,227 L 124,223 L 115,220 L 110,225 L 118,224 L 127,229 L 135,236 L 122,234 L 115,237 L 113,242 L 121,238 L 139,243 L 121,245 L 111,254 L 95,254 L 102,244 L 104,235 L 110,229 L 100,231 L 104,224 L 113,216 L 122,215 L 132,217 L 141,224 L 145,230 L 149,240 L 142,234 L 142,234 L 142,234\n" "M 115,252 L 125,248 L 137,249 L 143,258 L 134,255 L 125,254 L 115,252 L 115,252 L 115,252\n" "M 114,212 L 130,213 L 140,219 L 147,225 L 144,214 L 137,209 L 128,207 L 114,212 L 114,212 L 114,212\n" "M 102,263 L 108,258 L 117,257 L 131,258 L 116,260 L 109,265 L 102,263 L 102,263 L 102,263\n" "M 51,241 L 35,224 L 40,238 L 23,224 L 31,242 L 19,239 L 28,247 L 17,246 L 25,250 L 37,254 L 39,263 L 44,271 L 47,294 L 48,317 L 51,328 L 60,351 L 60,323 L 53,262 L 47,246 L 51,241 L 51,241 L 51,241\n" "M 2,364 L 9,367 L 14,366 L 18,355 L 20,364 L 26,366 L 31,357 L 35,364 L 39,364 L 42,357 L 47,363 L 53,360 L 59,357 L 54,369 L 7,373 L 2,364 L 2,364 L 2,364\n" "M 7,349 L 19,345 L 25,339 L 18,341 L 23,333 L 28,326 L 23,326 L 27,320 L 23,316 L 25,311 L 20,298 L 15,277 L 12,264 L 9,249 L 10,223 L 3,248 L 5,261 L 15,307 L 17,326 L 11,343 L 7,349 L 7,349 L 7,349\n" "M 11,226 L 15,231 L 25,236 L 18,227 L 11,226 L 11,226 L 11,226\n" "M 13,214 L 19,217 L 32,227 L 23,214 L 16,208 L 15,190 L 24,148 L 31,121 L 24,137 L 14,170 L 8,189 L 13,214 L 13,214 L 13,214\n" "M 202,254 L 195,258 L 199,260 L 193,263 L 197,263 L 190,268 L 196,268 L 191,273 L 188,282 L 200,272 L 194,272 L 201,266 L 197,265 L 204,262 L 200,258 L 204,256 L 202,254 L 202,254 L 202,254\n" "845433\n" "M 151,213 L 165,212 L 179,225 L 189,246 L 187,262 L 179,275 L 176,263 L 177,247 L 171,233 L 163,230 L 165,251 L 157,264 L 146,298 L 145,321 L 133,326 L 143,285 L 154,260 L 153,240 L 151,213 L 151,213 L 151,213\n" "M 91,132 L 95,145 L 97,154 L 104,148 L 107,155 L 109,150 L 111,158 L 115,152 L 118,159 L 120,153 L 125,161 L 126,155 L 133,164 L 132,154 L 137,163 L 137,152 L 142,163 L 147,186 L 152,192 L 148,167 L 141,143 L 124,145 L 105,143 L 91,132 L 91,132 L 91,132\n" "9c826b\n" "M 31,57 L 23,52 L 26,51 L 20,44 L 23,42 L 21,36 L 22,29 L 25,23 L 24,32 L 30,43 L 26,41 L 30,50 L 26,48 L 31,57 L 31,57 L 31,57\n" "M 147,21 L 149,28 L 155,21 L 161,16 L 167,14 L 175,15 L 173,11 L 161,9 L 147,21 L 147,21 L 147,21\n" "M 181,39 L 175,51 L 169,57 L 171,65 L 165,68 L 165,75 L 160,76 L 162,91 L 171,71 L 180,51 L 181,39 L 181,39 L 181,39\n" "M 132,346 L 139,348 L 141,346 L 142,341 L 147,342 L 143,355 L 133,350 L 132,346 L 132,346 L 132,346\n" "M 146,355 L 151,352 L 155,348 L 157,343 L 160,349 L 151,356 L 147,357 L 146,355 L 146,355 L 146,355\n" "M 99,266 L 100,281 L 94,305 L 86,322 L 78,332 L 72,346 L 73,331 L 91,291 L 99,266 L 99,266 L 99,266\n" "M 20,347 L 32,342 L 45,340 L 54,345 L 45,350 L 42,353 L 38,350 L 31,353 L 29,356 L 23,350 L 19,353 L 15,349 L 20,347 L 20,347 L 20,347\n" "M 78,344 L 86,344 L 92,349 L 88,358 L 84,352 L 78,344 L 78,344 L 78,344\n" "M 93,347 L 104,344 L 117,345 L 124,354 L 121,357 L 116,351 L 112,351 L 108,355 L 102,351 L 93,347 L 93,347 L 93,347\n" "000000\n" "M 105,12 L 111,18 L 113,24 L 113,29 L 119,34 L 116,23 L 112,16 L 105,12 L 105,12 L 105,12\n" "M 122,27 L 125,34 L 127,43 L 128,34 L 125,29 L 122,27 L 122,27 L 122,27\n" "M 115,13 L 122,19 L 122,15 L 113,10 L 115,13 L 115,13 L 115,13\n" "ffe5b2\n" "M 116,172 L 107,182 L 98,193 L 98,183 L 90,199 L 89,189 L 84,207 L 88,206 L 87,215 L 95,206 L 93,219 L 91,230 L 98,216 L 97,226 L 104,214 L 112,209 L 104,208 L 113,202 L 126,200 L 139,207 L 132,198 L 142,203 L 134,192 L 142,195 L 134,187 L 140,185 L 130,181 L 136,177 L 126,177 L 125,171 L 116,180 L 116,172 L 116,172 L 116,172\n" "M 74,220 L 67,230 L 67,221 L 59,235 L 63,233 L 60,248 L 70,232 L 65,249 L 71,243 L 67,256 L 73,250 L 69,262 L 73,259 L 71,267 L 76,262 L 72,271 L 78,270 L 76,275 L 82,274 L 78,290 L 86,279 L 86,289 L 92,274 L 88,275 L 87,264 L 82,270 L 82,258 L 77,257 L 78,247 L 73,246 L 77,233 L 72,236 L 74,220 L 74,220 L 74,220\n" "M 133,230 L 147,242 L 148,250 L 145,254 L 138,247 L 129,246 L 142,245 L 138,241 L 128,237 L 137,238 L 133,230 L 133,230 L 133,230\n" "M 133,261 L 125,261 L 116,263 L 111,267 L 125,265 L 133,261 L 133,261 L 133,261\n" "M 121,271 L 109,273 L 103,279 L 99,305 L 92,316 L 85,327 L 83,335 L 89,340 L 97,341 L 94,336 L 101,336 L 96,331 L 103,330 L 97,327 L 108,325 L 99,322 L 109,321 L 100,318 L 110,317 L 105,314 L 110,312 L 107,310 L 113,308 L 105,306 L 114,303 L 105,301 L 115,298 L 107,295 L 115,294 L 108,293 L 117,291 L 109,289 L 117,286 L 109,286 L 118,283 L 112,281 L 118,279 L 114,278 L 119,276 L 115,274 L 121,271 L 121,271 L 121,271\n" "M 79,364 L 74,359 L 74,353 L 76,347 L 80,351 L 83,356 L 82,360 L 79,364 L 79,364 L 79,364\n" "M 91,363 L 93,356 L 97,353 L 103,355 L 105,360 L 103,366 L 99,371 L 94,368 L 91,363 L 91,363 L 91,363\n" "M 110,355 L 114,353 L 118,357 L 117,363 L 113,369 L 111,362 L 110,355 L 110,355 L 110,355\n" "M 126,354 L 123,358 L 124,367 L 126,369 L 129,361 L 129,357 L 126,354 L 126,354 L 126,354\n" "M 30,154 L 24,166 L 20,182 L 23,194 L 29,208 L 37,218 L 41,210 L 41,223 L 46,214 L 46,227 L 52,216 L 52,227 L 61,216 L 59,225 L 68,213 L 73,219 L 70,207 L 77,212 L 69,200 L 77,202 L 70,194 L 78,197 L 68,187 L 76,182 L 64,182 L 58,175 L 58,185 L 53,177 L 50,186 L 46,171 L 44,182 L 39,167 L 36,172 L 36,162 L 30,166 L 30,154 L 30,154 L 30,154\n" "M 44,130 L 41,137 L 45,136 L 43,150 L 48,142 L 48,157 L 53,150 L 52,164 L 60,156 L 61,169 L 64,165 L 66,175 L 70,167 L 74,176 L 77,168 L 80,183 L 85,172 L 90,182 L 93,174 L 98,181 L 99,173 L 104,175 L 105,169 L 114,168 L 102,163 L 95,157 L 94,166 L 90,154 L 87,162 L 82,149 L 75,159 L 72,148 L 68,155 L 67,143 L 62,148 L 62,138 L 58,145 L 56,133 L 52,142 L 52,128 L 49,134 L 47,125 L 44,130 L 44,130 L 44,130\n" "M 13,216 L 19,219 L 36,231 L 22,223 L 16,222 L 22,227 L 12,224 L 13,220 L 16,220 L 13,216 L 13,216 L 13,216\n" "M 10,231 L 14,236 L 25,239 L 27,237 L 19,234 L 10,231 L 10,231 L 10,231\n" "M 9,245 L 14,242 L 25,245 L 13,245 L 9,245 L 9,245 L 9,245\n" "M 33,255 L 26,253 L 18,254 L 25,256 L 18,258 L 27,260 L 18,263 L 27,265 L 19,267 L 29,270 L 21,272 L 29,276 L 21,278 L 30,281 L 22,283 L 31,287 L 24,288 L 32,292 L 23,293 L 34,298 L 26,299 L 37,303 L 32,305 L 39,309 L 33,309 L 39,314 L 34,314 L 40,318 L 34,317 L 40,321 L 34,321 L 41,326 L 33,326 L 40,330 L 33,332 L 39,333 L 33,337 L 42,337 L 54,341 L 49,337 L 52,335 L 47,330 L 50,330 L 45,325 L 49,325 L 45,321 L 48,321 L 45,316 L 46,306 L 45,286 L 43,274 L 36,261 L 33,255 L 33,255 L 33,255\n" "M 7,358 L 9,351 L 14,351 L 17,359 L 11,364 L 7,358 L 7,358 L 7,358\n" "M 44,354 L 49,351 L 52,355 L 49,361 L 44,354 L 44,354 L 44,354\n" "M 32,357 L 37,353 L 40,358 L 36,361 L 32,357 L 32,357 L 32,357\n" "M 139,334 L 145,330 L 154,330 L 158,334 L 154,341 L 152,348 L 145,350 L 149,340 L 147,336 L 141,339 L 139,345 L 136,342 L 136,339 L 139,334 L 139,334 L 139,334\n" "M 208,259 L 215,259 L 212,255 L 220,259 L 224,263 L 225,274 L 224,283 L 220,292 L 208,300 L 206,308 L 203,304 L 199,315 L 197,309 L 195,318 L 193,313 L 190,322 L 190,316 L 185,325 L 182,318 L 180,325 L 172,321 L 178,320 L 176,313 L 186,312 L 180,307 L 188,307 L 184,303 L 191,302 L 186,299 L 195,294 L 187,290 L 197,288 L 192,286 L 201,283 L 194,280 L 203,277 L 198,275 L 207,271 L 200,269 L 209,265 L 204,265 L 212,262 L 208,259 L 208,259 L 208,259\n" "M 106,126 L 106,131 L 109,132 L 111,134 L 115,132 L 115,135 L 119,133 L 118,137 L 123,137 L 128,137 L 133,134 L 136,130 L 136,127 L 132,124 L 118,128 L 112,128 L 106,126 L 106,126 L 106,126\n" "M 107,114 L 101,110 L 98,102 L 105,97 L 111,98 L 119,102 L 121,108 L 118,112 L 113,115 L 107,114 L 107,114 L 107,114\n" "M 148,106 L 145,110 L 146,116 L 150,118 L 152,111 L 151,107 L 148,106 L 148,106 L 148,106\n" "M 80,55 L 70,52 L 75,58 L 63,57 L 72,61 L 57,61 L 67,66 L 57,67 L 62,69 L 54,71 L 61,73 L 54,77 L 63,78 L 53,85 L 60,84 L 56,90 L 69,84 L 63,82 L 75,76 L 70,75 L 77,72 L 72,71 L 78,69 L 72,66 L 81,67 L 78,64 L 82,63 L 80,60 L 86,62 L 80,55 L 80,55 L 80,55\n" "M 87,56 L 91,52 L 96,50 L 102,56 L 98,56 L 92,60 L 87,56 L 87,56 L 87,56\n" "M 85,68 L 89,73 L 98,76 L 106,74 L 96,73 L 91,70 L 85,68 L 85,68 L 85,68\n" "M 115,57 L 114,64 L 111,64 L 115,75 L 122,81 L 122,74 L 126,79 L 126,74 L 131,78 L 130,72 L 133,77 L 131,68 L 126,61 L 119,57 L 115,57 L 115,57 L 115,57\n" "M 145,48 L 143,53 L 147,59 L 151,59 L 150,55 L 145,48 L 145,48 L 145,48\n" "M 26,22 L 34,15 L 43,10 L 52,10 L 59,16 L 47,15 L 32,22 L 26,22 L 26,22 L 26,22\n" "M 160,19 L 152,26 L 149,34 L 154,33 L 152,30 L 157,30 L 155,26 L 158,27 L 157,23 L 161,23 L 160,19 L 160,19 L 160,19\n" "000000\n" "M 98,117 L 105,122 L 109,122 L 105,117 L 113,120 L 121,120 L 130,112 L 128,108 L 123,103 L 123,99 L 128,101 L 132,106 L 135,109 L 142,105 L 142,101 L 145,101 L 145,91 L 148,101 L 145,105 L 136,112 L 135,116 L 143,124 L 148,120 L 150,122 L 142,128 L 133,122 L 121,125 L 112,126 L 103,125 L 100,129 L 96,124 L 98,117 L 98,117 L 98,117\n" "M 146,118 L 152,118 L 152,115 L 149,115 L 146,118 L 146,118 L 146,118\n" "M 148,112 L 154,111 L 154,109 L 149,109 L 148,112 L 148,112 L 148,112\n" "M 106,112 L 108,115 L 114,116 L 118,114 L 106,112 L 106,112 L 106,112\n" "M 108,108 L 111,110 L 116,110 L 119,108 L 108,108 L 108,108 L 108,108\n" "M 106,104 L 109,105 L 117,106 L 115,104 L 106,104 L 106,104 L 106,104\n" "M 50,25 L 41,26 L 34,33 L 39,43 L 49,58 L 36,51 L 47,68 L 55,69 L 54,59 L 61,57 L 74,46 L 60,52 L 67,42 L 57,48 L 61,40 L 54,45 L 60,36 L 59,29 L 48,38 L 52,30 L 47,32 L 50,25 L 50,25 L 50,25\n" "M 147,34 L 152,41 L 155,49 L 161,53 L 157,47 L 164,47 L 158,43 L 168,44 L 159,40 L 164,37 L 169,37 L 164,33 L 169,34 L 165,28 L 170,30 L 170,25 L 173,29 L 175,27 L 176,32 L 173,36 L 175,39 L 172,42 L 172,46 L 168,49 L 170,55 L 162,57 L 158,63 L 155,58 L 153,50 L 149,46 L 147,34 L 147,34 L 147,34\n" "M 155,71 L 159,80 L 157,93 L 157,102 L 155,108 L 150,101 L 149,93 L 154,101 L 152,91 L 151,83 L 155,79 L 155,71 L 155,71 L 155,71\n" "M 112,78 L 115,81 L 114,91 L 112,87 L 113,82 L 112,78 L 112,78 L 112,78\n" "M 78,28 L 64,17 L 58,11 L 47,9 L 36,10 L 28,16 L 21,26 L 18,41 L 20,51 L 23,61 L 33,65 L 28,68 L 37,74 L 36,81 L 43,87 L 48,90 L 43,100 L 40,98 L 39,90 L 31,80 L 30,72 L 22,71 L 17,61 L 14,46 L 16,28 L 23,17 L 33,9 L 45,6 L 54,6 L 65,12 L 78,28 L 78,28 L 78,28\n" "M 67,18 L 76,9 L 87,5 L 101,2 L 118,3 L 135,8 L 149,20 L 149,26 L 144,19 L 132,12 L 121,9 L 105,7 L 89,8 L 76,14 L 70,20 L 67,18 L 67,18 L 67,18\n" "M 56,98 L 48,106 L 56,103 L 47,112 L 56,110 L 52,115 L 57,113 L 52,121 L 62,115 L 58,123 L 65,119 L 63,125 L 69,121 L 68,127 L 74,125 L 74,129 L 79,128 L 83,132 L 94,135 L 93,129 L 85,127 L 81,122 L 76,126 L 75,121 L 71,124 L 71,117 L 66,121 L 66,117 L 62,117 L 64,112 L 60,113 L 60,110 L 57,111 L 61,105 L 57,107 L 60,101 L 55,102 L 56,98 L 56,98 L 56,98\n" "M 101,132 L 103,138 L 106,134 L 106,139 L 112,136 L 111,142 L 115,139 L 114,143 L 119,142 L 125,145 L 131,142 L 135,138 L 140,134 L 140,129 L 143,135 L 145,149 L 150,171 L 149,184 L 145,165 L 141,150 L 136,147 L 132,151 L 131,149 L 126,152 L 125,150 L 121,152 L 117,148 L 111,152 L 110,148 L 105,149 L 104,145 L 98,150 L 96,138 L 94,132 L 94,130 L 98,132 L 101,132 L 101,132 L 101,132\n" "M 41,94 L 32,110 L 23,132 L 12,163 L 6,190 L 7,217 L 5,236 L 3,247 L 9,230 L 12,211 L 12,185 L 18,160 L 26,134 L 35,110 L 43,99 L 41,94 L 41,94 L 41,94\n" "M 32,246 L 41,250 L 50,257 L 52,267 L 53,295 L 53,323 L 59,350 L 54,363 L 51,365 L 44,366 L 42,360 L 40,372 L 54,372 L 59,366 L 62,353 L 71,352 L 75,335 L 73,330 L 66,318 L 68,302 L 64,294 L 67,288 L 63,286 L 63,279 L 59,275 L 58,267 L 56,262 L 50,247 L 42,235 L 44,246 L 32,236 L 35,244 L 32,246 L 32,246 L 32,246\n" "M 134,324 L 146,320 L 159,322 L 173,327 L 179,337 L 179,349 L 172,355 L 158,357 L 170,350 L 174,343 L 170,333 L 163,328 L 152,326 L 134,329 L 134,324 L 134,324 L 134,324\n" "M 173,339 L 183,334 L 184,338 L 191,329 L 194,332 L 199,323 L 202,325 L 206,318 L 209,320 L 213,309 L 221,303 L 228,296 L 232,289 L 234,279 L 233,269 L 230,262 L 225,256 L 219,253 L 208,252 L 198,252 L 210,249 L 223,250 L 232,257 L 237,265 L 238,277 L 238,291 L 232,305 L 221,323 L 218,335 L 212,342 L 200,349 L 178,348 L 173,339 L 173,339 L 173,339\n" "M 165,296 L 158,301 L 156,310 L 156,323 L 162,324 L 159,318 L 162,308 L 162,304 L 165,296 L 165,296 L 165,296\n" "M 99,252 L 105,244 L 107,234 L 115,228 L 121,228 L 131,235 L 122,233 L 113,235 L 109,246 L 121,239 L 133,243 L 121,243 L 110,251 L 99,252 L 99,252 L 99,252\n" "M 117,252 L 124,247 L 134,249 L 136,253 L 126,252 L 117,252 L 117,252 L 117,252\n" "M 117,218 L 132,224 L 144,233 L 140,225 L 132,219 L 117,218 L 117,218 L 117,218\n" "M 122,212 L 134,214 L 143,221 L 141,213 L 132,210 L 122,212 L 122,212 L 122,212\n" "M 69,352 L 70,363 L 76,373 L 86,378 L 97,379 L 108,379 L 120,377 L 128,378 L 132,373 L 135,361 L 133,358 L 132,366 L 127,375 L 121,374 L 121,362 L 119,367 L 117,374 L 110,376 L 110,362 L 107,357 L 106,371 L 104,375 L 97,376 L 90,375 L 90,368 L 86,362 L 83,364 L 86,369 L 85,373 L 78,370 L 73,362 L 71,351 L 69,352 L 69,352 L 69,352\n" "M 100,360 L 96,363 L 99,369 L 102,364 L 100,360 L 100,360 L 100,360\n" "M 115,360 L 112,363 L 114,369 L 117,364 L 115,360 L 115,360 L 115,360\n" "M 127,362 L 125,364 L 126,369 L 128,365 L 127,362 L 127,362 L 127,362\n" "M 5,255 L 7,276 L 11,304 L 15,320 L 13,334 L 6,348 L 2,353 L 0,363 L 5,372 L 12,374 L 25,372 L 38,372 L 44,369 L 42,367 L 36,368 L 31,369 L 30,360 L 27,368 L 20,370 L 16,361 L 15,368 L 10,369 L 3,366 L 3,359 L 6,352 L 11,348 L 17,331 L 19,316 L 12,291 L 9,274 L 5,255 L 5,255 L 5,255\n" "M 10,358 L 7,362 L 10,366 L 11,362 L 10,358 L 10,358 L 10,358\n" "M 25,357 L 22,360 L 24,366 L 27,360 L 25,357 L 25,357 L 25,357\n" "M 37,357 L 34,361 L 36,365 L 38,361 L 37,357 L 37,357 L 37,357\n" "M 49,356 L 46,359 L 47,364 L 50,360 L 49,356 L 49,356 L 49,356\n" "M 130,101 L 132,102 L 135,101 L 139,102 L 143,103 L 142,101 L 137,100 L 133,100 L 130,101 L 130,101 L 130,101\n" "M 106,48 L 105,52 L 108,56 L 109,52 L 106,48 L 106,48 L 106,48\n" "M 139,52 L 139,56 L 140,60 L 142,58 L 141,56 L 139,52 L 139,52 L 139,52\n" "M 25,349 L 29,351 L 30,355 L 33,350 L 37,348 L 42,351 L 45,347 L 49,345 L 44,343 L 36,345 L 25,349 L 25,349 L 25,349\n" "M 98,347 L 105,351 L 107,354 L 109,349 L 115,349 L 120,353 L 118,349 L 113,346 L 104,346 L 98,347 L 98,347 L 98,347\n" "M 83,348 L 87,352 L 87,357 L 89,351 L 87,348 L 83,348 L 83,348 L 83,348\n" "M 155,107 L 163,107 L 170,107 L 186,108 L 175,109 L 155,109 L 155,107 L 155,107 L 155,107\n" "M 153,114 L 162,113 L 175,112 L 192,114 L 173,114 L 154,115 L 153,114 L 153,114 L 153,114\n" "M 152,118 L 164,120 L 180,123 L 197,129 L 169,123 L 151,120 L 152,118 L 152,118 L 152,118\n" "M 68,109 L 87,106 L 107,106 L 106,108 L 88,108 L 68,109 L 68,109 L 68,109\n" "M 105,111 L 95,112 L 79,114 L 71,116 L 85,115 L 102,113 L 105,111 L 105,111 L 105,111\n" "M 108,101 L 98,99 L 87,99 L 78,99 L 93,100 L 105,102 L 108,101 L 108,101 L 108,101\n" "M 85,63 L 91,63 L 97,60 L 104,60 L 108,62 L 111,69 L 112,75 L 110,74 L 108,71 L 103,73 L 106,69 L 105,65 L 103,64 L 103,67 L 102,70 L 99,70 L 97,66 L 94,67 L 97,72 L 88,67 L 84,66 L 85,63 L 85,63 L 85,63\n" "M 140,74 L 141,66 L 144,61 L 150,61 L 156,62 L 153,70 L 150,73 L 152,65 L 150,65 L 151,68 L 149,71 L 146,71 L 144,66 L 143,70 L 143,74 L 140,74 L 140,74 L 140,74\n" "M 146,20 L 156,11 L 163,9 L 172,9 L 178,14 L 182,18 L 184,32 L 182,42 L 182,52 L 177,58 L 176,67 L 171,76 L 165,90 L 157,105 L 160,92 L 164,85 L 168,78 L 167,73 L 173,66 L 172,62 L 175,59 L 174,55 L 177,53 L 180,46 L 181,29 L 179,21 L 173,13 L 166,11 L 159,13 L 153,18 L 148,23 L 146,20 L 146,20 L 146,20\n" "M 150,187 L 148,211 L 150,233 L 153,247 L 148,267 L 135,283 L 125,299 L 136,292 L 131,313 L 122,328 L 122,345 L 129,352 L 133,359 L 133,367 L 137,359 L 148,356 L 140,350 L 131,347 L 129,340 L 132,332 L 140,328 L 137,322 L 140,304 L 154,265 L 157,244 L 155,223 L 161,220 L 175,229 L 186,247 L 185,260 L 176,275 L 178,287 L 185,277 L 188,261 L 196,253 L 189,236 L 174,213 L 150,187 L 150,187 L 150,187\n" "M 147,338 L 142,341 L 143,345 L 141,354 L 147,343 L 147,338 L 147,338 L 147,338\n" "M 157,342 L 156,349 L 150,356 L 157,353 L 163,346 L 162,342 L 157,342 L 157,342 L 157,342\n" "M 99,265 L 96,284 L 92,299 L 73,339 L 73,333 L 87,300 L 99,265 L 99,265 L 99,265\n"; unsigned parse_lion(agg::path_storage& path, agg::rgba8* colors, unsigned* path_idx) { // Parse the lion and then detect its bounding // box and arrange polygons orientations (make all polygons // oriented clockwise or counterclockwise) const char* ptr = g_lion; unsigned npaths = 0; while(*ptr) { if(*ptr != 'M' && isalnum(*ptr)) { unsigned c = 0; sscanf(ptr, "%x", &c); // New color. Every new color creates new path in the path object. path.close_polygon(); colors[npaths] = agg::rgb8_packed(c); path_idx[npaths] = path.start_new_path(); npaths++; while(*ptr && *ptr != '\n') ptr++; if(*ptr == '\n') ptr++; } else { double x = 0.0; double y = 0.0; while(*ptr && *ptr != '\n') { int c = *ptr; while(*ptr && !isdigit(*ptr)) ptr++; x = atof(ptr); while(*ptr && isdigit(*ptr)) ptr++; while(*ptr && !isdigit(*ptr)) ptr++; y = atof(ptr); if(c == 'M') { path.close_polygon(); path.move_to(x, y); } else { path.line_to(x, y); } while(*ptr && isdigit(*ptr)) ptr++; while(*ptr && *ptr != '\n' && !isalpha(*ptr)) ptr++; } if(*ptr == '\n') ptr++; } } path.arrange_orientations_all_paths(agg::path_flags_cw); return npaths; } agg-2.5+dfsg1/examples/pattern_fill.cpp0000644000000000000000000002647410703246330020300 0ustar00usergroup00000000000000#include #include #include #include "agg_rendering_buffer.h" #include "agg_rasterizer_scanline_aa.h" #include "agg_path_storage.h" #include "agg_trans_affine.h" #include "agg_conv_transform.h" #include "agg_conv_smooth_poly1.h" #include "agg_scanline_p.h" #include "agg_renderer_scanline.h" #include "agg_span_allocator.h" #include "agg_span_pattern_gray.h" #include "agg_span_pattern_rgb.h" #include "agg_span_pattern_rgba.h" #include "agg_image_accessors.h" #include "ctrl/agg_slider_ctrl.h" #include "ctrl/agg_rbox_ctrl.h" #include "ctrl/agg_cbox_ctrl.h" #include "platform/agg_platform_support.h" enum flip_y_e { flip_y = true }; //#define AGG_GRAY8 //#define AGG_BGR24 //#define AGG_RGB24 #define AGG_BGRA32 //#define AGG_RGBA32 //#define AGG_ARGB32 //#define AGG_ABGR32 //#define AGG_RGB565 //#define AGG_RGB555 #include "pixel_formats.h" class the_application : public agg::platform_support { agg::slider_ctrl m_polygon_angle; agg::slider_ctrl m_polygon_scale; agg::slider_ctrl m_pattern_angle; agg::slider_ctrl m_pattern_size; agg::slider_ctrl m_pattern_alpha; agg::cbox_ctrl m_rotate_polygon; agg::cbox_ctrl m_rotate_pattern; agg::cbox_ctrl m_tie_pattern; double m_polygon_cx; double m_polygon_cy; double m_dx; double m_dy; int m_flag; agg::int8u* m_pattern; agg::rendering_buffer m_pattern_rbuf; agg::rasterizer_scanline_aa<> m_ras; agg::scanline_p8 m_sl; agg::path_storage m_ps; public: //------------------------------------------------------------------------ the_application(agg::pix_format_e format, bool flip_y) : agg::platform_support(format, flip_y), m_polygon_angle(5, 5, 145, 12, !flip_y), m_polygon_scale(5, 5+14, 145, 12+14, !flip_y), m_pattern_angle(155, 5, 300, 12, !flip_y), m_pattern_size (155, 5+14, 300, 12+14, !flip_y), m_pattern_alpha(310, 5, 460, 12, !flip_y), m_rotate_polygon(5, 5+14+14, "Rotate Polygon", !flip_y), m_rotate_pattern(5, 5+14+14+14, "Rotate Pattern", !flip_y), m_tie_pattern (155, 5+14+14, "Tie pattern to polygon", !flip_y), m_flag(0), m_pattern(0) { add_ctrl(m_polygon_angle); add_ctrl(m_polygon_scale); add_ctrl(m_pattern_angle); add_ctrl(m_pattern_size); add_ctrl(m_pattern_alpha); add_ctrl(m_rotate_polygon); add_ctrl(m_rotate_pattern); add_ctrl(m_tie_pattern); m_polygon_angle.label("Polygon Angle=%3.2f"); m_polygon_angle.range(-180.0, 180.0); m_polygon_scale.label("Polygon Scale=%3.2f"); m_polygon_scale.range(0.1, 5.0); m_polygon_scale.value(1.0); m_pattern_angle.label("Pattern Angle=%3.2f"); m_pattern_angle.range(-180.0, 180.0); m_pattern_size.label("Pattern Size=%3.2f"); m_pattern_size.range(10, 40); m_pattern_size.value(30); m_pattern_alpha.label("Background Alpha=%.2f"); m_pattern_alpha.value(0.1); } //------------------------------------------------------------------------ virtual ~the_application() { delete [] m_pattern; } //------------------------------------------------------------------------ void create_star(double xc, double yc, double r1, double r2, unsigned n, double start_angle = 0.0) { m_ps.remove_all(); unsigned i; start_angle *= agg::pi / 180.0; for(i = 0; i < n; i++) { double a = agg::pi * 2.0 * i / n - agg::pi / 2.0; double dx = cos(a + start_angle); double dy = sin(a + start_angle); if(i & 1) { m_ps.line_to(xc + dx * r1, yc + dy * r1); } else { if(i) m_ps.line_to(xc + dx * r2, yc + dy * r2); else m_ps.move_to(xc + dx * r2, yc + dy * r2); } } m_ps.close_polygon(); } //------------------------------------------------------------------------ void generate_pattern() { unsigned size = unsigned(m_pattern_size.value()); create_star(m_pattern_size.value() / 2.0, m_pattern_size.value() / 2.0, m_pattern_size.value() / 2.5, m_pattern_size.value() / 6.0, 6, m_pattern_angle.value()); agg::conv_smooth_poly1_curve smooth(m_ps); agg::conv_stroke > stroke(smooth); smooth.smooth_value(1.0); smooth.approximation_scale(4.0); stroke.width(m_pattern_size.value() / 15.0); delete [] m_pattern; m_pattern = new agg::int8u[size * size * 4]; m_pattern_rbuf.attach(m_pattern, size, size, size*4); pixfmt pixf(m_pattern_rbuf); agg::renderer_base rb(pixf); agg::renderer_scanline_aa_solid > rs(rb); rb.clear(agg::rgba_pre(0.4, 0.0, 0.1, m_pattern_alpha.value())); // Pattern background color m_ras.add_path(smooth); rs.color(agg::rgba8(110,130,50)); agg::render_scanlines(m_ras, m_sl, rs); m_ras.add_path(stroke); rs.color(agg::rgba8(0,50,80)); agg::render_scanlines(m_ras, m_sl, rs); } //------------------------------------------------------------------------ virtual void on_init() { m_polygon_cx = initial_width() / 2.0; m_polygon_cy = initial_height() / 2.0; generate_pattern(); } //------------------------------------------------------------------------ virtual void on_draw() { double width = rbuf_window().width(); double height = rbuf_window().height(); typedef agg::renderer_base renderer_base; typedef agg::renderer_base renderer_base_pre; pixfmt pixf(rbuf_window()); pixfmt_pre pixf_pre(rbuf_window()); renderer_base rb(pixf); renderer_base_pre rb_pre(pixf_pre); rb.clear(agg::rgba(1.0, 1.0, 1.0)); agg::trans_affine polygon_mtx; polygon_mtx *= agg::trans_affine_translation(-m_polygon_cx, -m_polygon_cy); polygon_mtx *= agg::trans_affine_rotation(m_polygon_angle.value() * agg::pi / 180.0); polygon_mtx *= agg::trans_affine_scaling(m_polygon_scale.value()); polygon_mtx *= agg::trans_affine_translation(m_polygon_cx, m_polygon_cy); double r = initial_width() / 3.0 - 8.0; create_star(m_polygon_cx, m_polygon_cy, r, r / 1.45, 14); agg::conv_transform tr(m_ps, polygon_mtx); typedef agg::wrap_mode_reflect_auto_pow2 wrap_x_type; typedef agg::wrap_mode_reflect_auto_pow2 wrap_y_type; typedef agg::image_accessor_wrap img_source_type; typedef agg::span_pattern_rgba span_gen_type; unsigned offset_x = 0; unsigned offset_y = 0; if(m_tie_pattern.status()) { offset_x = unsigned(width-m_polygon_cx); offset_y = unsigned(height-m_polygon_cy); } agg::span_allocator sa; pixfmt img_pixf(m_pattern_rbuf); img_source_type img_src(img_pixf); span_gen_type sg(img_src, offset_x, offset_y); // Alpha is meaningful for RGB only because RGBA has its own sg.alpha(span_gen_type::value_type(m_pattern_alpha.value() * 255.0)); m_ras.add_path(tr); agg::render_scanlines_aa(m_ras, m_sl, rb_pre, sa, sg); agg::render_ctrl(m_ras, m_sl, rb, m_polygon_angle); agg::render_ctrl(m_ras, m_sl, rb, m_polygon_scale); agg::render_ctrl(m_ras, m_sl, rb, m_pattern_angle); agg::render_ctrl(m_ras, m_sl, rb, m_pattern_size); agg::render_ctrl(m_ras, m_sl, rb, m_pattern_alpha); agg::render_ctrl(m_ras, m_sl, rb, m_rotate_polygon); agg::render_ctrl(m_ras, m_sl, rb, m_rotate_pattern); agg::render_ctrl(m_ras, m_sl, rb, m_tie_pattern); } //------------------------------------------------------------------------ virtual void on_mouse_button_down(int x, int y, unsigned flags) { if(flags & agg::mouse_left) { agg::trans_affine polygon_mtx; polygon_mtx *= agg::trans_affine_translation(-m_polygon_cx, -m_polygon_cy); polygon_mtx *= agg::trans_affine_rotation(m_polygon_angle.value() * agg::pi / 180.0); polygon_mtx *= agg::trans_affine_scaling(m_polygon_scale.value(), m_polygon_scale.value()); polygon_mtx *= agg::trans_affine_translation(m_polygon_cx, m_polygon_cy); double r = initial_width() / 3.0 - 8.0; create_star(m_polygon_cx, m_polygon_cy, r, r / 1.45, 14); agg::conv_transform tr(m_ps, polygon_mtx); m_ras.add_path(tr); if(m_ras.hit_test(x, y)) { m_dx = x - m_polygon_cx; m_dy = y - m_polygon_cy; m_flag = 1; } } } //------------------------------------------------------------------------ virtual void on_mouse_move(int x, int y, unsigned flags) { if(flags & agg::mouse_left) { if(m_flag) { m_polygon_cx = x - m_dx; m_polygon_cy = y - m_dy; force_redraw(); } } else { on_mouse_button_up(x, y, flags); } } //------------------------------------------------------------------------ virtual void on_mouse_button_up(int x, int y, unsigned flags) { m_flag = 0; } //------------------------------------------------------------------------ virtual void on_ctrl_change() { if(m_rotate_polygon.status() || m_rotate_pattern.status()) { wait_mode(false); } else { wait_mode(true); } generate_pattern(); force_redraw(); } //------------------------------------------------------------------------ virtual void on_idle() { bool redraw = false; if(m_rotate_polygon.status()) { m_polygon_angle.value(m_polygon_angle.value() + 0.5); if(m_polygon_angle.value() >= 180.0) { m_polygon_angle.value(m_polygon_angle.value() - 360.0); } redraw = true; } if(m_rotate_pattern.status()) { m_pattern_angle.value(m_pattern_angle.value() - 0.5); if(m_pattern_angle.value() <= -180.0) { m_pattern_angle.value(m_pattern_angle.value() + 360.0); } generate_pattern(); redraw = true; } if(redraw) force_redraw(); } }; int agg_main(int argc, char* argv[]) { the_application app(pix_format, flip_y); app.caption("AGG Example: Pattern Filling"); if(app.init(640, 480, 0)) { return app.run(); } return 0; } agg-2.5+dfsg1/examples/pattern_perspective.cpp0000644000000000000000000002240410703246330021670 0ustar00usergroup00000000000000#include #include #include #include "agg_basics.h" #include "agg_rendering_buffer.h" #include "agg_rasterizer_scanline_aa.h" #include "agg_scanline_u.h" #include "agg_renderer_scanline.h" #include "agg_path_storage.h" #include "agg_conv_transform.h" #include "agg_trans_affine.h" #include "agg_trans_bilinear.h" #include "agg_trans_perspective.h" #include "agg_span_interpolator_linear.h" #include "agg_span_interpolator_trans.h" #include "agg_span_allocator.h" #include "agg_image_accessors.h" #include "ctrl/agg_rbox_ctrl.h" #include "platform/agg_platform_support.h" #include "interactive_polygon.h" #include "agg_pixfmt_rgb.h" #include "agg_span_image_filter_rgb.h" #define span_image_filter_2x2 agg::span_image_filter_rgb_2x2 #define span_image_filter_nn agg::span_image_filter_rgb_nn #define pix_format agg::pix_format_bgr24 typedef agg::pixfmt_bgr24 pixfmt; typedef agg::pixfmt_bgr24_pre pixfmt_pre; typedef pixfmt::color_type color_type; enum flip_y_e { flip_y = true }; agg::rasterizer_scanline_aa<> g_rasterizer; agg::scanline_u8 g_scanline; double g_x1 = 0; double g_y1 = 0; double g_x2 = 0; double g_y2 = 0; class the_application : public agg::platform_support { public: typedef agg::renderer_base renderer_base; typedef agg::renderer_scanline_aa_solid renderer_solid; typedef agg::renderer_base renderer_base_pre; agg::interactive_polygon m_quad; agg::rbox_ctrl m_trans_type; bool m_test_flag; the_application(agg::pix_format_e format, bool flip_y) : agg::platform_support(format, flip_y), m_quad(4, 5.0), m_trans_type(460, 5.0, 420+170.0, 60.0, !flip_y), m_test_flag(false) { m_trans_type.text_size(8); m_trans_type.text_thickness(1); m_trans_type.add_item("Affine"); m_trans_type.add_item("Bilinear"); m_trans_type.add_item("Perspective"); m_trans_type.cur_item(2); add_ctrl(m_trans_type); } virtual void on_init() { g_x1 = -150; g_y1 = -150; g_x2 = 150; g_y2 = 150; double trans_x1 = -200; double trans_y1 = -200; double trans_x2 = 200; double trans_y2 = 200; double dx = width() / 2.0 - (trans_x2 + trans_x1) / 2.0; double dy = height() / 2.0 - (trans_y2 + trans_y1) / 2.0; m_quad.xn(0) = floor(trans_x1 + dx); m_quad.yn(0) = floor(trans_y1 + dy); m_quad.xn(1) = floor(trans_x2 + dx); m_quad.yn(1) = floor(trans_y1 + dy); m_quad.xn(2) = floor(trans_x2 + dx); m_quad.yn(2) = floor(trans_y2 + dy); m_quad.xn(3) = floor(trans_x1 + dx); m_quad.yn(3) = floor(trans_y2 + dy); } virtual void on_draw() { pixfmt pixf(rbuf_window()); pixfmt_pre pixf_pre(rbuf_window()); renderer_base rb(pixf); renderer_base_pre rb_pre(pixf_pre); if(!m_test_flag) { rb.clear(agg::rgba(1, 1, 1)); } if(m_trans_type.cur_item() == 0) { // For the affine parallelogram transformations we // calculate the 4-th (implicit) point of the parallelogram m_quad.xn(3) = m_quad.xn(0) + (m_quad.xn(2) - m_quad.xn(1)); m_quad.yn(3) = m_quad.yn(0) + (m_quad.yn(2) - m_quad.yn(1)); } if(!m_test_flag) { //-------------------------- // Render the "quad" tool and controls g_rasterizer.add_path(m_quad); agg::render_scanlines_aa_solid(g_rasterizer, g_scanline, rb, agg::rgba(0, 0.3, 0.5, 0.6)); //-------------------------- agg::render_ctrl(g_rasterizer, g_scanline, rb, m_trans_type); } // Prepare the polygon to rasterize. Here we need to fill // the destination (transformed) polygon. g_rasterizer.clip_box(0, 0, width(), height()); g_rasterizer.reset(); g_rasterizer.move_to_d(m_quad.xn(0), m_quad.yn(0)); g_rasterizer.line_to_d(m_quad.xn(1), m_quad.yn(1)); g_rasterizer.line_to_d(m_quad.xn(2), m_quad.yn(2)); g_rasterizer.line_to_d(m_quad.xn(3), m_quad.yn(3)); typedef agg::span_allocator span_alloc_type; span_alloc_type sa; agg::image_filter filter; typedef agg::wrap_mode_reflect_auto_pow2 remainder_type; typedef agg::image_accessor_wrap img_source_type; pixfmt img_pixf(rbuf_img(0)); img_source_type img_src(img_pixf); enum subdiv_shift_e { subdiv_shift = 2 }; switch(m_trans_type.cur_item()) { case 0: { // Note that we consruct an affine matrix that transforms // a parallelogram to a rectangle, i.e., it's inverted. // It's actually the same as: // tr(g_x1, g_y1, g_x2, g_y2, m_triangle.polygon()); // tr.invert(); agg::trans_affine tr(m_quad.polygon(), g_x1, g_y1, g_x2, g_y2); // Also note that we can use the linear interpolator instead of // arbitrary span_interpolator_trans. It works much faster, // but the transformations must be linear and parellel. typedef agg::span_interpolator_linear interpolator_type; interpolator_type interpolator(tr); typedef span_image_filter_2x2 span_gen_type; span_gen_type sg(img_src, interpolator, filter); agg::render_scanlines_aa(g_rasterizer, g_scanline, rb_pre, sa, sg); break; } case 1: { agg::trans_bilinear tr(m_quad.polygon(), g_x1, g_y1, g_x2, g_y2); if(tr.is_valid()) { typedef agg::span_interpolator_linear interpolator_type; interpolator_type interpolator(tr); typedef span_image_filter_2x2 span_gen_type; span_gen_type sg(img_src, interpolator, filter); agg::render_scanlines_aa(g_rasterizer, g_scanline, rb_pre, sa, sg); } break; } case 2: { agg::trans_perspective tr(m_quad.polygon(), g_x1, g_y1, g_x2, g_y2); if(tr.is_valid()) { typedef agg::span_interpolator_linear_subdiv interpolator_type; interpolator_type interpolator(tr); typedef span_image_filter_2x2 span_gen_type; span_gen_type sg(img_src, interpolator, filter); agg::render_scanlines_aa(g_rasterizer, g_scanline, rb_pre, sa, sg); } break; } } } virtual void on_mouse_button_down(int x, int y, unsigned flags) { if(flags & agg::mouse_left) { if(m_quad.on_mouse_button_down(x, y)) { force_redraw(); } else { start_timer(); m_test_flag = true; on_draw(); on_draw(); on_draw(); on_draw(); char buf[100]; sprintf(buf, "time=%.3f", elapsed_time()); m_test_flag = false; force_redraw(); message(buf); } } } virtual void on_mouse_move(int x, int y, unsigned flags) { if(flags & agg::mouse_left) { if(m_quad.on_mouse_move(x, y)) { force_redraw(); } } if((flags & agg::mouse_left) == 0) { on_mouse_button_up(x, y, flags); } } virtual void on_mouse_button_up(int x, int y, unsigned flags) { if(m_quad.on_mouse_button_up(x, y)) { force_redraw(); } } }; int agg_main(int argc, char* argv[]) { the_application app(pix_format, flip_y); app.caption("AGG Example. Pattern Perspective Transformations"); const char* img_name = "agg"; if(argc >= 2) img_name = argv[1]; if(!app.load_img(0, img_name)) { char buf[256]; if(strcmp(img_name, "agg") == 0) { sprintf(buf, "File not found: %s%s. Download http://www.antigrain.com/%s%s\n" "or copy it from another directory if available.", img_name, app.img_ext(), img_name, app.img_ext()); } else { sprintf(buf, "File not found: %s%s", img_name, app.img_ext()); } app.message(buf); return 1; } if(app.init(600, 600, agg::window_resize)) { return app.run(); } return 1; } agg-2.5+dfsg1/examples/pattern_resample.cpp0000644000000000000000000003210210703246330021143 0ustar00usergroup00000000000000#include #include #include #include "agg_rendering_buffer.h" #include "agg_rasterizer_scanline_aa.h" #include "agg_scanline_u.h" #include "agg_renderer_scanline.h" #include "agg_path_storage.h" #include "agg_conv_transform.h" #include "agg_trans_affine.h" #include "agg_span_allocator.h" #include "agg_span_interpolator_linear.h" #include "agg_span_interpolator_trans.h" #include "agg_span_interpolator_persp.h" #include "agg_span_subdiv_adaptor.h" #include "agg_image_accessors.h" #include "agg_gamma_lut.h" #include "ctrl/agg_rbox_ctrl.h" #include "ctrl/agg_slider_ctrl.h" #include "platform/agg_platform_support.h" #include "interactive_polygon.h" int global_offset = 0; enum flip_y_e { flip_y = true }; agg::rasterizer_scanline_aa<> g_rasterizer; agg::scanline_u8 g_scanline; double g_x1 = 0; double g_y1 = 0; double g_x2 = 0; double g_y2 = 0; #include "agg_pixfmt_rgb.h" #include "agg_span_image_filter_rgb.h" #define pix_format agg::pix_format_bgr24 typedef agg::pixfmt_bgr24 pixfmt; typedef agg::pixfmt_bgr24_pre pixfmt_pre; #define span_image_filter_2x2 agg::span_image_filter_rgb_2x2 #define span_image_resample_affine agg::span_image_resample_rgb_affine #define span_image_resample agg::span_image_resample_rgb typedef pixfmt::color_type color_type; typedef color_type::value_type value_type; typedef agg::renderer_base renderer_base; typedef agg::renderer_base renderer_base_pre; typedef agg::renderer_scanline_aa_solid renderer_solid; enum base_scale_e { base_shift = color_type::base_shift }; class the_application : public agg::platform_support { public: agg::gamma_lut m_gamma_lut; agg::interactive_polygon m_quad; agg::rbox_ctrl m_trans_type; agg::slider_ctrl m_gamma; agg::slider_ctrl m_blur; double m_old_gamma; the_application(agg::pix_format_e format, bool flip_y) : agg::platform_support(format, flip_y), m_gamma_lut(2.0), m_quad(4, 5.0), m_trans_type(400, 5.0, 430+170.0, 100.0, !flip_y), m_gamma(5.0, 5.0+15*0, 400-5, 10.0+15*0, !flip_y), m_blur (5.0, 5.0+15*1, 400-5, 10.0+15*1, !flip_y), m_old_gamma(2.0) { m_trans_type.text_size(7); m_trans_type.add_item("Affine No Resample"); m_trans_type.add_item("Affine Resample"); m_trans_type.add_item("Perspective No Resample LERP"); m_trans_type.add_item("Perspective No Resample Exact"); m_trans_type.add_item("Perspective Resample LERP"); m_trans_type.add_item("Perspective Resample Exact"); m_trans_type.cur_item(4); add_ctrl(m_trans_type); m_gamma.range(0.5, 3.0); m_gamma.value(2.0); m_gamma.label("Gamma=%.3f"); add_ctrl(m_gamma); m_blur.range(0.5, 2.0); m_blur.value(1.0); m_blur.label("Blur=%.3f"); add_ctrl(m_blur); } virtual void on_init() { g_x1 = -150; g_y1 = -150; g_x2 = 150; g_y2 = 150; double trans_x1 = -200; double trans_y1 = -200; double trans_x2 = 200; double trans_y2 = 200; double dx = width() / 2.0 - (trans_x2 + trans_x1) / 2.0; double dy = height() / 2.0 - (trans_y2 + trans_y1) / 2.0; m_quad.xn(0) = floor(trans_x1 + dx); m_quad.yn(0) = floor(trans_y1 + dy); m_quad.xn(1) = floor(trans_x2 + dx); m_quad.yn(1) = floor(trans_y1 + dy); m_quad.xn(2) = floor(trans_x2 + dx); m_quad.yn(2) = floor(trans_y2 + dy); m_quad.xn(3) = floor(trans_x1 + dx); m_quad.yn(3) = floor(trans_y2 + dy); pixfmt pixf(rbuf_img(0)); pixf.apply_gamma_dir(m_gamma_lut); } virtual void on_draw() { if(m_gamma.value() != m_old_gamma) { m_gamma_lut.gamma(m_gamma.value()); load_img(0, "agg"); pixfmt pixf(rbuf_img(0)); pixf.apply_gamma_dir(m_gamma_lut); m_old_gamma = m_gamma.value(); } pixfmt pixf(rbuf_window()); pixfmt_pre pixf_pre(rbuf_window()); renderer_base rb(pixf); renderer_base_pre rb_pre(pixf_pre); renderer_solid r(rb); rb.clear(agg::rgba(1, 1, 1)); if(m_trans_type.cur_item() < 2) { // For the affine parallelogram transformations we // calculate the 4-th (implicit) point of the parallelogram m_quad.xn(3) = m_quad.xn(0) + (m_quad.xn(2) - m_quad.xn(1)); m_quad.yn(3) = m_quad.yn(0) + (m_quad.yn(2) - m_quad.yn(1)); } //-------------------------- // Render the "quad" tool and controls g_rasterizer.add_path(m_quad); r.color(agg::rgba(0, 0.3, 0.5, 0.1)); agg::render_scanlines(g_rasterizer, g_scanline, r); // Prepare the polygon to rasterize. Here we need to fill // the destination (transformed) polygon. g_rasterizer.clip_box(0, 0, width(), height()); g_rasterizer.reset(); int b = 0; g_rasterizer.move_to_d(m_quad.xn(0)-b, m_quad.yn(0)-b); g_rasterizer.line_to_d(m_quad.xn(1)+b, m_quad.yn(1)-b); g_rasterizer.line_to_d(m_quad.xn(2)+b, m_quad.yn(2)+b); g_rasterizer.line_to_d(m_quad.xn(3)-b, m_quad.yn(3)+b); typedef agg::span_allocator span_alloc_type; span_alloc_type sa; agg::image_filter_hanning filter_kernel; agg::image_filter_lut filter(filter_kernel, true); typedef agg::wrap_mode_reflect_auto_pow2 wrap_type; typedef agg::image_accessor_wrap img_source_type; pixfmt img_pixf(rbuf_img(0)); img_source_type img_src(img_pixf); start_timer(); switch(m_trans_type.cur_item()) { case 0: { agg::trans_affine tr(m_quad.polygon(), g_x1, g_y1, g_x2, g_y2); typedef agg::span_interpolator_linear interpolator_type; interpolator_type interpolator(tr); typedef span_image_filter_2x2 span_gen_type; span_gen_type sg(img_src, interpolator, filter); agg::render_scanlines_aa(g_rasterizer, g_scanline, rb_pre, sa, sg); break; } case 1: { agg::trans_affine tr(m_quad.polygon(), g_x1, g_y1, g_x2, g_y2); typedef agg::span_interpolator_linear interpolator_type; typedef span_image_resample_affine span_gen_type; interpolator_type interpolator(tr); span_gen_type sg(img_src, interpolator, filter); sg.blur(m_blur.value()); agg::render_scanlines_aa(g_rasterizer, g_scanline, rb_pre, sa, sg); break; } case 2: { agg::trans_perspective tr(m_quad.polygon(), g_x1, g_y1, g_x2, g_y2); if(tr.is_valid()) { typedef agg::span_interpolator_linear_subdiv interpolator_type; interpolator_type interpolator(tr); typedef span_image_filter_2x2 span_gen_type; span_gen_type sg(img_src, interpolator, filter); agg::render_scanlines_aa(g_rasterizer, g_scanline, rb_pre, sa, sg); } break; } case 3: { agg::trans_perspective tr(m_quad.polygon(), g_x1, g_y1, g_x2, g_y2); if(tr.is_valid()) { typedef agg::span_interpolator_trans interpolator_type; interpolator_type interpolator(tr); typedef span_image_filter_2x2 span_gen_type; span_gen_type sg(img_src, interpolator, filter); agg::render_scanlines_aa(g_rasterizer, g_scanline, rb_pre, sa, sg); } break; } case 4: { typedef agg::span_interpolator_persp_lerp<> interpolator_type; typedef agg::span_subdiv_adaptor subdiv_adaptor_type; interpolator_type interpolator(m_quad.polygon(), g_x1, g_y1, g_x2, g_y2); subdiv_adaptor_type subdiv_adaptor(interpolator); if(interpolator.is_valid()) { typedef span_image_resample span_gen_type; span_gen_type sg(img_src, subdiv_adaptor, filter); sg.blur(m_blur.value()); agg::render_scanlines_aa(g_rasterizer, g_scanline, rb_pre, sa, sg); } break; } case 5: { typedef agg::span_interpolator_persp_exact<> interpolator_type; typedef agg::span_subdiv_adaptor subdiv_adaptor_type; interpolator_type interpolator(m_quad.polygon(), g_x1, g_y1, g_x2, g_y2); subdiv_adaptor_type subdiv_adaptor(interpolator); if(interpolator.is_valid()) { typedef span_image_resample span_gen_type; span_gen_type sg(img_src, subdiv_adaptor, filter); sg.blur(m_blur.value()); agg::render_scanlines_aa(g_rasterizer, g_scanline, rb_pre, sa, sg); } break; } } double tm = elapsed_time(); pixf.apply_gamma_inv(m_gamma_lut); char buf[64]; agg::gsv_text t; t.size(10.0); agg::conv_stroke pt(t); pt.width(1.5); sprintf(buf, "%3.2f ms", tm); t.start_point(10.0, 70.0); t.text(buf); g_rasterizer.add_path(pt); r.color(agg::rgba(0,0,0)); agg::render_scanlines(g_rasterizer, g_scanline, r); //-------------------------- agg::render_ctrl(g_rasterizer, g_scanline, rb, m_trans_type); agg::render_ctrl(g_rasterizer, g_scanline, rb, m_gamma); agg::render_ctrl(g_rasterizer, g_scanline, rb, m_blur); } virtual void on_mouse_button_down(int x, int y, unsigned flags) { if(flags & agg::mouse_left) { if(m_quad.on_mouse_button_down(x, y)) { force_redraw(); } } } virtual void on_mouse_move(int x, int y, unsigned flags) { if(flags & agg::mouse_left) { if(m_quad.on_mouse_move(x, y)) { force_redraw(); } } if((flags & agg::mouse_left) == 0) { on_mouse_button_up(x, y, flags); } } virtual void on_mouse_button_up(int x, int y, unsigned flags) { if(m_quad.on_mouse_button_up(x, y)) { force_redraw(); } } virtual void on_key(int x, int y, unsigned key, unsigned flags) { if(key == ' ') { double cx = (m_quad.xn(0) + m_quad.xn(1) + m_quad.xn(2) + m_quad.xn(3)) / 4; double cy = (m_quad.yn(0) + m_quad.yn(1) + m_quad.yn(2) + m_quad.yn(3)) / 4; agg::trans_affine tr = agg::trans_affine_translation(-cx, -cy); tr *= agg::trans_affine_rotation(agg::pi / 2.0); tr *= agg::trans_affine_translation(cx, cy); tr.transform(&m_quad.xn(0), &m_quad.yn(0)); tr.transform(&m_quad.xn(1), &m_quad.yn(1)); tr.transform(&m_quad.xn(2), &m_quad.yn(2)); tr.transform(&m_quad.xn(3), &m_quad.yn(3)); force_redraw(); } } }; int agg_main(int argc, char* argv[]) { the_application app(pix_format, flip_y); app.caption("AGG Example. Pattern Transformations with Resampling"); const char* img_name = "agg"; if(argc >= 2) img_name = argv[1]; if(!app.load_img(0, img_name)) { char buf[256]; if(strcmp(img_name, "agg") == 0) { sprintf(buf, "File not found: %s%s. Download http://www.antigrain.com/%s%s\n" "or copy it from another directory if available.", img_name, app.img_ext(), img_name, app.img_ext()); } else { sprintf(buf, "File not found: %s%s", img_name, app.img_ext()); } app.message(buf); return 1; } if(app.init(600, 600, agg::window_resize)) { return app.run(); } return 1; } agg-2.5+dfsg1/examples/perspective.cpp0000644000000000000000000002160510703246330020135 0ustar00usergroup00000000000000#include #include #include #include "agg_basics.h" #include "agg_rendering_buffer.h" #include "agg_rasterizer_scanline_aa.h" #include "agg_scanline_p.h" #include "agg_renderer_scanline.h" #include "agg_path_storage.h" #include "agg_conv_transform.h" #include "agg_conv_clip_polygon.h" #include "agg_bounding_rect.h" #include "agg_ellipse.h" #include "agg_trans_bilinear.h" #include "agg_trans_perspective.h" #include "ctrl/agg_rbox_ctrl.h" #include "platform/agg_platform_support.h" #include "interactive_polygon.h" #define AGG_BGR24 //#define AGG_RGB24 //#define AGG_BGRA32 //#define AGG_RGBA32 //#define AGG_ARGB32 //#define AGG_ABGR32 //#define AGG_RGB565 //#define AGG_RGB555 #include "pixel_formats.h" enum flip_y_e { flip_y = true }; agg::rasterizer_scanline_aa<> g_rasterizer; agg::scanline_p8 g_scanline; agg::path_storage g_path; agg::rgba8 g_colors[100]; unsigned g_path_idx[100]; unsigned g_npaths = 0; double g_x1 = 0; double g_y1 = 0; double g_x2 = 0; double g_y2 = 0; double g_base_dx = 0; double g_base_dy = 0; double g_angle = 0; double g_scale = 1.0; double g_skew_x = 0; double g_skew_y = 0; int g_nclick = 0; unsigned parse_lion(agg::path_storage& ps, agg::rgba8* colors, unsigned* path_idx); void parse_lion() { g_npaths = parse_lion(g_path, g_colors, g_path_idx); agg::pod_array_adaptor path_idx(g_path_idx, 100); agg::bounding_rect(g_path, path_idx, 0, g_npaths, &g_x1, &g_y1, &g_x2, &g_y2); g_base_dx = (g_x2 - g_x1) / 2.0; g_base_dy = (g_y2 - g_y1) / 2.0; g_path.flip_x(g_x1, g_x2); g_path.flip_y(g_y1, g_y2); } namespace agg { } class the_application : public agg::platform_support { public: typedef agg::renderer_base renderer_base; typedef agg::renderer_scanline_aa_solid renderer_solid; agg::interactive_polygon m_quad; agg::rbox_ctrl m_trans_type; the_application(agg::pix_format_e format, bool flip_y) : agg::platform_support(format, flip_y), m_quad(4, 5.0), m_trans_type(420, 5.0, 420+130.0, 55.0, !flip_y) { parse_lion(); m_quad.xn(0) = g_x1; m_quad.yn(0) = g_y1; m_quad.xn(1) = g_x2; m_quad.yn(1) = g_y1; m_quad.xn(2) = g_x2; m_quad.yn(2) = g_y2; m_quad.xn(3) = g_x1; m_quad.yn(3) = g_y2; m_trans_type.add_item("Bilinear"); m_trans_type.add_item("Perspective"); m_trans_type.cur_item(0); add_ctrl(m_trans_type); } virtual void on_init() { double dx = width() / 2.0 - (m_quad.xn(1) - m_quad.xn(0)) / 2.0; double dy = height() / 2.0 - (m_quad.yn(2) - m_quad.yn(0)) / 2.0; m_quad.xn(0) += dx; m_quad.yn(0) += dy; m_quad.xn(1) += dx; m_quad.yn(1) += dy; m_quad.xn(2) += dx; m_quad.yn(2) += dy; m_quad.xn(3) += dx; m_quad.yn(3) += dy; } virtual void on_draw() { pixfmt pixf(rbuf_window()); renderer_base rb(pixf); renderer_solid r(rb); rb.clear(agg::rgba(1, 1, 1)); g_rasterizer.clip_box(0, 0, width(), height()); if(m_trans_type.cur_item() == 0) { agg::trans_bilinear tr(g_x1, g_y1, g_x2, g_y2, m_quad.polygon()); if(tr.is_valid()) { //-------------------------- // Render transformed lion // agg::conv_transform trans(g_path, tr); agg::render_all_paths(g_rasterizer, g_scanline, r, trans, g_colors, g_path_idx, g_npaths); //-------------------------- //-------------------------- // Render transformed ellipse // agg::ellipse ell((g_x1 + g_x2) * 0.5, (g_y1 + g_y2) * 0.5, (g_x2 - g_x1) * 0.5, (g_y2 - g_y1) * 0.5, 200); agg::conv_stroke ell_stroke(ell); ell_stroke.width(3.0); agg::conv_transform trans_ell(ell, tr); agg::conv_transform, agg::trans_bilinear> trans_ell_stroke(ell_stroke, tr); g_rasterizer.add_path(trans_ell); r.color(agg::rgba(0.5, 0.3, 0.0, 0.3)); agg::render_scanlines(g_rasterizer, g_scanline, r); g_rasterizer.add_path(trans_ell_stroke); r.color(agg::rgba(0.0, 0.3, 0.2, 1.0)); agg::render_scanlines(g_rasterizer, g_scanline, r); //-------------------------- } } else { agg::trans_perspective tr(g_x1, g_y1, g_x2, g_y2, m_quad.polygon()); if(tr.is_valid()) { //-------------------------- // Render transformed lion // agg::conv_transform trans(g_path, tr); agg::render_all_paths(g_rasterizer, g_scanline, r, trans, g_colors, g_path_idx, g_npaths); //-------------------------- //-------------------------- // Render transformed ellipse // agg::ellipse ell((g_x1 + g_x2) * 0.5, (g_y1 + g_y2) * 0.5, (g_x2 - g_x1) * 0.5, (g_y2 - g_y1) * 0.5, 200); agg::conv_stroke ell_stroke(ell); ell_stroke.width(3.0); agg::conv_transform trans_ell(ell, tr); agg::conv_transform, agg::trans_perspective> trans_ell_stroke(ell_stroke, tr); g_rasterizer.add_path(trans_ell); r.color(agg::rgba(0.5, 0.3, 0.0, 0.3)); agg::render_scanlines(g_rasterizer, g_scanline, r); g_rasterizer.add_path(trans_ell_stroke); r.color(agg::rgba(0.0, 0.3, 0.2, 1.0)); agg::render_scanlines(g_rasterizer, g_scanline, r); //-------------------------- // Testing the reverse transformations //agg::trans_perspective tr2(m_quad.polygon(), g_x1, g_y1, g_x2, g_y2); //if(tr2.is_valid()) //{ // double x, y; // x = m_quad.xn(0); y = m_quad.yn(0); tr2.transform(&x, &y); // g_rasterizer.move_to_d(x, y); // x = m_quad.xn(1); y = m_quad.yn(1); tr2.transform(&x, &y); // g_rasterizer.line_to_d(x, y); // x = m_quad.xn(2); y = m_quad.yn(2); tr2.transform(&x, &y); // g_rasterizer.line_to_d(x, y); // x = m_quad.xn(3); y = m_quad.yn(3); tr2.transform(&x, &y); // g_rasterizer.line_to_d(x, y); // r.color(agg::rgba(0.5, 0.0, 0.0, 0.5)); // agg::render_scanlines(g_rasterizer, g_scanline, r); //} //else //{ // message("Singularity..."); //} } } //-------------------------- // Render the "quad" tool and controls g_rasterizer.add_path(m_quad); r.color(agg::rgba(0, 0.3, 0.5, 0.6)); agg::render_scanlines(g_rasterizer, g_scanline, r); agg::render_ctrl(g_rasterizer, g_scanline, rb, m_trans_type); //-------------------------- } virtual void on_mouse_button_down(int x, int y, unsigned flags) { if(flags & agg::mouse_left) { if(m_quad.on_mouse_button_down(x, y)) { force_redraw(); } } } virtual void on_mouse_move(int x, int y, unsigned flags) { if(flags & agg::mouse_left) { if(m_quad.on_mouse_move(x, y)) { force_redraw(); } } if((flags & agg::mouse_left) == 0) { on_mouse_button_up(x, y, flags); } } virtual void on_mouse_button_up(int x, int y, unsigned flags) { if(m_quad.on_mouse_button_up(x, y)) { force_redraw(); } } }; int agg_main(int argc, char* argv[]) { the_application app(pix_format, flip_y); app.caption("AGG Example. Perspective Transformations"); if(app.init(600, 600, agg::window_resize)) { return app.run(); } return 1; } agg-2.5+dfsg1/examples/pixel_formats.h0000644000000000000000000001164610703246330020131 0ustar00usergroup00000000000000#ifndef PIXEL_FORMATS_INCLUDED #define PIXEL_FORMATS_INCLUDED #if defined(AGG_GRAY8) #include "agg_pixfmt_gray.h" #define pix_format agg::pix_format_gray8 typedef agg::pixfmt_gray8 pixfmt; typedef agg::pixfmt_gray8_pre pixfmt_pre; typedef agg::gray8 color_type; #elif defined(AGG_GRAY16) #include "agg_pixfmt_gray.h" #define pix_format agg::pix_format_gray16 typedef agg::pixfmt_gray16 pixfmt; typedef agg::pixfmt_gray16_pre pixfmt_pre; typedef agg::gray16 color_type; #elif defined(AGG_BGR24) #include "agg_pixfmt_rgb.h" #define pix_format agg::pix_format_bgr24 typedef agg::pixfmt_bgr24 pixfmt; typedef agg::pixfmt_bgr24_pre pixfmt_pre; #define pixfmt_gamma agg::pixfmt_bgr24_gamma typedef agg::rgba8 color_type; typedef agg::order_bgr component_order; #elif defined(AGG_RGB24) #include "agg_pixfmt_rgb.h" #define pix_format agg::pix_format_rgb24 typedef agg::pixfmt_rgb24 pixfmt; typedef agg::pixfmt_rgb24_pre pixfmt_pre; #define pixfmt_gamma agg::pixfmt_rgb24_gamma typedef agg::rgba8 color_type; typedef agg::order_rgb component_order; #elif defined(AGG_BGR48) #include "agg_pixfmt_rgb.h" #define pix_format agg::pix_format_bgr48 typedef agg::pixfmt_bgr48 pixfmt; typedef agg::pixfmt_bgr48_pre pixfmt_pre; #define pixfmt_gamma agg::pixfmt_bgr48_gamma typedef agg::rgba16 color_type; typedef agg::order_bgr component_order; #elif defined(AGG_RGB48) #include "agg_pixfmt_rgb.h" #define pix_format agg::pix_format_rgb48 typedef agg::pixfmt_rgb48 pixfmt; typedef agg::pixfmt_rgb48_pre pixfmt_pre; #define pixfmt_gamma agg::pixfmt_rgb48_gamma typedef agg::rgba16 color_type; typedef agg::order_rgb component_order; #elif defined(AGG_BGRA32) #include "agg_pixfmt_rgba.h" #define pix_format agg::pix_format_bgra32 typedef agg::pixfmt_bgra32 pixfmt; typedef agg::pixfmt_bgra32_pre pixfmt_pre; typedef agg::rgba8 color_type; typedef agg::order_bgra component_order; #elif defined(AGG_RGBA32) #include "agg_pixfmt_rgba.h" #define pix_format agg::pix_format_rgba32 typedef agg::pixfmt_rgba32 pixfmt; typedef agg::pixfmt_rgba32_pre pixfmt_pre; typedef agg::rgba8 color_type; typedef agg::order_rgba component_order; #elif defined(AGG_ARGB32) #include "agg_pixfmt_rgba.h" #define pix_format agg::pix_format_argb32 typedef agg::pixfmt_argb32 pixfmt; typedef agg::pixfmt_argb32_pre pixfmt_pre; typedef agg::rgba8 color_type; typedef agg::order_argb component_order; #elif defined(AGG_ABGR32) #include "agg_pixfmt_rgba.h" #define pix_format agg::pix_format_abgr32 typedef agg::pixfmt_abgr32 pixfmt; typedef agg::pixfmt_abgr32_pre pixfmt_pre; typedef agg::rgba8 color_type; typedef agg::order_argb component_order; #elif defined(AGG_BGRA64) #include "agg_pixfmt_rgba.h" #define pix_format agg::pix_format_bgra64 typedef agg::pixfmt_bgra64 pixfmt; typedef agg::pixfmt_bgra64_pre pixfmt_pre; typedef agg::rgba16 color_type; typedef agg::order_bgra component_order; #elif defined(AGG_RGBA64) #include "agg_pixfmt_rgba.h" #define pix_format agg::pix_format_rgba64 typedef agg::pixfmt_rgba64 pixfmt; typedef agg::pixfmt_rgba64_pre pixfmt_pre; typedef agg::rgba16 color_type; typedef agg::order_rgba component_order; #elif defined(AGG_ARGB64) #include "agg_pixfmt_rgba.h" #define pix_format agg::pix_format_argb64 typedef agg::pixfmt_argb64 pixfmt; typedef agg::pixfmt_argb64_pre pixfmt_pre; typedef agg::rgba16 color_type; typedef agg::order_argb component_order; #elif defined(AGG_ABGR64) #include "agg_pixfmt_rgba.h" #define pix_format agg::pix_format_abgr64 typedef agg::pixfmt_abgr64 pixfmt; typedef agg::pixfmt_abgr64_pre pixfmt_pre; typedef agg::rgba16 color_type; typedef agg::order_argb component_order; #elif defined(AGG_RGB565) #include "agg_pixfmt_rgb_packed.h" #define pix_format agg::pix_format_rgb565 typedef agg::pixfmt_rgb565 pixfmt; typedef agg::pixfmt_rgb565_pre pixfmt_pre; typedef agg::rgba8 color_type; #elif defined(AGG_RGB555) #include "agg_pixfmt_rgb_packed.h" #define pix_format agg::pix_format_rgb555 typedef agg::pixfmt_rgb555 pixfmt; typedef agg::pixfmt_rgb555_pre pixfmt_pre; typedef agg::rgba8 color_type; #elif defined(AGG_RGB_AAA) #include "agg_pixfmt_rgb_packed.h" #define pix_format agg::pix_format_rgbAAA typedef agg::pixfmt_rgbAAA pixfmt; typedef agg::pixfmt_rgbAAA_pre pixfmt_pre; typedef agg::rgba16 color_type; #elif defined(AGG_BGR_AAA) #include "agg_pixfmt_rgb_packed.h" #define pix_format agg::pix_format_bgrAAA typedef agg::pixfmt_bgrAAA pixfmt; typedef agg::pixfmt_bgrAAA_pre pixfmt_pre; typedef agg::rgba16 color_type; #elif defined(AGG_RGB_BBA) #include "agg_pixfmt_rgb_packed.h" #define pix_format agg::pix_format_rgbBBA typedef agg::pixfmt_rgbBBA pixfmt; typedef agg::pixfmt_rgbBBA_pre pixfmt_pre; typedef agg::rgba16 color_type; #elif defined(AGG_BGR_ABB) #include "agg_pixfmt_rgb_packed.h" #define pix_format agg::pix_format_bgrABB typedef agg::pixfmt_bgrABB pixfmt; typedef agg::pixfmt_bgrABB_pre pixfmt_pre; typedef agg::rgba16 color_type; #else #error Please define pixel format: AGG_GRAY8, AGG_BGR24, AGG_RGB24, etc. See this file above #endif #endif agg-2.5+dfsg1/examples/polymorphic_renderer.cpp0000644000000000000000000001157510703246330022044 0ustar00usergroup00000000000000#include #include #include #include "agg_basics.h" #include "agg_rendering_buffer.h" #include "agg_rasterizer_scanline_aa.h" #include "agg_rasterizer_outline.h" #include "agg_scanline_p.h" #include "agg_path_storage.h" #include "agg_renderer_scanline.h" #include "platform/agg_platform_support.h" #include "agg_pixfmt_rgb.h" #include "agg_pixfmt_rgb_packed.h" #include "agg_pixfmt_rgba.h" static int pix_fmt = agg::pix_format_rgb555; //static int pix_fmt = agg::pix_format_rgb565; //static int pix_fmt = agg::pix_format_rgb24; //static int pix_fmt = agg::pix_format_bgr24; //static int pix_fmt = agg::pix_format_rgba32; //static int pix_fmt = agg::pix_format_argb32; //static int pix_fmt = agg::pix_format_abgr32; //static int pix_fmt = agg::pix_format_bgra32; enum flip_y_e { flip_y = true }; namespace agg { //======================================================================== class polymorphic_renderer_solid_rgba8_base { public: typedef rgba8 color_type; typedef scanline_p8 scanline_type; virtual ~polymorphic_renderer_solid_rgba8_base() {} //-------------------------------------------------------------------- virtual void clear(const color_type& c) = 0; virtual void color(const color_type& c) = 0; virtual const color_type& color() const = 0; virtual void prepare() = 0; virtual void render(const scanline_type&) = 0; }; //======================================================================== template class polymorphic_renderer_solid_rgba8_adaptor : public polymorphic_renderer_solid_rgba8_base { public: polymorphic_renderer_solid_rgba8_adaptor(rendering_buffer& rbuf) : m_pixfmt(rbuf), m_ren_base(m_pixfmt), m_ren(m_ren_base) {} //-------------------------------------------------------------------- virtual void clear(const color_type& c) { m_ren_base.clear(c); } virtual void color(const color_type& c) { m_ren.color(c); } virtual const color_type& color() const { return m_ren.color(); } virtual void prepare() { m_ren.prepare(); } virtual void render(const scanline_type& sl) { m_ren.render(sl); } private: PixFmt m_pixfmt; renderer_base m_ren_base; renderer_scanline_aa_solid > m_ren; }; } class the_application : public agg::platform_support { double m_x[3]; double m_y[3]; public: the_application(int format, bool flip_y) : agg::platform_support((agg::pix_format_e)format, flip_y) { m_x[0] = 100; m_y[0] = 60; m_x[1] = 369; m_y[1] = 170; m_x[2] = 143; m_y[2] = 310; } virtual void on_draw() { agg::path_storage path; path.move_to(m_x[0], m_y[0]); path.line_to(m_x[1], m_y[1]); path.line_to(m_x[2], m_y[2]); path.close_polygon(); agg::polymorphic_renderer_solid_rgba8_base* ren = 0; //-- Polymorphic renderer class factory switch(pix_fmt) { case agg::pix_format_rgb555 : ren = new agg::polymorphic_renderer_solid_rgba8_adaptor(rbuf_window()); break; case agg::pix_format_rgb565 : ren = new agg::polymorphic_renderer_solid_rgba8_adaptor(rbuf_window()); break; case agg::pix_format_rgb24 : ren = new agg::polymorphic_renderer_solid_rgba8_adaptor(rbuf_window()); break; case agg::pix_format_bgr24 : ren = new agg::polymorphic_renderer_solid_rgba8_adaptor(rbuf_window()); break; case agg::pix_format_rgba32 : ren = new agg::polymorphic_renderer_solid_rgba8_adaptor(rbuf_window()); break; case agg::pix_format_argb32 : ren = new agg::polymorphic_renderer_solid_rgba8_adaptor(rbuf_window()); break; case agg::pix_format_abgr32 : ren = new agg::polymorphic_renderer_solid_rgba8_adaptor(rbuf_window()); break; case agg::pix_format_bgra32 : ren = new agg::polymorphic_renderer_solid_rgba8_adaptor(rbuf_window()); break; } agg::rasterizer_scanline_aa<> ras; agg::scanline_p8 sl; if(ren) { ren->clear(agg::rgba8(255, 255, 255)); ren->color(agg::rgba8(80, 30, 20)); ras.add_path(path); agg::render_scanlines(ras, sl, *ren); } delete ren; } }; int agg_main(int argc, char* argv[]) { the_application app(pix_fmt, flip_y); app.caption("AGG Example. Polymorphic Renderers"); if(app.init(400, 330, agg::window_resize)) { return app.run(); } return 1; } agg-2.5+dfsg1/examples/raster_text.cpp0000644000000000000000000001443110703246330020147 0ustar00usergroup00000000000000#include #include "agg_basics.h" #include "agg_rendering_buffer.h" #include "agg_rasterizer_scanline_aa.h" #include "agg_scanline_u.h" #include "agg_renderer_scanline.h" #include "agg_pixfmt_rgb.h" #include "agg_span_allocator.h" #include "agg_span_gradient.h" #include "agg_span_interpolator_linear.h" #include "agg_glyph_raster_bin.h" #include "agg_renderer_raster_text.h" #include "agg_embedded_raster_fonts.h" #include "platform/agg_platform_support.h" #include "ctrl/agg_slider_ctrl.h" #include "ctrl/agg_cbox_ctrl.h" enum flip_y_e { flip_y = true }; //------------------------------------------------------------------------ template class gradient_sine_repeat_adaptor { public: gradient_sine_repeat_adaptor() : m_periods(agg::pi* 2.0) {} void periods(double p) { m_periods = p * agg::pi * 2.0; } int calculate(int x, int y, int d) const { return int((1.0 + sin(m_gradient.calculate(x, y, d) * m_periods / d)) * d/2); } private: GradientF m_gradient; double m_periods; }; //------------------------------------------------------------------------ class the_application : public agg::platform_support { public: typedef agg::pixfmt_bgr24 pixfmt; typedef agg::renderer_base ren_base; typedef agg::glyph_raster_bin glyph_gen; the_application(agg::pix_format_e format, bool flip_y) : agg::platform_support(format, flip_y) { } virtual void on_draw() { struct font_type { const agg::int8u* font; const char* name; } fonts[] = { { agg::gse4x6, "gse4x6" }, { agg::gse4x8, "gse4x8" }, { agg::gse5x7, "gse5x7" }, { agg::gse5x9, "gse5x9" }, { agg::gse6x9, "gse6x9" }, { agg::gse6x12, "gse6x12" }, { agg::gse7x11, "gse7x11" }, { agg::gse7x11_bold, "gse7x11_bold" }, { agg::gse7x15, "gse7x15" }, { agg::gse7x15_bold, "gse7x15_bold" }, { agg::gse8x16, "gse8x16" }, { agg::gse8x16_bold, "gse8x16_bold" }, { agg::mcs11_prop, "mcs11_prop" }, { agg::mcs11_prop_condensed, "mcs11_prop_condensed" }, { agg::mcs12_prop, "mcs12_prop" }, { agg::mcs13_prop, "mcs13_prop" }, { agg::mcs5x10_mono, "mcs5x10_mono" }, { agg::mcs5x11_mono, "mcs5x11_mono" }, { agg::mcs6x10_mono, "mcs6x10_mono" }, { agg::mcs6x11_mono, "mcs6x11_mono" }, { agg::mcs7x12_mono_high, "mcs7x12_mono_high" }, { agg::mcs7x12_mono_low, "mcs7x12_mono_low" }, { agg::verdana12, "verdana12" }, { agg::verdana12_bold, "verdana12_bold" }, { agg::verdana13, "verdana13" }, { agg::verdana13_bold, "verdana13_bold" }, { agg::verdana14, "verdana14" }, { agg::verdana14_bold, "verdana14_bold" }, { agg::verdana16, "verdana16" }, { agg::verdana16_bold, "verdana16_bold" }, { agg::verdana17, "verdana17" }, { agg::verdana17_bold, "verdana17_bold" }, { agg::verdana18, "verdana18" }, { agg::verdana18_bold, "verdana18_bold" }, 0, 0 }; glyph_gen glyph(0); pixfmt pixf(rbuf_window()); ren_base rb(pixf); rb.clear(agg::rgba(1,1,1)); agg::renderer_raster_htext_solid rt(rb, glyph); int i; double y = 5; rt.color(agg::rgba(0,0,0)); for(i = 0; fonts[i].font; i++) { char buf[100]; strcpy(buf, "A quick brown fox jumps over the lazy dog 0123456789: "); strcat(buf, fonts[i].name); // Testing "wide-char" unsigned wbuf[100]; unsigned* wp = wbuf; const char* p = buf; while(*p) *wp++ = *(unsigned char*)p++; *wp++ = 0; glyph.font(fonts[i].font); rt.render_text(5, y, wbuf, !flip_y()); y += glyph.height() + 1; } // Rendering raster text with a custom span generator, gradient typedef agg::span_interpolator_linear<> interpolator_type; typedef agg::span_allocator span_alloc_type; typedef agg::span_gradient, agg::gradient_linear_color > span_gen_type; typedef agg::renderer_scanline_aa ren_type; agg::trans_affine mtx; gradient_sine_repeat_adaptor grad_func; grad_func.periods(5); agg::gradient_linear_color color_func; color_func.colors(agg::rgba(1.0,0,0), agg::rgba(0,0.5,0)); interpolator_type inter(mtx); span_alloc_type sa; span_gen_type sg(inter, grad_func, color_func, 0, 150.0); ren_type ren(rb, sa, sg); agg::renderer_raster_htext rt2(ren, glyph); rt2.render_text(5, 465, (unsigned char*)"RADIAL REPEATING GRADIENT: A quick brown fox jumps over the lazy dog", !flip_y()); } }; int agg_main(int argc, char* argv[]) { the_application app(agg::pix_format_bgr24, flip_y); app.caption("AGG Example. Raster Text"); if(app.init(640, 480, agg::window_resize)) { return app.run(); } return 1; } agg-2.5+dfsg1/examples/rasterizer_compound.cpp0000644000000000000000000002227310703246330021704 0ustar00usergroup00000000000000#include #include #include "agg_basics.h" #include "agg_ellipse.h" #include "agg_gamma_lut.h" #include "agg_rendering_buffer.h" #include "agg_rasterizer_scanline_aa.h" #include "agg_rasterizer_compound_aa.h" #include "agg_conv_curve.h" #include "agg_conv_stroke.h" #include "agg_scanline_u.h" #include "agg_renderer_scanline.h" #include "agg_span_allocator.h" #include "agg_pixfmt_rgba.h" #include "ctrl/agg_slider_ctrl.h" #include "ctrl/agg_cbox_ctrl.h" #include "platform/agg_platform_support.h" enum flip_y_e { flip_y = true }; //------------------------------------------------- class style_handler { public: style_handler(const agg::rgba8* styles, unsigned count) : m_transparent(0, 0, 0, 0), m_styles(styles), m_count(count) {} bool is_solid(unsigned style) const { return true; } const agg::rgba8& color(unsigned style) const { if (style < m_count) return m_styles[style]; return m_transparent; } void generate_span(agg::rgba8* span, int x, int y, unsigned len, unsigned style) { } private: agg::rgba8 m_transparent; const agg::rgba8* m_styles; unsigned m_count; }; class the_application : public agg::platform_support { agg::slider_ctrl m_width; agg::slider_ctrl m_alpha1; agg::slider_ctrl m_alpha2; agg::slider_ctrl m_alpha3; agg::slider_ctrl m_alpha4; agg::cbox_ctrl m_invert_order; agg::path_storage m_path; public: the_application(agg::pix_format_e format, bool flip_y) : agg::platform_support(format, flip_y), m_width(180 + 10.0, 5.0, 130 + 300.0, 12, !flip_y), m_alpha1(5, 5, 180, 12, !flip_y), m_alpha2(5, 25, 180, 32, !flip_y), m_alpha3(5, 45, 180, 52, !flip_y), m_alpha4(5, 65, 180, 72, !flip_y), m_invert_order(190, 25, "Invert Z-Order") { add_ctrl(m_width); m_width.range(-20.0, 50.0); m_width.value(10.0); m_width.label("Width=%1.2f"); add_ctrl(m_alpha1); m_alpha1.range(0, 1); m_alpha1.value(1); m_alpha1.label("Alpha1=%1.3f"); add_ctrl(m_alpha2); m_alpha2.range(0, 1); m_alpha2.value(1); m_alpha2.label("Alpha2=%1.3f"); add_ctrl(m_alpha3); m_alpha3.range(0, 1); m_alpha3.value(1); m_alpha3.label("Alpha3=%1.3f"); add_ctrl(m_alpha4); m_alpha4.range(0, 1); m_alpha4.value(1); m_alpha4.label("Alpha4=%1.3f"); add_ctrl(m_invert_order); } void compose_path() { m_path.remove_all(); m_path.move_to(28.47, 6.45); m_path.curve3(21.58, 1.12, 19.82, 0.29); m_path.curve3(17.19, -0.93, 14.21, -0.93); m_path.curve3(9.57, -0.93, 6.57, 2.25); m_path.curve3(3.56, 5.42, 3.56, 10.60); m_path.curve3(3.56, 13.87, 5.03, 16.26); m_path.curve3(7.03, 19.58, 11.99, 22.51); m_path.curve3(16.94, 25.44, 28.47, 29.64); m_path.line_to(28.47, 31.40); m_path.curve3(28.47, 38.09, 26.34, 40.58); m_path.curve3(24.22, 43.07, 20.17, 43.07); m_path.curve3(17.09, 43.07, 15.28, 41.41); m_path.curve3(13.43, 39.75, 13.43, 37.60); m_path.line_to(13.53, 34.77); m_path.curve3(13.53, 32.52, 12.38, 31.30); m_path.curve3(11.23, 30.08, 9.38, 30.08); m_path.curve3(7.57, 30.08, 6.42, 31.35); m_path.curve3(5.27, 32.62, 5.27, 34.81); m_path.curve3(5.27, 39.01, 9.57, 42.53); m_path.curve3(13.87, 46.04, 21.63, 46.04); m_path.curve3(27.59, 46.04, 31.40, 44.04); m_path.curve3(34.28, 42.53, 35.64, 39.31); m_path.curve3(36.52, 37.21, 36.52, 30.71); m_path.line_to(36.52, 15.53); m_path.curve3(36.52, 9.13, 36.77, 7.69); m_path.curve3(37.01, 6.25, 37.57, 5.76); m_path.curve3(38.13, 5.27, 38.87, 5.27); m_path.curve3(39.65, 5.27, 40.23, 5.62); m_path.curve3(41.26, 6.25, 44.19, 9.18); m_path.line_to(44.19, 6.45); m_path.curve3(38.72, -0.88, 33.74, -0.88); m_path.curve3(31.35, -0.88, 29.93, 0.78); m_path.curve3(28.52, 2.44, 28.47, 6.45); m_path.close_polygon(); m_path.move_to(28.47, 9.62); m_path.line_to(28.47, 26.66); m_path.curve3(21.09, 23.73, 18.95, 22.51); m_path.curve3(15.09, 20.36, 13.43, 18.02); m_path.curve3(11.77, 15.67, 11.77, 12.89); m_path.curve3(11.77, 9.38, 13.87, 7.06); m_path.curve3(15.97, 4.74, 18.70, 4.74); m_path.curve3(22.41, 4.74, 28.47, 9.62); m_path.close_polygon(); } virtual void on_draw() { typedef agg::renderer_base ren_base; typedef agg::renderer_base ren_base_pre; agg::gamma_lut lut(2.0); agg::pixfmt_bgra32 pixf(rbuf_window()); ren_base renb(pixf); agg::pixfmt_bgra32_pre pixf_pre(rbuf_window()); ren_base_pre renb_pre(pixf_pre); // Clear the window with a gradient agg::pod_vector gr(pixf_pre.width()); unsigned i; for(i = 0; i < pixf.width(); i++) { gr.add(agg::rgba8(255, 255, 0).gradient(agg::rgba8(0, 255, 255), double(i) / pixf.width())); } for(i = 0; i < pixf.height(); i++) { renb.copy_color_hspan(0, i, pixf.width(), &gr[0]); } pixf.apply_gamma_dir(lut); agg::rasterizer_scanline_aa<> ras; agg::rasterizer_compound_aa rasc; agg::scanline_u8 sl; agg::span_allocator alloc; // Draw two triangles ras.move_to_d(0, 0); ras.line_to_d(width(), 0); ras.line_to_d(width(), height()); agg::render_scanlines_aa_solid(ras, sl, renb, agg::rgba8(lut.dir(0), lut.dir(100), lut.dir(0))); ras.move_to_d(0, 0); ras.line_to_d(0, height()); ras.line_to_d(width(), 0); agg::render_scanlines_aa_solid(ras, sl, renb, agg::rgba8(lut.dir(0), lut.dir(100), lut.dir(100))); agg::trans_affine mtx; mtx *= agg::trans_affine_scaling(4.0); mtx *= agg::trans_affine_translation(150, 100); agg::conv_transform trans(m_path, mtx); agg::conv_curve > curve(trans); agg::conv_stroke > > stroke(curve); compose_path(); agg::rgba8 styles[4]; if(m_invert_order.status()) { rasc.layer_order(agg::layer_inverse); } else { rasc.layer_order(agg::layer_direct); } styles[3] = agg::rgba8(lut.dir(255), lut.dir(0), lut.dir(108), 200).premultiply(); styles[2] = agg::rgba8(lut.dir(51), lut.dir(0), lut.dir(151), 180).premultiply(); styles[1] = agg::rgba8(lut.dir(143), lut.dir(90), lut.dir(6), 200).premultiply(); styles[0] = agg::rgba8(lut.dir(0), lut.dir(0), lut.dir(255), 220).premultiply(); style_handler sh(styles, 4); stroke.width(m_width.value()); rasc.reset(); rasc.master_alpha(3, m_alpha1.value()); rasc.master_alpha(2, m_alpha2.value()); rasc.master_alpha(1, m_alpha3.value()); rasc.master_alpha(0, m_alpha4.value()); agg::ellipse ell(220.0, 180.0, 120.0, 10.0, 128, false); agg::conv_stroke str_ell(ell); str_ell.width(m_width.value() / 2); rasc.styles(3, -1); rasc.add_path(str_ell); rasc.styles(2, -1); rasc.add_path(ell); rasc.styles(1, -1); rasc.add_path(stroke); rasc.styles(0, -1); rasc.add_path(curve); agg::render_scanlines_compound_layered(rasc, sl, renb_pre, alloc, sh); agg::render_ctrl(ras, sl, renb, m_width); agg::render_ctrl(ras, sl, renb, m_alpha1); agg::render_ctrl(ras, sl, renb, m_alpha2); agg::render_ctrl(ras, sl, renb, m_alpha3); agg::render_ctrl(ras, sl, renb, m_alpha4); agg::render_ctrl(ras, sl, renb, m_invert_order); pixf.apply_gamma_inv(lut); } }; int agg_main(int argc, char* argv[]) { the_application app(agg::pix_format_bgra32, flip_y); app.caption("AGG Example. Compound Rasterizer -- Geometry Flattening"); if(app.init(440, 330, 0)) { return app.run(); } return 1; } agg-2.5+dfsg1/examples/rasterizers.cpp0000644000000000000000000001637610703246330020172 0ustar00usergroup00000000000000#include #include #include #include "agg_basics.h" #include "agg_rendering_buffer.h" #include "agg_rasterizer_scanline_aa.h" #include "agg_rasterizer_outline.h" #include "agg_scanline_p.h" #include "agg_scanline_bin.h" #include "agg_renderer_scanline.h" #include "agg_renderer_primitives.h" #include "ctrl/agg_slider_ctrl.h" #include "ctrl/agg_cbox_ctrl.h" #include "platform/agg_platform_support.h" #define AGG_BGR24 #include "pixel_formats.h" enum flip_y_e { flip_y = true }; class the_application : public agg::platform_support { double m_x[3]; double m_y[3]; double m_dx; double m_dy; int m_idx; agg::slider_ctrl m_gamma; agg::slider_ctrl m_alpha; agg::cbox_ctrl m_test; agg::rasterizer_scanline_aa<> m_ras; agg::scanline_p8 m_sl_p8; agg::scanline_bin m_sl_bin; public: the_application(agg::pix_format_e format, bool flip_y) : agg::platform_support(format, flip_y), m_idx(-1), m_gamma(130 + 10.0, 10.0 + 4.0, 130 + 150.0, 10.0 + 8.0 + 4.0, !flip_y), m_alpha(130 + 150.0 + 10.0, 10.0 + 4.0, 500 - 10.0, 10.0 + 8.0 + 4.0, !flip_y), m_test(130 + 10.0, 10.0 + 4.0 + 16.0, "Test Performance", !flip_y) { m_x[0] = 100 + 120; m_y[0] = 60; m_x[1] = 369 + 120; m_y[1] = 170; m_x[2] = 143 + 120; m_y[2] = 310; add_ctrl(m_gamma); m_gamma.range(0.0, 1.0); m_gamma.value(0.5); m_gamma.label("Gamma=%1.2f"); m_gamma.no_transform(); add_ctrl(m_alpha); m_alpha.range(0.0, 1.0); m_alpha.value(1.0); m_alpha.label("Alpha=%1.2f"); m_alpha.no_transform(); add_ctrl(m_test); m_test.no_transform(); } typedef agg::renderer_base renderer_base; typedef agg::renderer_scanline_aa_solid renderer_aa; typedef agg::renderer_scanline_bin_solid renderer_bin; void draw_anti_aliased() { pixfmt pixf(rbuf_window()); renderer_base rb(pixf); renderer_aa ren_aa(rb); agg::path_storage path; path.move_to(m_x[0], m_y[0]); path.line_to(m_x[1], m_y[1]); path.line_to(m_x[2], m_y[2]); path.close_polygon(); ren_aa.color(agg::rgba(0.7, 0.5, 0.1, m_alpha.value())); m_ras.gamma(agg::gamma_power(m_gamma.value() * 2.0)); m_ras.add_path(path); agg::render_scanlines(m_ras, m_sl_p8, ren_aa); } void draw_aliased() { pixfmt pixf(rbuf_window()); renderer_base rb(pixf); renderer_bin ren_bin(rb); agg::path_storage path; path.move_to(m_x[0] - 200, m_y[0]); path.line_to(m_x[1] - 200, m_y[1]); path.line_to(m_x[2] - 200, m_y[2]); path.close_polygon(); ren_bin.color(agg::rgba(0.1, 0.5, 0.7, m_alpha.value())); m_ras.gamma(agg::gamma_threshold(m_gamma.value())); m_ras.add_path(path); agg::render_scanlines(m_ras, m_sl_bin, ren_bin); //-- Drawing an outline with subpixel accuracy (aliased) //typedef agg::renderer_primitives renderer_pr; //renderer_pr ren_pr(rb); //agg::rasterizer_outline ras_line(ren_pr); //ren_pr.line_color(agg::rgba(0.0, 0.0, 0.0)); //ras_line.add_path(path); } virtual void on_draw() { pixfmt pixf(rbuf_window()); renderer_base rb(pixf); renderer_aa ren_aa(rb); rb.clear(agg::rgba(1, 1, 1)); agg::rasterizer_scanline_aa<> ras_aa; draw_anti_aliased(); draw_aliased(); agg::render_ctrl(ras_aa, m_sl_p8, rb, m_gamma); agg::render_ctrl(ras_aa, m_sl_p8, rb, m_alpha); agg::render_ctrl(ras_aa, m_sl_p8, rb, m_test); } virtual void on_mouse_button_down(int x, int y, unsigned flags) { if(flags & agg::mouse_left) { unsigned i; for (i = 0; i < 3; i++) { if(sqrt( (x-m_x[i]) * (x-m_x[i]) + (y-m_y[i]) * (y-m_y[i]) ) < 20.0 || sqrt( (x-m_x[i]+200) * (x-m_x[i]+200) + (y-m_y[i]) * (y-m_y[i]) ) < 20) { m_dx = x - m_x[i]; m_dy = y - m_y[i]; m_idx = i; break; } } if(i == 3) { if(agg::point_in_triangle(m_x[0], m_y[0], m_x[1], m_y[1], m_x[2], m_y[2], x, y) || agg::point_in_triangle(m_x[0] - 200, m_y[0], m_x[1] - 200, m_y[1], m_x[2] - 200, m_y[2], x, y)) { m_dx = x - m_x[0]; m_dy = y - m_y[0]; m_idx = 3; } } } } virtual void on_mouse_move(int x, int y, unsigned flags) { if(flags & agg::mouse_left) { if(m_idx == 3) { double dx = x - m_dx; double dy = y - m_dy; m_x[1] -= m_x[0] - dx; m_y[1] -= m_y[0] - dy; m_x[2] -= m_x[0] - dx; m_y[2] -= m_y[0] - dy; m_x[0] = dx; m_y[0] = dy; force_redraw(); return; } if(m_idx >= 0) { m_x[m_idx] = x - m_dx; m_y[m_idx] = y - m_dy; force_redraw(); } } else { on_mouse_button_up(x, y, flags); } } virtual void on_mouse_button_up(int x, int y, unsigned flags) { m_idx = -1; } virtual void on_ctrl_change() { if(m_test.status()) { on_draw(); update_window(); m_test.status(false); start_timer(); int i; for(i = 0; i < 1000; i++) { draw_aliased(); } double t1 = elapsed_time(); start_timer(); for(i = 0; i < 1000; i++) { draw_anti_aliased(); } double t2 = elapsed_time(); update_window(); char buf[100]; sprintf(buf, "Time Aliased=%.2fms Time Anti-Aliased=%.2fms", t1, t2); message(buf); } } virtual void on_key(int x, int y, unsigned key, unsigned flags) { double dx = 0; double dy = 0; switch(key) { case agg::key_left: dx = -0.1; break; case agg::key_right: dx = 0.1; break; case agg::key_up: dy = 0.1; break; case agg::key_down: dy = -0.1; break; } m_x[0] += dx; m_y[0] += dy; m_x[1] += dx; m_y[1] += dy; force_redraw(); } }; int agg_main(int argc, char* argv[]) { the_application app(pix_format, flip_y); app.caption("AGG Example. Line Join"); if(app.init(500, 330, agg::window_resize)) { return app.run(); } return 1; } agg-2.5+dfsg1/examples/rasterizers2.cpp0000644000000000000000000004326710703246330020253 0ustar00usergroup00000000000000#include #include #include #include "agg_basics.h" #include "agg_rendering_buffer.h" #include "agg_rasterizer_scanline_aa.h" #include "agg_rasterizer_outline.h" #include "agg_conv_transform.h" #include "agg_conv_stroke.h" #include "agg_scanline_p.h" #include "agg_renderer_scanline.h" #include "agg_renderer_primitives.h" #include "agg_rasterizer_outline.h" #include "agg_rasterizer_outline_aa.h" #include "agg_pattern_filters_rgba.h" #include "agg_renderer_outline_aa.h" #include "agg_renderer_outline_image.h" #include "ctrl/agg_slider_ctrl.h" #include "ctrl/agg_cbox_ctrl.h" #include "platform/agg_platform_support.h" #define AGG_BGR24 //#define AGG_RGB24 //#define AGG_BGRA32 //#define AGG_RGBA32 //#define AGG_ARGB32 //#define AGG_ABGR32 //#define AGG_RGB565 //#define AGG_RGB555 #include "pixel_formats.h" enum flip_y_e { flip_y = true }; static const agg::int32u pixmap_chain[] = { 16, 7, 0x00ffffff, 0x00ffffff, 0x00ffffff, 0x00ffffff, 0xb4c29999, 0xff9a5757, 0xff9a5757, 0xff9a5757, 0xff9a5757, 0xff9a5757, 0xff9a5757, 0xb4c29999, 0x00ffffff, 0x00ffffff, 0x00ffffff, 0x00ffffff, 0x00ffffff, 0x00ffffff, 0x0cfbf9f9, 0xff9a5757, 0xff660000, 0xff660000, 0xff660000, 0xff660000, 0xff660000, 0xff660000, 0xff660000, 0xff660000, 0xb4c29999, 0x00ffffff, 0x00ffffff, 0x00ffffff, 0x00ffffff, 0x5ae0cccc, 0xffa46767, 0xff660000, 0xff975252, 0x7ed4b8b8, 0x5ae0cccc, 0x5ae0cccc, 0x5ae0cccc, 0x5ae0cccc, 0xa8c6a0a0, 0xff7f2929, 0xff670202, 0x9ecaa6a6, 0x5ae0cccc, 0x00ffffff, 0xff660000, 0xff660000, 0xff660000, 0xff660000, 0xff660000, 0xff660000, 0xa4c7a2a2, 0x3affff00, 0x3affff00, 0xff975151, 0xff660000, 0xff660000, 0xff660000, 0xff660000, 0xff660000, 0xff660000, 0x00ffffff, 0x5ae0cccc, 0xffa46767, 0xff660000, 0xff954f4f, 0x7ed4b8b8, 0x5ae0cccc, 0x5ae0cccc, 0x5ae0cccc, 0x5ae0cccc, 0xa8c6a0a0, 0xff7f2929, 0xff670202, 0x9ecaa6a6, 0x5ae0cccc, 0x00ffffff, 0x00ffffff, 0x00ffffff, 0x0cfbf9f9, 0xff9a5757, 0xff660000, 0xff660000, 0xff660000, 0xff660000, 0xff660000, 0xff660000, 0xff660000, 0xff660000, 0xb4c29999, 0x00ffffff, 0x00ffffff, 0x00ffffff, 0x00ffffff, 0x00ffffff, 0x00ffffff, 0x00ffffff, 0xb4c29999, 0xff9a5757, 0xff9a5757, 0xff9a5757, 0xff9a5757, 0xff9a5757, 0xff9a5757, 0xb4c29999, 0x00ffffff, 0x00ffffff, 0x00ffffff, 0x00ffffff }; namespace agg { class pattern_pixmap_argb32 { public: typedef rgba8 color_type; pattern_pixmap_argb32(const int32u* pixmap) : m_pixmap(pixmap) {} unsigned width() const { return m_pixmap[0]; } unsigned height() const { return m_pixmap[1]; } rgba8 pixel(int x, int y) const { int32u p = m_pixmap[y * width() + x + 2]; return rgba8((p >> 16) & 0xFF, (p >> 8) & 0xFF, p & 0xFF, p >> 24); } private: const int32u* m_pixmap; }; } class spiral { public: spiral(double x, double y, double r1, double r2, double step, double start_angle=0) : m_x(x), m_y(y), m_r1(r1), m_r2(r2), m_step(step), m_start_angle(start_angle), m_angle(start_angle), m_da(agg::deg2rad(8.0)), m_dr(m_step / 45.0) { } void rewind(unsigned) { m_angle = m_start_angle; m_curr_r = m_r1; m_start = true; } unsigned vertex(double* x, double* y) { if(m_curr_r > m_r2) return agg::path_cmd_stop; *x = m_x + cos(m_angle) * m_curr_r; *y = m_y + sin(m_angle) * m_curr_r; m_curr_r += m_dr; m_angle += m_da; if(m_start) { m_start = false; return agg::path_cmd_move_to; } return agg::path_cmd_line_to; } private: double m_x; double m_y; double m_r1; double m_r2; double m_step; double m_start_angle; double m_angle; double m_curr_r; double m_da; double m_dr; bool m_start; }; struct roundoff { void transform(double* x, double* y) const { *x = floor(*x); *y = floor(*y); } }; class the_application : public agg::platform_support { agg::slider_ctrl m_step; agg::slider_ctrl m_width; agg::cbox_ctrl m_test; agg::cbox_ctrl m_rotate; agg::cbox_ctrl m_accurate_joins; agg::cbox_ctrl m_scale_pattern; double m_start_angle; public: typedef agg::renderer_base renderer_base; typedef agg::renderer_scanline_aa_solid renderer_aa; typedef agg::renderer_primitives renderer_prim; typedef agg::rasterizer_outline rasterizer_outline; typedef agg::rasterizer_scanline_aa<> rasterizer_scanline; typedef agg::scanline_p8 scanline; typedef agg::renderer_outline_aa renderer_oaa; typedef agg::pattern_filter_bilinear_rgba8 pattern_filter; typedef agg::line_image_pattern_pow2 image_pattern; typedef agg::renderer_outline_image renderer_img; typedef agg::rasterizer_outline_aa rasterizer_outline_aa; typedef agg::rasterizer_outline_aa rasterizer_outline_img; the_application(agg::pix_format_e format, bool flip_y) : agg::platform_support(format, flip_y), m_step(10.0, 10.0 + 4.0, 150.0, 10.0 + 8.0 + 4.0, !flip_y), m_width(150.0 + 10.0, 10.0 + 4.0, 400 - 10.0, 10.0 + 8.0 + 4.0, !flip_y), m_test(10.0, 10.0 + 4.0 + 16.0, "Test Performance", !flip_y), m_rotate(130 + 10.0, 10.0 + 4.0 + 16.0, "Rotate", !flip_y), m_accurate_joins(200 + 10.0, 10.0 + 4.0 + 16.0, "Accurate Joins", !flip_y), m_scale_pattern(310 + 10.0, 10.0 + 4.0 + 16.0, "Scale Pattern", !flip_y), m_start_angle(0.0) { add_ctrl(m_step); m_step.range(0.0, 2.0); m_step.value(0.1); m_step.label("Step=%1.2f"); m_step.no_transform(); add_ctrl(m_width); m_width.range(0.0, 7.0); m_width.value(3.0); m_width.label("Width=%1.2f"); m_width.no_transform(); add_ctrl(m_test); m_test.text_size(9.0, 7.0); m_test.no_transform(); add_ctrl(m_rotate); m_rotate.text_size(9.0, 7.0); m_rotate.no_transform(); add_ctrl(m_accurate_joins); m_accurate_joins.text_size(9.0, 7.0); m_accurate_joins.no_transform(); add_ctrl(m_scale_pattern); m_scale_pattern.text_size(9.0, 7.0); m_scale_pattern.no_transform(); m_scale_pattern.status(true); } void draw_aliased_pix_accuracy(rasterizer_outline& ras, renderer_prim& prim) { spiral s1(width()/5, height()/4+50, 5, 70, 8, m_start_angle); roundoff rn; agg::conv_transform trans(s1, rn); prim.line_color(agg::rgba(0.4, 0.3, 0.1)); ras.add_path(trans); } void draw_aliased_subpix_accuracy(rasterizer_outline& ras, renderer_prim& prim) { spiral s2(width()/2, height()/4+50, 5, 70, 8, m_start_angle); prim.line_color(agg::rgba(0.4, 0.3, 0.1)); ras.add_path(s2); } void draw_anti_aliased_outline(rasterizer_outline_aa& ras, renderer_oaa& ren) { spiral s3(width()/5, height() - height()/4 + 20, 5, 70, 8, m_start_angle); ren.color(agg::rgba(0.4, 0.3, 0.1)); ras.add_path(s3); } void draw_anti_aliased_scanline(rasterizer_scanline& ras, scanline& sl, renderer_aa& ren) { spiral s4(width()/2, height() - height()/4 + 20, 5, 70, 8, m_start_angle); agg::conv_stroke stroke(s4); stroke.width(m_width.value()); stroke.line_cap(agg::round_cap); ren.color(agg::rgba(0.4, 0.3, 0.1)); ras.add_path(stroke); agg::render_scanlines(ras, sl, ren); } void draw_anti_aliased_outline_img(rasterizer_outline_img& ras, renderer_img& ren) { spiral s5(width() - width()/5, height() - height()/4 + 20, 5, 70, 8, m_start_angle); ras.add_path(s5); } void text(rasterizer_scanline& ras, scanline& sl, renderer_aa& ren, double x, double y, const char* txt) { agg::gsv_text t; t.size(8); t.text(txt); t.start_point(x, y); agg::conv_stroke stroke(t); stroke.width(0.7); ras.add_path(stroke); ren.color(agg::rgba(0,0,0)); agg::render_scanlines(ras, sl, ren); } virtual void on_draw() { pixfmt pf(rbuf_window()); renderer_base ren_base(pf); renderer_aa ren_aa(ren_base); renderer_prim ren_prim(ren_base); rasterizer_scanline ras_aa; scanline sl; rasterizer_outline ras_al(ren_prim); agg::line_profile_aa prof; prof.width(m_width.value()); renderer_oaa ren_oaa(ren_base, prof); rasterizer_outline_aa ras_oaa(ren_oaa); ras_oaa.line_join(m_accurate_joins.status() ? agg::outline_miter_accurate_join : agg::outline_round_join); ras_oaa.round_cap(true); pattern_filter filter; agg::pattern_pixmap_argb32 src(pixmap_chain); agg::line_image_scale src_scaled(src, m_width.value()); image_pattern pattern(filter); if(m_scale_pattern.status()) { pattern.create(src_scaled); } else { pattern.create(src); } renderer_img ren_img(ren_base, pattern); if(m_scale_pattern.status()) { ren_img.scale_x(m_width.value() / src.height()); } rasterizer_outline_img ras_img(ren_img); ren_base.clear(agg::rgba(1.0, 1.0, 0.95)); draw_aliased_pix_accuracy(ras_al, ren_prim); draw_aliased_subpix_accuracy(ras_al, ren_prim); draw_anti_aliased_outline(ras_oaa, ren_oaa); draw_anti_aliased_scanline(ras_aa, sl, ren_aa); draw_anti_aliased_outline_img(ras_img, ren_img); text(ras_aa, sl, ren_aa, 50, 80, "Bresenham lines,\n\nregular accuracy"); text(ras_aa, sl, ren_aa, width()/2-50, 80, "Bresenham lines,\n\nsubpixel accuracy"); text(ras_aa, sl, ren_aa, 50, height()/2+50, "Anti-aliased lines"); text(ras_aa, sl, ren_aa, width()/2-50, height()/2+50, "Scanline rasterizer"); text(ras_aa, sl, ren_aa, width() - width()/5 - 50, height()/2+50, "Arbitrary Image Pattern"); agg::render_ctrl(ras_aa, sl, ren_base, m_step); agg::render_ctrl(ras_aa, sl, ren_base, m_width); agg::render_ctrl(ras_aa, sl, ren_base, m_test); agg::render_ctrl(ras_aa, sl, ren_base, m_rotate); agg::render_ctrl(ras_aa, sl, ren_base, m_accurate_joins); agg::render_ctrl(ras_aa, sl, ren_base, m_scale_pattern); /* // An example of using anti-aliased outline rasterizer. // Uncomment it to see the result // // Includes: //#include "agg_pixfmt_rgb.h" // or another //#include "agg_renderer_outline_aa.h" //#include "agg_rasterizer_outline_aa.h" typedef agg::renderer_base base_ren_type; typedef agg::renderer_outline_aa renderer_type; typedef agg::rasterizer_outline_aa rasterizer_type; double width = 5.0; //-- create with specifying width //-- min_width=1.0, smoother_width=1.0 //agg::line_profile_aa(width, agg::gamma_none()); //-- create uninitialized and set parameters agg::line_profile_aa profile; profile.gamma(agg::gamma_power(1.2)); //optional profile.min_width(0.75); //optional profile.smoother_width(3.0); //optional profile.width(width); //mandatory! agg::pixfmt_bgr24 pixf(rbuf_window()); //or another base_ren_type base_ren(pixf); renderer_type ren(base_ren, profile); ren.color(agg::rgba8(0,0,0)); //mandatory! rasterizer_type ras(ren); ras.round_cap(true); //optional ras.accurate_join(true); //optional //-- move_to/line_to interface ras.move_to_d(100, 100); ras.line_to_d(150, 200); ras.render(false); //false means "don't close //the polygon", i.e. polyline //-- add_path interface //-- doesn't require invoking render() //ras.add_path(some_path); */ /* // An example of using image pattern outline rasterizer // Uncomment it to see the result // // Includes: //#include "agg_pixfmt_rgb.h" // or another //#include "agg_pattern_filters_rgba.h" // for all rgba-8-bit color formats //#include "agg_renderer_outline_image.h" //#include "agg_rasterizer_outline_aa.h" agg::pattern_filter_bilinear_rgba8 fltr; // Filtering functor agg::pattern_pixmap_argb32 patt_src(pixmap_chain); // Source. Must have an interface: // width() const // height() const // pixel(int x, int y) const // Any agg::renderer_base<> or derived // is good for the use as a source. // agg::line_image_pattern is the main container for the patterns. It creates // a copy of the patterns extended according to the needs of the filter. // agg::line_image_pattern can operate with arbitrary image width, but if the // width of the pattern is power of 2, it's better to use the modified // version agg::line_image_pattern_pow2 because it works about 15-25 percent // faster than agg::line_image_pattern (because of using simple masking instead // of expensive '%' operation). typedef agg::line_image_pattern_pow2 pattern_type; typedef agg::renderer_base base_ren_type; typedef agg::renderer_outline_image renderer_type; typedef agg::rasterizer_outline_aa rasterizer_type; //-- Create with specifying the source pattern_type patt(fltr, src); //-- Create uninitialized and set the source //pattern_type patt(fltr); //patt.create(src); agg::pixfmt_bgr24 pixf(rbuf_window()); //or another base_ren_type base_ren(pixf); renderer_type ren(base_ren, patt); //ren.scale_x(1.3); // Optional rasterizer_type ras(ren); //-- move_to/line_to interface ras.move_to_d(100, 150); ras.line_to_d(0, 0); ras.line_to_d(300, 200); //ras.line_to_d(10, 10); ras.render(false); //false means "don't close //the polygon", i.e. polyline //-- add_path interface //-- doesn't require invoking render() //ras.add_path(some_path); */ } virtual void on_idle() { m_start_angle += agg::deg2rad(m_step.value()); if(m_start_angle > agg::deg2rad(360.0)) m_start_angle -= agg::deg2rad(360.0); force_redraw(); } virtual void on_ctrl_change() { wait_mode(!m_rotate.status()); if(m_test.status()) { on_draw(); update_window(); pixfmt pf(rbuf_window()); renderer_base ren_base(pf); renderer_aa ren_aa(ren_base); renderer_prim ren_prim(ren_base); rasterizer_scanline ras_aa; scanline sl; rasterizer_outline ras_al(ren_prim); agg::line_profile_aa prof; prof.width(m_width.value()); renderer_oaa ren_oaa(ren_base, prof); rasterizer_outline_aa ras_oaa(ren_oaa); ras_oaa.line_join(m_accurate_joins.status() ? agg::outline_miter_accurate_join : agg::outline_round_join); ras_oaa.round_cap(true); pattern_filter filter; agg::pattern_pixmap_argb32 src(pixmap_chain); agg::line_image_scale src_scaled(src, m_width.value()); image_pattern pattern(filter); if(m_scale_pattern.status()) { pattern.create(src_scaled); } else { pattern.create(src); } renderer_img ren_img(ren_base, pattern); if(m_scale_pattern.status()) { ren_img.scale_x(src.height() / m_width.value()); } rasterizer_outline_img ras_img(ren_img); unsigned i; start_timer(); for(i = 0; i < 200; i++) { draw_aliased_subpix_accuracy(ras_al, ren_prim); m_start_angle += agg::deg2rad(m_step.value()); } double t2 = elapsed_time(); start_timer(); for(i = 0; i < 200; i++) { draw_anti_aliased_outline(ras_oaa, ren_oaa); m_start_angle += agg::deg2rad(m_step.value()); } double t3 = elapsed_time(); start_timer(); for(i = 0; i < 200; i++) { draw_anti_aliased_scanline(ras_aa, sl, ren_aa); m_start_angle += agg::deg2rad(m_step.value()); } double t4 = elapsed_time(); start_timer(); for(i = 0; i < 200; i++) { draw_anti_aliased_outline_img(ras_img, ren_img); m_start_angle += agg::deg2rad(m_step.value()); } double t5 = elapsed_time(); m_test.status(false); force_redraw(); char buf[256]; sprintf(buf, "Aliased=%1.2fms, Anti-Aliased=%1.2fms, Scanline=%1.2fms, Image-Pattern=%1.2fms", t2, t3, t4, t5); message(buf); } } }; int agg_main(int argc, char* argv[]) { the_application app(pix_format, flip_y); app.caption("AGG Example. Line Join"); if(app.init(500, 450, 0)) { return app.run(); } return 1; } agg-2.5+dfsg1/examples/rounded_rect.cpp0000644000000000000000000001114010703246330020252 0ustar00usergroup00000000000000#include #include "agg_basics.h" #include "agg_rendering_buffer.h" #include "agg_rasterizer_scanline_aa.h" #include "agg_scanline_p.h" #include "agg_renderer_scanline.h" #include "agg_pixfmt_rgb.h" #include "agg_gamma_lut.h" #include "agg_ellipse.h" #include "agg_rounded_rect.h" #include "agg_conv_stroke.h" #include "platform/agg_platform_support.h" #include "ctrl/agg_slider_ctrl.h" #include "ctrl/agg_cbox_ctrl.h" enum flip_y_e { flip_y = true }; class the_application : public agg::platform_support { double m_x[2]; double m_y[2]; double m_dx; double m_dy; int m_idx; agg::slider_ctrl m_radius; agg::slider_ctrl m_gamma; agg::slider_ctrl m_offset; agg::cbox_ctrl m_white_on_black; public: the_application(agg::pix_format_e format, bool flip_y) : agg::platform_support(format, flip_y), m_idx(-1), m_radius(10, 10, 600-10, 19, !flip_y), m_gamma(10, 10+20, 600-10, 19+20, !flip_y), m_offset(10, 10+40, 600-10, 19+40, !flip_y), m_white_on_black(10, 10+60, "White on black") { m_x[0] = 100; m_y[0] = 100; m_x[1] = 500; m_y[1] = 350; add_ctrl(m_radius); add_ctrl(m_gamma); add_ctrl(m_offset); add_ctrl(m_white_on_black); m_gamma.label("gamma=%4.3f"); m_gamma.range(0.0, 3.0); m_gamma.value(1.8); m_radius.label("radius=%4.3f"); m_radius.range(0.0, 50.0); m_radius.value(25.0); m_offset.label("subpixel offset=%4.3f"); m_offset.range(-2.0, 3.0); m_white_on_black.text_color(agg::rgba8(127, 127, 127)); m_white_on_black.inactive_color(agg::rgba8(127, 127, 127)); } virtual void on_draw() { typedef agg::gamma_lut gamma_lut_type; typedef agg::pixfmt_bgr24_gamma pixfmt; typedef agg::renderer_base renderer_base; typedef agg::renderer_scanline_aa_solid renderer_solid; gamma_lut_type gamma(m_gamma.value()); pixfmt pixf(rbuf_window(), gamma); renderer_base rb(pixf); renderer_solid ren(rb); rb.clear(m_white_on_black.status() ? agg::rgba(0,0,0) : agg::rgba(1,1,1)); agg::rasterizer_scanline_aa<> ras; agg::scanline_p8 sl; agg::ellipse e; // Render two "control" circles ren.color(agg::rgba8(127,127,127)); e.init(m_x[0], m_y[0], 3, 3, 16); ras.add_path(e); agg::render_scanlines(ras, sl, ren); e.init(m_x[1], m_y[1], 3, 3, 16); ras.add_path(e); agg::render_scanlines(ras, sl, ren); double d = m_offset.value(); // Creating a rounded rectangle agg::rounded_rect r(m_x[0]+d, m_y[0]+d, m_x[1]+d, m_y[1]+d, m_radius.value()); r.normalize_radius(); // Drawing as an outline agg::conv_stroke p(r); p.width(1.0); ras.add_path(p); ren.color(m_white_on_black.status() ? agg::rgba(1,1,1) : agg::rgba(0,0,0)); agg::render_scanlines(ras, sl, ren); ras.gamma(agg::gamma_none()); // Render the controls agg::render_ctrl(ras, sl, rb, m_radius); agg::render_ctrl(ras, sl, rb, m_gamma); agg::render_ctrl(ras, sl, rb, m_offset); agg::render_ctrl(ras, sl, rb, m_white_on_black); } virtual void on_mouse_button_down(int x, int y, unsigned flags) { if(flags & agg::mouse_left) { unsigned i; for (i = 0; i < 2; i++) { if(sqrt( (x-m_x[i]) * (x-m_x[i]) + (y-m_y[i]) * (y-m_y[i]) ) < 5.0) { m_dx = x - m_x[i]; m_dy = y - m_y[i]; m_idx = i; break; } } } } virtual void on_mouse_move(int x, int y, unsigned flags) { if(flags & agg::mouse_left) { if(m_idx >= 0) { m_x[m_idx] = x - m_dx; m_y[m_idx] = y - m_dy; force_redraw(); } } else { on_mouse_button_up(x, y, flags); } } virtual void on_mouse_button_up(int x, int y, unsigned flags) { m_idx = -1; } }; int agg_main(int argc, char* argv[]) { the_application app(agg::pix_format_bgr24, flip_y); app.caption("AGG Example. Rounded rectangle with gamma-correction & stuff"); if(app.init(600, 400, agg::window_resize)) { return app.run(); } return 1; } agg-2.5+dfsg1/examples/scanline_boolean.cpp0000644000000000000000000001562410703246330021103 0ustar00usergroup00000000000000#include #include #include #include "agg_basics.h" #include "agg_array.h" #include "agg_rendering_buffer.h" #include "agg_rasterizer_scanline_aa.h" #include "agg_scanline_p.h" #include "agg_scanline_u.h" #include "agg_scanline_bin.h" #include "agg_scanline_boolean_algebra.h" #include "agg_scanline_storage_aa.h" #include "agg_scanline_storage_bin.h" #include "agg_renderer_scanline.h" #include "agg_path_storage.h" #include "agg_conv_transform.h" #include "agg_ellipse.h" #include "ctrl/agg_rbox_ctrl.h" #include "ctrl/agg_cbox_ctrl.h" #include "ctrl/agg_slider_ctrl.h" #include "platform/agg_platform_support.h" #include "interactive_polygon.h" #define AGG_BGR24 //#define AGG_RGB24 //#define AGG_BGRA32 //#define AGG_RGBA32 //#define AGG_ARGB32 //#define AGG_ABGR32 //#define AGG_RGB565 //#define AGG_RGB555 #include "pixel_formats.h" enum flip_y_e { flip_y = true }; void generate_circles(agg::path_storage& ps, const double* quad, unsigned num_circles, double radius) { ps.remove_all(); unsigned i; for(i = 0; i < 4; ++i) { unsigned n1 = i * 2; unsigned n2 = (i < 3) ? i * 2 + 2 : 0; unsigned j; for(j = 0; j < num_circles; j++) { agg::ellipse ell(quad[n1] + (quad[n2] - quad[n1]) * j / num_circles, quad[n1 + 1] + (quad[n2 + 1] - quad[n1 + 1]) * j / num_circles, radius, radius, 100); ps.concat_path(ell); } } } class the_application : public agg::platform_support { public: typedef agg::renderer_base renderer_base; typedef agg::renderer_scanline_aa_solid renderer_solid; typedef agg::scanline_p8 scanline_type; agg::interactive_polygon m_quad1; agg::interactive_polygon m_quad2; agg::rbox_ctrl m_trans_type; agg::cbox_ctrl m_reset; agg::slider_ctrl m_mul1; agg::slider_ctrl m_mul2; the_application(agg::pix_format_e format, bool flip_y) : agg::platform_support(format, flip_y), m_quad1(4, 5.0), m_quad2(4, 5.0), m_trans_type(420, 5.0, 420+130.0, 145.0, !flip_y), m_reset (350, 5.0, "Reset", !flip_y), m_mul1 (5.0, 5.0, 340.0, 12.0, !flip_y), m_mul2 (5.0, 20.0, 340.0, 27.0, !flip_y) { m_trans_type.add_item("Union"); m_trans_type.add_item("Intersection"); m_trans_type.add_item("Linear XOR"); m_trans_type.add_item("Saddle XOR"); m_trans_type.add_item("Abs Diff XOR"); m_trans_type.add_item("A-B"); m_trans_type.add_item("B-A"); m_trans_type.cur_item(0); add_ctrl(m_trans_type); add_ctrl(m_reset); add_ctrl(m_mul1); add_ctrl(m_mul2); m_mul1.value(1.0); m_mul2.value(1.0); m_mul1.label("Opacity1=%.3f"); m_mul2.label("Opacity2=%.3f"); } virtual void on_init() { m_quad1.xn(0) = 50; m_quad1.yn(0) = 200 - 20; m_quad1.xn(1) = width() / 2 - 25; m_quad1.yn(1) = 200; m_quad1.xn(2) = width() / 2 - 25; m_quad1.yn(2) = height() - 50 - 20; m_quad1.xn(3) = 50; m_quad1.yn(3) = height() - 50; m_quad2.xn(0) = width() / 2 + 25; m_quad2.yn(0) = 200 - 20; m_quad2.xn(1) = width() - 50; m_quad2.yn(1) = 200; m_quad2.xn(2) = width() - 50; m_quad2.yn(2) = height() - 50 - 20; m_quad2.xn(3) = width() / 2 + 25; m_quad2.yn(3) = height() - 50; } virtual void on_draw() { pixfmt pixf(rbuf_window()); renderer_base rb(pixf); renderer_solid r(rb); rb.clear(agg::rgba(1, 1, 1)); scanline_type sl; agg::rasterizer_scanline_aa<> ras; agg::rasterizer_scanline_aa<> ras1; agg::rasterizer_scanline_aa<> ras2; agg::sbool_op_e op = (agg::sbool_op_e)m_trans_type.cur_item(); ras1.gamma(agg::gamma_multiply(m_mul1.value())); ras2.gamma(agg::gamma_multiply(m_mul2.value())); ras.clip_box(0, 0, width(), height()); agg::path_storage ps1; generate_circles(ps1, m_quad1.polygon(), 5, 20); agg::path_storage ps2; generate_circles(ps2, m_quad2.polygon(), 5, 20); ras1.filling_rule(agg::fill_even_odd); r.color(agg::rgba8(240, 255, 200, 100)); ras1.add_path(ps1); agg::render_scanlines(ras1, sl, r); r.color(agg::rgba8(255, 240, 240, 100)); ras2.add_path(ps2); agg::render_scanlines(ras2, sl, r); typedef agg::scanline_p8 sbool_scanline_type; typedef agg::renderer_scanline_aa_solid sbool_renderer_type; sbool_scanline_type sl_result; sbool_scanline_type sl1; sbool_scanline_type sl2; sbool_renderer_type sren(rb); sren.color(agg::rgba8(0, 0, 0)); agg::sbool_combine_shapes_aa(op, ras1, ras2, sl1, sl2, sl_result, sren); //-------------------------- // Render the "quad" tools and controls r.color(agg::rgba(0, 0.3, 0.5, 0.6)); ras.add_path(m_quad1); agg::render_scanlines(ras, sl, r); ras.add_path(m_quad2); agg::render_scanlines(ras, sl, r); agg::render_ctrl(ras, sl, rb, m_trans_type); agg::render_ctrl(ras, sl, rb, m_reset); agg::render_ctrl(ras, sl, rb, m_mul1); agg::render_ctrl(ras, sl, rb, m_mul2); //-------------------------- } virtual void on_mouse_button_down(int x, int y, unsigned flags) { if(flags & agg::mouse_left) { if(m_quad1.on_mouse_button_down(x, y) || m_quad2.on_mouse_button_down(x, y) ) { force_redraw(); } } } virtual void on_mouse_move(int x, int y, unsigned flags) { if(flags & agg::mouse_left) { if(m_quad1.on_mouse_move(x, y) || m_quad2.on_mouse_move(x, y) ) { force_redraw(); } } if((flags & agg::mouse_left) == 0) { on_mouse_button_up(x, y, flags); } } virtual void on_mouse_button_up(int x, int y, unsigned flags) { if(m_quad1.on_mouse_button_up(x, y) || m_quad2.on_mouse_button_up(x, y) ) { force_redraw(); } } virtual void on_ctrl_change() { if(m_reset.status()) { on_init(); m_reset.status(false); force_redraw(); } } }; int agg_main(int argc, char* argv[]) { the_application app(pix_format, flip_y); app.caption("AGG Example. Scanline Boolean"); if(app.init(800, 600, agg::window_resize)) { return app.run(); } return 1; } agg-2.5+dfsg1/examples/scanline_boolean2.cpp0000644000000000000000000005227210703246330021165 0ustar00usergroup00000000000000#include #include "agg_basics.h" #include "agg_rendering_buffer.h" #include "agg_rasterizer_scanline_aa.h" #include "agg_scanline_u.h" #include "agg_scanline_p.h" #include "agg_scanline_bin.h" #include "agg_renderer_scanline.h" #include "agg_renderer_primitives.h" #include "agg_span_solid.h" #include "agg_conv_curve.h" #include "agg_conv_stroke.h" #include "agg_gsv_text.h" #include "agg_pixfmt_rgb.h" #include "agg_scanline_boolean_algebra.h" #include "agg_scanline_storage_aa.h" #include "agg_scanline_storage_bin.h" #include "platform/agg_platform_support.h" #include "ctrl/agg_slider_ctrl.h" #include "ctrl/agg_cbox_ctrl.h" #include "ctrl/agg_rbox_ctrl.h" enum flip_y_e { flip_y = true }; class spiral { public: spiral(double x, double y, double r1, double r2, double step, double start_angle=0) : m_x(x), m_y(y), m_r1(r1), m_r2(r2), m_step(step), m_start_angle(start_angle), m_angle(start_angle), m_da(agg::deg2rad(4.0)), m_dr(m_step / 90.0) { } void rewind(unsigned) { m_angle = m_start_angle; m_curr_r = m_r1; m_start = true; } unsigned vertex(double* x, double* y) { if(m_curr_r > m_r2) return agg::path_cmd_stop; *x = m_x + cos(m_angle) * m_curr_r; *y = m_y + sin(m_angle) * m_curr_r; m_curr_r += m_dr; m_angle += m_da; if(m_start) { m_start = false; return agg::path_cmd_move_to; } return agg::path_cmd_line_to; } private: double m_x; double m_y; double m_r1; double m_r2; double m_step; double m_start_angle; double m_angle; double m_curr_r; double m_da; double m_dr; bool m_start; }; template unsigned count_spans(Rasterizer& ras, Scanline& sl) { unsigned n = 0; if(ras.rewind_scanlines()) { sl.reset(ras.min_x(), ras.max_x()); while(ras.sweep_scanline(sl)) { n += sl.num_spans(); } } return n; } void make_gb_poly(agg::path_storage& ps); void make_arrows(agg::path_storage& ps); class the_application : public agg::platform_support { typedef agg::pixfmt_bgr24 pixfmt_type; agg::rbox_ctrl m_polygons; agg::rbox_ctrl m_fill_rule; agg::rbox_ctrl m_scanline_type; agg::rbox_ctrl m_operation; double m_x; double m_y; public: the_application(agg::pix_format_e format, bool flip_y) : agg::platform_support(format, flip_y), m_polygons (5.0, 5.0, 5.0+205.0, 110.0, !flip_y), m_fill_rule (200, 5.0, 200+105.0, 50.0, !flip_y), m_scanline_type(300, 5.0, 300+115.0, 70.0, !flip_y), m_operation (535.0, 5.0, 535.0+115.0, 145.0, !flip_y) { m_operation.add_item("None"); m_operation.add_item("OR"); m_operation.add_item("AND"); m_operation.add_item("XOR Linear"); m_operation.add_item("XOR Saddle"); m_operation.add_item("A-B"); m_operation.add_item("B-A"); m_operation.cur_item(2); add_ctrl(m_operation); m_operation.no_transform(); m_fill_rule.add_item("Even-Odd"); m_fill_rule.add_item("Non Zero"); m_fill_rule.cur_item(1); add_ctrl(m_fill_rule); m_fill_rule.no_transform(); m_scanline_type.add_item("scanline_p"); m_scanline_type.add_item("scanline_u"); m_scanline_type.add_item("scanline_bin"); m_scanline_type.cur_item(1); add_ctrl(m_scanline_type); m_scanline_type.no_transform(); m_polygons.add_item("Two Simple Paths"); m_polygons.add_item("Closed Stroke"); m_polygons.add_item("Great Britain and Arrows"); m_polygons.add_item("Great Britain and Spiral"); m_polygons.add_item("Spiral and Glyph"); m_polygons.cur_item(3); add_ctrl(m_polygons); m_polygons.no_transform(); } template void render_scanline_boolean(Rasterizer& ras1, Rasterizer& ras2) { if(m_operation.cur_item() > 0) { agg::sbool_op_e op; switch(m_operation.cur_item()) { case 1: op = agg::sbool_or; break; case 2: op = agg::sbool_and; break; case 3: op = agg::sbool_xor; break; case 4: op = agg::sbool_xor_saddle;break; case 5: op = agg::sbool_a_minus_b; break; case 6: op = agg::sbool_b_minus_a; break; } typedef agg::renderer_base renderer_base; pixfmt_type pixf(rbuf_window()); renderer_base rb(pixf); double t1 = 0.0; double t2 = 0.0; unsigned num_spans = 0; switch(m_scanline_type.cur_item()) { case 0: { typedef agg::renderer_scanline_aa_solid renderer_solid; typedef agg::scanline_p8 scanline_type; renderer_solid ren(rb); scanline_type sl; scanline_type sl1; scanline_type sl2; // The intermediate storage is used only to test the perfoprmance, // the short variant can be as follows: // ------------------------ // ren.color(agg::rgba(0.5, 0.0, 0, 0.5)); // agg::sbool_combine_shapes_aa(op, ras1, ras2, sl1, sl2, sl, ren); agg::scanline_storage_aa8 storage; agg::scanline_storage_aa8 storage1; agg::scanline_storage_aa8 storage2; agg::render_scanlines(ras1, sl, storage1); agg::render_scanlines(ras2, sl, storage2); start_timer(); for(int i = 0; i < 10; i++) { agg::sbool_combine_shapes_aa(op, storage1, storage2, sl1, sl2, sl, storage); } t1 = elapsed_time() / 10.0; start_timer(); ren.color(agg::rgba(0.5, 0.0, 0, 0.5)); agg::render_scanlines(storage, sl, ren); t2 = elapsed_time(); num_spans = count_spans(storage, sl); } break; case 1: { typedef agg::renderer_scanline_aa_solid renderer_solid; typedef agg::scanline_u8 scanline_type; renderer_solid ren(rb); scanline_type sl; scanline_type sl1; scanline_type sl2; agg::scanline_storage_aa8 storage; agg::scanline_storage_aa8 storage1; agg::scanline_storage_aa8 storage2; agg::render_scanlines(ras1, sl, storage1); agg::render_scanlines(ras2, sl, storage2); start_timer(); for(int i = 0; i < 10; i++) { agg::sbool_combine_shapes_aa(op, storage1, storage2, sl1, sl2, sl, storage); } t1 = elapsed_time() / 10.0; start_timer(); ren.color(agg::rgba(0.5, 0.0, 0, 0.5)); agg::render_scanlines(storage, sl, ren); t2 = elapsed_time(); num_spans = count_spans(storage, sl); } break; case 2: { typedef agg::renderer_scanline_bin_solid renderer_solid; typedef agg::scanline_bin scanline_type; renderer_solid ren(rb); scanline_type sl; scanline_type sl1; scanline_type sl2; agg::scanline_storage_bin storage; agg::scanline_storage_bin storage1; agg::scanline_storage_bin storage2; agg::render_scanlines(ras1, sl, storage1); agg::render_scanlines(ras2, sl, storage2); start_timer(); for(int i = 0; i < 10; i++) { agg::sbool_combine_shapes_bin(op, storage1, storage2, sl1, sl2, sl, storage); } t1 = elapsed_time() / 10.0; start_timer(); ren.color(agg::rgba(0.5, 0.0, 0, 0.5)); agg::render_scanlines(storage, sl, ren); t2 = elapsed_time(); num_spans = count_spans(storage, sl); } break; } char buf[100]; sprintf(buf, "Combine=%.3fms\n\nRender=%.3fms\n\nnum_spans=%d", t1, t2, num_spans); agg::renderer_scanline_aa_solid ren(rb); agg::scanline_p8 sl; agg::gsv_text txt; agg::conv_stroke txt_stroke(txt); txt_stroke.width(1.0); txt_stroke.line_cap(agg::round_cap); txt.size(8.0); txt.start_point(420, 40); txt.text(buf); ras1.add_path(txt_stroke); ren.color(agg::rgba(0.0, 0.0, 0.0)); agg::render_scanlines(ras1, sl, ren); } } template unsigned render_sbool(Rasterizer& ras1, Rasterizer& ras2) { pixfmt_type pf(rbuf_window()); agg::renderer_base rb(pf); agg::renderer_scanline_aa_solid > ren(rb); agg::scanline_p8 sl; ras1.filling_rule(m_fill_rule.cur_item() ? agg::fill_non_zero : agg::fill_even_odd); ras2.filling_rule(m_fill_rule.cur_item() ? agg::fill_non_zero : agg::fill_even_odd); switch(m_polygons.cur_item()) { case 0: { //------------------------------------ // Two simple paths // agg::path_storage ps1; agg::path_storage ps2; double x = m_x - initial_width()/2 + 100; double y = m_y - initial_height()/2 + 100; ps1.move_to(x+140, y+145); ps1.line_to(x+225, y+44); ps1.line_to(x+296, y+219); ps1.close_polygon(); ps1.line_to(x+226, y+289); ps1.line_to(x+82, y+292); ps1.move_to(x+220, y+222); ps1.line_to(x+363, y+249); ps1.line_to(x+265, y+331); ps1.move_to(x+242, y+243); ps1.line_to(x+325, y+261); ps1.line_to(x+268, y+309); ps1.move_to(x+259, y+259); ps1.line_to(x+273, y+288); ps1.line_to(x+298, y+266); ps2.move_to(100+32, 100+77); ps2.line_to(100+473, 100+263); ps2.line_to(100+351, 100+290); ps2.line_to(100+354, 100+374); ras1.reset(); ras1.add_path(ps1); ren.color(agg::rgba(0, 0, 0, 0.1)); agg::render_scanlines(ras1, sl, ren); ras2.reset(); ras2.add_path(ps2); ren.color(agg::rgba(0, 0.6, 0, 0.1)); agg::render_scanlines(ras2, sl, ren); render_scanline_boolean(ras1, ras2); } break; case 1: { //------------------------------------ // Closed stroke // agg::path_storage ps1; agg::path_storage ps2; agg::conv_stroke stroke(ps2); stroke.width(15.0); double x = m_x - initial_width()/2 + 100; double y = m_y - initial_height()/2 + 100; ps1.move_to(x+140, y+145); ps1.line_to(x+225, y+44); ps1.line_to(x+296, y+219); ps1.close_polygon(); ps1.line_to(x+226, y+289); ps1.line_to(x+82, y+292); ps1.move_to(x+220-50, y+222); ps1.line_to(x+363-50, y+249); ps1.line_to(x+265-50, y+331); ps1.close_polygon(); ps2.move_to(100+32, 100+77); ps2.line_to(100+473, 100+263); ps2.line_to(100+351, 100+290); ps2.line_to(100+354, 100+374); ps2.close_polygon(); ras1.reset(); ras1.add_path(ps1); ren.color(agg::rgba(0, 0, 0, 0.1)); agg::render_scanlines(ras1, sl, ren); ras2.reset(); ras2.add_path(stroke); ren.color(agg::rgba(0, 0.6, 0, 0.1)); agg::render_scanlines(ras2, sl, ren); render_scanline_boolean(ras1, ras2); } break; case 2: { //------------------------------------ // Great Britain and Arrows // agg::path_storage gb_poly; agg::path_storage arrows; make_gb_poly(gb_poly); make_arrows(arrows); agg::trans_affine mtx1; agg::trans_affine mtx2; mtx1 *= agg::trans_affine_translation(-1150, -1150); mtx1 *= agg::trans_affine_scaling(2.0); mtx2 = mtx1; mtx2 *= agg::trans_affine_translation(m_x - initial_width()/2, m_y - initial_height()/2); agg::conv_transform trans_gb_poly(gb_poly, mtx1); agg::conv_transform trans_arrows(arrows, mtx2); ras2.add_path(trans_gb_poly); ren.color(agg::rgba(0.5, 0.5, 0, 0.1)); agg::render_scanlines(ras2, sl, ren); agg::conv_stroke > stroke_gb_poly(trans_gb_poly); stroke_gb_poly.width(0.1); ras1.add_path(stroke_gb_poly); ren.color(agg::rgba(0, 0, 0)); agg::render_scanlines(ras1, sl, ren); ras2.add_path(trans_arrows); ren.color(agg::rgba(0.0, 0.5, 0.5, 0.1)); agg::render_scanlines(ras2, sl, ren); ras1.reset(); ras1.add_path(trans_gb_poly); render_scanline_boolean(ras1, ras2); } break; case 3: { //------------------------------------ // Great Britain and a Spiral // spiral sp(m_x, m_y, 10, 150, 30, 0.0); agg::conv_stroke stroke(sp); stroke.width(15.0); agg::path_storage gb_poly; make_gb_poly(gb_poly); agg::trans_affine mtx; mtx *= agg::trans_affine_translation(-1150, -1150); mtx *= agg::trans_affine_scaling(2.0); mtx *= trans_affine_resizing(); agg::conv_transform trans_gb_poly(gb_poly, mtx); ras1.add_path(trans_gb_poly); ren.color(agg::rgba(0.5, 0.5, 0, 0.1)); agg::render_scanlines(ras1, sl, ren); agg::conv_stroke > stroke_gb_poly(trans_gb_poly); stroke_gb_poly.width(0.1); ras1.reset(); ras1.add_path(stroke_gb_poly); ren.color(agg::rgba(0, 0, 0)); agg::render_scanlines(ras1, sl, ren); ras2.reset(); ras2.add_path(stroke); ren.color(agg::rgba(0.0, 0.5, 0.5, 0.1)); agg::render_scanlines(ras2, sl, ren); ras1.reset(); ras1.add_path(trans_gb_poly); render_scanline_boolean(ras1, ras2); } break; case 4: { //------------------------------------ // Spiral and glyph // spiral sp(m_x, m_y, 10, 150, 30, 0.0); agg::conv_stroke stroke(sp); stroke.width(15.0); agg::path_storage glyph; glyph.move_to(28.47, 6.45); glyph.curve3(21.58, 1.12, 19.82, 0.29); glyph.curve3(17.19, -0.93, 14.21, -0.93); glyph.curve3(9.57, -0.93, 6.57, 2.25); glyph.curve3(3.56, 5.42, 3.56, 10.60); glyph.curve3(3.56, 13.87, 5.03, 16.26); glyph.curve3(7.03, 19.58, 11.99, 22.51); glyph.curve3(16.94, 25.44, 28.47, 29.64); glyph.line_to(28.47, 31.40); glyph.curve3(28.47, 38.09, 26.34, 40.58); glyph.curve3(24.22, 43.07, 20.17, 43.07); glyph.curve3(17.09, 43.07, 15.28, 41.41); glyph.curve3(13.43, 39.75, 13.43, 37.60); glyph.line_to(13.53, 34.77); glyph.curve3(13.53, 32.52, 12.38, 31.30); glyph.curve3(11.23, 30.08, 9.38, 30.08); glyph.curve3(7.57, 30.08, 6.42, 31.35); glyph.curve3(5.27, 32.62, 5.27, 34.81); glyph.curve3(5.27, 39.01, 9.57, 42.53); glyph.curve3(13.87, 46.04, 21.63, 46.04); glyph.curve3(27.59, 46.04, 31.40, 44.04); glyph.curve3(34.28, 42.53, 35.64, 39.31); glyph.curve3(36.52, 37.21, 36.52, 30.71); glyph.line_to(36.52, 15.53); glyph.curve3(36.52, 9.13, 36.77, 7.69); glyph.curve3(37.01, 6.25, 37.57, 5.76); glyph.curve3(38.13, 5.27, 38.87, 5.27); glyph.curve3(39.65, 5.27, 40.23, 5.62); glyph.curve3(41.26, 6.25, 44.19, 9.18); glyph.line_to(44.19, 6.45); glyph.curve3(38.72, -0.88, 33.74, -0.88); glyph.curve3(31.35, -0.88, 29.93, 0.78); glyph.curve3(28.52, 2.44, 28.47, 6.45); glyph.close_polygon(); glyph.move_to(28.47, 9.62); glyph.line_to(28.47, 26.66); glyph.curve3(21.09, 23.73, 18.95, 22.51); glyph.curve3(15.09, 20.36, 13.43, 18.02); glyph.curve3(11.77, 15.67, 11.77, 12.89); glyph.curve3(11.77, 9.38, 13.87, 7.06); glyph.curve3(15.97, 4.74, 18.70, 4.74); glyph.curve3(22.41, 4.74, 28.47, 9.62); glyph.close_polygon(); agg::trans_affine mtx; mtx *= agg::trans_affine_scaling(4.0); mtx *= agg::trans_affine_translation(220, 200); agg::conv_transform trans(glyph, mtx); agg::conv_curve > curve(trans); ras1.reset(); ras1.add_path(stroke); ren.color(agg::rgba(0, 0, 0, 0.1)); agg::render_scanlines(ras1, sl, ren); ras2.reset(); ras2.add_path(curve); ren.color(agg::rgba(0, 0.6, 0, 0.1)); agg::render_scanlines(ras2, sl, ren); render_scanline_boolean(ras1, ras2); } break; } return 0; } virtual void on_init() { m_x = width() / 2.0; m_y = height() / 2.0; } virtual void on_draw() { typedef agg::renderer_base base_ren_type; typedef agg::renderer_scanline_aa_solid renderer_solid; agg::pixfmt_bgr24 pf(rbuf_window()); base_ren_type ren_base(pf); renderer_solid ren_solid(ren_base); ren_base.clear(agg::rgba(1,1,1)); agg::scanline_u8 sl; agg::rasterizer_scanline_aa<> ras; agg::rasterizer_scanline_aa<> ras2; agg::render_ctrl(ras, sl, ren_base, m_polygons); agg::render_ctrl(ras, sl, ren_base, m_fill_rule); agg::render_ctrl(ras, sl, ren_base, m_scanline_type); agg::render_ctrl(ras, sl, ren_base, m_operation); render_sbool(ras, ras2); } virtual void on_mouse_button_down(int x, int y, unsigned flags) { if(flags & agg::mouse_left) { m_x = x; m_y = y; force_redraw(); } if(flags & agg::mouse_right) { char buf[100]; sprintf(buf, "%d %d", x, y); message(buf); } } virtual void on_mouse_move(int x, int y, unsigned flags) { if(flags & agg::mouse_left) { m_x = x; m_y = y; force_redraw(); } } }; int agg_main(int argc, char* argv[]) { the_application app(agg::pix_format_bgr24, flip_y); app.caption("AGG Example. Scanline Boolean"); if(app.init(655, 520, agg::window_resize)) { return app.run(); } return 1; } agg-2.5+dfsg1/examples/simple_blur.cpp0000644000000000000000000001705110703246330020121 0ustar00usergroup00000000000000#include #include #include #include "agg_basics.h" #include "agg_rendering_buffer.h" #include "agg_rasterizer_scanline_aa.h" #include "agg_rasterizer_outline.h" #include "agg_path_storage.h" #include "agg_conv_stroke.h" #include "agg_conv_transform.h" #include "agg_bounding_rect.h" #include "agg_scanline_u.h" #include "agg_scanline_p.h" #include "agg_pixfmt_rgb.h" #include "agg_renderer_base.h" #include "agg_renderer_outline_aa.h" #include "agg_rasterizer_outline_aa.h" #include "agg_renderer_scanline.h" #include "agg_span_allocator.h" #include "agg_ellipse.h" #include "platform/agg_platform_support.h" enum flip_y_e { flip_y = true }; agg::path_storage g_path; agg::rgba8 g_colors[100]; unsigned g_path_idx[100]; unsigned g_npaths = 0; double g_x1 = 0; double g_y1 = 0; double g_x2 = 0; double g_y2 = 0; double g_base_dx = 0; double g_base_dy = 0; double g_angle = 0; double g_scale = 1.0; double g_skew_x = 0; double g_skew_y = 0; int g_nclick = 0; unsigned parse_lion(agg::path_storage& ps, agg::rgba8* colors, unsigned* path_idx); void parse_lion() { g_npaths = parse_lion(g_path, g_colors, g_path_idx); agg::pod_array_adaptor path_idx(g_path_idx, 100); agg::bounding_rect(g_path, path_idx, 0, g_npaths, &g_x1, &g_y1, &g_x2, &g_y2); g_base_dx = (g_x2 - g_x1) / 2.0; g_base_dy = (g_y2 - g_y1) / 2.0; } namespace agg { template class span_simple_blur_rgb24 { public: //-------------------------------------------------------------------- typedef rgba8 color_type; //-------------------------------------------------------------------- span_simple_blur_rgb24() : m_source_image(0) {} //-------------------------------------------------------------------- span_simple_blur_rgb24(const rendering_buffer& src) : m_source_image(&src) {} //-------------------------------------------------------------------- void source_image(const rendering_buffer& src) { m_source_image = &src; } const rendering_buffer& source_image() const { return *m_source_image; } //-------------------------------------------------------------------- void prepare() {} //-------------------------------------------------------------------- void generate(color_type* span, int x, int y, int len) { if(y < 1 || y >= int(m_source_image->height() - 1)) { do { *span++ = rgba8(0,0,0,0); } while(--len); return; } do { int color[4]; color[0] = color[1] = color[2] = color[3] = 0; if(x > 0 && x < int(m_source_image->width()-1)) { int i = 3; do { const int8u* ptr = m_source_image->row_ptr(y - i + 2) + (x - 1) * 3; color[0] += *ptr++; color[1] += *ptr++; color[2] += *ptr++; color[3] += 255; color[0] += *ptr++; color[1] += *ptr++; color[2] += *ptr++; color[3] += 255; color[0] += *ptr++; color[1] += *ptr++; color[2] += *ptr++; color[3] += 255; } while(--i); color[0] /= 9; color[1] /= 9; color[2] /= 9; color[3] /= 9; } *span++ = rgba8(color[Order::R], color[Order::G], color[Order::B], color[3]); ++x; } while(--len); } private: const rendering_buffer* m_source_image; }; } class the_application : public agg::platform_support { double m_cx; double m_cy; public: virtual ~the_application() { } the_application(agg::pix_format_e format, bool flip_y) : agg::platform_support(format, flip_y), m_cx(100), m_cy(102) { parse_lion(); } virtual void on_resize(int cx, int cy) { } virtual void on_draw() { typedef agg::pixfmt_bgr24 pixfmt; typedef agg::renderer_base renderer_base; typedef agg::renderer_scanline_aa_solid renderer_solid; pixfmt pixf(rbuf_window()); renderer_base rb(pixf); renderer_solid rs(rb); rb.clear(agg::rgba(1, 1, 1)); agg::trans_affine mtx; agg::conv_transform trans(g_path, mtx); mtx *= agg::trans_affine_translation(-g_base_dx, -g_base_dy); mtx *= agg::trans_affine_scaling(g_scale, g_scale); mtx *= agg::trans_affine_rotation(g_angle + agg::pi); mtx *= agg::trans_affine_skewing(g_skew_x/1000.0, g_skew_y/1000.0); mtx *= agg::trans_affine_translation(initial_width()/4, initial_height()/2); mtx *= trans_affine_resizing(); agg::rasterizer_scanline_aa<> ras2; agg::scanline_p8 sl; agg::scanline_u8 sl2; agg::render_all_paths(ras2, sl, rs, trans, g_colors, g_path_idx, g_npaths); mtx *= ~trans_affine_resizing(); mtx *= agg::trans_affine_translation(initial_width()/2, 0); mtx *= trans_affine_resizing(); agg::line_profile_aa profile; profile.width(1.0); agg::renderer_outline_aa rp(rb, profile); agg::rasterizer_outline_aa > ras(rp); ras.round_cap(true); ras.render_all_paths(trans, g_colors, g_path_idx, g_npaths); agg::ellipse ell(m_cx, m_cy, 100.0, 100.0, 100); agg::conv_stroke ell_stroke1(ell); ell_stroke1.width(6.0); agg::conv_stroke > ell_stroke2(ell_stroke1); ell_stroke2.width(2.0); rs.color(agg::rgba(0,0.2,0)); ras2.add_path(ell_stroke2); agg::render_scanlines(ras2, sl, rs); typedef agg::span_simple_blur_rgb24 span_blur_gen; typedef agg::span_allocator span_blur_alloc; span_blur_alloc sa; span_blur_gen sg; sg.source_image(rbuf_img(0)); ras2.add_path(ell); copy_window_to_img(0); agg::render_scanlines_aa(ras2, sl2, rb, sa, sg); // More blur if desired :-) //copy_window_to_img(0); //agg::render_scanlines(ras2, sl2, rblur); //copy_window_to_img(0); //agg::render_scanlines(ras2, sl2, rblur); //copy_window_to_img(0); //agg::render_scanlines(ras2, sl2, rblur); } virtual void on_mouse_button_down(int x, int y, unsigned flags) { if(flags & agg::mouse_left) { m_cx = x; m_cy = y; force_redraw(); } } virtual void on_mouse_move(int x, int y, unsigned flags) { on_mouse_button_down(x, y, flags); } }; int agg_main(int argc, char* argv[]) { the_application app(agg::pix_format_bgr24, flip_y); app.caption("AGG Example. Lion with Alpha-Masking"); if(app.init(512, 400, agg::window_resize)) { return app.run(); } return 1; } agg-2.5+dfsg1/examples/svg_viewer/0000755000000000000000000000000010703246330017254 5ustar00usergroup00000000000000agg-2.5+dfsg1/examples/svg_viewer/agg_svg_exception.h0000644000000000000000000000332710703246330023125 0ustar00usergroup00000000000000//---------------------------------------------------------------------------- // Anti-Grain Geometry - Version 2.3 // Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com) // // Permission to copy, use, modify, sell and distribute this software // is granted provided this copyright notice appears in all copies. // This software is provided "as is" without express or implied // warranty, and with no claim as to its suitability for any purpose. // //---------------------------------------------------------------------------- // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://www.antigrain.com //---------------------------------------------------------------------------- // // SVG exception // //---------------------------------------------------------------------------- #ifndef AGG_SVG_EXCEPTION_INCLUDED #define AGG_SVG_EXCEPTION_INCLUDED #include #include #include namespace agg { namespace svg { class exception { public: ~exception() { delete [] m_msg; } exception() : m_msg(0) {} exception(const char* fmt, ...) : m_msg(0) { if(fmt) { m_msg = new char [4096]; va_list arg; va_start(arg, fmt); vsprintf(m_msg, fmt, arg); va_end(arg); } } exception(const exception& exc) : m_msg(exc.m_msg ? new char[strlen(exc.m_msg) + 1] : 0) { if(m_msg) strcpy(m_msg, exc.m_msg); } const char* msg() const { return m_msg; } private: char* m_msg; }; } } #endif agg-2.5+dfsg1/examples/svg_viewer/agg_svg_parser.cpp0000644000000000000000000006556410703246330022771 0ustar00usergroup00000000000000//---------------------------------------------------------------------------- // Anti-Grain Geometry - Version 2.3 // Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com) // // Permission to copy, use, modify, sell and distribute this software // is granted provided this copyright notice appears in all copies. // This software is provided "as is" without express or implied // warranty, and with no claim as to its suitability for any purpose. // //---------------------------------------------------------------------------- // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://www.antigrain.com //---------------------------------------------------------------------------- // // SVG parser. // //---------------------------------------------------------------------------- #include #include #include #include "agg_svg_parser.h" #include "expat.h" namespace agg { namespace svg { struct named_color { char name[22]; int8u r, g, b, a; }; named_color colors[] = { { "aliceblue",240,248,255, 255 }, { "antiquewhite",250,235,215, 255 }, { "aqua",0,255,255, 255 }, { "aquamarine",127,255,212, 255 }, { "azure",240,255,255, 255 }, { "beige",245,245,220, 255 }, { "bisque",255,228,196, 255 }, { "black",0,0,0, 255 }, { "blanchedalmond",255,235,205, 255 }, { "blue",0,0,255, 255 }, { "blueviolet",138,43,226, 255 }, { "brown",165,42,42, 255 }, { "burlywood",222,184,135, 255 }, { "cadetblue",95,158,160, 255 }, { "chartreuse",127,255,0, 255 }, { "chocolate",210,105,30, 255 }, { "coral",255,127,80, 255 }, { "cornflowerblue",100,149,237, 255 }, { "cornsilk",255,248,220, 255 }, { "crimson",220,20,60, 255 }, { "cyan",0,255,255, 255 }, { "darkblue",0,0,139, 255 }, { "darkcyan",0,139,139, 255 }, { "darkgoldenrod",184,134,11, 255 }, { "darkgray",169,169,169, 255 }, { "darkgreen",0,100,0, 255 }, { "darkgrey",169,169,169, 255 }, { "darkkhaki",189,183,107, 255 }, { "darkmagenta",139,0,139, 255 }, { "darkolivegreen",85,107,47, 255 }, { "darkorange",255,140,0, 255 }, { "darkorchid",153,50,204, 255 }, { "darkred",139,0,0, 255 }, { "darksalmon",233,150,122, 255 }, { "darkseagreen",143,188,143, 255 }, { "darkslateblue",72,61,139, 255 }, { "darkslategray",47,79,79, 255 }, { "darkslategrey",47,79,79, 255 }, { "darkturquoise",0,206,209, 255 }, { "darkviolet",148,0,211, 255 }, { "deeppink",255,20,147, 255 }, { "deepskyblue",0,191,255, 255 }, { "dimgray",105,105,105, 255 }, { "dimgrey",105,105,105, 255 }, { "dodgerblue",30,144,255, 255 }, { "firebrick",178,34,34, 255 }, { "floralwhite",255,250,240, 255 }, { "forestgreen",34,139,34, 255 }, { "fuchsia",255,0,255, 255 }, { "gainsboro",220,220,220, 255 }, { "ghostwhite",248,248,255, 255 }, { "gold",255,215,0, 255 }, { "goldenrod",218,165,32, 255 }, { "gray",128,128,128, 255 }, { "green",0,128,0, 255 }, { "greenyellow",173,255,47, 255 }, { "grey",128,128,128, 255 }, { "honeydew",240,255,240, 255 }, { "hotpink",255,105,180, 255 }, { "indianred",205,92,92, 255 }, { "indigo",75,0,130, 255 }, { "ivory",255,255,240, 255 }, { "khaki",240,230,140, 255 }, { "lavender",230,230,250, 255 }, { "lavenderblush",255,240,245, 255 }, { "lawngreen",124,252,0, 255 }, { "lemonchiffon",255,250,205, 255 }, { "lightblue",173,216,230, 255 }, { "lightcoral",240,128,128, 255 }, { "lightcyan",224,255,255, 255 }, { "lightgoldenrodyellow",250,250,210, 255 }, { "lightgray",211,211,211, 255 }, { "lightgreen",144,238,144, 255 }, { "lightgrey",211,211,211, 255 }, { "lightpink",255,182,193, 255 }, { "lightsalmon",255,160,122, 255 }, { "lightseagreen",32,178,170, 255 }, { "lightskyblue",135,206,250, 255 }, { "lightslategray",119,136,153, 255 }, { "lightslategrey",119,136,153, 255 }, { "lightsteelblue",176,196,222, 255 }, { "lightyellow",255,255,224, 255 }, { "lime",0,255,0, 255 }, { "limegreen",50,205,50, 255 }, { "linen",250,240,230, 255 }, { "magenta",255,0,255, 255 }, { "maroon",128,0,0, 255 }, { "mediumaquamarine",102,205,170, 255 }, { "mediumblue",0,0,205, 255 }, { "mediumorchid",186,85,211, 255 }, { "mediumpurple",147,112,219, 255 }, { "mediumseagreen",60,179,113, 255 }, { "mediumslateblue",123,104,238, 255 }, { "mediumspringgreen",0,250,154, 255 }, { "mediumturquoise",72,209,204, 255 }, { "mediumvioletred",199,21,133, 255 }, { "midnightblue",25,25,112, 255 }, { "mintcream",245,255,250, 255 }, { "mistyrose",255,228,225, 255 }, { "moccasin",255,228,181, 255 }, { "navajowhite",255,222,173, 255 }, { "navy",0,0,128, 255 }, { "oldlace",253,245,230, 255 }, { "olive",128,128,0, 255 }, { "olivedrab",107,142,35, 255 }, { "orange",255,165,0, 255 }, { "orangered",255,69,0, 255 }, { "orchid",218,112,214, 255 }, { "palegoldenrod",238,232,170, 255 }, { "palegreen",152,251,152, 255 }, { "paleturquoise",175,238,238, 255 }, { "palevioletred",219,112,147, 255 }, { "papayawhip",255,239,213, 255 }, { "peachpuff",255,218,185, 255 }, { "peru",205,133,63, 255 }, { "pink",255,192,203, 255 }, { "plum",221,160,221, 255 }, { "powderblue",176,224,230, 255 }, { "purple",128,0,128, 255 }, { "red",255,0,0, 255 }, { "rosybrown",188,143,143, 255 }, { "royalblue",65,105,225, 255 }, { "saddlebrown",139,69,19, 255 }, { "salmon",250,128,114, 255 }, { "sandybrown",244,164,96, 255 }, { "seagreen",46,139,87, 255 }, { "seashell",255,245,238, 255 }, { "sienna",160,82,45, 255 }, { "silver",192,192,192, 255 }, { "skyblue",135,206,235, 255 }, { "slateblue",106,90,205, 255 }, { "slategray",112,128,144, 255 }, { "slategrey",112,128,144, 255 }, { "snow",255,250,250, 255 }, { "springgreen",0,255,127, 255 }, { "steelblue",70,130,180, 255 }, { "tan",210,180,140, 255 }, { "teal",0,128,128, 255 }, { "thistle",216,191,216, 255 }, { "tomato",255,99,71, 255 }, { "turquoise",64,224,208, 255 }, { "violet",238,130,238, 255 }, { "wheat",245,222,179, 255 }, { "white",255,255,255, 255 }, { "whitesmoke",245,245,245, 255 }, { "yellow",255,255,0, 255 }, { "yellowgreen",154,205,50, 255 }, { "zzzzzzzzzzz",0,0,0, 0 } }; //------------------------------------------------------------------------ parser::~parser() { delete [] m_attr_value; delete [] m_attr_name; delete [] m_buf; delete [] m_title; } //------------------------------------------------------------------------ parser::parser(path_renderer& path) : m_path(path), m_tokenizer(), m_buf(new char[buf_size]), m_title(new char[256]), m_title_len(0), m_title_flag(false), m_path_flag(false), m_attr_name(new char[128]), m_attr_value(new char[1024]), m_attr_name_len(127), m_attr_value_len(1023) { m_title[0] = 0; } //------------------------------------------------------------------------ void parser::parse(const char* fname) { char msg[1024]; XML_Parser p = XML_ParserCreate(NULL); if(p == 0) { throw exception("Couldn't allocate memory for parser"); } XML_SetUserData(p, this); XML_SetElementHandler(p, start_element, end_element); XML_SetCharacterDataHandler(p, content); FILE* fd = fopen(fname, "r"); if(fd == 0) { sprintf(msg, "Couldn't open file %s", fname); throw exception(msg); } bool done = false; do { size_t len = fread(m_buf, 1, buf_size, fd); done = len < buf_size; if(!XML_Parse(p, m_buf, len, done)) { sprintf(msg, "%s at line %d\n", XML_ErrorString(XML_GetErrorCode(p)), XML_GetCurrentLineNumber(p)); throw exception(msg); } } while(!done); fclose(fd); XML_ParserFree(p); char* ts = m_title; while(*ts) { if(*ts < ' ') *ts = ' '; ++ts; } } //------------------------------------------------------------------------ void parser::start_element(void* data, const char* el, const char** attr) { parser& self = *(parser*)data; if(strcmp(el, "title") == 0) { self.m_title_flag = true; } else if(strcmp(el, "g") == 0) { self.m_path.push_attr(); self.parse_attr(attr); } else if(strcmp(el, "path") == 0) { if(self.m_path_flag) { throw exception("start_element: Nested path"); } self.m_path.begin_path(); self.parse_path(attr); self.m_path.end_path(); self.m_path_flag = true; } else if(strcmp(el, "rect") == 0) { self.parse_rect(attr); } else if(strcmp(el, "line") == 0) { self.parse_line(attr); } else if(strcmp(el, "polyline") == 0) { self.parse_poly(attr, false); } else if(strcmp(el, "polygon") == 0) { self.parse_poly(attr, true); } //else //if(strcmp(el, "") == 0) //{ //} // . . . } //------------------------------------------------------------------------ void parser::end_element(void* data, const char* el) { parser& self = *(parser*)data; if(strcmp(el, "title") == 0) { self.m_title_flag = false; } else if(strcmp(el, "g") == 0) { self.m_path.pop_attr(); } else if(strcmp(el, "path") == 0) { self.m_path_flag = false; } //else //if(strcmp(el, "") == 0) //{ //} // . . . } //------------------------------------------------------------------------ void parser::content(void* data, const char* s, int len) { parser& self = *(parser*)data; // m_title_flag signals that the tag is being parsed now. // The following code concatenates the pieces of content of the <title> tag. if(self.m_title_flag) { if(len + self.m_title_len > 255) len = 255 - self.m_title_len; if(len > 0) { memcpy(self.m_title + self.m_title_len, s, len); self.m_title_len += len; self.m_title[self.m_title_len] = 0; } } } //------------------------------------------------------------------------ void parser::parse_attr(const char** attr) { int i; for(i = 0; attr[i]; i += 2) { if(strcmp(attr[i], "style") == 0) { parse_style(attr[i + 1]); } else { parse_attr(attr[i], attr[i + 1]); } } } //------------------------------------------------------------- void parser::parse_path(const char** attr) { int i; for(i = 0; attr[i]; i += 2) { // The <path> tag can consist of the path itself ("d=") // as well as of other parameters like "style=", "transform=", etc. // In the last case we simply rely on the function of parsing // attributes (see 'else' branch). if(strcmp(attr[i], "d") == 0) { m_tokenizer.set_path_str(attr[i + 1]); m_path.parse_path(m_tokenizer); } else { // Create a temporary single pair "name-value" in order // to avoid multiple calls for the same attribute. const char* tmp[4]; tmp[0] = attr[i]; tmp[1] = attr[i + 1]; tmp[2] = 0; tmp[3] = 0; parse_attr(tmp); } } } //------------------------------------------------------------- int cmp_color(const void* p1, const void* p2) { return strcmp(((named_color*)p1)->name, ((named_color*)p2)->name); } //------------------------------------------------------------- rgba8 parse_color(const char* str) { while(*str == ' ') ++str; unsigned c = 0; if(*str == '#') { sscanf(str + 1, "%x", &c); return rgb8_packed(c); } else { named_color c; unsigned len = strlen(str); if(len > sizeof(c.name) - 1) { throw exception("parse_color: Invalid color name '%s'", str); } strcpy(c.name, str); const void* p = bsearch(&c, colors, sizeof(colors) / sizeof(colors[0]), sizeof(colors[0]), cmp_color); if(p == 0) { throw exception("parse_color: Invalid color name '%s'", str); } const named_color* pc = (const named_color*)p; return rgba8(pc->r, pc->g, pc->b, pc->a); } } double parse_double(const char* str) { while(*str == ' ') ++str; return atof(str); } //------------------------------------------------------------- bool parser::parse_attr(const char* name, const char* value) { if(strcmp(name, "style") == 0) { parse_style(value); } else if(strcmp(name, "fill") == 0) { if(strcmp(value, "none") == 0) { m_path.fill_none(); } else { m_path.fill(parse_color(value)); } } else if(strcmp(name, "fill-opacity") == 0) { m_path.fill_opacity(parse_double(value)); } else if(strcmp(name, "stroke") == 0) { if(strcmp(value, "none") == 0) { m_path.stroke_none(); } else { m_path.stroke(parse_color(value)); } } else if(strcmp(name, "stroke-width") == 0) { m_path.stroke_width(parse_double(value)); } else if(strcmp(name, "stroke-linecap") == 0) { if(strcmp(value, "butt") == 0) m_path.line_cap(butt_cap); else if(strcmp(value, "round") == 0) m_path.line_cap(round_cap); else if(strcmp(value, "square") == 0) m_path.line_cap(square_cap); } else if(strcmp(name, "stroke-linejoin") == 0) { if(strcmp(value, "miter") == 0) m_path.line_join(miter_join); else if(strcmp(value, "round") == 0) m_path.line_join(round_join); else if(strcmp(value, "bevel") == 0) m_path.line_join(bevel_join); } else if(strcmp(name, "stroke-miterlimit") == 0) { m_path.miter_limit(parse_double(value)); } else if(strcmp(name, "stroke-opacity") == 0) { m_path.stroke_opacity(parse_double(value)); } else if(strcmp(name, "transform") == 0) { parse_transform(value); } //else //if(strcmp(el, "<OTHER_ATTRIBUTES>") == 0) //{ //} // . . . else { return false; } return true; } //------------------------------------------------------------- void parser::copy_name(const char* start, const char* end) { unsigned len = unsigned(end - start); if(m_attr_name_len == 0 || len > m_attr_name_len) { delete [] m_attr_name; m_attr_name = new char[len + 1]; m_attr_name_len = len; } if(len) memcpy(m_attr_name, start, len); m_attr_name[len] = 0; } //------------------------------------------------------------- void parser::copy_value(const char* start, const char* end) { unsigned len = unsigned(end - start); if(m_attr_value_len == 0 || len > m_attr_value_len) { delete [] m_attr_value; m_attr_value = new char[len + 1]; m_attr_value_len = len; } if(len) memcpy(m_attr_value, start, len); m_attr_value[len] = 0; } //------------------------------------------------------------- bool parser::parse_name_value(const char* nv_start, const char* nv_end) { const char* str = nv_start; while(str < nv_end && *str != ':') ++str; const char* val = str; // Right Trim while(str > nv_start && (*str == ':' || isspace(*str))) --str; ++str; copy_name(nv_start, str); while(val < nv_end && (*val == ':' || isspace(*val))) ++val; copy_value(val, nv_end); return parse_attr(m_attr_name, m_attr_value); } //------------------------------------------------------------- void parser::parse_style(const char* str) { while(*str) { // Left Trim while(*str && isspace(*str)) ++str; const char* nv_start = str; while(*str && *str != ';') ++str; const char* nv_end = str; // Right Trim while(nv_end > nv_start && (*nv_end == ';' || isspace(*nv_end))) --nv_end; ++nv_end; parse_name_value(nv_start, nv_end); if(*str) ++str; } } //------------------------------------------------------------- void parser::parse_rect(const char** attr) { int i; double x = 0.0; double y = 0.0; double w = 0.0; double h = 0.0; m_path.begin_path(); for(i = 0; attr[i]; i += 2) { if(!parse_attr(attr[i], attr[i + 1])) { if(strcmp(attr[i], "x") == 0) x = parse_double(attr[i + 1]); if(strcmp(attr[i], "y") == 0) y = parse_double(attr[i + 1]); if(strcmp(attr[i], "width") == 0) w = parse_double(attr[i + 1]); if(strcmp(attr[i], "height") == 0) h = parse_double(attr[i + 1]); // rx - to be implemented // ry - to be implemented } } if(w != 0.0 && h != 0.0) { if(w < 0.0) throw exception("parse_rect: Invalid width: %f", w); if(h < 0.0) throw exception("parse_rect: Invalid height: %f", h); m_path.move_to(x, y); m_path.line_to(x + w, y); m_path.line_to(x + w, y + h); m_path.line_to(x, y + h); m_path.close_subpath(); } m_path.end_path(); } //------------------------------------------------------------- void parser::parse_line(const char** attr) { int i; double x1 = 0.0; double y1 = 0.0; double x2 = 0.0; double y2 = 0.0; m_path.begin_path(); for(i = 0; attr[i]; i += 2) { if(!parse_attr(attr[i], attr[i + 1])) { if(strcmp(attr[i], "x1") == 0) x1 = parse_double(attr[i + 1]); if(strcmp(attr[i], "y1") == 0) y1 = parse_double(attr[i + 1]); if(strcmp(attr[i], "x2") == 0) x2 = parse_double(attr[i + 1]); if(strcmp(attr[i], "y2") == 0) y2 = parse_double(attr[i + 1]); } } m_path.move_to(x1, y1); m_path.line_to(x2, y2); m_path.end_path(); } //------------------------------------------------------------- void parser::parse_poly(const char** attr, bool close_flag) { int i; double x = 0.0; double y = 0.0; m_path.begin_path(); for(i = 0; attr[i]; i += 2) { if(!parse_attr(attr[i], attr[i + 1])) { if(strcmp(attr[i], "points") == 0) { m_tokenizer.set_path_str(attr[i + 1]); if(!m_tokenizer.next()) { throw exception("parse_poly: Too few coordinates"); } x = m_tokenizer.last_number(); if(!m_tokenizer.next()) { throw exception("parse_poly: Too few coordinates"); } y = m_tokenizer.last_number(); m_path.move_to(x, y); while(m_tokenizer.next()) { x = m_tokenizer.last_number(); if(!m_tokenizer.next()) { throw exception("parse_poly: Odd number of coordinates"); } y = m_tokenizer.last_number(); m_path.line_to(x, y); } } } } if(close_flag) { m_path.close_subpath(); } m_path.end_path(); } //------------------------------------------------------------- void parser::parse_transform(const char* str) { while(*str) { if(islower(*str)) { if(strncmp(str, "matrix", 6) == 0) str += parse_matrix(str); else if(strncmp(str, "translate", 9) == 0) str += parse_translate(str); else if(strncmp(str, "rotate", 6) == 0) str += parse_rotate(str); else if(strncmp(str, "scale", 5) == 0) str += parse_scale(str); else if(strncmp(str, "skewX", 5) == 0) str += parse_skew_x(str); else if(strncmp(str, "skewY", 5) == 0) str += parse_skew_y(str); else { ++str; } } else { ++str; } } } //------------------------------------------------------------- static bool is_numeric(char c) { return strchr("0123456789+-.eE", c) != 0; } //------------------------------------------------------------- static unsigned parse_transform_args(const char* str, double* args, unsigned max_na, unsigned* na) { *na = 0; const char* ptr = str; while(*ptr && *ptr != '(') ++ptr; if(*ptr == 0) { throw exception("parse_transform_args: Invalid syntax"); } const char* end = ptr; while(*end && *end != ')') ++end; if(*end == 0) { throw exception("parse_transform_args: Invalid syntax"); } while(ptr < end) { if(is_numeric(*ptr)) { if(*na >= max_na) { throw exception("parse_transform_args: Too many arguments"); } args[(*na)++] = atof(ptr); while(ptr < end && is_numeric(*ptr)) ++ptr; } else { ++ptr; } } return unsigned(end - str); } //------------------------------------------------------------- unsigned parser::parse_matrix(const char* str) { double args[6]; unsigned na = 0; unsigned len = parse_transform_args(str, args, 6, &na); if(na != 6) { throw exception("parse_matrix: Invalid number of arguments"); } m_path.transform().premultiply(trans_affine(args[0], args[1], args[2], args[3], args[4], args[5])); return len; } //------------------------------------------------------------- unsigned parser::parse_translate(const char* str) { double args[2]; unsigned na = 0; unsigned len = parse_transform_args(str, args, 2, &na); if(na == 1) args[1] = 0.0; m_path.transform().premultiply(trans_affine_translation(args[0], args[1])); return len; } //------------------------------------------------------------- unsigned parser::parse_rotate(const char* str) { double args[3]; unsigned na = 0; unsigned len = parse_transform_args(str, args, 3, &na); if(na == 1) { m_path.transform().premultiply(trans_affine_rotation(deg2rad(args[0]))); } else if(na == 3) { trans_affine t = trans_affine_translation(-args[1], -args[2]); t *= trans_affine_rotation(deg2rad(args[0])); t *= trans_affine_translation(args[1], args[2]); m_path.transform().premultiply(t); } else { throw exception("parse_rotate: Invalid number of arguments"); } return len; } //------------------------------------------------------------- unsigned parser::parse_scale(const char* str) { double args[2]; unsigned na = 0; unsigned len = parse_transform_args(str, args, 2, &na); if(na == 1) args[1] = args[0]; m_path.transform().premultiply(trans_affine_scaling(args[0], args[1])); return len; } //------------------------------------------------------------- unsigned parser::parse_skew_x(const char* str) { double arg; unsigned na = 0; unsigned len = parse_transform_args(str, &arg, 1, &na); m_path.transform().premultiply(trans_affine_skewing(deg2rad(arg), 0.0)); return len; } //------------------------------------------------------------- unsigned parser::parse_skew_y(const char* str) { double arg; unsigned na = 0; unsigned len = parse_transform_args(str, &arg, 1, &na); m_path.transform().premultiply(trans_affine_skewing(0.0, deg2rad(arg))); return len; } } } ��������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/svg_viewer/agg_svg_parser.h��������������������������������������������������0000644�0000000�0000000�00000005361�10703246330�022423� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry - Version 2.3 // Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com) // // Permission to copy, use, modify, sell and distribute this software // is granted provided this copyright notice appears in all copies. // This software is provided "as is" without express or implied // warranty, and with no claim as to its suitability for any purpose. // //---------------------------------------------------------------------------- // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://www.antigrain.com //---------------------------------------------------------------------------- // // SVG parser. // //---------------------------------------------------------------------------- #ifndef AGG_SVG_PARSER_INCLUDED #define AGG_SVG_PARSER_INCLUDED #include "agg_svg_path_tokenizer.h" #include "agg_svg_path_renderer.h" namespace agg { namespace svg { class parser { enum buf_size_e { buf_size = BUFSIZ }; public: ~parser(); parser(path_renderer& path); void parse(const char* fname); const char* title() const { return m_title; } private: // XML event handlers static void start_element(void* data, const char* el, const char** attr); static void end_element(void* data, const char* el); static void content(void* data, const char* s, int len); void parse_attr(const char** attr); void parse_path(const char** attr); void parse_poly(const char** attr, bool close_flag); void parse_rect(const char** attr); void parse_line(const char** attr); void parse_style(const char* str); void parse_transform(const char* str); unsigned parse_matrix(const char* str); unsigned parse_translate(const char* str); unsigned parse_rotate(const char* str); unsigned parse_scale(const char* str); unsigned parse_skew_x(const char* str); unsigned parse_skew_y(const char* str); bool parse_attr(const char* name, const char* value); bool parse_name_value(const char* nv_start, const char* nv_end); void copy_name(const char* start, const char* end); void copy_value(const char* start, const char* end); private: path_renderer& m_path; path_tokenizer m_tokenizer; char* m_buf; char* m_title; unsigned m_title_len; bool m_title_flag; bool m_path_flag; char* m_attr_name; char* m_attr_value; unsigned m_attr_name_len; unsigned m_attr_value_len; }; } } #endif �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/svg_viewer/agg_svg_path_renderer.cpp�����������������������������������������0000644�0000000�0000000�00000026260�10703246330�024305� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry - Version 2.3 // Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com) // // Permission to copy, use, modify, sell and distribute this software // is granted provided this copyright notice appears in all copies. // This software is provided "as is" without express or implied // warranty, and with no claim as to its suitability for any purpose. // //---------------------------------------------------------------------------- // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://www.antigrain.com //---------------------------------------------------------------------------- // // SVG path renderer. // //---------------------------------------------------------------------------- #include <stdio.h> #include "agg_svg_path_renderer.h" namespace agg { namespace svg { //------------------------------------------------------------------------ path_renderer::path_renderer() : m_curved(m_storage), m_curved_count(m_curved), m_curved_stroked(m_curved_count), m_curved_stroked_trans(m_curved_stroked, m_transform), m_curved_trans(m_curved_count, m_transform), m_curved_trans_contour(m_curved_trans) { m_curved_trans_contour.auto_detect_orientation(false); } //------------------------------------------------------------------------ void path_renderer::remove_all() { m_storage.remove_all(); m_attr_storage.remove_all(); m_attr_stack.remove_all(); m_transform.reset(); } //------------------------------------------------------------------------ void path_renderer::begin_path() { push_attr(); unsigned idx = m_storage.start_new_path(); m_attr_storage.add(path_attributes(cur_attr(), idx)); } //------------------------------------------------------------------------ void path_renderer::end_path() { if(m_attr_storage.size() == 0) { throw exception("end_path : The path was not begun"); } path_attributes attr = cur_attr(); unsigned idx = m_attr_storage[m_attr_storage.size() - 1].index; attr.index = idx; m_attr_storage[m_attr_storage.size() - 1] = attr; pop_attr(); } //------------------------------------------------------------------------ void path_renderer::move_to(double x, double y, bool rel) // M, m { if(rel) m_storage.rel_to_abs(&x, &y); m_storage.move_to(x, y); } //------------------------------------------------------------------------ void path_renderer::line_to(double x, double y, bool rel) // L, l { if(rel) m_storage.rel_to_abs(&x, &y); m_storage.line_to(x, y); } //------------------------------------------------------------------------ void path_renderer::hline_to(double x, bool rel) // H, h { double x2 = 0.0; double y2 = 0.0; if(m_storage.total_vertices()) { m_storage.vertex(m_storage.total_vertices() - 1, &x2, &y2); if(rel) x += x2; m_storage.line_to(x, y2); } } //------------------------------------------------------------------------ void path_renderer::vline_to(double y, bool rel) // V, v { double x2 = 0.0; double y2 = 0.0; if(m_storage.total_vertices()) { m_storage.vertex(m_storage.total_vertices() - 1, &x2, &y2); if(rel) y += y2; m_storage.line_to(x2, y); } } //------------------------------------------------------------------------ void path_renderer::curve3(double x1, double y1, // Q, q double x, double y, bool rel) { if(rel) { m_storage.rel_to_abs(&x1, &y1); m_storage.rel_to_abs(&x, &y); } m_storage.curve3(x1, y1, x, y); } //------------------------------------------------------------------------ void path_renderer::curve3(double x, double y, bool rel) // T, t { // throw exception("curve3(x, y) : NOT IMPLEMENTED YET"); if(rel) { m_storage.curve3_rel(x, y); } else { m_storage.curve3(x, y); } } //------------------------------------------------------------------------ void path_renderer::curve4(double x1, double y1, // C, c double x2, double y2, double x, double y, bool rel) { if(rel) { m_storage.rel_to_abs(&x1, &y1); m_storage.rel_to_abs(&x2, &y2); m_storage.rel_to_abs(&x, &y); } m_storage.curve4(x1, y1, x2, y2, x, y); } //------------------------------------------------------------------------ void path_renderer::curve4(double x2, double y2, // S, s double x, double y, bool rel) { //throw exception("curve4(x2, y2, x, y) : NOT IMPLEMENTED YET"); if(rel) { m_storage.curve4_rel(x2, y2, x, y); } else { m_storage.curve4(x2, y2, x, y); } } //------------------------------------------------------------------------ void path_renderer::close_subpath() { m_storage.end_poly(path_flags_close); } //------------------------------------------------------------------------ path_attributes& path_renderer::cur_attr() { if(m_attr_stack.size() == 0) { throw exception("cur_attr : Attribute stack is empty"); } return m_attr_stack[m_attr_stack.size() - 1]; } //------------------------------------------------------------------------ void path_renderer::push_attr() { m_attr_stack.add(m_attr_stack.size() ? m_attr_stack[m_attr_stack.size() - 1] : path_attributes()); } //------------------------------------------------------------------------ void path_renderer::pop_attr() { if(m_attr_stack.size() == 0) { throw exception("pop_attr : Attribute stack is empty"); } m_attr_stack.remove_last(); } //------------------------------------------------------------------------ void path_renderer::fill(const rgba8& f) { path_attributes& attr = cur_attr(); attr.fill_color = f; attr.fill_flag = true; } //------------------------------------------------------------------------ void path_renderer::stroke(const rgba8& s) { path_attributes& attr = cur_attr(); attr.stroke_color = s; attr.stroke_flag = true; } //------------------------------------------------------------------------ void path_renderer::even_odd(bool flag) { cur_attr().even_odd_flag = flag; } //------------------------------------------------------------------------ void path_renderer::stroke_width(double w) { cur_attr().stroke_width = w; } //------------------------------------------------------------------------ void path_renderer::fill_none() { cur_attr().fill_flag = false; } //------------------------------------------------------------------------ void path_renderer::stroke_none() { cur_attr().stroke_flag = false; } //------------------------------------------------------------------------ void path_renderer::fill_opacity(double op) { cur_attr().fill_color.opacity(op); } //------------------------------------------------------------------------ void path_renderer::stroke_opacity(double op) { cur_attr().stroke_color.opacity(op); } //------------------------------------------------------------------------ void path_renderer::line_join(line_join_e join) { cur_attr().line_join = join; } //------------------------------------------------------------------------ void path_renderer::line_cap(line_cap_e cap) { cur_attr().line_cap = cap; } //------------------------------------------------------------------------ void path_renderer::miter_limit(double ml) { cur_attr().miter_limit = ml; } //------------------------------------------------------------------------ trans_affine& path_renderer::transform() { return cur_attr().transform; } //------------------------------------------------------------------------ void path_renderer::parse_path(path_tokenizer& tok) { while(tok.next()) { double arg[10]; char cmd = tok.last_command(); unsigned i; switch(cmd) { case 'M': case 'm': arg[0] = tok.last_number(); arg[1] = tok.next(cmd); move_to(arg[0], arg[1], cmd == 'm'); break; case 'L': case 'l': arg[0] = tok.last_number(); arg[1] = tok.next(cmd); line_to(arg[0], arg[1], cmd == 'l'); break; case 'V': case 'v': vline_to(tok.last_number(), cmd == 'v'); break; case 'H': case 'h': hline_to(tok.last_number(), cmd == 'h'); break; case 'Q': case 'q': arg[0] = tok.last_number(); for(i = 1; i < 4; i++) { arg[i] = tok.next(cmd); } curve3(arg[0], arg[1], arg[2], arg[3], cmd == 'q'); break; case 'T': case 't': arg[0] = tok.last_number(); arg[1] = tok.next(cmd); curve3(arg[0], arg[1], cmd == 't'); break; case 'C': case 'c': arg[0] = tok.last_number(); for(i = 1; i < 6; i++) { arg[i] = tok.next(cmd); } curve4(arg[0], arg[1], arg[2], arg[3], arg[4], arg[5], cmd == 'c'); break; case 'S': case 's': arg[0] = tok.last_number(); for(i = 1; i < 4; i++) { arg[i] = tok.next(cmd); } curve4(arg[0], arg[1], arg[2], arg[3], cmd == 's'); break; case 'A': case 'a': throw exception("parse_path: Command A: NOT IMPLEMENTED YET"); case 'Z': case 'z': close_subpath(); break; default: { char buf[100]; sprintf(buf, "parse_path: Invalid Command %c", cmd); throw exception(buf); } } } } } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/svg_viewer/agg_svg_path_renderer.h�������������������������������������������0000644�0000000�0000000�00000025666�10703246330�023763� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry - Version 2.3 // Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com) // // Permission to copy, use, modify, sell and distribute this software // is granted provided this copyright notice appears in all copies. // This software is provided "as is" without express or implied // warranty, and with no claim as to its suitability for any purpose. // //---------------------------------------------------------------------------- // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://www.antigrain.com //---------------------------------------------------------------------------- // // SVG path renderer. // //---------------------------------------------------------------------------- #ifndef AGG_SVG_PATH_RENDERER_INCLUDED #define AGG_SVG_PATH_RENDERER_INCLUDED #include "agg_path_storage.h" #include "agg_conv_transform.h" #include "agg_conv_stroke.h" #include "agg_conv_contour.h" #include "agg_conv_curve.h" #include "agg_color_rgba.h" #include "agg_renderer_scanline.h" #include "agg_bounding_rect.h" #include "agg_rasterizer_scanline_aa.h" #include "agg_svg_path_tokenizer.h" namespace agg { namespace svg { template<class VertexSource> class conv_count { public: conv_count(VertexSource& vs) : m_source(&vs), m_count(0) {} void count(unsigned n) { m_count = n; } unsigned count() const { return m_count; } void rewind(unsigned path_id) { m_source->rewind(path_id); } unsigned vertex(double* x, double* y) { ++m_count; return m_source->vertex(x, y); } private: VertexSource* m_source; unsigned m_count; }; //============================================================================ // Basic path attributes struct path_attributes { unsigned index; rgba8 fill_color; rgba8 stroke_color; bool fill_flag; bool stroke_flag; bool even_odd_flag; line_join_e line_join; line_cap_e line_cap; double miter_limit; double stroke_width; trans_affine transform; // Empty constructor path_attributes() : index(0), fill_color(rgba(0,0,0)), stroke_color(rgba(0,0,0)), fill_flag(true), stroke_flag(false), even_odd_flag(false), line_join(miter_join), line_cap(butt_cap), miter_limit(4.0), stroke_width(1.0), transform() { } // Copy constructor path_attributes(const path_attributes& attr) : index(attr.index), fill_color(attr.fill_color), stroke_color(attr.stroke_color), fill_flag(attr.fill_flag), stroke_flag(attr.stroke_flag), even_odd_flag(attr.even_odd_flag), line_join(attr.line_join), line_cap(attr.line_cap), miter_limit(attr.miter_limit), stroke_width(attr.stroke_width), transform(attr.transform) { } // Copy constructor with new index value path_attributes(const path_attributes& attr, unsigned idx) : index(idx), fill_color(attr.fill_color), stroke_color(attr.stroke_color), fill_flag(attr.fill_flag), stroke_flag(attr.stroke_flag), even_odd_flag(attr.even_odd_flag), line_join(attr.line_join), line_cap(attr.line_cap), miter_limit(attr.miter_limit), stroke_width(attr.stroke_width), transform(attr.transform) { } }; //============================================================================ // Path container and renderer. class path_renderer { public: typedef pod_bvector<path_attributes> attr_storage; typedef conv_curve<path_storage> curved; typedef conv_count<curved> curved_count; typedef conv_stroke<curved_count> curved_stroked; typedef conv_transform<curved_stroked> curved_stroked_trans; typedef conv_transform<curved_count> curved_trans; typedef conv_contour<curved_trans> curved_trans_contour; path_renderer(); void remove_all(); // Use these functions as follows: // begin_path() when the XML tag <path> comes ("start_element" handler) // parse_path() on "d=" tag attribute // end_path() when parsing of the entire tag is done. void begin_path(); void parse_path(path_tokenizer& tok); void end_path(); // The following functions are essentially a "reflection" of // the respective SVG path commands. void move_to(double x, double y, bool rel=false); // M, m void line_to(double x, double y, bool rel=false); // L, l void hline_to(double x, bool rel=false); // H, h void vline_to(double y, bool rel=false); // V, v void curve3(double x1, double y1, // Q, q double x, double y, bool rel=false); void curve3(double x, double y, bool rel=false); // T, t void curve4(double x1, double y1, // C, c double x2, double y2, double x, double y, bool rel=false); void curve4(double x2, double y2, // S, s double x, double y, bool rel=false); void close_subpath(); // Z, z // template<class VertexSource> // void add_path(VertexSource& vs, // unsigned path_id = 0, // bool solid_path = true) // { // m_storage.add_path(vs, path_id, solid_path); // } unsigned vertex_count() const { return m_curved_count.count(); } // Call these functions on <g> tag (start_element, end_element respectively) void push_attr(); void pop_attr(); // Attribute setting functions. void fill(const rgba8& f); void stroke(const rgba8& s); void even_odd(bool flag); void stroke_width(double w); void fill_none(); void stroke_none(); void fill_opacity(double op); void stroke_opacity(double op); void line_join(line_join_e join); void line_cap(line_cap_e cap); void miter_limit(double ml); trans_affine& transform(); // Make all polygons CCW-oriented void arrange_orientations() { m_storage.arrange_orientations_all_paths(path_flags_ccw); } // Expand all polygons void expand(double value) { m_curved_trans_contour.width(value); } unsigned operator [](unsigned idx) { m_transform = m_attr_storage[idx].transform; return m_attr_storage[idx].index; } void bounding_rect(double* x1, double* y1, double* x2, double* y2) { agg::conv_transform<agg::path_storage> trans(m_storage, m_transform); agg::bounding_rect(trans, *this, 0, m_attr_storage.size(), x1, y1, x2, y2); } // Rendering. One can specify two additional parameters: // trans_affine and opacity. They can be used to transform the whole // image and/or to make it translucent. template<class Rasterizer, class Scanline, class Renderer> void render(Rasterizer& ras, Scanline& sl, Renderer& ren, const trans_affine& mtx, const rect_i& cb, double opacity=1.0) { unsigned i; ras.clip_box(cb.x1, cb.y1, cb.x2, cb.y2); m_curved_count.count(0); for(i = 0; i < m_attr_storage.size(); i++) { const path_attributes& attr = m_attr_storage[i]; m_transform = attr.transform; m_transform *= mtx; double scl = m_transform.scale(); //m_curved.approximation_method(curve_inc); m_curved.approximation_scale(scl); m_curved.angle_tolerance(0.0); rgba8 color; if(attr.fill_flag) { ras.reset(); ras.filling_rule(attr.even_odd_flag ? fill_even_odd : fill_non_zero); if(fabs(m_curved_trans_contour.width()) < 0.0001) { ras.add_path(m_curved_trans, attr.index); } else { m_curved_trans_contour.miter_limit(attr.miter_limit); ras.add_path(m_curved_trans_contour, attr.index); } color = attr.fill_color; color.opacity(color.opacity() * opacity); ren.color(color); agg::render_scanlines(ras, sl, ren); } if(attr.stroke_flag) { m_curved_stroked.width(attr.stroke_width); //m_curved_stroked.line_join((attr.line_join == miter_join) ? miter_join_round : attr.line_join); m_curved_stroked.line_join(attr.line_join); m_curved_stroked.line_cap(attr.line_cap); m_curved_stroked.miter_limit(attr.miter_limit); m_curved_stroked.inner_join(inner_round); m_curved_stroked.approximation_scale(scl); // If the *visual* line width is considerable we // turn on processing of curve cusps. //--------------------- if(attr.stroke_width * scl > 1.0) { m_curved.angle_tolerance(0.2); } ras.reset(); ras.filling_rule(fill_non_zero); ras.add_path(m_curved_stroked_trans, attr.index); color = attr.stroke_color; color.opacity(color.opacity() * opacity); ren.color(color); agg::render_scanlines(ras, sl, ren); } } } private: path_attributes& cur_attr(); path_storage m_storage; attr_storage m_attr_storage; attr_storage m_attr_stack; trans_affine m_transform; curved m_curved; curved_count m_curved_count; curved_stroked m_curved_stroked; curved_stroked_trans m_curved_stroked_trans; curved_trans m_curved_trans; curved_trans_contour m_curved_trans_contour; }; } } #endif ��������������������������������������������������������������������������agg-2.5+dfsg1/examples/svg_viewer/agg_svg_path_tokenizer.cpp����������������������������������������0000644�0000000�0000000�00000010310�10703246330�024476� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry - Version 2.3 // Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com) // // Permission to copy, use, modify, sell and distribute this software // is granted provided this copyright notice appears in all copies. // This software is provided "as is" without express or implied // warranty, and with no claim as to its suitability for any purpose. // //---------------------------------------------------------------------------- // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://www.antigrain.com //---------------------------------------------------------------------------- // // SVG path tokenizer. // //---------------------------------------------------------------------------- #include <string.h> #include <stdlib.h> #include <stdio.h> #include "agg_svg_exception.h" #include "agg_svg_path_tokenizer.h" namespace agg { namespace svg { //------------------------------------------------------------------------ const char path_tokenizer::s_commands[] = "+-MmZzLlHhVvCcSsQqTtAaFfPp"; const char path_tokenizer::s_numeric[] = ".Ee0123456789"; const char path_tokenizer::s_separators[] = " ,\t\n\r"; //------------------------------------------------------------------------ path_tokenizer::path_tokenizer() : m_path(0), m_last_command(0), m_last_number(0.0) { init_char_mask(m_commands_mask, s_commands); init_char_mask(m_numeric_mask, s_numeric); init_char_mask(m_separators_mask, s_separators); } //------------------------------------------------------------------------ void path_tokenizer::set_path_str(const char* str) { m_path = str; m_last_command = 0; m_last_number = 0.0; } //------------------------------------------------------------------------ void path_tokenizer::init_char_mask(char* mask, const char* char_set) { memset(mask, 0, 256/8); while(*char_set) { unsigned c = unsigned(*char_set++) & 0xFF; mask[c >> 3] |= 1 << (c & 7); } } //------------------------------------------------------------------------ bool path_tokenizer::next() { if(m_path == 0) return false; // Skip all white spaces and other garbage while(*m_path && !is_command(*m_path) && !is_numeric(*m_path)) { if(!is_separator(*m_path)) { char buf[100]; sprintf(buf, "path_tokenizer::next : Invalid Character %c", *m_path); throw exception(buf); } m_path++; } if(*m_path == 0) return false; if(is_command(*m_path)) { // Check if the command is a numeric sign character if(*m_path == '-' || *m_path == '+') { return parse_number(); } m_last_command = *m_path++; while(*m_path && is_separator(*m_path)) m_path++; if(*m_path == 0) return true; } return parse_number(); } //------------------------------------------------------------------------ double path_tokenizer::next(char cmd) { if(!next()) throw exception("parse_path: Unexpected end of path"); if(last_command() != cmd) { char buf[100]; sprintf(buf, "parse_path: Command %c: bad or missing parameters", cmd); throw exception(buf); } return last_number(); } //------------------------------------------------------------------------ bool path_tokenizer::parse_number() { char buf[256]; // Should be enough for any number char* buf_ptr = buf; // Copy all sign characters while(buf_ptr < buf+255 && *m_path == '-' || *m_path == '+') { *buf_ptr++ = *m_path++; } // Copy all numeric characters while(buf_ptr < buf+255 && is_numeric(*m_path)) { *buf_ptr++ = *m_path++; } *buf_ptr = 0; m_last_number = atof(buf); return true; } } //namespace svg } //namespace agg ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/svg_viewer/agg_svg_path_tokenizer.h������������������������������������������0000644�0000000�0000000�00000007221�10703246330�024152� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry - Version 2.3 // Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com) // // Permission to copy, use, modify, sell and distribute this software // is granted provided this copyright notice appears in all copies. // This software is provided "as is" without express or implied // warranty, and with no claim as to its suitability for any purpose. // //---------------------------------------------------------------------------- // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://www.antigrain.com //---------------------------------------------------------------------------- // // SVG path tokenizer. // //---------------------------------------------------------------------------- #ifndef AGG_SVG_PATH_TOKENIZER_INCLUDED #define AGG_SVG_PATH_TOKENIZER_INCLUDED #include "agg_svg_exception.h" namespace agg { namespace svg { // SVG path tokenizer. // Example: // // agg::svg::path_tokenizer tok; // // tok.set_str("M-122.304 84.285L-122.304 84.285 122.203 86.179 "); // while(tok.next()) // { // printf("command='%c' number=%f\n", // tok.last_command(), // tok.last_number()); // } // // The tokenizer does all the routine job of parsing the SVG paths. // It doesn't recognize any graphical primitives, it even doesn't know // anything about pairs of coordinates (X,Y). The purpose of this class // is to tokenize the numeric values and commands. SVG paths can // have single numeric values for Horizontal or Vertical line_to commands // as well as more than two coordinates (4 or 6) for Bezier curves // depending on the semantics of the command. // The behaviour is as follows: // // Each call to next() returns true if there's new command or new numeric // value or false when the path ends. How to interpret the result // depends on the sematics of the command. For example, command "C" // (cubic Bezier curve) implies 6 floating point numbers preceded by this // command. If the command assumes no arguments (like z or Z) the // the last_number() values won't change, that is, last_number() always // returns the last recognized numeric value, so does last_command(). //=============================================================== class path_tokenizer { public: path_tokenizer(); void set_path_str(const char* str); bool next(); double next(char cmd); char last_command() const { return m_last_command; } double last_number() const { return m_last_number; } private: static void init_char_mask(char* mask, const char* char_set); bool contains(const char* mask, unsigned c) const { return (mask[(c >> 3) & (256/8-1)] & (1 << (c & 7))) != 0; } bool is_command(unsigned c) const { return contains(m_commands_mask, c); } bool is_numeric(unsigned c) const { return contains(m_numeric_mask, c); } bool is_separator(unsigned c) const { return contains(m_separators_mask, c); } bool parse_number(); char m_separators_mask[256/8]; char m_commands_mask[256/8]; char m_numeric_mask[256/8]; const char* m_path; double m_last_number; char m_last_command; static const char s_commands[]; static const char s_numeric[]; static const char s_separators[]; }; } //namespace svg } //namespace agg #endif �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/svg_viewer/svg_test.cpp������������������������������������������������������0000644�0000000�0000000�00000015014�10703246330�021617� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#include <stdio.h> #include <stdlib.h> #include "agg_basics.h" #include "agg_rendering_buffer.h" #include "agg_rasterizer_scanline_aa.h" #include "agg_scanline_p.h" #include "agg_renderer_scanline.h" #include "agg_pixfmt_rgba.h" #include "platform/agg_platform_support.h" #include "ctrl/agg_slider_ctrl.h" #include "agg_svg_parser.h" //#include "agg_gamma_lut.h" enum { flip_y = false }; class the_application : public agg::platform_support { agg::svg::path_renderer m_path; agg::slider_ctrl<agg::rgba8> m_expand; agg::slider_ctrl<agg::rgba8> m_gamma; agg::slider_ctrl<agg::rgba8> m_scale; agg::slider_ctrl<agg::rgba8> m_rotate; double m_min_x; double m_min_y; double m_max_x; double m_max_y; double m_x; double m_y; double m_dx; double m_dy; bool m_drag_flag; public: the_application(agg::pix_format_e format, bool flip_y) : agg::platform_support(format, flip_y), m_path(), m_expand(5, 5, 256-5, 11, !flip_y), m_gamma (5, 5+15, 256-5, 11+15, !flip_y), m_scale (256+5, 5, 512-5, 11, !flip_y), m_rotate(256+5, 5+15, 512-5, 11+15, !flip_y), m_min_x(0.0), m_min_y(0.0), m_max_x(0.0), m_max_y(0.0), m_x(0.0), m_y(0.0), m_dx(0.0), m_dy(0.0), m_drag_flag(false) { add_ctrl(m_expand); add_ctrl(m_gamma); add_ctrl(m_scale); add_ctrl(m_rotate); m_expand.label("Expand=%3.2f"); m_expand.range(-1, 1.2); m_expand.value(0.0); m_gamma.label("Gamma=%3.2f"); m_gamma.range(0.0, 3.0); m_gamma.value(1.0); m_scale.label("Scale=%3.2f"); m_scale.range(0.2, 10.0); m_scale.value(1.0); m_rotate.label("Rotate=%3.2f"); m_rotate.range(-180.0, 180.0); m_rotate.value(0.0); } void parse_svg(const char* fname) { agg::svg::parser p(m_path); p.parse(fname); m_path.arrange_orientations(); m_path.bounding_rect(&m_min_x, &m_min_y, &m_max_x, &m_max_y); caption(p.title()); } virtual void on_resize(int cx, int cy) { } virtual void on_draw() { typedef agg::pixfmt_bgra32 pixfmt; typedef agg::renderer_base<pixfmt> renderer_base; typedef agg::renderer_scanline_aa_solid<renderer_base> renderer_solid; pixfmt pixf(rbuf_window()); renderer_base rb(pixf); renderer_solid ren(rb); rb.clear(agg::rgba(1,1,1)); agg::rasterizer_scanline_aa<> ras; agg::scanline_p8 sl; agg::trans_affine mtx; ras.gamma(agg::gamma_power(m_gamma.value())); mtx *= agg::trans_affine_translation((m_min_x + m_max_x) * -0.5, (m_min_y + m_max_y) * -0.5); mtx *= agg::trans_affine_scaling(m_scale.value()); mtx *= agg::trans_affine_rotation(agg::deg2rad(m_rotate.value())); mtx *= agg::trans_affine_translation((m_min_x + m_max_x) * 0.5 + m_x, (m_min_y + m_max_y) * 0.5 + m_y + 30); m_path.expand(m_expand.value()); start_timer(); m_path.render(ras, sl, ren, mtx, rb.clip_box(), 1.0); double tm = elapsed_time(); unsigned vertex_count = m_path.vertex_count(); ras.gamma(agg::gamma_none()); agg::render_ctrl(ras, sl, rb, m_expand); agg::render_ctrl(ras, sl, rb, m_gamma); agg::render_ctrl(ras, sl, rb, m_scale); agg::render_ctrl(ras, sl, rb, m_rotate); char buf[128]; agg::gsv_text t; t.size(10.0); t.flip(true); agg::conv_stroke<agg::gsv_text> pt(t); pt.width(1.5); sprintf(buf, "Vertices=%d Time=%.3f ms", vertex_count, tm); t.start_point(10.0, 40.0); t.text(buf); ras.add_path(pt); ren.color(agg::rgba(0,0,0)); agg::render_scanlines(ras, sl, ren); //agg::gamma_lut<> gl(m_gamma.value()); //unsigned x, y; //unsigned w = unsigned(width()); //unsigned h = unsigned(height()); //for(y = 0; y < h; y++) //{ // for(x = 0; x < w; x++) // { // agg::rgba8 c = rb.pixel(x, y); // c.r = gl.inv(c.r); // c.g = gl.inv(c.g); // c.b = gl.inv(c.b); // rb.copy_pixel(x, y, c); // } //} } virtual void on_mouse_button_down(int x, int y, unsigned flags) { m_dx = x - m_x; m_dy = y - m_y; m_drag_flag = true; } virtual void on_mouse_move(int x, int y, unsigned flags) { if(flags == 0) { m_drag_flag = false; } if(m_drag_flag) { m_x = x - m_dx; m_y = y - m_dy; force_redraw(); } } virtual void on_mouse_button_up(int x, int y, unsigned flags) { m_drag_flag = false; } virtual void on_key(int x, int y, unsigned key, unsigned flags) { if(key == ' ') { agg::trans_affine mtx; mtx *= agg::trans_affine_translation((m_min_x + m_max_x) * -0.5, (m_min_y + m_max_y) * -0.5); mtx *= agg::trans_affine_scaling(m_scale.value()); mtx *= agg::trans_affine_rotation(agg::deg2rad(m_rotate.value())); mtx *= agg::trans_affine_translation((m_min_x + m_max_x) * 0.5, (m_min_y + m_max_y) * 0.5); mtx *= agg::trans_affine_translation(m_x, m_y); double m[6]; mtx.store_to(m); char buf[128]; sprintf(buf, "%3.3f, %3.3f, %3.3f, %3.3f, %3.3f, %3.3f", m[0], m[1], m[2], m[3], m[4], m[5]); message(buf); FILE* fd = fopen(full_file_name("transform.txt"), "a"); fprintf(fd, "%s\n", buf); fclose(fd); } } }; int agg_main(int argc, char* argv[]) { the_application app(agg::pix_format_bgra32, flip_y); const char* fname = "tiger.svg"; if(argc <= 1) { FILE* fd = fopen(app.full_file_name(fname), "r"); if(fd == 0) { app.message("Usage: svg_test <svg_file>\n" "Download http://antigrain.com/svg/tiger.svg"); return 1; } fclose(fd); } else { fname = argv[1]; } try { app.parse_svg(app.full_file_name(fname)); } catch(agg::svg::exception& e) { app.message(e.msg()); return 1; } if(app.init(512, 600, agg::window_resize)) { return app.run(); } return 1; } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/trans_curve1.cpp�������������������������������������������������������������0000644�0000000�0000000�00000021232�10703246330�020214� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#include <stdlib.h> #include <ctype.h> #include <stdio.h> #include "agg_rendering_buffer.h" #include "agg_rasterizer_scanline_aa.h" #include "agg_scanline_p.h" #include "agg_renderer_scanline.h" #include "agg_conv_bspline.h" #include "agg_conv_segmentator.h" #include "agg_font_win32_tt.h" #include "agg_trans_single_path.h" #include "ctrl/agg_cbox_ctrl.h" #include "ctrl/agg_slider_ctrl.h" #include "platform/agg_platform_support.h" #include "interactive_polygon.h" #define AGG_BGR24 //#define AGG_RGB24 //#define AGG_BGRA32 //#define AGG_RGBA32 //#define AGG_ARGB32 //#define AGG_ABGR32 //#define AGG_RGB565 //#define AGG_RGB555 #include "pixel_formats.h" enum flip_y_e { flip_y = true }; static char text[] = "Anti-Grain Geometry is designed as a set of loosely coupled " "algorithms and class templates united with a common idea, " "so that all the components can be easily combined. Also, " "the template based design allows you to replace any part of " "the library without the necessity to modify a single byte in " "the existing code. "; class the_application : public agg::platform_support { public: typedef agg::renderer_base<pixfmt> renderer_base; typedef agg::renderer_scanline_aa_solid<renderer_base> renderer_solid; typedef agg::scanline_p8 scanline_type; typedef agg::font_engine_win32_tt_int16 font_engine_type; typedef agg::font_cache_manager<font_engine_type> font_manager_type; font_engine_type m_feng; font_manager_type m_fman; agg::interactive_polygon m_poly; agg::slider_ctrl<agg::rgba8> m_num_points; agg::cbox_ctrl<agg::rgba8> m_close; agg::cbox_ctrl<agg::rgba8> m_preserve_x_scale; agg::cbox_ctrl<agg::rgba8> m_fixed_len; agg::cbox_ctrl<agg::rgba8> m_animate; double m_dx[6]; double m_dy[6]; bool m_prev_animate; the_application(HDC dc, agg::pix_format_e format, bool flip_y) : agg::platform_support(format, flip_y), m_feng(dc), m_fman(m_feng), m_poly(6, 5.0), m_num_points (5.0, 5.0, 340.0, 12.0, !flip_y), m_close (350, 5.0, "Close", !flip_y), m_preserve_x_scale(460, 5.0, "Preserve X scale", !flip_y), m_fixed_len (350, 25.0, "Fixed Length", !flip_y), m_animate (460, 25.0, "Animate", !flip_y), m_prev_animate(false) { add_ctrl(m_close); add_ctrl(m_preserve_x_scale); add_ctrl(m_fixed_len); add_ctrl(m_animate); m_preserve_x_scale.status(true); m_fixed_len.status(true); m_num_points.range(10.0, 400.0); m_num_points.value(200.0); m_num_points.label("Number of intermediate Points = %.3f"); add_ctrl(m_num_points); } virtual void on_init() { m_poly.xn(0) = 50; m_poly.yn(0) = 50; m_poly.xn(1) = 150 + 20; m_poly.yn(1) = 150 - 20; m_poly.xn(2) = 250 - 20; m_poly.yn(2) = 250 + 20; m_poly.xn(3) = 350 + 20; m_poly.yn(3) = 350 - 20; m_poly.xn(4) = 450 - 20; m_poly.yn(4) = 450 + 20; m_poly.xn(5) = 550; m_poly.yn(5) = 550; } virtual void on_draw() { pixfmt pixf(rbuf_window()); renderer_base rb(pixf); renderer_solid r(rb); rb.clear(agg::rgba(1, 1, 1)); scanline_type sl; agg::rasterizer_scanline_aa<> ras; m_poly.close(m_close.status()); agg::simple_polygon_vertex_source path(m_poly.polygon(), m_poly.num_points(), false, m_close.status()); typedef agg::conv_bspline<agg::simple_polygon_vertex_source> conv_bspline_type; conv_bspline_type bspline(path); bspline.interpolation_step(1.0 / m_num_points.value()); agg::trans_single_path tcurve; tcurve.add_path(bspline); tcurve.preserve_x_scale(m_preserve_x_scale.status()); if(m_fixed_len.status()) tcurve.base_length(1120); typedef agg::conv_curve<font_manager_type::path_adaptor_type> conv_font_curve_type; typedef agg::conv_segmentator<conv_font_curve_type> conv_font_segm_type; typedef agg::conv_transform<conv_font_segm_type, agg::trans_single_path> conv_font_trans_type; conv_font_curve_type fcurves(m_fman.path_adaptor()); conv_font_segm_type fsegm(fcurves); conv_font_trans_type ftrans(fsegm, tcurve); fsegm.approximation_scale(3.0); fcurves.approximation_scale(2.0); m_feng.height(40.0); //m_feng.italic(true); if(m_feng.create_font("Times New Roman", agg::glyph_ren_outline)) { double x = 0.0; double y = 3.0; const char* p = text; while(*p) { const agg::glyph_cache* glyph = m_fman.glyph(*p); if(glyph) { if(x > tcurve.total_length()) break; m_fman.add_kerning(&x, &y); m_fman.init_embedded_adaptors(glyph, x, y); if(glyph->data_type == agg::glyph_data_outline) { ras.reset(); ras.add_path(ftrans); r.color(agg::rgba8(0, 0, 0)); agg::render_scanlines(ras, sl, r); } // increment pen position x += glyph->advance_x; y += glyph->advance_y; } ++p; } } typedef agg::conv_stroke<conv_bspline_type> conv_stroke_type; conv_stroke_type stroke(bspline); stroke.width(2.0); r.color(agg::rgba8(170, 50, 20, 100)); ras.add_path(stroke); agg::render_scanlines(ras, sl, r); //-------------------------- // Render the "poly" tool and controls r.color(agg::rgba(0, 0.3, 0.5, 0.3)); ras.add_path(m_poly); agg::render_scanlines(ras, sl, r); agg::render_ctrl(ras, sl, rb, m_close); agg::render_ctrl(ras, sl, rb, m_preserve_x_scale); agg::render_ctrl(ras, sl, rb, m_fixed_len); agg::render_ctrl(ras, sl, rb, m_animate); agg::render_ctrl(ras, sl, rb, m_num_points); //-------------------------- } virtual void on_mouse_button_down(int x, int y, unsigned flags) { if(flags & agg::mouse_left) { if(m_poly.on_mouse_button_down(x, y)) { force_redraw(); } } } virtual void on_mouse_move(int x, int y, unsigned flags) { if(flags & agg::mouse_left) { if(m_poly.on_mouse_move(x, y)) { force_redraw(); } } if((flags & agg::mouse_left) == 0) { on_mouse_button_up(x, y, flags); } } virtual void on_mouse_button_up(int x, int y, unsigned flags) { if(m_poly.on_mouse_button_up(x, y)) { force_redraw(); } } virtual void on_key(int x, int y, unsigned key, unsigned flags) { } virtual void on_ctrl_change() { if(m_animate.status() != m_prev_animate) { if(m_animate.status()) { on_init(); int i; for(i = 0; i < 6; i++) { m_dx[i] = ((rand() % 1000) - 500) * 0.01; m_dy[i] = ((rand() % 1000) - 500) * 0.01; } wait_mode(false); } else { wait_mode(true); } m_prev_animate = m_animate.status(); } } void move_point(double& x, double& y, double& dx, double& dy) { if(x < 0.0) { x = 0.0; dx = -dx; } if(x > width()) { x = width(); dx = -dx; } if(y < 0.0) { y = 0.0; dy = -dy; } if(y > height()) { y = height(); dy = -dy; } x += dx; y += dy; } virtual void on_idle() { int i; for(i = 0; i < 6; i++) { move_point(m_poly.xn(i), m_poly.yn(i), m_dx[i], m_dy[i]); } force_redraw(); } }; int agg_main(int argc, char* argv[]) { HDC dc = ::GetDC(0); the_application app(dc, pix_format, flip_y); app.caption("AGG Example. Non-linear \"Along-A-Curve\" Transformer"); if(app.init(600, 600, agg::window_resize)) { return app.run(); } ::ReleaseDC(0, dc); return 1; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/trans_curve1_ft.cpp����������������������������������������������������������0000644�0000000�0000000�00000021451�10703246330�020710� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#include <stdlib.h> #include <ctype.h> #include <stdio.h> #include "agg_rendering_buffer.h" #include "agg_rasterizer_scanline_aa.h" #include "agg_scanline_p.h" #include "agg_renderer_scanline.h" #include "agg_conv_bspline.h" #include "agg_conv_segmentator.h" #include "agg_font_freetype.h" #include "agg_trans_single_path.h" #include "ctrl/agg_cbox_ctrl.h" #include "ctrl/agg_slider_ctrl.h" #include "platform/agg_platform_support.h" #include "interactive_polygon.h" #define AGG_BGR24 //#define AGG_RGB24 //#define AGG_BGRA32 //#define AGG_RGBA32 //#define AGG_ARGB32 //#define AGG_ABGR32 //#define AGG_RGB565 //#define AGG_RGB555 #include "pixel_formats.h" enum flip_y_e { flip_y = true }; static char text[] = "Anti-Grain Geometry is designed as a set of loosely coupled " "algorithms and class templates united with a common idea, " "so that all the components can be easily combined. Also, " "the template based design allows you to replace any part of " "the library without the necessity to modify a single byte in " "the existing code. "; class the_application : public agg::platform_support { public: typedef agg::renderer_base<pixfmt> renderer_base; typedef agg::renderer_scanline_aa_solid<renderer_base> renderer_solid; typedef agg::scanline_p8 scanline_type; typedef agg::font_engine_freetype_int16 font_engine_type; typedef agg::font_cache_manager<font_engine_type> font_manager_type; font_engine_type m_feng; font_manager_type m_fman; agg::interactive_polygon m_poly; agg::slider_ctrl<agg::rgba8> m_num_points; agg::cbox_ctrl<agg::rgba8> m_close; agg::cbox_ctrl<agg::rgba8> m_preserve_x_scale; agg::cbox_ctrl<agg::rgba8> m_fixed_len; agg::cbox_ctrl<agg::rgba8> m_animate; double m_dx[6]; double m_dy[6]; bool m_prev_animate; the_application(agg::pix_format_e format, bool flip_y) : agg::platform_support(format, flip_y), m_feng(), m_fman(m_feng), m_poly(6, 5.0), m_num_points (5.0, 5.0, 340.0, 12.0, !flip_y), m_close (350, 5.0, "Close", !flip_y), m_preserve_x_scale(460, 5.0, "Preserve X scale", !flip_y), m_fixed_len (350, 25.0, "Fixed Length", !flip_y), m_animate (460, 25.0, "Animate", !flip_y), m_prev_animate(false) { add_ctrl(m_close); add_ctrl(m_preserve_x_scale); add_ctrl(m_fixed_len); add_ctrl(m_animate); m_preserve_x_scale.status(true); m_fixed_len.status(true); m_num_points.range(10.0, 400.0); m_num_points.value(200.0); m_num_points.label("Number of intermediate Points = %.3f"); add_ctrl(m_num_points); } virtual void on_init() { m_poly.xn(0) = 50; m_poly.yn(0) = 50; m_poly.xn(1) = 150 + 20; m_poly.yn(1) = 150 - 20; m_poly.xn(2) = 250 - 20; m_poly.yn(2) = 250 + 20; m_poly.xn(3) = 350 + 20; m_poly.yn(3) = 350 - 20; m_poly.xn(4) = 450 - 20; m_poly.yn(4) = 450 + 20; m_poly.xn(5) = 550; m_poly.yn(5) = 550; } virtual void on_draw() { pixfmt pixf(rbuf_window()); renderer_base rb(pixf); renderer_solid r(rb); rb.clear(agg::rgba(1, 1, 1)); scanline_type sl; agg::rasterizer_scanline_aa<> ras; m_poly.close(m_close.status()); agg::simple_polygon_vertex_source path(m_poly.polygon(), m_poly.num_points(), false, m_close.status()); typedef agg::conv_bspline<agg::simple_polygon_vertex_source> conv_bspline_type; conv_bspline_type bspline(path); bspline.interpolation_step(1.0 / m_num_points.value()); agg::trans_single_path tcurve; tcurve.add_path(bspline); tcurve.preserve_x_scale(m_preserve_x_scale.status()); if(m_fixed_len.status()) tcurve.base_length(1120); typedef agg::conv_curve<font_manager_type::path_adaptor_type> conv_font_curve_type; typedef agg::conv_segmentator<conv_font_curve_type> conv_font_segm_type; typedef agg::conv_transform<conv_font_segm_type, agg::trans_single_path> conv_font_trans_type; conv_font_curve_type fcurves(m_fman.path_adaptor()); conv_font_segm_type fsegm(fcurves); conv_font_trans_type ftrans(fsegm, tcurve); fsegm.approximation_scale(3.0); fcurves.approximation_scale(2.0); if(m_feng.load_font(full_file_name("timesi.ttf"), 0, agg::glyph_ren_outline)) { double x = 0.0; double y = 3.0; const char* p = text; m_feng.hinting(false); m_feng.height(40); while(*p) { const agg::glyph_cache* glyph = m_fman.glyph(*p); if(glyph) { if(x > tcurve.total_length()) break; m_fman.add_kerning(&x, &y); m_fman.init_embedded_adaptors(glyph, x, y); if(glyph->data_type == agg::glyph_data_outline) { ras.reset(); ras.add_path(ftrans); r.color(agg::rgba8(0, 0, 0)); agg::render_scanlines(ras, sl, r); } // increment pen position x += glyph->advance_x; y += glyph->advance_y; } ++p; } } else { message("Please copy file timesi.ttf to the current directory\n" "or download it from http://www.antigrain.com/timesi.zip"); } typedef agg::conv_stroke<conv_bspline_type> conv_stroke_type; conv_stroke_type stroke(bspline); stroke.width(2.0); r.color(agg::rgba8(170, 50, 20, 100)); ras.add_path(stroke); agg::render_scanlines(ras, sl, r); //-------------------------- // Render the "poly" tool and controls r.color(agg::rgba(0, 0.3, 0.5, 0.3)); ras.add_path(m_poly); agg::render_scanlines(ras, sl, r); agg::render_ctrl(ras, sl, rb, m_close); agg::render_ctrl(ras, sl, rb, m_preserve_x_scale); agg::render_ctrl(ras, sl, rb, m_fixed_len); agg::render_ctrl(ras, sl, rb, m_animate); agg::render_ctrl(ras, sl, rb, m_num_points); //-------------------------- } virtual void on_mouse_button_down(int x, int y, unsigned flags) { if(flags & agg::mouse_left) { if(m_poly.on_mouse_button_down(x, y)) { force_redraw(); } } } virtual void on_mouse_move(int x, int y, unsigned flags) { if(flags & agg::mouse_left) { if(m_poly.on_mouse_move(x, y)) { force_redraw(); } } if((flags & agg::mouse_left) == 0) { on_mouse_button_up(x, y, flags); } } virtual void on_mouse_button_up(int x, int y, unsigned flags) { if(m_poly.on_mouse_button_up(x, y)) { force_redraw(); } } virtual void on_key(int x, int y, unsigned key, unsigned flags) { } virtual void on_ctrl_change() { if(m_animate.status() != m_prev_animate) { if(m_animate.status()) { on_init(); int i; for(i = 0; i < 6; i++) { m_dx[i] = ((rand() % 1000) - 500) * 0.01; m_dy[i] = ((rand() % 1000) - 500) * 0.01; } wait_mode(false); } else { wait_mode(true); } m_prev_animate = m_animate.status(); } } void move_point(double& x, double& y, double& dx, double& dy) { if(x < 0.0) { x = 0.0; dx = -dx; } if(x > width()) { x = width(); dx = -dx; } if(y < 0.0) { y = 0.0; dy = -dy; } if(y > height()) { y = height(); dy = -dy; } x += dx; y += dy; } virtual void on_idle() { int i; for(i = 0; i < 6; i++) { move_point(m_poly.xn(i), m_poly.yn(i), m_dx[i], m_dy[i]); } force_redraw(); } }; int agg_main(int argc, char* argv[]) { the_application app(pix_format, flip_y); app.caption("AGG Example. Non-linear \"Along-A-Curve\" Transformer"); if(app.init(600, 600, agg::window_resize)) { return app.run(); } return 1; } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/trans_curve2.cpp�������������������������������������������������������������0000644�0000000�0000000�00000025467�10703246330�020233� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#include <stdlib.h> #include <ctype.h> #include <stdio.h> #include "agg_rendering_buffer.h" #include "agg_rasterizer_scanline_aa.h" #include "agg_scanline_p.h" #include "agg_renderer_scanline.h" #include "agg_conv_bspline.h" #include "agg_conv_segmentator.h" #include "agg_font_win32_tt.h" #include "agg_trans_double_path.h" #include "ctrl/agg_cbox_ctrl.h" #include "ctrl/agg_slider_ctrl.h" #include "platform/agg_platform_support.h" #include "interactive_polygon.h" #define AGG_BGR24 //#define AGG_RGB24 //#define AGG_BGRA32 //#define AGG_RGBA32 //#define AGG_ARGB32 //#define AGG_ABGR32 //#define AGG_RGB565 //#define AGG_RGB555 #include "pixel_formats.h" enum flip_y_e { flip_y = true }; static char text[] = "Anti-Grain Geometry is designed as a set of loosely coupled " "algorithms and class templates united with a common idea, " "so that all the components can be easily combined. Also, " "the template based design allows you to replace any part of " "the library without the necessity to modify a single byte in " "the existing code. "; class the_application : public agg::platform_support { public: typedef agg::renderer_base<pixfmt> renderer_base; typedef agg::renderer_scanline_aa_solid<renderer_base> renderer_solid; typedef agg::scanline_p8 scanline_type; typedef agg::font_engine_win32_tt_int16 font_engine_type; typedef agg::font_cache_manager<font_engine_type> font_manager_type; font_engine_type m_feng; font_manager_type m_fman; agg::interactive_polygon m_poly1; agg::interactive_polygon m_poly2; agg::slider_ctrl<agg::rgba8> m_num_points; agg::cbox_ctrl<agg::rgba8> m_fixed_len; agg::cbox_ctrl<agg::rgba8> m_preserve_x_scale; agg::cbox_ctrl<agg::rgba8> m_animate; double m_dx1[6]; double m_dy1[6]; double m_dx2[6]; double m_dy2[6]; bool m_prev_animate; the_application(HDC dc, agg::pix_format_e format, bool flip_y) : agg::platform_support(format, flip_y), m_feng(dc), m_fman(m_feng), m_poly1(6, 5.0), m_poly2(6, 5.0), m_num_points (5.0, 5.0, 340.0, 12.0, !flip_y), m_fixed_len (350, 5.0, "Fixed Length", !flip_y), m_preserve_x_scale(465, 5.0, "Preserve X scale", !flip_y), m_animate (350, 25.0, "Animate", !flip_y), m_prev_animate(false) { add_ctrl(m_fixed_len); add_ctrl(m_preserve_x_scale); add_ctrl(m_animate); m_fixed_len.status(true); m_preserve_x_scale.status(true); m_num_points.range(10.0, 400.0); m_num_points.value(200.0); m_num_points.label("Number of intermediate Points = %.3f"); add_ctrl(m_num_points); m_poly1.close(false); m_poly2.close(false); } virtual void on_init() { m_poly1.xn(0) = 10 + 50; m_poly1.yn(0) = -10 + 50; m_poly1.xn(1) = 10 + 150 + 20; m_poly1.yn(1) = -10 + 150 - 20; m_poly1.xn(2) = 10 + 250 - 20; m_poly1.yn(2) = -10 + 250 + 20; m_poly1.xn(3) = 10 + 350 + 20; m_poly1.yn(3) = -10 + 350 - 20; m_poly1.xn(4) = 10 + 450 - 20; m_poly1.yn(4) = -10 + 450 + 20; m_poly1.xn(5) = 10 + 550; m_poly1.yn(5) = -10 + 550; m_poly2.xn(0) = -10 + 50; m_poly2.yn(0) = 10 + 50; m_poly2.xn(1) = -10 + 150 + 20; m_poly2.yn(1) = 10 + 150 - 20; m_poly2.xn(2) = -10 + 250 - 20; m_poly2.yn(2) = 10 + 250 + 20; m_poly2.xn(3) = -10 + 350 + 20; m_poly2.yn(3) = 10 + 350 - 20; m_poly2.xn(4) = -10 + 450 - 20; m_poly2.yn(4) = 10 + 450 + 20; m_poly2.xn(5) = -10 + 550; m_poly2.yn(5) = 10 + 550; } virtual void on_draw() { pixfmt pixf(rbuf_window()); renderer_base rb(pixf); renderer_solid r(rb); rb.clear(agg::rgba(1, 1, 1)); scanline_type sl; agg::rasterizer_scanline_aa<> ras; agg::simple_polygon_vertex_source path1(m_poly1.polygon(), m_poly1.num_points(), false, false); agg::simple_polygon_vertex_source path2(m_poly2.polygon(), m_poly2.num_points(), false, false); typedef agg::conv_bspline<agg::simple_polygon_vertex_source> conv_bspline_type; conv_bspline_type bspline1(path1); conv_bspline_type bspline2(path2); bspline1.interpolation_step(1.0 / m_num_points.value()); bspline2.interpolation_step(1.0 / m_num_points.value()); typedef agg::conv_curve<font_manager_type::path_adaptor_type> conv_font_curve_type; typedef agg::conv_segmentator<conv_font_curve_type> conv_font_segm_type; typedef agg::conv_transform<conv_font_segm_type, agg::trans_double_path> conv_font_trans_type; agg::trans_double_path tcurve; conv_font_curve_type fcurves(m_fman.path_adaptor()); conv_font_segm_type fsegm(fcurves); conv_font_trans_type ftrans(fsegm, tcurve); tcurve.preserve_x_scale(m_preserve_x_scale.status()); if(m_fixed_len.status()) tcurve.base_length(1140.0); tcurve.base_height(30.0); tcurve.add_paths(bspline1, bspline2); fsegm.approximation_scale(3.0); fcurves.approximation_scale(5.0); m_feng.height(40.0); m_feng.hinting(false); m_feng.italic(true); if(m_feng.create_font("Times New Roman", agg::glyph_ren_outline)) { double x = 0.0; double y = 3.0; const char* p = text; while(*p) { const agg::glyph_cache* glyph = m_fman.glyph(*p); if(glyph) { if(x > tcurve.total_length1()) break; m_fman.add_kerning(&x, &y); m_fman.init_embedded_adaptors(glyph, x, y); if(glyph->data_type == agg::glyph_data_outline) { ras.reset(); ras.add_path(ftrans); r.color(agg::rgba8(0, 0, 0)); agg::render_scanlines(ras, sl, r); } // increment pen position x += glyph->advance_x; y += glyph->advance_y; } ++p; } } typedef agg::conv_stroke<conv_bspline_type> conv_stroke_type; conv_stroke_type stroke1(bspline1); conv_stroke_type stroke2(bspline2); stroke1.width(2.0); stroke2.width(2.0); r.color(agg::rgba8(170, 50, 20, 100)); ras.add_path(stroke1); agg::render_scanlines(ras, sl, r); ras.add_path(stroke2); agg::render_scanlines(ras, sl, r); //-------------------------- // Render the "poly" tool and controls r.color(agg::rgba(0, 0.3, 0.5, 0.2)); ras.add_path(m_poly1); agg::render_scanlines(ras, sl, r); ras.add_path(m_poly2); agg::render_scanlines(ras, sl, r); agg::render_ctrl(ras, sl, rb, m_fixed_len); agg::render_ctrl(ras, sl, rb, m_preserve_x_scale); agg::render_ctrl(ras, sl, rb, m_animate); agg::render_ctrl(ras, sl, rb, m_num_points); //-------------------------- } virtual void on_mouse_button_down(int x, int y, unsigned flags) { if(flags & agg::mouse_left) { if(m_poly1.on_mouse_button_down(x, y)) { force_redraw(); } if(m_poly2.on_mouse_button_down(x, y)) { force_redraw(); } } } virtual void on_mouse_move(int x, int y, unsigned flags) { if(flags & agg::mouse_left) { if(m_poly1.on_mouse_move(x, y)) { force_redraw(); } if(m_poly2.on_mouse_move(x, y)) { force_redraw(); } } if((flags & agg::mouse_left) == 0) { on_mouse_button_up(x, y, flags); } } virtual void on_mouse_button_up(int x, int y, unsigned flags) { if(m_poly1.on_mouse_button_up(x, y)) { force_redraw(); } if(m_poly2.on_mouse_button_up(x, y)) { force_redraw(); } } virtual void on_key(int x, int y, unsigned key, unsigned flags) { } virtual void on_ctrl_change() { if(m_animate.status() != m_prev_animate) { if(m_animate.status()) { on_init(); int i; for(i = 0; i < 6; i++) { m_dx1[i] = ((rand() % 1000) - 500) * 0.01; m_dy1[i] = ((rand() % 1000) - 500) * 0.01; m_dx2[i] = ((rand() % 1000) - 500) * 0.01; m_dy2[i] = ((rand() % 1000) - 500) * 0.01; } wait_mode(false); } else { wait_mode(true); } m_prev_animate = m_animate.status(); } } void move_point(double& x, double& y, double& dx, double& dy) { if(x < 0.0) { x = 0.0; dx = -dx; } if(x > width()) { x = width(); dx = -dx; } if(y < 0.0) { y = 0.0; dy = -dy; } if(y > height()) { y = height(); dy = -dy; } x += dx; y += dy; } void normalize_point(unsigned i) { double d = agg::calc_distance(m_poly1.xn(i), m_poly1.yn(i), m_poly2.xn(i), m_poly2.yn(i)); // 28.8 is 20 * sqrt(2) if(d > 28.28) { m_poly2.xn(i) = m_poly1.xn(i) + (m_poly2.xn(i) - m_poly1.xn(i)) * 28.28 / d; m_poly2.yn(i) = m_poly1.yn(i) + (m_poly2.yn(i) - m_poly1.yn(i)) * 28.28 / d; } } virtual void on_idle() { int i; for(i = 0; i < 6; i++) { move_point(m_poly1.xn(i), m_poly1.yn(i), m_dx1[i], m_dy1[i]); move_point(m_poly2.xn(i), m_poly2.yn(i), m_dx2[i], m_dy2[i]); normalize_point(i); } force_redraw(); } }; int agg_main(int argc, char* argv[]) { HDC dc = ::GetDC(0); the_application app(dc, pix_format, flip_y); app.caption("AGG Example. Non-linear \"Along-A-Curve\" Transformer"); if(app.init(600, 600, agg::window_resize)) { return app.run(); } ::ReleaseDC(0, dc); return 1; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/trans_curve2_ft.cpp����������������������������������������������������������0000644�0000000�0000000�00000025650�10703246330�020716� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#include <stdlib.h> #include <ctype.h> #include <stdio.h> #include "agg_rendering_buffer.h" #include "agg_rasterizer_scanline_aa.h" #include "agg_scanline_p.h" #include "agg_renderer_scanline.h" #include "agg_conv_bspline.h" #include "agg_conv_segmentator.h" #include "agg_font_freetype.h" #include "agg_trans_double_path.h" #include "ctrl/agg_cbox_ctrl.h" #include "ctrl/agg_slider_ctrl.h" #include "platform/agg_platform_support.h" #include "interactive_polygon.h" #define AGG_BGR24 //#define AGG_RGB24 //#define AGG_BGRA32 //#define AGG_RGBA32 //#define AGG_ARGB32 //#define AGG_ABGR32 //#define AGG_RGB565 //#define AGG_RGB555 #include "pixel_formats.h" enum flip_y_e { flip_y = true }; static char text[] = "Anti-Grain Geometry is designed as a set of loosely coupled " "algorithms and class templates united with a common idea, " "so that all the components can be easily combined. Also, " "the template based design allows you to replace any part of " "the library without the necessity to modify a single byte in " "the existing code. "; class the_application : public agg::platform_support { public: typedef agg::renderer_base<pixfmt> renderer_base; typedef agg::renderer_scanline_aa_solid<renderer_base> renderer_solid; typedef agg::scanline_p8 scanline_type; typedef agg::font_engine_freetype_int16 font_engine_type; typedef agg::font_cache_manager<font_engine_type> font_manager_type; font_engine_type m_feng; font_manager_type m_fman; agg::interactive_polygon m_poly1; agg::interactive_polygon m_poly2; agg::slider_ctrl<agg::rgba8> m_num_points; agg::cbox_ctrl<agg::rgba8> m_fixed_len; agg::cbox_ctrl<agg::rgba8> m_preserve_x_scale; agg::cbox_ctrl<agg::rgba8> m_animate; double m_dx1[6]; double m_dy1[6]; double m_dx2[6]; double m_dy2[6]; bool m_prev_animate; the_application(agg::pix_format_e format, bool flip_y) : agg::platform_support(format, flip_y), m_feng(), m_fman(m_feng), m_poly1(6, 5.0), m_poly2(6, 5.0), m_num_points (5.0, 5.0, 340.0, 12.0, !flip_y), m_fixed_len (350, 5.0, "Fixed Length", !flip_y), m_preserve_x_scale(465, 5.0, "Preserve X scale", !flip_y), m_animate (350, 25.0, "Animate", !flip_y), m_prev_animate(false) { add_ctrl(m_fixed_len); add_ctrl(m_preserve_x_scale); add_ctrl(m_animate); m_fixed_len.status(true); m_preserve_x_scale.status(true); m_num_points.range(10.0, 400.0); m_num_points.value(200.0); m_num_points.label("Number of intermediate Points = %.3f"); add_ctrl(m_num_points); m_poly1.close(false); m_poly2.close(false); } virtual void on_init() { m_poly1.xn(0) = 10 + 50; m_poly1.yn(0) = -10 + 50; m_poly1.xn(1) = 10 + 150 + 20; m_poly1.yn(1) = -10 + 150 - 20; m_poly1.xn(2) = 10 + 250 - 20; m_poly1.yn(2) = -10 + 250 + 20; m_poly1.xn(3) = 10 + 350 + 20; m_poly1.yn(3) = -10 + 350 - 20; m_poly1.xn(4) = 10 + 450 - 20; m_poly1.yn(4) = -10 + 450 + 20; m_poly1.xn(5) = 10 + 550; m_poly1.yn(5) = -10 + 550; m_poly2.xn(0) = -10 + 50; m_poly2.yn(0) = 10 + 50; m_poly2.xn(1) = -10 + 150 + 20; m_poly2.yn(1) = 10 + 150 - 20; m_poly2.xn(2) = -10 + 250 - 20; m_poly2.yn(2) = 10 + 250 + 20; m_poly2.xn(3) = -10 + 350 + 20; m_poly2.yn(3) = 10 + 350 - 20; m_poly2.xn(4) = -10 + 450 - 20; m_poly2.yn(4) = 10 + 450 + 20; m_poly2.xn(5) = -10 + 550; m_poly2.yn(5) = 10 + 550; } virtual void on_draw() { pixfmt pixf(rbuf_window()); renderer_base rb(pixf); renderer_solid r(rb); rb.clear(agg::rgba(1, 1, 1)); scanline_type sl; agg::rasterizer_scanline_aa<> ras; agg::simple_polygon_vertex_source path1(m_poly1.polygon(), m_poly1.num_points(), false, false); agg::simple_polygon_vertex_source path2(m_poly2.polygon(), m_poly2.num_points(), false, false); typedef agg::conv_bspline<agg::simple_polygon_vertex_source> conv_bspline_type; conv_bspline_type bspline1(path1); conv_bspline_type bspline2(path2); bspline1.interpolation_step(1.0 / m_num_points.value()); bspline2.interpolation_step(1.0 / m_num_points.value()); typedef agg::conv_curve<font_manager_type::path_adaptor_type> conv_font_curve_type; typedef agg::conv_segmentator<conv_font_curve_type> conv_font_segm_type; typedef agg::conv_transform<conv_font_segm_type, agg::trans_double_path> conv_font_trans_type; agg::trans_double_path tcurve; conv_font_curve_type fcurves(m_fman.path_adaptor()); conv_font_segm_type fsegm(fcurves); conv_font_trans_type ftrans(fsegm, tcurve); tcurve.preserve_x_scale(m_preserve_x_scale.status()); if(m_fixed_len.status()) tcurve.base_length(1140.0); tcurve.base_height(30.0); tcurve.add_paths(bspline1, bspline2); fsegm.approximation_scale(3.0); fcurves.approximation_scale(5.0); if(m_feng.load_font(full_file_name("timesi.ttf"), 0, agg::glyph_ren_outline)) { double x = 0.0; double y = 3.0; const char* p = text; m_feng.hinting(false); m_feng.height(40); while(*p) { const agg::glyph_cache* glyph = m_fman.glyph(*p); if(glyph) { if(x > tcurve.total_length1()) break; m_fman.add_kerning(&x, &y); m_fman.init_embedded_adaptors(glyph, x, y); if(glyph->data_type == agg::glyph_data_outline) { ras.reset(); ras.add_path(ftrans); r.color(agg::rgba8(0, 0, 0)); agg::render_scanlines(ras, sl, r); } // increment pen position x += glyph->advance_x; y += glyph->advance_y; } ++p; } } else { message("Please copy file timesi.ttf to the current directory\n" "or download it from http://www.antigrain.com/timesi.zip"); } typedef agg::conv_stroke<conv_bspline_type> conv_stroke_type; conv_stroke_type stroke1(bspline1); conv_stroke_type stroke2(bspline2); stroke1.width(2.0); stroke2.width(2.0); r.color(agg::rgba8(170, 50, 20, 100)); ras.add_path(stroke1); agg::render_scanlines(ras, sl, r); ras.add_path(stroke2); agg::render_scanlines(ras, sl, r); //-------------------------- // Render the "poly" tool and controls r.color(agg::rgba(0, 0.3, 0.5, 0.2)); ras.add_path(m_poly1); agg::render_scanlines(ras, sl, r); ras.add_path(m_poly2); agg::render_scanlines(ras, sl, r); agg::render_ctrl(ras, sl, rb, m_fixed_len); agg::render_ctrl(ras, sl, rb, m_preserve_x_scale); agg::render_ctrl(ras, sl, rb, m_animate); agg::render_ctrl(ras, sl, rb, m_num_points); //-------------------------- } virtual void on_mouse_button_down(int x, int y, unsigned flags) { if(flags & agg::mouse_left) { if(m_poly1.on_mouse_button_down(x, y)) { force_redraw(); } if(m_poly2.on_mouse_button_down(x, y)) { force_redraw(); } } } virtual void on_mouse_move(int x, int y, unsigned flags) { if(flags & agg::mouse_left) { if(m_poly1.on_mouse_move(x, y)) { force_redraw(); } if(m_poly2.on_mouse_move(x, y)) { force_redraw(); } } if((flags & agg::mouse_left) == 0) { on_mouse_button_up(x, y, flags); } } virtual void on_mouse_button_up(int x, int y, unsigned flags) { if(m_poly1.on_mouse_button_up(x, y)) { force_redraw(); } if(m_poly2.on_mouse_button_up(x, y)) { force_redraw(); } } virtual void on_key(int x, int y, unsigned key, unsigned flags) { } virtual void on_ctrl_change() { if(m_animate.status() != m_prev_animate) { if(m_animate.status()) { on_init(); int i; for(i = 0; i < 6; i++) { m_dx1[i] = ((rand() % 1000) - 500) * 0.01; m_dy1[i] = ((rand() % 1000) - 500) * 0.01; m_dx2[i] = ((rand() % 1000) - 500) * 0.01; m_dy2[i] = ((rand() % 1000) - 500) * 0.01; } wait_mode(false); } else { wait_mode(true); } m_prev_animate = m_animate.status(); } } void move_point(double& x, double& y, double& dx, double& dy) { if(x < 0.0) { x = 0.0; dx = -dx; } if(x > width()) { x = width(); dx = -dx; } if(y < 0.0) { y = 0.0; dy = -dy; } if(y > height()) { y = height(); dy = -dy; } x += dx; y += dy; } void normalize_point(unsigned i) { double d = agg::calc_distance(m_poly1.xn(i), m_poly1.yn(i), m_poly2.xn(i), m_poly2.yn(i)); // 28.8 is 20 * sqrt(2) if(d > 28.28) { m_poly2.xn(i) = m_poly1.xn(i) + (m_poly2.xn(i) - m_poly1.xn(i)) * 28.28 / d; m_poly2.yn(i) = m_poly1.yn(i) + (m_poly2.yn(i) - m_poly1.yn(i)) * 28.28 / d; } } virtual void on_idle() { int i; for(i = 0; i < 6; i++) { move_point(m_poly1.xn(i), m_poly1.yn(i), m_dx1[i], m_dy1[i]); move_point(m_poly2.xn(i), m_poly2.yn(i), m_dx2[i], m_dy2[i]); normalize_point(i); } force_redraw(); } }; int agg_main(int argc, char* argv[]) { the_application app(pix_format, flip_y); app.caption("AGG Example. Non-linear \"Along-A-Curve\" Transformer"); if(app.init(600, 600, agg::window_resize)) { return app.run(); } return 1; } ����������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/trans_polar.cpp��������������������������������������������������������������0000644�0000000�0000000�00000011471�10703246330�020130� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#include "agg_basics.h" #include "agg_rendering_buffer.h" #include "agg_rasterizer_scanline_aa.h" #include "agg_scanline_u.h" #include "agg_renderer_scanline.h" #include "agg_pixfmt_rgb.h" #include "agg_trans_affine.h" #include "agg_conv_transform.h" #include "agg_conv_segmentator.h" #include "platform/agg_platform_support.h" #include "ctrl/agg_slider_ctrl.h" #include "ctrl/agg_cbox_ctrl.h" enum flip_y_e { flip_y = true }; namespace agg { template<class ColorT, class Ctrl, class Pipeline> class transformed_control { public: transformed_control(Ctrl& ctrl, Pipeline& pl) : m_ctrl(ctrl), m_pipeline(pl) {} unsigned num_paths() { return m_ctrl.num_paths(); } void rewind(unsigned path_id) { m_pipeline.rewind(path_id); } unsigned vertex(double* x, double* y) { return m_pipeline.vertex(x, y); } const ColorT& color(unsigned i) const { return m_ctrl.color(i); } private: Ctrl& m_ctrl; Pipeline& m_pipeline; }; class trans_polar { public: trans_polar() : m_base_angle(1.0), m_base_scale(1.0), m_base_x(0.0), m_base_y(0.0), m_translation_x(0.0), m_translation_y(0.0), m_spiral(0.0) {} void base_scale(double v) { m_base_scale = v; } void full_circle(double v) { m_base_angle = 2.0 * pi / v; } void base_offset(double dx, double dy) { m_base_x = dx; m_base_y = dy; } void translation(double dx, double dy) { m_translation_x = dx; m_translation_y = dy;} void spiral(double v) { m_spiral = v; } void transform(double* x, double* y) const { double x1 = (*x + m_base_x) * m_base_angle; double y1 = (*y + m_base_y) * m_base_scale + (*x * m_spiral); *x = cos(x1) * y1 + m_translation_x; *y = sin(x1) * y1 + m_translation_y; } private: double m_base_angle; double m_base_scale; double m_base_x; double m_base_y; double m_translation_x; double m_translation_y; double m_spiral; }; } class the_application : public agg::platform_support { agg::slider_ctrl<agg::rgba8> m_slider1; agg::slider_ctrl<agg::rgba8> m_slider_spiral; agg::slider_ctrl<agg::rgba8> m_slider_base_y; public: the_application(agg::pix_format_e format, bool flip_y) : agg::platform_support(format, flip_y), m_slider1 (10, 10, 600-10, 17, !flip_y), m_slider_spiral(10, 10+20, 600-10, 17+20, !flip_y), m_slider_base_y(10, 10+40, 600-10, 17+40, !flip_y) { add_ctrl(m_slider1); m_slider1.range(0.0, 100.0); m_slider1.num_steps(5); m_slider1.value(32.0); m_slider1.label("Some Value=%1.0f"); add_ctrl(m_slider_spiral); m_slider_spiral.label("Spiral=%.3f"); m_slider_spiral.range(-0.1, 0.1); m_slider_spiral.value(0.0); add_ctrl(m_slider_base_y); m_slider_base_y.label("Base Y=%.3f"); m_slider_base_y.range(50.0, 200.0); m_slider_base_y.value(120.0); } virtual ~the_application() { } virtual void on_init() { } virtual void on_draw() { typedef agg::renderer_base<agg::pixfmt_bgr24> ren_base; typedef agg::renderer_scanline_aa_solid<ren_base> renderer; agg::pixfmt_bgr24 pixf(rbuf_window()); ren_base rb(pixf); renderer ren(rb); agg::scanline_u8 sl; rb.clear(agg::rgba(1,1,1)); agg::rasterizer_scanline_aa<> ras; agg::render_ctrl(ras, sl, rb, m_slider1); agg::render_ctrl(ras, sl, rb, m_slider_spiral); agg::render_ctrl(ras, sl, rb, m_slider_base_y); typedef agg::conv_segmentator<agg::slider_ctrl<agg::rgba8> > conv_segmentator_type; typedef agg::conv_transform<conv_segmentator_type, agg::trans_polar> conv_transform_type; agg::trans_polar trans; trans.full_circle(-600); trans.base_scale(-1.0); trans.base_offset(0.0, m_slider_base_y.value()); trans.translation(width() / 2.0, height() / 2.0 + 30.0); trans.spiral(-m_slider_spiral.value()); conv_segmentator_type segm(m_slider1); conv_transform_type pipeline(segm, trans); agg::transformed_control<agg::rgba8, agg::slider_ctrl<agg::rgba8>, conv_transform_type> ctrl(m_slider1, pipeline); agg::render_ctrl(ras, sl, rb, ctrl); } }; int agg_main(int argc, char* argv[]) { the_application app(agg::pix_format_bgr24, flip_y); app.caption("AGG Example. Polar Transformer"); if(app.init(600, 400, agg::window_resize)) { return app.run(); } return 1; } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/truetype_test.cpp������������������������������������������������������������0000644�0000000�0000000�00000044244�10703246330�020530� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#include <stdio.h> #include "agg_basics.h" #include "agg_rendering_buffer.h" #include "agg_scanline_u.h" #include "agg_scanline_bin.h" #include "agg_renderer_scanline.h" #include "agg_renderer_primitives.h" #include "agg_rasterizer_scanline_aa.h" #include "agg_conv_curve.h" #include "agg_conv_contour.h" #include "agg_pixfmt_rgb.h" #include "agg_gamma_lut.h" #include "agg_font_win32_tt.h" #include "platform/agg_platform_support.h" #include "ctrl/agg_slider_ctrl.h" #include "ctrl/agg_cbox_ctrl.h" #include "ctrl/agg_rbox_ctrl.h" enum flip_y_e { flip = true }; typedef char char_type; static char_type text[] = //"0123456789ABCDEFGHIJKLMNOPRSTUVWXYZabcdefghijklmnoprstuvwxyz " " Anti-Grain Geometry is designed as a set of loosely coupled " "algorithms and class templates united with a common idea, " "so that all the components can be easily combined. Also, " "the template based design allows you to replace any part of " "the library without the necessity to modify a single byte in " "the existing code. " "AGG is designed keeping in mind extensibility and flexibility. " "Basically I just wanted to create a toolkit that would allow me " "(and anyone else) to add new fancy algorithms very easily. " "AGG does not dictate you any style of its use, you are free to " "use any part of it. However, AGG is often associated with a tool " "for rendering images in memory. That is not quite true, but it can " "be a good starting point in studying. The tutorials describe the " "use of AGG starting from the low level functionality that deals with " "frame buffers and pixels. Then you will gradually understand how to " "abstract different parts of the library and how to use them separately. " "Remember, the raster picture is often not the only thing you want to " "obtain, you will probably want to print your graphics with highest " "possible quality and in this case you can easily combine the \"vectorial\" " "part of the library with some API like Windows GDI, having a common " "external interface. If that API can render multi-polygons with non-zero " "and even-odd filling rules it's all you need to incorporate AGG into " "your application. For example, Windows API PolyPolygon perfectly fits " "these needs, except certain advanced things like gradient filling, " "Gouraud shading, image transformations, and so on. Or, as an alternative, " "you can use all AGG algorithms producing high resolution pixel images and " "then to send the result to the printer as a pixel map." "Below is a typical brief scheme of the AGG rendering pipeline. " "Please note that any component between the Vertex Source " "and Screen Output is not mandatory. It all depends on your " "particular needs. For example, you can use your own rasterizer, " "based on Windows API. In this case you won't need the AGG rasterizer " "and renderers. Or, if you need to draw only lines, you can use the " "AGG outline rasterizer that has certain restrictions but works faster. " "The number of possibilities is endless. " "Vertex Source is some object that produces polygons or polylines as " "a set of consecutive 2D vertices with commands like MoveTo, LineTo. " "It can be a container or some other object that generates vertices " "on demand. " "Coordinate conversion pipeline consists of a number of coordinate " "converters. It always works with vectorial data (X,Y) represented " "as floating point numbers (double). For example, it can contain an " "affine transformer, outline (stroke) generator, some marker " "generator (like arrowheads/arrowtails), dashed lines generator, " "and so on. The pipeline can have branches and you also can have " "any number of different pipelines. You also can write your own " "converter and include it into the pipeline. " "Scanline Rasterizer converts vectorial data into a number of " "horizontal scanlines. The scanlines usually (but not obligatory) " "carry information about Anti-Aliasing as coverage values. " "Renderers render scanlines, sorry for the tautology. The simplest " "example is solid filling. The renderer just adds a color to the " "scanline and writes the result into the rendering buffer. " "More complex renderers can produce multi-color result, " "like gradients, Gouraud shading, image transformations, " "patterns, and so on. Rendering Buffer is a buffer in memory " "that will be displayed afterwards. Usually but not obligatory " "it contains pixels in format that fits your video system. " "For example, 24 bits B-G-R, 32 bits B-G-R-A, or 15 " "bits R-G-B-555 for Windows. But in general, there're no " "restrictions on pixel formats or color space if you write " "your own low level class that supports that format. " "Colors in AGG appear only in renderers, that is, when you " "actually put some data to the rendering buffer. In general, " "there's no general purpose structure or class like color, " "instead, AGG always operates with concrete color space. " "There are plenty of color spaces in the world, like RGB, " "HSV, CMYK, etc., and all of them have certain restrictions. " "For example, the RGB color space is just a poor subset of " "colors that a human eye can recognize. If you look at the full " "CIE Chromaticity Diagram, you will see that the RGB triangle " "is just a little part of it. " "In other words there are plenty of colors in the real world " "that cannot be reproduced with RGB, CMYK, HSV, etc. Any color " "space except the one existing in Nature is restrictive. Thus, " "it was decided not to introduce such an object like color in " "order not to restrict the possibilities in advance. Instead, " "there are objects that operate with concrete color spaces. " "Currently there are agg::rgba and agg::rgba8 that operate " "with the most popular RGB color space (strictly speaking there's " "RGB plus Alpha). The RGB color space is used with different " "pixel formats, like 24-bit RGB or 32-bit RGBA with different " "order of color components. But the common property of all of " "them is that they are essentially RGB. Although, AGG doesn't " "explicitly support any other color spaces, there is at least " "a potential possibility of adding them. It means that all " "class and function templates that depend on the color type " "are parameterized with the ColorT argument. " "Basically, AGG operates with coordinates of the output device. " "On your screen there are pixels. But unlike many other libraries " "and APIs AGG initially supports Subpixel Accuracy. It means " "that the coordinates are represented as doubles, where fractional " "values actually take effect. AGG doesn't have an embedded " "conversion mechanism from world to screen coordinates in order " "not to restrict your freedom. It's very important where and when " "you do that conversion, so, different applications can require " "different approaches. AGG just provides you a transformer of " "that kind, namely, that can convert your own view port to the " "device one. And it's your responsibility to include it into " "the proper place of the pipeline. You can also write your " "own very simple class that will allow you to operate with " "millimeters, inches, or any other physical units. " "Internally, the rasterizers use integer coordinates of the " "format 24.8 bits, that is, 24 bits for the integer part and 8 " "bits for the fractional one. In other words, all the internal " "coordinates are multiplied by 256. If you intend to use AGG in " "some embedded system that has inefficient floating point " "processing, you still can use the rasterizers with their " "integer interfaces. Although, you won't be able to use the " "floating point coordinate pipelines in this case. "; bool text_flip = false; class the_application : public agg::platform_support { typedef agg::gamma_lut<agg::int8u, agg::int16u, 8, 16> gamma_type; typedef agg::pixfmt_bgr24_gamma<gamma_type> pixfmt_type; typedef agg::renderer_base<pixfmt_type> base_ren_type; typedef agg::renderer_scanline_aa_solid<base_ren_type> renderer_solid; typedef agg::renderer_scanline_bin_solid<base_ren_type> renderer_bin; typedef agg::font_engine_win32_tt_int32 font_engine_type; typedef agg::font_cache_manager<font_engine_type> font_manager_type; agg::rbox_ctrl<agg::rgba8> m_ren_type; agg::slider_ctrl<agg::rgba8> m_height; agg::slider_ctrl<agg::rgba8> m_width; agg::slider_ctrl<agg::rgba8> m_weight; agg::slider_ctrl<agg::rgba8> m_gamma; agg::cbox_ctrl<agg::rgba8> m_hinting; agg::cbox_ctrl<agg::rgba8> m_kerning; agg::cbox_ctrl<agg::rgba8> m_performance; font_engine_type m_feng; font_manager_type m_fman; double m_old_height; gamma_type m_gamma_lut; // Pipeline to process the vectors glyph paths (curves + contour) typedef agg::conv_curve<font_manager_type::path_adaptor_type> conv_curve_type; typedef agg::conv_contour<conv_curve_type> conv_contour_type; conv_curve_type m_curves; conv_contour_type m_contour; public: the_application(HDC dc, agg::pix_format_e format, bool flip) : agg::platform_support(format, flip), m_ren_type (5.0, 5.0, 5.0+150.0, 110.0, !flip), m_height (160, 10.0, 640-5.0, 18.0, !flip), m_width (160, 30.0, 640-5.0, 38.0, !flip), m_weight (160, 50.0, 640-5.0, 58.0, !flip), m_gamma (260, 70.0, 640-5.0, 78.0, !flip), m_hinting (160, 65.0, "Hinting", !flip), m_kerning (160, 80.0, "Kerning", !flip), m_performance (160, 95.0, "Test Performance", !flip), m_feng(dc), m_fman(m_feng), m_old_height(0.0), m_curves(m_fman.path_adaptor()), m_contour(m_curves) { m_ren_type.add_item("Native Mono"); m_ren_type.add_item("Native Gray 8"); m_ren_type.add_item("Outline"); m_ren_type.add_item("AGG Mono"); m_ren_type.add_item("AGG Gray 8"); m_ren_type.cur_item(1); add_ctrl(m_ren_type); m_ren_type.no_transform(); m_height.label("Font Height=%.2f"); m_height.range(8, 32); m_height.num_steps(32-8); m_height.value(18); m_height.text_thickness(1.5); add_ctrl(m_height); m_height.no_transform(); m_width.label("Font Width=%.2f"); m_width.range(8, 32); m_width.num_steps(32-8); m_width.text_thickness(1.5); m_width.value(18); add_ctrl(m_width); m_width.no_transform(); m_weight.label("Font Weight=%.2f"); m_weight.range(-2, 2); m_weight.text_thickness(1.5); add_ctrl(m_weight); m_weight.no_transform(); m_gamma.label("Gamma=%.2f"); m_gamma.range(0.1, 2.0); m_gamma.value(1.0); m_gamma.text_thickness(1.5); add_ctrl(m_gamma); m_gamma.no_transform(); add_ctrl(m_hinting); m_hinting.status(true); m_hinting.no_transform(); add_ctrl(m_kerning); m_kerning.status(true); m_kerning.no_transform(); add_ctrl(m_performance); m_performance.no_transform(); // m_curves.approximation_method(agg::curve_div); // m_curves.approximation_scale(0.5); // m_curves.angle_tolerance(0.3); m_contour.auto_detect_orientation(false); } template<class Rasterizer, class Scanline, class RenSolid, class RenBin> unsigned draw_text(Rasterizer& ras, Scanline& sl, RenSolid& ren_solid, RenBin& ren_bin) { agg::glyph_rendering gren = agg::glyph_ren_native_mono; switch(m_ren_type.cur_item()) { case 0: gren = agg::glyph_ren_native_mono; break; case 1: gren = agg::glyph_ren_native_gray8; break; case 2: gren = agg::glyph_ren_outline; break; case 3: gren = agg::glyph_ren_agg_mono; break; case 4: gren = agg::glyph_ren_agg_gray8; break; } unsigned num_glyphs = 0; m_contour.width(-m_weight.value() * m_height.value() * 0.05); m_feng.hinting(m_hinting.status()); m_feng.height(m_height.value()); // Font width in Windows is strange. MSDN says, // "specifies the average width", but there's no clue what // this "average width" means. It'd be logical to specify // the width with regard to the font height, like it's done in // FreeType. That is, width == height should mean the "natural", // not distorted glyphs. In Windows you have to specify // the absolute width, which is very stupid and hard to use // in practice. //------------------------- m_feng.width((m_width.value() == m_height.value()) ? 0.0 : m_width.value() / 2.4); m_feng.italic(true); m_feng.flip_y(text_flip); agg::trans_affine mtx; //mtx *= agg::trans_affine_skewing(-0.3, 0); mtx *= agg::trans_affine_rotation(agg::deg2rad(-4.0)); m_feng.transform(mtx); if(m_feng.create_font("Arial", gren)) { m_fman.precache(' ', 127); double x = 10.0; double y0 = height() - m_height.value() - 10.0; double y = y0; const char_type* p = text; while(*p) { const agg::glyph_cache* glyph = m_fman.glyph(*p); if(glyph) { if(m_kerning.status()) { m_fman.add_kerning(&x, &y); } if(x >= width() - m_height.value()) { x = 10.0; y0 -= m_height.value(); if(y0 <= 120) break; y = y0; } m_fman.init_embedded_adaptors(glyph, x, y); switch(glyph->data_type) { case agg::glyph_data_mono: ren_bin.color(agg::rgba8(0, 0, 0)); agg::render_scanlines(m_fman.mono_adaptor(), m_fman.mono_scanline(), ren_bin); break; case agg::glyph_data_gray8: ren_solid.color(agg::rgba8(0, 0, 0)); agg::render_scanlines(m_fman.gray8_adaptor(), m_fman.gray8_scanline(), ren_solid); break; case agg::glyph_data_outline: ras.reset(); if(fabs(m_weight.value()) <= 0.01) { // For the sake of efficiency skip the // contour converter if the weight is about zero. //----------------------- ras.add_path(m_curves); } else { ras.add_path(m_contour); } ren_solid.color(agg::rgba8(0, 0, 0)); agg::render_scanlines(ras, sl, ren_solid); break; } // increment pen position x += glyph->advance_x; y += glyph->advance_y; ++num_glyphs; } ++p; } } return num_glyphs; } virtual void on_draw() { pixfmt_type pf(rbuf_window(), m_gamma_lut); base_ren_type ren_base(pf); renderer_solid ren_solid(ren_base); renderer_bin ren_bin(ren_base); ren_base.clear(agg::rgba(1,1,1)); agg::scanline_u8 sl; agg::rasterizer_scanline_aa<> ras; if(m_height.value() != m_old_height) { m_width.value(m_old_height = m_height.value()); } if(m_ren_type.cur_item() == 3) { // When rendering in mono format, // Set threshold gamma = 0.5 //------------------- m_feng.gamma(agg::gamma_threshold(m_gamma.value() / 2.0)); } else { m_feng.gamma(agg::gamma_none()); m_gamma_lut.gamma(m_gamma.value()); } draw_text(ras, sl, ren_solid, ren_bin); ras.gamma(agg::gamma_power(1.0)); agg::render_ctrl(ras, sl, ren_base, m_ren_type); agg::render_ctrl(ras, sl, ren_base, m_height); agg::render_ctrl(ras, sl, ren_base, m_width); agg::render_ctrl(ras, sl, ren_base, m_weight); agg::render_ctrl(ras, sl, ren_base, m_gamma); agg::render_ctrl(ras, sl, ren_base, m_hinting); agg::render_ctrl(ras, sl, ren_base, m_kerning); agg::render_ctrl(ras, sl, ren_base, m_performance); } virtual void on_ctrl_change() { if(m_performance.status()) { pixfmt_type pf(rbuf_window(), m_gamma_lut); base_ren_type ren_base(pf); renderer_solid ren_solid(ren_base); renderer_bin ren_bin(ren_base); ren_base.clear(agg::rgba(1,1,1)); agg::scanline_u8 sl; agg::rasterizer_scanline_aa<> ras; unsigned num_glyphs = 0; start_timer(); for(int i = 0; i < 50; i++) { num_glyphs += draw_text(ras, sl, ren_solid, ren_bin); } double t = elapsed_time(); char buf[100]; sprintf(buf, "Glyphs=%u, Time=%.3fms, %.3f glyps/sec, %.3f microsecond/glyph", num_glyphs, t, (num_glyphs / t) * 1000.0, (t / num_glyphs) * 1000.0); message(buf); m_performance.status(false); force_redraw(); } } virtual void on_key(int x, int y, unsigned key, unsigned flags) { text_flip = !text_flip; force_redraw(); } }; int agg_main(int argc, char* argv[]) { HDC dc = ::GetDC(0); the_application app(dc, agg::pix_format_bgr24, flip); app.caption("AGG Example. Rendering TrueType Fonts with WinAPI"); if(app.init(640, 520, agg::window_resize)) { return app.run(); } ::ReleaseDC(0, dc); return 1; } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/�������������������������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�016667� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/Makefile�����������������������������������������������������������0000644�0000000�0000000�00000005107�10703246330�020332� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# # This makefile can be used to build Win32 application under Cygwin # all: cd aa_demo; make cd aa_test; make cd alpha_gradient; make cd alpha_mask; make cd alpha_mask2; make cd alpha_mask3; make cd bezier_div; make cd bspline; make cd circles; make cd compositing; make cd component_rendering; make cd conv_contour; make cd conv_dash_marker; make cd conv_stroke; make cd distortions; make cd gamma_correction; make cd gamma_ctrl; make cd gouraud; make cd gpc_test; make cd gradients; make cd graph_test; make cd idea; make cd image_alpha; make cd image_filters; make cd image_filters2; make cd image_fltr_graph; make cd image_transforms; make cd image_perspective; make cd image_resample; make cd images1; make cd line_patterns; make cd lion; make cd lion_lens; make cd lion_outline; make cd mol_view; make cd multi_clip; make cd pattern_fill; make cd perspective; make cd polymorphic_renderer; make cd raster_text; make cd rasterizers; make cd rasterizers2; make cd rounded_rect; make cd scanline_boolean; make cd scanline_boolean2; make cd simple_blur; make cd trans_polar; make cd trans_curve1; make cd trans_curve2; make cd truetype_test; make clean: cd aa_demo; make clean cd aa_test; make clean cd alpha_gradient; make clean cd alpha_mask; make clean cd alpha_mask2; make clean cd alpha_mask3; make clean cd bezier_div; make clean cd bspline; make clean cd circles; make clean cd compositing; make clean cd component_rendering; make clean cd conv_contour; make clean cd conv_dash_marker; make clean cd conv_stroke; make clean cd distortions; make clean cd gamma_correction; make clean cd gamma_ctrl; make clean cd gouraud; make clean cd gpc_test; make clean cd gradients; make clean cd graph_test; make clean cd idea; make clean cd image_alpha; make clean cd image_filters; make clean cd image_filters2; make clean cd image_fltr_graph; make clean cd image_perspective; make clean cd image_resample; make clean cd image_transforms; make clean cd images1; make clean cd line_patterns; make clean cd lion; make clean cd lion_lens; make clean cd lion_outline; make clean cd mol_view; make clean cd multi_clip; make clean cd pattern_fill; make clean cd perspective; make clean cd polymorphic_renderer; make clean cd raster_text; make clean cd rasterizers; make clean cd rasterizers2; make clean cd rounded_rect; make clean cd scanline_boolean; make clean cd scanline_boolean2; make clean cd simple_blur; make clean cd trans_polar; make clean cd trans_curve1; make clean cd trans_curve2; make clean cd truetype_test; make clean ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/aa_demo/�����������������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�020254� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/aa_demo/Makefile���������������������������������������������������0000644�0000000�0000000�00000001370�10703246330�021715� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# # This makefile can be used to build a Win32 application under Cygwin or MinGW # include ../../../Makefile.in.$(shell uname) PROGNAME=aa_demo OUTNAME=$(PROGNAME) PLATFORM=win32 CXXFLAGS= $(AGGCXXFLAGS) -I../../../include \ -I/usr/X11R6/include \ -L/usr/X11R6/lib \ -L../../../src \ $(PIXFMT) LIBS = $(AGGLIBS) -lm -lgdi32 SRC=\ ../../$(PROGNAME).cpp \ ../../../src/platform/$(PLATFORM)/agg_platform_support.cpp \ ../../../src/platform/$(PLATFORM)/agg_win32_bmp.cpp OBJ= $(SRC:.cpp=.o) $(OUTNAME): $(OBJ) $(CXX) $(CXXFLAGS) $^ -o $(OUTNAME) $(LIBS) clean: rm -f $(OUTNAME) rm -f ../../$(PROGNAME).o rm -f ../../../src/platform/$(PLATFORM)/agg_platform_support.o rm -f gamma.txt rm -f gamma.bin %.o: %.cpp $(CXX) -c $(CXXFLAGS) $*.cpp -o $@ ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/aa_demo/aa_demo.dsp������������������������������������������������0000644�0000000�0000000�00000010727�10703246330�022360� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Microsoft Developer Studio Project File - Name="aa_demo" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 CFG=aa_demo - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "aa_demo.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "aa_demo.mak" CFG="aa_demo - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "aa_demo - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "aa_demo - Win32 Debug" (based on "Win32 (x86) Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "aa_demo - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /out:"./aa_demo.exe" !ELSEIF "$(CFG)" == "aa_demo - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "aa_demo - Win32 Release" # Name "aa_demo - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\aa_demo.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_bezier_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_curves.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_gsv_text.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_platform_support.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_slider_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_trans_affine.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_stroke.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_win32_bmp.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project �����������������������������������������agg-2.5+dfsg1/examples/win32_api/aa_demo/aa_demo.dsw������������������������������������������������0000644�0000000�0000000�00000000774�10703246330�022370� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "aa_demo"=.\aa_demo.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### ����agg-2.5+dfsg1/examples/win32_api/aa_test/�����������������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�020307� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/aa_test/Makefile���������������������������������������������������0000644�0000000�0000000�00000001403�10703246330�021745� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# # This makefile can be used to build a Win32 application under Cygwin # include ../../../Makefile.in.$(shell uname) PROGNAME=aa_test OUTNAME=$(PROGNAME) PLATFORM=win32 CXXFLAGS= $(AGGCXXFLAGS) -I../../../include \ -I/usr/X11R6/include \ -L/usr/X11R6/lib \ -L../../../src \ $(PIXFMT) LIBS = $(AGGLIBS) -lm -lgdi32 SRC=\ ../../$(PROGNAME).cpp \ ../../../src/platform/$(PLATFORM)/agg_platform_support.cpp \ ../../../src/platform/$(PLATFORM)/agg_win32_bmp.cpp OBJ= $(SRC:.cpp=.o) $(OUTNAME): $(OBJ) $(CXX) $(CXXFLAGS) $^ -o $(OUTNAME) $(LIBS) clean: rm -f $(OUTNAME) rm -f ../../$(PROGNAME).o rm -f ../../../src/platform/$(PLATFORM)/agg_platform_support.o rm -f gamma.txt rm -f gamma.bin %.o: %.cpp @echo \< $*.cpp \> $(CXX) -c $(CXXFLAGS) $*.cpp -o $@ �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/aa_test/aa_test.dsp������������������������������������������������0000644�0000000�0000000�00000011056�10703246330�022442� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Microsoft Developer Studio Project File - Name="aa_test" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 CFG=aa_test - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "aa_test.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "aa_test.mak" CFG="aa_test - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "aa_test - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "aa_test - Win32 Debug" (based on "Win32 (x86) Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=xicl6.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "aa_test - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /out:"./aa_test.exe" !ELSEIF "$(CFG)" == "aa_test - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "aa_test - Win32 Release" # Name "aa_test - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\aa_test.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_bezier_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_curves.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_gsv_text.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_platform_support.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_slider_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_trans_affine.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_dash.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_stroke.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_win32_bmp.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/aa_test/aa_test.dsw������������������������������������������������0000644�0000000�0000000�00000000774�10703246330�022456� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "aa_test"=.\aa_test.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### ����agg-2.5+dfsg1/examples/win32_api/alpha_gradient/����������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�021631� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/alpha_gradient/Makefile��������������������������������������������0000644�0000000�0000000�00000001412�10703246330�023267� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# # This makefile can be used to build a Win32 application under Cygwin # include ../../../Makefile.in.$(shell uname) PROGNAME=alpha_gradient OUTNAME=$(PROGNAME) PLATFORM=win32 CXXFLAGS= $(AGGCXXFLAGS) -I../../../include \ -I/usr/X11R6/include \ -L/usr/X11R6/lib \ -L../../../src \ $(PIXFMT) LIBS = $(AGGLIBS) -lm -lgdi32 SRC=\ ../../$(PROGNAME).cpp \ ../../../src/platform/$(PLATFORM)/agg_platform_support.cpp \ ../../../src/platform/$(PLATFORM)/agg_win32_bmp.cpp OBJ= $(SRC:.cpp=.o) $(OUTNAME): $(OBJ) $(CXX) $(CXXFLAGS) $^ -o $(OUTNAME) $(LIBS) clean: rm -f $(OUTNAME) rm -f ../../$(PROGNAME).o rm -f ../../../src/platform/$(PLATFORM)/agg_platform_support.o rm -f gamma.txt rm -f gamma.bin %.o: %.cpp @echo \< $*.cpp \> $(CXX) -c $(CXXFLAGS) $*.cpp -o $@ ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/alpha_gradient/alpha_gradient.dsp����������������������������������0000644�0000000�0000000�00000011452�10703246330�025306� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Microsoft Developer Studio Project File - Name="alpha_gradient" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 CFG=alpha_gradient - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "alpha_gradient.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "alpha_gradient.mak" CFG="alpha_gradient - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "alpha_gradient - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "alpha_gradient - Win32 Debug" (based on "Win32 (x86) Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "alpha_gradient - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /out:"./alpha_gradient.exe" !ELSEIF "$(CFG)" == "alpha_gradient - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /ZI /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "alpha_gradient - Win32 Release" # Name "alpha_gradient - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\..\src\agg_bezier_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_bspline.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_gsv_text.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_platform_support.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_spline_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_sqrt_tables.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_trans_affine.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_stroke.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_win32_bmp.cpp # End Source File # Begin Source File SOURCE=..\..\alpha_gradient.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # Begin Source File SOURCE=..\..\..\include\agg_span_gradient.h # End Source File # Begin Source File SOURCE=..\..\..\include\agg_span_gradient_alpha.h # End Source File # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/alpha_gradient/alpha_gradient.dsw����������������������������������0000644�0000000�0000000�00000001012�10703246330�025304� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "alpha_gradient"=.\alpha_gradient.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/alpha_mask/��������������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�020767� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/alpha_mask/Makefile������������������������������������������������0000644�0000000�0000000�00000001435�10703246330�022432� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# # This makefile can be used to build a Win32 application under Cygwin # include ../../../Makefile.in.$(shell uname) PROGNAME=alpha_mask OUTNAME=$(PROGNAME) PLATFORM=win32 CXXFLAGS= $(AGGCXXFLAGS) -I../../../include \ -I/usr/X11R6/include \ -L/usr/X11R6/lib \ -L../../../src \ $(PIXFMT) LIBS = $(AGGLIBS) -lm -lgdi32 SRC=\ ../../$(PROGNAME).cpp \ ../../parse_lion.cpp \ ../../../src/platform/$(PLATFORM)/agg_platform_support.cpp \ ../../../src/platform/$(PLATFORM)/agg_win32_bmp.cpp OBJ= $(SRC:.cpp=.o) $(OUTNAME): $(OBJ) $(CXX) $(CXXFLAGS) $^ -o $(OUTNAME) $(LIBS) clean: rm -f $(OUTNAME) rm -f ../../$(PROGNAME).o rm -f ../../../src/platform/$(PLATFORM)/agg_platform_support.o rm -f gamma.txt rm -f gamma.bin %.o: %.cpp @echo \< $*.cpp \> $(CXX) -c $(CXXFLAGS) $*.cpp -o $@ �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/alpha_mask/alpha_mask.dsp������������������������������������������0000644�0000000�0000000�00000011117�10703246330�023600� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Microsoft Developer Studio Project File - Name="alpha_mask" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 CFG=alpha_mask - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "alpha_mask.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "alpha_mask.mak" CFG="alpha_mask - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "alpha_mask - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "alpha_mask - Win32 Debug" (based on "Win32 (x86) Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "alpha_mask - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "AGG_BMP_NO_ALPHA_BLEND" /FD /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x419 /d "NDEBUG" # ADD RSC /l 0x419 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /out:"./alpha_mask.exe" !ELSEIF "$(CFG)" == "alpha_mask - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "AGG_BMP_NO_ALPHA_BLEND" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x419 /d "_DEBUG" # ADD RSC /l 0x419 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "alpha_mask - Win32 Release" # Name "alpha_mask - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\..\src\agg_bezier_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_gsv_text.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_platform_support.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_slider_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_trans_affine.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_stroke.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_win32_bmp.cpp # End Source File # Begin Source File SOURCE=..\..\alpha_mask.cpp # End Source File # Begin Source File SOURCE=..\..\parse_lion.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/alpha_mask/alpha_mask.dsw������������������������������������������0000644�0000000�0000000�00000001002�10703246330�023577� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "alpha_mask"=.\alpha_mask.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/alpha_mask2/�������������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�021051� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/alpha_mask2/Makefile�����������������������������������������������0000644�0000000�0000000�00000001436�10703246330�022515� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# # This makefile can be used to build a Win32 application under Cygwin # include ../../../Makefile.in.$(shell uname) PROGNAME=alpha_mask2 OUTNAME=$(PROGNAME) PLATFORM=win32 CXXFLAGS= $(AGGCXXFLAGS) -I../../../include \ -I/usr/X11R6/include \ -L/usr/X11R6/lib \ -L../../../src \ $(PIXFMT) LIBS = $(AGGLIBS) -lm -lgdi32 SRC=\ ../../$(PROGNAME).cpp \ ../../parse_lion.cpp \ ../../../src/platform/$(PLATFORM)/agg_platform_support.cpp \ ../../../src/platform/$(PLATFORM)/agg_win32_bmp.cpp OBJ= $(SRC:.cpp=.o) $(OUTNAME): $(OBJ) $(CXX) $(CXXFLAGS) $^ -o $(OUTNAME) $(LIBS) clean: rm -f $(OUTNAME) rm -f ../../$(PROGNAME).o rm -f ../../../src/platform/$(PLATFORM)/agg_platform_support.o rm -f gamma.txt rm -f gamma.bin %.o: %.cpp @echo \< $*.cpp \> $(CXX) -c $(CXXFLAGS) $*.cpp -o $@ ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/alpha_mask2/alpha_mask2.dsp����������������������������������������0000644�0000000�0000000�00000011652�10703246330�023750� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Microsoft Developer Studio Project File - Name="alpha_mask2" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 CFG=alpha_mask2 - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "alpha_mask2.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "alpha_mask2.mak" CFG="alpha_mask2 - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "alpha_mask2 - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "alpha_mask2 - Win32 Debug" (based on "Win32 (x86) Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "alpha_mask2 - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "AGG_BMP_NO_ALPHA_BLEND" /FD /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x419 /d "NDEBUG" # ADD RSC /l 0x419 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /out:"./alpha_mask2.exe" !ELSEIF "$(CFG)" == "alpha_mask2 - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "AGG_BMP_NO_ALPHA_BLEND" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x419 /d "_DEBUG" # ADD RSC /l 0x419 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "alpha_mask2 - Win32 Release" # Name "alpha_mask2 - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\..\src\agg_bezier_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_gsv_text.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_line_aa_basics.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_line_profile_aa.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_platform_support.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_slider_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_sqrt_tables.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_trans_affine.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_stroke.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_win32_bmp.cpp # End Source File # Begin Source File SOURCE=..\..\alpha_mask2.cpp # End Source File # Begin Source File SOURCE=..\..\parse_lion.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # Begin Source File SOURCE=..\..\..\include\agg_pixfmt_amask_adaptor.h # End Source File # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project ��������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/alpha_mask2/alpha_mask2.dsw����������������������������������������0000644�0000000�0000000�00000001004�10703246330�023745� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "alpha_mask2"=.\alpha_mask2.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/alpha_mask3/�������������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�021052� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/alpha_mask3/Makefile�����������������������������������������������0000644�0000000�0000000�00000001456�10703246330�022520� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# # This makefile can be used to build a Win32 application under Cygwin # include ../../../Makefile.in.$(shell uname) PROGNAME=alpha_mask3 OUTNAME=$(PROGNAME) PLATFORM=win32 CXXFLAGS= $(AGGCXXFLAGS) -I../../../include \ -I/usr/X11R6/include \ -L/usr/X11R6/lib \ -L../../../src \ $(PIXFMT) LIBS = $(AGGLIBS) -lm -lgdi32 SRC=\ ../../$(PROGNAME).cpp \ ../../make_arrows.cpp \ ../../make_gb_poly.cpp \ ../../../src/platform/$(PLATFORM)/agg_platform_support.cpp \ ../../../src/platform/$(PLATFORM)/agg_win32_bmp.cpp OBJ= $(SRC:.cpp=.o) $(OUTNAME): $(OBJ) $(CXX) $(CXXFLAGS) $^ -o $(OUTNAME) $(LIBS) clean: rm -f $(OUTNAME) rm -f ../../*.o rm -f ../../../src/platform/$(PLATFORM)/agg_platform_support.o rm -f gamma.txt rm -f gamma.bin %.o: %.cpp @echo \< $*.cpp \> $(CXX) -c $(CXXFLAGS) $*.cpp -o $@ ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/alpha_mask3/alpha_mask3.dsp����������������������������������������0000644�0000000�0000000�00000011534�10703246330�023751� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Microsoft Developer Studio Project File - Name="alpha_mask3" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 CFG=alpha_mask3 - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "alpha_mask3.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "alpha_mask3.mak" CFG="alpha_mask3 - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "alpha_mask3 - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "alpha_mask3 - Win32 Debug" (based on "Win32 (x86) Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "alpha_mask3 - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /I "../../../gpc" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /out:"./alpha_mask3.exe" !ELSEIF "$(CFG)" == "alpha_mask3 - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /I "../../../gpc" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "alpha_mask3 - Win32 Release" # Name "alpha_mask3 - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\..\src\agg_bezier_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_cbox_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_curves.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_gsv_text.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_platform_support.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_rbox_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_slider_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_trans_affine.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_stroke.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_win32_bmp.cpp # End Source File # Begin Source File SOURCE=..\..\alpha_mask3.cpp # End Source File # Begin Source File SOURCE=..\..\make_arrows.cpp # End Source File # Begin Source File SOURCE=..\..\make_gb_poly.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project ��������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/alpha_mask3/alpha_mask3.dsw����������������������������������������0000644�0000000�0000000�00000001004�10703246330�023747� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "alpha_mask3"=.\alpha_mask3.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/bezier_div/��������������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�021011� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/bezier_div/Makefile������������������������������������������������0000644�0000000�0000000�00000001511�10703246330�022447� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# # This makefile can be used to build a Win32 application under Cygwin # include ../../../Makefile.in.$(shell uname) PROGNAME=bezier_div OUTNAME=$(PROGNAME) PLATFORM=win32 CXXFLAGS= $(AGGCXXFLAGS) -I../../../include \ -I/usr/X11R6/include \ -L/usr/X11R6/lib \ -L../../../src \ $(PIXFMT) LIBS = $(AGGLIBS) -lm -lgdi32 SRC=\ ../../$(PROGNAME).cpp \ ../../interactive_polygon.cpp \ ../../../src/platform/$(PLATFORM)/agg_platform_support.cpp \ ../../../src/platform/$(PLATFORM)/agg_win32_bmp.cpp OBJ= $(SRC:.cpp=.o) $(OUTNAME): $(OBJ) $(CXX) $(CXXFLAGS) $^ -o $(OUTNAME) $(LIBS) clean: rm -f $(OUTNAME) rm -f ../../$(PROGNAME).o rm -f ../../interactive_polygon.o rm -f ../../../src/platform/$(PLATFORM)/agg_platform_support.o rm -f gamma.txt rm -f gamma.bin %.o: %.cpp @echo \< $*.cpp \> $(CXX) -c $(CXXFLAGS) $*.cpp -o $@ ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/bezier_div/bezier_div.dsp������������������������������������������0000644�0000000�0000000�00000012346�10703246330�023651� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Microsoft Developer Studio Project File - Name="bezier_div" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 CFG=bezier_div - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "bezier_div.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "bezier_div.mak" CFG="bezier_div - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "bezier_div - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "bezier_div - Win32 Debug" (based on "Win32 (x86) Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=xicl6.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "bezier_div - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /profile /machine:I386 /out:"./bezier_div.exe" !ELSEIF "$(CFG)" == "bezier_div - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "bezier_div - Win32 Release" # Name "bezier_div - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\..\src\agg_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_bezier_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_bezier_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_cbox_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_curves.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_gsv_text.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_line_aa_basics.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_line_profile_aa.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_platform_support.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_polygon_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_rbox_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_slider_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_sqrt_tables.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_trans_affine.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_dash.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_stroke.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_win32_bmp.cpp # End Source File # Begin Source File SOURCE=..\..\bezier_div.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/bezier_div/bezier_div.dsw������������������������������������������0000644�0000000�0000000�00000001002�10703246330�023643� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "bezier_div"=.\bezier_div.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/blend_color/�������������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�021151� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/blend_color/Makefile�����������������������������������������������0000644�0000000�0000000�00000001407�10703246330�022613� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# # This makefile can be used to build a Win32 application under Cygwin # include ../../../Makefile.in.$(shell uname) PROGNAME=blend_color OUTNAME=$(PROGNAME) PLATFORM=win32 CXXFLAGS= $(AGGCXXFLAGS) -I../../../include \ -I/usr/X11R6/include \ -L/usr/X11R6/lib \ -L../../../src \ $(PIXFMT) LIBS = $(AGGLIBS) -lm -lgdi32 SRC=\ ../../$(PROGNAME).cpp \ ../../../src/platform/$(PLATFORM)/agg_platform_support.cpp \ ../../../src/platform/$(PLATFORM)/agg_win32_bmp.cpp OBJ= $(SRC:.cpp=.o) $(OUTNAME): $(OBJ) $(CXX) $(CXXFLAGS) $^ -o $(OUTNAME) $(LIBS) clean: rm -f $(OUTNAME) rm -f ../../$(PROGNAME).o rm -f ../../../src/platform/$(PLATFORM)/agg_platform_support.o rm -f gamma.txt rm -f gamma.bin %.o: %.cpp @echo \< $*.cpp \> $(CXX) -c $(CXXFLAGS) $*.cpp -o $@ ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/blend_color/blend_color.dsp����������������������������������������0000644�0000000�0000000�00000011762�10703246330�024152� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Microsoft Developer Studio Project File - Name="blend_color" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 CFG=blend_color - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "blend_color.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "blend_color.mak" CFG="blend_color - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "blend_color - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "blend_color - Win32 Debug" (based on "Win32 (x86) Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=xicl6.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "blend_color - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /out:"./blend_color.exe" !ELSEIF "$(CFG)" == "blend_color - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "blend_color - Win32 Release" # Name "blend_color - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\..\src\agg_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_arrowhead.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_bezier_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_cbox_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_curves.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_gsv_text.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_platform_support.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_polygon_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_rbox_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_slider_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_trans_affine.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_contour.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_stroke.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_win32_bmp.cpp # End Source File # Begin Source File SOURCE=..\..\blend_color.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project ��������������agg-2.5+dfsg1/examples/win32_api/blend_color/blend_color.dsw����������������������������������������0000644�0000000�0000000�00000001004�10703246330�024145� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "blend_color"=.\blend_color.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/blur/��������������������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�017633� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/blur/Makefile������������������������������������������������������0000644�0000000�0000000�00000001400�10703246330�021266� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# # This makefile can be used to build a Win32 application under Cygwin # include ../../../Makefile.in.$(shell uname) PROGNAME=blur OUTNAME=$(PROGNAME) PLATFORM=win32 CXXFLAGS= $(AGGCXXFLAGS) -I../../../include \ -I/usr/X11R6/include \ -L/usr/X11R6/lib \ -L../../../src \ $(PIXFMT) LIBS = $(AGGLIBS) -lm -lgdi32 SRC=\ ../../$(PROGNAME).cpp \ ../../../src/platform/$(PLATFORM)/agg_platform_support.cpp \ ../../../src/platform/$(PLATFORM)/agg_win32_bmp.cpp OBJ= $(SRC:.cpp=.o) $(OUTNAME): $(OBJ) $(CXX) $(CXXFLAGS) $^ -o $(OUTNAME) $(LIBS) clean: rm -f $(OUTNAME) rm -f ../../$(PROGNAME).o rm -f ../../../src/platform/$(PLATFORM)/agg_platform_support.o rm -f gamma.txt rm -f gamma.bin %.o: %.cpp @echo \< $*.cpp \> $(CXX) -c $(CXXFLAGS) $*.cpp -o $@ ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/blur/blur.dsp������������������������������������������������������0000644�0000000�0000000�00000011627�10703246330�021316� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Microsoft Developer Studio Project File - Name="blur" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 CFG=blur - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "blur.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "blur.mak" CFG="blur - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "blur - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "blur - Win32 Debug" (based on "Win32 (x86) Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=xicl6.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "blur - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /out:"./blur.exe" !ELSEIF "$(CFG)" == "blur - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "blur - Win32 Release" # Name "blur - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\..\src\agg_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_arrowhead.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_bezier_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_cbox_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_curves.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_gsv_text.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_platform_support.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_polygon_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_rbox_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_slider_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_trans_affine.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_contour.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_stroke.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_win32_bmp.cpp # End Source File # Begin Source File SOURCE=..\..\blur.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project ���������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/blur/blur.dsw������������������������������������������������������0000644�0000000�0000000�00000000766�10703246330�021327� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "blur"=.\blur.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### ����������agg-2.5+dfsg1/examples/win32_api/bspline/�����������������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�020323� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/bspline/Makefile���������������������������������������������������0000644�0000000�0000000�00000001506�10703246330�021765� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# # This makefile can be used to build a Win32 application under Cygwin # include ../../../Makefile.in.$(shell uname) PROGNAME=bspline OUTNAME=$(PROGNAME) PLATFORM=win32 CXXFLAGS= $(AGGCXXFLAGS) -I../../../include \ -I/usr/X11R6/include \ -L/usr/X11R6/lib \ -L../../../src \ $(PIXFMT) LIBS = $(AGGLIBS) -lm -lgdi32 SRC=\ ../../$(PROGNAME).cpp \ ../../interactive_polygon.cpp \ ../../../src/platform/$(PLATFORM)/agg_platform_support.cpp \ ../../../src/platform/$(PLATFORM)/agg_win32_bmp.cpp OBJ= $(SRC:.cpp=.o) $(OUTNAME): $(OBJ) $(CXX) $(CXXFLAGS) $^ -o $(OUTNAME) $(LIBS) clean: rm -f $(OUTNAME) rm -f ../../$(PROGNAME).o rm -f ../../interactive_polygon.o rm -f ../../../src/platform/$(PLATFORM)/agg_platform_support.o rm -f gamma.txt rm -f gamma.bin %.o: %.cpp @echo \< $*.cpp \> $(CXX) -c $(CXXFLAGS) $*.cpp -o $@ ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/bspline/bspline.dsp������������������������������������������������0000644�0000000�0000000�00000011437�10703246330�022475� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Microsoft Developer Studio Project File - Name="bspline" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 CFG=bspline - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "bspline.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "bspline.mak" CFG="bspline - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "bspline - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "bspline - Win32 Debug" (based on "Win32 (x86) Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "bspline - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "AGG_BMP_NO_ALPHA_BLEND" /FD /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x419 /d "NDEBUG" # ADD RSC /l 0x419 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /out:"./bspline.exe" !ELSEIF "$(CFG)" == "bspline - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "AGG_BMP_NO_ALPHA_BLEND" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x419 /d "_DEBUG" # ADD RSC /l 0x419 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "bspline - Win32 Release" # Name "bspline - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\..\src\agg_bezier_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_bspline.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_cbox_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_gsv_text.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_platform_support.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_slider_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_trans_affine.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_bspline.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_stroke.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_win32_bmp.cpp # End Source File # Begin Source File SOURCE=..\..\bspline.cpp # End Source File # Begin Source File SOURCE=..\..\interactive_polygon.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/bspline/bspline.dsw������������������������������������������������0000644�0000000�0000000�00000000774�10703246330�022506� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "bspline"=.\bspline.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### ����agg-2.5+dfsg1/examples/win32_api/circles/�����������������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�020313� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/circles/Makefile���������������������������������������������������0000644�0000000�0000000�00000001403�10703246330�021751� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# # This makefile can be used to build a Win32 application under Cygwin # include ../../../Makefile.in.$(shell uname) PROGNAME=circles OUTNAME=$(PROGNAME) PLATFORM=win32 CXXFLAGS= $(AGGCXXFLAGS) -I../../../include \ -I/usr/X11R6/include \ -L/usr/X11R6/lib \ -L../../../src \ $(PIXFMT) LIBS = $(AGGLIBS) -lm -lgdi32 SRC=\ ../../$(PROGNAME).cpp \ ../../../src/platform/$(PLATFORM)/agg_platform_support.cpp \ ../../../src/platform/$(PLATFORM)/agg_win32_bmp.cpp OBJ= $(SRC:.cpp=.o) $(OUTNAME): $(OBJ) $(CXX) $(CXXFLAGS) $^ -o $(OUTNAME) $(LIBS) clean: rm -f $(OUTNAME) rm -f ../../$(PROGNAME).o rm -f ../../../src/platform/$(PLATFORM)/agg_platform_support.o rm -f gamma.txt rm -f gamma.bin %.o: %.cpp @echo \< $*.cpp \> $(CXX) -c $(CXXFLAGS) $*.cpp -o $@ �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/circles/circles.dsp������������������������������������������������0000644�0000000�0000000�00000011524�10703246330�022452� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Microsoft Developer Studio Project File - Name="circles" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 CFG=circles - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "circles.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "circles.mak" CFG="circles - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "circles - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "circles - Win32 Debug" (based on "Win32 (x86) Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=xicl6.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "circles - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /FD /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /out:"./circles.exe" !ELSEIF "$(CFG)" == "circles - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /FD /GZ /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "circles - Win32 Release" # Name "circles - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\..\src\agg_bezier_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_bspline.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_gsv_text.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_platform_support.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_scale_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_slider_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_trans_affine.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_stroke.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_win32_bmp.cpp # End Source File # Begin Source File SOURCE=..\..\circles.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # Begin Source File SOURCE=..\..\..\include\agg_gsv_text.h # End Source File # Begin Source File SOURCE=..\..\..\include\platform\agg_platform_support.h # End Source File # Begin Source File SOURCE=..\..\..\include\ctrl\agg_scale_ctrl.h # End Source File # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/circles/circles.dsw������������������������������������������������0000644�0000000�0000000�00000000774�10703246330�022466� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "circles"=.\circles.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### ����agg-2.5+dfsg1/examples/win32_api/component_rendering/�����������������������������������������������0000755�0000000�0000000�00000000000�10703246330�022726� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/component_rendering/Makefile���������������������������������������0000644�0000000�0000000�00000001417�10703246330�024371� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# # This makefile can be used to build a Win32 application under Cygwin # include ../../../Makefile.in.$(shell uname) PROGNAME=component_rendering OUTNAME=$(PROGNAME) PLATFORM=win32 CXXFLAGS= $(AGGCXXFLAGS) -I../../../include \ -I/usr/X11R6/include \ -L/usr/X11R6/lib \ -L../../../src \ $(PIXFMT) LIBS = $(AGGLIBS) -lm -lgdi32 SRC=\ ../../$(PROGNAME).cpp \ ../../../src/platform/$(PLATFORM)/agg_platform_support.cpp \ ../../../src/platform/$(PLATFORM)/agg_win32_bmp.cpp OBJ= $(SRC:.cpp=.o) $(OUTNAME): $(OBJ) $(CXX) $(CXXFLAGS) $^ -o $(OUTNAME) $(LIBS) clean: rm -f $(OUTNAME) rm -f ../../$(PROGNAME).o rm -f ../../../src/platform/$(PLATFORM)/agg_platform_support.o rm -f gamma.txt rm -f gamma.bin %.o: %.cpp @echo \< $*.cpp \> $(CXX) -c $(CXXFLAGS) $*.cpp -o $@ �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/component_rendering/component_rendering.dsp������������������������0000644�0000000�0000000�00000011253�10703246330�027477� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Microsoft Developer Studio Project File - Name="component_rendering" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 CFG=component_rendering - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "component_rendering.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "component_rendering.mak" CFG="component_rendering - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "component_rendering - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "component_rendering - Win32 Debug" (based on "Win32 (x86) Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "component_rendering - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "AGG_BMP_NO_ALPHA_BLEND" /FD /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x419 /d "NDEBUG" # ADD RSC /l 0x419 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /out:"./component_rendering.exe" !ELSEIF "$(CFG)" == "component_rendering - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "AGG_BMP_NO_ALPHA_BLEND" /FD /GZ /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x419 /d "_DEBUG" # ADD RSC /l 0x419 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "component_rendering - Win32 Release" # Name "component_rendering - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\..\src\agg_bezier_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_gsv_text.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_platform_support.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_slider_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_trans_affine.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_stroke.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_win32_bmp.cpp # End Source File # Begin Source File SOURCE=..\..\component_rendering.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/component_rendering/component_rendering.dsw������������������������0000644�0000000�0000000�00000001024�10703246330�027501� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "component_rendering"=.\component_rendering.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/compositing/�������������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�021222� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/compositing/Makefile�����������������������������������������������0000644�0000000�0000000�00000001374�10703246330�022667� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# # This makefile can be used to build a Win32 application under Cygwin or MinGW # include ../../../Makefile.in.$(shell uname) PROGNAME=compositing OUTNAME=$(PROGNAME) PLATFORM=win32 CXXFLAGS= $(AGGCXXFLAGS) -I../../../include \ -I/usr/X11R6/include \ -L/usr/X11R6/lib \ -L../../../src \ $(PIXFMT) LIBS = $(AGGLIBS) -lm -lgdi32 SRC=\ ../../$(PROGNAME).cpp \ ../../../src/platform/$(PLATFORM)/agg_platform_support.cpp \ ../../../src/platform/$(PLATFORM)/agg_win32_bmp.cpp OBJ= $(SRC:.cpp=.o) $(OUTNAME): $(OBJ) $(CXX) $(CXXFLAGS) $^ -o $(OUTNAME) $(LIBS) clean: rm -f $(OUTNAME) rm -f ../../$(PROGNAME).o rm -f ../../../src/platform/$(PLATFORM)/agg_platform_support.o rm -f gamma.txt rm -f gamma.bin %.o: %.cpp $(CXX) -c $(CXXFLAGS) $*.cpp -o $@ ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/compositing/compositing.dsp����������������������������������������0000644�0000000�0000000�00000011654�10703246330�024274� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Microsoft Developer Studio Project File - Name="compositing" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 CFG=compositing - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "compositing.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "compositing.mak" CFG="compositing - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "compositing - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "compositing - Win32 Debug" (based on "Win32 (x86) Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=xicl6.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "compositing - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /out:"./compositing.exe" !ELSEIF "$(CFG)" == "compositing - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "compositing - Win32 Release" # Name "compositing - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\..\src\agg_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_bezier_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_curves.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_gsv_text.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_platform_support.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_rbox_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_rounded_rect.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_slider_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_trans_affine.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_stroke.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_win32_bmp.cpp # End Source File # Begin Source File SOURCE=..\..\compositing.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # Begin Source File SOURCE=..\..\..\include\agg_pixfmt_rgba.h # End Source File # Begin Source File SOURCE=..\..\..\include\agg_rendering_buffer_dynarow.h # End Source File # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project ������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/compositing/compositing.dsw����������������������������������������0000644�0000000�0000000�00000001004�10703246330�024267� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "compositing"=.\compositing.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/compositing/readme�������������������������������������������������0000644�0000000�0000000�00000000117�10703246330�022401� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Download http://www.antigrain.com/compositing.bmp before running this example. �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/compositing2/������������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�021304� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/compositing2/Makefile����������������������������������������������0000644�0000000�0000000�00000001374�10703246330�022751� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# # This makefile can be used to build a Win32 application under Cygwin or MinGW # include ../../../Makefile.in.$(shell uname) PROGNAME=compositing OUTNAME=$(PROGNAME) PLATFORM=win32 CXXFLAGS= $(AGGCXXFLAGS) -I../../../include \ -I/usr/X11R6/include \ -L/usr/X11R6/lib \ -L../../../src \ $(PIXFMT) LIBS = $(AGGLIBS) -lm -lgdi32 SRC=\ ../../$(PROGNAME).cpp \ ../../../src/platform/$(PLATFORM)/agg_platform_support.cpp \ ../../../src/platform/$(PLATFORM)/agg_win32_bmp.cpp OBJ= $(SRC:.cpp=.o) $(OUTNAME): $(OBJ) $(CXX) $(CXXFLAGS) $^ -o $(OUTNAME) $(LIBS) clean: rm -f $(OUTNAME) rm -f ../../$(PROGNAME).o rm -f ../../../src/platform/$(PLATFORM)/agg_platform_support.o rm -f gamma.txt rm -f gamma.bin %.o: %.cpp $(CXX) -c $(CXXFLAGS) $*.cpp -o $@ ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/compositing2/compositing2.dsp��������������������������������������0000644�0000000�0000000�00000012010�10703246330�024423� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Microsoft Developer Studio Project File - Name="compositing2" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 CFG=compositing2 - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "compositing2.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "compositing2.mak" CFG="compositing2 - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "compositing2 - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "compositing2 - Win32 Debug" (based on "Win32 (x86) Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=xicl6.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "compositing2 - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /out:"./compositing2.exe" !ELSEIF "$(CFG)" == "compositing2 - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "compositing2 - Win32 Release" # Name "compositing2 - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\..\src\agg_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_bezier_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_curves.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_gsv_text.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_platform_support.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_rbox_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_rounded_rect.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_slider_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_sqrt_tables.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_trans_affine.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_stroke.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_win32_bmp.cpp # End Source File # Begin Source File SOURCE=..\..\compositing2.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # Begin Source File SOURCE=..\..\..\include\agg_pixfmt_rgba.h # End Source File # Begin Source File SOURCE=..\..\..\include\agg_rendering_buffer_dynarow.h # End Source File # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/compositing2/compositing2.dsw��������������������������������������0000644�0000000�0000000�00000001006�10703246330�024435� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "compositing2"=.\compositing2.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/conv_contour/������������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�021405� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/conv_contour/Makefile����������������������������������������������0000644�0000000�0000000�00000001410�10703246330�023041� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# # This makefile can be used to build a Win32 application under Cygwin # include ../../../Makefile.in.$(shell uname) PROGNAME=conv_contour OUTNAME=$(PROGNAME) PLATFORM=win32 CXXFLAGS= $(AGGCXXFLAGS) -I../../../include \ -I/usr/X11R6/include \ -L/usr/X11R6/lib \ -L../../../src \ $(PIXFMT) LIBS = $(AGGLIBS) -lm -lgdi32 SRC=\ ../../$(PROGNAME).cpp \ ../../../src/platform/$(PLATFORM)/agg_platform_support.cpp \ ../../../src/platform/$(PLATFORM)/agg_win32_bmp.cpp OBJ= $(SRC:.cpp=.o) $(OUTNAME): $(OBJ) $(CXX) $(CXXFLAGS) $^ -o $(OUTNAME) $(LIBS) clean: rm -f $(OUTNAME) rm -f ../../$(PROGNAME).o rm -f ../../../src/platform/$(PLATFORM)/agg_platform_support.o rm -f gamma.txt rm -f gamma.bin %.o: %.cpp @echo \< $*.cpp \> $(CXX) -c $(CXXFLAGS) $*.cpp -o $@ ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/conv_contour/conv_contour.dsp��������������������������������������0000644�0000000�0000000�00000011641�10703246330�024636� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Microsoft Developer Studio Project File - Name="conv_contour" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 CFG=conv_contour - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "conv_contour.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "conv_contour.mak" CFG="conv_contour - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "conv_contour - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "conv_contour - Win32 Debug" (based on "Win32 (x86) Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "conv_contour - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /out:"./conv_contour.exe" !ELSEIF "$(CFG)" == "conv_contour - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "conv_contour - Win32 Release" # Name "conv_contour - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\..\src\agg_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_arrowhead.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_bezier_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_cbox_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_curves.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_gsv_text.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_platform_support.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_rbox_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_slider_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_trans_affine.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_contour.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_stroke.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_win32_bmp.cpp # End Source File # Begin Source File SOURCE=..\..\conv_contour.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project �����������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/conv_contour/conv_contour.dsw��������������������������������������0000644�0000000�0000000�00000001006�10703246330�024637� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "conv_contour"=.\conv_contour.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/conv_dash_marker/��������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�022174� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/conv_dash_marker/Makefile������������������������������������������0000644�0000000�0000000�00000001414�10703246330�023634� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# # This makefile can be used to build a Win32 application under Cygwin # include ../../../Makefile.in.$(shell uname) PROGNAME=conv_dash_marker OUTNAME=$(PROGNAME) PLATFORM=win32 CXXFLAGS= $(AGGCXXFLAGS) -I../../../include \ -I/usr/X11R6/include \ -L/usr/X11R6/lib \ -L../../../src \ $(PIXFMT) LIBS = $(AGGLIBS) -lm -lgdi32 SRC=\ ../../$(PROGNAME).cpp \ ../../../src/platform/$(PLATFORM)/agg_platform_support.cpp \ ../../../src/platform/$(PLATFORM)/agg_win32_bmp.cpp OBJ= $(SRC:.cpp=.o) $(OUTNAME): $(OBJ) $(CXX) $(CXXFLAGS) $^ -o $(OUTNAME) $(LIBS) clean: rm -f $(OUTNAME) rm -f ../../$(PROGNAME).o rm -f ../../../src/platform/$(PLATFORM)/agg_platform_support.o rm -f gamma.txt rm -f gamma.bin %.o: %.cpp @echo \< $*.cpp \> $(CXX) -c $(CXXFLAGS) $*.cpp -o $@ ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/conv_dash_marker/conv_dash_marker.dsp������������������������������0000644�0000000�0000000�00000012437�10703246330�026220� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Microsoft Developer Studio Project File - Name="conv_dash_marker" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 CFG=conv_dash_marker - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "conv_dash_marker.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "conv_dash_marker.mak" CFG="conv_dash_marker - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "conv_dash_marker - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "conv_dash_marker - Win32 Debug" (based on "Win32 (x86) Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "conv_dash_marker - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /out:"./conv_dash_marker.exe" !ELSEIF "$(CFG)" == "conv_dash_marker - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "conv_dash_marker - Win32 Release" # Name "conv_dash_marker - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\..\src\agg_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_arrowhead.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_bezier_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_cbox_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_curves.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_gsv_text.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_platform_support.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_rbox_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_rounded_rect.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_slider_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_trans_affine.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_contour.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_dash.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_markers_term.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_smooth_poly1.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_stroke.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_win32_bmp.cpp # End Source File # Begin Source File SOURCE=..\..\conv_dash_marker.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/conv_dash_marker/conv_dash_marker.dsw������������������������������0000644�0000000�0000000�00000001016�10703246330�026216� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "conv_dash_marker"=.\conv_dash_marker.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/conv_stroke/�������������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�021223� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/conv_stroke/Makefile�����������������������������������������������0000644�0000000�0000000�00000001407�10703246330�022665� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# # This makefile can be used to build a Win32 application under Cygwin # include ../../../Makefile.in.$(shell uname) PROGNAME=conv_stroke OUTNAME=$(PROGNAME) PLATFORM=win32 CXXFLAGS= $(AGGCXXFLAGS) -I../../../include \ -I/usr/X11R6/include \ -L/usr/X11R6/lib \ -L../../../src \ $(PIXFMT) LIBS = $(AGGLIBS) -lm -lgdi32 SRC=\ ../../$(PROGNAME).cpp \ ../../../src/platform/$(PLATFORM)/agg_platform_support.cpp \ ../../../src/platform/$(PLATFORM)/agg_win32_bmp.cpp OBJ= $(SRC:.cpp=.o) $(OUTNAME): $(OBJ) $(CXX) $(CXXFLAGS) $^ -o $(OUTNAME) $(LIBS) clean: rm -f $(OUTNAME) rm -f ../../$(PROGNAME).o rm -f ../../../src/platform/$(PLATFORM)/agg_platform_support.o rm -f gamma.txt rm -f gamma.bin %.o: %.cpp @echo \< $*.cpp \> $(CXX) -c $(CXXFLAGS) $*.cpp -o $@ ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/conv_stroke/conv_stroke.dsp����������������������������������������0000644�0000000�0000000�00000012214�10703246330�024267� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Microsoft Developer Studio Project File - Name="conv_stroke" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 CFG=conv_stroke - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "conv_stroke.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "conv_stroke.mak" CFG="conv_stroke - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "conv_stroke - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "conv_stroke - Win32 Debug" (based on "Win32 (x86) Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "conv_stroke - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /out:"./conv_stroke.exe" !ELSEIF "$(CFG)" == "conv_stroke - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "conv_stroke - Win32 Release" # Name "conv_stroke - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\..\src\agg_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_arrowhead.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_bezier_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_curves.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_gsv_text.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_platform_support.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_rbox_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_rounded_rect.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_slider_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_trans_affine.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_contour.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_dash.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_markers_term.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_smooth_poly1.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_stroke.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_win32_bmp.cpp # End Source File # Begin Source File SOURCE=..\..\conv_stroke.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/conv_stroke/conv_stroke.dsw����������������������������������������0000644�0000000�0000000�00000001004�10703246330�024271� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "conv_stroke"=.\conv_stroke.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/distortions/�������������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�021250� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/distortions/Makefile�����������������������������������������������0000644�0000000�0000000�00000001407�10703246330�022712� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# # This makefile can be used to build a Win32 application under Cygwin # include ../../../Makefile.in.$(shell uname) PROGNAME=distortions OUTNAME=$(PROGNAME) PLATFORM=win32 CXXFLAGS= $(AGGCXXFLAGS) -I../../../include \ -I/usr/X11R6/include \ -L/usr/X11R6/lib \ -L../../../src \ $(PIXFMT) LIBS = $(AGGLIBS) -lm -lgdi32 SRC=\ ../../$(PROGNAME).cpp \ ../../../src/platform/$(PLATFORM)/agg_platform_support.cpp \ ../../../src/platform/$(PLATFORM)/agg_win32_bmp.cpp OBJ= $(SRC:.cpp=.o) $(OUTNAME): $(OBJ) $(CXX) $(CXXFLAGS) $^ -o $(OUTNAME) $(LIBS) clean: rm -f $(OUTNAME) rm -f ../../$(PROGNAME).o rm -f ../../../src/platform/$(PLATFORM)/agg_platform_support.o rm -f gamma.txt rm -f gamma.bin %.o: %.cpp @echo \< $*.cpp \> $(CXX) -c $(CXXFLAGS) $*.cpp -o $@ ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/distortions/distortions.dsp����������������������������������������0000644�0000000�0000000�00000012071�10703246330�024342� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Microsoft Developer Studio Project File - Name="distortions" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 CFG=distortions - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "distortions.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "distortions.mak" CFG="distortions - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "distortions - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "distortions - Win32 Debug" (based on "Win32 (x86) Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "distortions - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /MD /W3 /GX /O2 /I "../../../include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "AGG_BMP_NO_ALPHA_BLEND" /FD /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x419 /d "NDEBUG" # ADD RSC /l 0x419 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /out:"./distortions.exe" # SUBTRACT LINK32 /profile !ELSEIF "$(CFG)" == "distortions - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /MD /W3 /Gm /GX /ZI /Od /I "../../../include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "AGG_BMP_NO_ALPHA_BLEND" /FD /GZ /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x419 /d "_DEBUG" # ADD RSC /l 0x419 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "distortions - Win32 Release" # Name "distortions - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\..\src\agg_bezier_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_bspline.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_gsv_text.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_image_filters.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_platform_support.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_rbox_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_slider_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_sqrt_tables.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_trans_affine.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_stroke.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_win32_bmp.cpp # End Source File # Begin Source File SOURCE=..\..\distortions.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # Begin Source File SOURCE=..\..\..\include\agg_span_interpolator_adaptor.h # End Source File # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # Begin Source File SOURCE=..\..\..\include\agg_gouraud_attr.h # End Source File # End Target # End Project �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/distortions/distortions.dsw����������������������������������������0000644�0000000�0000000�00000001004�10703246330�024343� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "distortions"=.\distortions.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/distortions/readme�������������������������������������������������0000644�0000000�0000000�00000000504�10703246330�022427� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Download http://www.antigrain.com/spheres.bmp before running this example Use the sliders and the radio-buttons to change the parameters of the distortions. Drag the center of the distortions. Don't try to understand the shamanic manipulations with affine matrices because I composed it using the "hit-and-miss" method :-) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/examples.dsw�������������������������������������������������������0000644�0000000�0000000�00000031026�10703246330�021226� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "aa_demo"=".\aa_demo\aa_demo.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "aa_test"=".\aa_test\aa_test.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "alpha_gradient"=".\alpha_gradient\alpha_gradient.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "alpha_mask"=".\alpha_mask\alpha_mask.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "alpha_mask2"=".\alpha_mask2\alpha_mask2.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "alpha_mask3"=".\alpha_mask3\alpha_mask3.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "bezier_div"=".\bezier_div\bezier_div.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "blend_color"=".\blend_color\blend_color.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "blur"=".\blur\blur.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "bspline"=".\bspline\bspline.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "circles"=".\circles\circles.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "component_rendering"=".\component_rendering\component_rendering.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "compositing"=".\compositing\compositing.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "compositing2"=".\compositing2\compositing2.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "conv_contour"=".\conv_contour\conv_contour.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "conv_dash_marker"=".\conv_dash_marker\conv_dash_marker.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "conv_stroke"=".\conv_stroke\conv_stroke.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "distortions"=".\distortions\distortions.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "flash_rasterizer"=".\flash_rasterizer\flash_rasterizer.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "flash_rasterizer2"=".\flash_rasterizer2\flash_rasterizer2.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "gamma_correction"=".\gamma_correction\gamma_correction.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "gamma_ctrl"=".\gamma_ctrl\gamma_ctrl.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "gamma_tuner"=".\gamma_tuner\gamma_tuner.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "gouraud"=".\gouraud\gouraud.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "gouraud_mesh"=".\gouraud_mesh\gouraud_mesh.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "gpc_test"=".\gpc_test\gpc_test.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "gradient_focal"=".\gradient_focal\gradient_focal.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "gradients"=".\gradients\gradients.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "graph_test"=".\graph_test\graph_test.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "idea"=".\idea\idea.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "image1"=".\image1\image1.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "image_alpha"=".\image_alpha\image_alpha.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "image_filters"=".\image_filters\image_filters.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "image_filters2"=".\image_filters2\image_filters2.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "image_fltr_graph"=".\image_fltr_graph\image_fltr_graph.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "image_perspective"=".\image_perspective\image_perspective.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "image_resample"=".\image_resample\image_resample.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "image_transforms"=".\image_transforms\image_transforms.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "line_patterns"=".\line_patterns\line_patterns.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "line_patterns_clip"=".\line_patterns_clip\line_patterns_clip.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "lion"=".\lion\lion.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "lion_lens"=".\lion_lens\lion_lens.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "lion_outline"=".\lion_outline\lion_outline.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "mol_view"=".\mol_view\mol_view.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "multi_clip"=".\multi_clip\multi_clip.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "pattern_fill"=".\pattern_fill\pattern_fill.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "pattern_perspective"=".\pattern_perspective\pattern_perspective.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "perspective"=".\perspective\perspective.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "polymorphic_renderer"=".\polymorphic_renderer\polymorphic_renderer.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "pure_api"=".\pure_api\pure_api.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "raster_text"=".\raster_text\raster_text.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "rasterizer_compound"=".\rasterizer_compound\rasterizer_compound.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "rasterizers"=".\rasterizers\rasterizers.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "rasterizers2"=".\rasterizers2\rasterizers2.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "rounded_rect"=".\rounded_rect\rounded_rect.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "scanline_boolean"=".\scanline_boolean\scanline_boolean.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "scanline_boolean2"=".\scanline_boolean2\scanline_boolean2.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "simple_blur"=".\simple_blur\simple_blur.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "trans_curve1"=".\trans_curve1\trans_curve1.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "trans_curve2"=".\trans_curve2\trans_curve2.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "trans_polar"=".\trans_polar\trans_polar.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "truetype_test"=".\truetype_test\truetype_test.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/flash_rasterizer/��������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�022236� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/flash_rasterizer/Makefile������������������������������������������0000644�0000000�0000000�00000001414�10703246330�023676� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# # This makefile can be used to build a Win32 application under Cygwin # include ../../../Makefile.in.$(shell uname) PROGNAME=flash_rasterizer OUTNAME=$(PROGNAME) PLATFORM=win32 CXXFLAGS= $(AGGCXXFLAGS) -I../../../include \ -I/usr/X11R6/include \ -L/usr/X11R6/lib \ -L../../../src \ $(PIXFMT) LIBS = $(AGGLIBS) -lm -lgdi32 SRC=\ ../../$(PROGNAME).cpp \ ../../../src/platform/$(PLATFORM)/agg_platform_support.cpp \ ../../../src/platform/$(PLATFORM)/agg_win32_bmp.cpp OBJ= $(SRC:.cpp=.o) $(OUTNAME): $(OBJ) $(CXX) $(CXXFLAGS) $^ -o $(OUTNAME) $(LIBS) clean: rm -f $(OUTNAME) rm -f ../../$(PROGNAME).o rm -f ../../../src/platform/$(PLATFORM)/agg_platform_support.o rm -f gamma.txt rm -f gamma.bin %.o: %.cpp @echo \< $*.cpp \> $(CXX) -c $(CXXFLAGS) $*.cpp -o $@ ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/flash_rasterizer/flash_rasterizer.dsp������������������������������0000644�0000000�0000000�00000011366�10703246330�026324� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Microsoft Developer Studio Project File - Name="flash_rasterizer" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 CFG=flash_rasterizer - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "flash_rasterizer.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "flash_rasterizer.mak" CFG="flash_rasterizer - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "flash_rasterizer - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "flash_rasterizer - Win32 Debug" (based on "Win32 (x86) Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=xicl6.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "flash_rasterizer - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /profile /machine:I386 /out:"./flash_rasterizer.exe" !ELSEIF "$(CFG)" == "flash_rasterizer - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "flash_rasterizer - Win32 Release" # Name "flash_rasterizer - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\..\src\agg_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_bezier_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_curves.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_gsv_text.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_platform_support.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_polygon_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_trans_affine.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_stroke.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_win32_bmp.cpp # End Source File # Begin Source File SOURCE=..\..\flash_rasterizer.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # Begin Source File SOURCE=..\..\..\include\agg_color_gray.h # End Source File # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/flash_rasterizer/flash_rasterizer.dsw������������������������������0000644�0000000�0000000�00000001016�10703246330�026322� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "flash_rasterizer"=.\flash_rasterizer.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/flash_rasterizer2/�������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�022320� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/flash_rasterizer2/Makefile�����������������������������������������0000644�0000000�0000000�00000001415�10703246330�023761� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# # This makefile can be used to build a Win32 application under Cygwin # include ../../../Makefile.in.$(shell uname) PROGNAME=flash_rasterizer2 OUTNAME=$(PROGNAME) PLATFORM=win32 CXXFLAGS= $(AGGCXXFLAGS) -I../../../include \ -I/usr/X11R6/include \ -L/usr/X11R6/lib \ -L../../../src \ $(PIXFMT) LIBS = $(AGGLIBS) -lm -lgdi32 SRC=\ ../../$(PROGNAME).cpp \ ../../../src/platform/$(PLATFORM)/agg_platform_support.cpp \ ../../../src/platform/$(PLATFORM)/agg_win32_bmp.cpp OBJ= $(SRC:.cpp=.o) $(OUTNAME): $(OBJ) $(CXX) $(CXXFLAGS) $^ -o $(OUTNAME) $(LIBS) clean: rm -f $(OUTNAME) rm -f ../../$(PROGNAME).o rm -f ../../../src/platform/$(PLATFORM)/agg_platform_support.o rm -f gamma.txt rm -f gamma.bin %.o: %.cpp @echo \< $*.cpp \> $(CXX) -c $(CXXFLAGS) $*.cpp -o $@ ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/flash_rasterizer2/flash_rasterizer2.dsp����������������������������0000644�0000000�0000000�00000011263�10703246330�026464� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Microsoft Developer Studio Project File - Name="flash_rasterizer2" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 CFG=flash_rasterizer2 - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "flash_rasterizer2.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "flash_rasterizer2.mak" CFG="flash_rasterizer2 - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "flash_rasterizer2 - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "flash_rasterizer2 - Win32 Debug" (based on "Win32 (x86) Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=xicl6.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "flash_rasterizer2 - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /profile /machine:I386 /out:"./flash_rasterizer2.exe" !ELSEIF "$(CFG)" == "flash_rasterizer2 - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "flash_rasterizer2 - Win32 Release" # Name "flash_rasterizer2 - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\..\src\agg_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_bezier_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_curves.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_gsv_text.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_platform_support.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_polygon_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_trans_affine.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_stroke.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_win32_bmp.cpp # End Source File # Begin Source File SOURCE=..\..\flash_rasterizer2.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/flash_rasterizer2/flash_rasterizer2.dsw����������������������������0000644�0000000�0000000�00000001020�10703246330�026461� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "flash_rasterizer2"=.\flash_rasterizer2.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/freetype_test/�����������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�021551� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/freetype_test/Makefile���������������������������������������������0000644�0000000�0000000�00000001464�10703246330�023216� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# # This makefile can be used to build a Win32 application under Cygwin # include ../../../Makefile.in.$(shell uname) PROGNAME=scanline_boolean2 OUTNAME=$(PROGNAME) PLATFORM=win32 CXXFLAGS= $(AGGCXXFLAGS) -I../../../include \ -I/usr/X11R6/include \ -L/usr/X11R6/lib \ -L../../../src \ $(PIXFMT) LIBS = $(AGGLIBS) -lm -lgdi32 SRC=\ ../../$(PROGNAME).cpp \ ../../make_arrows.cpp \ ../../make_gb_poly.cpp \ ../../../src/platform/$(PLATFORM)/agg_platform_support.cpp \ ../../../src/platform/$(PLATFORM)/agg_win32_bmp.cpp OBJ= $(SRC:.cpp=.o) $(OUTNAME): $(OBJ) $(CXX) $(CXXFLAGS) $^ -o $(OUTNAME) $(LIBS) clean: rm -f $(OUTNAME) rm -f ../../*.o rm -f ../../../src/platform/$(PLATFORM)/agg_platform_support.o rm -f gamma.txt rm -f gamma.bin %.o: %.cpp @echo \< $*.cpp \> $(CXX) -c $(CXXFLAGS) $*.cpp -o $@ ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/freetype_test/freetype_test.dsp������������������������������������0000644�0000000�0000000�00000012401�10703246330�025141� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Microsoft Developer Studio Project File - Name="freetype_test" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 CFG=freetype_test - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "freetype_test.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "freetype_test.mak" CFG="freetype_test - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "freetype_test - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "freetype_test - Win32 Debug" (based on "Win32 (x86) Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "freetype_test - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD CPP /nologo /MD /W3 /GX /O2 /I "../../../include" /I "../../../font_freetype" /I "../../../../freetype2/include" /I "../../../../freetype2/src" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib freetype219.lib /nologo /subsystem:windows /machine:I386 /out:"./freetype_test.exe" /libpath:"../../../../freetype2/objs" !ELSEIF "$(CFG)" == "freetype_test - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c # ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../../include" /I "../../../font_freetype" /I "../../../../freetype2/include" /I "../../../../freetype2/src" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib freetype219_D.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept /libpath:"../../../../freetype2/objs" !ENDIF # Begin Target # Name "freetype_test - Win32 Release" # Name "freetype_test - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\..\src\agg_bezier_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_cbox_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_curves.cpp # End Source File # Begin Source File SOURCE=..\..\..\font_freetype\agg_font_freetype.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_gsv_text.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_platform_support.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_rbox_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_slider_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_trans_affine.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_contour.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_stroke.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_win32_bmp.cpp # End Source File # Begin Source File SOURCE=..\..\freetype_test.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # Begin Source File SOURCE=..\..\..\font_freetype\agg_font_freetype.h # End Source File # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/freetype_test/freetype_test.dsw������������������������������������0000644�0000000�0000000�00000001010�10703246330�025142� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "freetype_test"=.\freetype_test.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/freetype_test/readme�����������������������������������������������0000644�0000000�0000000�00000000767�10703246330�022743� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������This example demonstrates the use of the FreeType font rendering engine (http://freetype.org). Please get file "timesi.ttf" before running this example. You can download it from: http://www.antigrain.com/timesi.zip Note that the building environment expects FreeType installed into the root directory, that is, "\freetype2". It supposed to be compiled in "Debug" and "Release" configurations. If you install FreeType somewhere else please correct the paths to the include and library directories. ���������agg-2.5+dfsg1/examples/win32_api/gamma_correction/��������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�022200� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/gamma_correction/Makefile������������������������������������������0000644�0000000�0000000�00000001414�10703246330�023640� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# # This makefile can be used to build a Win32 application under Cygwin # include ../../../Makefile.in.$(shell uname) PROGNAME=gamma_correction OUTNAME=$(PROGNAME) PLATFORM=win32 CXXFLAGS= $(AGGCXXFLAGS) -I../../../include \ -I/usr/X11R6/include \ -L/usr/X11R6/lib \ -L../../../src \ $(PIXFMT) LIBS = $(AGGLIBS) -lm -lgdi32 SRC=\ ../../$(PROGNAME).cpp \ ../../../src/platform/$(PLATFORM)/agg_platform_support.cpp \ ../../../src/platform/$(PLATFORM)/agg_win32_bmp.cpp OBJ= $(SRC:.cpp=.o) $(OUTNAME): $(OBJ) $(CXX) $(CXXFLAGS) $^ -o $(OUTNAME) $(LIBS) clean: rm -f $(OUTNAME) rm -f ../../$(PROGNAME).o rm -f ../../../src/platform/$(PLATFORM)/agg_platform_support.o rm -f gamma.txt rm -f gamma.bin %.o: %.cpp @echo \< $*.cpp \> $(CXX) -c $(CXXFLAGS) $*.cpp -o $@ ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/gamma_correction/gamma_correction.dsp������������������������������0000644�0000000�0000000�00000011000�10703246330�026211� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Microsoft Developer Studio Project File - Name="gamma_correction" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 CFG=gamma_correction - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "gamma_correction.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "gamma_correction.mak" CFG="gamma_correction - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "gamma_correction - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "gamma_correction - Win32 Debug" (based on "Win32 (x86) Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "gamma_correction - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /out:"gamma_correction.exe" !ELSEIF "$(CFG)" == "gamma_correction - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "gamma_correction - Win32 Release" # Name "gamma_correction - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\..\src\agg_bezier_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_gsv_text.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_platform_support.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_slider_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_trans_affine.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_stroke.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_win32_bmp.cpp # End Source File # Begin Source File SOURCE=..\..\gamma_correction.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project agg-2.5+dfsg1/examples/win32_api/gamma_correction/gamma_correction.dsw������������������������������0000644�0000000�0000000�00000001016�10703246330�026226� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "gamma_correction"=.\gamma_correction.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/gamma_ctrl/��������������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�020775� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/gamma_ctrl/Makefile������������������������������������������������0000644�0000000�0000000�00000001405�10703246330�022435� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# # This makefile can be used to build a Win32 application under Cygwin # include ../../../Makefile.in.$(shell uname) PROGNAME=gamma_ctrl OUTNAME=$(PROGNAME) PLATFORM=win32 CXXFLAGS= $(AGGCXXFLAGS) -I../../../include \ -I/usr/X11R6/include \ -L/usr/X11R6/lib \ -L../../../src \ $(PIXFMT) LIBS = $(AGGLIBS) -lm -lgdi32 SRC=\ ../../$(PROGNAME).cpp \ ../../../src/platform/$(PLATFORM)/agg_platform_support.cpp \ ../../../src/platform/$(PLATFORM)/agg_win32_bmp.cpp OBJ= $(SRC:.cpp=.o) $(OUTNAME): $(OBJ) $(CXX) $(CXXFLAGS) $^ -o $(OUTNAME) $(LIBS) clean: rm -f $(OUTNAME) rm -f ../../$(PROGNAME).o rm -f ../../../src/platform/$(PLATFORM)/agg_platform_support.o rm -f gamma.txt rm -f gamma.bin %.o: %.cpp @echo \< $*.cpp \> $(CXX) -c $(CXXFLAGS) $*.cpp -o $@ �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/gamma_ctrl/gamma_ctrl.dsp������������������������������������������0000644�0000000�0000000�00000011351�10703246330�023614� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Microsoft Developer Studio Project File - Name="gamma_ctrl" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 CFG=gamma_ctrl - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "gamma_ctrl.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "gamma_ctrl.mak" CFG="gamma_ctrl - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "gamma_ctrl - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "gamma_ctrl - Win32 Debug" (based on "Win32 (x86) Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "gamma_ctrl - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /MD /W3 /GX /O2 /I "../../../include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "AGG_BMP_NO_ALPHA_BLEND" /FD /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x419 /d "NDEBUG" # ADD RSC /l 0x419 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /out:"./gamma_ctrl.exe" # SUBTRACT LINK32 /profile !ELSEIF "$(CFG)" == "gamma_ctrl - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /MD /W3 /Gm /GX /ZI /Od /I "../../../include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "AGG_BMP_NO_ALPHA_BLEND" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x419 /d "_DEBUG" # ADD RSC /l 0x419 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "gamma_ctrl - Win32 Release" # Name "gamma_ctrl - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\..\src\agg_bezier_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_bspline.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_gamma_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_gamma_spline.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_gsv_text.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_platform_support.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_trans_affine.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_stroke.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_win32_bmp.cpp # End Source File # Begin Source File SOURCE=..\..\gamma_ctrl.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/gamma_ctrl/gamma_ctrl.dsw������������������������������������������0000644�0000000�0000000�00000001002�10703246330�023613� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "gamma_ctrl"=.\gamma_ctrl.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/gamma_tuner/�������������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�021166� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/gamma_tuner/Makefile�����������������������������������������������0000644�0000000�0000000�00000001406�10703246330�022627� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# # This makefile can be used to build a Win32 application under Cygwin # include ../../../Makefile.in.$(shell uname) PROGNAME=gamma_tuner OUTNAME=$(PROGNAME) PLATFORM=win32 CXXFLAGS= $(AGGCXXFLAGS) -I../../../include \ -I/usr/X11R6/include \ -L/usr/X11R6/lib \ -L../../../src \ $(PIXFMT) LIBS = $(AGGLIBS) -lm -lgdi32 SRC=\ ../../$(PROGNAME).cpp \ ../../../src/platform/$(PLATFORM)/agg_platform_support.cpp \ ../../../src/platform/$(PLATFORM)/agg_win32_bmp.cpp OBJ= $(SRC:.cpp=.o) $(OUTNAME): $(OBJ) $(CXX) $(CXXFLAGS) $^ -o $(OUTNAME) $(LIBS) clean: rm -f $(OUTNAME) rm -f ../../$(PROGNAME).o rm -f ../../../src/platform/$(PLATFORM)/agg_platform_support.o rm -f gamma.txt rm -f gamma.bin %.o: %.cpp @echo \< $*.cpp \> $(CXX) -c $(CXXFLAGS) $*.cpp -o $@ ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/gamma_tuner/gamma_tuner.dsp����������������������������������������0000644�0000000�0000000�00000011032�10703246330�024172� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Microsoft Developer Studio Project File - Name="gamma_tuner" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 CFG=gamma_tuner - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "gamma_tuner.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "gamma_tuner.mak" CFG="gamma_tuner - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "gamma_tuner - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "gamma_tuner - Win32 Debug" (based on "Win32 (x86) Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=xicl6.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "gamma_tuner - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /out:"gamma_tuner.exe" !ELSEIF "$(CFG)" == "gamma_tuner - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "gamma_tuner - Win32 Release" # Name "gamma_tuner - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\..\src\agg_bezier_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_gsv_text.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_platform_support.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_rbox_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_slider_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_trans_affine.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_stroke.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_win32_bmp.cpp # End Source File # Begin Source File SOURCE=..\..\gamma_tuner.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/gamma_tuner/gamma_tuner.dsw����������������������������������������0000644�0000000�0000000�00000001004�10703246330�024177� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "gamma_tuner"=.\gamma_tuner.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/gouraud/�����������������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�020335� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/gouraud/Makefile���������������������������������������������������0000644�0000000�0000000�00000001403�10703246330�021773� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# # This makefile can be used to build a Win32 application under Cygwin # include ../../../Makefile.in.$(shell uname) PROGNAME=gouraud OUTNAME=$(PROGNAME) PLATFORM=win32 CXXFLAGS= $(AGGCXXFLAGS) -I../../../include \ -I/usr/X11R6/include \ -L/usr/X11R6/lib \ -L../../../src \ $(PIXFMT) LIBS = $(AGGLIBS) -lm -lgdi32 SRC=\ ../../$(PROGNAME).cpp \ ../../../src/platform/$(PLATFORM)/agg_platform_support.cpp \ ../../../src/platform/$(PLATFORM)/agg_win32_bmp.cpp OBJ= $(SRC:.cpp=.o) $(OUTNAME): $(OBJ) $(CXX) $(CXXFLAGS) $^ -o $(OUTNAME) $(LIBS) clean: rm -f $(OUTNAME) rm -f ../../$(PROGNAME).o rm -f ../../../src/platform/$(PLATFORM)/agg_platform_support.o rm -f gamma.txt rm -f gamma.bin %.o: %.cpp @echo \< $*.cpp \> $(CXX) -c $(CXXFLAGS) $*.cpp -o $@ �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/gouraud/gouraud.dsp������������������������������������������������0000644�0000000�0000000�00000010626�10703246330�022520� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Microsoft Developer Studio Project File - Name="gouraud" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 CFG=gouraud - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "gouraud.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "gouraud.mak" CFG="gouraud - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "gouraud - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "gouraud - Win32 Debug" (based on "Win32 (x86) Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=xicl6.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "gouraud - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /out:"./gouraud.exe" !ELSEIF "$(CFG)" == "gouraud - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "gouraud - Win32 Release" # Name "gouraud - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\..\src\agg_bezier_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_gsv_text.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_platform_support.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_slider_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_trans_affine.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_stroke.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_win32_bmp.cpp # End Source File # Begin Source File SOURCE=..\..\gouraud.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project ����������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/gouraud/gouraud.dsw������������������������������������������������0000644�0000000�0000000�00000000774�10703246330�022532� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "gouraud"=.\gouraud.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### ����agg-2.5+dfsg1/examples/win32_api/gouraud_mesh/������������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�021351� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/gouraud_mesh/Makefile����������������������������������������������0000644�0000000�0000000�00000001410�10703246330�023005� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# # This makefile can be used to build a Win32 application under Cygwin # include ../../../Makefile.in.$(shell uname) PROGNAME=gouraud_mesh OUTNAME=$(PROGNAME) PLATFORM=win32 CXXFLAGS= $(AGGCXXFLAGS) -I../../../include \ -I/usr/X11R6/include \ -L/usr/X11R6/lib \ -L../../../src \ $(PIXFMT) LIBS = $(AGGLIBS) -lm -lgdi32 SRC=\ ../../$(PROGNAME).cpp \ ../../../src/platform/$(PLATFORM)/agg_platform_support.cpp \ ../../../src/platform/$(PLATFORM)/agg_win32_bmp.cpp OBJ= $(SRC:.cpp=.o) $(OUTNAME): $(OBJ) $(CXX) $(CXXFLAGS) $^ -o $(OUTNAME) $(LIBS) clean: rm -f $(OUTNAME) rm -f ../../$(PROGNAME).o rm -f ../../../src/platform/$(PLATFORM)/agg_platform_support.o rm -f gamma.txt rm -f gamma.bin %.o: %.cpp @echo \< $*.cpp \> $(CXX) -c $(CXXFLAGS) $*.cpp -o $@ ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/gouraud_mesh/gouraud_mesh.dsp��������������������������������������0000644�0000000�0000000�00000011627�10703246330�024552� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Microsoft Developer Studio Project File - Name="gouraud_mesh" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 CFG=gouraud_mesh - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "gouraud_mesh.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "gouraud_mesh.mak" CFG="gouraud_mesh - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "gouraud_mesh - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "gouraud_mesh - Win32 Debug" (based on "Win32 (x86) Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=xicl6.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "gouraud_mesh - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "AGG_FISTP" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /profile /machine:I386 /out:"./gouraud_mesh.exe" !ELSEIF "$(CFG)" == "gouraud_mesh - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "AGG_QIFIST" /YX /FD /GZ /QIfist /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "gouraud_mesh - Win32 Release" # Name "gouraud_mesh - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\..\src\agg_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_bezier_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_curves.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_gsv_text.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_platform_support.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_polygon_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_sqrt_tables.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_trans_affine.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_stroke.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_win32_bmp.cpp # End Source File # Begin Source File SOURCE=..\..\gouraud_mesh.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # Begin Source File SOURCE=..\..\..\include\agg_rasterizer_sl_clip.h # End Source File # Begin Source File SOURCE=..\..\..\include\agg_span_gouraud_rgba.h # End Source File # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project ���������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/gouraud_mesh/gouraud_mesh.dsw��������������������������������������0000644�0000000�0000000�00000001006�10703246330�024547� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "gouraud_mesh"=.\gouraud_mesh.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/gpc_test/����������������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�020477� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/gpc_test/Makefile��������������������������������������������������0000644�0000000�0000000�00000001472�10703246330�022143� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# # This makefile can be used to build a Win32 application under Cygwin # include ../../../Makefile.in.$(shell uname) PROGNAME=gpc_test OUTNAME=$(PROGNAME) PLATFORM=win32 CXXFLAGS= $(AGGCXXFLAGS) -I../../../include -I../../../gpc \ -I/usr/X11R6/include \ -L/usr/X11R6/lib \ -L../../../src \ $(PIXFMT) LIBS = $(AGGLIBS) -lm -lgdi32 SRC=\ ../../$(PROGNAME).cpp \ ../../make_arrows.cpp \ ../../make_gb_poly.cpp \ ../../../src/platform/$(PLATFORM)/agg_platform_support.cpp \ ../../../src/platform/$(PLATFORM)/agg_win32_bmp.cpp OBJ= $(SRC:.cpp=.o) $(OUTNAME): $(OBJ) $(CXX) $(CXXFLAGS) $^ -o $(OUTNAME) $(LIBS) clean: rm -f $(OUTNAME) rm -f ../../*.o rm -f ../../../src/platform/$(PLATFORM)/agg_platform_support.o rm -f gamma.txt rm -f gamma.bin %.o: %.cpp @echo \< $*.cpp \> $(CXX) -c $(CXXFLAGS) $*.cpp -o $@ ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/gpc_test/gpc_test.dsp����������������������������������������������0000644�0000000�0000000�00000011566�10703246330�023030� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Microsoft Developer Studio Project File - Name="gpc_test" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 CFG=gpc_test - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "gpc_test.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "gpc_test.mak" CFG="gpc_test - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "gpc_test - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "gpc_test - Win32 Debug" (based on "Win32 (x86) Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "gpc_test - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /I "../../../gpc" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /out:"./gpc_test.exe" !ELSEIF "$(CFG)" == "gpc_test - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /I "../../../gpc" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "gpc_test - Win32 Release" # Name "gpc_test - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\..\src\agg_bezier_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_cbox_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_curves.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_gsv_text.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_platform_support.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_rbox_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_slider_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_trans_affine.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_stroke.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_win32_bmp.cpp # End Source File # Begin Source File SOURCE=..\..\..\gpc\gpc.c # End Source File # Begin Source File SOURCE=..\..\gpc_test.cpp # End Source File # Begin Source File SOURCE=..\..\make_arrows.cpp # End Source File # Begin Source File SOURCE=..\..\make_gb_poly.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project ������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/gpc_test/gpc_test.dsw����������������������������������������������0000644�0000000�0000000�00000000776�10703246330�023040� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "gpc_test"=.\gpc_test.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### ��agg-2.5+dfsg1/examples/win32_api/gradient_focal/����������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�021630� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/gradient_focal/Makefile��������������������������������������������0000644�0000000�0000000�00000001350�10703246330�023267� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# # This makefile can be used to build a Win32 application under Cygwin # include ../../../Makefile.in.$(shell uname) PROGNAME=gradient_focal OUTNAME=$(PROGNAME) PLATFORM=win32 CXXFLAGS= $(AGGCXXFLAGS) -I../../../include \ -I/usr/X11R6/include \ -L/usr/X11R6/lib \ -L../../../src \ $(PIXFMT) LIBS = $(AGGLIBS) -lm -lgdi32 SRC=\ ../../$(PROGNAME).cpp \ ../../../src/platform/$(PLATFORM)/agg_platform_support.cpp \ ../../../src/platform/$(PLATFORM)/agg_win32_bmp.cpp OBJ= $(SRC:.cpp=.o) $(OUTNAME): $(OBJ) $(CXX) $(CXXFLAGS) $^ -o $(OUTNAME) $(LIBS) clean: rm -f $(OUTNAME) rm -f ../../$(PROGNAME).o rm -f ../../../src/platform/$(PLATFORM)/agg_platform_support.o %.o: %.cpp @echo \< $*.cpp \> $(CXX) -c $(CXXFLAGS) $*.cpp -o $@ ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/gradient_focal/gradient_focal.dsp����������������������������������0000644�0000000�0000000�00000012231�10703246330�025300� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Microsoft Developer Studio Project File - Name="gradient_focal" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 CFG=gradient_focal - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "gradient_focal.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "gradient_focal.mak" CFG="gradient_focal - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "gradient_focal - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "gradient_focal - Win32 Debug" (based on "Win32 (x86) Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=xicl6.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "gradient_focal - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /I "../../../gpc" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "AGG_BMP_NO_ALPHA_BLEND" /FD /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x419 /d "NDEBUG" # ADD RSC /l 0x419 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /out:"./gradient_focal.exe" !ELSEIF "$(CFG)" == "gradient_focal - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /I "../../../gpc" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "AGG_BMP_NO_ALPHA_BLEND" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x419 /d "_DEBUG" # ADD RSC /l 0x419 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "gradient_focal - Win32 Release" # Name "gradient_focal - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\..\src\agg_bezier_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_bspline.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_cbox_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_curves.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_gsv_text.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_platform_support.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_slider_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_sqrt_tables.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_trans_affine.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_contour.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_stroke.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_win32_bmp.cpp # End Source File # Begin Source File SOURCE=..\..\gradient_focal.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # Begin Source File SOURCE=..\..\..\include\agg_gradient_lut.h # End Source File # Begin Source File SOURCE=..\..\..\include\agg_image_filters.h # End Source File # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/gradient_focal/gradient_focal.dsw����������������������������������0000644�0000000�0000000�00000001012�10703246330�025302� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "gradient_focal"=.\gradient_focal.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/gradients/���������������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�020647� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/gradients/Makefile�������������������������������������������������0000644�0000000�0000000�00000001405�10703246330�022307� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# # This makefile can be used to build a Win32 application under Cygwin # include ../../../Makefile.in.$(shell uname) PROGNAME=gradients OUTNAME=$(PROGNAME) PLATFORM=win32 CXXFLAGS= $(AGGCXXFLAGS) -I../../../include \ -I/usr/X11R6/include \ -L/usr/X11R6/lib \ -L../../../src \ $(PIXFMT) LIBS = $(AGGLIBS) -lm -lgdi32 SRC=\ ../../$(PROGNAME).cpp \ ../../../src/platform/$(PLATFORM)/agg_platform_support.cpp \ ../../../src/platform/$(PLATFORM)/agg_win32_bmp.cpp OBJ= $(SRC:.cpp=.o) $(OUTNAME): $(OBJ) $(CXX) $(CXXFLAGS) $^ -o $(OUTNAME) $(LIBS) clean: rm -f $(OUTNAME) rm -f ../../$(PROGNAME).o rm -f ../../../src/platform/$(PLATFORM)/agg_platform_support.o rm -f gamma.txt rm -f gamma.bin %.o: %.cpp @echo \< $*.cpp \> $(CXX) -c $(CXXFLAGS) $*.cpp -o $@ �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/gradients/gradients.dsp��������������������������������������������0000644�0000000�0000000�00000012057�10703246330�023344� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Microsoft Developer Studio Project File - Name="gradients" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 CFG=gradients - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "gradients.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "gradients.mak" CFG="gradients - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "gradients - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "gradients - Win32 Debug" (based on "Win32 (x86) Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "gradients - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "AGG_BMP_NO_ALPHA_BLEND" /FD /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /out:"./gradients.exe" !ELSEIF "$(CFG)" == "gradients - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "AGG_BMP_NO_ALPHA_BLEND" /FD /GZ /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "gradients - Win32 Release" # Name "gradients - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\..\src\agg_bezier_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_bspline.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_curves.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_gamma_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_gamma_spline.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_gsv_text.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_platform_support.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_rbox_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_slider_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_spline_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_sqrt_tables.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_trans_affine.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_stroke.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_win32_bmp.cpp # End Source File # Begin Source File SOURCE=..\..\gradients.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/gradients/gradients.dsw��������������������������������������������0000644�0000000�0000000�00000001000�10703246330�023335� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "gradients"=.\gradients.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### agg-2.5+dfsg1/examples/win32_api/gradients/settings.dat���������������������������������������������0000644�0000000�0000000�00000000775�10703246330�023212� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������399.254028 339.996429 1.128661 77.270996 0.000000 1.000000 0.115323 1.000000 0.363710 0.812121 0.604032 0.460606 0.791935 0.200000 1.000000 0.606061 0.000000 1.000000 0.083065 1.000000 0.299194 0.418182 0.651484 0.000000 0.810365 0.000000 1.000000 0.290598 0.000000 1.000000 0.051755 0.934195 0.115509 0.587701 0.334362 0.000000 0.708762 0.000000 1.000000 0.000000 0.000000 1.000000 0.171775 1.000000 0.376360 1.000000 0.598100 1.000000 0.804839 1.000000 1.000000 1.000000 0.786681 1.239889 0.726049 0.710140 ���agg-2.5+dfsg1/examples/win32_api/graph_test/��������������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�021027� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/graph_test/Makefile������������������������������������������������0000644�0000000�0000000�00000001406�10703246330�022470� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# # This makefile can be used to build a Win32 application under Cygwin # include ../../../Makefile.in.$(shell uname) PROGNAME=graph_test OUTNAME=$(PROGNAME) PLATFORM=win32 CXXFLAGS= $(AGGCXXFLAGS) -I../../../include \ -I/usr/X11R6/include \ -L/usr/X11R6/lib \ -L../../../src \ $(PIXFMT) LIBS = $(AGGLIBS) -lm -lgdi32 SRC=\ ../../$(PROGNAME).cpp \ ../../../src/platform/$(PLATFORM)/agg_platform_support.cpp \ ../../../src/platform/$(PLATFORM)/agg_win32_bmp.cpp OBJ= $(SRC:.cpp=.o) $(OUTNAME): $(OBJ) $(CXX) $(CXXFLAGS) $^ -o $(OUTNAME) $(LIBS) clean: rm -f $(OUTNAME) rm -f ../../$(PROGNAME).o rm -f ../../../src/platform/$(PLATFORM)/agg_platform_support.o rm -f gamma.txt rm -f gamma.bin %.o: %.cpp @echo \< $*.cpp \> $(CXX) -c $(CXXFLAGS) $*.cpp -o $@ ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/graph_test/graph_test.dsp������������������������������������������0000644�0000000�0000000�00000012473�10703246330�023706� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Microsoft Developer Studio Project File - Name="graph_test" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 CFG=graph_test - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "graph_test.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "graph_test.mak" CFG="graph_test - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "graph_test - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "graph_test - Win32 Debug" (based on "Win32 (x86) Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "graph_test - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /out:"./graph_test.exe" # SUBTRACT LINK32 /profile !ELSEIF "$(CFG)" == "graph_test - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "graph_test - Win32 Release" # Name "graph_test - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\..\src\agg_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_arrowhead.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_bezier_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_cbox_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_curves.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_gsv_text.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_platform_support.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_rbox_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_rounded_rect.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_slider_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_sqrt_tables.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_trans_affine.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_contour.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_dash.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_markers_term.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_smooth_poly1.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_stroke.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_win32_bmp.cpp # End Source File # Begin Source File SOURCE=..\..\graph_test.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/graph_test/graph_test.dsw������������������������������������������0000644�0000000�0000000�00000001002�10703246330�023677� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "graph_test"=.\graph_test.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/idea/��������������������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�017571� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/idea/Makefile������������������������������������������������������0000644�0000000�0000000�00000001400�10703246330�021224� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# # This makefile can be used to build a Win32 application under Cygwin # include ../../../Makefile.in.$(shell uname) PROGNAME=idea OUTNAME=$(PROGNAME) PLATFORM=win32 CXXFLAGS= $(AGGCXXFLAGS) -I../../../include \ -I/usr/X11R6/include \ -L/usr/X11R6/lib \ -L../../../src \ $(PIXFMT) LIBS = $(AGGLIBS) -lm -lgdi32 SRC=\ ../../$(PROGNAME).cpp \ ../../../src/platform/$(PLATFORM)/agg_platform_support.cpp \ ../../../src/platform/$(PLATFORM)/agg_win32_bmp.cpp OBJ= $(SRC:.cpp=.o) $(OUTNAME): $(OBJ) $(CXX) $(CXXFLAGS) $^ -o $(OUTNAME) $(LIBS) clean: rm -f $(OUTNAME) rm -f ../../$(PROGNAME).o rm -f ../../../src/platform/$(PLATFORM)/agg_platform_support.o rm -f gamma.txt rm -f gamma.bin %.o: %.cpp @echo \< $*.cpp \> $(CXX) -c $(CXXFLAGS) $*.cpp -o $@ ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/idea/idea.dsp������������������������������������������������������0000644�0000000�0000000�00000011072�10703246330�021204� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Microsoft Developer Studio Project File - Name="idea" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 CFG=idea - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "idea.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "idea.mak" CFG="idea - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "idea - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "idea - Win32 Debug" (based on "Win32 (x86) Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "idea - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "AGG_BMP_NO_ALPHA_BLEND" /FD /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x419 /d "NDEBUG" # ADD RSC /l 0x419 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /out:"./idea.exe" !ELSEIF "$(CFG)" == "idea - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "AGG_BMP_NO_ALPHA_BLEND" /FD /GZ /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x419 /d "_DEBUG" # ADD RSC /l 0x419 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "idea - Win32 Release" # Name "idea - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\..\src\agg_bezier_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_cbox_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_gsv_text.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_platform_support.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_slider_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_trans_affine.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_stroke.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_win32_bmp.cpp # End Source File # Begin Source File SOURCE=..\..\idea.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/idea/idea.dsw������������������������������������������������������0000644�0000000�0000000�00000000766�10703246330�021223� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "idea"=.\idea.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### ����������agg-2.5+dfsg1/examples/win32_api/image1/������������������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�020032� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/image1/Makefile����������������������������������������������������0000644�0000000�0000000�00000001402�10703246330�021467� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# # This makefile can be used to build a Win32 application under Cygwin # include ../../../Makefile.in.$(shell uname) PROGNAME=image1 OUTNAME=$(PROGNAME) PLATFORM=win32 CXXFLAGS= $(AGGCXXFLAGS) -I../../../include \ -I/usr/X11R6/include \ -L/usr/X11R6/lib \ -L../../../src \ $(PIXFMT) LIBS = $(AGGLIBS) -lm -lgdi32 SRC=\ ../../$(PROGNAME).cpp \ ../../../src/platform/$(PLATFORM)/agg_platform_support.cpp \ ../../../src/platform/$(PLATFORM)/agg_win32_bmp.cpp OBJ= $(SRC:.cpp=.o) $(OUTNAME): $(OBJ) $(CXX) $(CXXFLAGS) $^ -o $(OUTNAME) $(LIBS) clean: rm -f $(OUTNAME) rm -f ../../$(PROGNAME).o rm -f ../../../src/platform/$(PLATFORM)/agg_platform_support.o rm -f gamma.txt rm -f gamma.bin %.o: %.cpp @echo \< $*.cpp \> $(CXX) -c $(CXXFLAGS) $*.cpp -o $@ ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/image1/image1.dsp��������������������������������������������������0000644�0000000�0000000�00000011512�10703246330�021705� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Microsoft Developer Studio Project File - Name="image1" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 CFG=image1 - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "image1.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "image1.mak" CFG="image1 - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "image1 - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "image1 - Win32 Debug" (based on "Win32 (x86) Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=xicl6.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "image1 - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "AGG_BMP_NO_ALPHA_BLEND" /FD /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x419 /d "NDEBUG" # ADD RSC /l 0x419 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /out:"./image1.exe" # SUBTRACT LINK32 /profile !ELSEIF "$(CFG)" == "image1 - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "AGG_BMP_NO_ALPHA_BLEND" /FD /GZ /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x419 /d "_DEBUG" # ADD RSC /l 0x419 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "image1 - Win32 Release" # Name "image1 - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\..\src\agg_bezier_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_bspline.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_gsv_text.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_image_filters.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_platform_support.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_slider_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_spline_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_sqrt_tables.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_trans_affine.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_stroke.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_win32_bmp.cpp # End Source File # Begin Source File SOURCE=..\..\image1.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/image1/image1.dsw��������������������������������������������������0000644�0000000�0000000�00000000772�10703246330�021722� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "image1"=.\image1.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### ������agg-2.5+dfsg1/examples/win32_api/image1/readme������������������������������������������������������0000644�0000000�0000000�00000000111�10703246330�021203� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Download http://www.antigrain.com/spheres.bmp before running this example�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/image_alpha/�������������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�021116� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/image_alpha/Makefile�����������������������������������������������0000644�0000000�0000000�00000001407�10703246330�022560� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# # This makefile can be used to build a Win32 application under Cygwin # include ../../../Makefile.in.$(shell uname) PROGNAME=image_alpha OUTNAME=$(PROGNAME) PLATFORM=win32 CXXFLAGS= $(AGGCXXFLAGS) -I../../../include \ -I/usr/X11R6/include \ -L/usr/X11R6/lib \ -L../../../src \ $(PIXFMT) LIBS = $(AGGLIBS) -lm -lgdi32 SRC=\ ../../$(PROGNAME).cpp \ ../../../src/platform/$(PLATFORM)/agg_platform_support.cpp \ ../../../src/platform/$(PLATFORM)/agg_win32_bmp.cpp OBJ= $(SRC:.cpp=.o) $(OUTNAME): $(OBJ) $(CXX) $(CXXFLAGS) $^ -o $(OUTNAME) $(LIBS) clean: rm -f $(OUTNAME) rm -f ../../$(PROGNAME).o rm -f ../../../src/platform/$(PLATFORM)/agg_platform_support.o rm -f gamma.txt rm -f gamma.bin %.o: %.cpp @echo \< $*.cpp \> $(CXX) -c $(CXXFLAGS) $*.cpp -o $@ ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/image_alpha/image_alpha.dsp����������������������������������������0000644�0000000�0000000�00000011466�10703246330�024065� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Microsoft Developer Studio Project File - Name="image_alpha" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 CFG=image_alpha - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "image_alpha.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "image_alpha.mak" CFG="image_alpha - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "image_alpha - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "image_alpha - Win32 Debug" (based on "Win32 (x86) Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "image_alpha - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /MD /W3 /GX /O2 /I "../../../include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "AGG_BMP_NO_ALPHA_BLEND" /FD /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x419 /d "NDEBUG" # ADD RSC /l 0x419 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /out:"./image_alpha.exe" # SUBTRACT LINK32 /profile !ELSEIF "$(CFG)" == "image_alpha - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /MD /W3 /Gm /GX /ZI /Od /I "../../../include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "AGG_BMP_NO_ALPHA_BLEND" /FD /GZ /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x419 /d "_DEBUG" # ADD RSC /l 0x419 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "image_alpha - Win32 Release" # Name "image_alpha - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\..\src\agg_bezier_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_bspline.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_gsv_text.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_image_filters.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_platform_support.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_spline_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_sqrt_tables.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_trans_affine.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_stroke.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_win32_bmp.cpp # End Source File # Begin Source File SOURCE=..\..\image_alpha.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/image_alpha/image_alpha.dsw����������������������������������������0000644�0000000�0000000�00000001004�10703246330�024057� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "image_alpha"=.\image_alpha.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/image_alpha/readme�������������������������������������������������0000644�0000000�0000000�00000000113�10703246330�022271� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Download http://www.antigrain.com/spheres.bmp before running this example. �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/image_filters/�����������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�021501� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/image_filters/Makefile���������������������������������������������0000644�0000000�0000000�00000001411�10703246330�023136� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# # This makefile can be used to build a Win32 application under Cygwin # include ../../../Makefile.in.$(shell uname) PROGNAME=image_filters OUTNAME=$(PROGNAME) PLATFORM=win32 CXXFLAGS= $(AGGCXXFLAGS) -I../../../include \ -I/usr/X11R6/include \ -L/usr/X11R6/lib \ -L../../../src \ $(PIXFMT) LIBS = $(AGGLIBS) -lm -lgdi32 SRC=\ ../../$(PROGNAME).cpp \ ../../../src/platform/$(PLATFORM)/agg_platform_support.cpp \ ../../../src/platform/$(PLATFORM)/agg_win32_bmp.cpp OBJ= $(SRC:.cpp=.o) $(OUTNAME): $(OBJ) $(CXX) $(CXXFLAGS) $^ -o $(OUTNAME) $(LIBS) clean: rm -f $(OUTNAME) rm -f ../../$(PROGNAME).o rm -f ../../../src/platform/$(PLATFORM)/agg_platform_support.o rm -f gamma.txt rm -f gamma.bin %.o: %.cpp @echo \< $*.cpp \> $(CXX) -c $(CXXFLAGS) $*.cpp -o $@ �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/image_filters/image_filters.dsp������������������������������������0000644�0000000�0000000�00000012533�10703246330�025027� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Microsoft Developer Studio Project File - Name="image_filters" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 CFG=image_filters - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "image_filters.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "image_filters.mak" CFG="image_filters - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "image_filters - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "image_filters - Win32 Debug" (based on "Win32 (x86) Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "image_filters - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /MD /W3 /GX /O2 /I "../../../include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "AGG_BMP_NO_ALPHA_BLEND" /FD /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x419 /d "NDEBUG" # ADD RSC /l 0x419 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /out:"./image_filters.exe" # SUBTRACT LINK32 /profile !ELSEIF "$(CFG)" == "image_filters - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /MD /W3 /Gm /GX /ZI /Od /I "../../../include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "AGG_BMP_NO_ALPHA_BLEND" /FD /GZ /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x419 /d "_DEBUG" # ADD RSC /l 0x419 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "image_filters - Win32 Release" # Name "image_filters - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\..\src\agg_bezier_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_bspline.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_cbox_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_gsv_text.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_image_filters.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_platform_support.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_rbox_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_slider_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_spline_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_sqrt_tables.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_trans_affine.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_stroke.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_win32_bmp.cpp # End Source File # Begin Source File SOURCE=..\..\image_filters.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # Begin Source File SOURCE=..\..\..\include\agg_span_image_filter_gray.h # End Source File # Begin Source File SOURCE=..\..\..\include\agg_span_image_filter_rgb.h # End Source File # Begin Source File SOURCE=..\..\..\include\agg_span_image_filter_rgba.h # End Source File # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project ���������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/image_filters/image_filters.dsw������������������������������������0000644�0000000�0000000�00000001010�10703246330�025022� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "image_filters"=.\image_filters.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/image_filters/readme�����������������������������������������������0000644�0000000�0000000�00000000113�10703246330�022654� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Download http://www.antigrain.com/spheres.bmp before running this example. �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/image_filters2/����������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�021563� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/image_filters2/Makefile��������������������������������������������0000644�0000000�0000000�00000001412�10703246330�023221� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# # This makefile can be used to build a Win32 application under Cygwin # include ../../../Makefile.in.$(shell uname) PROGNAME=image_filters2 OUTNAME=$(PROGNAME) PLATFORM=win32 CXXFLAGS= $(AGGCXXFLAGS) -I../../../include \ -I/usr/X11R6/include \ -L/usr/X11R6/lib \ -L../../../src \ $(PIXFMT) LIBS = $(AGGLIBS) -lm -lgdi32 SRC=\ ../../$(PROGNAME).cpp \ ../../../src/platform/$(PLATFORM)/agg_platform_support.cpp \ ../../../src/platform/$(PLATFORM)/agg_win32_bmp.cpp OBJ= $(SRC:.cpp=.o) $(OUTNAME): $(OBJ) $(CXX) $(CXXFLAGS) $^ -o $(OUTNAME) $(LIBS) clean: rm -f $(OUTNAME) rm -f ../../$(PROGNAME).o rm -f ../../../src/platform/$(PLATFORM)/agg_platform_support.o rm -f gamma.txt rm -f gamma.bin %.o: %.cpp @echo \< $*.cpp \> $(CXX) -c $(CXXFLAGS) $*.cpp -o $@ ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/image_filters2/image_filters2.dsp����������������������������������0000644�0000000�0000000�00000012125�10703246330�025170� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Microsoft Developer Studio Project File - Name="image_filters2" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 CFG=image_filters2 - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "image_filters2.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "image_filters2.mak" CFG="image_filters2 - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "image_filters2 - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "image_filters2 - Win32 Debug" (based on "Win32 (x86) Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "image_filters2 - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /MD /W3 /GX /O2 /I "../../../include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "AGG_BMP_NO_ALPHA_BLEND" /FD /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x419 /d "NDEBUG" # ADD RSC /l 0x419 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /out:"./image_filters2.exe" # SUBTRACT LINK32 /profile !ELSEIF "$(CFG)" == "image_filters2 - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /MD /W3 /Gm /GX /ZI /Od /I "../../../include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "AGG_BMP_NO_ALPHA_BLEND" /FD /GZ /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x419 /d "_DEBUG" # ADD RSC /l 0x419 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "image_filters2 - Win32 Release" # Name "image_filters2 - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\..\src\agg_bezier_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_bspline.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_cbox_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_gsv_text.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_image_filters.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_platform_support.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_rbox_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_slider_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_spline_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_sqrt_tables.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_trans_affine.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_stroke.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_win32_bmp.cpp # End Source File # Begin Source File SOURCE=..\..\image_filters2.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/image_filters2/image_filters2.dsw����������������������������������0000644�0000000�0000000�00000001012�10703246330�025170� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "image_filters2"=.\image_filters2.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/image_filters2/readme����������������������������������������������0000644�0000000�0000000�00000000113�10703246330�022736� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Download http://www.antigrain.com/spheres.bmp before running this example. �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/image_fltr_graph/��������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�022161� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/image_fltr_graph/Makefile������������������������������������������0000644�0000000�0000000�00000001414�10703246330�023621� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# # This makefile can be used to build a Win32 application under Cygwin # include ../../../Makefile.in.$(shell uname) PROGNAME=image_fltr_graph OUTNAME=$(PROGNAME) PLATFORM=win32 CXXFLAGS= $(AGGCXXFLAGS) -I../../../include \ -I/usr/X11R6/include \ -L/usr/X11R6/lib \ -L../../../src \ $(PIXFMT) LIBS = $(AGGLIBS) -lm -lgdi32 SRC=\ ../../$(PROGNAME).cpp \ ../../../src/platform/$(PLATFORM)/agg_platform_support.cpp \ ../../../src/platform/$(PLATFORM)/agg_win32_bmp.cpp OBJ= $(SRC:.cpp=.o) $(OUTNAME): $(OBJ) $(CXX) $(CXXFLAGS) $^ -o $(OUTNAME) $(LIBS) clean: rm -f $(OUTNAME) rm -f ../../$(PROGNAME).o rm -f ../../../src/platform/$(PLATFORM)/agg_platform_support.o rm -f gamma.txt rm -f gamma.bin %.o: %.cpp @echo \< $*.cpp \> $(CXX) -c $(CXXFLAGS) $*.cpp -o $@ ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/image_fltr_graph/image_fltr_graph.dsp������������������������������0000644�0000000�0000000�00000012430�10703246330�026163� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Microsoft Developer Studio Project File - Name="image_fltr_graph" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 CFG=image_fltr_graph - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "image_fltr_graph.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "image_fltr_graph.mak" CFG="image_fltr_graph - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "image_fltr_graph - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "image_fltr_graph - Win32 Debug" (based on "Win32 (x86) Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "image_fltr_graph - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /MD /W3 /GX /O2 /I "../../../include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "AGG_BMP_NO_ALPHA_BLEND" /FD /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x419 /d "NDEBUG" # ADD RSC /l 0x419 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /out:"./image_fltr_graph.exe" # SUBTRACT LINK32 /profile !ELSEIF "$(CFG)" == "image_fltr_graph - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /MD /W3 /Gm /GX /ZI /Od /I "../../../include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "AGG_BMP_NO_ALPHA_BLEND" /FD /GZ /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x419 /d "_DEBUG" # ADD RSC /l 0x419 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "image_fltr_graph - Win32 Release" # Name "image_fltr_graph - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\..\src\agg_bezier_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_bspline.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_cbox_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_gsv_text.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_image_filters.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_platform_support.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_rbox_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_slider_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_spline_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_sqrt_tables.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_trans_affine.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_stroke.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_win32_bmp.cpp # End Source File # Begin Source File SOURCE=..\..\image_fltr_graph.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # Begin Source File SOURCE=..\..\..\include\agg_span_bgra32_image.h # End Source File # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # Begin Source File SOURCE=..\..\..\include\agg_gouraud_attr.h # End Source File # End Target # End Project ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/image_fltr_graph/image_fltr_graph.dsw������������������������������0000644�0000000�0000000�00000001016�10703246330�026170� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "image_fltr_graph"=.\image_fltr_graph.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/image_perspective/�������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�022362� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/image_perspective/Makefile�����������������������������������������0000644�0000000�0000000�00000001520�10703246330�024020� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# # This makefile can be used to build a Win32 application under Cygwin # include ../../../Makefile.in.$(shell uname) PROGNAME=image_perspective OUTNAME=$(PROGNAME) PLATFORM=win32 CXXFLAGS= $(AGGCXXFLAGS) -I../../../include \ -I/usr/X11R6/include \ -L/usr/X11R6/lib \ -L../../../src \ $(PIXFMT) LIBS = $(AGGLIBS) -lm -lgdi32 SRC=\ ../../$(PROGNAME).cpp \ ../../interactive_polygon.cpp \ ../../../src/platform/$(PLATFORM)/agg_platform_support.cpp \ ../../../src/platform/$(PLATFORM)/agg_win32_bmp.cpp OBJ= $(SRC:.cpp=.o) $(OUTNAME): $(OBJ) $(CXX) $(CXXFLAGS) $^ -o $(OUTNAME) $(LIBS) clean: rm -f $(OUTNAME) rm -f ../../$(PROGNAME).o rm -f ../../interactive_polygon.o rm -f ../../../src/platform/$(PLATFORM)/agg_platform_support.o rm -f gamma.txt rm -f gamma.bin %.o: %.cpp @echo \< $*.cpp \> $(CXX) -c $(CXXFLAGS) $*.cpp -o $@ ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/image_perspective/image_perspective.dsp����������������������������0000644�0000000�0000000�00000011661�10703246330�026572� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Microsoft Developer Studio Project File - Name="image_perspective" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 CFG=image_perspective - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "image_perspective.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "image_perspective.mak" CFG="image_perspective - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "image_perspective - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "image_perspective - Win32 Debug" (based on "Win32 (x86) Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=xicl6.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "image_perspective - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "AGG_BMP_NO_ALPHA_BLEND" /FD /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x419 /d "NDEBUG" # ADD RSC /l 0x419 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /out:"./image_perspective.exe" !ELSEIF "$(CFG)" == "image_perspective - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "AGG_BMP_NO_ALPHA_BLEND" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x419 /d "_DEBUG" # ADD RSC /l 0x419 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "image_perspective - Win32 Release" # Name "image_perspective - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\..\src\agg_bezier_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_gsv_text.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_image_filters.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_platform_support.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_rbox_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_trans_affine.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_stroke.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_win32_bmp.cpp # End Source File # Begin Source File SOURCE=..\..\image_perspective.cpp # End Source File # Begin Source File SOURCE=..\..\interactive_polygon.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # Begin Source File SOURCE=..\..\..\include\agg_image_accessors.h # End Source File # Begin Source File SOURCE=..\..\..\include\agg_pixfmt_rgba.h # End Source File # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project �������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/image_perspective/image_perspective.dsw����������������������������0000644�0000000�0000000�00000001020�10703246330�026565� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "image_perspective"=.\image_perspective.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/image_perspective/readme�������������������������������������������0000644�0000000�0000000�00000000113�10703246330�023535� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Download http://www.antigrain.com/spheres.bmp before running this example. �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/image_resample/����������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�021641� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/image_resample/Makefile��������������������������������������������0000644�0000000�0000000�00000001515�10703246330�023303� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# # This makefile can be used to build a Win32 application under Cygwin # include ../../../Makefile.in.$(shell uname) PROGNAME=image_resample OUTNAME=$(PROGNAME) PLATFORM=win32 CXXFLAGS= $(AGGCXXFLAGS) -I../../../include \ -I/usr/X11R6/include \ -L/usr/X11R6/lib \ -L../../../src \ $(PIXFMT) LIBS = $(AGGLIBS) -lm -lgdi32 SRC=\ ../../$(PROGNAME).cpp \ ../../interactive_polygon.cpp \ ../../../src/platform/$(PLATFORM)/agg_platform_support.cpp \ ../../../src/platform/$(PLATFORM)/agg_win32_bmp.cpp OBJ= $(SRC:.cpp=.o) $(OUTNAME): $(OBJ) $(CXX) $(CXXFLAGS) $^ -o $(OUTNAME) $(LIBS) clean: rm -f $(OUTNAME) rm -f ../../$(PROGNAME).o rm -f ../../interactive_polygon.o rm -f ../../../src/platform/$(PLATFORM)/agg_platform_support.o rm -f gamma.txt rm -f gamma.bin %.o: %.cpp @echo \< $*.cpp \> $(CXX) -c $(CXXFLAGS) $*.cpp -o $@ �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/image_resample/image_resample.dsp����������������������������������0000644�0000000�0000000�00000013233�10703246330�025325� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Microsoft Developer Studio Project File - Name="image_resample" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 CFG=image_resample - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "image_resample.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "image_resample.mak" CFG="image_resample - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "image_resample - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "image_resample - Win32 Debug" (based on "Win32 (x86) Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=xicl6.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "image_resample - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "AGG_BMP_NO_ALPHA_BLEND" /FD /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x419 /d "NDEBUG" # ADD RSC /l 0x419 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /out:"./image_resample.exe" !ELSEIF "$(CFG)" == "image_resample - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "AGG_BMP_NO_ALPHA_BLEND" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x419 /d "_DEBUG" # ADD RSC /l 0x419 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "image_resample - Win32 Release" # Name "image_resample - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\..\src\agg_bezier_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_bezier_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_curves.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_gsv_text.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_image_filters.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_platform_support.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_polygon_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_rbox_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_slider_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_trans_affine.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_stroke.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_win32_bmp.cpp # End Source File # Begin Source File SOURCE=..\..\image_resample.cpp # End Source File # Begin Source File SOURCE=..\..\interactive_polygon.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # Begin Source File SOURCE=..\..\..\include\agg_color_gray.h # End Source File # Begin Source File SOURCE=..\..\..\include\agg_span_image_filter.h # End Source File # Begin Source File SOURCE=..\..\..\include\agg_span_image_filter_gray.h # End Source File # Begin Source File SOURCE=..\..\..\include\agg_span_image_filter_rgb.h # End Source File # Begin Source File SOURCE=..\..\..\include\agg_span_image_filter_rgba.h # End Source File # Begin Source File SOURCE=..\..\..\include\agg_span_interpolator_persp.h # End Source File # Begin Source File SOURCE=..\..\..\include\agg_span_subdiv_adaptor.h # End Source File # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/image_resample/image_resample.dsw����������������������������������0000644�0000000�0000000�00000001012�10703246330�025324� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "image_resample"=.\image_resample.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/image_resample/readme����������������������������������������������0000644�0000000�0000000�00000000113�10703246330�023014� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Download http://www.antigrain.com/spheres.bmp before running this example. �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/image_transforms/��������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�022227� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/image_transforms/Makefile������������������������������������������0000644�0000000�0000000�00000001414�10703246330�023667� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# # This makefile can be used to build a Win32 application under Cygwin # include ../../../Makefile.in.$(shell uname) PROGNAME=image_transforms OUTNAME=$(PROGNAME) PLATFORM=win32 CXXFLAGS= $(AGGCXXFLAGS) -I../../../include \ -I/usr/X11R6/include \ -L/usr/X11R6/lib \ -L../../../src \ $(PIXFMT) LIBS = $(AGGLIBS) -lm -lgdi32 SRC=\ ../../$(PROGNAME).cpp \ ../../../src/platform/$(PLATFORM)/agg_platform_support.cpp \ ../../../src/platform/$(PLATFORM)/agg_win32_bmp.cpp OBJ= $(SRC:.cpp=.o) $(OUTNAME): $(OBJ) $(CXX) $(CXXFLAGS) $^ -o $(OUTNAME) $(LIBS) clean: rm -f $(OUTNAME) rm -f ../../$(PROGNAME).o rm -f ../../../src/platform/$(PLATFORM)/agg_platform_support.o rm -f gamma.txt rm -f gamma.bin %.o: %.cpp @echo \< $*.cpp \> $(CXX) -c $(CXXFLAGS) $*.cpp -o $@ ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/image_transforms/image_transforms.dsp������������������������������0000644�0000000�0000000�00000012574�10703246330�026310� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Microsoft Developer Studio Project File - Name="image_transforms" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 CFG=image_transforms - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "image_transforms.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "image_transforms.mak" CFG="image_transforms - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "image_transforms - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "image_transforms - Win32 Debug" (based on "Win32 (x86) Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "image_transforms - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /MD /W3 /GX /O2 /I "../../../include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "AGG_BMP_NO_ALPHA_BLEND" /FD /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x419 /d "NDEBUG" # ADD RSC /l 0x419 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /out:"./image_transforms.exe" # SUBTRACT LINK32 /profile !ELSEIF "$(CFG)" == "image_transforms - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /MD /W3 /Gm /GX /ZI /Od /I "../../../include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "AGG_BMP_NO_ALPHA_BLEND" /FD /GZ /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x419 /d "_DEBUG" # ADD RSC /l 0x419 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "image_transforms - Win32 Release" # Name "image_transforms - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\..\src\agg_bezier_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_bspline.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_cbox_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_gsv_text.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_image_filters.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_platform_support.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_rbox_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_slider_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_spline_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_sqrt_tables.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_trans_affine.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_stroke.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_win32_bmp.cpp # End Source File # Begin Source File SOURCE=..\..\image_transforms.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # Begin Source File SOURCE=..\..\..\include\agg_span_image_filter_rgb24.h # End Source File # Begin Source File SOURCE=..\..\..\include\agg_span_image_filter_rgba32.h # End Source File # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # Begin Source File SOURCE=..\..\..\include\agg_gouraud_attr.h # End Source File # End Target # End Project ������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/image_transforms/image_transforms.dsw������������������������������0000644�0000000�0000000�00000001016�10703246330�026304� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "image_transforms"=.\image_transforms.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/image_transforms/readme!�������������������������������������������0000644�0000000�0000000�00000017516�10703246330�023462� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������IMPORTANT! Download http://www.antigrain.com/spheres.bmp before running this example. Using affine transformations for images looks tricky, but it's not, especially when you understand the main idea. You can apply any affine transformations to images of any size and draw any part of the image. This example demonstrates the ideas of constructing affine matrices for images. The example contains 6 variants of scaling/rotation/translation matrices. Also, there are the following important variables: m_polygon_angle; m_polygon_scale; m_image_angle; m_image_scale; m_image_center_x; m_image_center_y; m_polygon_cx; m_polygon_cy; m_image_cx; m_image_cy; Variables m_polygon_... refer to the source path (star) that will be used to transform the image, variables m_image_... refer to the image parametres. Actually, different variants of transformations use different variables (in some cases m_polygon_... is used to create the image affine matrix). The meaning of the variables is the following: m_polygon_angle; m_polygon_scale; Are actually two slider controls on the left. m_polygon_cx; m_polygon_cy; Are the center of the "star", that is the geometric center of the source path. You can drag the "star" with the left mouse button. m_image_angle; m_image_scale; are two respective sliders on the right. m_image_cx; m_image_cy; are the coordinates of the green marker. The marker can also be dragged. m_image_center_x; m_image_center_y; are the center of the image. You can consider them as constants. In certain cases it's easier to understand the idea when we have some "reference point", like the center or the origin of the axes. The image transformation matrix doesn't depend on anything else. It means that the code above the line "// --------------(Example 0)": polygon_mtx *= agg::trans_affine_translation(-m_polygon_cx, -m_polygon_cy); polygon_mtx *= agg::trans_affine_rotation(m_polygon_angle.value() * agg::pi / 180.0); polygon_mtx *= agg::trans_affine_scaling(m_polygon_scale.value()); polygon_mtx *= agg::trans_affine_translation(m_polygon_cx, m_polygon_cy); affects only the drawn path. So, the only way to shift, rotate, or scale the image is to use the image affine matrix (image_mtx in this example). Another important thing is that due to the nature of the algorithm you have to use the inverse transformations. The algorithm takes the coordinates of every destination pixel, applies the transformations and obtains the coordinates of the pixel to pick it up from the source image. The coordinates of the destination pixels are always known and they have regular, pixel accuracy. After transforming they usually fall somewhere " between" pixels. This fact allows us to apply anti-aliasing filters like bilinear, bicubic, sinc, blackman, etc. After filtering we know the value of the destination pixel and we can put it in its place. This is why the algorithm uses the inverse affine matrix. In other words you prepare the transformation matrix as usual and then invret it before using: image_mtx *= agg::trans_affine_translation(-m_image_center_x, -m_image_center_y); image_mtx *= agg::trans_affine_rotation(m_polygon_angle.value() * agg::pi / 180.0); image_mtx *= agg::trans_affine_scaling(m_polygon_scale.value()); image_mtx *= agg::trans_affine_translation(m_polygon_cx, m_polygon_cy); image_mtx.invert(); This code illustrates the behaviour when we have synchronous transformations of the source path and the image. Well, let us return to example 0. Here we have a "star" that can be dragged with the left mouse button, a small round green marker, and four sliders. The marker and the sliders on the right don't affect anything. As it was said, this example simply copies pixels from the source image to the destination canvas. Example 1. The marker and the image sliders on the right still don't work, but now the image is moved, scaled, and rotated syncronously with the "star". We simply take the reference point, which is m_image_center_x(y), rotate and scale the image around it, and then, translate the image to m_polygon_cx(cy). Example 2 is the same as 1 but instead of using "m_polygon_..." parameters we use "m_image_..." ones, so the marker and the sliders on the right now work independently. In other words you can control the image and the "star" separately. image_mtx *= agg::trans_affine_translation(-m_image_center_x, -m_image_center_y); image_mtx *= agg::trans_affine_rotation(m_image_angle.value() * agg::pi / 180.0); image_mtx *= agg::trans_affine_scaling(m_image_scale.value()); image_mtx *= agg::trans_affine_translation(m_image_cx, m_image_cy); image_mtx.invert(); Example 3 is the same as the above but instead of using "m_image_cx(cy)" we use m_polygon_cx(cy). So that, the image is rotated and scaled around its center, but the marker doesn't have any effect. image_mtx *= agg::trans_affine_translation(-m_image_center_x, -m_image_center_y); image_mtx *= agg::trans_affine_rotation(m_image_angle.value() * agg::pi / 180.0); image_mtx *= agg::trans_affine_scaling(m_image_scale.value()); image_mtx *= agg::trans_affine_translation(m_polygon_cx, m_polygon_cy); image_mtx.invert(); Example 4 is the same as 1, but we use m_image_cx(cy) as the source point in the image. So, the image sliders don't work, the image is transformed synchronously with the path, but we are able to choose the source point for image transformations. That is the idea: we take the source point in the image, perform the transformations around it and then move this source point to the center of the "star". image_mtx *= agg::trans_affine_translation(-m_image_cx, -m_image_cy); image_mtx *= agg::trans_affine_rotation(m_polygon_angle.value() * agg::pi / 180.0); image_mtx *= agg::trans_affine_scaling(m_polygon_scale.value()); image_mtx *= agg::trans_affine_translation(m_polygon_cx, m_polygon_cy); image_mtx.invert(); Example 5 is the same as 2, but there we have a combination of the scaling and rotation of the "star" and the image. image_mtx *= agg::trans_affine_translation(-m_image_center_x, -m_image_center_y); image_mtx *= agg::trans_affine_rotation(m_image_angle.value() * agg::pi / 180.0); image_mtx *= agg::trans_affine_rotation(m_polygon_angle.value() * agg::pi / 180.0); image_mtx *= agg::trans_affine_scaling(m_image_scale.value()); image_mtx *= agg::trans_affine_scaling(m_polygon_scale.value()); image_mtx *= agg::trans_affine_translation(m_image_cx, m_image_cy); image_mtx.invert(); BTW, code above can be simplified like this: image_mtx *= agg::trans_affine_translation(-m_image_center_x, -m_image_center_y); image_mtx *= agg::trans_affine_rotation(m_image_angle.value() * agg::pi / 180.0 + m_polygon_angle.value() * agg::pi / 180.0); image_mtx *= agg::trans_affine_scaling(m_image_scale.value() * m_polygon_scale.value()); image_mtx *= agg::trans_affine_translation(m_image_cx, m_image_cy); image_mtx.invert(); Finally, example 5 is probably not very interesting in practice, but still, it can simplify understanding of the idea. This example uses only m_image_... parameters. It shifts the image from m_image_cx(cy) to the origin (0,0), then applies rotation and scaling, and finally, shifts the image back. So that, point m_image_cx(cy) is simply the center of the transformations. When the image angle is 0.0 and the scale is 1.0 dragging this point doesn't have any effect. image_mtx *= agg::trans_affine_translation(-m_image_cx, -m_image_cy); image_mtx *= agg::trans_affine_rotation(m_image_angle.value() * agg::pi / 180.0); image_mtx *= agg::trans_affine_scaling(m_image_scale.value()); image_mtx *= agg::trans_affine_translation(m_image_cx, m_image_cy); image_mtx.invert(); Many thank to you if you read it and many special thanks if you could understand something. :-) ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/line_patterns/�����������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�021536� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/line_patterns/Makefile���������������������������������������������0000644�0000000�0000000�00000001411�10703246330�023173� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# # This makefile can be used to build a Win32 application under Cygwin # include ../../../Makefile.in.$(shell uname) PROGNAME=line_patterns OUTNAME=$(PROGNAME) PLATFORM=win32 CXXFLAGS= $(AGGCXXFLAGS) -I../../../include \ -I/usr/X11R6/include \ -L/usr/X11R6/lib \ -L../../../src \ $(PIXFMT) LIBS = $(AGGLIBS) -lm -lgdi32 SRC=\ ../../$(PROGNAME).cpp \ ../../../src/platform/$(PLATFORM)/agg_platform_support.cpp \ ../../../src/platform/$(PLATFORM)/agg_win32_bmp.cpp OBJ= $(SRC:.cpp=.o) $(OUTNAME): $(OBJ) $(CXX) $(CXXFLAGS) $^ -o $(OUTNAME) $(LIBS) clean: rm -f $(OUTNAME) rm -f ../../$(PROGNAME).o rm -f ../../../src/platform/$(PLATFORM)/agg_platform_support.o rm -f gamma.txt rm -f gamma.bin %.o: %.cpp @echo \< $*.cpp \> $(CXX) -c $(CXXFLAGS) $*.cpp -o $@ �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/line_patterns/line_patterns.dsp������������������������������������0000644�0000000�0000000�00000012033�10703246330�025114� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Microsoft Developer Studio Project File - Name="line_patterns" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 CFG=line_patterns - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "line_patterns.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "line_patterns.mak" CFG="line_patterns - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "line_patterns - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "line_patterns - Win32 Debug" (based on "Win32 (x86) Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=xicl6.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "line_patterns - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /profile /machine:I386 /out:"./line_patterns.exe" !ELSEIF "$(CFG)" == "line_patterns - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "line_patterns - Win32 Release" # Name "line_patterns - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\..\src\agg_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_bezier_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_bezier_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_curves.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_gsv_text.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_line_aa_basics.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_line_profile_aa.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_platform_support.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_polygon_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_slider_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_sqrt_tables.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_trans_affine.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_stroke.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_win32_bmp.cpp # End Source File # Begin Source File SOURCE=..\..\line_patterns.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/line_patterns/line_patterns.dsw������������������������������������0000644�0000000�0000000�00000001010�10703246330�025114� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "line_patterns"=.\line_patterns.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/line_patterns_clip/������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�022545� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/line_patterns_clip/Makefile����������������������������������������0000644�0000000�0000000�00000001416�10703246330�024207� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# # This makefile can be used to build a Win32 application under Cygwin # include ../../../Makefile.in.$(shell uname) PROGNAME=line_patterns_clip OUTNAME=$(PROGNAME) PLATFORM=win32 CXXFLAGS= $(AGGCXXFLAGS) -I../../../include \ -I/usr/X11R6/include \ -L/usr/X11R6/lib \ -L../../../src \ $(PIXFMT) LIBS = $(AGGLIBS) -lm -lgdi32 SRC=\ ../../$(PROGNAME).cpp \ ../../../src/platform/$(PLATFORM)/agg_platform_support.cpp \ ../../../src/platform/$(PLATFORM)/agg_win32_bmp.cpp OBJ= $(SRC:.cpp=.o) $(OUTNAME): $(OBJ) $(CXX) $(CXXFLAGS) $^ -o $(OUTNAME) $(LIBS) clean: rm -f $(OUTNAME) rm -f ../../$(PROGNAME).o rm -f ../../../src/platform/$(PLATFORM)/agg_platform_support.o rm -f gamma.txt rm -f gamma.bin %.o: %.cpp @echo \< $*.cpp \> $(CXX) -c $(CXXFLAGS) $*.cpp -o $@ ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/line_patterns_clip/line_patterns_clip.dsp��������������������������0000644�0000000�0000000�00000012263�10703246330�027137� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Microsoft Developer Studio Project File - Name="line_patterns_clip" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 CFG=line_patterns_clip - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "line_patterns_clip.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "line_patterns_clip.mak" CFG="line_patterns_clip - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "line_patterns_clip - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "line_patterns_clip - Win32 Debug" (based on "Win32 (x86) Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=xicl6.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "line_patterns_clip - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /profile /machine:I386 /out:"./line_patterns_clip.exe" !ELSEIF "$(CFG)" == "line_patterns_clip - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "line_patterns_clip - Win32 Release" # Name "line_patterns_clip - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\..\src\agg_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_bezier_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_bezier_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_curves.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_gsv_text.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_line_aa_basics.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_line_profile_aa.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_platform_support.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_polygon_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_slider_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_sqrt_tables.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_trans_affine.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_stroke.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vpgen_clip_polyline.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_win32_bmp.cpp # End Source File # Begin Source File SOURCE=..\..\line_patterns_clip.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/line_patterns_clip/line_patterns_clip.dsw��������������������������0000644�0000000�0000000�00000001022�10703246330�027135� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "line_patterns_clip"=.\line_patterns_clip.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/lion/��������������������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�017630� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/lion/Makefile������������������������������������������������������0000644�0000000�0000000�00000001427�10703246330�021274� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# # This makefile can be used to build a Win32 application under Cygwin # include ../../../Makefile.in.$(shell uname) PROGNAME=lion OUTNAME=$(PROGNAME) PLATFORM=win32 CXXFLAGS= $(AGGCXXFLAGS) -I../../../include \ -I/usr/X11R6/include \ -L/usr/X11R6/lib \ -L../../../src \ $(PIXFMT) LIBS = $(AGGLIBS) -lm -lgdi32 SRC=\ ../../$(PROGNAME).cpp \ ../../parse_lion.cpp \ ../../../src/platform/$(PLATFORM)/agg_platform_support.cpp \ ../../../src/platform/$(PLATFORM)/agg_win32_bmp.cpp OBJ= $(SRC:.cpp=.o) $(OUTNAME): $(OBJ) $(CXX) $(CXXFLAGS) $^ -o $(OUTNAME) $(LIBS) clean: rm -f $(OUTNAME) rm -f ../../$(PROGNAME).o rm -f ../../../src/platform/$(PLATFORM)/agg_platform_support.o rm -f gamma.txt rm -f gamma.bin %.o: %.cpp @echo \< $*.cpp \> $(CXX) -c $(CXXFLAGS) $*.cpp -o $@ �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/lion/lion.dsp������������������������������������������������������0000644�0000000�0000000�00000011122�10703246330�021276� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Microsoft Developer Studio Project File - Name="lion" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 CFG=lion - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "lion.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "lion.mak" CFG="lion - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "lion - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "lion - Win32 Debug" (based on "Win32 (x86) Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "lion - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "AGG_BMP_NO_ALPHA_BLEND" /FD /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x419 /d "NDEBUG" # ADD RSC /l 0x419 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /out:"./lion.exe" !ELSEIF "$(CFG)" == "lion - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "AGG_BMP_NO_ALPHA_BLEND" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x419 /d "_DEBUG" # ADD RSC /l 0x419 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "lion - Win32 Release" # Name "lion - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\..\src\agg_bezier_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_gsv_text.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_platform_support.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_slider_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_trans_affine.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_stroke.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_win32_bmp.cpp # End Source File # Begin Source File SOURCE=..\..\lion.cpp # End Source File # Begin Source File SOURCE=..\..\parse_lion.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # Begin Source File SOURCE=..\..\..\include\agg_pixfmt_rgba.h # End Source File # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/lion/lion.dsw������������������������������������������������������0000644�0000000�0000000�00000000766�10703246330�021321� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "lion"=.\lion.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### ����������agg-2.5+dfsg1/examples/win32_api/lion_lens/���������������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�020651� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/lion_lens/Makefile�������������������������������������������������0000644�0000000�0000000�00000001434�10703246330�022313� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# # This makefile can be used to build a Win32 application under Cygwin # include ../../../Makefile.in.$(shell uname) PROGNAME=lion_lens OUTNAME=$(PROGNAME) PLATFORM=win32 CXXFLAGS= $(AGGCXXFLAGS) -I../../../include \ -I/usr/X11R6/include \ -L/usr/X11R6/lib \ -L../../../src \ $(PIXFMT) LIBS = $(AGGLIBS) -lm -lgdi32 SRC=\ ../../$(PROGNAME).cpp \ ../../parse_lion.cpp \ ../../../src/platform/$(PLATFORM)/agg_platform_support.cpp \ ../../../src/platform/$(PLATFORM)/agg_win32_bmp.cpp OBJ= $(SRC:.cpp=.o) $(OUTNAME): $(OBJ) $(CXX) $(CXXFLAGS) $^ -o $(OUTNAME) $(LIBS) clean: rm -f $(OUTNAME) rm -f ../../$(PROGNAME).o rm -f ../../../src/platform/$(PLATFORM)/agg_platform_support.o rm -f gamma.txt rm -f gamma.bin %.o: %.cpp @echo \< $*.cpp \> $(CXX) -c $(CXXFLAGS) $*.cpp -o $@ ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/lion_lens/lion_lens.dsp��������������������������������������������0000644�0000000�0000000�00000011357�10703246330�023352� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Microsoft Developer Studio Project File - Name="lion_lens" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 CFG=lion_lens - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "lion_lens.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "lion_lens.mak" CFG="lion_lens - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "lion_lens - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "lion_lens - Win32 Debug" (based on "Win32 (x86) Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "lion_lens - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "AGG_BMP_NO_ALPHA_BLEND" /FD /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x419 /d "NDEBUG" # ADD RSC /l 0x419 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /out:"./lion_lens.exe" !ELSEIF "$(CFG)" == "lion_lens - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "AGG_BMP_NO_ALPHA_BLEND" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x419 /d "_DEBUG" # ADD RSC /l 0x419 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "lion_lens - Win32 Release" # Name "lion_lens - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\..\src\agg_bezier_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_gsv_text.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_platform_support.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_slider_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_trans_affine.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_trans_warp_magnifier.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_stroke.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vpgen_segmentator.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_win32_bmp.cpp # End Source File # Begin Source File SOURCE=..\..\lion_lens.cpp # End Source File # Begin Source File SOURCE=..\..\parse_lion.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/lion_lens/lion_lens.dsw��������������������������������������������0000644�0000000�0000000�00000001000�10703246330�023341� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "lion_lens"=.\lion_lens.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### agg-2.5+dfsg1/examples/win32_api/lion_outline/������������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�021367� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/lion_outline/Makefile����������������������������������������������0000644�0000000�0000000�00000001437�10703246330�023034� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# # This makefile can be used to build a Win32 application under Cygwin # include ../../../Makefile.in.$(shell uname) PROGNAME=lion_outline OUTNAME=$(PROGNAME) PLATFORM=win32 CXXFLAGS= $(AGGCXXFLAGS) -I../../../include \ -I/usr/X11R6/include \ -L/usr/X11R6/lib \ -L../../../src \ $(PIXFMT) LIBS = $(AGGLIBS) -lm -lgdi32 SRC=\ ../../$(PROGNAME).cpp \ ../../parse_lion.cpp \ ../../../src/platform/$(PLATFORM)/agg_platform_support.cpp \ ../../../src/platform/$(PLATFORM)/agg_win32_bmp.cpp OBJ= $(SRC:.cpp=.o) $(OUTNAME): $(OBJ) $(CXX) $(CXXFLAGS) $^ -o $(OUTNAME) $(LIBS) clean: rm -f $(OUTNAME) rm -f ../../$(PROGNAME).o rm -f ../../../src/platform/$(PLATFORM)/agg_platform_support.o rm -f gamma.txt rm -f gamma.bin %.o: %.cpp @echo \< $*.cpp \> $(CXX) -c $(CXXFLAGS) $*.cpp -o $@ ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/lion_outline/lion_outline.dsp��������������������������������������0000644�0000000�0000000�00000011657�10703246330�024611� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Microsoft Developer Studio Project File - Name="lion_outline" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 CFG=lion_outline - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "lion_outline.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "lion_outline.mak" CFG="lion_outline - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "lion_outline - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "lion_outline - Win32 Debug" (based on "Win32 (x86) Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "lion_outline - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "AGG_BMP_NO_ALPHA_BLEND" /FD /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x419 /d "NDEBUG" # ADD RSC /l 0x419 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /out:"./lion_outline.exe" !ELSEIF "$(CFG)" == "lion_outline - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "AGG_BMP_NO_ALPHA_BLEND" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x419 /d "_DEBUG" # ADD RSC /l 0x419 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "lion_outline - Win32 Release" # Name "lion_outline - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\..\src\agg_bezier_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_cbox_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_gsv_text.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_line_aa_basics.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_line_profile_aa.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_platform_support.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_slider_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_sqrt_tables.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_trans_affine.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_stroke.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_win32_bmp.cpp # End Source File # Begin Source File SOURCE=..\..\lion_outline.cpp # End Source File # Begin Source File SOURCE=..\..\parse_lion.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project ���������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/lion_outline/lion_outline.dsw��������������������������������������0000644�0000000�0000000�00000001006�10703246330�024603� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "lion_outline"=.\lion_outline.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/mol_view/����������������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�020510� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/mol_view/Makefile��������������������������������������������������0000644�0000000�0000000�00000001404�10703246330�022147� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# # This makefile can be used to build a Win32 application under Cygwin # include ../../../Makefile.in.$(shell uname) PROGNAME=mol_view OUTNAME=$(PROGNAME) PLATFORM=win32 CXXFLAGS= $(AGGCXXFLAGS) -I../../../include \ -I/usr/X11R6/include \ -L/usr/X11R6/lib \ -L../../../src \ $(PIXFMT) LIBS = $(AGGLIBS) -lm -lgdi32 SRC=\ ../../$(PROGNAME).cpp \ ../../../src/platform/$(PLATFORM)/agg_platform_support.cpp \ ../../../src/platform/$(PLATFORM)/agg_win32_bmp.cpp OBJ= $(SRC:.cpp=.o) $(OUTNAME): $(OBJ) $(CXX) $(CXXFLAGS) $^ -o $(OUTNAME) $(LIBS) clean: rm -f $(OUTNAME) rm -f ../../$(PROGNAME).o rm -f ../../../src/platform/$(PLATFORM)/agg_platform_support.o rm -f gamma.txt rm -f gamma.bin %.o: %.cpp @echo \< $*.cpp \> $(CXX) -c $(CXXFLAGS) $*.cpp -o $@ ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/mol_view/mol_view.dsp����������������������������������������������0000644�0000000�0000000�00000012467�10703246330�023053� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Microsoft Developer Studio Project File - Name="mol_view" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 CFG=mol_view - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "mol_view.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "mol_view.mak" CFG="mol_view - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "mol_view - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "mol_view - Win32 Debug" (based on "Win32 (x86) Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "mol_view - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "AGG_BMP_NO_ALPHA_BLEND" /FD /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /profile /machine:I386 /out:"./mol_view.exe" !ELSEIF "$(CFG)" == "mol_view - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "AGG_BMP_NO_ALPHA_BLEND" /FD /GZ /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "mol_view - Win32 Release" # Name "mol_view - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\..\src\agg_bezier_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_bspline.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_gsv_text.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_platform_support.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_slider_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_trans_affine.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_stroke.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_win32_bmp.cpp # End Source File # Begin Source File SOURCE=..\..\mol_view.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # Begin Source File SOURCE=..\..\..\include\agg_gsv_text.h # End Source File # Begin Source File SOURCE=..\..\..\include\agg_gsv_text_outline.h # End Source File # Begin Source File SOURCE=..\..\..\include\agg_math.h # End Source File # Begin Source File SOURCE=..\..\..\include\agg_path_storage.h # End Source File # Begin Source File SOURCE=..\..\..\include\platform\agg_platform_support.h # End Source File # Begin Source File SOURCE=..\..\..\include\agg_rasterizer_scanline_aa.h # End Source File # Begin Source File SOURCE=..\..\..\include\agg_renderer_u8.h # End Source File # Begin Source File SOURCE=..\..\..\include\ctrl\agg_scale_ctrl.h # End Source File # Begin Source File SOURCE=..\..\..\include\agg_trans_affine.h # End Source File # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/mol_view/mol_view.dsw����������������������������������������������0000644�0000000�0000000�00000000776�10703246330�023062� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "mol_view"=.\mol_view.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### ��agg-2.5+dfsg1/examples/win32_api/mol_view/readme����������������������������������������������������0000644�0000000�0000000�00000000200�10703246330�021660� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Download http://www.antigrain.com/1.sdf before running this example. Press PageUp/PgDown to switch between different molecules. ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/multi_clip/��������������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�021030� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/multi_clip/Makefile������������������������������������������������0000644�0000000�0000000�00000001435�10703246330�022473� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# # This makefile can be used to build a Win32 application under Cygwin # include ../../../Makefile.in.$(shell uname) PROGNAME=multi_clip OUTNAME=$(PROGNAME) PLATFORM=win32 CXXFLAGS= $(AGGCXXFLAGS) -I../../../include \ -I/usr/X11R6/include \ -L/usr/X11R6/lib \ -L../../../src \ $(PIXFMT) LIBS = $(AGGLIBS) -lm -lgdi32 SRC=\ ../../$(PROGNAME).cpp \ ../../parse_lion.cpp \ ../../../src/platform/$(PLATFORM)/agg_platform_support.cpp \ ../../../src/platform/$(PLATFORM)/agg_win32_bmp.cpp OBJ= $(SRC:.cpp=.o) $(OUTNAME): $(OBJ) $(CXX) $(CXXFLAGS) $^ -o $(OUTNAME) $(LIBS) clean: rm -f $(OUTNAME) rm -f ../../$(PROGNAME).o rm -f ../../../src/platform/$(PLATFORM)/agg_platform_support.o rm -f gamma.txt rm -f gamma.bin %.o: %.cpp @echo \< $*.cpp \> $(CXX) -c $(CXXFLAGS) $*.cpp -o $@ �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/multi_clip/multi_clip.dsp������������������������������������������0000644�0000000�0000000�00000011503�10703246330�023701� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Microsoft Developer Studio Project File - Name="multi_clip" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 CFG=multi_clip - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "multi_clip.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "multi_clip.mak" CFG="multi_clip - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "multi_clip - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "multi_clip - Win32 Debug" (based on "Win32 (x86) Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "multi_clip - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "AGG_BMP_NO_ALPHA_BLEND" /FD /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x419 /d "NDEBUG" # ADD RSC /l 0x419 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /out:"./multi_clip.exe" !ELSEIF "$(CFG)" == "multi_clip - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "AGG_BMP_NO_ALPHA_BLEND" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x419 /d "_DEBUG" # ADD RSC /l 0x419 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "multi_clip - Win32 Release" # Name "multi_clip - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\..\src\agg_bezier_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_gsv_text.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_line_aa_basics.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_line_profile_aa.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_platform_support.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_slider_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_sqrt_tables.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_trans_affine.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_stroke.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_win32_bmp.cpp # End Source File # Begin Source File SOURCE=..\..\multi_clip.cpp # End Source File # Begin Source File SOURCE=..\..\parse_lion.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/multi_clip/multi_clip.dsw������������������������������������������0000644�0000000�0000000�00000001002�10703246330�023701� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "multi_clip"=.\multi_clip.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/pattern_fill/������������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�021352� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/pattern_fill/Makefile����������������������������������������������0000644�0000000�0000000�00000001410�10703246330�023006� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# # This makefile can be used to build a Win32 application under Cygwin # include ../../../Makefile.in.$(shell uname) PROGNAME=pattern_fill OUTNAME=$(PROGNAME) PLATFORM=win32 CXXFLAGS= $(AGGCXXFLAGS) -I../../../include \ -I/usr/X11R6/include \ -L/usr/X11R6/lib \ -L../../../src \ $(PIXFMT) LIBS = $(AGGLIBS) -lm -lgdi32 SRC=\ ../../$(PROGNAME).cpp \ ../../../src/platform/$(PLATFORM)/agg_platform_support.cpp \ ../../../src/platform/$(PLATFORM)/agg_win32_bmp.cpp OBJ= $(SRC:.cpp=.o) $(OUTNAME): $(OBJ) $(CXX) $(CXXFLAGS) $^ -o $(OUTNAME) $(LIBS) clean: rm -f $(OUTNAME) rm -f ../../$(PROGNAME).o rm -f ../../../src/platform/$(PLATFORM)/agg_platform_support.o rm -f gamma.txt rm -f gamma.bin %.o: %.cpp @echo \< $*.cpp \> $(CXX) -c $(CXXFLAGS) $*.cpp -o $@ ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/pattern_fill/pattern_fill.dsp��������������������������������������0000644�0000000�0000000�00000012352�10703246330�024550� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Microsoft Developer Studio Project File - Name="pattern_fill" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 CFG=pattern_fill - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "pattern_fill.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "pattern_fill.mak" CFG="pattern_fill - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "pattern_fill - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "pattern_fill - Win32 Debug" (based on "Win32 (x86) Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=xicl6.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "pattern_fill - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /MD /W3 /GX /O2 /I "../../../include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "AGG_BMP_NO_ALPHA_BLEND" /FD /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x419 /d "NDEBUG" # ADD RSC /l 0x419 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /out:"./pattern_fill.exe" # SUBTRACT LINK32 /profile !ELSEIF "$(CFG)" == "pattern_fill - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /MD /W3 /Gm /GX /ZI /Od /I "../../../include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "AGG_BMP_NO_ALPHA_BLEND" /FD /GZ /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x419 /d "_DEBUG" # ADD RSC /l 0x419 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "pattern_fill - Win32 Release" # Name "pattern_fill - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\..\src\agg_bezier_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_bspline.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_cbox_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_curves.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_gsv_text.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_platform_support.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_rbox_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_slider_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_spline_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_sqrt_tables.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_trans_affine.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_smooth_poly1.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_stroke.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_win32_bmp.cpp # End Source File # Begin Source File SOURCE=..\..\pattern_fill.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # Begin Source File SOURCE=..\..\..\include\agg_span_pattern_gray.h # End Source File # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/pattern_fill/pattern_fill.dsw��������������������������������������0000644�0000000�0000000�00000001006�10703246330�024551� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "pattern_fill"=.\pattern_fill.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/pattern_perspective/�����������������������������������������������0000755�0000000�0000000�00000000000�10703246330�022755� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/pattern_perspective/pattern_perspective.dsp������������������������0000644�0000000�0000000�00000012620�10703246330�027554� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Microsoft Developer Studio Project File - Name="pattern_perspective" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 CFG=pattern_perspective - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "pattern_perspective.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "pattern_perspective.mak" CFG="pattern_perspective - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "pattern_perspective - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "pattern_perspective - Win32 Debug" (based on "Win32 (x86) Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "pattern_perspective - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "AGG_BMP_NO_ALPHA_BLEND" /FD /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x419 /d "NDEBUG" # ADD RSC /l 0x419 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /out:"./pattern_perspective.exe" !ELSEIF "$(CFG)" == "pattern_perspective - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "AGG_BMP_NO_ALPHA_BLEND" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x419 /d "_DEBUG" # ADD RSC /l 0x419 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "pattern_perspective - Win32 Release" # Name "pattern_perspective - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\..\src\agg_bezier_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_gsv_text.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_image_filters.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_platform_support.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_rbox_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_trans_affine.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_stroke.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_win32_bmp.cpp # End Source File # Begin Source File SOURCE=..\..\interactive_polygon.cpp # End Source File # Begin Source File SOURCE=..\..\pattern_perspective.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # Begin Source File SOURCE=..\..\..\include\agg_span_allocator.h # End Source File # Begin Source File SOURCE=..\..\..\include\agg_span_generator.h # End Source File # Begin Source File SOURCE=..\..\..\include\agg_span_image_filter.h # End Source File # Begin Source File SOURCE=..\..\..\include\agg_span_image_filter_rgba.h # End Source File # Begin Source File SOURCE=..\..\..\include\agg_span_pattern_filter_gray.h # End Source File # Begin Source File SOURCE=..\..\..\include\agg_span_pattern_filter_rgb.h # End Source File # Begin Source File SOURCE=..\..\..\include\agg_span_pattern_filter_rgba.h # End Source File # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project ����������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/pattern_perspective/pattern_perspective.dsw������������������������0000644�0000000�0000000�00000001024�10703246330�027557� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "pattern_perspective"=.\pattern_perspective.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/pattern_resample/��������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�022234� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/pattern_resample/Makefile������������������������������������������0000644�0000000�0000000�00000001517�10703246330�023700� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# # This makefile can be used to build a Win32 application under Cygwin # include ../../../Makefile.in.$(shell uname) PROGNAME=pattern_resample OUTNAME=$(PROGNAME) PLATFORM=win32 CXXFLAGS= $(AGGCXXFLAGS) -I../../../include \ -I/usr/X11R6/include \ -L/usr/X11R6/lib \ -L../../../src \ $(PIXFMT) LIBS = $(AGGLIBS) -lm -lgdi32 SRC=\ ../../$(PROGNAME).cpp \ ../../interactive_polygon.cpp \ ../../../src/platform/$(PLATFORM)/agg_platform_support.cpp \ ../../../src/platform/$(PLATFORM)/agg_win32_bmp.cpp OBJ= $(SRC:.cpp=.o) $(OUTNAME): $(OBJ) $(CXX) $(CXXFLAGS) $^ -o $(OUTNAME) $(LIBS) clean: rm -f $(OUTNAME) rm -f ../../$(PROGNAME).o rm -f ../../interactive_polygon.o rm -f ../../../src/platform/$(PLATFORM)/agg_platform_support.o rm -f gamma.txt rm -f gamma.bin %.o: %.cpp @echo \< $*.cpp \> $(CXX) -c $(CXXFLAGS) $*.cpp -o $@ ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/pattern_resample/pattern_resample.dsp������������������������������0000644�0000000�0000000�00000013002�10703246330�026305� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Microsoft Developer Studio Project File - Name="pattern_resample" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 CFG=pattern_resample - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "pattern_resample.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "pattern_resample.mak" CFG="pattern_resample - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "pattern_resample - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "pattern_resample - Win32 Debug" (based on "Win32 (x86) Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=xicl6.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "pattern_resample - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "AGG_BMP_NO_ALPHA_BLEND" /FD /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x419 /d "NDEBUG" # ADD RSC /l 0x419 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /out:"./pattern_resample.exe" !ELSEIF "$(CFG)" == "pattern_resample - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "AGG_BMP_NO_ALPHA_BLEND" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x419 /d "_DEBUG" # ADD RSC /l 0x419 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "pattern_resample - Win32 Release" # Name "pattern_resample - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\..\src\agg_bezier_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_bezier_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_curves.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_gsv_text.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_image_filters.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_platform_support.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_polygon_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_rbox_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_slider_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_trans_affine.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_stroke.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_win32_bmp.cpp # End Source File # Begin Source File SOURCE=..\..\interactive_polygon.cpp # End Source File # Begin Source File SOURCE=..\..\pattern_resample.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # Begin Source File SOURCE=..\..\..\include\agg_color_gray.h # End Source File # Begin Source File SOURCE=..\..\..\include\agg_span_image_filter_gray.h # End Source File # Begin Source File SOURCE=..\..\..\include\agg_span_image_filter_rgb.h # End Source File # Begin Source File SOURCE=..\..\..\include\agg_span_interpolator_persp.h # End Source File # Begin Source File SOURCE=..\..\..\include\agg_span_subdiv_adaptor.h # End Source File # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/pattern_resample/pattern_resample.dsw������������������������������0000644�0000000�0000000�00000001016�10703246330�026316� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "pattern_resample"=.\pattern_resample.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/perspective/�������������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�021220� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/perspective/Makefile�����������������������������������������������0000644�0000000�0000000�00000001476�10703246330�022670� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# # This makefile can be used to build a Win32 application under Cygwin # include ../../../Makefile.in.$(shell uname) PROGNAME=perspective OUTNAME=$(PROGNAME) PLATFORM=win32 CXXFLAGS= $(AGGCXXFLAGS) -I../../../include \ -I/usr/X11R6/include \ -L/usr/X11R6/lib \ -L../../../src \ $(PIXFMT) LIBS = $(AGGLIBS) -lm -lgdi32 SRC=\ ../../$(PROGNAME).cpp \ ../../parse_lion.cpp \ ../../interactive_polygon.cpp \ ../../../src/platform/$(PLATFORM)/agg_platform_support.cpp \ ../../../src/platform/$(PLATFORM)/agg_win32_bmp.cpp OBJ= $(SRC:.cpp=.o) $(OUTNAME): $(OBJ) $(CXX) $(CXXFLAGS) $^ -o $(OUTNAME) $(LIBS) clean: rm -f $(OUTNAME) rm -f ../../$(PROGNAME).o rm -f ../../../src/platform/$(PLATFORM)/agg_platform_support.o rm -f gamma.txt rm -f gamma.bin %.o: %.cpp @echo \< $*.cpp \> $(CXX) -c $(CXXFLAGS) $*.cpp -o $@ ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/perspective/perspective.dsp����������������������������������������0000644�0000000�0000000�00000011246�10703246330�024265� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Microsoft Developer Studio Project File - Name="perspective" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 CFG=perspective - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "perspective.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "perspective.mak" CFG="perspective - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "perspective - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "perspective - Win32 Debug" (based on "Win32 (x86) Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "perspective - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "AGG_BMP_NO_ALPHA_BLEND" /FD /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x419 /d "NDEBUG" # ADD RSC /l 0x419 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /out:"./perspective.exe" !ELSEIF "$(CFG)" == "perspective - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "AGG_BMP_NO_ALPHA_BLEND" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x419 /d "_DEBUG" # ADD RSC /l 0x419 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "perspective - Win32 Release" # Name "perspective - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\..\src\agg_bezier_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_gsv_text.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_platform_support.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_rbox_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_trans_affine.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_stroke.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_win32_bmp.cpp # End Source File # Begin Source File SOURCE=..\..\interactive_polygon.cpp # End Source File # Begin Source File SOURCE=..\..\parse_lion.cpp # End Source File # Begin Source File SOURCE=..\..\perspective.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/perspective/perspective.dsw����������������������������������������0000644�0000000�0000000�00000001004�10703246330�024263� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "perspective"=.\perspective.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/polymorphic_renderer/����������������������������������������������0000755�0000000�0000000�00000000000�10703246330�023122� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/polymorphic_renderer/Makefile��������������������������������������0000644�0000000�0000000�00000001420�10703246330�024557� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# # This makefile can be used to build a Win32 application under Cygwin # include ../../../Makefile.in.$(shell uname) PROGNAME=polymorphic_renderer OUTNAME=$(PROGNAME) PLATFORM=win32 CXXFLAGS= $(AGGCXXFLAGS) -I../../../include \ -I/usr/X11R6/include \ -L/usr/X11R6/lib \ -L../../../src \ $(PIXFMT) LIBS = $(AGGLIBS) -lm -lgdi32 SRC=\ ../../$(PROGNAME).cpp \ ../../../src/platform/$(PLATFORM)/agg_platform_support.cpp \ ../../../src/platform/$(PLATFORM)/agg_win32_bmp.cpp OBJ= $(SRC:.cpp=.o) $(OUTNAME): $(OBJ) $(CXX) $(CXXFLAGS) $^ -o $(OUTNAME) $(LIBS) clean: rm -f $(OUTNAME) rm -f ../../$(PROGNAME).o rm -f ../../../src/platform/$(PLATFORM)/agg_platform_support.o rm -f gamma.txt rm -f gamma.bin %.o: %.cpp @echo \< $*.cpp \> $(CXX) -c $(CXXFLAGS) $*.cpp -o $@ ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/polymorphic_renderer/polymorphic_renderer.dsp����������������������0000644�0000000�0000000�00000010756�10703246330�030076� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Microsoft Developer Studio Project File - Name="polymorphic_renderer" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 CFG=polymorphic_renderer - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "polymorphic_renderer.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "polymorphic_renderer.mak" CFG="polymorphic_renderer - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "polymorphic_renderer - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "polymorphic_renderer - Win32 Debug" (based on "Win32 (x86) Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "polymorphic_renderer - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /profile /machine:I386 /out:"./polymorphic_renderer.exe" !ELSEIF "$(CFG)" == "polymorphic_renderer - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "polymorphic_renderer - Win32 Release" # Name "polymorphic_renderer - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\..\src\agg_bezier_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_platform_support.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_trans_affine.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_contour.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_dash.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_win32_bmp.cpp # End Source File # Begin Source File SOURCE=..\..\polymorphic_renderer.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project ������������������agg-2.5+dfsg1/examples/win32_api/polymorphic_renderer/polymorphic_renderer.dsw����������������������0000644�0000000�0000000�00000001026�10703246330�030073� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "polymorphic_renderer"=.\polymorphic_renderer.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/pure_api/����������������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�020473� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/pure_api/StdAfx.cpp������������������������������������������������0000644�0000000�0000000�00000000437�10703246330�022374� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// stdafx.cpp : source file that includes just the standard includes // pure_api.pch will be the pre-compiled header // stdafx.obj will contain the pre-compiled type information #include "stdafx.h" // TODO: reference any additional headers you need in STDAFX.H // and not in this file ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/pure_api/StdAfx.h��������������������������������������������������0000644�0000000�0000000�00000001610�10703246330�022033� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// stdafx.h : include file for standard system include files, // or project specific include files that are used frequently, but // are changed infrequently // #if !defined(AFX_STDAFX_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_) #define AFX_STDAFX_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers // Windows Header Files: #include <windows.h> // C RunTime Header Files #include <stdlib.h> #include <malloc.h> #include <memory.h> #include <tchar.h> // Local Header Files // TODO: reference additional headers your program requires here //{{AFX_INSERT_LOCATION}} // Microsoft Visual C++ will insert additional declarations immediately before the previous line. #endif // !defined(AFX_STDAFX_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_) ������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/pure_api/pure_api.cpp����������������������������������������������0000644�0000000�0000000�00000021700�10703246330�023003� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// pure_api.cpp : Defines the entry point for the application. // #include "stdafx.h" #include "resource.h" #include "agg_scanline_p.h" #include "agg_renderer_scanline.h" #include "agg_pixfmt_rgba.h" #include "agg_rasterizer_scanline_aa.h" #define MAX_LOADSTRING 100 // Global Variables: HINSTANCE hInst; // current instance TCHAR szTitle[MAX_LOADSTRING]; // The title bar text TCHAR szWindowClass[MAX_LOADSTRING]; // The title bar text // Foward declarations of functions included in this code module: ATOM MyRegisterClass(HINSTANCE hInstance); BOOL InitInstance(HINSTANCE, int); LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); LRESULT CALLBACK About(HWND, UINT, WPARAM, LPARAM); int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { // TODO: Place code here. MSG msg; HACCEL hAccelTable; // Initialize global strings LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING); LoadString(hInstance, IDC_PURE_API, szWindowClass, MAX_LOADSTRING); MyRegisterClass(hInstance); // Perform application initialization: if (!InitInstance (hInstance, nCmdShow)) { return FALSE; } hAccelTable = LoadAccelerators(hInstance, (LPCTSTR)IDC_PURE_API); // Main message loop: while (GetMessage(&msg, NULL, 0, 0)) { if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg)) { TranslateMessage(&msg); DispatchMessage(&msg); } } return msg.wParam; } // // FUNCTION: MyRegisterClass() // // PURPOSE: Registers the window class. // // COMMENTS: // // This function and its usage is only necessary if you want this code // to be compatible with Win32 systems prior to the 'RegisterClassEx' // function that was added to Windows 95. It is important to call this function // so that the application will get 'well formed' small icons associated // with it. // ATOM MyRegisterClass(HINSTANCE hInstance) { WNDCLASSEX wcex; wcex.cbSize = sizeof(WNDCLASSEX); wcex.style = CS_HREDRAW | CS_VREDRAW; wcex.lpfnWndProc = (WNDPROC)WndProc; wcex.cbClsExtra = 0; wcex.cbWndExtra = 0; wcex.hInstance = hInstance; wcex.hIcon = LoadIcon(hInstance, (LPCTSTR)IDI_PURE_API); wcex.hCursor = LoadCursor(NULL, IDC_ARROW); wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1); wcex.lpszMenuName = (LPCSTR)IDC_PURE_API; wcex.lpszClassName = szWindowClass; wcex.hIconSm = LoadIcon(wcex.hInstance, (LPCTSTR)IDI_SMALL); return RegisterClassEx(&wcex); } // // FUNCTION: InitInstance(HANDLE, int) // // PURPOSE: Saves instance handle and creates main window // // COMMENTS: // // In this function, we save the instance handle in a global variable and // create and display the main program window. // BOOL InitInstance(HINSTANCE hInstance, int nCmdShow) { HWND hWnd; hInst = hInstance; // Store instance handle in our global variable hWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInstance, NULL); if (!hWnd) { return FALSE; } ShowWindow(hWnd, nCmdShow); UpdateWindow(hWnd); return TRUE; } // // FUNCTION: WndProc(HWND, unsigned, WORD, LONG) // // PURPOSE: Processes messages for the main window. // // WM_COMMAND - process the application menu // WM_PAINT - Paint the main window // WM_DESTROY - post a quit message and return // // LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { int wmId, wmEvent; PAINTSTRUCT ps; HDC hdc; TCHAR szHello[MAX_LOADSTRING]; LoadString(hInst, IDS_HELLO, szHello, MAX_LOADSTRING); switch (message) { case WM_COMMAND: wmId = LOWORD(wParam); wmEvent = HIWORD(wParam); // Parse the menu selections: switch (wmId) { case IDM_ABOUT: DialogBox(hInst, (LPCTSTR)IDD_ABOUTBOX, hWnd, (DLGPROC)About); break; case IDM_EXIT: DestroyWindow(hWnd); break; default: return DefWindowProc(hWnd, message, wParam, lParam); } break; case WM_PAINT: { hdc = BeginPaint(hWnd, &ps); RECT rt; GetClientRect(hWnd, &rt); int width = rt.right - rt.left; int height = rt.bottom - rt.top; //============================================================ //Creating compatible DC and a bitmap to render the image BITMAPINFO bmp_info; bmp_info.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); bmp_info.bmiHeader.biWidth = width; bmp_info.bmiHeader.biHeight = height; bmp_info.bmiHeader.biPlanes = 1; bmp_info.bmiHeader.biBitCount = 32; bmp_info.bmiHeader.biCompression = BI_RGB; bmp_info.bmiHeader.biSizeImage = 0; bmp_info.bmiHeader.biXPelsPerMeter = 0; bmp_info.bmiHeader.biYPelsPerMeter = 0; bmp_info.bmiHeader.biClrUsed = 0; bmp_info.bmiHeader.biClrImportant = 0; HDC mem_dc = ::CreateCompatibleDC(hdc); void* buf = 0; HBITMAP bmp = ::CreateDIBSection( mem_dc, &bmp_info, DIB_RGB_COLORS, &buf, 0, 0 ); // Selecting the object before doing anything allows you // to use AGG together with native Windows GDI. HBITMAP temp = (HBITMAP)::SelectObject(mem_dc, bmp); //============================================================ // AGG lowest level code. agg::rendering_buffer rbuf; rbuf.attach((unsigned char*)buf, width, height, -width*4); // Use negative stride in order // to keep Y-axis consistent with // WinGDI, i.e., going down. // Pixel format and basic primitives renderer agg::pixfmt_bgra32 pixf(rbuf); agg::renderer_base<agg::pixfmt_bgra32> renb(pixf); renb.clear(agg::rgba8(255, 255, 255, 255)); // Scanline renderer for solid filling. agg::renderer_scanline_aa_solid<agg::renderer_base<agg::pixfmt_bgra32> > ren(renb); // Rasterizer & scanline agg::rasterizer_scanline_aa<> ras; agg::scanline_p8 sl; // Polygon (triangle) ras.move_to_d(20.7, 34.15); ras.line_to_d(398.23, 123.43); ras.line_to_d(165.45, 401.87); // Setting the attrribute (color) & Rendering ren.color(agg::rgba8(80, 90, 60)); agg::render_scanlines(ras, sl, ren); //============================================================ //------------------------------------------------------------ // Display the image. If the image is B-G-R-A (32-bits per pixel) // one can use AlphaBlend instead of BitBlt. In case of AlphaBlend // one also should clear the image with zero alpha, i.e. rgba8(0,0,0,0) ::BitBlt( hdc, rt.left, rt.top, width, height, mem_dc, 0, 0, SRCCOPY ); // Free resources ::SelectObject(mem_dc, temp); ::DeleteObject(bmp); ::DeleteObject(mem_dc); EndPaint(hWnd, &ps); } break; case WM_ERASEBKGND: // Don't forget to do nothing on Erase Background event :-) break; case WM_DESTROY: PostQuitMessage(0); break; default: return DefWindowProc(hWnd, message, wParam, lParam); } return 0; } // Mesage handler for about box. LRESULT CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { switch (message) { case WM_INITDIALOG: return TRUE; case WM_COMMAND: if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL) { EndDialog(hDlg, LOWORD(wParam)); return TRUE; } break; } return FALSE; } ����������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/pure_api/pure_api.dsp����������������������������������������������0000644�0000000�0000000�00000010336�10703246330�023012� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Microsoft Developer Studio Project File - Name="pure_api" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 CFG=pure_api - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "pure_api.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "pure_api.mak" CFG="pure_api - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "pure_api - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "pure_api - Win32 Debug" (based on "Win32 (x86) Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=xicl6.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "pure_api - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 !ELSEIF "$(CFG)" == "pure_api - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "pure_api - Win32 Release" # Name "pure_api - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=.\pure_api.cpp # End Source File # Begin Source File SOURCE=.\pure_api.rc # End Source File # Begin Source File SOURCE=.\StdAfx.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # Begin Source File SOURCE=.\pure_api.h # End Source File # Begin Source File SOURCE=.\resource.h # End Source File # Begin Source File SOURCE=.\StdAfx.h # End Source File # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # Begin Source File SOURCE=.\pure_api.ico # End Source File # Begin Source File SOURCE=.\small.ico # End Source File # End Group # Begin Source File SOURCE=.\ReadMe.txt # End Source File # End Target # End Project ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/pure_api/pure_api.dsw����������������������������������������������0000644�0000000�0000000�00000000776�10703246330�023030� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "pure_api"=.\pure_api.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### ��agg-2.5+dfsg1/examples/win32_api/pure_api/pure_api.h������������������������������������������������0000644�0000000�0000000�00000000500�10703246330�022443� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ #if !defined(AFX_PURE_API_H__B17A1161_38FE_4F00_8284_B215A497C968__INCLUDED_) #define AFX_PURE_API_H__B17A1161_38FE_4F00_8284_B215A497C968__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #include "resource.h" #endif // !defined(AFX_PURE_API_H__B17A1161_38FE_4F00_8284_B215A497C968__INCLUDED_) ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/pure_api/pure_api.ico����������������������������������������������0000644�0000000�0000000�00000002066�10703246330�022777� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000���������������������������������������������������������������������������������������������������������������������������������������������������������������������������� �����è��&��������(����(��� ���@���������€������������������������€��€���€€�€���€�€�€€��€€€�ÀÀÀ���ÿ��ÿ���ÿÿ�ÿ���ÿ�ÿ�ÿÿ��ÿÿÿ�ðÿ��ðÿðð�ÿðÿðððððÿðððððÿðððððð�ððððÿðð�ðð�ðÿððððð�ððÿðð�ÿððÿÿÿÿÿÿÿÿÿÿÿÿðð��������������ðÿÿÿÿÿÿÿÿÿÿÿÿÿÿð�ððð�ÿðð�ðð�ððð�ÿðð�ðð�ððð�ÿðð�ðð�ððð�ÿðð�ðð�ððð�ÿðð�ðð�ððð�ÿðð�ðð�ððð�ÿðð�ðð�ððð�ÿðð�ðð�ððð�ÿðð�ðð�ððð�ÿðð�ðð�ððð�ÿðð�ðð�ððð�ÿðð�ðð�ððð�ÿðð�ðð�ððð�ÿðð�ðð�ððð�ÿðð�ðð�ððð�ÿðð�ðð�ððð�ÿðð�ðð�ððð�ÿðð�ðð�ððð�ÿðð�ðð�ððð�ÿðð�ðð�ððð�ÿðð�ðð�ððð�ÿðð�ððÿÿÿÿÿÿÿÿÿÿÿÿÿÿðð����������������������������������������������������������������������������������������������������������������������������������������������(������ ���������À�������������������������€��€���€€�€���€�€�€€��€€€�ÀÀÀ���ÿ��ÿ���ÿÿ�ÿ���ÿ�ÿ�ÿÿ��ÿÿÿ����ð�����ð�ð�ðððÿÿÿÿðð������ðÿÿÿÿÿÿð�ððð�ð�ððð�ð�ððð�ð�ððð�ð�ððð�ð�ððð�ð�ððð�ð�ððð�ðÿÿÿÿÿÿð��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/pure_api/pure_api.rc�����������������������������������������������0000644�0000000�0000000�00000005604�10703246330�022632� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//Microsoft Visual C++ generated resource script. // #include "resource.h" #define APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// // // Generated from the TEXTINCLUDE 2 resource. // #define APSTUDIO_HIDDEN_SYMBOLS #include "windows.h" #undef APSTUDIO_HIDDEN_SYMBOLS ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) #ifdef _WIN32 LANGUAGE 9, 1 #pragma code_page(1252) #endif //_WIN32 ///////////////////////////////////////////////////////////////////////////// // // Icon // // Icon with lowest ID value placed first to ensure application icon // remains consistent on all systems. IDI_PURE_API ICON DISCARDABLE "pure_api.ICO" IDI_SMALL ICON DISCARDABLE "SMALL.ICO" ///////////////////////////////////////////////////////////////////////////// // // Menu // IDC_PURE_API MENU DISCARDABLE BEGIN POPUP "&File" BEGIN MENUITEM "E&xit", IDM_EXIT END POPUP "&Help" BEGIN MENUITEM "&About ...", IDM_ABOUT END END ///////////////////////////////////////////////////////////////////////////// // // Accelerator // IDC_PURE_API ACCELERATORS MOVEABLE PURE BEGIN "?", IDM_ABOUT, ASCII, ALT "/", IDM_ABOUT, ASCII, ALT END ///////////////////////////////////////////////////////////////////////////// // // Dialog // IDD_ABOUTBOX DIALOG DISCARDABLE 22, 17, 230, 75 STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU CAPTION "About" FONT 8, "System" BEGIN ICON IDI_PURE_API,IDC_MYICON,14,9,16,16 LTEXT "pure_api Version 1.0",IDC_STATIC,49,10,119,8,SS_NOPREFIX LTEXT "Copyright (C) 2002",IDC_STATIC,49,20,119,8 DEFPUSHBUTTON "OK",IDOK,195,6,30,11,WS_GROUP END #ifdef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // // TEXTINCLUDE // 2 TEXTINCLUDE DISCARDABLE BEGIN "#define APSTUDIO_HIDDEN_SYMBOLS\r\n" "#include ""windows.h""\r\n" "#undef APSTUDIO_HIDDEN_SYMBOLS\r\n" "#include ""resource.h""\r\n" "\0" END 3 TEXTINCLUDE DISCARDABLE BEGIN "\r\n" "\0" END #endif // APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // // String Table // STRINGTABLE DISCARDABLE BEGIN IDC_PURE_API "PURE_API" IDS_APP_TITLE "pure_api" IDS_HELLO "Hello World!" END #endif ///////////////////////////////////////////////////////////////////////////// #ifndef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // // Generated from the TEXTINCLUDE 3 resource. // ///////////////////////////////////////////////////////////////////////////// #endif // not APSTUDIO_INVOKED ����������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/pure_api/resource.h������������������������������������������������0000644�0000000�0000000�00000001372�10703246330�022476� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//{{NO_DEPENDENCIES}} // Microsoft Visual C++ generated include file. // Used by PURE_API.RC // #define IDR_MAINFRAME 128 #define IDD_PURE_API_DIALOG 102 #define IDD_ABOUTBOX 103 #define IDS_APP_TITLE 103 #define IDM_ABOUT 104 #define IDM_EXIT 105 #define IDS_HELLO 106 #define IDI_PURE_API 107 #define IDI_SMALL 108 #define IDC_PURE_API 109 #define IDC_MYICON 2 #define IDC_STATIC -1 // Next default values for new objects // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 129 #define _APS_NEXT_COMMAND_VALUE 32771 #define _APS_NEXT_CONTROL_VALUE 1000 #define _APS_NEXT_SYMED_VALUE 110 #endif #endif ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/pure_api/small.ico�������������������������������������������������0000644�0000000�0000000�00000000476�10703246330�022306� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(�����(������ ���������À�������������������������€��€���€€�€���€�€�€€��€€€�ÀÀÀ���ÿ��ÿ���ÿÿ�ÿ���ÿ�ÿ�ÿÿ��ÿÿÿ���ÿðð�ð�ðð�ð�ððÿÿÿÿðð������ðÿÿÿÿÿÿð�ð�ð�ð�ð�ð�ð�ð�ð�ð�ð�ð�ð�ð�ð�ð�ðÿÿÿÿÿÿð��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/raster_text/�������������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�021233� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/raster_text/Makefile�����������������������������������������������0000644�0000000�0000000�00000001407�10703246330�022675� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# # This makefile can be used to build a Win32 application under Cygwin # include ../../../Makefile.in.$(shell uname) PROGNAME=raster_text OUTNAME=$(PROGNAME) PLATFORM=win32 CXXFLAGS= $(AGGCXXFLAGS) -I../../../include \ -I/usr/X11R6/include \ -L/usr/X11R6/lib \ -L../../../src \ $(PIXFMT) LIBS = $(AGGLIBS) -lm -lgdi32 SRC=\ ../../$(PROGNAME).cpp \ ../../../src/platform/$(PLATFORM)/agg_platform_support.cpp \ ../../../src/platform/$(PLATFORM)/agg_win32_bmp.cpp OBJ= $(SRC:.cpp=.o) $(OUTNAME): $(OBJ) $(CXX) $(CXXFLAGS) $^ -o $(OUTNAME) $(LIBS) clean: rm -f $(OUTNAME) rm -f ../../$(PROGNAME).o rm -f ../../../src/platform/$(PLATFORM)/agg_platform_support.o rm -f gamma.txt rm -f gamma.bin %.o: %.cpp @echo \< $*.cpp \> $(CXX) -c $(CXXFLAGS) $*.cpp -o $@ ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/raster_text/raster_text.dsp����������������������������������������0000644�0000000�0000000�00000011456�10703246330�024316� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Microsoft Developer Studio Project File - Name="raster_text" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 CFG=raster_text - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "raster_text.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "raster_text.mak" CFG="raster_text - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "raster_text - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "raster_text - Win32 Debug" (based on "Win32 (x86) Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=xicl6.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "raster_text - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /out:"./raster_text.exe" !ELSEIF "$(CFG)" == "raster_text - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "raster_text - Win32 Release" # Name "raster_text - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\..\src\agg_trans_affine.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_embedded_raster_fonts.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_stroke.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_gsv_text.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_platform_support.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_sqrt_tables.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_win32_bmp.cpp # End Source File # Begin Source File SOURCE=..\..\raster_text.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # Begin Source File SOURCE=..\..\..\include\agg_embedded_raster_fonts.h # End Source File # Begin Source File SOURCE=..\..\..\include\agg_glyph_raster_bin.h # End Source File # Begin Source File SOURCE=..\..\..\include\agg_renderer_raster_text.h # End Source File # Begin Source File SOURCE=..\..\..\include\agg_span_gradient.h # End Source File # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/raster_text/raster_text.dsw����������������������������������������0000644�0000000�0000000�00000001004�10703246330�024311� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "raster_text"=.\raster_text.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/rasterizer_compound/�����������������������������������������������0000755�0000000�0000000�00000000000�10703246330�022765� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/rasterizer_compound/Makefile���������������������������������������0000644�0000000�0000000�00000001417�10703246330�024430� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# # This makefile can be used to build a Win32 application under Cygwin # include ../../../Makefile.in.$(shell uname) PROGNAME=rasterizer_compound OUTNAME=$(PROGNAME) PLATFORM=win32 CXXFLAGS= $(AGGCXXFLAGS) -I../../../include \ -I/usr/X11R6/include \ -L/usr/X11R6/lib \ -L../../../src \ $(PIXFMT) LIBS = $(AGGLIBS) -lm -lgdi32 SRC=\ ../../$(PROGNAME).cpp \ ../../../src/platform/$(PLATFORM)/agg_platform_support.cpp \ ../../../src/platform/$(PLATFORM)/agg_win32_bmp.cpp OBJ= $(SRC:.cpp=.o) $(OUTNAME): $(OBJ) $(CXX) $(CXXFLAGS) $^ -o $(OUTNAME) $(LIBS) clean: rm -f $(OUTNAME) rm -f ../../$(PROGNAME).o rm -f ../../../src/platform/$(PLATFORM)/agg_platform_support.o rm -f gamma.txt rm -f gamma.bin %.o: %.cpp @echo \< $*.cpp \> $(CXX) -c $(CXXFLAGS) $*.cpp -o $@ �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/rasterizer_compound/rasterizer_compound.dsp������������������������0000644�0000000�0000000�00000012005�10703246330�027571� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Microsoft Developer Studio Project File - Name="rasterizer_compound" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 CFG=rasterizer_compound - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "rasterizer_compound.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "rasterizer_compound.mak" CFG="rasterizer_compound - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "rasterizer_compound - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "rasterizer_compound - Win32 Debug" (based on "Win32 (x86) Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=xicl6.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "rasterizer_compound - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /out:"./rasterizer_compound.exe" !ELSEIF "$(CFG)" == "rasterizer_compound - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "rasterizer_compound - Win32 Release" # Name "rasterizer_compound - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\..\src\agg_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_arrowhead.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_bezier_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_cbox_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_curves.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_gsv_text.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_platform_support.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_rbox_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_slider_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_trans_affine.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_contour.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_stroke.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_win32_bmp.cpp # End Source File # Begin Source File SOURCE=..\..\rasterizer_compound.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/rasterizer_compound/rasterizer_compound.dsw������������������������0000644�0000000�0000000�00000001024�10703246330�027577� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "rasterizer_compound"=.\rasterizer_compound.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/rasterizers/�������������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�021244� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/rasterizers/Makefile�����������������������������������������������0000644�0000000�0000000�00000001407�10703246330�022706� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# # This makefile can be used to build a Win32 application under Cygwin # include ../../../Makefile.in.$(shell uname) PROGNAME=rasterizers OUTNAME=$(PROGNAME) PLATFORM=win32 CXXFLAGS= $(AGGCXXFLAGS) -I../../../include \ -I/usr/X11R6/include \ -L/usr/X11R6/lib \ -L../../../src \ $(PIXFMT) LIBS = $(AGGLIBS) -lm -lgdi32 SRC=\ ../../$(PROGNAME).cpp \ ../../../src/platform/$(PLATFORM)/agg_platform_support.cpp \ ../../../src/platform/$(PLATFORM)/agg_win32_bmp.cpp OBJ= $(SRC:.cpp=.o) $(OUTNAME): $(OBJ) $(CXX) $(CXXFLAGS) $^ -o $(OUTNAME) $(LIBS) clean: rm -f $(OUTNAME) rm -f ../../$(PROGNAME).o rm -f ../../../src/platform/$(PLATFORM)/agg_platform_support.o rm -f gamma.txt rm -f gamma.bin %.o: %.cpp @echo \< $*.cpp \> $(CXX) -c $(CXXFLAGS) $*.cpp -o $@ ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/rasterizers/rasterizers.dsp����������������������������������������0000644�0000000�0000000�00000011406�10703246330�024333� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Microsoft Developer Studio Project File - Name="rasterizers" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 CFG=rasterizers - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "rasterizers.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "rasterizers.mak" CFG="rasterizers - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "rasterizers - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "rasterizers - Win32 Debug" (based on "Win32 (x86) Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "rasterizers - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /profile /machine:I386 /out:"./rasterizers.exe" !ELSEIF "$(CFG)" == "rasterizers - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "rasterizers - Win32 Release" # Name "rasterizers - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\..\src\agg_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_arrowhead.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_bezier_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_cbox_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_gsv_text.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_platform_support.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_slider_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_trans_affine.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_markers_term.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_stroke.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_win32_bmp.cpp # End Source File # Begin Source File SOURCE=..\..\rasterizers.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/rasterizers/rasterizers.dsw����������������������������������������0000644�0000000�0000000�00000001004�10703246330�024333� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "rasterizers"=.\rasterizers.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/rasterizers2/������������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�021326� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/rasterizers2/Makefile����������������������������������������������0000644�0000000�0000000�00000001410�10703246330�022762� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# # This makefile can be used to build a Win32 application under Cygwin # include ../../../Makefile.in.$(shell uname) PROGNAME=rasterizers2 OUTNAME=$(PROGNAME) PLATFORM=win32 CXXFLAGS= $(AGGCXXFLAGS) -I../../../include \ -I/usr/X11R6/include \ -L/usr/X11R6/lib \ -L../../../src \ $(PIXFMT) LIBS = $(AGGLIBS) -lm -lgdi32 SRC=\ ../../$(PROGNAME).cpp \ ../../../src/platform/$(PLATFORM)/agg_platform_support.cpp \ ../../../src/platform/$(PLATFORM)/agg_win32_bmp.cpp OBJ= $(SRC:.cpp=.o) $(OUTNAME): $(OBJ) $(CXX) $(CXXFLAGS) $^ -o $(OUTNAME) $(LIBS) clean: rm -f $(OUTNAME) rm -f ../../$(PROGNAME).o rm -f ../../../src/platform/$(PLATFORM)/agg_platform_support.o rm -f gamma.txt rm -f gamma.bin %.o: %.cpp @echo \< $*.cpp \> $(CXX) -c $(CXXFLAGS) $*.cpp -o $@ ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/rasterizers2/rasterizers2.dsp��������������������������������������0000644�0000000�0000000�00000013365�10703246330�024505� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Microsoft Developer Studio Project File - Name="rasterizers2" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 CFG=rasterizers2 - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "rasterizers2.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "rasterizers2.mak" CFG="rasterizers2 - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "rasterizers2 - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "rasterizers2 - Win32 Debug" (based on "Win32 (x86) Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "rasterizers2 - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /profile /machine:I386 /out:"./rasterizers2.exe" !ELSEIF "$(CFG)" == "rasterizers2 - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "rasterizers2 - Win32 Release" # Name "rasterizers2 - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\..\src\agg_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_arrowhead.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_bezier_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_cbox_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_curves.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_gsv_text.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_line_aa_basics.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_line_profile_aa.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_platform_support.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_rounded_rect.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_slider_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_sqrt_tables.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_trans_affine.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_contour.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_dash.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_markers_term.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_smooth_poly1.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_stroke.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_win32_bmp.cpp # End Source File # Begin Source File SOURCE=..\..\rasterizers2.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # Begin Source File SOURCE=..\..\..\include\agg_line_aa_basics.h # End Source File # Begin Source File SOURCE=..\..\..\include\agg_renderer_markers.h # End Source File # Begin Source File SOURCE=..\..\..\include\agg_renderer_outline_aa.h # End Source File # Begin Source File SOURCE=..\..\..\include\agg_renderer_outline_image.h # End Source File # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/rasterizers2/rasterizers2.dsw��������������������������������������0000644�0000000�0000000�00000001006�10703246330�024501� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "rasterizers2"=.\rasterizers2.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/rounded_rect/������������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�021344� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/rounded_rect/Makefile����������������������������������������������0000644�0000000�0000000�00000001410�10703246330�023000� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# # This makefile can be used to build a Win32 application under Cygwin # include ../../../Makefile.in.$(shell uname) PROGNAME=rounded_rect OUTNAME=$(PROGNAME) PLATFORM=win32 CXXFLAGS= $(AGGCXXFLAGS) -I../../../include \ -I/usr/X11R6/include \ -L/usr/X11R6/lib \ -L../../../src \ $(PIXFMT) LIBS = $(AGGLIBS) -lm -lgdi32 SRC=\ ../../$(PROGNAME).cpp \ ../../../src/platform/$(PLATFORM)/agg_platform_support.cpp \ ../../../src/platform/$(PLATFORM)/agg_win32_bmp.cpp OBJ= $(SRC:.cpp=.o) $(OUTNAME): $(OBJ) $(CXX) $(CXXFLAGS) $^ -o $(OUTNAME) $(LIBS) clean: rm -f $(OUTNAME) rm -f ../../$(PROGNAME).o rm -f ../../../src/platform/$(PLATFORM)/agg_platform_support.o rm -f gamma.txt rm -f gamma.bin %.o: %.cpp @echo \< $*.cpp \> $(CXX) -c $(CXXFLAGS) $*.cpp -o $@ ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/rounded_rect/rounded_rect.dsp��������������������������������������0000644�0000000�0000000�00000011267�10703246330�024540� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Microsoft Developer Studio Project File - Name="rounded_rect" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 CFG=rounded_rect - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "rounded_rect.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "rounded_rect.mak" CFG="rounded_rect - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "rounded_rect - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "rounded_rect - Win32 Debug" (based on "Win32 (x86) Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "rounded_rect - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /out:"./rounded_rect.exe" !ELSEIF "$(CFG)" == "rounded_rect - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "rounded_rect - Win32 Release" # Name "rounded_rect - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\..\src\agg_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_bezier_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_cbox_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_gsv_text.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_platform_support.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_rounded_rect.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_slider_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_trans_affine.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_stroke.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_win32_bmp.cpp # End Source File # Begin Source File SOURCE=..\..\rounded_rect.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/rounded_rect/rounded_rect.dsw��������������������������������������0000644�0000000�0000000�00000001006�10703246330�024535� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "rounded_rect"=.\rounded_rect.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/scanline_boolean/��������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�022162� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/scanline_boolean/Makefile������������������������������������������0000644�0000000�0000000�00000001517�10703246330�023626� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# # This makefile can be used to build a Win32 application under Cygwin # include ../../../Makefile.in.$(shell uname) PROGNAME=scanline_boolean OUTNAME=$(PROGNAME) PLATFORM=win32 CXXFLAGS= $(AGGCXXFLAGS) -I../../../include \ -I/usr/X11R6/include \ -L/usr/X11R6/lib \ -L../../../src \ $(PIXFMT) LIBS = $(AGGLIBS) -lm -lgdi32 SRC=\ ../../$(PROGNAME).cpp \ ../../interactive_polygon.cpp \ ../../../src/platform/$(PLATFORM)/agg_platform_support.cpp \ ../../../src/platform/$(PLATFORM)/agg_win32_bmp.cpp OBJ= $(SRC:.cpp=.o) $(OUTNAME): $(OBJ) $(CXX) $(CXXFLAGS) $^ -o $(OUTNAME) $(LIBS) clean: rm -f $(OUTNAME) rm -f ../../$(PROGNAME).o rm -f ../../interactive_polygon.o rm -f ../../../src/platform/$(PLATFORM)/agg_platform_support.o rm -f gamma.txt rm -f gamma.bin %.o: %.cpp @echo \< $*.cpp \> $(CXX) -c $(CXXFLAGS) $*.cpp -o $@ ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/scanline_boolean/scanline_boolean.dsp������������������������������0000644�0000000�0000000�00000011626�10703246330�026173� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Microsoft Developer Studio Project File - Name="scanline_boolean" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 CFG=scanline_boolean - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "scanline_boolean.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "scanline_boolean.mak" CFG="scanline_boolean - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "scanline_boolean - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "scanline_boolean - Win32 Debug" (based on "Win32 (x86) Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "scanline_boolean - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "AGG_BMP_NO_ALPHA_BLEND" /FD /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x419 /d "NDEBUG" # ADD RSC /l 0x419 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /out:"./scanline_boolean.exe" !ELSEIF "$(CFG)" == "scanline_boolean - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "AGG_BMP_NO_ALPHA_BLEND" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x419 /d "_DEBUG" # ADD RSC /l 0x419 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "scanline_boolean - Win32 Release" # Name "scanline_boolean - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\..\src\agg_bezier_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_cbox_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_gsv_text.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_platform_support.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_rbox_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_slider_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_trans_affine.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_stroke.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_win32_bmp.cpp # End Source File # Begin Source File SOURCE=..\..\interactive_polygon.cpp # End Source File # Begin Source File SOURCE=..\..\scanline_boolean.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # Begin Source File SOURCE=..\..\..\include\agg_config.h # End Source File # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project ����������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/scanline_boolean/scanline_boolean.dsw������������������������������0000644�0000000�0000000�00000001016�10703246330�026172� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "scanline_boolean"=.\scanline_boolean.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/scanline_boolean2/�������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�022244� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/scanline_boolean2/Makefile�����������������������������������������0000644�0000000�0000000�00000001464�10703246330�023711� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# # This makefile can be used to build a Win32 application under Cygwin # include ../../../Makefile.in.$(shell uname) PROGNAME=scanline_boolean2 OUTNAME=$(PROGNAME) PLATFORM=win32 CXXFLAGS= $(AGGCXXFLAGS) -I../../../include \ -I/usr/X11R6/include \ -L/usr/X11R6/lib \ -L../../../src \ $(PIXFMT) LIBS = $(AGGLIBS) -lm -lgdi32 SRC=\ ../../$(PROGNAME).cpp \ ../../make_arrows.cpp \ ../../make_gb_poly.cpp \ ../../../src/platform/$(PLATFORM)/agg_platform_support.cpp \ ../../../src/platform/$(PLATFORM)/agg_win32_bmp.cpp OBJ= $(SRC:.cpp=.o) $(OUTNAME): $(OBJ) $(CXX) $(CXXFLAGS) $^ -o $(OUTNAME) $(LIBS) clean: rm -f $(OUTNAME) rm -f ../../*.o rm -f ../../../src/platform/$(PLATFORM)/agg_platform_support.o rm -f gamma.txt rm -f gamma.bin %.o: %.cpp @echo \< $*.cpp \> $(CXX) -c $(CXXFLAGS) $*.cpp -o $@ ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/scanline_boolean2/scanline_boolean2.dsp����������������������������0000644�0000000�0000000�00000011652�10703246330�026336� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Microsoft Developer Studio Project File - Name="scanline_boolean2" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 CFG=scanline_boolean2 - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "scanline_boolean2.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "scanline_boolean2.mak" CFG="scanline_boolean2 - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "scanline_boolean2 - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "scanline_boolean2 - Win32 Debug" (based on "Win32 (x86) Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "scanline_boolean2 - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /I "../../../gpc" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /out:"./scanline_boolean2.exe" !ELSEIF "$(CFG)" == "scanline_boolean2 - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /I "../../../gpc" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "scanline_boolean2 - Win32 Release" # Name "scanline_boolean2 - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\..\src\agg_bezier_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_cbox_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_curves.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_gsv_text.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_platform_support.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_rbox_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_slider_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_trans_affine.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_stroke.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_win32_bmp.cpp # End Source File # Begin Source File SOURCE=..\..\make_arrows.cpp # End Source File # Begin Source File SOURCE=..\..\make_gb_poly.cpp # End Source File # Begin Source File SOURCE=..\..\scanline_boolean2.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project ��������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/scanline_boolean2/scanline_boolean2.dsw����������������������������0000644�0000000�0000000�00000001020�10703246330�026331� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "scanline_boolean2"=.\scanline_boolean2.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/simple_blur/�������������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�021204� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/simple_blur/Makefile�����������������������������������������������0000644�0000000�0000000�00000001436�10703246330�022650� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# # This makefile can be used to build a Win32 application under Cygwin # include ../../../Makefile.in.$(shell uname) PROGNAME=simple_blur OUTNAME=$(PROGNAME) PLATFORM=win32 CXXFLAGS= $(AGGCXXFLAGS) -I../../../include \ -I/usr/X11R6/include \ -L/usr/X11R6/lib \ -L../../../src \ $(PIXFMT) LIBS = $(AGGLIBS) -lm -lgdi32 SRC=\ ../../$(PROGNAME).cpp \ ../../parse_lion.cpp \ ../../../src/platform/$(PLATFORM)/agg_platform_support.cpp \ ../../../src/platform/$(PLATFORM)/agg_win32_bmp.cpp OBJ= $(SRC:.cpp=.o) $(OUTNAME): $(OBJ) $(CXX) $(CXXFLAGS) $^ -o $(OUTNAME) $(LIBS) clean: rm -f $(OUTNAME) rm -f ../../$(PROGNAME).o rm -f ../../../src/platform/$(PLATFORM)/agg_platform_support.o rm -f gamma.txt rm -f gamma.bin %.o: %.cpp @echo \< $*.cpp \> $(CXX) -c $(CXXFLAGS) $*.cpp -o $@ ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/simple_blur/simple_blur.dsp����������������������������������������0000644�0000000�0000000�00000011520�10703246330�024230� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Microsoft Developer Studio Project File - Name="simple_blur" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 CFG=simple_blur - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "simple_blur.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "simple_blur.mak" CFG="simple_blur - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "simple_blur - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "simple_blur - Win32 Debug" (based on "Win32 (x86) Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "simple_blur - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "AGG_BMP_NO_ALPHA_BLEND" /FD /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x419 /d "NDEBUG" # ADD RSC /l 0x419 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /out:"./simple_blur.exe" !ELSEIF "$(CFG)" == "simple_blur - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "AGG_BMP_NO_ALPHA_BLEND" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x419 /d "_DEBUG" # ADD RSC /l 0x419 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "simple_blur - Win32 Release" # Name "simple_blur - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\..\src\agg_bezier_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_gsv_text.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_line_aa_basics.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_line_profile_aa.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_platform_support.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_slider_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_sqrt_tables.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_trans_affine.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_stroke.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_win32_bmp.cpp # End Source File # Begin Source File SOURCE=..\..\parse_lion.cpp # End Source File # Begin Source File SOURCE=..\..\simple_blur.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/simple_blur/simple_blur.dsw����������������������������������������0000644�0000000�0000000�00000001004�10703246330�024233� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "simple_blur"=.\simple_blur.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/svg_test/����������������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�020525� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/svg_test/svg_test.dsp����������������������������������������������0000644�0000000�0000000�00000012606�10703246330�023100� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Microsoft Developer Studio Project File - Name="svg_test" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 CFG=svg_test - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "svg_test.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "svg_test.mak" CFG="svg_test - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "svg_test - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "svg_test - Win32 Debug" (based on "Win32 (x86) Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=xicl6.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "svg_test - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /I "../../../../Expat/Source/lib" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /FD /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x419 /d "NDEBUG" # ADD RSC /l 0x419 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libexpat.lib /nologo /subsystem:windows /profile /machine:I386 /out:"./svg_test.exe" /libpath:"../../../../Expat/libs" !ELSEIF "$(CFG)" == "svg_test - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /I "../../../../Expat/Source/lib" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x419 /d "_DEBUG" # ADD RSC /l 0x419 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libexpat.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept /libpath:"../../../../Expat/libs" !ENDIF # Begin Target # Name "svg_test - Win32 Release" # Name "svg_test - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\..\src\agg_bezier_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_curves.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_gsv_text.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_platform_support.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_slider_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\svg_viewer\agg_svg_parser.cpp # End Source File # Begin Source File SOURCE=..\..\svg_viewer\agg_svg_path_renderer.cpp # End Source File # Begin Source File SOURCE=..\..\svg_viewer\agg_svg_path_tokenizer.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_trans_affine.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_contour.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_stroke.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_win32_bmp.cpp # End Source File # Begin Source File SOURCE=..\..\svg_viewer\svg_test.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # Begin Source File SOURCE=..\..\svg_viewer\agg_svg_exception.h # End Source File # Begin Source File SOURCE=..\..\svg_viewer\agg_svg_parser.h # End Source File # Begin Source File SOURCE=..\..\svg_viewer\agg_svg_path_renderer.h # End Source File # Begin Source File SOURCE=..\..\svg_viewer\agg_svg_path_tokenizer.h # End Source File # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project ��������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/svg_test/svg_test.dsw����������������������������������������������0000644�0000000�0000000�00000000776�10703246330�023114� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "svg_test"=.\svg_test.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### ��agg-2.5+dfsg1/examples/win32_api/trans_curve1/������������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�021303� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/trans_curve1/Makefile����������������������������������������������0000644�0000000�0000000�00000001630�10703246330�022743� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# # This makefile can be used to build a Win32 application under Cygwin # include ../../../Makefile.in.$(shell uname) PROGNAME=trans_curve1 OUTNAME=$(PROGNAME) PLATFORM=win32 CXXFLAGS= $(AGGCXXFLAGS) \ -I../../../include \ -I../../../font_win32_tt \ -I/usr/X11R6/include \ -L/usr/X11R6/lib \ -L../../../src \ $(PIXFMT) LIBS = $(AGGLIBS) -lm -lgdi32 SRC=\ ../../$(PROGNAME).cpp \ ../../interactive_polygon.cpp \ ../../../src/platform/$(PLATFORM)/agg_platform_support.cpp \ ../../../src/platform/$(PLATFORM)/agg_win32_bmp.cpp \ ../../../font_win32_tt/agg_font_win32_tt.cpp OBJ= $(SRC:.cpp=.o) $(OUTNAME): $(OBJ) $(CXX) $(CXXFLAGS) $^ -o $(OUTNAME) $(LIBS) clean: rm -f $(OUTNAME) rm -f ../../$(PROGNAME).o rm -f ../../interactive_polygon.o rm -f ../../../src/platform/$(PLATFORM)/agg_platform_support.o rm -f gamma.txt rm -f gamma.bin %.o: %.cpp @echo \< $*.cpp \> $(CXX) -c $(CXXFLAGS) $*.cpp -o $@ ��������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/trans_curve1/trans_curve1.dsp��������������������������������������0000644�0000000�0000000�00000012347�10703246330�024436� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Microsoft Developer Studio Project File - Name="trans_curve1" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 CFG=trans_curve1 - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "trans_curve1.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "trans_curve1.mak" CFG="trans_curve1 - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "trans_curve1 - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "trans_curve1 - Win32 Debug" (based on "Win32 (x86) Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "trans_curve1 - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /I "../../../font_win32_tt" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "AGG_BMP_NO_ALPHA_BLEND" /FD /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x419 /d "NDEBUG" # ADD RSC /l 0x419 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /out:"./trans_curve1.exe" !ELSEIF "$(CFG)" == "trans_curve1 - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /I "../../../font_win32_tt" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "AGG_BMP_NO_ALPHA_BLEND" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x419 /d "_DEBUG" # ADD RSC /l 0x419 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "trans_curve1 - Win32 Release" # Name "trans_curve1 - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\..\src\agg_bezier_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_bspline.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_cbox_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_curves.cpp # End Source File # Begin Source File SOURCE=..\..\..\font_win32_tt\agg_font_win32_tt.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_gsv_text.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_platform_support.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_slider_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_trans_affine.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_trans_single_path.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_bspline.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_stroke.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vpgen_segmentator.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_win32_bmp.cpp # End Source File # Begin Source File SOURCE=..\..\interactive_polygon.cpp # End Source File # Begin Source File SOURCE=..\..\trans_curve1.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/trans_curve1/trans_curve1.dsw��������������������������������������0000644�0000000�0000000�00000001006�10703246330�024433� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "trans_curve1"=.\trans_curve1.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/trans_curve2/������������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�021304� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/trans_curve2/Makefile����������������������������������������������0000644�0000000�0000000�00000001630�10703246330�022744� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# # This makefile can be used to build a Win32 application under Cygwin # include ../../../Makefile.in.$(shell uname) PROGNAME=trans_curve2 OUTNAME=$(PROGNAME) PLATFORM=win32 CXXFLAGS= $(AGGCXXFLAGS) \ -I../../../include \ -I../../../font_win32_tt \ -I/usr/X11R6/include \ -L/usr/X11R6/lib \ -L../../../src \ $(PIXFMT) LIBS = $(AGGLIBS) -lm -lgdi32 SRC=\ ../../$(PROGNAME).cpp \ ../../interactive_polygon.cpp \ ../../../src/platform/$(PLATFORM)/agg_platform_support.cpp \ ../../../src/platform/$(PLATFORM)/agg_win32_bmp.cpp \ ../../../font_win32_tt/agg_font_win32_tt.cpp OBJ= $(SRC:.cpp=.o) $(OUTNAME): $(OBJ) $(CXX) $(CXXFLAGS) $^ -o $(OUTNAME) $(LIBS) clean: rm -f $(OUTNAME) rm -f ../../$(PROGNAME).o rm -f ../../interactive_polygon.o rm -f ../../../src/platform/$(PLATFORM)/agg_platform_support.o rm -f gamma.txt rm -f gamma.bin %.o: %.cpp @echo \< $*.cpp \> $(CXX) -c $(CXXFLAGS) $*.cpp -o $@ ��������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/trans_curve2/trans_curve2.dsp��������������������������������������0000644�0000000�0000000�00000012476�10703246330�024443� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Microsoft Developer Studio Project File - Name="trans_curve2" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 CFG=trans_curve2 - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "trans_curve2.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "trans_curve2.mak" CFG="trans_curve2 - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "trans_curve2 - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "trans_curve2 - Win32 Debug" (based on "Win32 (x86) Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "trans_curve2 - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /I "../../../font_win32_tt" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "AGG_BMP_NO_ALPHA_BLEND" /FD /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x419 /d "NDEBUG" # ADD RSC /l 0x419 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /out:"./trans_curve2.exe" !ELSEIF "$(CFG)" == "trans_curve2 - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /I "../../../font_win32_tt" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "AGG_BMP_NO_ALPHA_BLEND" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x419 /d "_DEBUG" # ADD RSC /l 0x419 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "trans_curve2 - Win32 Release" # Name "trans_curve2 - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\..\src\agg_bezier_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_bspline.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_cbox_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_curves.cpp # End Source File # Begin Source File SOURCE=..\..\..\font_win32_tt\agg_font_win32_tt.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_gsv_text.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_platform_support.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_slider_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_trans_affine.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_trans_double_path.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_bspline.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_stroke.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vpgen_segmentator.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_win32_bmp.cpp # End Source File # Begin Source File SOURCE=..\..\interactive_polygon.cpp # End Source File # Begin Source File SOURCE=..\..\trans_curve2.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # Begin Source File SOURCE=..\..\..\include\agg_trans_double_path.h # End Source File # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/trans_curve2/trans_curve2.dsw��������������������������������������0000644�0000000�0000000�00000001006�10703246330�024435� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "trans_curve2"=.\trans_curve2.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/trans_polar/�������������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�021213� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/trans_polar/Makefile�����������������������������������������������0000644�0000000�0000000�00000001407�10703246330�022655� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# # This makefile can be used to build a Win32 application under Cygwin # include ../../../Makefile.in.$(shell uname) PROGNAME=trans_polar OUTNAME=$(PROGNAME) PLATFORM=win32 CXXFLAGS= $(AGGCXXFLAGS) -I../../../include \ -I/usr/X11R6/include \ -L/usr/X11R6/lib \ -L../../../src \ $(PIXFMT) LIBS = $(AGGLIBS) -lm -lgdi32 SRC=\ ../../$(PROGNAME).cpp \ ../../../src/platform/$(PLATFORM)/agg_platform_support.cpp \ ../../../src/platform/$(PLATFORM)/agg_win32_bmp.cpp OBJ= $(SRC:.cpp=.o) $(OUTNAME): $(OBJ) $(CXX) $(CXXFLAGS) $^ -o $(OUTNAME) $(LIBS) clean: rm -f $(OUTNAME) rm -f ../../$(PROGNAME).o rm -f ../../../src/platform/$(PLATFORM)/agg_platform_support.o rm -f gamma.txt rm -f gamma.bin %.o: %.cpp @echo \< $*.cpp \> $(CXX) -c $(CXXFLAGS) $*.cpp -o $@ ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/trans_polar/trans_polar.dsp����������������������������������������0000644�0000000�0000000�00000011140�10703246330�024244� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Microsoft Developer Studio Project File - Name="trans_polar" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 CFG=trans_polar - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "trans_polar.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "trans_polar.mak" CFG="trans_polar - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "trans_polar - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "trans_polar - Win32 Debug" (based on "Win32 (x86) Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "trans_polar - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /out:"./trans_polar.exe" !ELSEIF "$(CFG)" == "trans_polar - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "trans_polar - Win32 Release" # Name "trans_polar - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\..\src\agg_bezier_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_curves.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_gsv_text.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_platform_support.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_slider_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_trans_affine.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_stroke.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vpgen_segmentator.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_win32_bmp.cpp # End Source File # Begin Source File SOURCE=..\..\trans_polar.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/trans_polar/trans_polar.dsw����������������������������������������0000644�0000000�0000000�00000001004�10703246330�024251� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "trans_polar"=.\trans_polar.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/truetype_test/�����������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�021607� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/truetype_test/Makefile���������������������������������������������0000644�0000000�0000000�00000001571�10703246330�023253� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# # This makefile can be used to build a Win32 application under Cygwin # include ../../../Makefile.in.$(shell uname) PROGNAME=truetype_test OUTNAME=$(PROGNAME) PLATFORM=win32 CXXFLAGS= $(AGGCXXFLAGS) \ -I../../../include \ -I../../../font_win32_tt \ -I/usr/X11R6/include \ -L/usr/X11R6/lib \ -L../../../src \ $(PIXFMT) LIBS = $(AGGLIBS) -lm -lgdi32 SRC=\ ../../$(PROGNAME).cpp \ ../../../src/platform/$(PLATFORM)/agg_platform_support.cpp \ ../../../src/platform/$(PLATFORM)/agg_win32_bmp.cpp \ ../../../font_win32_tt/agg_font_win32_tt.cpp OBJ= $(SRC:.cpp=.o) $(OUTNAME): $(OBJ) $(CXX) $(CXXFLAGS) $^ -o $(OUTNAME) $(LIBS) clean: rm -f $(OUTNAME) rm -f ../../$(PROGNAME).o rm -f ../../interactive_polygon.o rm -f ../../../src/platform/$(PLATFORM)/agg_platform_support.o rm -f gamma.txt rm -f gamma.bin %.o: %.cpp @echo \< $*.cpp \> $(CXX) -c $(CXXFLAGS) $*.cpp -o $@ ���������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/truetype_test/truetype_test.dsp������������������������������������0000644�0000000�0000000�00000011666�10703246330�025251� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Microsoft Developer Studio Project File - Name="truetype_test" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 CFG=truetype_test - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "truetype_test.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "truetype_test.mak" CFG="truetype_test - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "truetype_test - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "truetype_test - Win32 Debug" (based on "Win32 (x86) Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "truetype_test - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD CPP /nologo /MD /W3 /GX /O2 /I "../../../include" /I "../../../font_win32_tt" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /out:"./truetype_test.exe" !ELSEIF "$(CFG)" == "truetype_test - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c # ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../../include" /I "../../../font_win32_tt" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "truetype_test - Win32 Release" # Name "truetype_test - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\..\src\agg_bezier_arc.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_cbox_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_curves.cpp # End Source File # Begin Source File SOURCE=..\..\..\font_win32_tt\agg_font_win32_tt.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_gsv_text.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_platform_support.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_rbox_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\ctrl\agg_slider_ctrl.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_trans_affine.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_contour.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\agg_vcgen_stroke.cpp # End Source File # Begin Source File SOURCE=..\..\..\src\platform\win32\agg_win32_bmp.cpp # End Source File # Begin Source File SOURCE=..\..\truetype_test.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project ��������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api/truetype_test/truetype_test.dsw������������������������������������0000644�0000000�0000000�00000001010�10703246330�025236� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "truetype_test"=.\truetype_test.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api_dmc/���������������������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�017512� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/examples/win32_api_dmc/Makefile�������������������������������������������������������0000644�0000000�0000000�00000032764�10703246330�021166� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#============================================== # Digital Mars Makefile # # Modify this variable if necessary # DM = \dm\bin # CXX = $(DM)\dmc.exe -c -I..\..\include -I..\..\gpc -I..\..\font_win32_tt C = $(DM)\dmc.exe -c -o+speed -I..\..\gpc LINK = $(DM)\dmc.exe -L$(DM)\link.exe -L/SU:WINDOWS gdi32.lib LIB = $(DM)\lib.exe all: aa_demo.exe \ aa_test.exe \ alpha_gradient.exe \ alpha_mask.exe \ alpha_mask2.exe \ alpha_mask3.exe \ bezier_div.exe \ blur.exe \ blend_color.exe \ bspline.exe \ circles.exe \ component_rendering.exe \ compositing.exe \ compositing2.exe \ conv_contour.exe \ conv_dash_marker.exe \ conv_stroke.exe \ distortions.exe \ flash_rasterizer.exe \ flash_rasterizer2.exe \ gamma_correction.exe \ gamma_ctrl.exe \ gamma_tuner.exe \ gouraud.exe \ gouraud_mesh.exe \ gpc_test.exe \ gradient_focal.exe \ gradients.exe \ graph_test.exe \ idea.exe \ image1.exe \ image_alpha.exe \ image_filters.exe \ image_filters2.exe \ image_fltr_graph.exe \ image_perspective.exe \ image_resample.exe \ image_transforms.exe \ line_patterns.exe \ line_patterns_clip.exe \ lion.exe \ lion_lens.exe \ lion_outline.exe \ mol_view.exe \ multi_clip.exe \ pattern_fill.exe \ pattern_perspective.exe \ pattern_resample.exe \ perspective.exe \ polymorphic_renderer.exe \ rasterizers.exe \ rasterizers2.exe \ rasterizer_compound.exe \ raster_text.exe \ rounded_rect.exe \ scanline_boolean.exe \ scanline_boolean2.exe \ simple_blur.exe \ trans_curve1.exe \ trans_curve2.exe \ trans_polar.exe \ truetype_test.exe aa_demo.exe: aa_demo.obj agg.lib $(LINK) $** aa_demo.obj: ..\aa_demo.cpp $(CXX) $** -o$@ aa_test.exe: aa_test.obj agg.lib $(LINK) $** aa_test.obj: ..\aa_test.cpp $(CXX) $** -o$@ alpha_gradient.exe: alpha_gradient.obj agg.lib $(LINK) $** alpha_gradient.obj: ..\alpha_gradient.cpp $(CXX) $** -o$@ alpha_mask.exe: alpha_mask.obj parse_lion.obj agg.lib $(LINK) $** alpha_mask.obj: ..\alpha_mask.cpp $(CXX) $** -o$@ alpha_mask2.exe: alpha_mask2.obj parse_lion.obj agg.lib $(LINK) $** alpha_mask2.obj: ..\alpha_mask2.cpp $(CXX) $** -o$@ alpha_mask3.exe: alpha_mask3.obj make_arrows.obj make_gb_poly.obj agg.lib $(LINK) $** alpha_mask3.obj: ..\alpha_mask3.cpp $(CXX) $** -o$@ bezier_div.exe: bezier_div.obj agg.lib $(LINK) $** bezier_div.obj: ..\bezier_div.cpp $(CXX) $** -o$@ blur.exe: blur.obj agg.lib $(LINK) $** blur.obj: ..\blur.cpp $(CXX) $** -o$@ blend_color.exe: blend_color.obj agg.lib $(LINK) $** blend_color.obj: ..\blend_color.cpp $(CXX) $** -o$@ bspline.exe: bspline.obj interactive_polygon.obj agg.lib $(LINK) $** bspline.obj: ..\bspline.cpp $(CXX) $** -o$@ circles.exe: circles.obj agg.lib $(LINK) $** circles.obj: ..\circles.cpp $(CXX) $** -o$@ component_rendering.exe: component_rendering.obj agg.lib $(LINK) $** component_rendering.obj: ..\component_rendering.cpp $(CXX) $** -o$@ compositing.exe: compositing.obj agg.lib $(LINK) $** compositing.obj: ..\compositing.cpp $(CXX) $** -o$@ compositing2.exe: compositing2.obj agg.lib $(LINK) $** compositing2.obj: ..\compositing2.cpp $(CXX) $** -o$@ conv_contour.exe: conv_contour.obj agg.lib $(LINK) $** conv_contour.obj: ..\conv_contour.cpp $(CXX) $** -o$@ conv_dash_marker.exe: conv_dash_marker.obj agg.lib $(LINK) $** conv_dash_marker.obj: ..\conv_dash_marker.cpp $(CXX) $** -o$@ conv_stroke.exe: conv_stroke.obj agg.lib $(LINK) $** conv_stroke.obj: ..\conv_stroke.cpp $(CXX) $** -o$@ distortions.exe: distortions.obj agg.lib $(LINK) $** distortions.obj: ..\distortions.cpp $(CXX) $** -o$@ flash_rasterizer.exe: flash_rasterizer.obj agg.lib $(LINK) $** flash_rasterizer.obj: ..\flash_rasterizer.cpp $(CXX) $** -o$@ flash_rasterizer2.exe: flash_rasterizer2.obj agg.lib $(LINK) $** flash_rasterizer2.obj: ..\flash_rasterizer2.cpp $(CXX) $** -o$@ gamma_correction.exe: gamma_correction.obj agg.lib $(LINK) $** gamma_correction.obj: ..\gamma_correction.cpp $(CXX) $** -o$@ gamma_ctrl.exe: gamma_ctrl.obj agg.lib $(LINK) $** gamma_ctrl.obj: ..\gamma_ctrl.cpp $(CXX) $** -o$@ gamma_tuner.exe: gamma_tuner.obj agg.lib $(LINK) $** gamma_tuner.obj: ..\gamma_tuner.cpp $(CXX) $** -o$@ gouraud.exe: gouraud.obj agg.lib $(LINK) $** gouraud.obj: ..\gouraud.cpp $(CXX) $** -o$@ gouraud_mesh.exe: gouraud_mesh.obj agg.lib $(LINK) $** gouraud_mesh.obj: ..\gouraud_mesh.cpp $(CXX) $** -o$@ gpc_test.exe: gpc_test.obj make_arrows.obj make_gb_poly.obj agg.lib $(LINK) $** gpc_test.obj: ..\gpc_test.cpp $(CXX) $** -o$@ gradient_focal.exe: gradient_focal.obj agg.lib $(LINK) $** gradient_focal.obj: ..\gradient_focal.cpp $(CXX) $** -o$@ gradients.exe: gradients.obj agg.lib $(LINK) $** gradients.obj: ..\gradients.cpp $(CXX) $** -o$@ graph_test.exe: graph_test.obj agg.lib $(LINK) $** graph_test.obj: ..\graph_test.cpp $(CXX) $** -o$@ idea.exe: idea.obj agg.lib $(LINK) $** idea.obj: ..\idea.cpp $(CXX) $** -o$@ image1.exe: image1.obj agg.lib $(LINK) $** image1.obj: ..\image1.cpp $(CXX) $** -o$@ image_alpha.exe: image_alpha.obj agg.lib $(LINK) $** image_alpha.obj: ..\image_alpha.cpp $(CXX) $** -o$@ image_filters.exe: image_filters.obj agg.lib $(LINK) $** image_filters.obj: ..\image_filters.cpp $(CXX) $** -o$@ image_filters2.exe: image_filters2.obj agg.lib $(LINK) $** image_filters2.obj: ..\image_filters2.cpp $(CXX) $** -o$@ image_fltr_graph.exe: image_fltr_graph.obj agg.lib $(LINK) $** image_fltr_graph.obj: ..\image_fltr_graph.cpp $(CXX) $** -o$@ image_perspective.exe: image_perspective.obj interactive_polygon.obj agg.lib $(LINK) $** image_perspective.obj: ..\image_perspective.cpp $(CXX) $** -o$@ image_resample.exe: image_resample.obj interactive_polygon.obj agg.lib $(LINK) $** image_resample.obj: ..\image_resample.cpp $(CXX) $** -o$@ image_transforms.exe: image_transforms.obj agg.lib $(LINK) $** image_transforms.obj: ..\image_transforms.cpp $(CXX) $** -o$@ line_patterns.exe: line_patterns.obj agg.lib $(LINK) $** line_patterns.obj: ..\line_patterns.cpp $(CXX) $** -o$@ line_patterns_clip.exe: line_patterns_clip.obj agg.lib $(LINK) $** line_patterns_clip.obj: ..\line_patterns_clip.cpp $(CXX) $** -o$@ lion.exe: lion.obj parse_lion.obj agg.lib $(LINK) $** lion.obj: ..\lion.cpp $(CXX) $** -o$@ lion_lens.exe: lion_lens.obj parse_lion.obj agg.lib $(LINK) $** lion_lens.obj: ..\lion_lens.cpp $(CXX) $** -o$@ lion_outline.exe: lion_outline.obj parse_lion.obj agg.lib $(LINK) $** lion_outline.obj: ..\lion_outline.cpp $(CXX) $** -o$@ mol_view.exe: mol_view.obj agg.lib $(LINK) $** mol_view.obj: ..\mol_view.cpp $(CXX) $** -o$@ multi_clip.exe: multi_clip.obj parse_lion.obj agg.lib $(LINK) $** multi_clip.obj: ..\multi_clip.cpp $(CXX) $** -o$@ pattern_fill.exe: pattern_fill.obj agg.lib $(LINK) $** pattern_fill.obj: ..\pattern_fill.cpp $(CXX) $** -o$@ pattern_perspective.exe: pattern_perspective.obj interactive_polygon.obj agg.lib $(LINK) $** pattern_perspective.obj: ..\pattern_perspective.cpp $(CXX) $** -o$@ pattern_resample.exe: pattern_resample.obj interactive_polygon.obj agg.lib $(LINK) $** pattern_resample.obj: ..\pattern_resample.cpp $(CXX) $** -o$@ perspective.exe: perspective.obj parse_lion.obj interactive_polygon.obj agg.lib $(LINK) $** perspective.obj: ..\perspective.cpp $(CXX) $** -o$@ polymorphic_renderer.exe: polymorphic_renderer.obj agg.lib $(LINK) $** polymorphic_renderer.obj: ..\polymorphic_renderer.cpp $(CXX) $** -o$@ rasterizers.exe: rasterizers.obj agg.lib $(LINK) $** rasterizers.obj: ..\rasterizers.cpp $(CXX) $** -o$@ rasterizers2.exe: rasterizers2.obj agg.lib $(LINK) $** rasterizers2.obj: ..\rasterizers2.cpp $(CXX) $** -o$@ rasterizer_compound.exe: rasterizer_compound.obj agg.lib $(LINK) $** rasterizer_compound.obj: ..\rasterizer_compound.cpp $(CXX) $** -o$@ raster_text.exe: raster_text.obj agg.lib $(LINK) $** raster_text.obj: ..\raster_text.cpp $(CXX) $** -o$@ rounded_rect.exe: rounded_rect.obj agg.lib $(LINK) $** rounded_rect.obj: ..\rounded_rect.cpp $(CXX) $** -o$@ scanline_boolean.exe: scanline_boolean.obj interactive_polygon.obj agg.lib $(LINK) $** scanline_boolean.obj: ..\scanline_boolean.cpp $(CXX) $** -o$@ scanline_boolean2.exe: scanline_boolean2.obj make_arrows.obj make_gb_poly.obj agg.lib $(LINK) $** scanline_boolean2.obj: ..\scanline_boolean2.cpp $(CXX) $** -o$@ simple_blur.exe: simple_blur.obj parse_lion.obj agg.lib $(LINK) $** simple_blur.obj: ..\simple_blur.cpp $(CXX) $** -o$@ trans_curve1.exe: trans_curve1.obj interactive_polygon.obj agg.lib $(LINK) $** trans_curve1.obj: ..\trans_curve1.cpp $(CXX) $** -o$@ trans_curve2.exe: trans_curve2.obj interactive_polygon.obj agg.lib $(LINK) $** trans_curve2.obj: ..\trans_curve2.cpp $(CXX) $** -o$@ trans_polar.exe: trans_polar.obj agg.lib $(LINK) $** trans_polar.obj: ..\trans_polar.cpp $(CXX) $** -o$@ truetype_test.exe: truetype_test.obj agg.lib $(LINK) $** truetype_test.obj: ..\truetype_test.cpp $(CXX) $** -o$@ parse_lion.obj: ..\parse_lion.cpp $(CXX) $** -o$@ make_arrows.obj: ..\make_arrows.cpp $(CXX) $** -o$@ make_gb_poly.obj: ..\make_gb_poly.cpp $(CXX) $** -o$@ interactive_polygon.obj: ..\interactive_polygon.cpp $(CXX) $** -o$@ agg.lib: agg_arc.obj agg_arrowhead.obj agg_bezier_arc.obj agg_bspline.obj agg_curves.obj \ agg_embedded_raster_fonts.obj agg_gsv_text.obj agg_image_filters.obj \ agg_line_aa_basics.obj agg_line_profile_aa.obj agg_rounded_rect.obj \ agg_sqrt_tables.obj agg_trans_affine.obj agg_trans_double_path.obj \ agg_trans_single_path.obj agg_trans_warp_magnifier.obj agg_vcgen_bspline.obj \ agg_vcgen_contour.obj agg_vcgen_dash.obj agg_vcgen_markers_term.obj \ agg_vcgen_smooth_poly1.obj agg_vcgen_stroke.obj agg_vpgen_clip_polygon.obj \ agg_vpgen_clip_polyline.obj agg_vpgen_segmentator.obj agg_font_win32_tt.obj \ agg_bezier_ctrl.obj agg_cbox_ctrl.obj agg_gamma_ctrl.obj agg_gamma_spline.obj \ agg_polygon_ctrl.obj agg_rbox_ctrl.obj agg_scale_ctrl.obj agg_slider_ctrl.obj \ agg_spline_ctrl.obj agg_platform_support.obj agg_win32_bmp.obj gpc.obj $(LIB) -c $@ $** agg_arc.obj: ..\..\src\agg_arc.cpp $(CXX) $** -o$@ agg_arrowhead.obj: ..\..\src\agg_arrowhead.cpp $(CXX) $** -o$@ agg_bezier_arc.obj: ..\..\src\agg_bezier_arc.cpp $(CXX) $** -o$@ agg_bspline.obj: ..\..\src\agg_bspline.cpp $(CXX) $** -o$@ agg_curves.obj: ..\..\src\agg_curves.cpp $(CXX) $** -o$@ agg_embedded_raster_fonts.obj: ..\..\src\agg_embedded_raster_fonts.cpp $(CXX) $** -o$@ agg_gsv_text.obj: ..\..\src\agg_gsv_text.cpp $(CXX) $** -o$@ agg_image_filters.obj: ..\..\src\agg_image_filters.cpp $(CXX) $** -o$@ agg_line_aa_basics.obj: ..\..\src\agg_line_aa_basics.cpp $(CXX) $** -o$@ agg_line_profile_aa.obj: ..\..\src\agg_line_profile_aa.cpp $(CXX) $** -o$@ agg_rounded_rect.obj: ..\..\src\agg_rounded_rect.cpp $(CXX) $** -o$@ agg_sqrt_tables.obj: ..\..\src\agg_sqrt_tables.cpp $(CXX) $** -o$@ agg_trans_affine.obj: ..\..\src\agg_trans_affine.cpp $(CXX) $** -o$@ agg_trans_double_path.obj: ..\..\src\agg_trans_double_path.cpp $(CXX) $** -o$@ agg_trans_single_path.obj: ..\..\src\agg_trans_single_path.cpp $(CXX) $** -o$@ agg_trans_warp_magnifier.obj: ..\..\src\agg_trans_warp_magnifier.cpp $(CXX) $** -o$@ agg_vcgen_bspline.obj: ..\..\src\agg_vcgen_bspline.cpp $(CXX) $** -o$@ agg_vcgen_contour.obj: ..\..\src\agg_vcgen_contour.cpp $(CXX) $** -o$@ agg_vcgen_dash.obj: ..\..\src\agg_vcgen_dash.cpp $(CXX) $** -o$@ agg_vcgen_markers_term.obj: ..\..\src\agg_vcgen_markers_term.cpp $(CXX) $** -o$@ agg_vcgen_smooth_poly1.obj: ..\..\src\agg_vcgen_smooth_poly1.cpp $(CXX) $** -o$@ agg_vcgen_stroke.obj: ..\..\src\agg_vcgen_stroke.cpp $(CXX) $** -o$@ agg_vpgen_clip_polygon.obj: ..\..\src\agg_vpgen_clip_polygon.cpp $(CXX) $** -o$@ agg_vpgen_clip_polyline.obj: ..\..\src\agg_vpgen_clip_polyline.cpp $(CXX) $** -o$@ agg_vpgen_segmentator.obj: ..\..\src\agg_vpgen_segmentator.cpp $(CXX) $** -o$@ agg_font_win32_tt.obj: ..\..\font_win32_tt\agg_font_win32_tt.cpp $(CXX) $** -o$@ agg_bezier_ctrl.obj: ..\..\src\ctrl\agg_bezier_ctrl.cpp $(CXX) $** -o$@ agg_cbox_ctrl.obj: ..\..\src\ctrl\agg_cbox_ctrl.cpp $(CXX) $** -o$@ agg_gamma_ctrl.obj: ..\..\src\ctrl\agg_gamma_ctrl.cpp $(CXX) $** -o$@ agg_gamma_spline.obj: ..\..\src\ctrl\agg_gamma_spline.cpp $(CXX) $** -o$@ agg_polygon_ctrl.obj: ..\..\src\ctrl\agg_polygon_ctrl.cpp $(CXX) $** -o$@ agg_rbox_ctrl.obj: ..\..\src\ctrl\agg_rbox_ctrl.cpp $(CXX) $** -o$@ agg_scale_ctrl.obj: ..\..\src\ctrl\agg_scale_ctrl.cpp $(CXX) $** -o$@ agg_slider_ctrl.obj: ..\..\src\ctrl\agg_slider_ctrl.cpp $(CXX) $** -o$@ agg_spline_ctrl.obj: ..\..\src\ctrl\agg_spline_ctrl.cpp $(CXX) $** -o$@ agg_platform_support.obj: ..\..\src\platform\win32\agg_platform_support.cpp $(CXX) $** -o$@ agg_win32_bmp.obj: ..\..\src\platform\win32\agg_win32_bmp.cpp $(CXX) $** -o$@ gpc.obj: ..\..\gpc\gpc.c $(C) $(CFLAGS) $** -o$@ clean: del *.obj del agg.lib del *.exe del *.map ������������agg-2.5+dfsg1/examples/win32_api_dmc/readme���������������������������������������������������������0000644�0000000�0000000�00000001151�10703246330�020670� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������This is a makefile to build the demo examples with the Digital Mars C++. Visit http://digitalmars.com/ for more info and to download the compiler. The compiler is very easy in use and doesn't require any installation procedure. You just download and unzip it. Suppose you have unzipped it into the root directory: \dm\*.* That is, the full path to the compiler is \dm\bin\dmc.exe Then you simply run: \dm\bin\make That's it, it should build the examples, except for svg_test and freetype_test. If you have a different directory with the compiler please modify the Makefile accordingly (that's pertty easy). �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/font_freetype/������������������������������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�016127� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/font_freetype/Makefile.am�������������������������������������������������������������0000644�0000000�0000000�00000000535�10703246330�020166� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ if ENABLE_FT aggincludedir = $(includedir)/agg2 agginclude_HEADERS = agg_font_freetype.h lib_LTLIBRARIES = libaggfontfreetype.la libaggfontfreetype_la_LDFLAGS = -version-info @AGG_LIB_VERSION@ @FREETYPE_LIBS@ libaggfontfreetype_la_SOURCES = agg_font_freetype.cpp libaggfontfreetype_la_CXXFLAGS = -I$(top_srcdir)/include @FREETYPE_CFLAGS@ endif �������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/font_freetype/agg_font_freetype.cpp���������������������������������������������������0000644�0000000�0000000�00000124674�10703246330�022340� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #include <stdio.h> #include "agg_font_freetype.h" #include "agg_bitset_iterator.h" #include "agg_renderer_scanline.h" namespace agg { //------------------------------------------------------------------------------ // // This code implements the AUTODIN II polynomial // The variable corresponding to the macro argument "crc" should // be an unsigned long. // Oroginal code by Spencer Garrett <srg@quick.com> // // generated using the AUTODIN II polynomial // x^32 + x^26 + x^23 + x^22 + x^16 + // x^12 + x^11 + x^10 + x^8 + x^7 + x^5 + x^4 + x^2 + x^1 + 1 // //------------------------------------------------------------------------------ static const unsigned crc32tab[256] = { 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d, }; //------------------------------------------------------------------------------ static unsigned calc_crc32(const unsigned char* buf, unsigned size) { unsigned crc = (unsigned)~0; const unsigned char* p; unsigned len = 0; unsigned nr = size; for (len += nr, p = buf; nr--; ++p) { crc = (crc >> 8) ^ crc32tab[(crc ^ *p) & 0xff]; } return ~crc; } //------------------------------------------------------------------------ static inline int dbl_to_plain_fx(double d) { return int(d * 65536.0); } //------------------------------------------------------------------------ static inline double int26p6_to_dbl(int p) { return double(p) / 64.0; } //------------------------------------------------------------------------ static inline int dbl_to_int26p6(double p) { return int(p * 64.0 + 0.5); } //------------------------------------------------------------------------ template<class PathStorage> bool decompose_ft_outline(const FT_Outline& outline, bool flip_y, const trans_affine& mtx, PathStorage& path) { typedef typename PathStorage::value_type value_type; FT_Vector v_last; FT_Vector v_control; FT_Vector v_start; double x1, y1, x2, y2, x3, y3; FT_Vector* point; FT_Vector* limit; char* tags; int n; // index of contour in outline int first; // index of first point in contour char tag; // current point's state first = 0; for(n = 0; n < outline.n_contours; n++) { int last; // index of last point in contour last = outline.contours[n]; limit = outline.points + last; v_start = outline.points[first]; v_last = outline.points[last]; v_control = v_start; point = outline.points + first; tags = outline.tags + first; tag = FT_CURVE_TAG(tags[0]); // A contour cannot start with a cubic control point! if(tag == FT_CURVE_TAG_CUBIC) return false; // check first point to determine origin if( tag == FT_CURVE_TAG_CONIC) { // first point is conic control. Yes, this happens. if(FT_CURVE_TAG(outline.tags[last]) == FT_CURVE_TAG_ON) { // start at last point if it is on the curve v_start = v_last; limit--; } else { // if both first and last points are conic, // start at their middle and record its position // for closure v_start.x = (v_start.x + v_last.x) / 2; v_start.y = (v_start.y + v_last.y) / 2; v_last = v_start; } point--; tags--; } x1 = int26p6_to_dbl(v_start.x); y1 = int26p6_to_dbl(v_start.y); if(flip_y) y1 = -y1; mtx.transform(&x1, &y1); path.move_to(value_type(dbl_to_int26p6(x1)), value_type(dbl_to_int26p6(y1))); while(point < limit) { point++; tags++; tag = FT_CURVE_TAG(tags[0]); switch(tag) { case FT_CURVE_TAG_ON: // emit a single line_to { x1 = int26p6_to_dbl(point->x); y1 = int26p6_to_dbl(point->y); if(flip_y) y1 = -y1; mtx.transform(&x1, &y1); path.line_to(value_type(dbl_to_int26p6(x1)), value_type(dbl_to_int26p6(y1))); //path.line_to(conv(point->x), flip_y ? -conv(point->y) : conv(point->y)); continue; } case FT_CURVE_TAG_CONIC: // consume conic arcs { v_control.x = point->x; v_control.y = point->y; Do_Conic: if(point < limit) { FT_Vector vec; FT_Vector v_middle; point++; tags++; tag = FT_CURVE_TAG(tags[0]); vec.x = point->x; vec.y = point->y; if(tag == FT_CURVE_TAG_ON) { x1 = int26p6_to_dbl(v_control.x); y1 = int26p6_to_dbl(v_control.y); x2 = int26p6_to_dbl(vec.x); y2 = int26p6_to_dbl(vec.y); if(flip_y) { y1 = -y1; y2 = -y2; } mtx.transform(&x1, &y1); mtx.transform(&x2, &y2); path.curve3(value_type(dbl_to_int26p6(x1)), value_type(dbl_to_int26p6(y1)), value_type(dbl_to_int26p6(x2)), value_type(dbl_to_int26p6(y2))); continue; } if(tag != FT_CURVE_TAG_CONIC) return false; v_middle.x = (v_control.x + vec.x) / 2; v_middle.y = (v_control.y + vec.y) / 2; x1 = int26p6_to_dbl(v_control.x); y1 = int26p6_to_dbl(v_control.y); x2 = int26p6_to_dbl(v_middle.x); y2 = int26p6_to_dbl(v_middle.y); if(flip_y) { y1 = -y1; y2 = -y2; } mtx.transform(&x1, &y1); mtx.transform(&x2, &y2); path.curve3(value_type(dbl_to_int26p6(x1)), value_type(dbl_to_int26p6(y1)), value_type(dbl_to_int26p6(x2)), value_type(dbl_to_int26p6(y2))); //path.curve3(conv(v_control.x), // flip_y ? -conv(v_control.y) : conv(v_control.y), // conv(v_middle.x), // flip_y ? -conv(v_middle.y) : conv(v_middle.y)); v_control = vec; goto Do_Conic; } x1 = int26p6_to_dbl(v_control.x); y1 = int26p6_to_dbl(v_control.y); x2 = int26p6_to_dbl(v_start.x); y2 = int26p6_to_dbl(v_start.y); if(flip_y) { y1 = -y1; y2 = -y2; } mtx.transform(&x1, &y1); mtx.transform(&x2, &y2); path.curve3(value_type(dbl_to_int26p6(x1)), value_type(dbl_to_int26p6(y1)), value_type(dbl_to_int26p6(x2)), value_type(dbl_to_int26p6(y2))); //path.curve3(conv(v_control.x), // flip_y ? -conv(v_control.y) : conv(v_control.y), // conv(v_start.x), // flip_y ? -conv(v_start.y) : conv(v_start.y)); goto Close; } default: // FT_CURVE_TAG_CUBIC { FT_Vector vec1, vec2; if(point + 1 > limit || FT_CURVE_TAG(tags[1]) != FT_CURVE_TAG_CUBIC) { return false; } vec1.x = point[0].x; vec1.y = point[0].y; vec2.x = point[1].x; vec2.y = point[1].y; point += 2; tags += 2; if(point <= limit) { FT_Vector vec; vec.x = point->x; vec.y = point->y; x1 = int26p6_to_dbl(vec1.x); y1 = int26p6_to_dbl(vec1.y); x2 = int26p6_to_dbl(vec2.x); y2 = int26p6_to_dbl(vec2.y); x3 = int26p6_to_dbl(vec.x); y3 = int26p6_to_dbl(vec.y); if(flip_y) { y1 = -y1; y2 = -y2; y3 = -y3; } mtx.transform(&x1, &y1); mtx.transform(&x2, &y2); mtx.transform(&x3, &y3); path.curve4(value_type(dbl_to_int26p6(x1)), value_type(dbl_to_int26p6(y1)), value_type(dbl_to_int26p6(x2)), value_type(dbl_to_int26p6(y2)), value_type(dbl_to_int26p6(x3)), value_type(dbl_to_int26p6(y3))); //path.curve4(conv(vec1.x), // flip_y ? -conv(vec1.y) : conv(vec1.y), // conv(vec2.x), // flip_y ? -conv(vec2.y) : conv(vec2.y), // conv(vec.x), // flip_y ? -conv(vec.y) : conv(vec.y)); continue; } x1 = int26p6_to_dbl(vec1.x); y1 = int26p6_to_dbl(vec1.y); x2 = int26p6_to_dbl(vec2.x); y2 = int26p6_to_dbl(vec2.y); x3 = int26p6_to_dbl(v_start.x); y3 = int26p6_to_dbl(v_start.y); if(flip_y) { y1 = -y1; y2 = -y2; y3 = -y3; } mtx.transform(&x1, &y1); mtx.transform(&x2, &y2); mtx.transform(&x3, &y3); path.curve4(value_type(dbl_to_int26p6(x1)), value_type(dbl_to_int26p6(y1)), value_type(dbl_to_int26p6(x2)), value_type(dbl_to_int26p6(y2)), value_type(dbl_to_int26p6(x3)), value_type(dbl_to_int26p6(y3))); //path.curve4(conv(vec1.x), // flip_y ? -conv(vec1.y) : conv(vec1.y), // conv(vec2.x), // flip_y ? -conv(vec2.y) : conv(vec2.y), // conv(v_start.x), // flip_y ? -conv(v_start.y) : conv(v_start.y)); goto Close; } } } path.close_polygon(); Close: first = last + 1; } return true; } //------------------------------------------------------------------------ template<class Scanline, class ScanlineStorage> void decompose_ft_bitmap_mono(const FT_Bitmap& bitmap, int x, int y, bool flip_y, Scanline& sl, ScanlineStorage& storage) { int i; const int8u* buf = (const int8u*)bitmap.buffer; int pitch = bitmap.pitch; sl.reset(x, x + bitmap.width); storage.prepare(); if(flip_y) { buf += bitmap.pitch * (bitmap.rows - 1); y += bitmap.rows; pitch = -pitch; } for(i = 0; i < bitmap.rows; i++) { sl.reset_spans(); bitset_iterator bits(buf, 0); int j; for(j = 0; j < bitmap.width; j++) { if(bits.bit()) sl.add_cell(x + j, cover_full); ++bits; } buf += pitch; if(sl.num_spans()) { sl.finalize(y - i - 1); storage.render(sl); } } } //------------------------------------------------------------------------ template<class Rasterizer, class Scanline, class ScanlineStorage> void decompose_ft_bitmap_gray8(const FT_Bitmap& bitmap, int x, int y, bool flip_y, Rasterizer& ras, Scanline& sl, ScanlineStorage& storage) { int i, j; const int8u* buf = (const int8u*)bitmap.buffer; int pitch = bitmap.pitch; sl.reset(x, x + bitmap.width); storage.prepare(); if(flip_y) { buf += bitmap.pitch * (bitmap.rows - 1); y += bitmap.rows; pitch = -pitch; } for(i = 0; i < bitmap.rows; i++) { sl.reset_spans(); const int8u* p = buf; for(j = 0; j < bitmap.width; j++) { if(*p) sl.add_cell(x + j, ras.apply_gamma(*p)); ++p; } buf += pitch; if(sl.num_spans()) { sl.finalize(y - i - 1); storage.render(sl); } } } //------------------------------------------------------------------------ font_engine_freetype_base::~font_engine_freetype_base() { unsigned i; for(i = 0; i < m_num_faces; ++i) { delete [] m_face_names[i]; FT_Done_Face(m_faces[i]); } delete [] m_face_names; delete [] m_faces; delete [] m_signature; if(m_library_initialized) FT_Done_FreeType(m_library); } //------------------------------------------------------------------------ font_engine_freetype_base::font_engine_freetype_base(bool flag32, unsigned max_faces) : m_flag32(flag32), m_change_stamp(0), m_last_error(0), m_name(0), m_name_len(256-16-1), m_face_index(0), m_char_map(FT_ENCODING_NONE), m_signature(new char [256+256-16]), m_height(0), m_width(0), m_hinting(true), m_flip_y(false), m_library_initialized(false), m_library(0), m_faces(new FT_Face [max_faces]), m_face_names(new char* [max_faces]), m_num_faces(0), m_max_faces(max_faces), m_cur_face(0), m_resolution(0), m_glyph_rendering(glyph_ren_native_gray8), m_glyph_index(0), m_data_size(0), m_data_type(glyph_data_invalid), m_bounds(1,1,0,0), m_advance_x(0.0), m_advance_y(0.0), m_path16(), m_path32(), m_curves16(m_path16), m_curves32(m_path32), m_scanline_aa(), m_scanline_bin(), m_scanlines_aa(), m_scanlines_bin(), m_rasterizer() { m_curves16.approximation_scale(4.0); m_curves32.approximation_scale(4.0); m_last_error = FT_Init_FreeType(&m_library); if(m_last_error == 0) m_library_initialized = true; } //------------------------------------------------------------------------ void font_engine_freetype_base::resolution(unsigned dpi) { m_resolution = dpi; update_char_size(); } //------------------------------------------------------------------------ int font_engine_freetype_base::find_face(const char* face_name) const { unsigned i; for(i = 0; i < m_num_faces; ++i) { if(strcmp(face_name, m_face_names[i]) == 0) return i; } return -1; } //------------------------------------------------------------------------ double font_engine_freetype_base::ascender() const { if(m_cur_face) { return m_cur_face->ascender * height() / m_cur_face->height; } return 0.0; } //------------------------------------------------------------------------ double font_engine_freetype_base::descender() const { if(m_cur_face) { return m_cur_face->descender * height() / m_cur_face->height; } return 0.0; } //------------------------------------------------------------------------ bool font_engine_freetype_base::load_font(const char* font_name, unsigned face_index, glyph_rendering ren_type, const char* font_mem, const long font_mem_size) { bool ret = false; if(m_library_initialized) { m_last_error = 0; int idx = find_face(font_name); if(idx >= 0) { m_cur_face = m_faces[idx]; m_name = m_face_names[idx]; } else { if(m_num_faces >= m_max_faces) { delete [] m_face_names[0]; FT_Done_Face(m_faces[0]); memcpy(m_faces, m_faces + 1, (m_max_faces - 1) * sizeof(FT_Face)); memcpy(m_face_names, m_face_names + 1, (m_max_faces - 1) * sizeof(char*)); m_num_faces = m_max_faces - 1; } if (font_mem && font_mem_size) { m_last_error = FT_New_Memory_Face(m_library, (const FT_Byte*)font_mem, font_mem_size, face_index, &m_faces[m_num_faces]); } else { m_last_error = FT_New_Face(m_library, font_name, face_index, &m_faces[m_num_faces]); } if(m_last_error == 0) { m_face_names[m_num_faces] = new char [strlen(font_name) + 1]; strcpy(m_face_names[m_num_faces], font_name); m_cur_face = m_faces[m_num_faces]; m_name = m_face_names[m_num_faces]; ++m_num_faces; } else { m_face_names[m_num_faces] = 0; m_cur_face = 0; m_name = 0; } } if(m_last_error == 0) { ret = true; switch(ren_type) { case glyph_ren_native_mono: m_glyph_rendering = glyph_ren_native_mono; break; case glyph_ren_native_gray8: m_glyph_rendering = glyph_ren_native_gray8; break; case glyph_ren_outline: if(FT_IS_SCALABLE(m_cur_face)) { m_glyph_rendering = glyph_ren_outline; } else { m_glyph_rendering = glyph_ren_native_gray8; } break; case glyph_ren_agg_mono: if(FT_IS_SCALABLE(m_cur_face)) { m_glyph_rendering = glyph_ren_agg_mono; } else { m_glyph_rendering = glyph_ren_native_mono; } break; case glyph_ren_agg_gray8: if(FT_IS_SCALABLE(m_cur_face)) { m_glyph_rendering = glyph_ren_agg_gray8; } else { m_glyph_rendering = glyph_ren_native_gray8; } break; } update_signature(); } } return ret; } //------------------------------------------------------------------------ bool font_engine_freetype_base::attach(const char* file_name) { if(m_cur_face) { m_last_error = FT_Attach_File(m_cur_face, file_name); return m_last_error == 0; } return false; } //------------------------------------------------------------------------ unsigned font_engine_freetype_base::num_faces() const { if(m_cur_face) { return m_cur_face->num_faces; } return 0; } //------------------------------------------------------------------------ bool font_engine_freetype_base::char_map(FT_Encoding char_map) { if(m_cur_face) { m_last_error = FT_Select_Charmap(m_cur_face, m_char_map); if(m_last_error == 0) { update_signature(); return true; } } return false; } //------------------------------------------------------------------------ bool font_engine_freetype_base::height(double h) { m_height = int(h * 64.0); if(m_cur_face) { update_char_size(); return true; } return false; } //------------------------------------------------------------------------ bool font_engine_freetype_base::width(double w) { m_width = int(w * 64.0); if(m_cur_face) { update_char_size(); return true; } return false; } //------------------------------------------------------------------------ void font_engine_freetype_base::hinting(bool h) { m_hinting = h; if(m_cur_face) { update_signature(); } } //------------------------------------------------------------------------ void font_engine_freetype_base::flip_y(bool f) { m_flip_y = f; if(m_cur_face) { update_signature(); } } //------------------------------------------------------------------------ void font_engine_freetype_base::transform(const trans_affine& affine) { m_affine = affine; if(m_cur_face) { update_signature(); } } //------------------------------------------------------------------------ void font_engine_freetype_base::update_signature() { if(m_cur_face && m_name) { unsigned name_len = strlen(m_name); if(name_len > m_name_len) { delete [] m_signature; m_signature = new char [name_len + 32 + 256]; m_name_len = name_len + 32 - 1; } unsigned gamma_hash = 0; if(m_glyph_rendering == glyph_ren_native_gray8 || m_glyph_rendering == glyph_ren_agg_mono || m_glyph_rendering == glyph_ren_agg_gray8) { unsigned char gamma_table[rasterizer_scanline_aa<>::aa_scale]; unsigned i; for(i = 0; i < rasterizer_scanline_aa<>::aa_scale; ++i) { gamma_table[i] = m_rasterizer.apply_gamma(i); } gamma_hash = calc_crc32(gamma_table, sizeof(gamma_table)); } sprintf(m_signature, "%s,%u,%d,%d,%d:%dx%d,%d,%d,%08X", m_name, m_char_map, m_face_index, int(m_glyph_rendering), m_resolution, m_height, m_width, int(m_hinting), int(m_flip_y), gamma_hash); if(m_glyph_rendering == glyph_ren_outline || m_glyph_rendering == glyph_ren_agg_mono || m_glyph_rendering == glyph_ren_agg_gray8) { double mtx[6]; char buf[100]; m_affine.store_to(mtx); sprintf(buf, ",%08X%08X%08X%08X%08X%08X", dbl_to_plain_fx(mtx[0]), dbl_to_plain_fx(mtx[1]), dbl_to_plain_fx(mtx[2]), dbl_to_plain_fx(mtx[3]), dbl_to_plain_fx(mtx[4]), dbl_to_plain_fx(mtx[5])); strcat(m_signature, buf); } ++m_change_stamp; } } //------------------------------------------------------------------------ void font_engine_freetype_base::update_char_size() { if(m_cur_face) { if(m_resolution) { FT_Set_Char_Size(m_cur_face, m_width, // char_width in 1/64th of points m_height, // char_height in 1/64th of points m_resolution, // horizontal device resolution m_resolution); // vertical device resolution } else { FT_Set_Pixel_Sizes(m_cur_face, m_width >> 6, // pixel_width m_height >> 6); // pixel_height } update_signature(); } } //------------------------------------------------------------------------ bool font_engine_freetype_base::prepare_glyph(unsigned glyph_code) { m_glyph_index = FT_Get_Char_Index(m_cur_face, glyph_code); m_last_error = FT_Load_Glyph(m_cur_face, m_glyph_index, m_hinting ? FT_LOAD_DEFAULT : FT_LOAD_NO_HINTING); // m_hinting ? FT_LOAD_FORCE_AUTOHINT : FT_LOAD_NO_HINTING); if(m_last_error == 0) { switch(m_glyph_rendering) { case glyph_ren_native_mono: m_last_error = FT_Render_Glyph(m_cur_face->glyph, FT_RENDER_MODE_MONO); if(m_last_error == 0) { decompose_ft_bitmap_mono(m_cur_face->glyph->bitmap, m_cur_face->glyph->bitmap_left, m_flip_y ? -m_cur_face->glyph->bitmap_top : m_cur_face->glyph->bitmap_top, m_flip_y, m_scanline_bin, m_scanlines_bin); m_bounds.x1 = m_scanlines_bin.min_x(); m_bounds.y1 = m_scanlines_bin.min_y(); m_bounds.x2 = m_scanlines_bin.max_x() + 1; m_bounds.y2 = m_scanlines_bin.max_y() + 1; m_data_size = m_scanlines_bin.byte_size(); m_data_type = glyph_data_mono; m_advance_x = int26p6_to_dbl(m_cur_face->glyph->advance.x); m_advance_y = int26p6_to_dbl(m_cur_face->glyph->advance.y); return true; } break; case glyph_ren_native_gray8: m_last_error = FT_Render_Glyph(m_cur_face->glyph, FT_RENDER_MODE_NORMAL); if(m_last_error == 0) { decompose_ft_bitmap_gray8(m_cur_face->glyph->bitmap, m_cur_face->glyph->bitmap_left, m_flip_y ? -m_cur_face->glyph->bitmap_top : m_cur_face->glyph->bitmap_top, m_flip_y, m_rasterizer, m_scanline_aa, m_scanlines_aa); m_bounds.x1 = m_scanlines_aa.min_x(); m_bounds.y1 = m_scanlines_aa.min_y(); m_bounds.x2 = m_scanlines_aa.max_x() + 1; m_bounds.y2 = m_scanlines_aa.max_y() + 1; m_data_size = m_scanlines_aa.byte_size(); m_data_type = glyph_data_gray8; m_advance_x = int26p6_to_dbl(m_cur_face->glyph->advance.x); m_advance_y = int26p6_to_dbl(m_cur_face->glyph->advance.y); return true; } break; case glyph_ren_outline: if(m_last_error == 0) { if(m_flag32) { m_path32.remove_all(); if(decompose_ft_outline(m_cur_face->glyph->outline, m_flip_y, m_affine, m_path32)) { rect_d bnd = m_path32.bounding_rect(); m_data_size = m_path32.byte_size(); m_data_type = glyph_data_outline; m_bounds.x1 = int(floor(bnd.x1)); m_bounds.y1 = int(floor(bnd.y1)); m_bounds.x2 = int(ceil(bnd.x2)); m_bounds.y2 = int(ceil(bnd.y2)); m_advance_x = int26p6_to_dbl(m_cur_face->glyph->advance.x); m_advance_y = int26p6_to_dbl(m_cur_face->glyph->advance.y); m_affine.transform(&m_advance_x, &m_advance_y); return true; } } else { m_path16.remove_all(); if(decompose_ft_outline(m_cur_face->glyph->outline, m_flip_y, m_affine, m_path16)) { rect_d bnd = m_path16.bounding_rect(); m_data_size = m_path16.byte_size(); m_data_type = glyph_data_outline; m_bounds.x1 = int(floor(bnd.x1)); m_bounds.y1 = int(floor(bnd.y1)); m_bounds.x2 = int(ceil(bnd.x2)); m_bounds.y2 = int(ceil(bnd.y2)); m_advance_x = int26p6_to_dbl(m_cur_face->glyph->advance.x); m_advance_y = int26p6_to_dbl(m_cur_face->glyph->advance.y); m_affine.transform(&m_advance_x, &m_advance_y); return true; } } } return false; case glyph_ren_agg_mono: if(m_last_error == 0) { m_rasterizer.reset(); if(m_flag32) { m_path32.remove_all(); decompose_ft_outline(m_cur_face->glyph->outline, m_flip_y, m_affine, m_path32); m_rasterizer.add_path(m_curves32); } else { m_path16.remove_all(); decompose_ft_outline(m_cur_face->glyph->outline, m_flip_y, m_affine, m_path16); m_rasterizer.add_path(m_curves16); } m_scanlines_bin.prepare(); // Remove all render_scanlines(m_rasterizer, m_scanline_bin, m_scanlines_bin); m_bounds.x1 = m_scanlines_bin.min_x(); m_bounds.y1 = m_scanlines_bin.min_y(); m_bounds.x2 = m_scanlines_bin.max_x() + 1; m_bounds.y2 = m_scanlines_bin.max_y() + 1; m_data_size = m_scanlines_bin.byte_size(); m_data_type = glyph_data_mono; m_advance_x = int26p6_to_dbl(m_cur_face->glyph->advance.x); m_advance_y = int26p6_to_dbl(m_cur_face->glyph->advance.y); m_affine.transform(&m_advance_x, &m_advance_y); return true; } return false; case glyph_ren_agg_gray8: if(m_last_error == 0) { m_rasterizer.reset(); if(m_flag32) { m_path32.remove_all(); decompose_ft_outline(m_cur_face->glyph->outline, m_flip_y, m_affine, m_path32); m_rasterizer.add_path(m_curves32); } else { m_path16.remove_all(); decompose_ft_outline(m_cur_face->glyph->outline, m_flip_y, m_affine, m_path16); m_rasterizer.add_path(m_curves16); } m_scanlines_aa.prepare(); // Remove all render_scanlines(m_rasterizer, m_scanline_aa, m_scanlines_aa); m_bounds.x1 = m_scanlines_aa.min_x(); m_bounds.y1 = m_scanlines_aa.min_y(); m_bounds.x2 = m_scanlines_aa.max_x() + 1; m_bounds.y2 = m_scanlines_aa.max_y() + 1; m_data_size = m_scanlines_aa.byte_size(); m_data_type = glyph_data_gray8; m_advance_x = int26p6_to_dbl(m_cur_face->glyph->advance.x); m_advance_y = int26p6_to_dbl(m_cur_face->glyph->advance.y); m_affine.transform(&m_advance_x, &m_advance_y); return true; } return false; } } return false; } //------------------------------------------------------------------------ void font_engine_freetype_base::write_glyph_to(int8u* data) const { if(data && m_data_size) { switch(m_data_type) { default: return; case glyph_data_mono: m_scanlines_bin.serialize(data); break; case glyph_data_gray8: m_scanlines_aa.serialize(data); break; case glyph_data_outline: if(m_flag32) { m_path32.serialize(data); } else { m_path16.serialize(data); } break; case glyph_data_invalid: break; } } } //------------------------------------------------------------------------ bool font_engine_freetype_base::add_kerning(unsigned first, unsigned second, double* x, double* y) { if(m_cur_face && first && second && FT_HAS_KERNING(m_cur_face)) { FT_Vector delta; FT_Get_Kerning(m_cur_face, first, second, FT_KERNING_DEFAULT, &delta); double dx = int26p6_to_dbl(delta.x); double dy = int26p6_to_dbl(delta.y); if(m_glyph_rendering == glyph_ren_outline || m_glyph_rendering == glyph_ren_agg_mono || m_glyph_rendering == glyph_ren_agg_gray8) { m_affine.transform_2x2(&dx, &dy); } *x += dx; *y += dy; return true; } return false; } } ��������������������������������������������������������������������agg-2.5+dfsg1/font_freetype/agg_font_freetype.h�����������������������������������������������������0000644�0000000�0000000�00000020600�10703246330�021765� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_FONT_FREETYPE_INCLUDED #define AGG_FONT_FREETYPE_INCLUDED #include <ft2build.h> #include FT_FREETYPE_H #include "agg_scanline_storage_aa.h" #include "agg_scanline_storage_bin.h" #include "agg_scanline_u.h" #include "agg_scanline_bin.h" #include "agg_path_storage_integer.h" #include "agg_rasterizer_scanline_aa.h" #include "agg_conv_curve.h" #include "agg_font_cache_manager.h" #include "agg_trans_affine.h" namespace agg { //-----------------------------------------------font_engine_freetype_base class font_engine_freetype_base { public: //-------------------------------------------------------------------- typedef serialized_scanlines_adaptor_aa<int8u> gray8_adaptor_type; typedef serialized_scanlines_adaptor_bin mono_adaptor_type; typedef scanline_storage_aa8 scanlines_aa_type; typedef scanline_storage_bin scanlines_bin_type; //-------------------------------------------------------------------- ~font_engine_freetype_base(); font_engine_freetype_base(bool flag32, unsigned max_faces = 32); // Set font parameters //-------------------------------------------------------------------- void resolution(unsigned dpi); bool load_font(const char* font_name, unsigned face_index, glyph_rendering ren_type, const char* font_mem = 0, const long font_mem_size = 0); bool attach(const char* file_name); bool char_map(FT_Encoding map); bool height(double h); bool width(double w); void hinting(bool h); void flip_y(bool f); void transform(const trans_affine& affine); // Set Gamma //-------------------------------------------------------------------- template<class GammaF> void gamma(const GammaF& f) { m_rasterizer.gamma(f); } // Accessors //-------------------------------------------------------------------- int last_error() const { return m_last_error; } unsigned resolution() const { return m_resolution; } const char* name() const { return m_name; } unsigned num_faces() const; FT_Encoding char_map() const { return m_char_map; } double height() const { return double(m_height) / 64.0; } double width() const { return double(m_width) / 64.0; } double ascender() const; double descender() const; bool hinting() const { return m_hinting; } bool flip_y() const { return m_flip_y; } // Interface mandatory to implement for font_cache_manager //-------------------------------------------------------------------- const char* font_signature() const { return m_signature; } int change_stamp() const { return m_change_stamp; } bool prepare_glyph(unsigned glyph_code); unsigned glyph_index() const { return m_glyph_index; } unsigned data_size() const { return m_data_size; } glyph_data_type data_type() const { return m_data_type; } const rect_i& bounds() const { return m_bounds; } double advance_x() const { return m_advance_x; } double advance_y() const { return m_advance_y; } void write_glyph_to(int8u* data) const; bool add_kerning(unsigned first, unsigned second, double* x, double* y); private: font_engine_freetype_base(const font_engine_freetype_base&); const font_engine_freetype_base& operator = (const font_engine_freetype_base&); void update_char_size(); void update_signature(); int find_face(const char* face_name) const; bool m_flag32; int m_change_stamp; int m_last_error; char* m_name; unsigned m_name_len; unsigned m_face_index; FT_Encoding m_char_map; char* m_signature; unsigned m_height; unsigned m_width; bool m_hinting; bool m_flip_y; bool m_library_initialized; FT_Library m_library; // handle to library FT_Face* m_faces; // A pool of font faces char** m_face_names; unsigned m_num_faces; unsigned m_max_faces; FT_Face m_cur_face; // handle to the current face object int m_resolution; glyph_rendering m_glyph_rendering; unsigned m_glyph_index; unsigned m_data_size; glyph_data_type m_data_type; rect_i m_bounds; double m_advance_x; double m_advance_y; trans_affine m_affine; path_storage_integer<int16, 6> m_path16; path_storage_integer<int32, 6> m_path32; conv_curve<path_storage_integer<int16, 6> > m_curves16; conv_curve<path_storage_integer<int32, 6> > m_curves32; scanline_u8 m_scanline_aa; scanline_bin m_scanline_bin; scanlines_aa_type m_scanlines_aa; scanlines_bin_type m_scanlines_bin; rasterizer_scanline_aa<> m_rasterizer; }; //------------------------------------------------font_engine_freetype_int16 // This class uses values of type int16 (10.6 format) for the vector cache. // The vector cache is compact, but when rendering glyphs of height // more that 200 there integer overflow can occur. // class font_engine_freetype_int16 : public font_engine_freetype_base { public: typedef serialized_integer_path_adaptor<int16, 6> path_adaptor_type; typedef font_engine_freetype_base::gray8_adaptor_type gray8_adaptor_type; typedef font_engine_freetype_base::mono_adaptor_type mono_adaptor_type; typedef font_engine_freetype_base::scanlines_aa_type scanlines_aa_type; typedef font_engine_freetype_base::scanlines_bin_type scanlines_bin_type; font_engine_freetype_int16(unsigned max_faces = 32) : font_engine_freetype_base(false, max_faces) {} }; //------------------------------------------------font_engine_freetype_int32 // This class uses values of type int32 (26.6 format) for the vector cache. // The vector cache is twice larger than in font_engine_freetype_int16, // but it allows you to render glyphs of very large sizes. // class font_engine_freetype_int32 : public font_engine_freetype_base { public: typedef serialized_integer_path_adaptor<int32, 6> path_adaptor_type; typedef font_engine_freetype_base::gray8_adaptor_type gray8_adaptor_type; typedef font_engine_freetype_base::mono_adaptor_type mono_adaptor_type; typedef font_engine_freetype_base::scanlines_aa_type scanlines_aa_type; typedef font_engine_freetype_base::scanlines_bin_type scanlines_bin_type; font_engine_freetype_int32(unsigned max_faces = 32) : font_engine_freetype_base(true, max_faces) {} }; } #endif ��������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/font_win32_tt/������������������������������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�015755� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/font_win32_tt/Makefile.am�������������������������������������������������������������0000644�0000000�0000000�00000000762�10703246330�020016� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������## this needs more work, and is intended to work in a unix cross ## compilation toolchain, or in something like msys if ENABLE_WIN32_TT aggincludedir = $(includedir)/agg2 agginclude_HEADERS = agg_font_win32_tt.h lib_LTLIBRARIES = libaggfontwin32tt.la libaggfontwin32tt_la_LDFLAGS = -no-undefined -version-info @AGG_LIB_VERSION@ @WINDOWS_LIBS@ ../src/libagg.la libaggfontwin32tt_la_SOURCES = agg_font_win32_tt.cpp libaggfontwin32tt_la_CXXFLAGS = -I$(top_srcdir)/include @WINDOWS_CFLAGS@ endif ��������������agg-2.5+dfsg1/font_win32_tt/agg_font_win32_tt.cpp���������������������������������������������������0000644�0000000�0000000�00000106571�10703246330�022010� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #include <stdio.h> #include "agg_font_win32_tt.h" #include "agg_bitset_iterator.h" #include "agg_renderer_scanline.h" #ifdef AGG_WIN9X_COMPLIANT #define GetGlyphOutlineX GetGlyphOutline #else #define GetGlyphOutlineX GetGlyphOutlineW #endif namespace agg { //------------------------------------------------------------------------------ // // This code implements the AUTODIN II polynomial // The variable corresponding to the macro argument "crc" should // be an unsigned long. // Oroginal code by Spencer Garrett <srg@quick.com> // // generated using the AUTODIN II polynomial // x^32 + x^26 + x^23 + x^22 + x^16 + // x^12 + x^11 + x^10 + x^8 + x^7 + x^5 + x^4 + x^2 + x^1 + 1 // //------------------------------------------------------------------------------ static const unsigned crc32tab[256] = { 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d, }; //------------------------------------------------------------------------------ static unsigned calc_crc32(const unsigned char* buf, unsigned size) { unsigned crc = (unsigned)~0; const unsigned char* p; unsigned len = 0; unsigned nr = size; for (len += nr, p = buf; nr--; ++p) { crc = (crc >> 8) ^ crc32tab[(crc ^ *p) & 0xff]; } return ~crc; } //------------------------------------------------------------------------ static inline FIXED dbl_to_fx(double d) { int l; l = int(d * 65536.0); return *(FIXED*)&l; } //------------------------------------------------------------------------ static inline int dbl_to_plain_fx(double d) { return int(d * 65536.0); } //------------------------------------------------------------------------ static inline FIXED negate_fx(const FIXED& fx) { int l = -(*(int*)(&fx)); return *(FIXED*)&l; } //------------------------------------------------------------------------ static inline double fx_to_dbl(const FIXED& p) { return double(p.value) + double(p.fract) * (1.0 / 65536.0); } //------------------------------------------------------------------------ static inline int fx_to_plain_int(const FIXED& fx) { return *(int*)(&fx); } //------------------------------------------------------------------------ static inline int fx_to_int26p6(const FIXED& p) { return (int(p.value) << 6) + (int(p.fract) >> 10); } //------------------------------------------------------------------------ static inline int dbl_to_int26p6(double p) { return int(p * 64.0 + 0.5); } //------------------------------------------------------------------------ template<class Scanline, class ScanlineStorage> void decompose_win32_glyph_bitmap_mono(const char* gbuf, int w, int h, int x, int y, bool flip_y, Scanline& sl, ScanlineStorage& storage) { int i; int pitch = ((w + 31) >> 5) << 2; const int8u* buf = (const int8u*)gbuf; sl.reset(x, x + w); storage.prepare(); if(flip_y) { buf += pitch * (h - 1); y += h; pitch = -pitch; } for(i = 0; i < h; i++) { sl.reset_spans(); bitset_iterator bits(buf, 0); int j; for(j = 0; j < w; j++) { if(bits.bit()) sl.add_cell(x + j, cover_full); ++bits; } buf += pitch; if(sl.num_spans()) { sl.finalize(y - i - 1); storage.render(sl); } } } //------------------------------------------------------------------------ template<class Rasterizer, class Scanline, class ScanlineStorage> void decompose_win32_glyph_bitmap_gray8(const char* gbuf, int w, int h, int x, int y, bool flip_y, Rasterizer& ras, Scanline& sl, ScanlineStorage& storage) { int i, j; int pitch = ((w + 3) >> 2) << 2; const int8u* buf = (const int8u*)gbuf; sl.reset(x, x + w); storage.prepare(); if(flip_y) { buf += pitch * (h - 1); y += h; pitch = -pitch; } for(i = 0; i < h; i++) { sl.reset_spans(); const int8u* p = buf; for(j = 0; j < w; j++) { if(*p) { unsigned v = *p; if(v == 64) v = 255; else v <<= 2; sl.add_cell(x + j, ras.apply_gamma(v)); } ++p; } buf += pitch; if(sl.num_spans()) { sl.finalize(y - i - 1); storage.render(sl); } } } //------------------------------------------------------------------------ template<class PathStorage> bool decompose_win32_glyph_outline(const char* gbuf, unsigned total_size, bool flip_y, const trans_affine& mtx, PathStorage& path) { const char* cur_glyph = gbuf; const char* end_glyph = gbuf + total_size; double x, y; typedef typename PathStorage::value_type value_type; while(cur_glyph < end_glyph) { const TTPOLYGONHEADER* th = (TTPOLYGONHEADER*)cur_glyph; const char* end_poly = cur_glyph + th->cb; const char* cur_poly = cur_glyph + sizeof(TTPOLYGONHEADER); x = fx_to_dbl(th->pfxStart.x); y = fx_to_dbl(th->pfxStart.y); if(flip_y) y = -y; mtx.transform(&x, &y); path.move_to(value_type(dbl_to_int26p6(x)), value_type(dbl_to_int26p6(y))); while(cur_poly < end_poly) { const TTPOLYCURVE* pc = (const TTPOLYCURVE*)cur_poly; if (pc->wType == TT_PRIM_LINE) { int i; for (i = 0; i < pc->cpfx; i++) { x = fx_to_dbl(pc->apfx[i].x); y = fx_to_dbl(pc->apfx[i].y); if(flip_y) y = -y; mtx.transform(&x, &y); path.line_to(value_type(dbl_to_int26p6(x)), value_type(dbl_to_int26p6(y))); } } if (pc->wType == TT_PRIM_QSPLINE) { int u; for (u = 0; u < pc->cpfx - 1; u++) // Walk through points in spline { POINTFX pnt_b = pc->apfx[u]; // B is always the current point POINTFX pnt_c = pc->apfx[u+1]; if (u < pc->cpfx - 2) // If not on last spline, compute C { // midpoint (x,y) *(int*)&pnt_c.x = (*(int*)&pnt_b.x + *(int*)&pnt_c.x) / 2; *(int*)&pnt_c.y = (*(int*)&pnt_b.y + *(int*)&pnt_c.y) / 2; } double x2, y2; x = fx_to_dbl(pnt_b.x); y = fx_to_dbl(pnt_b.y); x2 = fx_to_dbl(pnt_c.x); y2 = fx_to_dbl(pnt_c.y); if(flip_y) { y = -y; y2 = -y2; } mtx.transform(&x, &y); mtx.transform(&x2, &y2); path.curve3(value_type(dbl_to_int26p6(x)), value_type(dbl_to_int26p6(y)), value_type(dbl_to_int26p6(x2)), value_type(dbl_to_int26p6(y2))); } } cur_poly += sizeof(WORD) * 2 + sizeof(POINTFX) * pc->cpfx; } cur_glyph += th->cb; } return true; } //------------------------------------------------------------------------ font_engine_win32_tt_base::~font_engine_win32_tt_base() { delete [] m_kerning_pairs; delete [] m_gbuf; delete [] m_signature; delete [] m_typeface; if(m_dc && m_old_font) ::SelectObject(m_dc, m_old_font); unsigned i; for(i = 0; i < m_num_fonts; ++i) { delete [] m_font_names[i]; ::DeleteObject(m_fonts[i]); } delete [] m_font_names; delete [] m_fonts; } //------------------------------------------------------------------------ font_engine_win32_tt_base::font_engine_win32_tt_base(bool flag32, HDC dc, unsigned max_fonts) : m_flag32(flag32), m_dc(dc), m_old_font(m_dc ? (HFONT)::GetCurrentObject(m_dc, OBJ_FONT) : 0), m_fonts(new HFONT [max_fonts]), m_num_fonts(0), m_max_fonts(max_fonts), m_font_names(new char* [max_fonts]), m_cur_font(0), m_change_stamp(0), m_typeface(new char [256-16]), m_typeface_len(256-16-1), m_signature(new char [256+256-16]), m_height(0), m_width(0), m_weight(FW_REGULAR), m_italic(false), m_char_set(DEFAULT_CHARSET), m_pitch_and_family(FF_DONTCARE), m_hinting(true), m_flip_y(false), m_font_created(false), m_resolution(0), m_glyph_rendering(glyph_ren_native_gray8), m_glyph_index(0), m_data_size(0), m_data_type(glyph_data_invalid), m_bounds(1,1,0,0), m_advance_x(0.0), m_advance_y(0.0), m_gbuf(new char [buf_size]), m_kerning_pairs(0), m_num_kerning_pairs(0), m_max_kerning_pairs(0), m_path16(), m_path32(), m_curves16(m_path16), m_curves32(m_path32), m_scanline_aa(), m_scanline_bin(), m_scanlines_aa(), m_scanlines_bin(), m_rasterizer() { m_curves16.approximation_scale(4.0); m_curves32.approximation_scale(4.0); memset(&m_matrix, 0, sizeof(m_matrix)); m_matrix.eM11.value = 1; m_matrix.eM22.value = 1; } //------------------------------------------------------------------------ int font_engine_win32_tt_base::find_font(const char* name) const { unsigned i; for(i = 0; i < m_num_fonts; ++i) { if(strcmp(name, m_font_names[i]) == 0) return i; } return -1; } //------------------------------------------------------------------------ bool font_engine_win32_tt_base::create_font(const char* typeface_, glyph_rendering ren_type) { if(m_dc) { unsigned len = strlen(typeface_); if(len > m_typeface_len) { delete [] m_signature; delete [] m_typeface; m_typeface = new char [len + 32]; m_signature = new char [len + 32 + 256]; m_typeface_len = len + 32 - 1; } strcpy(m_typeface, typeface_); int h = m_height; int w = m_width; if(m_resolution) { h = ::MulDiv(m_height, m_resolution, 72); w = ::MulDiv(m_width, m_resolution, 72); } m_glyph_rendering = ren_type; update_signature(); int idx = find_font(m_signature); if(idx >= 0) { m_cur_font = m_fonts[idx]; ::SelectObject(m_dc, m_cur_font); m_num_kerning_pairs = 0; return true; } else { m_cur_font = ::CreateFont(-h, // height of font w, // average character width 0, // angle of escapement 0, // base-line orientation angle m_weight, // font weight m_italic, // italic attribute option 0, // underline attribute option 0, // strikeout attribute option m_char_set, // character set identifier OUT_DEFAULT_PRECIS, // output precision CLIP_DEFAULT_PRECIS, // clipping precision ANTIALIASED_QUALITY, // output quality m_pitch_and_family, // pitch and family m_typeface); // typeface name if(m_cur_font) { if(m_num_fonts >= m_max_fonts) { delete [] m_font_names[0]; if(m_old_font) ::SelectObject(m_dc, m_old_font); ::DeleteObject(m_fonts[0]); memcpy(m_fonts, m_fonts + 1, (m_max_fonts - 1) * sizeof(HFONT)); memcpy(m_font_names, m_font_names + 1, (m_max_fonts - 1) * sizeof(char*)); m_num_fonts = m_max_fonts - 1; } update_signature(); m_font_names[m_num_fonts] = new char[strlen(m_signature) + 1]; strcpy(m_font_names[m_num_fonts], m_signature); m_fonts[m_num_fonts] = m_cur_font; ++m_num_fonts; ::SelectObject(m_dc, m_cur_font); m_num_kerning_pairs = 0; return true; } } } return false; } //------------------------------------------------------------------------ bool font_engine_win32_tt_base::create_font(const char* typeface_, glyph_rendering ren_type, double height_, double width_, int weight_, bool italic_, DWORD char_set_, DWORD pitch_and_family_) { height(height_); width(width_); weight(weight_); italic(italic_); char_set(char_set_); pitch_and_family(pitch_and_family_); return create_font(typeface_, ren_type); } //------------------------------------------------------------------------ void font_engine_win32_tt_base::update_signature() { m_signature[0] = 0; if(m_dc && m_cur_font) { unsigned gamma_hash = 0; if(m_glyph_rendering == glyph_ren_native_gray8 || m_glyph_rendering == glyph_ren_agg_mono || m_glyph_rendering == glyph_ren_agg_gray8) { unsigned char gamma_table[rasterizer_scanline_aa<>::aa_scale]; unsigned i; for(i = 0; i < rasterizer_scanline_aa<>::aa_scale; ++i) { gamma_table[i] = m_rasterizer.apply_gamma(i); } gamma_hash = calc_crc32(gamma_table, sizeof(gamma_table)); } sprintf(m_signature, "%s,%u,%d,%d:%dx%d,%d,%d,%d,%d,%d,%08X", m_typeface, m_char_set, int(m_glyph_rendering), m_resolution, m_height, m_width, m_weight, int(m_italic), int(m_hinting), int(m_flip_y), int(m_pitch_and_family), gamma_hash); if(m_glyph_rendering == glyph_ren_outline || m_glyph_rendering == glyph_ren_agg_mono || m_glyph_rendering == glyph_ren_agg_gray8) { double mtx[6]; char buf[100]; m_affine.store_to(mtx); sprintf(buf, ",%08X%08X%08X%08X%08X%08X", dbl_to_plain_fx(mtx[0]), dbl_to_plain_fx(mtx[1]), dbl_to_plain_fx(mtx[2]), dbl_to_plain_fx(mtx[3]), dbl_to_plain_fx(mtx[4]), dbl_to_plain_fx(mtx[5])); strcat(m_signature, buf); } ++m_change_stamp; } } //------------------------------------------------------------------------ bool font_engine_win32_tt_base::prepare_glyph(unsigned glyph_code) { if(m_dc && m_cur_font) { int format = GGO_BITMAP; switch(m_glyph_rendering) { case glyph_ren_native_gray8: format = GGO_GRAY8_BITMAP; break; case glyph_ren_outline: case glyph_ren_agg_mono: case glyph_ren_agg_gray8: format = GGO_NATIVE; break; } #ifndef GGO_UNHINTED // For compatibility with old SDKs. #define GGO_UNHINTED 0x0100 #endif if(!m_hinting) format |= GGO_UNHINTED; GLYPHMETRICS gm; int total_size = GetGlyphOutlineX(m_dc, glyph_code, format, &gm, buf_size, (void*)m_gbuf, &m_matrix); if(total_size < 0) { // GetGlyphOutline() fails when being called for // GGO_GRAY8_BITMAP and white space (stupid Microsoft). // It doesn't even initialize the glyph metrics // structure. So, we have to query the metrics // separately (basically we need gmCellIncX). int total_size = GetGlyphOutlineX(m_dc, glyph_code, GGO_METRICS, &gm, buf_size, (void*)m_gbuf, &m_matrix); if(total_size < 0) return false; gm.gmBlackBoxX = gm.gmBlackBoxY = 0; total_size = 0; } m_glyph_index = glyph_code; m_advance_x = gm.gmCellIncX; m_advance_y = -gm.gmCellIncY; switch(m_glyph_rendering) { case glyph_ren_native_mono: decompose_win32_glyph_bitmap_mono(m_gbuf, gm.gmBlackBoxX, gm.gmBlackBoxY, gm.gmptGlyphOrigin.x, m_flip_y ? -gm.gmptGlyphOrigin.y : gm.gmptGlyphOrigin.y, m_flip_y, m_scanline_bin, m_scanlines_bin); m_bounds.x1 = m_scanlines_bin.min_x(); m_bounds.y1 = m_scanlines_bin.min_y(); m_bounds.x2 = m_scanlines_bin.max_x() + 1; m_bounds.y2 = m_scanlines_bin.max_y() + 1; m_data_size = m_scanlines_bin.byte_size(); m_data_type = glyph_data_mono; return true; case glyph_ren_native_gray8: decompose_win32_glyph_bitmap_gray8(m_gbuf, gm.gmBlackBoxX, gm.gmBlackBoxY, gm.gmptGlyphOrigin.x, m_flip_y ? -gm.gmptGlyphOrigin.y : gm.gmptGlyphOrigin.y, m_flip_y, m_rasterizer, m_scanline_aa, m_scanlines_aa); m_bounds.x1 = m_scanlines_aa.min_x(); m_bounds.y1 = m_scanlines_aa.min_y(); m_bounds.x2 = m_scanlines_aa.max_x() + 1; m_bounds.y2 = m_scanlines_aa.max_y() + 1; m_data_size = m_scanlines_aa.byte_size(); m_data_type = glyph_data_gray8; return true; case glyph_ren_outline: m_affine.transform(&m_advance_x, &m_advance_y); if(m_flag32) { m_path32.remove_all(); if(decompose_win32_glyph_outline(m_gbuf, total_size, m_flip_y, m_affine, m_path32)) { rect_d bnd = m_path32.bounding_rect(); m_data_size = m_path32.byte_size(); m_data_type = glyph_data_outline; m_bounds.x1 = int(floor(bnd.x1)); m_bounds.y1 = int(floor(bnd.y1)); m_bounds.x2 = int(ceil(bnd.x2)); m_bounds.y2 = int(ceil(bnd.y2)); return true; } } else { m_path16.remove_all(); if(decompose_win32_glyph_outline(m_gbuf, total_size, m_flip_y, m_affine, m_path16)) { rect_d bnd = m_path16.bounding_rect(); m_data_size = m_path16.byte_size(); m_data_type = glyph_data_outline; m_bounds.x1 = int(floor(bnd.x1)); m_bounds.y1 = int(floor(bnd.y1)); m_bounds.x2 = int(ceil(bnd.x2)); m_bounds.y2 = int(ceil(bnd.y2)); return true; } } break; case glyph_ren_agg_mono: m_rasterizer.reset(); m_affine.transform(&m_advance_x, &m_advance_y); if(m_flag32) { m_path32.remove_all(); decompose_win32_glyph_outline(m_gbuf, total_size, m_flip_y, m_affine, m_path32); m_rasterizer.add_path(m_curves32); } else { m_path16.remove_all(); decompose_win32_glyph_outline(m_gbuf, total_size, m_flip_y, m_affine, m_path16); m_rasterizer.add_path(m_curves16); } m_scanlines_bin.prepare(); // Remove all render_scanlines(m_rasterizer, m_scanline_bin, m_scanlines_bin); m_bounds.x1 = m_scanlines_bin.min_x(); m_bounds.y1 = m_scanlines_bin.min_y(); m_bounds.x2 = m_scanlines_bin.max_x() + 1; m_bounds.y2 = m_scanlines_bin.max_y() + 1; m_data_size = m_scanlines_bin.byte_size(); m_data_type = glyph_data_mono; return true; case glyph_ren_agg_gray8: m_rasterizer.reset(); m_affine.transform(&m_advance_x, &m_advance_y); if(m_flag32) { m_path32.remove_all(); decompose_win32_glyph_outline(m_gbuf, total_size, m_flip_y, m_affine, m_path32); m_rasterizer.add_path(m_curves32); } else { m_path16.remove_all(); decompose_win32_glyph_outline(m_gbuf, total_size, m_flip_y, m_affine, m_path16); m_rasterizer.add_path(m_curves16); } m_scanlines_aa.prepare(); // Remove all render_scanlines(m_rasterizer, m_scanline_aa, m_scanlines_aa); m_bounds.x1 = m_scanlines_aa.min_x(); m_bounds.y1 = m_scanlines_aa.min_y(); m_bounds.x2 = m_scanlines_aa.max_x() + 1; m_bounds.y2 = m_scanlines_aa.max_y() + 1; m_data_size = m_scanlines_aa.byte_size(); m_data_type = glyph_data_gray8; return true; } } return false; } //------------------------------------------------------------------------ void font_engine_win32_tt_base::write_glyph_to(int8u* data) const { if(data && m_data_size) { switch(m_data_type) { case glyph_data_mono: m_scanlines_bin.serialize(data); break; case glyph_data_gray8: m_scanlines_aa.serialize(data); break; case glyph_data_outline: if(m_flag32) { m_path32.serialize(data); } else { m_path16.serialize(data); } break; } } } //------------------------------------------------------------------------ static bool pair_less(const KERNINGPAIR& v1, const KERNINGPAIR& v2) { if(v1.wFirst != v2.wFirst) return v1.wFirst < v2.wFirst; return v1.wSecond < v2.wSecond; } //------------------------------------------------------------------------ void font_engine_win32_tt_base::sort_kerning_pairs() { pod_array_adaptor<KERNINGPAIR> pairs(m_kerning_pairs, m_num_kerning_pairs); quick_sort(pairs, pair_less); } //------------------------------------------------------------------------ void font_engine_win32_tt_base::load_kerning_pairs() { if(m_dc && m_cur_font) { if(m_kerning_pairs == 0) { m_kerning_pairs = new KERNINGPAIR [16384-16]; m_max_kerning_pairs = 16384-16; } m_num_kerning_pairs = ::GetKerningPairs(m_dc, m_max_kerning_pairs, m_kerning_pairs); if(m_num_kerning_pairs) { // Check to see if the kerning pairs are sorted and // sort them if they are not. //---------------- unsigned i; for(i = 1; i < m_num_kerning_pairs; ++i) { if(!pair_less(m_kerning_pairs[i - 1], m_kerning_pairs[i])) { sort_kerning_pairs(); break; } } } } } //------------------------------------------------------------------------ bool font_engine_win32_tt_base::add_kerning(unsigned first, unsigned second, double* x, double* y) { if(m_dc && m_cur_font) { if(m_num_kerning_pairs == 0) { load_kerning_pairs(); } int end = m_num_kerning_pairs - 1; int beg = 0; KERNINGPAIR t; t.wFirst = (WORD)first; t.wSecond = (WORD)second; while(beg <= end) { int mid = (end + beg) / 2; if(m_kerning_pairs[mid].wFirst == t.wFirst && m_kerning_pairs[mid].wSecond == t.wSecond) { double dx = m_kerning_pairs[mid].iKernAmount; double dy = 0.0; if(m_glyph_rendering == glyph_ren_outline || m_glyph_rendering == glyph_ren_agg_mono || m_glyph_rendering == glyph_ren_agg_gray8) { m_affine.transform_2x2(&dx, &dy); } *x += dx; *y += dy; return true; } else if(pair_less(t, m_kerning_pairs[mid])) { end = mid - 1; } else { beg = mid + 1; } } return false; } return false; } } ���������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/font_win32_tt/agg_font_win32_tt.h�����������������������������������������������������0000644�0000000�0000000�00000022603�10703246330�021446� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_FONT_WIN32_TT_INCLUDED #define AGG_FONT_WIN32_TT_INCLUDED #include <windows.h> #include "agg_scanline_storage_aa.h" #include "agg_scanline_storage_bin.h" #include "agg_scanline_u.h" #include "agg_scanline_bin.h" #include "agg_path_storage_integer.h" #include "agg_rasterizer_scanline_aa.h" #include "agg_conv_curve.h" #include "agg_trans_affine.h" #include "agg_font_cache_manager.h" namespace agg { //-----------------------------------------------font_engine_win32_tt_base class font_engine_win32_tt_base { enum { buf_size = 32768-32 }; public: //-------------------------------------------------------------------- typedef serialized_scanlines_adaptor_aa<int8u> gray8_adaptor_type; typedef serialized_scanlines_adaptor_bin mono_adaptor_type; typedef scanline_storage_aa8 scanlines_aa_type; typedef scanline_storage_bin scanlines_bin_type; //-------------------------------------------------------------------- ~font_engine_win32_tt_base(); font_engine_win32_tt_base(bool flag32, HDC dc, unsigned max_fonts = 32); // Set font parameters //-------------------------------------------------------------------- void resolution(unsigned dpi) { m_resolution = unsigned(dpi); } void height(double h) { m_height = unsigned(h); } void width(double w) { m_width = unsigned(w); } void weight(int w) { m_weight = w; } void italic(bool it) { m_italic = it; } void char_set(DWORD c) { m_char_set = c; } void pitch_and_family(DWORD p){ m_pitch_and_family = p; } void flip_y(bool flip) { m_flip_y = flip; } void hinting(bool h) { m_hinting = h; } bool create_font(const char* typeface_, glyph_rendering ren_type); bool create_font(const char* typeface_, glyph_rendering ren_type, double height_, double width_=0.0, int weight_=FW_REGULAR, bool italic_=false, DWORD char_set_=ANSI_CHARSET, DWORD pitch_and_family_=FF_DONTCARE); // Set Gamma //-------------------------------------------------------------------- template<class GammaF> void gamma(const GammaF& f) { m_rasterizer.gamma(f); } //-------------------------------------------------------------------- void transform(const agg::trans_affine& mtx) { m_affine = mtx; } // Accessors //-------------------------------------------------------------------- unsigned resolution() const { return m_resolution; } const char* typeface() const { return m_typeface; } double height() const { return m_height; } double width() const { return m_width; } int weight() const { return m_weight; } bool italic() const { return m_italic; } DWORD char_set() const { return m_char_set; } DWORD pitch_and_family() const { return m_pitch_and_family; } bool hinting() const { return m_hinting; } bool flip_y() const { return m_flip_y; } // Interface mandatory to implement for font_cache_manager //-------------------------------------------------------------------- const char* font_signature() const { return m_signature; } int change_stamp() const { return m_change_stamp; } bool prepare_glyph(unsigned glyph_code); unsigned glyph_index() const { return m_glyph_index; } unsigned data_size() const { return m_data_size; } glyph_data_type data_type() const { return m_data_type; } const rect_i& bounds() const { return m_bounds; } double advance_x() const { return m_advance_x; } double advance_y() const { return m_advance_y; } void write_glyph_to(int8u* data) const; bool add_kerning(unsigned first, unsigned second, double* x, double* y); private: font_engine_win32_tt_base(const font_engine_win32_tt_base&); const font_engine_win32_tt_base& operator = (const font_engine_win32_tt_base&); void update_signature(); void load_kerning_pairs(); void sort_kerning_pairs(); int find_font(const char* name) const; bool m_flag32; HDC m_dc; HFONT m_old_font; HFONT* m_fonts; unsigned m_num_fonts; unsigned m_max_fonts; char** m_font_names; HFONT m_cur_font; int m_change_stamp; char* m_typeface; unsigned m_typeface_len; char* m_signature; unsigned m_height; unsigned m_width; int m_weight; bool m_italic; DWORD m_char_set; DWORD m_pitch_and_family; bool m_hinting; bool m_flip_y; bool m_font_created; unsigned m_resolution; glyph_rendering m_glyph_rendering; unsigned m_glyph_index; unsigned m_data_size; glyph_data_type m_data_type; rect_i m_bounds; double m_advance_x; double m_advance_y; MAT2 m_matrix; char* m_gbuf; KERNINGPAIR* m_kerning_pairs; unsigned m_num_kerning_pairs; unsigned m_max_kerning_pairs; trans_affine m_affine; path_storage_integer<int16, 6> m_path16; path_storage_integer<int32, 6> m_path32; conv_curve<path_storage_integer<int16, 6> > m_curves16; conv_curve<path_storage_integer<int32, 6> > m_curves32; scanline_u8 m_scanline_aa; scanline_bin m_scanline_bin; scanlines_aa_type m_scanlines_aa; scanlines_bin_type m_scanlines_bin; rasterizer_scanline_aa<> m_rasterizer; }; //------------------------------------------------font_engine_win32_tt_int16 // This class uses values of type int16 (10.6 format) for the vector cache. // The vector cache is compact, but when rendering glyphs of height // more that 200 there integer overflow can occur. // class font_engine_win32_tt_int16 : public font_engine_win32_tt_base { public: typedef serialized_integer_path_adaptor<int16, 6> path_adaptor_type; typedef font_engine_win32_tt_base::gray8_adaptor_type gray8_adaptor_type; typedef font_engine_win32_tt_base::mono_adaptor_type mono_adaptor_type; typedef font_engine_win32_tt_base::scanlines_aa_type scanlines_aa_type; typedef font_engine_win32_tt_base::scanlines_bin_type scanlines_bin_type; font_engine_win32_tt_int16(HDC dc, unsigned max_fonts = 32) : font_engine_win32_tt_base(false, dc, max_fonts) {} }; //------------------------------------------------font_engine_win32_tt_int32 // This class uses values of type int32 (26.6 format) for the vector cache. // The vector cache is twice larger than in font_engine_win32_tt_int16, // but it allows you to render glyphs of very large sizes. // class font_engine_win32_tt_int32 : public font_engine_win32_tt_base { public: typedef serialized_integer_path_adaptor<int32, 6> path_adaptor_type; typedef font_engine_win32_tt_base::gray8_adaptor_type gray8_adaptor_type; typedef font_engine_win32_tt_base::mono_adaptor_type mono_adaptor_type; typedef font_engine_win32_tt_base::scanlines_aa_type scanlines_aa_type; typedef font_engine_win32_tt_base::scanlines_bin_type scanlines_bin_type; font_engine_win32_tt_int32(HDC dc, unsigned max_fonts = 32) : font_engine_win32_tt_base(true, dc, max_fonts) {} }; } #endif �����������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/gpc/����������������������������������������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�014027� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/gpc/Makefile.am�����������������������������������������������������������������������0000644�0000000�0000000�00000000345�10703246330�016065� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������if ENABLE_GPC lib_LTLIBRARIES = libagggpc.la include_HEADERS=gpc.h libagggpc_la_LDFLAGS = -no-undefined -version-info @AGG_LIB_VERSION@ libagggpc_la_SOURCES = gpc.c EXTRA_DIST=copying.txt\ VERSIONS.TXT\ gpc.h endif �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/������������������������������������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�014701� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/Makefile.am�������������������������������������������������������������������0000644�0000000�0000000�00000007107�10703246330�016742� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������SUBDIRS = ctrl util platform aggincludedir = $(includedir)/agg2 agginclude_HEADERS = \ agg_alpha_mask_u8.h agg_glyph_raster_bin.h agg_span_allocator.h \ agg_arc.h agg_gsv_text.h agg_span_converter.h \ agg_array.h agg_image_accessors.h agg_span_gouraud.h \ agg_arrowhead.h agg_image_filters.h agg_span_gouraud_gray.h \ agg_basics.h agg_line_aa_basics.h agg_span_gouraud_rgba.h \ agg_bezier_arc.h agg_math.h agg_span_gradient.h \ agg_bitset_iterator.h agg_blur.h agg_math_stroke.h \ agg_span_gradient_alpha.h agg_gradient_lut.h \ agg_bounding_rect.h agg_path_length.h agg_span_image_filter.h \ agg_bspline.h agg_path_storage.h agg_span_image_filter_gray.h \ agg_clip_liang_barsky.h agg_path_storage_integer.h agg_span_image_filter_rgb.h \ agg_color_gray.h agg_pattern_filters_rgba.h agg_span_image_filter_rgba.h \ agg_color_rgba.h agg_pixfmt_amask_adaptor.h agg_span_interpolator_adaptor.h \ agg_config.h agg_pixfmt_gray.h agg_span_interpolator_linear.h \ agg_conv_adaptor_vcgen.h agg_pixfmt_rgb.h agg_span_interpolator_persp.h \ agg_conv_adaptor_vpgen.h agg_pixfmt_rgb_packed.h agg_span_interpolator_trans.h \ agg_conv_bspline.h agg_pixfmt_rgba.h agg_pixfmt_transposer.h \ agg_span_pattern_gray.h \ agg_conv_clip_polygon.h agg_rasterizer_cells_aa.h agg_span_pattern_rgb.h \ agg_conv_clip_polyline.h agg_rasterizer_compound_aa.h agg_span_pattern_rgba.h \ agg_conv_close_polygon.h agg_rasterizer_outline.h agg_span_solid.h \ agg_conv_concat.h agg_rasterizer_outline_aa.h agg_span_subdiv_adaptor.h \ agg_conv_contour.h agg_rasterizer_scanline_aa.h agg_trans_affine.h \ agg_conv_curve.h agg_rasterizer_sl_clip.h agg_trans_bilinear.h \ agg_conv_dash.h agg_renderer_base.h agg_trans_double_path.h \ agg_conv_gpc.h agg_renderer_markers.h \ agg_conv_marker.h agg_renderer_mclip.h agg_trans_perspective.h \ agg_conv_marker_adaptor.h agg_renderer_outline_aa.h agg_trans_single_path.h \ agg_conv_segmentator.h agg_renderer_outline_image.h agg_trans_viewport.h \ agg_conv_shorten_path.h agg_renderer_primitives.h agg_trans_warp_magnifier.h \ agg_conv_smooth_poly1.h agg_renderer_raster_text.h agg_vcgen_bspline.h \ agg_conv_stroke.h agg_renderer_scanline.h agg_vcgen_contour.h \ agg_conv_transform.h agg_rendering_buffer.h agg_vcgen_dash.h \ agg_conv_unclose_polygon.h agg_rendering_buffer_dynarow.h agg_vcgen_markers_term.h \ agg_curves.h agg_rounded_rect.h agg_vcgen_smooth_poly1.h \ agg_scanline_bin.h agg_vcgen_stroke.h \ agg_dda_line.h agg_scanline_boolean_algebra.h agg_vcgen_vertex_sequence.h \ agg_ellipse.h agg_scanline_p.h agg_vertex_sequence.h \ agg_ellipse_bresenham.h agg_scanline_storage_aa.h agg_vpgen_clip_polygon.h \ agg_embedded_raster_fonts.h agg_scanline_storage_bin.h agg_vpgen_clip_polyline.h \ agg_font_cache_manager.h agg_scanline_u.h agg_vpgen_segmentator.h \ agg_gamma_functions.h agg_shorten_path.h \ agg_gamma_lut.h agg_simul_eq.h ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_alpha_mask_u8.h�����������������������������������������������������������0000644�0000000�0000000�00000044510�10703246330�020410� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_ALPHA_MASK_U8_INCLUDED #define AGG_ALPHA_MASK_U8_INCLUDED #include <string.h> #include "agg_basics.h" #include "agg_rendering_buffer.h" namespace agg { //===================================================one_component_mask_u8 struct one_component_mask_u8 { static unsigned calculate(const int8u* p) { return *p; } }; //=====================================================rgb_to_gray_mask_u8 template<unsigned R, unsigned G, unsigned B> struct rgb_to_gray_mask_u8 { static unsigned calculate(const int8u* p) { return (p[R]*77 + p[G]*150 + p[B]*29) >> 8; } }; //==========================================================alpha_mask_u8 template<unsigned Step=1, unsigned Offset=0, class MaskF=one_component_mask_u8> class alpha_mask_u8 { public: typedef int8u cover_type; typedef alpha_mask_u8<Step, Offset, MaskF> self_type; enum cover_scale_e { cover_shift = 8, cover_none = 0, cover_full = 255 }; alpha_mask_u8() : m_rbuf(0) {} explicit alpha_mask_u8(rendering_buffer& rbuf) : m_rbuf(&rbuf) {} void attach(rendering_buffer& rbuf) { m_rbuf = &rbuf; } MaskF& mask_function() { return m_mask_function; } const MaskF& mask_function() const { return m_mask_function; } //-------------------------------------------------------------------- cover_type pixel(int x, int y) const { if(x >= 0 && y >= 0 && x < (int)m_rbuf->width() && y < (int)m_rbuf->height()) { return (cover_type)m_mask_function.calculate( m_rbuf->row_ptr(y) + x * Step + Offset); } return 0; } //-------------------------------------------------------------------- cover_type combine_pixel(int x, int y, cover_type val) const { if(x >= 0 && y >= 0 && x < (int)m_rbuf->width() && y < (int)m_rbuf->height()) { return (cover_type)((cover_full + val * m_mask_function.calculate( m_rbuf->row_ptr(y) + x * Step + Offset)) >> cover_shift); } return 0; } //-------------------------------------------------------------------- void fill_hspan(int x, int y, cover_type* dst, int num_pix) const { int xmax = m_rbuf->width() - 1; int ymax = m_rbuf->height() - 1; int count = num_pix; cover_type* covers = dst; if(y < 0 || y > ymax) { memset(dst, 0, num_pix * sizeof(cover_type)); return; } if(x < 0) { count += x; if(count <= 0) { memset(dst, 0, num_pix * sizeof(cover_type)); return; } memset(covers, 0, -x * sizeof(cover_type)); covers -= x; x = 0; } if(x + count > xmax) { int rest = x + count - xmax - 1; count -= rest; if(count <= 0) { memset(dst, 0, num_pix * sizeof(cover_type)); return; } memset(covers + count, 0, rest * sizeof(cover_type)); } const int8u* mask = m_rbuf->row_ptr(y) + x * Step + Offset; do { *covers++ = (cover_type)m_mask_function.calculate(mask); mask += Step; } while(--count); } //-------------------------------------------------------------------- void combine_hspan(int x, int y, cover_type* dst, int num_pix) const { int xmax = m_rbuf->width() - 1; int ymax = m_rbuf->height() - 1; int count = num_pix; cover_type* covers = dst; if(y < 0 || y > ymax) { memset(dst, 0, num_pix * sizeof(cover_type)); return; } if(x < 0) { count += x; if(count <= 0) { memset(dst, 0, num_pix * sizeof(cover_type)); return; } memset(covers, 0, -x * sizeof(cover_type)); covers -= x; x = 0; } if(x + count > xmax) { int rest = x + count - xmax - 1; count -= rest; if(count <= 0) { memset(dst, 0, num_pix * sizeof(cover_type)); return; } memset(covers + count, 0, rest * sizeof(cover_type)); } const int8u* mask = m_rbuf->row_ptr(y) + x * Step + Offset; do { *covers = (cover_type)((cover_full + (*covers) * m_mask_function.calculate(mask)) >> cover_shift); ++covers; mask += Step; } while(--count); } //-------------------------------------------------------------------- void fill_vspan(int x, int y, cover_type* dst, int num_pix) const { int xmax = m_rbuf->width() - 1; int ymax = m_rbuf->height() - 1; int count = num_pix; cover_type* covers = dst; if(x < 0 || x > xmax) { memset(dst, 0, num_pix * sizeof(cover_type)); return; } if(y < 0) { count += y; if(count <= 0) { memset(dst, 0, num_pix * sizeof(cover_type)); return; } memset(covers, 0, -y * sizeof(cover_type)); covers -= y; y = 0; } if(y + count > ymax) { int rest = y + count - ymax - 1; count -= rest; if(count <= 0) { memset(dst, 0, num_pix * sizeof(cover_type)); return; } memset(covers + count, 0, rest * sizeof(cover_type)); } const int8u* mask = m_rbuf->row_ptr(y) + x * Step + Offset; do { *covers++ = (cover_type)m_mask_function.calculate(mask); mask += m_rbuf->stride(); } while(--count); } //-------------------------------------------------------------------- void combine_vspan(int x, int y, cover_type* dst, int num_pix) const { int xmax = m_rbuf->width() - 1; int ymax = m_rbuf->height() - 1; int count = num_pix; cover_type* covers = dst; if(x < 0 || x > xmax) { memset(dst, 0, num_pix * sizeof(cover_type)); return; } if(y < 0) { count += y; if(count <= 0) { memset(dst, 0, num_pix * sizeof(cover_type)); return; } memset(covers, 0, -y * sizeof(cover_type)); covers -= y; y = 0; } if(y + count > ymax) { int rest = y + count - ymax - 1; count -= rest; if(count <= 0) { memset(dst, 0, num_pix * sizeof(cover_type)); return; } memset(covers + count, 0, rest * sizeof(cover_type)); } const int8u* mask = m_rbuf->row_ptr(y) + x * Step + Offset; do { *covers = (cover_type)((cover_full + (*covers) * m_mask_function.calculate(mask)) >> cover_shift); ++covers; mask += m_rbuf->stride(); } while(--count); } private: alpha_mask_u8(const self_type&); const self_type& operator = (const self_type&); rendering_buffer* m_rbuf; MaskF m_mask_function; }; typedef alpha_mask_u8<1, 0> alpha_mask_gray8; //----alpha_mask_gray8 typedef alpha_mask_u8<3, 0> alpha_mask_rgb24r; //----alpha_mask_rgb24r typedef alpha_mask_u8<3, 1> alpha_mask_rgb24g; //----alpha_mask_rgb24g typedef alpha_mask_u8<3, 2> alpha_mask_rgb24b; //----alpha_mask_rgb24b typedef alpha_mask_u8<3, 2> alpha_mask_bgr24r; //----alpha_mask_bgr24r typedef alpha_mask_u8<3, 1> alpha_mask_bgr24g; //----alpha_mask_bgr24g typedef alpha_mask_u8<3, 0> alpha_mask_bgr24b; //----alpha_mask_bgr24b typedef alpha_mask_u8<4, 0> alpha_mask_rgba32r; //----alpha_mask_rgba32r typedef alpha_mask_u8<4, 1> alpha_mask_rgba32g; //----alpha_mask_rgba32g typedef alpha_mask_u8<4, 2> alpha_mask_rgba32b; //----alpha_mask_rgba32b typedef alpha_mask_u8<4, 3> alpha_mask_rgba32a; //----alpha_mask_rgba32a typedef alpha_mask_u8<4, 1> alpha_mask_argb32r; //----alpha_mask_argb32r typedef alpha_mask_u8<4, 2> alpha_mask_argb32g; //----alpha_mask_argb32g typedef alpha_mask_u8<4, 3> alpha_mask_argb32b; //----alpha_mask_argb32b typedef alpha_mask_u8<4, 0> alpha_mask_argb32a; //----alpha_mask_argb32a typedef alpha_mask_u8<4, 2> alpha_mask_bgra32r; //----alpha_mask_bgra32r typedef alpha_mask_u8<4, 1> alpha_mask_bgra32g; //----alpha_mask_bgra32g typedef alpha_mask_u8<4, 0> alpha_mask_bgra32b; //----alpha_mask_bgra32b typedef alpha_mask_u8<4, 3> alpha_mask_bgra32a; //----alpha_mask_bgra32a typedef alpha_mask_u8<4, 3> alpha_mask_abgr32r; //----alpha_mask_abgr32r typedef alpha_mask_u8<4, 2> alpha_mask_abgr32g; //----alpha_mask_abgr32g typedef alpha_mask_u8<4, 1> alpha_mask_abgr32b; //----alpha_mask_abgr32b typedef alpha_mask_u8<4, 0> alpha_mask_abgr32a; //----alpha_mask_abgr32a typedef alpha_mask_u8<3, 0, rgb_to_gray_mask_u8<0, 1, 2> > alpha_mask_rgb24gray; //----alpha_mask_rgb24gray typedef alpha_mask_u8<3, 0, rgb_to_gray_mask_u8<2, 1, 0> > alpha_mask_bgr24gray; //----alpha_mask_bgr24gray typedef alpha_mask_u8<4, 0, rgb_to_gray_mask_u8<0, 1, 2> > alpha_mask_rgba32gray; //----alpha_mask_rgba32gray typedef alpha_mask_u8<4, 1, rgb_to_gray_mask_u8<0, 1, 2> > alpha_mask_argb32gray; //----alpha_mask_argb32gray typedef alpha_mask_u8<4, 0, rgb_to_gray_mask_u8<2, 1, 0> > alpha_mask_bgra32gray; //----alpha_mask_bgra32gray typedef alpha_mask_u8<4, 1, rgb_to_gray_mask_u8<2, 1, 0> > alpha_mask_abgr32gray; //----alpha_mask_abgr32gray //==========================================================amask_no_clip_u8 template<unsigned Step=1, unsigned Offset=0, class MaskF=one_component_mask_u8> class amask_no_clip_u8 { public: typedef int8u cover_type; typedef amask_no_clip_u8<Step, Offset, MaskF> self_type; enum cover_scale_e { cover_shift = 8, cover_none = 0, cover_full = 255 }; amask_no_clip_u8() : m_rbuf(0) {} explicit amask_no_clip_u8(rendering_buffer& rbuf) : m_rbuf(&rbuf) {} void attach(rendering_buffer& rbuf) { m_rbuf = &rbuf; } MaskF& mask_function() { return m_mask_function; } const MaskF& mask_function() const { return m_mask_function; } //-------------------------------------------------------------------- cover_type pixel(int x, int y) const { return (cover_type)m_mask_function.calculate( m_rbuf->row_ptr(y) + x * Step + Offset); } //-------------------------------------------------------------------- cover_type combine_pixel(int x, int y, cover_type val) const { return (cover_type)((cover_full + val * m_mask_function.calculate( m_rbuf->row_ptr(y) + x * Step + Offset)) >> cover_shift); } //-------------------------------------------------------------------- void fill_hspan(int x, int y, cover_type* dst, int num_pix) const { const int8u* mask = m_rbuf->row_ptr(y) + x * Step + Offset; do { *dst++ = (cover_type)m_mask_function.calculate(mask); mask += Step; } while(--num_pix); } //-------------------------------------------------------------------- void combine_hspan(int x, int y, cover_type* dst, int num_pix) const { const int8u* mask = m_rbuf->row_ptr(y) + x * Step + Offset; do { *dst = (cover_type)((cover_full + (*dst) * m_mask_function.calculate(mask)) >> cover_shift); ++dst; mask += Step; } while(--num_pix); } //-------------------------------------------------------------------- void fill_vspan(int x, int y, cover_type* dst, int num_pix) const { const int8u* mask = m_rbuf->row_ptr(y) + x * Step + Offset; do { *dst++ = (cover_type)m_mask_function.calculate(mask); mask += m_rbuf->stride(); } while(--num_pix); } //-------------------------------------------------------------------- void combine_vspan(int x, int y, cover_type* dst, int num_pix) const { const int8u* mask = m_rbuf->row_ptr(y) + x * Step + Offset; do { *dst = (cover_type)((cover_full + (*dst) * m_mask_function.calculate(mask)) >> cover_shift); ++dst; mask += m_rbuf->stride(); } while(--num_pix); } private: amask_no_clip_u8(const self_type&); const self_type& operator = (const self_type&); rendering_buffer* m_rbuf; MaskF m_mask_function; }; typedef amask_no_clip_u8<1, 0> amask_no_clip_gray8; //----amask_no_clip_gray8 typedef amask_no_clip_u8<3, 0> amask_no_clip_rgb24r; //----amask_no_clip_rgb24r typedef amask_no_clip_u8<3, 1> amask_no_clip_rgb24g; //----amask_no_clip_rgb24g typedef amask_no_clip_u8<3, 2> amask_no_clip_rgb24b; //----amask_no_clip_rgb24b typedef amask_no_clip_u8<3, 2> amask_no_clip_bgr24r; //----amask_no_clip_bgr24r typedef amask_no_clip_u8<3, 1> amask_no_clip_bgr24g; //----amask_no_clip_bgr24g typedef amask_no_clip_u8<3, 0> amask_no_clip_bgr24b; //----amask_no_clip_bgr24b typedef amask_no_clip_u8<4, 0> amask_no_clip_rgba32r; //----amask_no_clip_rgba32r typedef amask_no_clip_u8<4, 1> amask_no_clip_rgba32g; //----amask_no_clip_rgba32g typedef amask_no_clip_u8<4, 2> amask_no_clip_rgba32b; //----amask_no_clip_rgba32b typedef amask_no_clip_u8<4, 3> amask_no_clip_rgba32a; //----amask_no_clip_rgba32a typedef amask_no_clip_u8<4, 1> amask_no_clip_argb32r; //----amask_no_clip_argb32r typedef amask_no_clip_u8<4, 2> amask_no_clip_argb32g; //----amask_no_clip_argb32g typedef amask_no_clip_u8<4, 3> amask_no_clip_argb32b; //----amask_no_clip_argb32b typedef amask_no_clip_u8<4, 0> amask_no_clip_argb32a; //----amask_no_clip_argb32a typedef amask_no_clip_u8<4, 2> amask_no_clip_bgra32r; //----amask_no_clip_bgra32r typedef amask_no_clip_u8<4, 1> amask_no_clip_bgra32g; //----amask_no_clip_bgra32g typedef amask_no_clip_u8<4, 0> amask_no_clip_bgra32b; //----amask_no_clip_bgra32b typedef amask_no_clip_u8<4, 3> amask_no_clip_bgra32a; //----amask_no_clip_bgra32a typedef amask_no_clip_u8<4, 3> amask_no_clip_abgr32r; //----amask_no_clip_abgr32r typedef amask_no_clip_u8<4, 2> amask_no_clip_abgr32g; //----amask_no_clip_abgr32g typedef amask_no_clip_u8<4, 1> amask_no_clip_abgr32b; //----amask_no_clip_abgr32b typedef amask_no_clip_u8<4, 0> amask_no_clip_abgr32a; //----amask_no_clip_abgr32a typedef amask_no_clip_u8<3, 0, rgb_to_gray_mask_u8<0, 1, 2> > amask_no_clip_rgb24gray; //----amask_no_clip_rgb24gray typedef amask_no_clip_u8<3, 0, rgb_to_gray_mask_u8<2, 1, 0> > amask_no_clip_bgr24gray; //----amask_no_clip_bgr24gray typedef amask_no_clip_u8<4, 0, rgb_to_gray_mask_u8<0, 1, 2> > amask_no_clip_rgba32gray; //----amask_no_clip_rgba32gray typedef amask_no_clip_u8<4, 1, rgb_to_gray_mask_u8<0, 1, 2> > amask_no_clip_argb32gray; //----amask_no_clip_argb32gray typedef amask_no_clip_u8<4, 0, rgb_to_gray_mask_u8<2, 1, 0> > amask_no_clip_bgra32gray; //----amask_no_clip_bgra32gray typedef amask_no_clip_u8<4, 1, rgb_to_gray_mask_u8<2, 1, 0> > amask_no_clip_abgr32gray; //----amask_no_clip_abgr32gray } #endif ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_arc.h���������������������������������������������������������������������0000644�0000000�0000000�00000004355�10703246330�016444� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_ARC_INCLUDED #define AGG_ARC_INCLUDED #include <math.h> #include "agg_basics.h" namespace agg { //=====================================================================arc // // See Implementation agg_arc.cpp // class arc { public: arc() : m_scale(1.0), m_initialized(false) {} arc(double x, double y, double rx, double ry, double a1, double a2, bool ccw=true); void init(double x, double y, double rx, double ry, double a1, double a2, bool ccw=true); void approximation_scale(double s); double approximation_scale() const { return m_scale; } void rewind(unsigned); unsigned vertex(double* x, double* y); private: void normalize(double a1, double a2, bool ccw); double m_x; double m_y; double m_rx; double m_ry; double m_angle; double m_start; double m_end; double m_scale; double m_da; bool m_ccw; bool m_initialized; unsigned m_path_cmd; }; } #endif �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_array.h�������������������������������������������������������������������0000644�0000000�0000000�00000103530�10703246330�017010� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_ARRAY_INCLUDED #define AGG_ARRAY_INCLUDED #include <stddef.h> #include <string.h> #include "agg_basics.h" namespace agg { //-------------------------------------------------------pod_array_adaptor template<class T> class pod_array_adaptor { public: typedef T value_type; pod_array_adaptor(T* array, unsigned size) : m_array(array), m_size(size) {} unsigned size() const { return m_size; } const T& operator [] (unsigned i) const { return m_array[i]; } T& operator [] (unsigned i) { return m_array[i]; } const T& at(unsigned i) const { return m_array[i]; } T& at(unsigned i) { return m_array[i]; } T value_at(unsigned i) const { return m_array[i]; } private: T* m_array; unsigned m_size; }; //---------------------------------------------------------pod_auto_array template<class T, unsigned Size> class pod_auto_array { public: typedef T value_type; typedef pod_auto_array<T, Size> self_type; pod_auto_array() {} explicit pod_auto_array(const T* c) { memcpy(m_array, c, sizeof(T) * Size); } const self_type& operator = (const T* c) { memcpy(m_array, c, sizeof(T) * Size); return *this; } static unsigned size() { return Size; } const T& operator [] (unsigned i) const { return m_array[i]; } T& operator [] (unsigned i) { return m_array[i]; } const T& at(unsigned i) const { return m_array[i]; } T& at(unsigned i) { return m_array[i]; } T value_at(unsigned i) const { return m_array[i]; } private: T m_array[Size]; }; //--------------------------------------------------------pod_auto_vector template<class T, unsigned Size> class pod_auto_vector { public: typedef T value_type; typedef pod_auto_vector<T, Size> self_type; pod_auto_vector() : m_size(0) {} void remove_all() { m_size = 0; } void clear() { m_size = 0; } void add(const T& v) { m_array[m_size++] = v; } void push_back(const T& v) { m_array[m_size++] = v; } void inc_size(unsigned size) { m_size += size; } unsigned size() const { return m_size; } const T& operator [] (unsigned i) const { return m_array[i]; } T& operator [] (unsigned i) { return m_array[i]; } const T& at(unsigned i) const { return m_array[i]; } T& at(unsigned i) { return m_array[i]; } T value_at(unsigned i) const { return m_array[i]; } private: T m_array[Size]; unsigned m_size; }; //---------------------------------------------------------------pod_array template<class T> class pod_array { public: typedef T value_type; typedef pod_array<T> self_type; ~pod_array() { pod_allocator<T>::deallocate(m_array, m_size); } pod_array() : m_array(0), m_size(0) {} pod_array(unsigned size) : m_array(pod_allocator<T>::allocate(size)), m_size(size) {} pod_array(const self_type& v) : m_array(pod_allocator<T>::allocate(v.m_size)), m_size(v.m_size) { memcpy(m_array, v.m_array, sizeof(T) * m_size); } void resize(unsigned size) { if(size != m_size) { pod_allocator<T>::deallocate(m_array, m_size); m_array = pod_allocator<T>::allocate(m_size = size); } } const self_type& operator = (const self_type& v) { resize(v.size()); memcpy(m_array, v.m_array, sizeof(T) * m_size); return *this; } unsigned size() const { return m_size; } const T& operator [] (unsigned i) const { return m_array[i]; } T& operator [] (unsigned i) { return m_array[i]; } const T& at(unsigned i) const { return m_array[i]; } T& at(unsigned i) { return m_array[i]; } T value_at(unsigned i) const { return m_array[i]; } const T* data() const { return m_array; } T* data() { return m_array; } private: T* m_array; unsigned m_size; }; //--------------------------------------------------------------pod_vector // A simple class template to store Plain Old Data, a vector // of a fixed size. The data is continous in memory //------------------------------------------------------------------------ template<class T> class pod_vector { public: typedef T value_type; ~pod_vector() { pod_allocator<T>::deallocate(m_array, m_capacity); } pod_vector() : m_size(0), m_capacity(0), m_array(0) {} pod_vector(unsigned cap, unsigned extra_tail=0); // Copying pod_vector(const pod_vector<T>&); const pod_vector<T>& operator = (const pod_vector<T>&); // Set new capacity. All data is lost, size is set to zero. void capacity(unsigned cap, unsigned extra_tail=0); unsigned capacity() const { return m_capacity; } // Allocate n elements. All data is lost, // but elements can be accessed in range 0...size-1. void allocate(unsigned size, unsigned extra_tail=0); // Resize keeping the content. void resize(unsigned new_size); void zero() { memset(m_array, 0, sizeof(T) * m_size); } void add(const T& v) { m_array[m_size++] = v; } void push_back(const T& v) { m_array[m_size++] = v; } void insert_at(unsigned pos, const T& val); void inc_size(unsigned size) { m_size += size; } unsigned size() const { return m_size; } unsigned byte_size() const { return m_size * sizeof(T); } void serialize(int8u* ptr) const; void deserialize(const int8u* data, unsigned byte_size); const T& operator [] (unsigned i) const { return m_array[i]; } T& operator [] (unsigned i) { return m_array[i]; } const T& at(unsigned i) const { return m_array[i]; } T& at(unsigned i) { return m_array[i]; } T value_at(unsigned i) const { return m_array[i]; } const T* data() const { return m_array; } T* data() { return m_array; } void remove_all() { m_size = 0; } void clear() { m_size = 0; } void cut_at(unsigned num) { if(num < m_size) m_size = num; } private: unsigned m_size; unsigned m_capacity; T* m_array; }; //------------------------------------------------------------------------ template<class T> void pod_vector<T>::capacity(unsigned cap, unsigned extra_tail) { m_size = 0; if(cap > m_capacity) { pod_allocator<T>::deallocate(m_array, m_capacity); m_capacity = cap + extra_tail; m_array = m_capacity ? pod_allocator<T>::allocate(m_capacity) : 0; } } //------------------------------------------------------------------------ template<class T> void pod_vector<T>::allocate(unsigned size, unsigned extra_tail) { capacity(size, extra_tail); m_size = size; } //------------------------------------------------------------------------ template<class T> void pod_vector<T>::resize(unsigned new_size) { if(new_size > m_size) { if(new_size > m_capacity) { T* data = pod_allocator<T>::allocate(new_size); memcpy(data, m_array, m_size * sizeof(T)); pod_allocator<T>::deallocate(m_array, m_capacity); m_array = data; } } else { m_size = new_size; } } //------------------------------------------------------------------------ template<class T> pod_vector<T>::pod_vector(unsigned cap, unsigned extra_tail) : m_size(0), m_capacity(cap + extra_tail), m_array(pod_allocator<T>::allocate(m_capacity)) {} //------------------------------------------------------------------------ template<class T> pod_vector<T>::pod_vector(const pod_vector<T>& v) : m_size(v.m_size), m_capacity(v.m_capacity), m_array(v.m_capacity ? pod_allocator<T>::allocate(v.m_capacity) : 0) { memcpy(m_array, v.m_array, sizeof(T) * v.m_size); } //------------------------------------------------------------------------ template<class T> const pod_vector<T>& pod_vector<T>::operator = (const pod_vector<T>&v) { allocate(v.m_size); if(v.m_size) memcpy(m_array, v.m_array, sizeof(T) * v.m_size); return *this; } //------------------------------------------------------------------------ template<class T> void pod_vector<T>::serialize(int8u* ptr) const { if(m_size) memcpy(ptr, m_array, m_size * sizeof(T)); } //------------------------------------------------------------------------ template<class T> void pod_vector<T>::deserialize(const int8u* data, unsigned byte_size) { byte_size /= sizeof(T); allocate(byte_size); if(byte_size) memcpy(m_array, data, byte_size * sizeof(T)); } //------------------------------------------------------------------------ template<class T> void pod_vector<T>::insert_at(unsigned pos, const T& val) { if(pos >= m_size) { m_array[m_size] = val; } else { memmove(m_array + pos + 1, m_array + pos, (m_size - pos) * sizeof(T)); m_array[pos] = val; } ++m_size; } //---------------------------------------------------------------pod_bvector // A simple class template to store Plain Old Data, similar to std::deque // It doesn't reallocate memory but instead, uses blocks of data of size // of (1 << S), that is, power of two. The data is NOT contiguous in memory, // so the only valid access method is operator [] or curr(), prev(), next() // // There reallocs occure only when the pool of pointers to blocks needs // to be extended (it happens very rarely). You can control the value // of increment to reallocate the pointer buffer. See the second constructor. // By default, the incremeent value equals (1 << S), i.e., the block size. //------------------------------------------------------------------------ template<class T, unsigned S=6> class pod_bvector { public: enum block_scale_e { block_shift = S, block_size = 1 << block_shift, block_mask = block_size - 1 }; typedef T value_type; ~pod_bvector(); pod_bvector(); pod_bvector(unsigned block_ptr_inc); // Copying pod_bvector(const pod_bvector<T, S>& v); const pod_bvector<T, S>& operator = (const pod_bvector<T, S>& v); void remove_all() { m_size = 0; } void clear() { m_size = 0; } void free_all() { free_tail(0); } void free_tail(unsigned size); void add(const T& val); void push_back(const T& val) { add(val); } void modify_last(const T& val); void remove_last(); int allocate_continuous_block(unsigned num_elements); void add_array(const T* ptr, unsigned num_elem) { while(num_elem--) { add(*ptr++); } } template<class DataAccessor> void add_data(DataAccessor& data) { while(data.size()) { add(*data); ++data; } } void cut_at(unsigned size) { if(size < m_size) m_size = size; } unsigned size() const { return m_size; } const T& operator [] (unsigned i) const { return m_blocks[i >> block_shift][i & block_mask]; } T& operator [] (unsigned i) { return m_blocks[i >> block_shift][i & block_mask]; } const T& at(unsigned i) const { return m_blocks[i >> block_shift][i & block_mask]; } T& at(unsigned i) { return m_blocks[i >> block_shift][i & block_mask]; } T value_at(unsigned i) const { return m_blocks[i >> block_shift][i & block_mask]; } const T& curr(unsigned idx) const { return (*this)[idx]; } T& curr(unsigned idx) { return (*this)[idx]; } const T& prev(unsigned idx) const { return (*this)[(idx + m_size - 1) % m_size]; } T& prev(unsigned idx) { return (*this)[(idx + m_size - 1) % m_size]; } const T& next(unsigned idx) const { return (*this)[(idx + 1) % m_size]; } T& next(unsigned idx) { return (*this)[(idx + 1) % m_size]; } const T& last() const { return (*this)[m_size - 1]; } T& last() { return (*this)[m_size - 1]; } unsigned byte_size() const; void serialize(int8u* ptr) const; void deserialize(const int8u* data, unsigned byte_size); void deserialize(unsigned start, const T& empty_val, const int8u* data, unsigned byte_size); template<class ByteAccessor> void deserialize(ByteAccessor data) { remove_all(); unsigned elem_size = data.size() / sizeof(T); for(unsigned i = 0; i < elem_size; ++i) { int8u* ptr = (int8u*)data_ptr(); for(unsigned j = 0; j < sizeof(T); ++j) { *ptr++ = *data; ++data; } ++m_size; } } template<class ByteAccessor> void deserialize(unsigned start, const T& empty_val, ByteAccessor data) { while(m_size < start) { add(empty_val); } unsigned elem_size = data.size() / sizeof(T); for(unsigned i = 0; i < elem_size; ++i) { int8u* ptr; if(start + i < m_size) { ptr = (int8u*)(&((*this)[start + i])); } else { ptr = (int8u*)data_ptr(); ++m_size; } for(unsigned j = 0; j < sizeof(T); ++j) { *ptr++ = *data; ++data; } } } const T* block(unsigned nb) const { return m_blocks[nb]; } private: void allocate_block(unsigned nb); T* data_ptr(); unsigned m_size; unsigned m_num_blocks; unsigned m_max_blocks; T** m_blocks; unsigned m_block_ptr_inc; }; //------------------------------------------------------------------------ template<class T, unsigned S> pod_bvector<T, S>::~pod_bvector() { if(m_num_blocks) { T** blk = m_blocks + m_num_blocks - 1; while(m_num_blocks--) { pod_allocator<T>::deallocate(*blk, block_size); --blk; } } pod_allocator<T*>::deallocate(m_blocks, m_max_blocks); } //------------------------------------------------------------------------ template<class T, unsigned S> void pod_bvector<T, S>::free_tail(unsigned size) { if(size < m_size) { unsigned nb = (size + block_mask) >> block_shift; while(m_num_blocks > nb) { pod_allocator<T>::deallocate(m_blocks[--m_num_blocks], block_size); } if(m_num_blocks == 0) { pod_allocator<T*>::deallocate(m_blocks, m_max_blocks); m_blocks = 0; m_max_blocks = 0; } m_size = size; } } //------------------------------------------------------------------------ template<class T, unsigned S> pod_bvector<T, S>::pod_bvector() : m_size(0), m_num_blocks(0), m_max_blocks(0), m_blocks(0), m_block_ptr_inc(block_size) { } //------------------------------------------------------------------------ template<class T, unsigned S> pod_bvector<T, S>::pod_bvector(unsigned block_ptr_inc) : m_size(0), m_num_blocks(0), m_max_blocks(0), m_blocks(0), m_block_ptr_inc(block_ptr_inc) { } //------------------------------------------------------------------------ template<class T, unsigned S> pod_bvector<T, S>::pod_bvector(const pod_bvector<T, S>& v) : m_size(v.m_size), m_num_blocks(v.m_num_blocks), m_max_blocks(v.m_max_blocks), m_blocks(v.m_max_blocks ? pod_allocator<T*>::allocate(v.m_max_blocks) : 0), m_block_ptr_inc(v.m_block_ptr_inc) { unsigned i; for(i = 0; i < v.m_num_blocks; ++i) { m_blocks[i] = pod_allocator<T>::allocate(block_size); memcpy(m_blocks[i], v.m_blocks[i], block_size * sizeof(T)); } } //------------------------------------------------------------------------ template<class T, unsigned S> const pod_bvector<T, S>& pod_bvector<T, S>::operator = (const pod_bvector<T, S>& v) { unsigned i; for(i = m_num_blocks; i < v.m_num_blocks; ++i) { allocate_block(i); } for(i = 0; i < v.m_num_blocks; ++i) { memcpy(m_blocks[i], v.m_blocks[i], block_size * sizeof(T)); } m_size = v.m_size; return *this; } //------------------------------------------------------------------------ template<class T, unsigned S> void pod_bvector<T, S>::allocate_block(unsigned nb) { if(nb >= m_max_blocks) { T** new_blocks = pod_allocator<T*>::allocate(m_max_blocks + m_block_ptr_inc); if(m_blocks) { memcpy(new_blocks, m_blocks, m_num_blocks * sizeof(T*)); pod_allocator<T*>::deallocate(m_blocks, m_max_blocks); } m_blocks = new_blocks; m_max_blocks += m_block_ptr_inc; } m_blocks[nb] = pod_allocator<T>::allocate(block_size); m_num_blocks++; } //------------------------------------------------------------------------ template<class T, unsigned S> inline T* pod_bvector<T, S>::data_ptr() { unsigned nb = m_size >> block_shift; if(nb >= m_num_blocks) { allocate_block(nb); } return m_blocks[nb] + (m_size & block_mask); } //------------------------------------------------------------------------ template<class T, unsigned S> inline void pod_bvector<T, S>::add(const T& val) { *data_ptr() = val; ++m_size; } //------------------------------------------------------------------------ template<class T, unsigned S> inline void pod_bvector<T, S>::remove_last() { if(m_size) --m_size; } //------------------------------------------------------------------------ template<class T, unsigned S> void pod_bvector<T, S>::modify_last(const T& val) { remove_last(); add(val); } //------------------------------------------------------------------------ template<class T, unsigned S> int pod_bvector<T, S>::allocate_continuous_block(unsigned num_elements) { if(num_elements < block_size) { data_ptr(); // Allocate initial block if necessary unsigned rest = block_size - (m_size & block_mask); unsigned index; if(num_elements <= rest) { // The rest of the block is good, we can use it //----------------- index = m_size; m_size += num_elements; return index; } // New block //--------------- m_size += rest; data_ptr(); index = m_size; m_size += num_elements; return index; } return -1; // Impossible to allocate } //------------------------------------------------------------------------ template<class T, unsigned S> unsigned pod_bvector<T, S>::byte_size() const { return m_size * sizeof(T); } //------------------------------------------------------------------------ template<class T, unsigned S> void pod_bvector<T, S>::serialize(int8u* ptr) const { unsigned i; for(i = 0; i < m_size; i++) { memcpy(ptr, &(*this)[i], sizeof(T)); ptr += sizeof(T); } } //------------------------------------------------------------------------ template<class T, unsigned S> void pod_bvector<T, S>::deserialize(const int8u* data, unsigned byte_size) { remove_all(); byte_size /= sizeof(T); for(unsigned i = 0; i < byte_size; ++i) { T* ptr = data_ptr(); memcpy(ptr, data, sizeof(T)); ++m_size; data += sizeof(T); } } // Replace or add a number of elements starting from "start" position //------------------------------------------------------------------------ template<class T, unsigned S> void pod_bvector<T, S>::deserialize(unsigned start, const T& empty_val, const int8u* data, unsigned byte_size) { while(m_size < start) { add(empty_val); } byte_size /= sizeof(T); for(unsigned i = 0; i < byte_size; ++i) { if(start + i < m_size) { memcpy(&((*this)[start + i]), data, sizeof(T)); } else { T* ptr = data_ptr(); memcpy(ptr, data, sizeof(T)); ++m_size; } data += sizeof(T); } } //---------------------------------------------------------block_allocator // Allocator for arbitrary POD data. Most usable in different cache // systems for efficient memory allocations. // Memory is allocated with blocks of fixed size ("block_size" in // the constructor). If required size exceeds the block size the allocator // creates a new block of the required size. However, the most efficient // use is when the average reqired size is much less than the block size. //------------------------------------------------------------------------ class block_allocator { struct block_type { int8u* data; unsigned size; }; public: void remove_all() { if(m_num_blocks) { block_type* blk = m_blocks + m_num_blocks - 1; while(m_num_blocks--) { pod_allocator<int8u>::deallocate(blk->data, blk->size); --blk; } pod_allocator<block_type>::deallocate(m_blocks, m_max_blocks); } m_num_blocks = 0; m_max_blocks = 0; m_blocks = 0; m_buf_ptr = 0; m_rest = 0; } ~block_allocator() { remove_all(); } block_allocator(unsigned block_size, unsigned block_ptr_inc=256-8) : m_block_size(block_size), m_block_ptr_inc(block_ptr_inc), m_num_blocks(0), m_max_blocks(0), m_blocks(0), m_buf_ptr(0), m_rest(0) { } int8u* allocate(unsigned size, unsigned alignment=1) { if(size == 0) return 0; if(size <= m_rest) { int8u* ptr = m_buf_ptr; if(alignment > 1) { unsigned align = (alignment - unsigned((size_t)ptr) % alignment) % alignment; size += align; ptr += align; if(size <= m_rest) { m_rest -= size; m_buf_ptr += size; return ptr; } allocate_block(size); return allocate(size - align, alignment); } m_rest -= size; m_buf_ptr += size; return ptr; } allocate_block(size + alignment - 1); return allocate(size, alignment); } private: void allocate_block(unsigned size) { if(size < m_block_size) size = m_block_size; if(m_num_blocks >= m_max_blocks) { block_type* new_blocks = pod_allocator<block_type>::allocate(m_max_blocks + m_block_ptr_inc); if(m_blocks) { memcpy(new_blocks, m_blocks, m_num_blocks * sizeof(block_type)); pod_allocator<block_type>::deallocate(m_blocks, m_max_blocks); } m_blocks = new_blocks; m_max_blocks += m_block_ptr_inc; } m_blocks[m_num_blocks].size = size; m_blocks[m_num_blocks].data = m_buf_ptr = pod_allocator<int8u>::allocate(size); m_num_blocks++; m_rest = size; } unsigned m_block_size; unsigned m_block_ptr_inc; unsigned m_num_blocks; unsigned m_max_blocks; block_type* m_blocks; int8u* m_buf_ptr; unsigned m_rest; }; //------------------------------------------------------------------------ enum quick_sort_threshold_e { quick_sort_threshold = 9 }; //-----------------------------------------------------------swap_elements template<class T> inline void swap_elements(T& a, T& b) { T temp = a; a = b; b = temp; } //--------------------------------------------------------------quick_sort template<class Array, class Less> void quick_sort(Array& arr, Less less) { if(arr.size() < 2) return; typename Array::value_type* e1; typename Array::value_type* e2; int stack[80]; int* top = stack; int limit = arr.size(); int base = 0; for(;;) { int len = limit - base; int i; int j; int pivot; if(len > quick_sort_threshold) { // we use base + len/2 as the pivot pivot = base + len / 2; swap_elements(arr[base], arr[pivot]); i = base + 1; j = limit - 1; // now ensure that *i <= *base <= *j e1 = &(arr[j]); e2 = &(arr[i]); if(less(*e1, *e2)) swap_elements(*e1, *e2); e1 = &(arr[base]); e2 = &(arr[i]); if(less(*e1, *e2)) swap_elements(*e1, *e2); e1 = &(arr[j]); e2 = &(arr[base]); if(less(*e1, *e2)) swap_elements(*e1, *e2); for(;;) { do i++; while( less(arr[i], arr[base]) ); do j--; while( less(arr[base], arr[j]) ); if( i > j ) { break; } swap_elements(arr[i], arr[j]); } swap_elements(arr[base], arr[j]); // now, push the largest sub-array if(j - base > limit - i) { top[0] = base; top[1] = j; base = i; } else { top[0] = i; top[1] = limit; limit = j; } top += 2; } else { // the sub-array is small, perform insertion sort j = base; i = j + 1; for(; i < limit; j = i, i++) { for(; less(*(e1 = &(arr[j + 1])), *(e2 = &(arr[j]))); j--) { swap_elements(*e1, *e2); if(j == base) { break; } } } if(top > stack) { top -= 2; base = top[0]; limit = top[1]; } else { break; } } } } //------------------------------------------------------remove_duplicates // Remove duplicates from a sorted array. It doesn't cut the // tail of the array, it just returns the number of remaining elements. //----------------------------------------------------------------------- template<class Array, class Equal> unsigned remove_duplicates(Array& arr, Equal equal) { if(arr.size() < 2) return arr.size(); unsigned i, j; for(i = 1, j = 1; i < arr.size(); i++) { typename Array::value_type& e = arr[i]; if(!equal(e, arr[i - 1])) { arr[j++] = e; } } return j; } //--------------------------------------------------------invert_container template<class Array> void invert_container(Array& arr) { int i = 0; int j = arr.size() - 1; while(i < j) { swap_elements(arr[i++], arr[j--]); } } //------------------------------------------------------binary_search_pos template<class Array, class Value, class Less> unsigned binary_search_pos(const Array& arr, const Value& val, Less less) { if(arr.size() == 0) return 0; unsigned beg = 0; unsigned end = arr.size() - 1; if(less(val, arr[0])) return 0; if(less(arr[end], val)) return end + 1; while(end - beg > 1) { unsigned mid = (end + beg) >> 1; if(less(val, arr[mid])) end = mid; else beg = mid; } //if(beg <= 0 && less(val, arr[0])) return 0; //if(end >= arr.size() - 1 && less(arr[end], val)) ++end; return end; } //----------------------------------------------------------range_adaptor template<class Array> class range_adaptor { public: typedef typename Array::value_type value_type; range_adaptor(Array& array, unsigned start, unsigned size) : m_array(array), m_start(start), m_size(size) {} unsigned size() const { return m_size; } const value_type& operator [] (unsigned i) const { return m_array[m_start + i]; } value_type& operator [] (unsigned i) { return m_array[m_start + i]; } const value_type& at(unsigned i) const { return m_array[m_start + i]; } value_type& at(unsigned i) { return m_array[m_start + i]; } value_type value_at(unsigned i) const { return m_array[m_start + i]; } private: Array& m_array; unsigned m_start; unsigned m_size; }; //---------------------------------------------------------------int_less inline bool int_less(int a, int b) { return a < b; } //------------------------------------------------------------int_greater inline bool int_greater(int a, int b) { return a > b; } //----------------------------------------------------------unsigned_less inline bool unsigned_less(unsigned a, unsigned b) { return a < b; } //-------------------------------------------------------unsigned_greater inline bool unsigned_greater(unsigned a, unsigned b) { return a > b; } } #endif ������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_arrowhead.h���������������������������������������������������������������0000644�0000000�0000000�00000004774�10703246330�017660� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_ARROWHEAD_INCLUDED #define AGG_ARROWHEAD_INCLUDED #include "agg_basics.h" namespace agg { //===============================================================arrowhead // // See implementation agg_arrowhead.cpp // class arrowhead { public: arrowhead(); void head(double d1, double d2, double d3, double d4) { m_head_d1 = d1; m_head_d2 = d2; m_head_d3 = d3; m_head_d4 = d4; m_head_flag = true; } void head() { m_head_flag = true; } void no_head() { m_head_flag = false; } void tail(double d1, double d2, double d3, double d4) { m_tail_d1 = d1; m_tail_d2 = d2; m_tail_d3 = d3; m_tail_d4 = d4; m_tail_flag = true; } void tail() { m_tail_flag = true; } void no_tail() { m_tail_flag = false; } void rewind(unsigned path_id); unsigned vertex(double* x, double* y); private: double m_head_d1; double m_head_d2; double m_head_d3; double m_head_d4; double m_tail_d1; double m_tail_d2; double m_tail_d3; double m_tail_d4; bool m_head_flag; bool m_tail_flag; double m_coord[16]; unsigned m_cmd[8]; unsigned m_curr_id; unsigned m_curr_coord; }; } #endif ����agg-2.5+dfsg1/include/agg_basics.h������������������������������������������������������������������0000644�0000000�0000000�00000041413�10703246330�017137� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_BASICS_INCLUDED #define AGG_BASICS_INCLUDED #include <math.h> #include "agg_config.h" //---------------------------------------------------------AGG_CUSTOM_ALLOCATOR #ifdef AGG_CUSTOM_ALLOCATOR #include "agg_allocator.h" #else namespace agg { // The policy of all AGG containers and memory allocation strategy // in general is that no allocated data requires explicit construction. // It means that the allocator can be really simple; you can even // replace new/delete to malloc/free. The constructors and destructors // won't be called in this case, however everything will remain working. // The second argument of deallocate() is the size of the allocated // block. You can use this information if you wish. //------------------------------------------------------------pod_allocator template<class T> struct pod_allocator { static T* allocate(unsigned num) { return new T [num]; } static void deallocate(T* ptr, unsigned) { delete [] ptr; } }; // Single object allocator. It's also can be replaced with your custom // allocator. The difference is that it can only allocate a single // object and the constructor and destructor must be called. // In AGG there is no need to allocate an array of objects with // calling their constructors (only single ones). So that, if you // replace these new/delete to malloc/free make sure that the in-place // new is called and take care of calling the destructor too. //------------------------------------------------------------obj_allocator template<class T> struct obj_allocator { static T* allocate() { return new T; } static void deallocate(T* ptr) { delete ptr; } }; } #endif //-------------------------------------------------------- Default basic types // // If the compiler has different capacity of the basic types you can redefine // them via the compiler command line or by generating agg_config.h that is // empty by default. // #ifndef AGG_INT8 #define AGG_INT8 signed char #endif #ifndef AGG_INT8U #define AGG_INT8U unsigned char #endif #ifndef AGG_INT16 #define AGG_INT16 short #endif #ifndef AGG_INT16U #define AGG_INT16U unsigned short #endif #ifndef AGG_INT32 #define AGG_INT32 int #endif #ifndef AGG_INT32U #define AGG_INT32U unsigned #endif #ifndef AGG_INT64 #if defined(_MSC_VER) || defined(__BORLANDC__) #define AGG_INT64 signed __int64 #else #define AGG_INT64 signed long long #endif #endif #ifndef AGG_INT64U #if defined(_MSC_VER) || defined(__BORLANDC__) #define AGG_INT64U unsigned __int64 #else #define AGG_INT64U unsigned long long #endif #endif //------------------------------------------------ Some fixes for MS Visual C++ #if defined(_MSC_VER) #pragma warning(disable:4786) // Identifier was truncated... #endif #if defined(_MSC_VER) #define AGG_INLINE __forceinline #else #define AGG_INLINE inline #endif namespace agg { //------------------------------------------------------------------------- typedef AGG_INT8 int8; //----int8 typedef AGG_INT8U int8u; //----int8u typedef AGG_INT16 int16; //----int16 typedef AGG_INT16U int16u; //----int16u typedef AGG_INT32 int32; //----int32 typedef AGG_INT32U int32u; //----int32u typedef AGG_INT64 int64; //----int64 typedef AGG_INT64U int64u; //----int64u #if defined(AGG_FISTP) #pragma warning(push) #pragma warning(disable : 4035) //Disable warning "no return value" AGG_INLINE int iround(double v) //-------iround { int t; __asm fld qword ptr [v] __asm fistp dword ptr [t] __asm mov eax, dword ptr [t] } AGG_INLINE unsigned uround(double v) //-------uround { unsigned t; __asm fld qword ptr [v] __asm fistp dword ptr [t] __asm mov eax, dword ptr [t] } #pragma warning(pop) AGG_INLINE unsigned ufloor(double v) //-------ufloor { return unsigned(floor(v)); } AGG_INLINE unsigned uceil(double v) //--------uceil { return unsigned(ceil(v)); } #elif defined(AGG_QIFIST) AGG_INLINE int iround(double v) { return int(v); } AGG_INLINE int uround(double v) { return unsigned(v); } AGG_INLINE unsigned ufloor(double v) { return unsigned(floor(v)); } AGG_INLINE unsigned uceil(double v) { return unsigned(ceil(v)); } #else AGG_INLINE int iround(double v) { return int((v < 0.0) ? v - 0.5 : v + 0.5); } AGG_INLINE int uround(double v) { return unsigned(v + 0.5); } AGG_INLINE unsigned ufloor(double v) { return unsigned(v); } AGG_INLINE unsigned uceil(double v) { return unsigned(ceil(v)); } #endif //---------------------------------------------------------------saturation template<int Limit> struct saturation { AGG_INLINE static int iround(double v) { if(v < double(-Limit)) return -Limit; if(v > double( Limit)) return Limit; return agg::iround(v); } }; //------------------------------------------------------------------mul_one template<unsigned Shift> struct mul_one { AGG_INLINE static unsigned mul(unsigned a, unsigned b) { register unsigned q = a * b + (1 << (Shift-1)); return (q + (q >> Shift)) >> Shift; } }; //------------------------------------------------------------------------- typedef unsigned char cover_type; //----cover_type enum cover_scale_e { 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 }; //----------------------------------------------------poly_subpixel_scale_e // 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_subpixel_shift, i.e, for 32-bit integers and // 8-bits fractional part the capacity is 24 bits. enum poly_subpixel_scale_e { poly_subpixel_shift = 8, //----poly_subpixel_shift poly_subpixel_scale = 1<<poly_subpixel_shift, //----poly_subpixel_scale poly_subpixel_mask = poly_subpixel_scale-1, //----poly_subpixel_mask }; //----------------------------------------------------------filling_rule_e enum filling_rule_e { fill_non_zero, fill_even_odd }; //-----------------------------------------------------------------------pi const double pi = 3.14159265358979323846; //------------------------------------------------------------------deg2rad inline double deg2rad(double deg) { return deg * pi / 180.0; } //------------------------------------------------------------------rad2deg inline double rad2deg(double rad) { return rad * 180.0 / pi; } //----------------------------------------------------------------rect_base template<class T> struct rect_base { typedef T value_type; typedef rect_base<T> self_type; T x1, y1, x2, y2; rect_base() {} rect_base(T x1_, T y1_, T x2_, T y2_) : x1(x1_), y1(y1_), x2(x2_), y2(y2_) {} void init(T x1_, T y1_, T x2_, T y2_) { x1 = x1_; y1 = y1_; x2 = x2_; y2 = y2_; } const self_type& normalize() { T t; if(x1 > x2) { t = x1; x1 = x2; x2 = t; } if(y1 > y2) { t = y1; y1 = y2; y2 = t; } return *this; } bool clip(const self_type& r) { if(x2 > r.x2) x2 = r.x2; if(y2 > r.y2) y2 = r.y2; if(x1 < r.x1) x1 = r.x1; if(y1 < r.y1) y1 = r.y1; return x1 <= x2 && y1 <= y2; } bool is_valid() const { return x1 <= x2 && y1 <= y2; } bool hit_test(T x, T y) const { return (x >= x1 && x <= x2 && y >= y1 && y <= y2); } }; //-----------------------------------------------------intersect_rectangles template<class Rect> inline Rect intersect_rectangles(const Rect& r1, const Rect& r2) { Rect r = r1; // First process x2,y2 because the other order // results in Internal Compiler Error under // Microsoft Visual C++ .NET 2003 69462-335-0000007-18038 in // case of "Maximize Speed" optimization option. //----------------- if(r.x2 > r2.x2) r.x2 = r2.x2; if(r.y2 > r2.y2) r.y2 = r2.y2; if(r.x1 < r2.x1) r.x1 = r2.x1; if(r.y1 < r2.y1) r.y1 = r2.y1; return r; } //---------------------------------------------------------unite_rectangles template<class Rect> inline Rect unite_rectangles(const Rect& r1, const Rect& r2) { Rect r = r1; if(r.x2 < r2.x2) r.x2 = r2.x2; if(r.y2 < r2.y2) r.y2 = r2.y2; if(r.x1 > r2.x1) r.x1 = r2.x1; if(r.y1 > r2.y1) r.y1 = r2.y1; return r; } typedef rect_base<int> rect_i; //----rect_i typedef rect_base<float> rect_f; //----rect_f typedef rect_base<double> rect_d; //----rect_d //---------------------------------------------------------path_commands_e enum path_commands_e { path_cmd_stop = 0, //----path_cmd_stop path_cmd_move_to = 1, //----path_cmd_move_to path_cmd_line_to = 2, //----path_cmd_line_to path_cmd_curve3 = 3, //----path_cmd_curve3 path_cmd_curve4 = 4, //----path_cmd_curve4 path_cmd_curveN = 5, //----path_cmd_curveN path_cmd_catrom = 6, //----path_cmd_catrom path_cmd_ubspline = 7, //----path_cmd_ubspline path_cmd_end_poly = 0x0F, //----path_cmd_end_poly path_cmd_mask = 0x0F //----path_cmd_mask }; //------------------------------------------------------------path_flags_e enum path_flags_e { path_flags_none = 0, //----path_flags_none path_flags_ccw = 0x10, //----path_flags_ccw path_flags_cw = 0x20, //----path_flags_cw path_flags_close = 0x40, //----path_flags_close path_flags_mask = 0xF0 //----path_flags_mask }; //---------------------------------------------------------------is_vertex inline bool is_vertex(unsigned c) { return c >= path_cmd_move_to && c < path_cmd_end_poly; } //--------------------------------------------------------------is_drawing inline bool is_drawing(unsigned c) { return c >= path_cmd_line_to && c < path_cmd_end_poly; } //-----------------------------------------------------------------is_stop inline bool is_stop(unsigned c) { return c == path_cmd_stop; } //--------------------------------------------------------------is_move_to inline bool is_move_to(unsigned c) { return c == path_cmd_move_to; } //--------------------------------------------------------------is_line_to inline bool is_line_to(unsigned c) { return c == path_cmd_line_to; } //----------------------------------------------------------------is_curve inline bool is_curve(unsigned c) { return c == path_cmd_curve3 || c == path_cmd_curve4; } //---------------------------------------------------------------is_curve3 inline bool is_curve3(unsigned c) { return c == path_cmd_curve3; } //---------------------------------------------------------------is_curve4 inline bool is_curve4(unsigned c) { return c == path_cmd_curve4; } //-------------------------------------------------------------is_end_poly inline bool is_end_poly(unsigned c) { return (c & path_cmd_mask) == path_cmd_end_poly; } //----------------------------------------------------------------is_close inline bool is_close(unsigned c) { return (c & ~(path_flags_cw | path_flags_ccw)) == (path_cmd_end_poly | path_flags_close); } //------------------------------------------------------------is_next_poly inline bool is_next_poly(unsigned c) { return is_stop(c) || is_move_to(c) || is_end_poly(c); } //-------------------------------------------------------------------is_cw inline bool is_cw(unsigned c) { return (c & path_flags_cw) != 0; } //------------------------------------------------------------------is_ccw inline bool is_ccw(unsigned c) { return (c & path_flags_ccw) != 0; } //-------------------------------------------------------------is_oriented inline bool is_oriented(unsigned c) { return (c & (path_flags_cw | path_flags_ccw)) != 0; } //---------------------------------------------------------------is_closed inline bool is_closed(unsigned c) { return (c & path_flags_close) != 0; } //----------------------------------------------------------get_close_flag inline unsigned get_close_flag(unsigned c) { return c & path_flags_close; } //-------------------------------------------------------clear_orientation inline unsigned clear_orientation(unsigned c) { return c & ~(path_flags_cw | path_flags_ccw); } //---------------------------------------------------------get_orientation inline unsigned get_orientation(unsigned c) { return c & (path_flags_cw | path_flags_ccw); } //---------------------------------------------------------set_orientation inline unsigned set_orientation(unsigned c, unsigned o) { return clear_orientation(c) | o; } //--------------------------------------------------------------point_base template<class T> struct point_base { typedef T value_type; T x,y; point_base() {} point_base(T x_, T y_) : x(x_), y(y_) {} }; typedef point_base<int> point_i; //-----point_i typedef point_base<float> point_f; //-----point_f typedef point_base<double> point_d; //-----point_d //-------------------------------------------------------------vertex_base template<class T> struct vertex_base { typedef T value_type; T x,y; unsigned cmd; vertex_base() {} vertex_base(T x_, T y_, unsigned cmd_) : x(x_), y(y_), cmd(cmd_) {} }; typedef vertex_base<int> vertex_i; //-----vertex_i typedef vertex_base<float> vertex_f; //-----vertex_f typedef vertex_base<double> vertex_d; //-----vertex_d //----------------------------------------------------------------row_info template<class T> struct row_info { int x1, x2; T* ptr; row_info() {} row_info(int x1_, int x2_, T* ptr_) : x1(x1_), x2(x2_), ptr(ptr_) {} }; //----------------------------------------------------------const_row_info template<class T> struct const_row_info { int x1, x2; const T* ptr; const_row_info() {} const_row_info(int x1_, int x2_, const T* ptr_) : x1(x1_), x2(x2_), ptr(ptr_) {} }; //------------------------------------------------------------is_equal_eps template<class T> inline bool is_equal_eps(T v1, T v2, T epsilon) { return fabs(v1 - v2) <= double(epsilon); } } #endif �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_bezier_arc.h��������������������������������������������������������������0000644�0000000�0000000�00000013470�10703246330�020002� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_BEZIER_ARC_INCLUDED #define AGG_BEZIER_ARC_INCLUDED #include "agg_conv_transform.h" namespace agg { //----------------------------------------------------------------------- void arc_to_bezier(double cx, double cy, double rx, double ry, double start_angle, double sweep_angle, double* curve); //==============================================================bezier_arc // // See implemantaion agg_bezier_arc.cpp // class bezier_arc { public: //-------------------------------------------------------------------- bezier_arc() : m_vertex(26), m_num_vertices(0), m_cmd(path_cmd_line_to) {} bezier_arc(double x, double y, double rx, double ry, double start_angle, double sweep_angle) { init(x, y, rx, ry, start_angle, sweep_angle); } //-------------------------------------------------------------------- void init(double x, double y, double rx, double ry, double start_angle, double sweep_angle); //-------------------------------------------------------------------- void rewind(unsigned) { m_vertex = 0; } //-------------------------------------------------------------------- unsigned vertex(double* x, double* y) { if(m_vertex >= m_num_vertices) return path_cmd_stop; *x = m_vertices[m_vertex]; *y = m_vertices[m_vertex + 1]; m_vertex += 2; return (m_vertex == 2) ? path_cmd_move_to : m_cmd; } // Supplemantary functions. num_vertices() actually returns doubled // number of vertices. That is, for 1 vertex it returns 2. //-------------------------------------------------------------------- unsigned num_vertices() const { return m_num_vertices; } const double* vertices() const { return m_vertices; } double* vertices() { return m_vertices; } private: unsigned m_vertex; unsigned m_num_vertices; double m_vertices[26]; unsigned m_cmd; }; //==========================================================bezier_arc_svg // Compute an SVG-style bezier arc. // // Computes an elliptical arc from (x1, y1) to (x2, y2). The size and // orientation of the ellipse are defined by two radii (rx, ry) // and an x-axis-rotation, which indicates how the ellipse as a whole // is rotated relative to the current coordinate system. The center // (cx, cy) of the ellipse is calculated automatically to satisfy the // constraints imposed by the other parameters. // large-arc-flag and sweep-flag contribute to the automatic calculations // and help determine how the arc is drawn. class bezier_arc_svg { public: //-------------------------------------------------------------------- bezier_arc_svg() : m_arc(), m_radii_ok(false) {} bezier_arc_svg(double x1, double y1, double rx, double ry, double angle, bool large_arc_flag, bool sweep_flag, double x2, double y2) : m_arc(), m_radii_ok(false) { init(x1, y1, rx, ry, angle, large_arc_flag, sweep_flag, x2, y2); } //-------------------------------------------------------------------- void init(double x1, double y1, double rx, double ry, double angle, bool large_arc_flag, bool sweep_flag, double x2, double y2); //-------------------------------------------------------------------- bool radii_ok() const { return m_radii_ok; } //-------------------------------------------------------------------- void rewind(unsigned) { m_arc.rewind(0); } //-------------------------------------------------------------------- unsigned vertex(double* x, double* y) { return m_arc.vertex(x, y); } // Supplemantary functions. num_vertices() actually returns doubled // number of vertices. That is, for 1 vertex it returns 2. //-------------------------------------------------------------------- unsigned num_vertices() const { return m_arc.num_vertices(); } const double* vertices() const { return m_arc.vertices(); } double* vertices() { return m_arc.vertices(); } private: bezier_arc m_arc; bool m_radii_ok; }; } #endif ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_bitset_iterator.h���������������������������������������������������������0000644�0000000�0000000�00000003364�10703246330�021101� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_BITSET_ITERATOR_INCLUDED #define AGG_BITSET_ITERATOR_INCLUDED #include "agg_basics.h" namespace agg { class bitset_iterator { public: bitset_iterator(const int8u* bits, unsigned offset = 0) : m_bits(bits + (offset >> 3)), m_mask(0x80 >> (offset & 7)) {} void operator ++ () { m_mask >>= 1; if(m_mask == 0) { ++m_bits; m_mask = 0x80; } } unsigned bit() const { return (*m_bits) & m_mask; } private: const int8u* m_bits; int8u m_mask; }; } #endif ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_blur.h��������������������������������������������������������������������0000644�0000000�0000000�00000130515�10703246330�016641� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- // // The Stack Blur Algorithm was invented by Mario Klingemann, // mario@quasimondo.com and described here: // http://incubator.quasimondo.com/processing/fast_blur_deluxe.php // (search phrase "Stackblur: Fast But Goodlooking"). // The major improvement is that there's no more division table // that was very expensive to create for large blur radii. Insted, // for 8-bit per channel and radius not exceeding 254 the division is // replaced by multiplication and shift. // //---------------------------------------------------------------------------- #ifndef AGG_BLUR_INCLUDED #define AGG_BLUR_INCLUDED #include "agg_array.h" #include "agg_pixfmt_transposer.h" namespace agg { template<class T> struct stack_blur_tables { static int16u const g_stack_blur8_mul[255]; static int8u const g_stack_blur8_shr[255]; }; //------------------------------------------------------------------------ template<class T> int16u const stack_blur_tables<T>::g_stack_blur8_mul[255] = { 512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512, 454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512, 482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456, 437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512, 497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328, 320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456, 446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335, 329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512, 505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405, 399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328, 324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271, 268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456, 451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388, 385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335, 332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292, 289,287,285,282,280,278,275,273,271,269,267,265,263,261,259 }; //------------------------------------------------------------------------ template<class T> int8u const stack_blur_tables<T>::g_stack_blur8_shr[255] = { 9, 11, 12, 13, 13, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }; //==============================================================stack_blur template<class ColorT, class CalculatorT> class stack_blur { public: typedef ColorT color_type; typedef CalculatorT calculator_type; //-------------------------------------------------------------------- template<class Img> void blur_x(Img& img, unsigned radius) { if(radius < 1) return; unsigned x, y, xp, i; unsigned stack_ptr; unsigned stack_start; color_type pix; color_type* stack_pix; calculator_type sum; calculator_type sum_in; calculator_type sum_out; unsigned w = img.width(); unsigned h = img.height(); unsigned wm = w - 1; unsigned div = radius * 2 + 1; unsigned div_sum = (radius + 1) * (radius + 1); unsigned mul_sum = 0; unsigned shr_sum = 0; unsigned max_val = color_type::base_mask; if(max_val <= 255 && radius < 255) { mul_sum = stack_blur_tables<int>::g_stack_blur8_mul[radius]; shr_sum = stack_blur_tables<int>::g_stack_blur8_shr[radius]; } m_buf.allocate(w, 128); m_stack.allocate(div, 32); for(y = 0; y < h; y++) { sum.clear(); sum_in.clear(); sum_out.clear(); pix = img.pixel(0, y); for(i = 0; i <= radius; i++) { m_stack[i] = pix; sum.add(pix, i + 1); sum_out.add(pix); } for(i = 1; i <= radius; i++) { pix = img.pixel((i > wm) ? wm : i, y); m_stack[i + radius] = pix; sum.add(pix, radius + 1 - i); sum_in.add(pix); } stack_ptr = radius; for(x = 0; x < w; x++) { if(mul_sum) sum.calc_pix(m_buf[x], mul_sum, shr_sum); else sum.calc_pix(m_buf[x], div_sum); sum.sub(sum_out); stack_start = stack_ptr + div - radius; if(stack_start >= div) stack_start -= div; stack_pix = &m_stack[stack_start]; sum_out.sub(*stack_pix); xp = x + radius + 1; if(xp > wm) xp = wm; pix = img.pixel(xp, y); *stack_pix = pix; sum_in.add(pix); sum.add(sum_in); ++stack_ptr; if(stack_ptr >= div) stack_ptr = 0; stack_pix = &m_stack[stack_ptr]; sum_out.add(*stack_pix); sum_in.sub(*stack_pix); } img.copy_color_hspan(0, y, w, &m_buf[0]); } } //-------------------------------------------------------------------- template<class Img> void blur_y(Img& img, unsigned radius) { pixfmt_transposer<Img> img2(img); blur_x(img2, radius); } //-------------------------------------------------------------------- template<class Img> void blur(Img& img, unsigned radius) { blur_x(img, radius); pixfmt_transposer<Img> img2(img); blur_x(img2, radius); } private: pod_vector<color_type> m_buf; pod_vector<color_type> m_stack; }; //====================================================stack_blur_calc_rgba template<class T=unsigned> struct stack_blur_calc_rgba { typedef T value_type; value_type r,g,b,a; AGG_INLINE void clear() { r = g = b = a = 0; } template<class ArgT> AGG_INLINE void add(const ArgT& v) { r += v.r; g += v.g; b += v.b; a += v.a; } template<class ArgT> AGG_INLINE void add(const ArgT& v, unsigned k) { r += v.r * k; g += v.g * k; b += v.b * k; a += v.a * k; } template<class ArgT> AGG_INLINE void sub(const ArgT& v) { r -= v.r; g -= v.g; b -= v.b; a -= v.a; } template<class ArgT> AGG_INLINE void calc_pix(ArgT& v, unsigned div) { typedef typename ArgT::value_type value_type; v.r = value_type(r / div); v.g = value_type(g / div); v.b = value_type(b / div); v.a = value_type(a / div); } template<class ArgT> AGG_INLINE void calc_pix(ArgT& v, unsigned mul, unsigned shr) { typedef typename ArgT::value_type value_type; v.r = value_type((r * mul) >> shr); v.g = value_type((g * mul) >> shr); v.b = value_type((b * mul) >> shr); v.a = value_type((a * mul) >> shr); } }; //=====================================================stack_blur_calc_rgb template<class T=unsigned> struct stack_blur_calc_rgb { typedef T value_type; value_type r,g,b; AGG_INLINE void clear() { r = g = b = 0; } template<class ArgT> AGG_INLINE void add(const ArgT& v) { r += v.r; g += v.g; b += v.b; } template<class ArgT> AGG_INLINE void add(const ArgT& v, unsigned k) { r += v.r * k; g += v.g * k; b += v.b * k; } template<class ArgT> AGG_INLINE void sub(const ArgT& v) { r -= v.r; g -= v.g; b -= v.b; } template<class ArgT> AGG_INLINE void calc_pix(ArgT& v, unsigned div) { typedef typename ArgT::value_type value_type; v.r = value_type(r / div); v.g = value_type(g / div); v.b = value_type(b / div); } template<class ArgT> AGG_INLINE void calc_pix(ArgT& v, unsigned mul, unsigned shr) { typedef typename ArgT::value_type value_type; v.r = value_type((r * mul) >> shr); v.g = value_type((g * mul) >> shr); v.b = value_type((b * mul) >> shr); } }; //====================================================stack_blur_calc_gray template<class T=unsigned> struct stack_blur_calc_gray { typedef T value_type; value_type v; AGG_INLINE void clear() { v = 0; } template<class ArgT> AGG_INLINE void add(const ArgT& a) { v += a.v; } template<class ArgT> AGG_INLINE void add(const ArgT& a, unsigned k) { v += a.v * k; } template<class ArgT> AGG_INLINE void sub(const ArgT& a) { v -= a.v; } template<class ArgT> AGG_INLINE void calc_pix(ArgT& a, unsigned div) { typedef typename ArgT::value_type value_type; a.v = value_type(v / div); } template<class ArgT> AGG_INLINE void calc_pix(ArgT& a, unsigned mul, unsigned shr) { typedef typename ArgT::value_type value_type; a.v = value_type((v * mul) >> shr); } }; //========================================================stack_blur_gray8 template<class Img> void stack_blur_gray8(Img& img, unsigned rx, unsigned ry) { unsigned x, y, xp, yp, i; unsigned stack_ptr; unsigned stack_start; const int8u* src_pix_ptr; int8u* dst_pix_ptr; unsigned pix; unsigned stack_pix; unsigned sum; unsigned sum_in; unsigned sum_out; unsigned w = img.width(); unsigned h = img.height(); unsigned wm = w - 1; unsigned hm = h - 1; unsigned div; unsigned mul_sum; unsigned shr_sum; pod_vector<int8u> stack; if(rx > 0) { if(rx > 254) rx = 254; div = rx * 2 + 1; mul_sum = stack_blur_tables<int>::g_stack_blur8_mul[rx]; shr_sum = stack_blur_tables<int>::g_stack_blur8_shr[rx]; stack.allocate(div); for(y = 0; y < h; y++) { sum = sum_in = sum_out = 0; src_pix_ptr = img.pix_ptr(0, y); pix = *src_pix_ptr; for(i = 0; i <= rx; i++) { stack[i] = pix; sum += pix * (i + 1); sum_out += pix; } for(i = 1; i <= rx; i++) { if(i <= wm) src_pix_ptr += Img::pix_step; pix = *src_pix_ptr; stack[i + rx] = pix; sum += pix * (rx + 1 - i); sum_in += pix; } stack_ptr = rx; xp = rx; if(xp > wm) xp = wm; src_pix_ptr = img.pix_ptr(xp, y); dst_pix_ptr = img.pix_ptr(0, y); for(x = 0; x < w; x++) { *dst_pix_ptr = (sum * mul_sum) >> shr_sum; dst_pix_ptr += Img::pix_step; sum -= sum_out; stack_start = stack_ptr + div - rx; if(stack_start >= div) stack_start -= div; sum_out -= stack[stack_start]; if(xp < wm) { src_pix_ptr += Img::pix_step; pix = *src_pix_ptr; ++xp; } stack[stack_start] = pix; sum_in += pix; sum += sum_in; ++stack_ptr; if(stack_ptr >= div) stack_ptr = 0; stack_pix = stack[stack_ptr]; sum_out += stack_pix; sum_in -= stack_pix; } } } if(ry > 0) { if(ry > 254) ry = 254; div = ry * 2 + 1; mul_sum = stack_blur_tables<int>::g_stack_blur8_mul[ry]; shr_sum = stack_blur_tables<int>::g_stack_blur8_shr[ry]; stack.allocate(div); int stride = img.stride(); for(x = 0; x < w; x++) { sum = sum_in = sum_out = 0; src_pix_ptr = img.pix_ptr(x, 0); pix = *src_pix_ptr; for(i = 0; i <= ry; i++) { stack[i] = pix; sum += pix * (i + 1); sum_out += pix; } for(i = 1; i <= ry; i++) { if(i <= hm) src_pix_ptr += stride; pix = *src_pix_ptr; stack[i + ry] = pix; sum += pix * (ry + 1 - i); sum_in += pix; } stack_ptr = ry; yp = ry; if(yp > hm) yp = hm; src_pix_ptr = img.pix_ptr(x, yp); dst_pix_ptr = img.pix_ptr(x, 0); for(y = 0; y < h; y++) { *dst_pix_ptr = (sum * mul_sum) >> shr_sum; dst_pix_ptr += stride; sum -= sum_out; stack_start = stack_ptr + div - ry; if(stack_start >= div) stack_start -= div; sum_out -= stack[stack_start]; if(yp < hm) { src_pix_ptr += stride; pix = *src_pix_ptr; ++yp; } stack[stack_start] = pix; sum_in += pix; sum += sum_in; ++stack_ptr; if(stack_ptr >= div) stack_ptr = 0; stack_pix = stack[stack_ptr]; sum_out += stack_pix; sum_in -= stack_pix; } } } } //========================================================stack_blur_rgb24 template<class Img> void stack_blur_rgb24(Img& img, unsigned rx, unsigned ry) { typedef typename Img::color_type color_type; typedef typename Img::order_type order_type; enum order_e { R = order_type::R, G = order_type::G, B = order_type::B }; unsigned x, y, xp, yp, i; unsigned stack_ptr; unsigned stack_start; const int8u* src_pix_ptr; int8u* dst_pix_ptr; color_type* stack_pix_ptr; unsigned sum_r; unsigned sum_g; unsigned sum_b; unsigned sum_in_r; unsigned sum_in_g; unsigned sum_in_b; unsigned sum_out_r; unsigned sum_out_g; unsigned sum_out_b; unsigned w = img.width(); unsigned h = img.height(); unsigned wm = w - 1; unsigned hm = h - 1; unsigned div; unsigned mul_sum; unsigned shr_sum; pod_vector<color_type> stack; if(rx > 0) { if(rx > 254) rx = 254; div = rx * 2 + 1; mul_sum = stack_blur_tables<int>::g_stack_blur8_mul[rx]; shr_sum = stack_blur_tables<int>::g_stack_blur8_shr[rx]; stack.allocate(div); for(y = 0; y < h; y++) { sum_r = sum_g = sum_b = sum_in_r = sum_in_g = sum_in_b = sum_out_r = sum_out_g = sum_out_b = 0; src_pix_ptr = img.pix_ptr(0, y); for(i = 0; i <= rx; i++) { stack_pix_ptr = &stack[i]; stack_pix_ptr->r = src_pix_ptr[R]; stack_pix_ptr->g = src_pix_ptr[G]; stack_pix_ptr->b = src_pix_ptr[B]; sum_r += src_pix_ptr[R] * (i + 1); sum_g += src_pix_ptr[G] * (i + 1); sum_b += src_pix_ptr[B] * (i + 1); sum_out_r += src_pix_ptr[R]; sum_out_g += src_pix_ptr[G]; sum_out_b += src_pix_ptr[B]; } for(i = 1; i <= rx; i++) { if(i <= wm) src_pix_ptr += Img::pix_width; stack_pix_ptr = &stack[i + rx]; stack_pix_ptr->r = src_pix_ptr[R]; stack_pix_ptr->g = src_pix_ptr[G]; stack_pix_ptr->b = src_pix_ptr[B]; sum_r += src_pix_ptr[R] * (rx + 1 - i); sum_g += src_pix_ptr[G] * (rx + 1 - i); sum_b += src_pix_ptr[B] * (rx + 1 - i); sum_in_r += src_pix_ptr[R]; sum_in_g += src_pix_ptr[G]; sum_in_b += src_pix_ptr[B]; } stack_ptr = rx; xp = rx; if(xp > wm) xp = wm; src_pix_ptr = img.pix_ptr(xp, y); dst_pix_ptr = img.pix_ptr(0, y); for(x = 0; x < w; x++) { dst_pix_ptr[R] = (sum_r * mul_sum) >> shr_sum; dst_pix_ptr[G] = (sum_g * mul_sum) >> shr_sum; dst_pix_ptr[B] = (sum_b * mul_sum) >> shr_sum; dst_pix_ptr += Img::pix_width; sum_r -= sum_out_r; sum_g -= sum_out_g; sum_b -= sum_out_b; stack_start = stack_ptr + div - rx; if(stack_start >= div) stack_start -= div; stack_pix_ptr = &stack[stack_start]; sum_out_r -= stack_pix_ptr->r; sum_out_g -= stack_pix_ptr->g; sum_out_b -= stack_pix_ptr->b; if(xp < wm) { src_pix_ptr += Img::pix_width; ++xp; } stack_pix_ptr->r = src_pix_ptr[R]; stack_pix_ptr->g = src_pix_ptr[G]; stack_pix_ptr->b = src_pix_ptr[B]; sum_in_r += src_pix_ptr[R]; sum_in_g += src_pix_ptr[G]; sum_in_b += src_pix_ptr[B]; sum_r += sum_in_r; sum_g += sum_in_g; sum_b += sum_in_b; ++stack_ptr; if(stack_ptr >= div) stack_ptr = 0; stack_pix_ptr = &stack[stack_ptr]; sum_out_r += stack_pix_ptr->r; sum_out_g += stack_pix_ptr->g; sum_out_b += stack_pix_ptr->b; sum_in_r -= stack_pix_ptr->r; sum_in_g -= stack_pix_ptr->g; sum_in_b -= stack_pix_ptr->b; } } } if(ry > 0) { if(ry > 254) ry = 254; div = ry * 2 + 1; mul_sum = stack_blur_tables<int>::g_stack_blur8_mul[ry]; shr_sum = stack_blur_tables<int>::g_stack_blur8_shr[ry]; stack.allocate(div); int stride = img.stride(); for(x = 0; x < w; x++) { sum_r = sum_g = sum_b = sum_in_r = sum_in_g = sum_in_b = sum_out_r = sum_out_g = sum_out_b = 0; src_pix_ptr = img.pix_ptr(x, 0); for(i = 0; i <= ry; i++) { stack_pix_ptr = &stack[i]; stack_pix_ptr->r = src_pix_ptr[R]; stack_pix_ptr->g = src_pix_ptr[G]; stack_pix_ptr->b = src_pix_ptr[B]; sum_r += src_pix_ptr[R] * (i + 1); sum_g += src_pix_ptr[G] * (i + 1); sum_b += src_pix_ptr[B] * (i + 1); sum_out_r += src_pix_ptr[R]; sum_out_g += src_pix_ptr[G]; sum_out_b += src_pix_ptr[B]; } for(i = 1; i <= ry; i++) { if(i <= hm) src_pix_ptr += stride; stack_pix_ptr = &stack[i + ry]; stack_pix_ptr->r = src_pix_ptr[R]; stack_pix_ptr->g = src_pix_ptr[G]; stack_pix_ptr->b = src_pix_ptr[B]; sum_r += src_pix_ptr[R] * (ry + 1 - i); sum_g += src_pix_ptr[G] * (ry + 1 - i); sum_b += src_pix_ptr[B] * (ry + 1 - i); sum_in_r += src_pix_ptr[R]; sum_in_g += src_pix_ptr[G]; sum_in_b += src_pix_ptr[B]; } stack_ptr = ry; yp = ry; if(yp > hm) yp = hm; src_pix_ptr = img.pix_ptr(x, yp); dst_pix_ptr = img.pix_ptr(x, 0); for(y = 0; y < h; y++) { dst_pix_ptr[R] = (sum_r * mul_sum) >> shr_sum; dst_pix_ptr[G] = (sum_g * mul_sum) >> shr_sum; dst_pix_ptr[B] = (sum_b * mul_sum) >> shr_sum; dst_pix_ptr += stride; sum_r -= sum_out_r; sum_g -= sum_out_g; sum_b -= sum_out_b; stack_start = stack_ptr + div - ry; if(stack_start >= div) stack_start -= div; stack_pix_ptr = &stack[stack_start]; sum_out_r -= stack_pix_ptr->r; sum_out_g -= stack_pix_ptr->g; sum_out_b -= stack_pix_ptr->b; if(yp < hm) { src_pix_ptr += stride; ++yp; } stack_pix_ptr->r = src_pix_ptr[R]; stack_pix_ptr->g = src_pix_ptr[G]; stack_pix_ptr->b = src_pix_ptr[B]; sum_in_r += src_pix_ptr[R]; sum_in_g += src_pix_ptr[G]; sum_in_b += src_pix_ptr[B]; sum_r += sum_in_r; sum_g += sum_in_g; sum_b += sum_in_b; ++stack_ptr; if(stack_ptr >= div) stack_ptr = 0; stack_pix_ptr = &stack[stack_ptr]; sum_out_r += stack_pix_ptr->r; sum_out_g += stack_pix_ptr->g; sum_out_b += stack_pix_ptr->b; sum_in_r -= stack_pix_ptr->r; sum_in_g -= stack_pix_ptr->g; sum_in_b -= stack_pix_ptr->b; } } } } //=======================================================stack_blur_rgba32 template<class Img> void stack_blur_rgba32(Img& img, unsigned rx, unsigned ry) { typedef typename Img::color_type color_type; typedef typename Img::order_type order_type; enum order_e { R = order_type::R, G = order_type::G, B = order_type::B, A = order_type::A }; unsigned x, y, xp, yp, i; unsigned stack_ptr; unsigned stack_start; const int8u* src_pix_ptr; int8u* dst_pix_ptr; color_type* stack_pix_ptr; unsigned sum_r; unsigned sum_g; unsigned sum_b; unsigned sum_a; unsigned sum_in_r; unsigned sum_in_g; unsigned sum_in_b; unsigned sum_in_a; unsigned sum_out_r; unsigned sum_out_g; unsigned sum_out_b; unsigned sum_out_a; unsigned w = img.width(); unsigned h = img.height(); unsigned wm = w - 1; unsigned hm = h - 1; unsigned div; unsigned mul_sum; unsigned shr_sum; pod_vector<color_type> stack; if(rx > 0) { if(rx > 254) rx = 254; div = rx * 2 + 1; mul_sum = stack_blur_tables<int>::g_stack_blur8_mul[rx]; shr_sum = stack_blur_tables<int>::g_stack_blur8_shr[rx]; stack.allocate(div); for(y = 0; y < h; y++) { sum_r = sum_g = sum_b = sum_a = sum_in_r = sum_in_g = sum_in_b = sum_in_a = sum_out_r = sum_out_g = sum_out_b = sum_out_a = 0; src_pix_ptr = img.pix_ptr(0, y); for(i = 0; i <= rx; i++) { stack_pix_ptr = &stack[i]; stack_pix_ptr->r = src_pix_ptr[R]; stack_pix_ptr->g = src_pix_ptr[G]; stack_pix_ptr->b = src_pix_ptr[B]; stack_pix_ptr->a = src_pix_ptr[A]; sum_r += src_pix_ptr[R] * (i + 1); sum_g += src_pix_ptr[G] * (i + 1); sum_b += src_pix_ptr[B] * (i + 1); sum_a += src_pix_ptr[A] * (i + 1); sum_out_r += src_pix_ptr[R]; sum_out_g += src_pix_ptr[G]; sum_out_b += src_pix_ptr[B]; sum_out_a += src_pix_ptr[A]; } for(i = 1; i <= rx; i++) { if(i <= wm) src_pix_ptr += Img::pix_width; stack_pix_ptr = &stack[i + rx]; stack_pix_ptr->r = src_pix_ptr[R]; stack_pix_ptr->g = src_pix_ptr[G]; stack_pix_ptr->b = src_pix_ptr[B]; stack_pix_ptr->a = src_pix_ptr[A]; sum_r += src_pix_ptr[R] * (rx + 1 - i); sum_g += src_pix_ptr[G] * (rx + 1 - i); sum_b += src_pix_ptr[B] * (rx + 1 - i); sum_a += src_pix_ptr[A] * (rx + 1 - i); sum_in_r += src_pix_ptr[R]; sum_in_g += src_pix_ptr[G]; sum_in_b += src_pix_ptr[B]; sum_in_a += src_pix_ptr[A]; } stack_ptr = rx; xp = rx; if(xp > wm) xp = wm; src_pix_ptr = img.pix_ptr(xp, y); dst_pix_ptr = img.pix_ptr(0, y); for(x = 0; x < w; x++) { dst_pix_ptr[R] = (sum_r * mul_sum) >> shr_sum; dst_pix_ptr[G] = (sum_g * mul_sum) >> shr_sum; dst_pix_ptr[B] = (sum_b * mul_sum) >> shr_sum; dst_pix_ptr[A] = (sum_a * mul_sum) >> shr_sum; dst_pix_ptr += Img::pix_width; sum_r -= sum_out_r; sum_g -= sum_out_g; sum_b -= sum_out_b; sum_a -= sum_out_a; stack_start = stack_ptr + div - rx; if(stack_start >= div) stack_start -= div; stack_pix_ptr = &stack[stack_start]; sum_out_r -= stack_pix_ptr->r; sum_out_g -= stack_pix_ptr->g; sum_out_b -= stack_pix_ptr->b; sum_out_a -= stack_pix_ptr->a; if(xp < wm) { src_pix_ptr += Img::pix_width; ++xp; } stack_pix_ptr->r = src_pix_ptr[R]; stack_pix_ptr->g = src_pix_ptr[G]; stack_pix_ptr->b = src_pix_ptr[B]; stack_pix_ptr->a = src_pix_ptr[A]; sum_in_r += src_pix_ptr[R]; sum_in_g += src_pix_ptr[G]; sum_in_b += src_pix_ptr[B]; sum_in_a += src_pix_ptr[A]; sum_r += sum_in_r; sum_g += sum_in_g; sum_b += sum_in_b; sum_a += sum_in_a; ++stack_ptr; if(stack_ptr >= div) stack_ptr = 0; stack_pix_ptr = &stack[stack_ptr]; sum_out_r += stack_pix_ptr->r; sum_out_g += stack_pix_ptr->g; sum_out_b += stack_pix_ptr->b; sum_out_a += stack_pix_ptr->a; sum_in_r -= stack_pix_ptr->r; sum_in_g -= stack_pix_ptr->g; sum_in_b -= stack_pix_ptr->b; sum_in_a -= stack_pix_ptr->a; } } } if(ry > 0) { if(ry > 254) ry = 254; div = ry * 2 + 1; mul_sum = stack_blur_tables<int>::g_stack_blur8_mul[ry]; shr_sum = stack_blur_tables<int>::g_stack_blur8_shr[ry]; stack.allocate(div); int stride = img.stride(); for(x = 0; x < w; x++) { sum_r = sum_g = sum_b = sum_a = sum_in_r = sum_in_g = sum_in_b = sum_in_a = sum_out_r = sum_out_g = sum_out_b = sum_out_a = 0; src_pix_ptr = img.pix_ptr(x, 0); for(i = 0; i <= ry; i++) { stack_pix_ptr = &stack[i]; stack_pix_ptr->r = src_pix_ptr[R]; stack_pix_ptr->g = src_pix_ptr[G]; stack_pix_ptr->b = src_pix_ptr[B]; stack_pix_ptr->a = src_pix_ptr[A]; sum_r += src_pix_ptr[R] * (i + 1); sum_g += src_pix_ptr[G] * (i + 1); sum_b += src_pix_ptr[B] * (i + 1); sum_a += src_pix_ptr[A] * (i + 1); sum_out_r += src_pix_ptr[R]; sum_out_g += src_pix_ptr[G]; sum_out_b += src_pix_ptr[B]; sum_out_a += src_pix_ptr[A]; } for(i = 1; i <= ry; i++) { if(i <= hm) src_pix_ptr += stride; stack_pix_ptr = &stack[i + ry]; stack_pix_ptr->r = src_pix_ptr[R]; stack_pix_ptr->g = src_pix_ptr[G]; stack_pix_ptr->b = src_pix_ptr[B]; stack_pix_ptr->a = src_pix_ptr[A]; sum_r += src_pix_ptr[R] * (ry + 1 - i); sum_g += src_pix_ptr[G] * (ry + 1 - i); sum_b += src_pix_ptr[B] * (ry + 1 - i); sum_a += src_pix_ptr[A] * (ry + 1 - i); sum_in_r += src_pix_ptr[R]; sum_in_g += src_pix_ptr[G]; sum_in_b += src_pix_ptr[B]; sum_in_a += src_pix_ptr[A]; } stack_ptr = ry; yp = ry; if(yp > hm) yp = hm; src_pix_ptr = img.pix_ptr(x, yp); dst_pix_ptr = img.pix_ptr(x, 0); for(y = 0; y < h; y++) { dst_pix_ptr[R] = (sum_r * mul_sum) >> shr_sum; dst_pix_ptr[G] = (sum_g * mul_sum) >> shr_sum; dst_pix_ptr[B] = (sum_b * mul_sum) >> shr_sum; dst_pix_ptr[A] = (sum_a * mul_sum) >> shr_sum; dst_pix_ptr += stride; sum_r -= sum_out_r; sum_g -= sum_out_g; sum_b -= sum_out_b; sum_a -= sum_out_a; stack_start = stack_ptr + div - ry; if(stack_start >= div) stack_start -= div; stack_pix_ptr = &stack[stack_start]; sum_out_r -= stack_pix_ptr->r; sum_out_g -= stack_pix_ptr->g; sum_out_b -= stack_pix_ptr->b; sum_out_a -= stack_pix_ptr->a; if(yp < hm) { src_pix_ptr += stride; ++yp; } stack_pix_ptr->r = src_pix_ptr[R]; stack_pix_ptr->g = src_pix_ptr[G]; stack_pix_ptr->b = src_pix_ptr[B]; stack_pix_ptr->a = src_pix_ptr[A]; sum_in_r += src_pix_ptr[R]; sum_in_g += src_pix_ptr[G]; sum_in_b += src_pix_ptr[B]; sum_in_a += src_pix_ptr[A]; sum_r += sum_in_r; sum_g += sum_in_g; sum_b += sum_in_b; sum_a += sum_in_a; ++stack_ptr; if(stack_ptr >= div) stack_ptr = 0; stack_pix_ptr = &stack[stack_ptr]; sum_out_r += stack_pix_ptr->r; sum_out_g += stack_pix_ptr->g; sum_out_b += stack_pix_ptr->b; sum_out_a += stack_pix_ptr->a; sum_in_r -= stack_pix_ptr->r; sum_in_g -= stack_pix_ptr->g; sum_in_b -= stack_pix_ptr->b; sum_in_a -= stack_pix_ptr->a; } } } } //===========================================================recursive_blur template<class ColorT, class CalculatorT> class recursive_blur { public: typedef ColorT color_type; typedef CalculatorT calculator_type; typedef typename color_type::value_type value_type; typedef typename calculator_type::value_type calc_type; //-------------------------------------------------------------------- template<class Img> void blur_x(Img& img, double radius) { if(radius < 0.62) return; if(img.width() < 3) return; calc_type s = calc_type(radius * 0.5); calc_type q = calc_type((s < 2.5) ? 3.97156 - 4.14554 * sqrt(1 - 0.26891 * s) : 0.98711 * s - 0.96330); calc_type q2 = calc_type(q * q); calc_type q3 = calc_type(q2 * q); calc_type b0 = calc_type(1.0 / (1.578250 + 2.444130 * q + 1.428100 * q2 + 0.422205 * q3)); calc_type b1 = calc_type( 2.44413 * q + 2.85619 * q2 + 1.26661 * q3); calc_type b2 = calc_type(-1.42810 * q2 + -1.26661 * q3); calc_type b3 = calc_type(0.422205 * q3); calc_type b = calc_type(1 - (b1 + b2 + b3) * b0); b1 *= b0; b2 *= b0; b3 *= b0; int w = img.width(); int h = img.height(); int wm = w-1; int x, y; m_sum1.allocate(w); m_sum2.allocate(w); m_buf.allocate(w); for(y = 0; y < h; y++) { calculator_type c; c.from_pix(img.pixel(0, y)); m_sum1[0].calc(b, b1, b2, b3, c, c, c, c); c.from_pix(img.pixel(1, y)); m_sum1[1].calc(b, b1, b2, b3, c, m_sum1[0], m_sum1[0], m_sum1[0]); c.from_pix(img.pixel(2, y)); m_sum1[2].calc(b, b1, b2, b3, c, m_sum1[1], m_sum1[0], m_sum1[0]); for(x = 3; x < w; ++x) { c.from_pix(img.pixel(x, y)); m_sum1[x].calc(b, b1, b2, b3, c, m_sum1[x-1], m_sum1[x-2], m_sum1[x-3]); } m_sum2[wm ].calc(b, b1, b2, b3, m_sum1[wm ], m_sum1[wm ], m_sum1[wm], m_sum1[wm]); m_sum2[wm-1].calc(b, b1, b2, b3, m_sum1[wm-1], m_sum2[wm ], m_sum2[wm], m_sum2[wm]); m_sum2[wm-2].calc(b, b1, b2, b3, m_sum1[wm-2], m_sum2[wm-1], m_sum2[wm], m_sum2[wm]); m_sum2[wm ].to_pix(m_buf[wm ]); m_sum2[wm-1].to_pix(m_buf[wm-1]); m_sum2[wm-2].to_pix(m_buf[wm-2]); for(x = wm-3; x >= 0; --x) { m_sum2[x].calc(b, b1, b2, b3, m_sum1[x], m_sum2[x+1], m_sum2[x+2], m_sum2[x+3]); m_sum2[x].to_pix(m_buf[x]); } img.copy_color_hspan(0, y, w, &m_buf[0]); } } //-------------------------------------------------------------------- template<class Img> void blur_y(Img& img, double radius) { pixfmt_transposer<Img> img2(img); blur_x(img2, radius); } //-------------------------------------------------------------------- template<class Img> void blur(Img& img, double radius) { blur_x(img, radius); pixfmt_transposer<Img> img2(img); blur_x(img2, radius); } private: agg::pod_vector<calculator_type> m_sum1; agg::pod_vector<calculator_type> m_sum2; agg::pod_vector<color_type> m_buf; }; //=================================================recursive_blur_calc_rgba template<class T=double> struct recursive_blur_calc_rgba { typedef T value_type; typedef recursive_blur_calc_rgba<T> self_type; value_type r,g,b,a; template<class ColorT> AGG_INLINE void from_pix(const ColorT& c) { r = c.r; g = c.g; b = c.b; a = c.a; } AGG_INLINE void calc(value_type b1, value_type b2, value_type b3, value_type b4, const self_type& c1, const self_type& c2, const self_type& c3, const self_type& c4) { r = b1*c1.r + b2*c2.r + b3*c3.r + b4*c4.r; g = b1*c1.g + b2*c2.g + b3*c3.g + b4*c4.g; b = b1*c1.b + b2*c2.b + b3*c3.b + b4*c4.b; a = b1*c1.a + b2*c2.a + b3*c3.a + b4*c4.a; } template<class ColorT> AGG_INLINE void to_pix(ColorT& c) const { typedef typename ColorT::value_type cv_type; c.r = (cv_type)uround(r); c.g = (cv_type)uround(g); c.b = (cv_type)uround(b); c.a = (cv_type)uround(a); } }; //=================================================recursive_blur_calc_rgb template<class T=double> struct recursive_blur_calc_rgb { typedef T value_type; typedef recursive_blur_calc_rgb<T> self_type; value_type r,g,b; template<class ColorT> AGG_INLINE void from_pix(const ColorT& c) { r = c.r; g = c.g; b = c.b; } AGG_INLINE void calc(value_type b1, value_type b2, value_type b3, value_type b4, const self_type& c1, const self_type& c2, const self_type& c3, const self_type& c4) { r = b1*c1.r + b2*c2.r + b3*c3.r + b4*c4.r; g = b1*c1.g + b2*c2.g + b3*c3.g + b4*c4.g; b = b1*c1.b + b2*c2.b + b3*c3.b + b4*c4.b; } template<class ColorT> AGG_INLINE void to_pix(ColorT& c) const { typedef typename ColorT::value_type cv_type; c.r = (cv_type)uround(r); c.g = (cv_type)uround(g); c.b = (cv_type)uround(b); } }; //================================================recursive_blur_calc_gray template<class T=double> struct recursive_blur_calc_gray { typedef T value_type; typedef recursive_blur_calc_gray<T> self_type; value_type v; template<class ColorT> AGG_INLINE void from_pix(const ColorT& c) { v = c.v; } AGG_INLINE void calc(value_type b1, value_type b2, value_type b3, value_type b4, const self_type& c1, const self_type& c2, const self_type& c3, const self_type& c4) { v = b1*c1.v + b2*c2.v + b3*c3.v + b4*c4.v; } template<class ColorT> AGG_INLINE void to_pix(ColorT& c) const { typedef typename ColorT::value_type cv_type; c.v = (cv_type)uround(v); } }; } #endif �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_bounding_rect.h�����������������������������������������������������������0000644�0000000�0000000�00000007363�10703246330�020523� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_BOUNDING_RECT_INCLUDED #define AGG_BOUNDING_RECT_INCLUDED #include "agg_basics.h" namespace agg { //-----------------------------------------------------------bounding_rect template<class VertexSource, class GetId, class CoordT> bool bounding_rect(VertexSource& vs, GetId& gi, unsigned start, unsigned num, CoordT* x1, CoordT* y1, CoordT* x2, CoordT* y2) { unsigned i; double x; double y; bool first = true; *x1 = CoordT(1); *y1 = CoordT(1); *x2 = CoordT(0); *y2 = CoordT(0); for(i = 0; i < num; i++) { vs.rewind(gi[start + i]); unsigned cmd; while(!is_stop(cmd = vs.vertex(&x, &y))) { if(is_vertex(cmd)) { if(first) { *x1 = CoordT(x); *y1 = CoordT(y); *x2 = CoordT(x); *y2 = CoordT(y); first = false; } else { if(CoordT(x) < *x1) *x1 = CoordT(x); if(CoordT(y) < *y1) *y1 = CoordT(y); if(CoordT(x) > *x2) *x2 = CoordT(x); if(CoordT(y) > *y2) *y2 = CoordT(y); } } } } return *x1 <= *x2 && *y1 <= *y2; } //-----------------------------------------------------bounding_rect_single template<class VertexSource, class CoordT> bool bounding_rect_single(VertexSource& vs, unsigned path_id, CoordT* x1, CoordT* y1, CoordT* x2, CoordT* y2) { double x; double y; bool first = true; *x1 = CoordT(1); *y1 = CoordT(1); *x2 = CoordT(0); *y2 = CoordT(0); vs.rewind(path_id); unsigned cmd; while(!is_stop(cmd = vs.vertex(&x, &y))) { if(is_vertex(cmd)) { if(first) { *x1 = CoordT(x); *y1 = CoordT(y); *x2 = CoordT(x); *y2 = CoordT(y); first = false; } else { if(CoordT(x) < *x1) *x1 = CoordT(x); if(CoordT(y) < *y1) *y1 = CoordT(y); if(CoordT(x) > *x2) *x2 = CoordT(x); if(CoordT(y) > *y2) *y2 = CoordT(y); } } } return *x1 <= *x2 && *y1 <= *y2; } } #endif �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_bspline.h�����������������������������������������������������������������0000644�0000000�0000000�00000005522�10703246330�017330� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_BSPLINE_INCLUDED #define AGG_BSPLINE_INCLUDED #include "agg_array.h" namespace agg { //----------------------------------------------------------------bspline // A very simple class of Bi-cubic Spline interpolation. // First call init(num, x[], y[]) where num - number of source points, // x, y - arrays of X and Y values respectively. Here Y must be a function // of X. It means that all the X-coordinates must be arranged in the ascending // order. // Then call get(x) that calculates a value Y for the respective X. // The class supports extrapolation, i.e. you can call get(x) where x is // outside the given with init() X-range. Extrapolation is a simple linear // function. // // See Implementation agg_bspline.cpp //------------------------------------------------------------------------ class bspline { public: bspline(); bspline(int num); bspline(int num, const double* x, const double* y); void init(int num); void add_point(double x, double y); void prepare(); void init(int num, const double* x, const double* y); double get(double x) const; double get_stateful(double x) const; private: bspline(const bspline&); const bspline& operator = (const bspline&); static void bsearch(int n, const double *x, double x0, int *i); double extrapolation_left(double x) const; double extrapolation_right(double x) const; double interpolation(double x, int i) const; int m_max; int m_num; double* m_x; double* m_y; pod_array<double> m_am; mutable int m_last_idx; }; } #endif ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_clip_liang_barsky.h�������������������������������������������������������0000644�0000000�0000000�00000023224�10703246330�021347� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_CLIP_LIANG_BARSKY_INCLUDED #define AGG_CLIP_LIANG_BARSKY_INCLUDED #include "agg_basics.h" namespace agg { //------------------------------------------------------------------------ enum clipping_flags_e { clipping_flags_x1_clipped = 4, clipping_flags_x2_clipped = 1, clipping_flags_y1_clipped = 8, clipping_flags_y2_clipped = 2, clipping_flags_x_clipped = clipping_flags_x1_clipped | clipping_flags_x2_clipped, clipping_flags_y_clipped = clipping_flags_y1_clipped | clipping_flags_y2_clipped }; //----------------------------------------------------------clipping_flags // Determine the clipping code of the vertex according to the // Cyrus-Beck line clipping algorithm // // | | // 0110 | 0010 | 0011 // | | // -------+--------+-------- clip_box.y2 // | | // 0100 | 0000 | 0001 // | | // -------+--------+-------- clip_box.y1 // | | // 1100 | 1000 | 1001 // | | // clip_box.x1 clip_box.x2 // // template<class T> inline unsigned clipping_flags(T x, T y, const rect_base<T>& clip_box) { return (x > clip_box.x2) | ((y > clip_box.y2) << 1) | ((x < clip_box.x1) << 2) | ((y < clip_box.y1) << 3); } //--------------------------------------------------------clipping_flags_x template<class T> inline unsigned clipping_flags_x(T x, const rect_base<T>& clip_box) { return (x > clip_box.x2) | ((x < clip_box.x1) << 2); } //--------------------------------------------------------clipping_flags_y template<class T> inline unsigned clipping_flags_y(T y, const rect_base<T>& clip_box) { return ((y > clip_box.y2) << 1) | ((y < clip_box.y1) << 3); } //-------------------------------------------------------clip_liang_barsky template<class T> inline unsigned clip_liang_barsky(T x1, T y1, T x2, T y2, const rect_base<T>& clip_box, T* x, T* y) { const double nearzero = 1e-30; double deltax = x2 - x1; double deltay = y2 - y1; double xin; double xout; double yin; double yout; double tinx; double tiny; double toutx; double touty; double tin1; double tin2; double tout1; unsigned np = 0; if(deltax == 0.0) { // bump off of the vertical deltax = (x1 > clip_box.x1) ? -nearzero : nearzero; } if(deltay == 0.0) { // bump off of the horizontal deltay = (y1 > clip_box.y1) ? -nearzero : nearzero; } if(deltax > 0.0) { // points to right xin = clip_box.x1; xout = clip_box.x2; } else { xin = clip_box.x2; xout = clip_box.x1; } if(deltay > 0.0) { // points up yin = clip_box.y1; yout = clip_box.y2; } else { yin = clip_box.y2; yout = clip_box.y1; } tinx = (xin - x1) / deltax; tiny = (yin - y1) / deltay; if (tinx < tiny) { // hits x first tin1 = tinx; tin2 = tiny; } else { // hits y first tin1 = tiny; tin2 = tinx; } if(tin1 <= 1.0) { if(0.0 < tin1) { *x++ = (T)xin; *y++ = (T)yin; ++np; } if(tin2 <= 1.0) { toutx = (xout - x1) / deltax; touty = (yout - y1) / deltay; tout1 = (toutx < touty) ? toutx : touty; if(tin2 > 0.0 || tout1 > 0.0) { if(tin2 <= tout1) { if(tin2 > 0.0) { if(tinx > tiny) { *x++ = (T)xin; *y++ = (T)(y1 + tinx * deltay); } else { *x++ = (T)(x1 + tiny * deltax); *y++ = (T)yin; } ++np; } if(tout1 < 1.0) { if(toutx < touty) { *x++ = (T)xout; *y++ = (T)(y1 + toutx * deltay); } else { *x++ = (T)(x1 + touty * deltax); *y++ = (T)yout; } } else { *x++ = x2; *y++ = y2; } ++np; } else { if(tinx > tiny) { *x++ = (T)xin; *y++ = (T)yout; } else { *x++ = (T)xout; *y++ = (T)yin; } ++np; } } } } return np; } //---------------------------------------------------------------------------- template<class T> bool clip_move_point(T x1, T y1, T x2, T y2, const rect_base<T>& clip_box, T* x, T* y, unsigned flags) { T bound; if(flags & clipping_flags_x_clipped) { if(x1 == x2) { return false; } bound = (flags & clipping_flags_x1_clipped) ? clip_box.x1 : clip_box.x2; *y = (T)(double(bound - x1) * (y2 - y1) / (x2 - x1) + y1); *x = bound; } flags = clipping_flags_y(*y, clip_box); if(flags & clipping_flags_y_clipped) { if(y1 == y2) { return false; } bound = (flags & clipping_flags_y1_clipped) ? clip_box.y1 : clip_box.y2; *x = (T)(double(bound - y1) * (x2 - x1) / (y2 - y1) + x1); *y = bound; } return true; } //-------------------------------------------------------clip_line_segment // Returns: ret >= 4 - Fully clipped // (ret & 1) != 0 - First point has been moved // (ret & 2) != 0 - Second point has been moved // template<class T> unsigned clip_line_segment(T* x1, T* y1, T* x2, T* y2, const rect_base<T>& clip_box) { unsigned f1 = clipping_flags(*x1, *y1, clip_box); unsigned f2 = clipping_flags(*x2, *y2, clip_box); unsigned ret = 0; if((f2 | f1) == 0) { // Fully visible return 0; } if((f1 & clipping_flags_x_clipped) != 0 && (f1 & clipping_flags_x_clipped) == (f2 & clipping_flags_x_clipped)) { // Fully clipped return 4; } if((f1 & clipping_flags_y_clipped) != 0 && (f1 & clipping_flags_y_clipped) == (f2 & clipping_flags_y_clipped)) { // Fully clipped return 4; } T tx1 = *x1; T ty1 = *y1; T tx2 = *x2; T ty2 = *y2; if(f1) { if(!clip_move_point(tx1, ty1, tx2, ty2, clip_box, x1, y1, f1)) { return 4; } if(*x1 == *x2 && *y1 == *y2) { return 4; } ret |= 1; } if(f2) { if(!clip_move_point(tx1, ty1, tx2, ty2, clip_box, x2, y2, f2)) { return 4; } if(*x1 == *x2 && *y1 == *y2) { return 4; } ret |= 2; } return ret; } } #endif ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_color_gray.h��������������������������������������������������������������0000644�0000000�0000000�00000033311�10703246330�020031� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- // // Adaptation for high precision colors has been sponsored by // Liberty Technology Systems, Inc., visit http://lib-sys.com // // Liberty Technology Systems, Inc. is the provider of // PostScript and PDF technology for software developers. // //---------------------------------------------------------------------------- // // color types gray8, gray16 // //---------------------------------------------------------------------------- #ifndef AGG_COLOR_GRAY_INCLUDED #define AGG_COLOR_GRAY_INCLUDED #include "agg_basics.h" #include "agg_color_rgba.h" namespace agg { //===================================================================gray8 struct gray8 { typedef int8u value_type; typedef int32u calc_type; typedef int32 long_type; enum base_scale_e { base_shift = 8, base_scale = 1 << base_shift, base_mask = base_scale - 1 }; typedef gray8 self_type; value_type v; value_type a; //-------------------------------------------------------------------- gray8() {} //-------------------------------------------------------------------- gray8(unsigned v_, unsigned a_=base_mask) : v(int8u(v_)), a(int8u(a_)) {} //-------------------------------------------------------------------- gray8(const self_type& c, unsigned a_) : v(c.v), a(value_type(a_)) {} //-------------------------------------------------------------------- gray8(const rgba& c) : v((value_type)uround((0.299*c.r + 0.587*c.g + 0.114*c.b) * double(base_mask))), a((value_type)uround(c.a * double(base_mask))) {} //-------------------------------------------------------------------- gray8(const rgba& c, double a_) : v((value_type)uround((0.299*c.r + 0.587*c.g + 0.114*c.b) * double(base_mask))), a((value_type)uround(a_ * double(base_mask))) {} //-------------------------------------------------------------------- gray8(const rgba8& c) : v((c.r*77 + c.g*150 + c.b*29) >> 8), a(c.a) {} //-------------------------------------------------------------------- gray8(const rgba8& c, unsigned a_) : v((c.r*77 + c.g*150 + c.b*29) >> 8), a(a_) {} //-------------------------------------------------------------------- void clear() { v = a = 0; } //-------------------------------------------------------------------- const self_type& transparent() { a = 0; return *this; } //-------------------------------------------------------------------- void opacity(double a_) { if(a_ < 0.0) a_ = 0.0; if(a_ > 1.0) a_ = 1.0; a = (value_type)uround(a_ * double(base_mask)); } //-------------------------------------------------------------------- double opacity() const { return double(a) / double(base_mask); } //-------------------------------------------------------------------- const self_type& premultiply() { if(a == base_mask) return *this; if(a == 0) { v = 0; return *this; } v = value_type((calc_type(v) * a) >> base_shift); return *this; } //-------------------------------------------------------------------- const self_type& premultiply(unsigned a_) { if(a == base_mask && a_ >= base_mask) return *this; if(a == 0 || a_ == 0) { v = a = 0; return *this; } calc_type v_ = (calc_type(v) * a_) / a; v = value_type((v_ > a_) ? a_ : v_); a = value_type(a_); return *this; } //-------------------------------------------------------------------- const self_type& demultiply() { if(a == base_mask) return *this; if(a == 0) { v = 0; return *this; } calc_type v_ = (calc_type(v) * base_mask) / a; v = value_type((v_ > base_mask) ? (value_type)base_mask : v_); return *this; } //-------------------------------------------------------------------- self_type gradient(self_type c, double k) const { self_type ret; calc_type ik = uround(k * base_scale); ret.v = value_type(calc_type(v) + (((calc_type(c.v) - v) * ik) >> base_shift)); ret.a = value_type(calc_type(a) + (((calc_type(c.a) - a) * ik) >> base_shift)); return ret; } //-------------------------------------------------------------------- AGG_INLINE void add(const self_type& c, unsigned cover) { calc_type cv, ca; if(cover == cover_mask) { if(c.a == base_mask) { *this = c; } else { cv = v + c.v; v = (cv > calc_type(base_mask)) ? calc_type(base_mask) : cv; ca = a + c.a; a = (ca > calc_type(base_mask)) ? calc_type(base_mask) : ca; } } else { cv = v + ((c.v * cover + cover_mask/2) >> cover_shift); ca = a + ((c.a * cover + cover_mask/2) >> cover_shift); v = (cv > calc_type(base_mask)) ? calc_type(base_mask) : cv; a = (ca > calc_type(base_mask)) ? calc_type(base_mask) : ca; } } //-------------------------------------------------------------------- static self_type no_color() { return self_type(0,0); } }; //-------------------------------------------------------------gray8_pre inline gray8 gray8_pre(unsigned v, unsigned a = gray8::base_mask) { return gray8(v,a).premultiply(); } inline gray8 gray8_pre(const gray8& c, unsigned a) { return gray8(c,a).premultiply(); } inline gray8 gray8_pre(const rgba& c) { return gray8(c).premultiply(); } inline gray8 gray8_pre(const rgba& c, double a) { return gray8(c,a).premultiply(); } inline gray8 gray8_pre(const rgba8& c) { return gray8(c).premultiply(); } inline gray8 gray8_pre(const rgba8& c, unsigned a) { return gray8(c,a).premultiply(); } //==================================================================gray16 struct gray16 { typedef int16u value_type; typedef int32u calc_type; typedef int64 long_type; enum base_scale_e { base_shift = 16, base_scale = 1 << base_shift, base_mask = base_scale - 1 }; typedef gray16 self_type; value_type v; value_type a; //-------------------------------------------------------------------- gray16() {} //-------------------------------------------------------------------- gray16(unsigned v_, unsigned a_=base_mask) : v(int16u(v_)), a(int16u(a_)) {} //-------------------------------------------------------------------- gray16(const self_type& c, unsigned a_) : v(c.v), a(value_type(a_)) {} //-------------------------------------------------------------------- gray16(const rgba& c) : v((value_type)uround((0.299*c.r + 0.587*c.g + 0.114*c.b) * double(base_mask))), a((value_type)uround(c.a * double(base_mask))) {} //-------------------------------------------------------------------- gray16(const rgba& c, double a_) : v((value_type)uround((0.299*c.r + 0.587*c.g + 0.114*c.b) * double(base_mask))), a((value_type)uround(a_ * double(base_mask))) {} //-------------------------------------------------------------------- gray16(const rgba8& c) : v(c.r*77 + c.g*150 + c.b*29), a((value_type(c.a) << 8) | c.a) {} //-------------------------------------------------------------------- gray16(const rgba8& c, unsigned a_) : v(c.r*77 + c.g*150 + c.b*29), a((value_type(a_) << 8) | c.a) {} //-------------------------------------------------------------------- void clear() { v = a = 0; } //-------------------------------------------------------------------- const self_type& transparent() { a = 0; return *this; } //-------------------------------------------------------------------- void opacity(double a_) { if(a_ < 0.0) a_ = 0.0; if(a_ > 1.0) a_ = 1.0; a = (value_type)uround(a_ * double(base_mask)); } //-------------------------------------------------------------------- double opacity() const { return double(a) / double(base_mask); } //-------------------------------------------------------------------- const self_type& premultiply() { if(a == base_mask) return *this; if(a == 0) { v = 0; return *this; } v = value_type((calc_type(v) * a) >> base_shift); return *this; } //-------------------------------------------------------------------- const self_type& premultiply(unsigned a_) { if(a == base_mask && a_ >= base_mask) return *this; if(a == 0 || a_ == 0) { v = a = 0; return *this; } calc_type v_ = (calc_type(v) * a_) / a; v = value_type((v_ > a_) ? a_ : v_); a = value_type(a_); return *this; } //-------------------------------------------------------------------- const self_type& demultiply() { if(a == base_mask) return *this; if(a == 0) { v = 0; return *this; } calc_type v_ = (calc_type(v) * base_mask) / a; v = value_type((v_ > base_mask) ? base_mask : v_); return *this; } //-------------------------------------------------------------------- self_type gradient(self_type c, double k) const { self_type ret; calc_type ik = uround(k * base_scale); ret.v = value_type(calc_type(v) + (((calc_type(c.v) - v) * ik) >> base_shift)); ret.a = value_type(calc_type(a) + (((calc_type(c.a) - a) * ik) >> base_shift)); return ret; } //-------------------------------------------------------------------- AGG_INLINE void add(const self_type& c, unsigned cover) { calc_type cv, ca; if(cover == cover_mask) { if(c.a == base_mask) { *this = c; } else { cv = v + c.v; v = (cv > calc_type(base_mask)) ? calc_type(base_mask) : cv; ca = a + c.a; a = (ca > calc_type(base_mask)) ? calc_type(base_mask) : ca; } } else { cv = v + ((c.v * cover + cover_mask/2) >> cover_shift); ca = a + ((c.a * cover + cover_mask/2) >> cover_shift); v = (cv > calc_type(base_mask)) ? calc_type(base_mask) : cv; a = (ca > calc_type(base_mask)) ? calc_type(base_mask) : ca; } } //-------------------------------------------------------------------- static self_type no_color() { return self_type(0,0); } }; //------------------------------------------------------------gray16_pre inline gray16 gray16_pre(unsigned v, unsigned a = gray16::base_mask) { return gray16(v,a).premultiply(); } inline gray16 gray16_pre(const gray16& c, unsigned a) { return gray16(c,a).premultiply(); } inline gray16 gray16_pre(const rgba& c) { return gray16(c).premultiply(); } inline gray16 gray16_pre(const rgba& c, double a) { return gray16(c,a).premultiply(); } inline gray16 gray16_pre(const rgba8& c) { return gray16(c).premultiply(); } inline gray16 gray16_pre(const rgba8& c, unsigned a) { return gray16(c,a).premultiply(); } } #endif �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_color_rgba.h��������������������������������������������������������������0000644�0000000�0000000�00000063565�10703246330�020020� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- // // 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 // http://www.antigrain.com //---------------------------------------------------------------------------- #ifndef AGG_COLOR_RGBA_INCLUDED #define AGG_COLOR_RGBA_INCLUDED #include <math.h> #include "agg_basics.h" namespace agg { // Supported byte orders for RGB and RGBA pixel formats //======================================================================= struct order_rgb { enum rgb_e { R=0, G=1, B=2, rgb_tag }; }; //----order_rgb struct order_bgr { enum bgr_e { B=0, G=1, R=2, rgb_tag }; }; //----order_bgr struct order_rgba { enum rgba_e { R=0, G=1, B=2, A=3, rgba_tag }; }; //----order_rgba struct order_argb { enum argb_e { A=0, R=1, G=2, B=3, rgba_tag }; }; //----order_argb struct order_abgr { enum abgr_e { A=0, B=1, G=2, R=3, rgba_tag }; }; //----order_abgr struct order_bgra { enum bgra_e { B=0, G=1, R=2, A=3, rgba_tag }; }; //----order_bgra //====================================================================rgba struct rgba { typedef double value_type; double r; double g; double b; double a; //-------------------------------------------------------------------- rgba() {} //-------------------------------------------------------------------- rgba(double r_, double g_, double b_, double a_=1.0) : r(r_), g(g_), b(b_), a(a_) {} //-------------------------------------------------------------------- rgba(const rgba& c, double a_) : r(c.r), g(c.g), b(c.b), a(a_) {} //-------------------------------------------------------------------- void clear() { r = g = b = a = 0; } //-------------------------------------------------------------------- const rgba& transparent() { a = 0.0; return *this; } //-------------------------------------------------------------------- const rgba& opacity(double a_) { if(a_ < 0.0) a_ = 0.0; if(a_ > 1.0) a_ = 1.0; a = a_; return *this; } //-------------------------------------------------------------------- double opacity() const { return a; } //-------------------------------------------------------------------- const rgba& premultiply() { r *= a; g *= a; b *= a; return *this; } //-------------------------------------------------------------------- const rgba& premultiply(double a_) { if(a <= 0.0 || a_ <= 0.0) { r = g = b = a = 0.0; return *this; } a_ /= a; r *= a_; g *= a_; b *= a_; a = a_; return *this; } //-------------------------------------------------------------------- const rgba& demultiply() { if(a == 0) { r = g = b = 0; return *this; } double a_ = 1.0 / a; r *= a_; g *= a_; b *= a_; return *this; } //-------------------------------------------------------------------- rgba gradient(rgba c, double k) const { rgba ret; ret.r = r + (c.r - r) * k; ret.g = g + (c.g - g) * k; ret.b = b + (c.b - b) * k; ret.a = a + (c.a - a) * k; return ret; } //-------------------------------------------------------------------- static rgba no_color() { return rgba(0,0,0,0); } //-------------------------------------------------------------------- static rgba from_wavelength(double wl, double gamma = 1.0); //-------------------------------------------------------------------- explicit rgba(double wavelen, double gamma=1.0) { *this = from_wavelength(wavelen, gamma); } }; //----------------------------------------------------------------rgba_pre inline rgba rgba_pre(double r, double g, double b, double a=1.0) { return rgba(r, g, b, a).premultiply(); } inline rgba rgba_pre(const rgba& c) { return rgba(c).premultiply(); } inline rgba rgba_pre(const rgba& c, double a) { return rgba(c, a).premultiply(); } //------------------------------------------------------------------------ inline rgba rgba::from_wavelength(double wl, double gamma) { rgba t(0.0, 0.0, 0.0); if(wl >= 380.0 && wl <= 440.0) { t.r = -1.0 * (wl - 440.0) / (440.0 - 380.0); t.b = 1.0; } else if(wl >= 440.0 && wl <= 490.0) { t.g = (wl - 440.0) / (490.0 - 440.0); t.b = 1.0; } else if(wl >= 490.0 && wl <= 510.0) { t.g = 1.0; t.b = -1.0 * (wl - 510.0) / (510.0 - 490.0); } else if(wl >= 510.0 && wl <= 580.0) { t.r = (wl - 510.0) / (580.0 - 510.0); t.g = 1.0; } else if(wl >= 580.0 && wl <= 645.0) { t.r = 1.0; t.g = -1.0 * (wl - 645.0) / (645.0 - 580.0); } else if(wl >= 645.0 && wl <= 780.0) { t.r = 1.0; } double s = 1.0; if(wl > 700.0) s = 0.3 + 0.7 * (780.0 - wl) / (780.0 - 700.0); else if(wl < 420.0) s = 0.3 + 0.7 * (wl - 380.0) / (420.0 - 380.0); t.r = pow(t.r * s, gamma); t.g = pow(t.g * s, gamma); t.b = pow(t.b * s, gamma); return t; } //===================================================================rgba8 struct rgba8 { typedef int8u value_type; typedef int32u calc_type; typedef int32 long_type; enum base_scale_e { base_shift = 8, base_scale = 1 << base_shift, base_mask = base_scale - 1 }; typedef rgba8 self_type; value_type r; value_type g; value_type b; value_type a; //-------------------------------------------------------------------- rgba8() {} //-------------------------------------------------------------------- rgba8(unsigned r_, unsigned g_, unsigned b_, unsigned a_=base_mask) : 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)uround(c.r * double(base_mask))), g((value_type)uround(c.g * double(base_mask))), b((value_type)uround(c.b * double(base_mask))), a((value_type)uround(a_ * double(base_mask))) {} //-------------------------------------------------------------------- rgba8(const self_type& c, unsigned a_) : r(c.r), g(c.g), b(c.b), a(value_type(a_)) {} //-------------------------------------------------------------------- rgba8(const rgba& c) : r((value_type)uround(c.r * double(base_mask))), g((value_type)uround(c.g * double(base_mask))), b((value_type)uround(c.b * double(base_mask))), a((value_type)uround(c.a * double(base_mask))) {} //-------------------------------------------------------------------- void clear() { r = g = b = a = 0; } //-------------------------------------------------------------------- const self_type& transparent() { a = 0; return *this; } //-------------------------------------------------------------------- const self_type& opacity(double a_) { if(a_ < 0.0) a_ = 0.0; if(a_ > 1.0) a_ = 1.0; a = (value_type)uround(a_ * double(base_mask)); return *this; } //-------------------------------------------------------------------- double opacity() const { return double(a) / double(base_mask); } //-------------------------------------------------------------------- AGG_INLINE const self_type& premultiply() { if(a == base_mask) return *this; if(a == 0) { r = g = b = 0; return *this; } r = value_type((calc_type(r) * a) >> base_shift); g = value_type((calc_type(g) * a) >> base_shift); b = value_type((calc_type(b) * a) >> base_shift); return *this; } //-------------------------------------------------------------------- AGG_INLINE const self_type& premultiply(unsigned a_) { if(a == base_mask && a_ >= base_mask) return *this; if(a == 0 || a_ == 0) { r = g = b = a = 0; return *this; } calc_type r_ = (calc_type(r) * a_) / a; calc_type g_ = (calc_type(g) * a_) / a; calc_type b_ = (calc_type(b) * a_) / a; r = value_type((r_ > a_) ? a_ : r_); g = value_type((g_ > a_) ? a_ : g_); b = value_type((b_ > a_) ? a_ : b_); a = value_type(a_); return *this; } //-------------------------------------------------------------------- AGG_INLINE const self_type& demultiply() { if(a == base_mask) return *this; if(a == 0) { r = g = b = 0; return *this; } calc_type r_ = (calc_type(r) * base_mask) / a; calc_type g_ = (calc_type(g) * base_mask) / a; calc_type b_ = (calc_type(b) * base_mask) / a; r = value_type((r_ > calc_type(base_mask)) ? calc_type(base_mask) : r_); g = value_type((g_ > calc_type(base_mask)) ? calc_type(base_mask) : g_); b = value_type((b_ > calc_type(base_mask)) ? calc_type(base_mask) : b_); return *this; } //-------------------------------------------------------------------- AGG_INLINE self_type gradient(const self_type& c, double k) const { self_type ret; calc_type ik = uround(k * base_scale); ret.r = value_type(calc_type(r) + (((calc_type(c.r) - r) * ik) >> base_shift)); ret.g = value_type(calc_type(g) + (((calc_type(c.g) - g) * ik) >> base_shift)); ret.b = value_type(calc_type(b) + (((calc_type(c.b) - b) * ik) >> base_shift)); ret.a = value_type(calc_type(a) + (((calc_type(c.a) - a) * ik) >> base_shift)); return ret; } //-------------------------------------------------------------------- AGG_INLINE void add(const self_type& c, unsigned cover) { calc_type cr, cg, cb, ca; if(cover == cover_mask) { if(c.a == base_mask) { *this = c; } else { cr = r + c.r; r = (cr > calc_type(base_mask)) ? calc_type(base_mask) : cr; cg = g + c.g; g = (cg > calc_type(base_mask)) ? calc_type(base_mask) : cg; cb = b + c.b; b = (cb > calc_type(base_mask)) ? calc_type(base_mask) : cb; ca = a + c.a; a = (ca > calc_type(base_mask)) ? calc_type(base_mask) : ca; } } else { cr = r + ((c.r * cover + cover_mask/2) >> cover_shift); cg = g + ((c.g * cover + cover_mask/2) >> cover_shift); cb = b + ((c.b * cover + cover_mask/2) >> cover_shift); ca = a + ((c.a * cover + cover_mask/2) >> cover_shift); r = (cr > calc_type(base_mask)) ? calc_type(base_mask) : cr; g = (cg > calc_type(base_mask)) ? calc_type(base_mask) : cg; b = (cb > calc_type(base_mask)) ? calc_type(base_mask) : cb; a = (ca > calc_type(base_mask)) ? calc_type(base_mask) : ca; } } //-------------------------------------------------------------------- template<class GammaLUT> AGG_INLINE void apply_gamma_dir(const GammaLUT& gamma) { r = gamma.dir(r); g = gamma.dir(g); b = gamma.dir(b); } //-------------------------------------------------------------------- template<class GammaLUT> AGG_INLINE void apply_gamma_inv(const GammaLUT& gamma) { r = gamma.inv(r); g = gamma.inv(g); b = gamma.inv(b); } //-------------------------------------------------------------------- static self_type no_color() { return self_type(0,0,0,0); } //-------------------------------------------------------------------- static self_type from_wavelength(double wl, double gamma = 1.0) { return self_type(rgba::from_wavelength(wl, gamma)); } }; //-------------------------------------------------------------rgba8_pre inline rgba8 rgba8_pre(unsigned r, unsigned g, unsigned b, unsigned a = rgba8::base_mask) { return rgba8(r,g,b,a).premultiply(); } inline rgba8 rgba8_pre(const rgba8& c) { return rgba8(c).premultiply(); } inline rgba8 rgba8_pre(const rgba8& c, unsigned a) { return rgba8(c,a).premultiply(); } inline rgba8 rgba8_pre(const rgba& c) { return rgba8(c).premultiply(); } inline rgba8 rgba8_pre(const rgba& c, double a) { return rgba8(c,a).premultiply(); } //-------------------------------------------------------------rgb8_packed inline rgba8 rgb8_packed(unsigned v) { return rgba8((v >> 16) & 0xFF, (v >> 8) & 0xFF, v & 0xFF); } //-------------------------------------------------------------bgr8_packed inline rgba8 bgr8_packed(unsigned v) { return rgba8(v & 0xFF, (v >> 8) & 0xFF, (v >> 16) & 0xFF); } //------------------------------------------------------------argb8_packed inline rgba8 argb8_packed(unsigned v) { return rgba8((v >> 16) & 0xFF, (v >> 8) & 0xFF, v & 0xFF, v >> 24); } //---------------------------------------------------------rgba8_gamma_dir template<class GammaLUT> rgba8 rgba8_gamma_dir(rgba8 c, const GammaLUT& gamma) { return rgba8(gamma.dir(c.r), gamma.dir(c.g), gamma.dir(c.b), c.a); } //---------------------------------------------------------rgba8_gamma_inv template<class GammaLUT> rgba8 rgba8_gamma_inv(rgba8 c, const GammaLUT& gamma) { return rgba8(gamma.inv(c.r), gamma.inv(c.g), gamma.inv(c.b), c.a); } //==================================================================rgba16 struct rgba16 { typedef int16u value_type; typedef int32u calc_type; typedef int64 long_type; enum base_scale_e { base_shift = 16, base_scale = 1 << base_shift, base_mask = base_scale - 1 }; typedef rgba16 self_type; value_type r; value_type g; value_type b; value_type a; //-------------------------------------------------------------------- rgba16() {} //-------------------------------------------------------------------- rgba16(unsigned r_, unsigned g_, unsigned b_, unsigned a_=base_mask) : r(value_type(r_)), g(value_type(g_)), b(value_type(b_)), a(value_type(a_)) {} //-------------------------------------------------------------------- rgba16(const self_type& c, unsigned a_) : r(c.r), g(c.g), b(c.b), a(value_type(a_)) {} //-------------------------------------------------------------------- rgba16(const rgba& c) : r((value_type)uround(c.r * double(base_mask))), g((value_type)uround(c.g * double(base_mask))), b((value_type)uround(c.b * double(base_mask))), a((value_type)uround(c.a * double(base_mask))) {} //-------------------------------------------------------------------- rgba16(const rgba& c, double a_) : r((value_type)uround(c.r * double(base_mask))), g((value_type)uround(c.g * double(base_mask))), b((value_type)uround(c.b * double(base_mask))), a((value_type)uround(a_ * double(base_mask))) {} //-------------------------------------------------------------------- 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)), 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)), a(value_type(( a_ << 8) | c.a)) {} //-------------------------------------------------------------------- void clear() { r = g = b = a = 0; } //-------------------------------------------------------------------- const self_type& transparent() { a = 0; return *this; } //-------------------------------------------------------------------- AGG_INLINE const self_type& opacity(double a_) { if(a_ < 0.0) a_ = 0.0; if(a_ > 1.0) a_ = 1.0; a = (value_type)uround(a_ * double(base_mask)); return *this; } //-------------------------------------------------------------------- double opacity() const { return double(a) / double(base_mask); } //-------------------------------------------------------------------- AGG_INLINE const self_type& premultiply() { if(a == base_mask) return *this; if(a == 0) { r = g = b = 0; return *this; } r = value_type((calc_type(r) * a) >> base_shift); g = value_type((calc_type(g) * a) >> base_shift); b = value_type((calc_type(b) * a) >> base_shift); return *this; } //-------------------------------------------------------------------- AGG_INLINE const self_type& premultiply(unsigned a_) { if(a == base_mask && a_ >= base_mask) return *this; if(a == 0 || a_ == 0) { r = g = b = a = 0; return *this; } calc_type r_ = (calc_type(r) * a_) / a; calc_type g_ = (calc_type(g) * a_) / a; calc_type b_ = (calc_type(b) * a_) / a; r = value_type((r_ > a_) ? a_ : r_); g = value_type((g_ > a_) ? a_ : g_); b = value_type((b_ > a_) ? a_ : b_); a = value_type(a_); return *this; } //-------------------------------------------------------------------- AGG_INLINE const self_type& demultiply() { if(a == base_mask) return *this; if(a == 0) { r = g = b = 0; return *this; } calc_type r_ = (calc_type(r) * base_mask) / a; calc_type g_ = (calc_type(g) * base_mask) / a; calc_type b_ = (calc_type(b) * base_mask) / a; r = value_type((r_ > calc_type(base_mask)) ? calc_type(base_mask) : r_); g = value_type((g_ > calc_type(base_mask)) ? calc_type(base_mask) : g_); b = value_type((b_ > calc_type(base_mask)) ? calc_type(base_mask) : b_); return *this; } //-------------------------------------------------------------------- AGG_INLINE self_type gradient(const self_type& c, double k) const { self_type ret; calc_type ik = uround(k * base_scale); ret.r = value_type(calc_type(r) + (((calc_type(c.r) - r) * ik) >> base_shift)); ret.g = value_type(calc_type(g) + (((calc_type(c.g) - g) * ik) >> base_shift)); ret.b = value_type(calc_type(b) + (((calc_type(c.b) - b) * ik) >> base_shift)); ret.a = value_type(calc_type(a) + (((calc_type(c.a) - a) * ik) >> base_shift)); return ret; } //-------------------------------------------------------------------- AGG_INLINE void add(const self_type& c, unsigned cover) { calc_type cr, cg, cb, ca; if(cover == cover_mask) { if(c.a == base_mask) { *this = c; } else { cr = r + c.r; r = (cr > calc_type(base_mask)) ? calc_type(base_mask) : cr; cg = g + c.g; g = (cg > calc_type(base_mask)) ? calc_type(base_mask) : cg; cb = b + c.b; b = (cb > calc_type(base_mask)) ? calc_type(base_mask) : cb; ca = a + c.a; a = (ca > calc_type(base_mask)) ? calc_type(base_mask) : ca; } } else { cr = r + ((c.r * cover + cover_mask) >> cover_shift); cg = g + ((c.g * cover + cover_mask) >> cover_shift); cb = b + ((c.b * cover + cover_mask) >> cover_shift); ca = a + ((c.a * cover + cover_mask) >> cover_shift); r = (cr > calc_type(base_mask)) ? calc_type(base_mask) : cr; g = (cg > calc_type(base_mask)) ? calc_type(base_mask) : cg; b = (cb > calc_type(base_mask)) ? calc_type(base_mask) : cb; a = (ca > calc_type(base_mask)) ? calc_type(base_mask) : ca; } } //-------------------------------------------------------------------- template<class GammaLUT> AGG_INLINE void apply_gamma_dir(const GammaLUT& gamma) { r = gamma.dir(r); g = gamma.dir(g); b = gamma.dir(b); } //-------------------------------------------------------------------- template<class GammaLUT> AGG_INLINE void apply_gamma_inv(const GammaLUT& gamma) { r = gamma.inv(r); g = gamma.inv(g); b = gamma.inv(b); } //-------------------------------------------------------------------- static self_type no_color() { return self_type(0,0,0,0); } //-------------------------------------------------------------------- static self_type from_wavelength(double wl, double gamma = 1.0) { return self_type(rgba::from_wavelength(wl, gamma)); } }; //--------------------------------------------------------------rgba16_pre inline rgba16 rgba16_pre(unsigned r, unsigned g, unsigned b, unsigned a = rgba16::base_mask) { return rgba16(r,g,b,a).premultiply(); } inline rgba16 rgba16_pre(const rgba16& c, unsigned a) { return rgba16(c,a).premultiply(); } inline rgba16 rgba16_pre(const rgba& c) { return rgba16(c).premultiply(); } inline rgba16 rgba16_pre(const rgba& c, double a) { return rgba16(c,a).premultiply(); } inline rgba16 rgba16_pre(const rgba8& c) { return rgba16(c).premultiply(); } inline rgba16 rgba16_pre(const rgba8& c, unsigned a) { return rgba16(c,a).premultiply(); } //------------------------------------------------------rgba16_gamma_dir template<class GammaLUT> rgba16 rgba16_gamma_dir(rgba16 c, const GammaLUT& gamma) { return rgba16(gamma.dir(c.r), gamma.dir(c.g), gamma.dir(c.b), c.a); } //------------------------------------------------------rgba16_gamma_inv template<class GammaLUT> rgba16 rgba16_gamma_inv(rgba16 c, const GammaLUT& gamma) { return rgba16(gamma.inv(c.r), gamma.inv(c.g), gamma.inv(c.b), c.a); } } #endif �������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_config.h������������������������������������������������������������������0000644�0000000�0000000�00000002361�10703246330�017137� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#ifndef AGG_CONFIG_INCLUDED #define AGG_CONFIG_INCLUDED // This file can be used to redefine certain data types. //--------------------------------------- // 1. Default basic types such as: // // AGG_INT8 // AGG_INT8U // AGG_INT16 // AGG_INT16U // AGG_INT32 // AGG_INT32U // AGG_INT64 // AGG_INT64U // // 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: // // #define AGG_INT64 int // #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 // fully functional. //--------------------------------------- // 2. Default rendering_buffer type. Can be: // // Provides faster access for massive pixel operations, // such as blur, image filtering: // #define AGG_RENDERING_BUFFER row_ptr_cache<int8u> // // Provides cheaper creation and destruction (no mem allocs): // #define AGG_RENDERING_BUFFER row_accessor<int8u> // // You can still use both of them simultaneouslyin your applications // This #define is used only for default rendering_buffer type, // in short hand typedefs like pixfmt_rgba32. #endif �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_conv_adaptor_vcgen.h������������������������������������������������������0000644�0000000�0000000�00000012320�10703246330�021527� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_CONV_ADAPTOR_VCGEN_INCLUDED #define AGG_CONV_ADAPTOR_VCGEN_INCLUDED #include "agg_basics.h" namespace agg { //------------------------------------------------------------null_markers struct null_markers { void remove_all() {} void add_vertex(double, double, unsigned) {} void prepare_src() {} void rewind(unsigned) {} unsigned vertex(double*, double*) { return path_cmd_stop; } }; //------------------------------------------------------conv_adaptor_vcgen template<class VertexSource, class Generator, class Markers=null_markers> class conv_adaptor_vcgen { enum status { initial, accumulate, generate }; public: explicit conv_adaptor_vcgen(VertexSource& source) : m_source(&source), m_status(initial) {} void attach(VertexSource& source) { m_source = &source; } Generator& generator() { return m_generator; } const Generator& generator() const { return m_generator; } Markers& markers() { return m_markers; } const Markers& markers() const { return m_markers; } void rewind(unsigned path_id) { m_source->rewind(path_id); m_status = initial; } unsigned vertex(double* x, double* y); private: // Prohibit copying conv_adaptor_vcgen(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; Generator m_generator; Markers m_markers; status m_status; unsigned m_last_cmd; double m_start_x; double m_start_y; }; //------------------------------------------------------------------------ template<class VertexSource, class Generator, class Markers> unsigned conv_adaptor_vcgen<VertexSource, Generator, Markers>::vertex(double* x, double* y) { unsigned cmd = path_cmd_stop; bool done = false; while(!done) { switch(m_status) { case initial: m_markers.remove_all(); m_last_cmd = m_source->vertex(&m_start_x, &m_start_y); m_status = accumulate; case accumulate: if(is_stop(m_last_cmd)) return path_cmd_stop; m_generator.remove_all(); m_generator.add_vertex(m_start_x, m_start_y, path_cmd_move_to); m_markers.add_vertex(m_start_x, m_start_y, path_cmd_move_to); for(;;) { cmd = m_source->vertex(x, y); if(is_vertex(cmd)) { m_last_cmd = cmd; if(is_move_to(cmd)) { m_start_x = *x; m_start_y = *y; break; } m_generator.add_vertex(*x, *y, cmd); m_markers.add_vertex(*x, *y, path_cmd_line_to); } else { if(is_stop(cmd)) { m_last_cmd = path_cmd_stop; break; } if(is_end_poly(cmd)) { m_generator.add_vertex(*x, *y, cmd); break; } } } m_generator.rewind(0); m_status = generate; case generate: cmd = m_generator.vertex(x, y); if(is_stop(cmd)) { m_status = accumulate; break; } done = true; break; } } return cmd; } } #endif ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_conv_adaptor_vpgen.h������������������������������������������������������0000644�0000000�0000000�00000012407�10703246330�021552� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_CONV_ADAPTOR_VPGEN_INCLUDED #define AGG_CONV_ADAPTOR_VPGEN_INCLUDED #include "agg_basics.h" namespace agg { //======================================================conv_adaptor_vpgen template<class VertexSource, class VPGen> class conv_adaptor_vpgen { public: explicit conv_adaptor_vpgen(VertexSource& source) : m_source(&source) {} void attach(VertexSource& source) { m_source = &source; } VPGen& vpgen() { return m_vpgen; } const VPGen& vpgen() const { return m_vpgen; } void rewind(unsigned path_id); unsigned vertex(double* x, double* y); private: conv_adaptor_vpgen(const conv_adaptor_vpgen<VertexSource, VPGen>&); const conv_adaptor_vpgen<VertexSource, VPGen>& operator = (const conv_adaptor_vpgen<VertexSource, VPGen>&); VertexSource* m_source; VPGen m_vpgen; double m_start_x; double m_start_y; unsigned m_poly_flags; int m_vertices; }; //------------------------------------------------------------------------ template<class VertexSource, class VPGen> void conv_adaptor_vpgen<VertexSource, VPGen>::rewind(unsigned path_id) { m_source->rewind(path_id); m_vpgen.reset(); m_start_x = 0; m_start_y = 0; m_poly_flags = 0; m_vertices = 0; } //------------------------------------------------------------------------ template<class VertexSource, class VPGen> unsigned conv_adaptor_vpgen<VertexSource, VPGen>::vertex(double* x, double* y) { unsigned cmd = path_cmd_stop; for(;;) { cmd = m_vpgen.vertex(x, y); if(!is_stop(cmd)) break; if(m_poly_flags && !m_vpgen.auto_unclose()) { *x = 0.0; *y = 0.0; cmd = m_poly_flags; m_poly_flags = 0; break; } if(m_vertices < 0) { if(m_vertices < -1) { m_vertices = 0; return path_cmd_stop; } m_vpgen.move_to(m_start_x, m_start_y); m_vertices = 1; continue; } double tx, ty; cmd = m_source->vertex(&tx, &ty); if(is_vertex(cmd)) { if(is_move_to(cmd)) { if(m_vpgen.auto_close() && m_vertices > 2) { m_vpgen.line_to(m_start_x, m_start_y); m_poly_flags = path_cmd_end_poly | path_flags_close; m_start_x = tx; m_start_y = ty; m_vertices = -1; continue; } m_vpgen.move_to(tx, ty); m_start_x = tx; m_start_y = ty; m_vertices = 1; } else { m_vpgen.line_to(tx, ty); ++m_vertices; } } else { if(is_end_poly(cmd)) { m_poly_flags = cmd; if(is_closed(cmd) || m_vpgen.auto_close()) { if(m_vpgen.auto_close()) m_poly_flags |= path_flags_close; if(m_vertices > 2) { m_vpgen.line_to(m_start_x, m_start_y); } m_vertices = 0; } } else { // path_cmd_stop if(m_vpgen.auto_close() && m_vertices > 2) { m_vpgen.line_to(m_start_x, m_start_y); m_poly_flags = path_cmd_end_poly | path_flags_close; m_vertices = -2; continue; } break; } } } return cmd; } } #endif ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_conv_bspline.h������������������������������������������������������������0000644�0000000�0000000�00000003764�10703246330�020363� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_CONV_BSPLINE_INCLUDED #define AGG_CONV_BSPLINE_INCLUDED #include "agg_basics.h" #include "agg_vcgen_bspline.h" #include "agg_conv_adaptor_vcgen.h" namespace agg { //---------------------------------------------------------conv_bspline 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_adaptor_vcgen<VertexSource, vcgen_bspline>(vs) {} void interpolation_step(double v) { base_type::generator().interpolation_step(v); } double interpolation_step() const { return base_type::generator().interpolation_step(); } private: conv_bspline(const conv_bspline<VertexSource>&); const conv_bspline<VertexSource>& operator = (const conv_bspline<VertexSource>&); }; } #endif ������������agg-2.5+dfsg1/include/agg_conv_clip_polygon.h�������������������������������������������������������0000644�0000000�0000000�00000005475�10703246330�021426� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- // // Polygon clipping converter // 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 // 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, // without any considerable overhead. // //---------------------------------------------------------------------------- #ifndef AGG_CONV_CLIP_POLYGON_INCLUDED #define AGG_CONV_CLIP_POLYGON_INCLUDED #include "agg_basics.h" #include "agg_conv_adaptor_vpgen.h" #include "agg_vpgen_clip_polygon.h" namespace agg { //=======================================================conv_clip_polygon 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_adaptor_vpgen<VertexSource, vpgen_clip_polygon>(vs) {} void clip_box(double x1, double y1, double x2, double y2) { base_type::vpgen().clip_box(x1, y1, x2, y2); } double x1() const { return base_type::vpgen().x1(); } double y1() const { return base_type::vpgen().y1(); } double x2() const { return base_type::vpgen().x2(); } double y2() const { return base_type::vpgen().y2(); } private: conv_clip_polygon(const conv_clip_polygon<VertexSource>&); const conv_clip_polygon<VertexSource>& operator = (const conv_clip_polygon<VertexSource>&); }; } #endif ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_conv_clip_polyline.h������������������������������������������������������0000644�0000000�0000000�00000005514�10703246330�021564� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- // // polyline clipping converter // 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 // 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, // without any considerable overhead. // //---------------------------------------------------------------------------- #ifndef AGG_CONV_CLIP_polyline_INCLUDED #define AGG_CONV_CLIP_polyline_INCLUDED #include "agg_basics.h" #include "agg_conv_adaptor_vpgen.h" #include "agg_vpgen_clip_polyline.h" namespace agg { //=======================================================conv_clip_polyline 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_adaptor_vpgen<VertexSource, vpgen_clip_polyline>(vs) {} void clip_box(double x1, double y1, double x2, double y2) { base_type::vpgen().clip_box(x1, y1, x2, y2); } double x1() const { return base_type::vpgen().x1(); } double y1() const { return base_type::vpgen().y1(); } double x2() const { return base_type::vpgen().x2(); } double y2() const { return base_type::vpgen().y2(); } private: conv_clip_polyline(const conv_clip_polyline<VertexSource>&); const conv_clip_polyline<VertexSource>& operator = (const conv_clip_polyline<VertexSource>&); }; } #endif ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_conv_close_polygon.h������������������������������������������������������0000644�0000000�0000000�00000007570�10703246330�021602� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_CONV_CLOSE_POLYGON_INCLUDED #define AGG_CONV_CLOSE_POLYGON_INCLUDED #include "agg_basics.h" namespace agg { //======================================================conv_close_polygon template<class VertexSource> class conv_close_polygon { public: explicit conv_close_polygon(VertexSource& vs) : m_source(&vs) {} void attach(VertexSource& source) { m_source = &source; } void rewind(unsigned path_id); unsigned vertex(double* x, double* y); private: conv_close_polygon(const conv_close_polygon<VertexSource>&); const conv_close_polygon<VertexSource>& operator = (const conv_close_polygon<VertexSource>&); VertexSource* m_source; unsigned m_cmd[2]; double m_x[2]; double m_y[2]; unsigned m_vertex; bool m_line_to; }; //------------------------------------------------------------------------ template<class VertexSource> void conv_close_polygon<VertexSource>::rewind(unsigned path_id) { m_source->rewind(path_id); m_vertex = 2; m_line_to = false; } //------------------------------------------------------------------------ template<class VertexSource> unsigned conv_close_polygon<VertexSource>::vertex(double* x, double* y) { unsigned cmd = path_cmd_stop; for(;;) { if(m_vertex < 2) { *x = m_x[m_vertex]; *y = m_y[m_vertex]; cmd = m_cmd[m_vertex]; ++m_vertex; break; } cmd = m_source->vertex(x, y); if(is_end_poly(cmd)) { cmd |= path_flags_close; break; } if(is_stop(cmd)) { if(m_line_to) { m_cmd[0] = path_cmd_end_poly | path_flags_close; m_cmd[1] = path_cmd_stop; m_vertex = 0; m_line_to = false; continue; } break; } if(is_move_to(cmd)) { if(m_line_to) { m_x[0] = 0.0; m_y[0] = 0.0; m_cmd[0] = path_cmd_end_poly | path_flags_close; m_x[1] = *x; m_y[1] = *y; m_cmd[1] = cmd; m_vertex = 0; m_line_to = false; continue; } break; } if(is_vertex(cmd)) { m_line_to = true; break; } } return cmd; } } #endif ����������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_conv_concat.h�������������������������������������������������������������0000644�0000000�0000000�00000005045�10703246330�020170� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_CONV_CONCAT_INCLUDED #define AGG_CONV_CONCAT_INCLUDED #include "agg_basics.h" namespace agg { //=============================================================conv_concat // Concatenation of two paths. Usually used to combine lines or curves // with markers such as arrowheads template<class VS1, class VS2> class conv_concat { public: conv_concat(VS1& source1, VS2& source2) : m_source1(&source1), m_source2(&source2), m_status(2) {} void attach1(VS1& source) { m_source1 = &source; } void attach2(VS2& source) { m_source2 = &source; } void rewind(unsigned path_id) { m_source1->rewind(path_id); m_source2->rewind(0); m_status = 0; } unsigned vertex(double* x, double* y) { unsigned cmd; if(m_status == 0) { cmd = m_source1->vertex(x, y); if(!is_stop(cmd)) return cmd; m_status = 1; } if(m_status == 1) { cmd = m_source2->vertex(x, y); if(!is_stop(cmd)) return cmd; m_status = 2; } return path_cmd_stop; } private: conv_concat(const conv_concat<VS1, VS2>&); const conv_concat<VS1, VS2>& operator = (const conv_concat<VS1, VS2>&); VS1* m_source1; VS2* m_source2; int m_status; }; } #endif �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_conv_contour.h������������������������������������������������������������0000644�0000000�0000000�00000006155�10703246330�020415� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_CONV_CONTOUR_INCLUDED #define AGG_CONV_CONTOUR_INCLUDED #include "agg_basics.h" #include "agg_vcgen_contour.h" #include "agg_conv_adaptor_vcgen.h" namespace agg { //-----------------------------------------------------------conv_contour 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_adaptor_vcgen<VertexSource, vcgen_contour>(vs) { } void line_join(line_join_e lj) { base_type::generator().line_join(lj); } void inner_join(inner_join_e ij) { base_type::generator().inner_join(ij); } void width(double w) { base_type::generator().width(w); } void miter_limit(double ml) { base_type::generator().miter_limit(ml); } void miter_limit_theta(double t) { base_type::generator().miter_limit_theta(t); } void inner_miter_limit(double ml) { base_type::generator().inner_miter_limit(ml); } void approximation_scale(double as) { base_type::generator().approximation_scale(as); } void auto_detect_orientation(bool v) { base_type::generator().auto_detect_orientation(v); } line_join_e line_join() const { return base_type::generator().line_join(); } inner_join_e inner_join() const { return base_type::generator().inner_join(); } double width() const { return base_type::generator().width(); } double miter_limit() const { return base_type::generator().miter_limit(); } double inner_miter_limit() const { return base_type::generator().inner_miter_limit(); } double approximation_scale() const { return base_type::generator().approximation_scale(); } bool auto_detect_orientation() const { return base_type::generator().auto_detect_orientation(); } private: conv_contour(const conv_contour<VertexSource>&); const conv_contour<VertexSource>& operator = (const conv_contour<VertexSource>&); }; } #endif �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_conv_curve.h��������������������������������������������������������������0000644�0000000�0000000�00000015407�10703246330�020050� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_CONV_CURVE_INCLUDED #define AGG_CONV_CURVE_INCLUDED #include "agg_basics.h" #include "agg_curves.h" 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 // 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 circular 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, nothing 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. // // 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 Curve3=curve3, class Curve4=curve4> class conv_curve { public: typedef Curve3 curve3_type; typedef Curve4 curve4_type; typedef conv_curve<VertexSource, Curve3, Curve4> self_type; explicit conv_curve(VertexSource& source) : m_source(&source), m_last_x(0.0), m_last_y(0.0) {} void attach(VertexSource& source) { m_source = &source; } void approximation_method(curve_approximation_method_e v) { m_curve3.approximation_method(v); m_curve4.approximation_method(v); } curve_approximation_method_e approximation_method() const { return m_curve4.approximation_method(); } void approximation_scale(double s) { m_curve3.approximation_scale(s); m_curve4.approximation_scale(s); } double approximation_scale() const { return m_curve4.approximation_scale(); } void angle_tolerance(double v) { m_curve3.angle_tolerance(v); m_curve4.angle_tolerance(v); } double angle_tolerance() const { return m_curve4.angle_tolerance(); } void cusp_limit(double v) { m_curve3.cusp_limit(v); m_curve4.cusp_limit(v); } double cusp_limit() const { return m_curve4.cusp_limit(); } void rewind(unsigned path_id); unsigned vertex(double* x, double* y); private: conv_curve(const self_type&); const self_type& operator = (const self_type&); VertexSource* m_source; double m_last_x; double m_last_y; curve3_type m_curve3; curve4_type m_curve4; }; //------------------------------------------------------------------------ template<class VertexSource, class Curve3, class Curve4> void conv_curve<VertexSource, Curve3, Curve4>::rewind(unsigned path_id) { m_source->rewind(path_id); m_last_x = 0.0; m_last_y = 0.0; m_curve3.reset(); m_curve4.reset(); } //------------------------------------------------------------------------ template<class VertexSource, class Curve3, class Curve4> unsigned conv_curve<VertexSource, Curve3, Curve4>::vertex(double* x, double* y) { if(!is_stop(m_curve3.vertex(x, y))) { m_last_x = *x; m_last_y = *y; return path_cmd_line_to; } if(!is_stop(m_curve4.vertex(x, y))) { m_last_x = *x; m_last_y = *y; return path_cmd_line_to; } double ct2_x; double ct2_y; double end_x; double end_y; unsigned cmd = m_source->vertex(x, y); switch(cmd) { case path_cmd_curve3: m_source->vertex(&end_x, &end_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 m_curve3.vertex(x, y); // This is the first vertex of the curve cmd = path_cmd_line_to; break; case path_cmd_curve4: 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, end_x, end_y); m_curve4.vertex(x, y); // First call returns path_cmd_move_to m_curve4.vertex(x, y); // This is the first vertex of the curve cmd = path_cmd_line_to; break; } m_last_x = *x; m_last_y = *y; return cmd; } } #endif ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_conv_dash.h���������������������������������������������������������������0000644�0000000�0000000�00000004631�10703246330�017640� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_CONV_DASH_INCLUDED #define AGG_CONV_DASH_INCLUDED #include "agg_basics.h" #include "agg_vcgen_dash.h" #include "agg_conv_adaptor_vcgen.h" namespace agg { //---------------------------------------------------------------conv_dash 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_adaptor_vcgen<VertexSource, vcgen_dash, Markers>(vs) { } 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 dash_start(double ds) { base_type::generator().dash_start(ds); } void shorten(double s) { base_type::generator().shorten(s); } double shorten() const { return base_type::generator().shorten(); } private: conv_dash(const conv_dash<VertexSource, Markers>&); const conv_dash<VertexSource, Markers>& operator = (const conv_dash<VertexSource, Markers>&); }; } #endif �������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_conv_gpc.h����������������������������������������������������������������0000644�0000000�0000000�00000031451�10703246330�017472� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- // // 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/ // Alan Murta (email: gpc@cs.man.ac.uk) // //---------------------------------------------------------------------------- #ifndef AGG_CONV_GPC_INCLUDED #define AGG_CONV_GPC_INCLUDED #include <math.h> #include "agg_basics.h" #include "agg_array.h" extern "C" { #include "gpc.h" } namespace agg { enum gpc_op_e { gpc_or, gpc_and, gpc_xor, gpc_a_minus_b, gpc_b_minus_a }; //================================================================conv_gpc template<class VSA, class VSB> class conv_gpc { enum status { status_move_to, status_line_to, status_stop }; struct contour_header_type { int num_vertices; int hole_flag; gpc_vertex* vertices; }; typedef pod_bvector<gpc_vertex, 8> vertex_array_type; typedef pod_bvector<contour_header_type, 6> contour_header_array_type; public: typedef VSA source_a_type; typedef VSB source_b_type; typedef conv_gpc<source_a_type, source_b_type> self_type; ~conv_gpc() { free_gpc_data(); } conv_gpc(source_a_type& a, source_b_type& b, gpc_op_e op = gpc_or) : m_src_a(&a), m_src_b(&b), m_status(status_move_to), m_vertex(-1), m_contour(-1), m_operation(op) { memset(&m_poly_a, 0, sizeof(m_poly_a)); memset(&m_poly_b, 0, sizeof(m_poly_b)); memset(&m_result, 0, sizeof(m_result)); } void attach1(VSA& source) { m_src_a = &source; } void attach2(VSB& source) { m_src_b = &source; } void operation(gpc_op_e v) { m_operation = v; } // Vertex Source Interface void rewind(unsigned path_id); unsigned vertex(double* x, double* y); private: conv_gpc(const conv_gpc<VSA, VSB>&); const conv_gpc<VSA, VSB>& operator = (const conv_gpc<VSA, VSB>&); //-------------------------------------------------------------------- void free_polygon(gpc_polygon& p); void free_result(); void free_gpc_data(); void start_contour(); void add_vertex(double x, double y); void end_contour(unsigned orientation); void make_polygon(gpc_polygon& p); void start_extracting(); bool next_contour(); bool next_vertex(double* x, double* y); //-------------------------------------------------------------------- template<class VS> void add(VS& src, gpc_polygon& p) { unsigned cmd; double x, y; double start_x = 0.0; double start_y = 0.0; bool line_to = false; unsigned orientation = 0; m_contour_accumulator.remove_all(); while(!is_stop(cmd = src.vertex(&x, &y))) { if(is_vertex(cmd)) { if(is_move_to(cmd)) { if(line_to) { end_contour(orientation); orientation = 0; } start_contour(); start_x = x; start_y = y; } add_vertex(x, y); line_to = true; } else { if(is_end_poly(cmd)) { orientation = get_orientation(cmd); if(line_to && is_closed(cmd)) { add_vertex(start_x, start_y); } } } } if(line_to) { end_contour(orientation); } make_polygon(p); } private: //-------------------------------------------------------------------- source_a_type* m_src_a; source_b_type* m_src_b; status m_status; int m_vertex; int m_contour; gpc_op_e m_operation; vertex_array_type m_vertex_accumulator; contour_header_array_type m_contour_accumulator; gpc_polygon m_poly_a; gpc_polygon m_poly_b; gpc_polygon m_result; }; //------------------------------------------------------------------------ template<class VSA, class VSB> void conv_gpc<VSA, VSB>::free_polygon(gpc_polygon& p) { int i; for(i = 0; i < p.num_contours; i++) { pod_allocator<gpc_vertex>::deallocate(p.contour[i].vertex, p.contour[i].num_vertices); } pod_allocator<gpc_vertex_list>::deallocate(p.contour, p.num_contours); memset(&p, 0, sizeof(gpc_polygon)); } //------------------------------------------------------------------------ template<class VSA, class VSB> void conv_gpc<VSA, VSB>::free_result() { if(m_result.contour) { gpc_free_polygon(&m_result); } memset(&m_result, 0, sizeof(m_result)); } //------------------------------------------------------------------------ template<class VSA, class VSB> void conv_gpc<VSA, VSB>::free_gpc_data() { free_polygon(m_poly_a); free_polygon(m_poly_b); free_result(); } //------------------------------------------------------------------------ template<class VSA, class VSB> void conv_gpc<VSA, VSB>::start_contour() { contour_header_type h; memset(&h, 0, sizeof(h)); m_contour_accumulator.add(h); m_vertex_accumulator.remove_all(); } //------------------------------------------------------------------------ template<class VSA, class VSB> inline void conv_gpc<VSA, VSB>::add_vertex(double x, double y) { gpc_vertex v; v.x = x; v.y = y; m_vertex_accumulator.add(v); } //------------------------------------------------------------------------ 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 = m_contour_accumulator[m_contour_accumulator.size() - 1]; h.num_vertices = m_vertex_accumulator.size(); h.hole_flag = 0; // TO DO: Clarify the "holes" //if(is_cw(orientation)) h.hole_flag = 1; h.vertices = pod_allocator<gpc_vertex>::allocate(h.num_vertices); gpc_vertex* d = h.vertices; int i; for(i = 0; i < h.num_vertices; i++) { const gpc_vertex& s = m_vertex_accumulator[i]; d->x = s.x; d->y = s.y; ++d; } } else { m_vertex_accumulator.remove_last(); } } } //------------------------------------------------------------------------ template<class VSA, class VSB> void conv_gpc<VSA, VSB>::make_polygon(gpc_polygon& p) { free_polygon(p); if(m_contour_accumulator.size()) { p.num_contours = m_contour_accumulator.size(); p.hole = 0; p.contour = pod_allocator<gpc_vertex_list>::allocate(p.num_contours); int i; gpc_vertex_list* pv = p.contour; for(i = 0; i < p.num_contours; i++) { const contour_header_type& h = m_contour_accumulator[i]; pv->num_vertices = h.num_vertices; pv->vertex = h.vertices; ++pv; } } } //------------------------------------------------------------------------ template<class VSA, class VSB> void conv_gpc<VSA, VSB>::start_extracting() { m_status = status_move_to; m_contour = -1; m_vertex = -1; } //------------------------------------------------------------------------ template<class VSA, class VSB> bool conv_gpc<VSA, VSB>::next_contour() { if(++m_contour < m_result.num_contours) { m_vertex = -1; return true; } return false; } //------------------------------------------------------------------------ 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]; if(++m_vertex < vlist.num_vertices) { const gpc_vertex& v = vlist.vertex[m_vertex]; *x = v.x; *y = v.y; return true; } return false; } //------------------------------------------------------------------------ template<class VSA, class VSB> void conv_gpc<VSA, VSB>::rewind(unsigned path_id) { free_result(); m_src_a->rewind(path_id); m_src_b->rewind(path_id); add(*m_src_a, m_poly_a); add(*m_src_b, m_poly_b); switch(m_operation) { case gpc_or: gpc_polygon_clip(GPC_UNION, &m_poly_a, &m_poly_b, &m_result); break; case gpc_and: gpc_polygon_clip(GPC_INT, &m_poly_a, &m_poly_b, &m_result); break; case gpc_xor: gpc_polygon_clip(GPC_XOR, &m_poly_a, &m_poly_b, &m_result); break; case gpc_a_minus_b: gpc_polygon_clip(GPC_DIFF, &m_poly_a, &m_poly_b, &m_result); break; case gpc_b_minus_a: gpc_polygon_clip(GPC_DIFF, &m_poly_b, &m_poly_a, &m_result); break; } start_extracting(); } //------------------------------------------------------------------------ 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_vertex(x, y)) { m_status = status_line_to; return path_cmd_move_to; } m_status = status_stop; return path_cmd_end_poly | path_flags_close; } } else { if(next_vertex(x, y)) { return path_cmd_line_to; } else { m_status = status_move_to; } return path_cmd_end_poly | path_flags_close; } return path_cmd_stop; } } #endif �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_conv_marker.h�������������������������������������������������������������0000644�0000000�0000000�00000011243�10703246330�020177� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_CONV_MARKER_INCLUDED #define AGG_CONV_MARKER_INCLUDED #include "agg_basics.h" #include "agg_trans_affine.h" namespace agg { //-------------------------------------------------------------conv_marker template<class MarkerLocator, class MarkerShapes> class conv_marker { public: conv_marker(MarkerLocator& ml, MarkerShapes& ms); trans_affine& transform() { return m_transform; } const trans_affine& transform() const { return m_transform; } void rewind(unsigned path_id); unsigned vertex(double* x, double* y); private: conv_marker(const conv_marker<MarkerLocator, MarkerShapes>&); const conv_marker<MarkerLocator, MarkerShapes>& operator = (const conv_marker<MarkerLocator, MarkerShapes>&); enum status_e { initial, markers, polygon, stop }; MarkerLocator* m_marker_locator; MarkerShapes* m_marker_shapes; trans_affine m_transform; trans_affine m_mtx; status_e m_status; unsigned m_marker; unsigned m_num_markers; }; //------------------------------------------------------------------------ template<class MarkerLocator, class MarkerShapes> conv_marker<MarkerLocator, MarkerShapes>::conv_marker(MarkerLocator& ml, MarkerShapes& ms) : m_marker_locator(&ml), m_marker_shapes(&ms), m_status(initial), m_marker(0), m_num_markers(1) { } //------------------------------------------------------------------------ template<class MarkerLocator, class MarkerShapes> void conv_marker<MarkerLocator, MarkerShapes>::rewind(unsigned) { m_status = initial; m_marker = 0; m_num_markers = 1; } //------------------------------------------------------------------------ template<class MarkerLocator, class MarkerShapes> unsigned conv_marker<MarkerLocator, MarkerShapes>::vertex(double* x, double* y) { unsigned cmd = path_cmd_move_to; double x1, y1, x2, y2; while(!is_stop(cmd)) { switch(m_status) { case initial: if(m_num_markers == 0) { cmd = path_cmd_stop; break; } m_marker_locator->rewind(m_marker); ++m_marker; m_num_markers = 0; m_status = markers; case markers: if(is_stop(m_marker_locator->vertex(&x1, &y1))) { m_status = initial; break; } if(is_stop(m_marker_locator->vertex(&x2, &y2))) { m_status = initial; break; } ++m_num_markers; m_mtx = m_transform; m_mtx *= trans_affine_rotation(atan2(y2 - y1, x2 - x1)); m_mtx *= trans_affine_translation(x1, y1); m_marker_shapes->rewind(m_marker - 1); m_status = polygon; case polygon: cmd = m_marker_shapes->vertex(x, y); if(is_stop(cmd)) { cmd = path_cmd_move_to; m_status = markers; break; } m_mtx.transform(x, y); return cmd; case stop: cmd = path_cmd_stop; break; } } return cmd; } } #endif �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_conv_marker_adaptor.h�����������������������������������������������������0000644�0000000�0000000�00000004253�10703246330�021714� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_CONV_MARKER_ADAPTOR_INCLUDED #define AGG_CONV_MARKER_ADAPTOR_INCLUDED #include "agg_basics.h" #include "agg_conv_adaptor_vcgen.h" #include "agg_vcgen_vertex_sequence.h" namespace agg { //=====================================================conv_marker_adaptor template<class VertexSource, class Markers=null_markers> 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_adaptor_vcgen<VertexSource, vcgen_vertex_sequence, Markers>(vs) { } void shorten(double s) { base_type::generator().shorten(s); } double shorten() const { return base_type::generator().shorten(); } private: conv_marker_adaptor(const conv_marker_adaptor<VertexSource, Markers>&); const conv_marker_adaptor<VertexSource, Markers>& operator = (const conv_marker_adaptor<VertexSource, Markers>&); }; } #endif �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_conv_segmentator.h��������������������������������������������������������0000644�0000000�0000000�00000004050�10703246330�021244� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_CONV_SEGMENTATOR_INCLUDED #define AGG_CONV_SEGMENTATOR_INCLUDED #include "agg_basics.h" #include "agg_conv_adaptor_vpgen.h" #include "agg_vpgen_segmentator.h" namespace agg { //========================================================conv_segmentator 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_adaptor_vpgen<VertexSource, vpgen_segmentator>(vs) {} void approximation_scale(double s) { base_type::vpgen().approximation_scale(s); } double approximation_scale() const { return base_type::vpgen().approximation_scale(); } private: conv_segmentator(const conv_segmentator<VertexSource>&); const conv_segmentator<VertexSource>& operator = (const conv_segmentator<VertexSource>&); }; } #endif ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_conv_shorten_path.h�������������������������������������������������������0000644�0000000�0000000�00000004054�10703246330�021416� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_CONV_SHORTEN_PATH_INCLUDED #define AGG_CONV_SHORTEN_PATH_INCLUDED #include "agg_basics.h" #include "agg_conv_adaptor_vcgen.h" #include "agg_vcgen_vertex_sequence.h" namespace agg { //=======================================================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_adaptor_vcgen<VertexSource, vcgen_vertex_sequence>(vs) { } void shorten(double s) { base_type::generator().shorten(s); } double shorten() const { return base_type::generator().shorten(); } private: conv_shorten_path(const conv_shorten_path<VertexSource>&); const conv_shorten_path<VertexSource>& operator = (const conv_shorten_path<VertexSource>&); }; } #endif ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_conv_smooth_poly1.h�������������������������������������������������������0000644�0000000�0000000�00000005603�10703246330�021356� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_CONV_SMOOTH_POLY1_INCLUDED #define AGG_CONV_SMOOTH_POLY1_INCLUDED #include "agg_basics.h" #include "agg_vcgen_smooth_poly1.h" #include "agg_conv_adaptor_vcgen.h" #include "agg_conv_curve.h" namespace agg { //-------------------------------------------------------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_adaptor_vcgen<VertexSource, vcgen_smooth_poly1>(vs) { } void smooth_value(double v) { base_type::generator().smooth_value(v); } double smooth_value() const { return base_type::generator().smooth_value(); } private: conv_smooth_poly1(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 : public conv_curve<conv_smooth_poly1<VertexSource> > { conv_smooth_poly1_curve(VertexSource& vs) : conv_curve<conv_smooth_poly1<VertexSource> >(m_smooth), m_smooth(vs) { } void smooth_value(double v) { m_smooth.generator().smooth_value(v); } double smooth_value() const { return m_smooth.generator().smooth_value(); } private: conv_smooth_poly1_curve(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; }; } #endif �����������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_conv_stroke.h�������������������������������������������������������������0000644�0000000�0000000�00000006521�10703246330�020230� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_CONV_STROKE_INCLUDED #define AGG_CONV_STROKE_INCLUDED #include "agg_basics.h" #include "agg_vcgen_stroke.h" #include "agg_conv_adaptor_vcgen.h" namespace agg { //-------------------------------------------------------------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_adaptor_vcgen<VertexSource, vcgen_stroke, Markers>(vs) { } void line_cap(line_cap_e lc) { base_type::generator().line_cap(lc); } void line_join(line_join_e lj) { base_type::generator().line_join(lj); } void inner_join(inner_join_e ij) { base_type::generator().inner_join(ij); } line_cap_e line_cap() const { return base_type::generator().line_cap(); } line_join_e line_join() const { return base_type::generator().line_join(); } inner_join_e inner_join() const { return base_type::generator().inner_join(); } void width(double w) { base_type::generator().width(w); } void miter_limit(double ml) { base_type::generator().miter_limit(ml); } void miter_limit_theta(double t) { base_type::generator().miter_limit_theta(t); } void inner_miter_limit(double ml) { base_type::generator().inner_miter_limit(ml); } void approximation_scale(double as) { base_type::generator().approximation_scale(as); } double width() const { return base_type::generator().width(); } double miter_limit() const { return base_type::generator().miter_limit(); } double inner_miter_limit() const { return base_type::generator().inner_miter_limit(); } double approximation_scale() const { return base_type::generator().approximation_scale(); } void shorten(double s) { base_type::generator().shorten(s); } double shorten() const { return base_type::generator().shorten(); } private: conv_stroke(const conv_stroke<VertexSource, Markers>&); const conv_stroke<VertexSource, Markers>& operator = (const conv_stroke<VertexSource, Markers>&); }; } #endif �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_conv_transform.h����������������������������������������������������������0000644�0000000�0000000�00000004412�10703246330�020731� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_CONV_TRANSFORM_INCLUDED #define AGG_CONV_TRANSFORM_INCLUDED #include "agg_basics.h" #include "agg_trans_affine.h" namespace agg { //----------------------------------------------------------conv_transform template<class VertexSource, class Transformer=trans_affine> class conv_transform { public: conv_transform(VertexSource& source, const Transformer& tr) : m_source(&source), m_trans(&tr) {} void attach(VertexSource& source) { m_source = &source; } void rewind(unsigned path_id) { m_source->rewind(path_id); } unsigned vertex(double* x, double* y) { unsigned cmd = m_source->vertex(x, y); if(is_vertex(cmd)) { m_trans->transform(x, y); } return cmd; } void transformer(const Transformer& tr) { m_trans = &tr; } private: conv_transform(const conv_transform<VertexSource>&); const conv_transform<VertexSource>& operator = (const conv_transform<VertexSource>&); VertexSource* m_source; const Transformer* m_trans; }; } #endif ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_conv_unclose_polygon.h����������������������������������������������������0000644�0000000�0000000�00000004024�10703246330�022134� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_CONV_UNCLOSE_POLYGON_INCLUDED #define AGG_CONV_UNCLOSE_POLYGON_INCLUDED #include "agg_basics.h" namespace agg { //====================================================conv_unclose_polygon template<class VertexSource> class conv_unclose_polygon { public: explicit conv_unclose_polygon(VertexSource& vs) : m_source(&vs) {} void attach(VertexSource& source) { m_source = &source; } void rewind(unsigned path_id) { m_source->rewind(path_id); } unsigned vertex(double* x, double* y) { unsigned cmd = m_source->vertex(x, y); if(is_end_poly(cmd)) cmd &= ~path_flags_close; return cmd; } private: conv_unclose_polygon(const conv_unclose_polygon<VertexSource>&); const conv_unclose_polygon<VertexSource>& operator = (const conv_unclose_polygon<VertexSource>&); VertexSource* m_source; }; } #endif ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_curves.h������������������������������������������������������������������0000644�0000000�0000000�00000047345�10703246330�017214� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_CURVES_INCLUDED #define AGG_CURVES_INCLUDED #include "agg_array.h" namespace agg { // See Implementation agg_curves.cpp //--------------------------------------------curve_approximation_method_e enum curve_approximation_method_e { curve_inc, curve_div }; //--------------------------------------------------------------curve3_inc class curve3_inc { public: curve3_inc() : m_num_steps(0), m_step(0), m_scale(1.0) { } curve3_inc(double x1, double y1, double x2, double y2, double x3, double y3) : 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, double x3, double y3); void approximation_method(curve_approximation_method_e) {} curve_approximation_method_e approximation_method() const { return curve_inc; } void approximation_scale(double s); double approximation_scale() const; void angle_tolerance(double) {} double angle_tolerance() const { return 0.0; } void cusp_limit(double) {} double cusp_limit() const { return 0.0; } void rewind(unsigned path_id); unsigned vertex(double* x, double* y); private: int m_num_steps; int m_step; double m_scale; double m_start_x; double m_start_y; double m_end_x; double m_end_y; double m_fx; double m_fy; double m_dfx; double m_dfy; double m_ddfx; double m_ddfy; double m_saved_fx; double m_saved_fy; double m_saved_dfx; double m_saved_dfy; }; //-------------------------------------------------------------curve3_div class curve3_div { public: curve3_div() : m_approximation_scale(1.0), m_angle_tolerance(0.0), m_count(0) {} curve3_div(double x1, double y1, double x2, double y2, double x3, double y3) : m_approximation_scale(1.0), m_angle_tolerance(0.0), m_count(0) { init(x1, y1, x2, y2, x3, y3); } void reset() { m_points.remove_all(); m_count = 0; } void init(double x1, double y1, double x2, double y2, double x3, double y3); void approximation_method(curve_approximation_method_e) {} curve_approximation_method_e approximation_method() const { return curve_div; } void approximation_scale(double s) { m_approximation_scale = s; } double approximation_scale() const { return m_approximation_scale; } void angle_tolerance(double a) { m_angle_tolerance = a; } double angle_tolerance() const { return m_angle_tolerance; } void cusp_limit(double) {} double cusp_limit() const { return 0.0; } void rewind(unsigned) { m_count = 0; } unsigned vertex(double* x, double* y) { if(m_count >= m_points.size()) return path_cmd_stop; const point_d& p = m_points[m_count++]; *x = p.x; *y = p.y; return (m_count == 1) ? path_cmd_move_to : path_cmd_line_to; } private: void bezier(double x1, double y1, double x2, double y2, double x3, double y3); void recursive_bezier(double x1, double y1, double x2, double y2, double x3, double y3, unsigned level); double m_approximation_scale; double m_distance_tolerance_square; double m_angle_tolerance; unsigned m_count; pod_bvector<point_d> m_points; }; //-------------------------------------------------------------curve4_points struct curve4_points { double cp[8]; curve4_points() {} curve4_points(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4) { cp[0] = x1; cp[1] = y1; cp[2] = x2; cp[3] = y2; cp[4] = x3; cp[5] = y3; cp[6] = x4; cp[7] = y4; } void init(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4) { cp[0] = x1; cp[1] = y1; cp[2] = x2; cp[3] = y2; cp[4] = x3; cp[5] = y3; cp[6] = x4; cp[7] = y4; } double operator [] (unsigned i) const { return cp[i]; } double& operator [] (unsigned i) { return cp[i]; } }; //-------------------------------------------------------------curve4_inc class curve4_inc { public: curve4_inc() : m_num_steps(0), m_step(0), m_scale(1.0) { } curve4_inc(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) { init(x1, y1, x2, y2, x3, y3, x4, y4); } curve4_inc(const curve4_points& cp) : m_num_steps(0), m_step(0), m_scale(1.0) { init(cp[0], cp[1], cp[2], cp[3], cp[4], cp[5], cp[6], cp[7]); } void reset() { m_num_steps = 0; m_step = -1; } void init(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4); void init(const curve4_points& cp) { init(cp[0], cp[1], cp[2], cp[3], cp[4], cp[5], cp[6], cp[7]); } void approximation_method(curve_approximation_method_e) {} curve_approximation_method_e approximation_method() const { return curve_inc; } void approximation_scale(double s); double approximation_scale() const; void angle_tolerance(double) {} double angle_tolerance() const { return 0.0; } void cusp_limit(double) {} double cusp_limit() const { return 0.0; } void rewind(unsigned path_id); unsigned vertex(double* x, double* y); private: int m_num_steps; int m_step; double m_scale; double m_start_x; double m_start_y; double m_end_x; double m_end_y; double m_fx; double m_fy; double m_dfx; double m_dfy; double m_ddfx; double m_ddfy; double m_dddfx; double m_dddfy; double m_saved_fx; double m_saved_fy; double m_saved_dfx; double m_saved_dfy; double m_saved_ddfx; double m_saved_ddfy; }; //-------------------------------------------------------catrom_to_bezier inline curve4_points catrom_to_bezier(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4) { // Trans. matrix Catmull-Rom to Bezier // // 0 1 0 0 // -1/6 1 1/6 0 // 0 1/6 1 -1/6 // 0 0 1 0 // return curve4_points( x2, y2, (-x1 + 6*x2 + x3) / 6, (-y1 + 6*y2 + y3) / 6, ( x2 + 6*x3 - x4) / 6, ( y2 + 6*y3 - y4) / 6, x3, y3); } //----------------------------------------------------------------------- inline curve4_points catrom_to_bezier(const curve4_points& cp) { return catrom_to_bezier(cp[0], cp[1], cp[2], cp[3], cp[4], cp[5], cp[6], cp[7]); } //-----------------------------------------------------ubspline_to_bezier inline curve4_points ubspline_to_bezier(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4) { // Trans. matrix Uniform BSpline to Bezier // // 1/6 4/6 1/6 0 // 0 4/6 2/6 0 // 0 2/6 4/6 0 // 0 1/6 4/6 1/6 // return curve4_points( (x1 + 4*x2 + x3) / 6, (y1 + 4*y2 + y3) / 6, (4*x2 + 2*x3) / 6, (4*y2 + 2*y3) / 6, (2*x2 + 4*x3) / 6, (2*y2 + 4*y3) / 6, (x2 + 4*x3 + x4) / 6, (y2 + 4*y3 + y4) / 6); } //----------------------------------------------------------------------- inline curve4_points ubspline_to_bezier(const curve4_points& cp) { return ubspline_to_bezier(cp[0], cp[1], cp[2], cp[3], cp[4], cp[5], cp[6], cp[7]); } //------------------------------------------------------hermite_to_bezier inline curve4_points hermite_to_bezier(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4) { // Trans. matrix Hermite to Bezier // // 1 0 0 0 // 1 0 1/3 0 // 0 1 0 -1/3 // 0 1 0 0 // return curve4_points( x1, y1, (3*x1 + x3) / 3, (3*y1 + y3) / 3, (3*x2 - x4) / 3, (3*y2 - y4) / 3, x2, y2); } //----------------------------------------------------------------------- inline curve4_points hermite_to_bezier(const curve4_points& cp) { return hermite_to_bezier(cp[0], cp[1], cp[2], cp[3], cp[4], cp[5], cp[6], cp[7]); } //-------------------------------------------------------------curve4_div class curve4_div { public: curve4_div() : m_approximation_scale(1.0), m_angle_tolerance(0.0), m_cusp_limit(0.0), m_count(0) {} curve4_div(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4) : m_approximation_scale(1.0), m_angle_tolerance(0.0), m_cusp_limit(0.0), m_count(0) { init(x1, y1, x2, y2, x3, y3, x4, y4); } curve4_div(const curve4_points& cp) : m_approximation_scale(1.0), m_angle_tolerance(0.0), m_count(0) { init(cp[0], cp[1], cp[2], cp[3], cp[4], cp[5], cp[6], cp[7]); } void reset() { m_points.remove_all(); m_count = 0; } void init(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4); void init(const curve4_points& cp) { init(cp[0], cp[1], cp[2], cp[3], cp[4], cp[5], cp[6], cp[7]); } void approximation_method(curve_approximation_method_e) {} curve_approximation_method_e approximation_method() const { return curve_div; } void approximation_scale(double s) { m_approximation_scale = s; } double approximation_scale() const { return m_approximation_scale; } void angle_tolerance(double a) { m_angle_tolerance = a; } double angle_tolerance() const { return m_angle_tolerance; } void cusp_limit(double v) { m_cusp_limit = (v == 0.0) ? 0.0 : pi - v; } double cusp_limit() const { return (m_cusp_limit == 0.0) ? 0.0 : pi - m_cusp_limit; } void rewind(unsigned) { m_count = 0; } unsigned vertex(double* x, double* y) { if(m_count >= m_points.size()) return path_cmd_stop; const point_d& p = m_points[m_count++]; *x = p.x; *y = p.y; return (m_count == 1) ? path_cmd_move_to : path_cmd_line_to; } private: void bezier(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4); void recursive_bezier(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4, unsigned level); double m_approximation_scale; double m_distance_tolerance_square; double m_angle_tolerance; double m_cusp_limit; unsigned m_count; pod_bvector<point_d> m_points; }; //-----------------------------------------------------------------curve3 class curve3 { public: curve3() : m_approximation_method(curve_div) {} curve3(double x1, double y1, double x2, double y2, double x3, double y3) : m_approximation_method(curve_div) { init(x1, y1, x2, y2, x3, y3); } void reset() { m_curve_inc.reset(); m_curve_div.reset(); } void init(double x1, double y1, double x2, double y2, double x3, double y3) { if(m_approximation_method == curve_inc) { m_curve_inc.init(x1, y1, x2, y2, x3, y3); } else { m_curve_div.init(x1, y1, x2, y2, x3, y3); } } void approximation_method(curve_approximation_method_e v) { m_approximation_method = v; } curve_approximation_method_e approximation_method() const { return m_approximation_method; } void approximation_scale(double s) { m_curve_inc.approximation_scale(s); m_curve_div.approximation_scale(s); } double approximation_scale() const { return m_curve_inc.approximation_scale(); } void angle_tolerance(double a) { m_curve_div.angle_tolerance(a); } double angle_tolerance() const { return m_curve_div.angle_tolerance(); } void cusp_limit(double v) { m_curve_div.cusp_limit(v); } double cusp_limit() const { return m_curve_div.cusp_limit(); } void rewind(unsigned path_id) { if(m_approximation_method == curve_inc) { m_curve_inc.rewind(path_id); } else { m_curve_div.rewind(path_id); } } unsigned vertex(double* x, double* y) { if(m_approximation_method == curve_inc) { return m_curve_inc.vertex(x, y); } return m_curve_div.vertex(x, y); } private: curve3_inc m_curve_inc; curve3_div m_curve_div; curve_approximation_method_e m_approximation_method; }; //-----------------------------------------------------------------curve4 class curve4 { public: curve4() : m_approximation_method(curve_div) {} curve4(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4) : m_approximation_method(curve_div) { init(x1, y1, x2, y2, x3, y3, x4, y4); } curve4(const curve4_points& cp) : m_approximation_method(curve_div) { init(cp[0], cp[1], cp[2], cp[3], cp[4], cp[5], cp[6], cp[7]); } void reset() { m_curve_inc.reset(); m_curve_div.reset(); } void init(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4) { if(m_approximation_method == curve_inc) { m_curve_inc.init(x1, y1, x2, y2, x3, y3, x4, y4); } else { m_curve_div.init(x1, y1, x2, y2, x3, y3, x4, y4); } } void init(const curve4_points& cp) { init(cp[0], cp[1], cp[2], cp[3], cp[4], cp[5], cp[6], cp[7]); } void approximation_method(curve_approximation_method_e v) { m_approximation_method = v; } curve_approximation_method_e approximation_method() const { return m_approximation_method; } void approximation_scale(double s) { m_curve_inc.approximation_scale(s); m_curve_div.approximation_scale(s); } double approximation_scale() const { return m_curve_inc.approximation_scale(); } void angle_tolerance(double v) { m_curve_div.angle_tolerance(v); } double angle_tolerance() const { return m_curve_div.angle_tolerance(); } void cusp_limit(double v) { m_curve_div.cusp_limit(v); } double cusp_limit() const { return m_curve_div.cusp_limit(); } void rewind(unsigned path_id) { if(m_approximation_method == curve_inc) { m_curve_inc.rewind(path_id); } else { m_curve_div.rewind(path_id); } } unsigned vertex(double* x, double* y) { if(m_approximation_method == curve_inc) { return m_curve_inc.vertex(x, y); } return m_curve_div.vertex(x, y); } private: curve4_inc m_curve_inc; curve4_div m_curve_div; curve_approximation_method_e m_approximation_method; }; } #endif �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_dda_line.h����������������������������������������������������������������0000644�0000000�0000000�00000020734�10703246330�017435� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_DDA_LINE_INCLUDED #define AGG_DDA_LINE_INCLUDED #include <stdlib.h> #include "agg_basics.h" namespace agg { //===================================================dda_line_interpolator template<int FractionShift, int YShift=0> class dda_line_interpolator { public: //-------------------------------------------------------------------- dda_line_interpolator() {} //-------------------------------------------------------------------- dda_line_interpolator(int y1, int y2, unsigned count) : m_y(y1), m_inc(((y2 - y1) << FractionShift) / int(count)), m_dy(0) { } //-------------------------------------------------------------------- void operator ++ () { m_dy += m_inc; } //-------------------------------------------------------------------- void operator -- () { m_dy -= m_inc; } //-------------------------------------------------------------------- void operator += (unsigned n) { m_dy += m_inc * n; } //-------------------------------------------------------------------- void operator -= (unsigned n) { m_dy -= m_inc * n; } //-------------------------------------------------------------------- int y() const { return m_y + (m_dy >> (FractionShift-YShift)); } int dy() const { return m_dy; } private: int m_y; int m_inc; int m_dy; }; //=================================================dda2_line_interpolator class dda2_line_interpolator { public: typedef int save_data_type; enum save_size_e { save_size = 2 }; //-------------------------------------------------------------------- dda2_line_interpolator() {} //-------------------------------------------- Forward-adjusted line dda2_line_interpolator(int y1, int y2, int count) : m_cnt(count <= 0 ? 1 : count), m_lft((y2 - y1) / m_cnt), m_rem((y2 - y1) % m_cnt), m_mod(m_rem), m_y(y1) { if(m_mod <= 0) { m_mod += count; m_rem += count; m_lft--; } m_mod -= count; } //-------------------------------------------- Backward-adjusted line dda2_line_interpolator(int y1, int y2, int count, int) : m_cnt(count <= 0 ? 1 : count), m_lft((y2 - y1) / m_cnt), m_rem((y2 - y1) % m_cnt), m_mod(m_rem), m_y(y1) { if(m_mod <= 0) { m_mod += count; m_rem += count; m_lft--; } } //-------------------------------------------- Backward-adjusted line dda2_line_interpolator(int y, int count) : m_cnt(count <= 0 ? 1 : count), m_lft(y / m_cnt), m_rem(y % m_cnt), m_mod(m_rem), m_y(0) { if(m_mod <= 0) { m_mod += count; m_rem += count; m_lft--; } } //-------------------------------------------------------------------- void save(save_data_type* data) const { data[0] = m_mod; data[1] = m_y; } //-------------------------------------------------------------------- void load(const save_data_type* data) { m_mod = data[0]; m_y = data[1]; } //-------------------------------------------------------------------- void operator++() { m_mod += m_rem; m_y += m_lft; if(m_mod > 0) { m_mod -= m_cnt; m_y++; } } //-------------------------------------------------------------------- void operator--() { if(m_mod <= m_rem) { m_mod += m_cnt; m_y--; } m_mod -= m_rem; m_y -= m_lft; } //-------------------------------------------------------------------- void adjust_forward() { m_mod -= m_cnt; } //-------------------------------------------------------------------- void adjust_backward() { m_mod += m_cnt; } //-------------------------------------------------------------------- int mod() const { return m_mod; } int rem() const { return m_rem; } int lft() const { return m_lft; } //-------------------------------------------------------------------- int y() const { return m_y; } private: int m_cnt; int m_lft; int m_rem; int m_mod; int m_y; }; //---------------------------------------------line_bresenham_interpolator class line_bresenham_interpolator { public: enum subpixel_scale_e { subpixel_shift = 8, subpixel_scale = 1 << subpixel_shift, subpixel_mask = subpixel_scale - 1 }; //-------------------------------------------------------------------- static int line_lr(int v) { return v >> subpixel_shift; } //-------------------------------------------------------------------- line_bresenham_interpolator(int x1, int y1, int x2, int y2) : m_x1_lr(line_lr(x1)), m_y1_lr(line_lr(y1)), 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) : 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_len) { } //-------------------------------------------------------------------- bool is_ver() const { return m_ver; } unsigned len() const { return m_len; } int inc() const { return m_inc; } //-------------------------------------------------------------------- void hstep() { ++m_interpolator; m_x1_lr += m_inc; } //-------------------------------------------------------------------- void vstep() { ++m_interpolator; m_y1_lr += m_inc; } //-------------------------------------------------------------------- int x1() const { return m_x1_lr; } int y1() const { return m_y1_lr; } int x2() const { return line_lr(m_interpolator.y()); } int y2() const { return line_lr(m_interpolator.y()); } int x2_hr() const { return m_interpolator.y(); } int y2_hr() const { return m_interpolator.y(); } private: int m_x1_lr; int m_y1_lr; int m_x2_lr; int m_y2_lr; bool m_ver; unsigned m_len; int m_inc; dda2_line_interpolator m_interpolator; }; } #endif ������������������������������������agg-2.5+dfsg1/include/agg_ellipse.h�����������������������������������������������������������������0000644�0000000�0000000�00000007502�10703246330�017331� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_ELLIPSE_INCLUDED #define AGG_ELLIPSE_INCLUDED #include "agg_basics.h" #include <math.h> namespace agg { //----------------------------------------------------------------ellipse class ellipse { public: ellipse() : m_x(0.0), m_y(0.0), m_rx(1.0), m_ry(1.0), m_scale(1.0), m_num(4), m_step(0), m_cw(false) {} ellipse(double x, double y, double rx, double ry, unsigned num_steps=0, bool cw=false) : m_x(x), m_y(y), m_rx(rx), m_ry(ry), m_scale(1.0), m_num(num_steps), m_step(0), m_cw(cw) { if(m_num == 0) calc_num_steps(); } void init(double x, double y, double rx, double ry, unsigned num_steps=0, bool cw=false); void approximation_scale(double scale); void rewind(unsigned path_id); unsigned vertex(double* x, double* y); private: void calc_num_steps(); double m_x; double m_y; double m_rx; double m_ry; double m_scale; unsigned m_num; unsigned m_step; bool m_cw; }; //------------------------------------------------------------------------ inline void ellipse::init(double x, double y, double rx, double ry, unsigned num_steps, bool cw) { m_x = x; m_y = y; m_rx = rx; m_ry = ry; m_num = num_steps; m_step = 0; m_cw = cw; if(m_num == 0) calc_num_steps(); } //------------------------------------------------------------------------ inline void ellipse::approximation_scale(double scale) { m_scale = scale; calc_num_steps(); } //------------------------------------------------------------------------ inline void ellipse::calc_num_steps() { double ra = (fabs(m_rx) + fabs(m_ry)) / 2; double da = acos(ra / (ra + 0.125 / m_scale)) * 2; m_num = uround(2*pi / da); } //------------------------------------------------------------------------ inline void ellipse::rewind(unsigned) { m_step = 0; } //------------------------------------------------------------------------ inline unsigned ellipse::vertex(double* x, double* y) { if(m_step == m_num) { ++m_step; return path_cmd_end_poly | path_flags_close | path_flags_ccw; } if(m_step > m_num) return path_cmd_stop; double angle = double(m_step) / double(m_num) * 2.0 * pi; if(m_cw) angle = 2.0 * pi - angle; *x = m_x + cos(angle) * m_rx; *y = m_y + sin(angle) * m_ry; m_step++; return ((m_step == 1) ? path_cmd_move_to : path_cmd_line_to); } } #endif ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_ellipse_bresenham.h�������������������������������������������������������0000644�0000000�0000000�00000005767�10703246330�021370� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_ELLIPSE_BRESENHAM_INCLUDED #define AGG_ELLIPSE_BRESENHAM_INCLUDED #include "agg_basics.h" namespace agg { //------------------------------------------ellipse_bresenham_interpolator class ellipse_bresenham_interpolator { public: ellipse_bresenham_interpolator(int rx, int ry) : m_rx2(rx * rx), m_ry2(ry * ry), m_two_rx2(m_rx2 << 1), m_two_ry2(m_ry2 << 1), m_dx(0), m_dy(0), m_inc_x(0), m_inc_y(-ry * m_two_rx2), m_cur_f(0) {} int dx() const { return m_dx; } int dy() const { return m_dy; } void operator++ () { int mx, my, mxy, min_m; int fx, fy, fxy; mx = fx = m_cur_f + m_inc_x + m_ry2; if(mx < 0) mx = -mx; my = fy = m_cur_f + m_inc_y + m_rx2; if(my < 0) my = -my; mxy = fxy = m_cur_f + m_inc_x + m_ry2 + m_inc_y + m_rx2; if(mxy < 0) mxy = -mxy; min_m = mx; bool flag = true; if(min_m > my) { min_m = my; flag = false; } m_dx = m_dy = 0; if(min_m > mxy) { m_inc_x += m_two_ry2; m_inc_y += m_two_rx2; m_cur_f = fxy; m_dx = 1; m_dy = 1; return; } if(flag) { m_inc_x += m_two_ry2; m_cur_f = fx; m_dx = 1; return; } m_inc_y += m_two_rx2; m_cur_f = fy; m_dy = 1; } private: int m_rx2; int m_ry2; int m_two_rx2; int m_two_ry2; int m_dx; int m_dy; int m_inc_x; int m_inc_y; int m_cur_f; }; } #endif ���������agg-2.5+dfsg1/include/agg_embedded_raster_fonts.h���������������������������������������������������0000644�0000000�0000000�00000004713�10703246330�022217� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_EMBEDDED_RASTER_FONTS_INCLUDED #define AGG_EMBEDDED_RASTER_FONTS_INCLUDED #include "agg_basics.h" namespace agg { extern const int8u gse4x6[]; extern const int8u gse4x8[]; extern const int8u gse5x7[]; extern const int8u gse5x9[]; extern const int8u gse6x12[]; extern const int8u gse6x9[]; extern const int8u gse7x11[]; extern const int8u gse7x11_bold[]; extern const int8u gse7x15[]; extern const int8u gse7x15_bold[]; extern const int8u gse8x16[]; extern const int8u gse8x16_bold[]; extern const int8u mcs11_prop[]; extern const int8u mcs11_prop_condensed[]; extern const int8u mcs12_prop[]; extern const int8u mcs13_prop[]; extern const int8u mcs5x10_mono[]; extern const int8u mcs5x11_mono[]; extern const int8u mcs6x10_mono[]; extern const int8u mcs6x11_mono[]; extern const int8u mcs7x12_mono_high[]; extern const int8u mcs7x12_mono_low[]; extern const int8u verdana12[]; extern const int8u verdana12_bold[]; extern const int8u verdana13[]; extern const int8u verdana13_bold[]; extern const int8u verdana14[]; extern const int8u verdana14_bold[]; extern const int8u verdana16[]; extern const int8u verdana16_bold[]; extern const int8u verdana17[]; extern const int8u verdana17_bold[]; extern const int8u verdana18[]; extern const int8u verdana18_bold[]; } #endif �����������������������������������������������������agg-2.5+dfsg1/include/agg_font_cache_manager.h������������������������������������������������������0000644�0000000�0000000�00000035264�10703246330�021465� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_FONT_CACHE_MANAGER_INCLUDED #define AGG_FONT_CACHE_MANAGER_INCLUDED #include <string.h> #include "agg_array.h" namespace agg { //---------------------------------------------------------glyph_data_type enum glyph_data_type { glyph_data_invalid = 0, glyph_data_mono = 1, glyph_data_gray8 = 2, glyph_data_outline = 3 }; //-------------------------------------------------------------glyph_cache struct glyph_cache { unsigned glyph_index; int8u* data; unsigned data_size; glyph_data_type data_type; rect_i bounds; double advance_x; double advance_y; }; //--------------------------------------------------------------font_cache class font_cache { public: enum block_size_e { block_size = 16384-16 }; //-------------------------------------------------------------------- font_cache() : m_allocator(block_size), m_font_signature(0) {} //-------------------------------------------------------------------- void signature(const char* font_signature) { m_font_signature = (char*)m_allocator.allocate(strlen(font_signature) + 1); strcpy(m_font_signature, font_signature); memset(m_glyphs, 0, sizeof(m_glyphs)); } //-------------------------------------------------------------------- bool font_is(const char* font_signature) const { return strcmp(font_signature, m_font_signature) == 0; } //-------------------------------------------------------------------- const glyph_cache* find_glyph(unsigned glyph_code) const { unsigned msb = (glyph_code >> 8) & 0xFF; if(m_glyphs[msb]) { return m_glyphs[msb][glyph_code & 0xFF]; } return 0; } //-------------------------------------------------------------------- glyph_cache* cache_glyph(unsigned glyph_code, unsigned glyph_index, unsigned data_size, glyph_data_type data_type, const rect_i& bounds, double advance_x, double advance_y) { unsigned msb = (glyph_code >> 8) & 0xFF; if(m_glyphs[msb] == 0) { m_glyphs[msb] = (glyph_cache**)m_allocator.allocate(sizeof(glyph_cache*) * 256, sizeof(glyph_cache*)); memset(m_glyphs[msb], 0, sizeof(glyph_cache*) * 256); } unsigned lsb = glyph_code & 0xFF; if(m_glyphs[msb][lsb]) return 0; // Already exists, do not overwrite glyph_cache* glyph = (glyph_cache*)m_allocator.allocate(sizeof(glyph_cache), sizeof(double)); glyph->glyph_index = glyph_index; glyph->data = m_allocator.allocate(data_size); glyph->data_size = data_size; glyph->data_type = data_type; glyph->bounds = bounds; glyph->advance_x = advance_x; glyph->advance_y = advance_y; return m_glyphs[msb][lsb] = glyph; } private: block_allocator m_allocator; glyph_cache** m_glyphs[256]; char* m_font_signature; }; //---------------------------------------------------------font_cache_pool class font_cache_pool { public: //-------------------------------------------------------------------- ~font_cache_pool() { unsigned i; for(i = 0; i < m_num_fonts; ++i) { obj_allocator<font_cache>::deallocate(m_fonts[i]); } pod_allocator<font_cache*>::deallocate(m_fonts, m_max_fonts); } //-------------------------------------------------------------------- font_cache_pool(unsigned max_fonts=32) : m_fonts(pod_allocator<font_cache*>::allocate(max_fonts)), m_max_fonts(max_fonts), m_num_fonts(0), m_cur_font(0) {} //-------------------------------------------------------------------- void font(const char* font_signature, bool reset_cache = false) { int idx = find_font(font_signature); if(idx >= 0) { if(reset_cache) { obj_allocator<font_cache>::deallocate(m_fonts[idx]); m_fonts[idx] = obj_allocator<font_cache>::allocate(); m_fonts[idx]->signature(font_signature); } m_cur_font = m_fonts[idx]; } else { if(m_num_fonts >= m_max_fonts) { obj_allocator<font_cache>::deallocate(m_fonts[0]); memcpy(m_fonts, m_fonts + 1, (m_max_fonts - 1) * sizeof(font_cache*)); m_num_fonts = m_max_fonts - 1; } m_fonts[m_num_fonts] = obj_allocator<font_cache>::allocate(); m_fonts[m_num_fonts]->signature(font_signature); m_cur_font = m_fonts[m_num_fonts]; ++m_num_fonts; } } //-------------------------------------------------------------------- const font_cache* font() const { return m_cur_font; } //-------------------------------------------------------------------- const glyph_cache* find_glyph(unsigned glyph_code) const { if(m_cur_font) return m_cur_font->find_glyph(glyph_code); return 0; } //-------------------------------------------------------------------- glyph_cache* cache_glyph(unsigned glyph_code, unsigned glyph_index, unsigned data_size, glyph_data_type data_type, const rect_i& bounds, double advance_x, double advance_y) { if(m_cur_font) { return m_cur_font->cache_glyph(glyph_code, glyph_index, data_size, data_type, bounds, advance_x, advance_y); } return 0; } //-------------------------------------------------------------------- int find_font(const char* font_signature) { unsigned i; for(i = 0; i < m_num_fonts; i++) { if(m_fonts[i]->font_is(font_signature)) return int(i); } return -1; } private: font_cache** m_fonts; unsigned m_max_fonts; unsigned m_num_fonts; font_cache* m_cur_font; }; //------------------------------------------------------------------------ enum glyph_rendering { glyph_ren_native_mono, glyph_ren_native_gray8, glyph_ren_outline, glyph_ren_agg_mono, glyph_ren_agg_gray8 }; //------------------------------------------------------font_cache_manager template<class FontEngine> class font_cache_manager { public: typedef FontEngine font_engine_type; typedef font_cache_manager<FontEngine> self_type; typedef typename font_engine_type::path_adaptor_type path_adaptor_type; typedef typename font_engine_type::gray8_adaptor_type gray8_adaptor_type; typedef typename gray8_adaptor_type::embedded_scanline gray8_scanline_type; typedef typename font_engine_type::mono_adaptor_type mono_adaptor_type; typedef typename mono_adaptor_type::embedded_scanline mono_scanline_type; //-------------------------------------------------------------------- font_cache_manager(font_engine_type& engine, unsigned max_fonts=32) : m_fonts(max_fonts), m_engine(engine), m_change_stamp(-1), m_prev_glyph(0), m_last_glyph(0) {} //-------------------------------------------------------------------- void reset_last_glyph() { m_prev_glyph = m_last_glyph = 0; } //-------------------------------------------------------------------- const glyph_cache* glyph(unsigned glyph_code) { synchronize(); const glyph_cache* gl = m_fonts.find_glyph(glyph_code); if(gl) { m_prev_glyph = m_last_glyph; return m_last_glyph = gl; } else { if(m_engine.prepare_glyph(glyph_code)) { m_prev_glyph = m_last_glyph; m_last_glyph = m_fonts.cache_glyph(glyph_code, m_engine.glyph_index(), m_engine.data_size(), m_engine.data_type(), m_engine.bounds(), m_engine.advance_x(), m_engine.advance_y()); m_engine.write_glyph_to(m_last_glyph->data); return m_last_glyph; } } return 0; } //-------------------------------------------------------------------- void init_embedded_adaptors(const glyph_cache* gl, double x, double y, double scale=1.0) { if(gl) { switch(gl->data_type) { default: return; case glyph_data_mono: m_mono_adaptor.init(gl->data, gl->data_size, x, y); break; case glyph_data_gray8: m_gray8_adaptor.init(gl->data, gl->data_size, x, y); break; case glyph_data_outline: m_path_adaptor.init(gl->data, gl->data_size, x, y, scale); break; } } } //-------------------------------------------------------------------- path_adaptor_type& path_adaptor() { return m_path_adaptor; } gray8_adaptor_type& gray8_adaptor() { return m_gray8_adaptor; } gray8_scanline_type& gray8_scanline() { return m_gray8_scanline; } mono_adaptor_type& mono_adaptor() { return m_mono_adaptor; } mono_scanline_type& mono_scanline() { return m_mono_scanline; } //-------------------------------------------------------------------- const glyph_cache* perv_glyph() const { return m_prev_glyph; } const glyph_cache* last_glyph() const { return m_last_glyph; } //-------------------------------------------------------------------- bool add_kerning(double* x, double* y) { if(m_prev_glyph && m_last_glyph) { return m_engine.add_kerning(m_prev_glyph->glyph_index, m_last_glyph->glyph_index, x, y); } return false; } //-------------------------------------------------------------------- void precache(unsigned from, unsigned to) { for(; from <= to; ++from) glyph(from); } //-------------------------------------------------------------------- void reset_cache() { m_fonts.font(m_engine.font_signature(), true); m_change_stamp = m_engine.change_stamp(); m_prev_glyph = m_last_glyph = 0; } private: //-------------------------------------------------------------------- font_cache_manager(const self_type&); const self_type& operator = (const self_type&); //-------------------------------------------------------------------- void synchronize() { if(m_change_stamp != m_engine.change_stamp()) { m_fonts.font(m_engine.font_signature()); m_change_stamp = m_engine.change_stamp(); m_prev_glyph = m_last_glyph = 0; } } font_cache_pool m_fonts; font_engine_type& m_engine; int m_change_stamp; double m_dx; double m_dy; const glyph_cache* m_prev_glyph; const glyph_cache* m_last_glyph; path_adaptor_type m_path_adaptor; gray8_adaptor_type m_gray8_adaptor; gray8_scanline_type m_gray8_scanline; mono_adaptor_type m_mono_adaptor; mono_scanline_type m_mono_scanline; }; } #endif ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_gamma_functions.h���������������������������������������������������������0000644�0000000�0000000�00000007034�10703246330�021046� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_GAMMA_FUNCTIONS_INCLUDED #define AGG_GAMMA_FUNCTIONS_INCLUDED #include <math.h> #include "agg_basics.h" namespace agg { //===============================================================gamma_none struct gamma_none { double operator()(double x) const { return x; } }; //==============================================================gamma_power class gamma_power { public: gamma_power() : m_gamma(1.0) {} gamma_power(double g) : m_gamma(g) {} void gamma(double g) { m_gamma = g; } double gamma() const { return m_gamma; } double operator() (double x) const { return pow(x, m_gamma); } private: double m_gamma; }; //==========================================================gamma_threshold class gamma_threshold { public: gamma_threshold() : m_threshold(0.5) {} gamma_threshold(double t) : m_threshold(t) {} void threshold(double t) { m_threshold = t; } double threshold() const { return m_threshold; } double operator() (double x) const { return (x < m_threshold) ? 0.0 : 1.0; } private: double m_threshold; }; //============================================================gamma_linear class gamma_linear { public: gamma_linear() : m_start(0.0), m_end(1.0) {} gamma_linear(double s, double e) : m_start(s), m_end(e) {} void set(double s, double e) { m_start = s; m_end = e; } void start(double s) { m_start = s; } void end(double e) { m_end = e; } double start() const { return m_start; } double end() const { return m_end; } double operator() (double x) const { if(x < m_start) return 0.0; if(x > m_end) return 1.0; return (x - m_start) / (m_end - m_start); } private: double m_start; double m_end; }; //==========================================================gamma_multiply class gamma_multiply { public: gamma_multiply() : m_mul(1.0) {} gamma_multiply(double v) : m_mul(v) {} void value(double v) { m_mul = v; } double value() const { return m_mul; } double operator() (double x) const { double y = x * m_mul; if(y > 1.0) y = 1.0; return y; } private: double m_mul; }; } #endif ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_gamma_lut.h���������������������������������������������������������������0000644�0000000�0000000�00000007335�10703246330�017646� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_GAMMA_LUT_INCLUDED #define AGG_GAMMA_LUT_INCLUDED #include <math.h> #include "agg_basics.h" namespace agg { template<class LoResT=int8u, class HiResT=int8u, unsigned GammaShift=8, unsigned HiResShift=8> class gamma_lut { public: typedef gamma_lut<LoResT, HiResT, GammaShift, HiResShift> self_type; enum gamma_scale_e { gamma_shift = GammaShift, gamma_size = 1 << gamma_shift, gamma_mask = gamma_size - 1 }; enum hi_res_scale_e { hi_res_shift = HiResShift, hi_res_size = 1 << hi_res_shift, hi_res_mask = hi_res_size - 1 }; ~gamma_lut() { pod_allocator<LoResT>::deallocate(m_inv_gamma, hi_res_size); pod_allocator<HiResT>::deallocate(m_dir_gamma, gamma_size); } gamma_lut() : m_gamma(1.0), m_dir_gamma(pod_allocator<HiResT>::allocate(gamma_size)), m_inv_gamma(pod_allocator<LoResT>::allocate(hi_res_size)) { unsigned i; for(i = 0; i < gamma_size; i++) { m_dir_gamma[i] = HiResT(i << (hi_res_shift - gamma_shift)); } for(i = 0; i < hi_res_size; i++) { m_inv_gamma[i] = LoResT(i >> (hi_res_shift - gamma_shift)); } } gamma_lut(double g) : m_gamma(1.0), m_dir_gamma(pod_allocator<HiResT>::allocate(gamma_size)), m_inv_gamma(pod_allocator<LoResT>::allocate(hi_res_size)) { gamma(g); } void gamma(double g) { m_gamma = g; unsigned i; for(i = 0; i < gamma_size; i++) { m_dir_gamma[i] = (HiResT) uround(pow(i / double(gamma_mask), m_gamma) * double(hi_res_mask)); } double inv_g = 1.0 / g; for(i = 0; i < hi_res_size; i++) { m_inv_gamma[i] = (LoResT) uround(pow(i / double(hi_res_mask), inv_g) * double(gamma_mask)); } } double gamma() const { return m_gamma; } HiResT dir(LoResT v) const { return m_dir_gamma[unsigned(v)]; } LoResT inv(HiResT v) const { return m_inv_gamma[unsigned(v)]; } private: gamma_lut(const self_type&); const self_type& operator = (const self_type&); double m_gamma; HiResT* m_dir_gamma; LoResT* m_inv_gamma; }; } #endif ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_glyph_raster_bin.h��������������������������������������������������������0000644�0000000�0000000�00000012167�10703246330�021232� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_GLYPH_RASTER_BIN_INCLUDED #define AGG_GLYPH_RASTER_BIN_INCLUDED #include <string.h> #include "agg_basics.h" namespace agg { //========================================================glyph_raster_bin template<class ColorT> class glyph_raster_bin { public: typedef ColorT color_type; //-------------------------------------------------------------------- struct glyph_rect { int x1,y1,x2,y2; double dx, dy; }; //-------------------------------------------------------------------- glyph_raster_bin(const int8u* font) : m_font(font), m_big_endian(false) { int t = 1; if(*(char*)&t == 0) m_big_endian = true; memset(m_span, 0, sizeof(m_span)); } //-------------------------------------------------------------------- const int8u* font() const { return m_font; } void font(const int8u* f) { m_font = f; } //-------------------------------------------------------------------- double height() const { return m_font[0]; } double base_line() const { return m_font[1]; } //-------------------------------------------------------------------- template<class CharT> double width(const CharT* str) const { unsigned start_char = m_font[2]; unsigned num_chars = m_font[3]; unsigned w = 0; while(*str) { unsigned glyph = *str; const int8u* bits = m_font + 4 + num_chars * 2 + value(m_font + 4 + (glyph - start_char) * 2); w += *bits; ++str; } return w; } //-------------------------------------------------------------------- void prepare(glyph_rect* r, double x, double y, unsigned glyph, bool flip) { unsigned start_char = m_font[2]; unsigned num_chars = m_font[3]; m_bits = m_font + 4 + num_chars * 2 + value(m_font + 4 + (glyph - start_char) * 2); m_glyph_width = *m_bits++; m_glyph_byte_width = (m_glyph_width + 7) >> 3; r->x1 = int(x); r->x2 = r->x1 + m_glyph_width - 1; if(flip) { r->y1 = int(y) - m_font[0] + m_font[1]; r->y2 = r->y1 + m_font[0] - 1; } else { r->y1 = int(y) - m_font[1] + 1; r->y2 = r->y1 + m_font[0] - 1; } r->dx = m_glyph_width; r->dy = 0; } //-------------------------------------------------------------------- const cover_type* span(unsigned i) { i = m_font[0] - i - 1; const int8u* bits = m_bits + i * m_glyph_byte_width; unsigned j; unsigned val = *bits; unsigned nb = 0; for(j = 0; j < m_glyph_width; ++j) { m_span[j] = (cover_type)((val & 0x80) ? cover_full : cover_none); val <<= 1; if(++nb >= 8) { val = *++bits; nb = 0; } } return m_span; } private: //-------------------------------------------------------------------- int16u value(const int8u* p) const { int16u v; if(m_big_endian) { *(int8u*)&v = p[1]; *((int8u*)&v + 1) = p[0]; } else { *(int8u*)&v = p[0]; *((int8u*)&v + 1) = p[1]; } return v; } //-------------------------------------------------------------------- const int8u* m_font; bool m_big_endian; cover_type m_span[32]; const int8u* m_bits; unsigned m_glyph_width; unsigned m_glyph_byte_width; }; } #endif ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_gradient_lut.h������������������������������������������������������������0000644�0000000�0000000�00000017401�10703246330�020354� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_GRADIENT_LUT_INCLUDED #define AGG_GRADIENT_LUT_INCLUDED #include "agg_array.h" #include "agg_dda_line.h" #include "agg_color_rgba.h" #include "agg_color_gray.h" namespace agg { //======================================================color_interpolator template<class ColorT> struct color_interpolator { public: typedef ColorT color_type; color_interpolator(const color_type& c1, const color_type& c2, unsigned len) : m_c1(c1), m_c2(c2), m_len(len), m_count(0) {} void operator ++ () { ++m_count; } color_type color() const { return m_c1.gradient(m_c2, double(m_count) / m_len); } private: color_type m_c1; color_type m_c2; unsigned m_len; unsigned m_count; }; //======================================================================== // Fast specialization for rgba8 template<> struct color_interpolator<rgba8> { public: typedef rgba8 color_type; color_interpolator(const color_type& c1, const color_type& c2, unsigned len) : r(c1.r, c2.r, len), g(c1.g, c2.g, len), b(c1.b, c2.b, len), a(c1.a, c2.a, len) {} void operator ++ () { ++r; ++g; ++b; ++a; } color_type color() const { return color_type(r.y(), g.y(), b.y(), a.y()); } private: agg::dda_line_interpolator<14> r, g, b, a; }; //======================================================================== // Fast specialization for gray8 template<> struct color_interpolator<gray8> { public: typedef gray8 color_type; color_interpolator(const color_type& c1, const color_type& c2, unsigned len) : v(c1.v, c2.v, len), a(c1.a, c2.a, len) {} void operator ++ () { ++v; ++a; } color_type color() const { return color_type(v.y(), a.y()); } private: agg::dda_line_interpolator<14> v,a; }; //============================================================gradient_lut template<class ColorInterpolator, unsigned ColorLutSize=256> class gradient_lut { public: typedef ColorInterpolator interpolator_type; typedef typename interpolator_type::color_type color_type; enum { color_lut_size = ColorLutSize }; //-------------------------------------------------------------------- gradient_lut() : m_color_lut(color_lut_size) {} // Build Gradient Lut // First, call remove_all(), then add_color() at least twice, // then build_lut(). Argument "offset" in add_color must be // in range [0...1] and defines a color stop as it is described // in SVG specification, section Gradients and Patterns. // The simplest linear gradient is: // gradient_lut.add_color(0.0, start_color); // gradient_lut.add_color(1.0, end_color); //-------------------------------------------------------------------- void remove_all(); void add_color(double offset, const color_type& color); void build_lut(); // Size-index Interface. This class can be used directly as the // ColorF in span_gradient. All it needs is two access methods // size() and operator []. //-------------------------------------------------------------------- static unsigned size() { return color_lut_size; } const color_type& operator [] (unsigned i) const { return m_color_lut[i]; } private: //-------------------------------------------------------------------- struct color_point { double offset; color_type color; color_point() {} color_point(double off, const color_type& c) : offset(off), color(c) { if(offset < 0.0) offset = 0.0; if(offset > 1.0) offset = 1.0; } }; typedef agg::pod_bvector<color_point, 4> color_profile_type; typedef agg::pod_array<color_type> color_lut_type; static bool offset_less(const color_point& a, const color_point& b) { return a.offset < b.offset; } static bool offset_equal(const color_point& a, const color_point& b) { return a.offset == b.offset; } //-------------------------------------------------------------------- color_profile_type m_color_profile; color_lut_type m_color_lut; }; //------------------------------------------------------------------------ template<class T, unsigned S> void gradient_lut<T,S>::remove_all() { m_color_profile.remove_all(); } //------------------------------------------------------------------------ template<class T, unsigned S> void gradient_lut<T,S>::add_color(double offset, const color_type& color) { m_color_profile.add(color_point(offset, color)); } //------------------------------------------------------------------------ template<class T, unsigned S> void gradient_lut<T,S>::build_lut() { quick_sort(m_color_profile, offset_less); m_color_profile.cut_at(remove_duplicates(m_color_profile, offset_equal)); if(m_color_profile.size() >= 2) { unsigned i; unsigned start = uround(m_color_profile[0].offset * color_lut_size); unsigned end; color_type c = m_color_profile[0].color; for(i = 0; i < start; i++) { m_color_lut[i] = c; } for(i = 1; i < m_color_profile.size(); i++) { end = uround(m_color_profile[i].offset * color_lut_size); interpolator_type ci(m_color_profile[i-1].color, m_color_profile[i ].color, end - start + 1); while(start < end) { m_color_lut[start] = ci.color(); ++ci; ++start; } } c = m_color_profile.last().color; for(; end < m_color_lut.size(); end++) { m_color_lut[end] = c; } } } } #endif ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_gsv_text.h����������������������������������������������������������������0000644�0000000�0000000�00000010300�10703246330�017525� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_GSV_TEXT_INCLUDED #define AGG_GSV_TEXT_INCLUDED #include "agg_array.h" #include "agg_conv_stroke.h" #include "agg_conv_transform.h" namespace agg { //---------------------------------------------------------------gsv_text // // See Implementation agg_gsv_text.cpp // class gsv_text { enum status { initial, next_char, start_glyph, glyph }; public: gsv_text(); void font(const void* font); void flip(bool flip_y) { m_flip = flip_y; } void load_font(const char* file); void size(double height, double width=0.0); void space(double space); void line_space(double line_space); void start_point(double x, double y); void text(const char* text); double text_width(); void rewind(unsigned path_id); unsigned vertex(double* x, double* y); private: // not supposed to be copied gsv_text(const gsv_text&); const gsv_text& operator = (const gsv_text&); int16u value(const int8u* p) const { int16u v; if(m_big_endian) { *(int8u*)&v = p[1]; *((int8u*)&v + 1) = p[0]; } else { *(int8u*)&v = p[0]; *((int8u*)&v + 1) = p[1]; } return v; } private: double m_x; double m_y; double m_start_x; double m_width; double m_height; double m_space; double m_line_space; char m_chr[2]; char* m_text; pod_array<char> m_text_buf; char* m_cur_chr; const void* m_font; pod_array<char> m_loaded_font; status m_status; bool m_big_endian; bool m_flip; int8u* m_indices; int8* m_glyphs; int8* m_bglyph; int8* m_eglyph; double m_w; double m_h; }; //--------------------------------------------------------gsv_text_outline template<class Transformer = trans_affine> class gsv_text_outline { public: gsv_text_outline(gsv_text& text, const Transformer& trans) : m_polyline(text), m_trans(m_polyline, trans) { } void width(double w) { m_polyline.width(w); } void transformer(const Transformer* trans) { m_trans->transformer(trans); } void rewind(unsigned path_id) { m_trans.rewind(path_id); m_polyline.line_join(round_join); m_polyline.line_cap(round_cap); } unsigned vertex(double* x, double* y) { return m_trans.vertex(x, y); } private: conv_stroke<gsv_text> m_polyline; conv_transform<conv_stroke<gsv_text>, Transformer> m_trans; }; } #endif ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_image_accessors.h���������������������������������������������������������0000644�0000000�0000000�00000032343�10703246330�021024� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_IMAGE_ACCESSORS_INCLUDED #define AGG_IMAGE_ACCESSORS_INCLUDED #include "agg_basics.h" namespace agg { //-----------------------------------------------------image_accessor_clip template<class PixFmt> class image_accessor_clip { public: typedef PixFmt pixfmt_type; typedef typename pixfmt_type::color_type color_type; typedef typename pixfmt_type::order_type order_type; typedef typename pixfmt_type::value_type value_type; enum pix_width_e { pix_width = pixfmt_type::pix_width }; image_accessor_clip() {} explicit image_accessor_clip(const pixfmt_type& pixf, const color_type& bk) : m_pixf(&pixf) { pixfmt_type::make_pix(m_bk_buf, bk); } void attach(const pixfmt_type& pixf) { m_pixf = &pixf; } void background_color(const color_type& bk) { pixfmt_type::make_pix(m_bk_buf, bk); } private: AGG_INLINE const int8u* pixel() const { if(m_y >= 0 && m_y < (int)m_pixf->height() && m_x >= 0 && m_x < (int)m_pixf->width()) { return m_pixf->pix_ptr(m_x, m_y); } return m_bk_buf; } public: AGG_INLINE const int8u* span(int x, int y, unsigned len) { m_x = m_x0 = x; m_y = y; if(y >= 0 && y < (int)m_pixf->height() && x >= 0 && x+(int)len <= (int)m_pixf->width()) { return m_pix_ptr = m_pixf->pix_ptr(x, y); } m_pix_ptr = 0; return pixel(); } AGG_INLINE const int8u* next_x() { if(m_pix_ptr) return m_pix_ptr += pix_width; ++m_x; return pixel(); } AGG_INLINE const int8u* next_y() { ++m_y; m_x = m_x0; if(m_pix_ptr && m_y >= 0 && m_y < (int)m_pixf->height()) { return m_pix_ptr = m_pixf->pix_ptr(m_x, m_y); } m_pix_ptr = 0; return pixel(); } private: const pixfmt_type* m_pixf; int8u m_bk_buf[4]; int m_x, m_x0, m_y; const int8u* m_pix_ptr; }; //--------------------------------------------------image_accessor_no_clip template<class PixFmt> class image_accessor_no_clip { public: typedef PixFmt pixfmt_type; typedef typename pixfmt_type::color_type color_type; typedef typename pixfmt_type::order_type order_type; typedef typename pixfmt_type::value_type value_type; enum pix_width_e { pix_width = pixfmt_type::pix_width }; image_accessor_no_clip() {} explicit image_accessor_no_clip(const pixfmt_type& pixf) : m_pixf(&pixf) {} void attach(const pixfmt_type& pixf) { m_pixf = &pixf; } AGG_INLINE const int8u* span(int x, int y, unsigned) { m_x = x; m_y = y; return m_pix_ptr = m_pixf->pix_ptr(x, y); } AGG_INLINE const int8u* next_x() { return m_pix_ptr += pix_width; } AGG_INLINE const int8u* next_y() { ++m_y; return m_pix_ptr = m_pixf->pix_ptr(m_x, m_y); } private: const pixfmt_type* m_pixf; int m_x, m_y; const int8u* m_pix_ptr; }; //----------------------------------------------------image_accessor_clone template<class PixFmt> class image_accessor_clone { public: typedef PixFmt pixfmt_type; typedef typename pixfmt_type::color_type color_type; typedef typename pixfmt_type::order_type order_type; typedef typename pixfmt_type::value_type value_type; enum pix_width_e { pix_width = pixfmt_type::pix_width }; image_accessor_clone() {} explicit image_accessor_clone(const pixfmt_type& pixf) : m_pixf(&pixf) {} void attach(const pixfmt_type& pixf) { m_pixf = &pixf; } private: AGG_INLINE const int8u* pixel() const { register int x = m_x; register int y = m_y; if(x < 0) x = 0; if(y < 0) y = 0; if(x >= (int)m_pixf->width()) x = m_pixf->width() - 1; if(y >= (int)m_pixf->height()) y = m_pixf->height() - 1; return m_pixf->pix_ptr(x, y); } public: AGG_INLINE const int8u* span(int x, int y, unsigned len) { m_x = m_x0 = x; m_y = y; if(y >= 0 && y < (int)m_pixf->height() && x >= 0 && x+len <= (int)m_pixf->width()) { return m_pix_ptr = m_pixf->pix_ptr(x, y); } m_pix_ptr = 0; return pixel(); } AGG_INLINE const int8u* next_x() { if(m_pix_ptr) return m_pix_ptr += pix_width; ++m_x; return pixel(); } AGG_INLINE const int8u* next_y() { ++m_y; m_x = m_x0; if(m_pix_ptr && m_y >= 0 && m_y < (int)m_pixf->height()) { return m_pix_ptr = m_pixf->pix_ptr(m_x, m_y); } m_pix_ptr = 0; return pixel(); } private: const pixfmt_type* m_pixf; int m_x, m_x0, m_y; const int8u* m_pix_ptr; }; //-----------------------------------------------------image_accessor_wrap template<class PixFmt, class WrapX, class WrapY> class image_accessor_wrap { public: typedef PixFmt pixfmt_type; typedef typename pixfmt_type::color_type color_type; typedef typename pixfmt_type::order_type order_type; typedef typename pixfmt_type::value_type value_type; enum pix_width_e { pix_width = pixfmt_type::pix_width }; image_accessor_wrap() {} explicit image_accessor_wrap(const pixfmt_type& pixf) : m_pixf(&pixf), m_wrap_x(pixf.width()), m_wrap_y(pixf.height()) {} void attach(const pixfmt_type& pixf) { m_pixf = &pixf; } AGG_INLINE const int8u* span(int x, int y, unsigned) { m_x = x; m_row_ptr = m_pixf->row_ptr(m_wrap_y(y)); return m_row_ptr + m_wrap_x(x) * pix_width; } AGG_INLINE const int8u* next_x() { int x = ++m_wrap_x; return m_row_ptr + x * pix_width; } AGG_INLINE const int8u* next_y() { m_row_ptr = m_pixf->row_ptr(++m_wrap_y); return m_row_ptr + m_wrap_x(m_x) * pix_width; } private: const pixfmt_type* m_pixf; const int8u* m_row_ptr; int m_x; WrapX m_wrap_x; WrapY m_wrap_y; }; //--------------------------------------------------------wrap_mode_repeat class wrap_mode_repeat { public: wrap_mode_repeat() {} 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; } AGG_INLINE unsigned operator++ () { ++m_value; if(m_value >= m_size) m_value = 0; return m_value; } private: unsigned m_size; unsigned m_add; unsigned m_value; }; //---------------------------------------------------wrap_mode_repeat_pow2 class wrap_mode_repeat_pow2 { public: wrap_mode_repeat_pow2() {} wrap_mode_repeat_pow2(unsigned size) : m_value(0) { m_mask = 1; while(m_mask < size) m_mask = (m_mask << 1) | 1; m_mask >>= 1; } AGG_INLINE unsigned operator() (int v) { return m_value = unsigned(v) & m_mask; } AGG_INLINE unsigned operator++ () { ++m_value; if(m_value > m_mask) m_value = 0; return m_value; } private: unsigned m_mask; unsigned m_value; }; //----------------------------------------------wrap_mode_repeat_auto_pow2 class wrap_mode_repeat_auto_pow2 { public: wrap_mode_repeat_auto_pow2() {} wrap_mode_repeat_auto_pow2(unsigned size) : m_size(size), m_add(size * (0x3FFFFFFF / size)), m_mask((m_size & (m_size-1)) ? 0 : m_size-1), m_value(0) {} 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; } AGG_INLINE unsigned operator++ () { ++m_value; if(m_value >= m_size) m_value = 0; return m_value; } private: unsigned m_size; unsigned m_add; unsigned m_mask; unsigned m_value; }; //-------------------------------------------------------wrap_mode_reflect class wrap_mode_reflect { public: wrap_mode_reflect() {} 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; } AGG_INLINE unsigned operator++ () { ++m_value; if(m_value >= m_size2) m_value = 0; if(m_value >= m_size) return m_size2 - m_value - 1; return m_value; } private: unsigned m_size; unsigned m_size2; unsigned m_add; unsigned m_value; }; //--------------------------------------------------wrap_mode_reflect_pow2 class wrap_mode_reflect_pow2 { public: wrap_mode_reflect_pow2() {} wrap_mode_reflect_pow2(unsigned size) : m_value(0) { m_mask = 1; m_size = 1; 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; } AGG_INLINE unsigned operator++ () { ++m_value; m_value &= m_mask; if(m_value >= m_size) return m_mask - m_value; return m_value; } private: unsigned m_size; unsigned m_mask; unsigned m_value; }; //---------------------------------------------wrap_mode_reflect_auto_pow2 class wrap_mode_reflect_auto_pow2 { public: wrap_mode_reflect_auto_pow2() {} wrap_mode_reflect_auto_pow2(unsigned size) : m_size(size), m_size2(size * 2), m_add(m_size2 * (0x3FFFFFFF / m_size2)), m_mask((m_size2 & (m_size2-1)) ? 0 : m_size2-1), m_value(0) {} 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; } AGG_INLINE unsigned operator++ () { ++m_value; if(m_value >= m_size2) m_value = 0; if(m_value >= m_size) return m_size2 - m_value - 1; return m_value; } private: unsigned m_size; unsigned m_size2; unsigned m_add; unsigned m_mask; unsigned m_value; }; } #endif ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_image_filters.h�����������������������������������������������������������0000644�0000000�0000000�00000035301�10703246330�020504� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_IMAGE_FILTERS_INCLUDED #define AGG_IMAGE_FILTERS_INCLUDED #include "agg_array.h" #include "agg_math.h" namespace agg { // See Implementation agg_image_filters.cpp enum image_filter_scale_e { image_filter_shift = 14, //----image_filter_shift image_filter_scale = 1 << image_filter_shift, //----image_filter_scale image_filter_mask = image_filter_scale - 1 //----image_filter_mask }; enum image_subpixel_scale_e { image_subpixel_shift = 8, //----image_subpixel_shift image_subpixel_scale = 1 << image_subpixel_shift, //----image_subpixel_scale image_subpixel_mask = image_subpixel_scale - 1 //----image_subpixel_mask }; //-----------------------------------------------------image_filter_lut class image_filter_lut { public: template<class FilterF> void calculate(const FilterF& filter, bool normalization=true) { double r = filter.radius(); realloc_lut(r); unsigned i; unsigned pivot = diameter() << (image_subpixel_shift - 1); for(i = 0; i < pivot; i++) { double x = double(i) / double(image_subpixel_scale); double y = filter.calc_weight(x); m_weight_array[pivot + i] = m_weight_array[pivot - i] = (int16)iround(y * image_filter_scale); } unsigned end = (diameter() << image_subpixel_shift) - 1; m_weight_array[0] = m_weight_array[end]; if(normalization) { normalize(); } } image_filter_lut() : m_radius(0), m_diameter(0), m_start(0) {} template<class FilterF> image_filter_lut(const FilterF& filter, bool normalization=true) { calculate(filter, normalization); } double radius() const { return m_radius; } unsigned diameter() const { return m_diameter; } int start() const { return m_start; } const int16* weight_array() const { return &m_weight_array[0]; } void normalize(); private: void realloc_lut(double radius); image_filter_lut(const image_filter_lut&); const image_filter_lut& operator = (const image_filter_lut&); double m_radius; unsigned m_diameter; int m_start; pod_array<int16> m_weight_array; }; //--------------------------------------------------------image_filter template<class FilterF> class image_filter : public image_filter_lut { public: image_filter() { calculate(m_filter_function); } private: FilterF m_filter_function; }; //-----------------------------------------------image_filter_bilinear struct image_filter_bilinear { static double radius() { return 1.0; } static double calc_weight(double x) { return 1.0 - x; } }; //-----------------------------------------------image_filter_hanning struct image_filter_hanning { static double radius() { return 1.0; } static double calc_weight(double x) { return 0.5 + 0.5 * cos(pi * x); } }; //-----------------------------------------------image_filter_hamming struct image_filter_hamming { static double radius() { return 1.0; } static double calc_weight(double x) { return 0.54 + 0.46 * cos(pi * x); } }; //-----------------------------------------------image_filter_hermite struct image_filter_hermite { static double radius() { return 1.0; } static double calc_weight(double x) { return (2.0 * x - 3.0) * x * x + 1.0; } }; //------------------------------------------------image_filter_quadric struct image_filter_quadric { static double radius() { return 1.5; } static double calc_weight(double x) { double t; if(x < 0.5) return 0.75 - x * x; if(x < 1.5) {t = x - 1.5; return 0.5 * t * t;} return 0.0; } }; //------------------------------------------------image_filter_bicubic class image_filter_bicubic { static double pow3(double x) { return (x <= 0.0) ? 0.0 : x * x * x; } public: static double radius() { return 2.0; } static double calc_weight(double x) { return (1.0/6.0) * (pow3(x + 2) - 4 * pow3(x + 1) + 6 * pow3(x) - 4 * pow3(x - 1)); } }; //-------------------------------------------------image_filter_kaiser class image_filter_kaiser { double a; double i0a; double epsilon; public: image_filter_kaiser(double b = 6.33) : a(b), epsilon(1e-12) { i0a = 1.0 / bessel_i0(b); } static double radius() { return 1.0; } double calc_weight(double x) const { return bessel_i0(a * sqrt(1. - x * x)) * i0a; } private: double bessel_i0(double x) const { int i; double sum, y, t; sum = 1.; y = x * x / 4.; t = y; for(i = 2; t > epsilon; i++) { sum += t; t *= (double)y / (i * i); } return sum; } }; //----------------------------------------------image_filter_catrom struct image_filter_catrom { static double radius() { return 2.0; } static double calc_weight(double x) { if(x < 1.0) return 0.5 * (2.0 + x * x * (-5.0 + x * 3.0)); if(x < 2.0) return 0.5 * (4.0 + x * (-8.0 + x * (5.0 - x))); return 0.; } }; //---------------------------------------------image_filter_mitchell class image_filter_mitchell { double p0, p2, p3; double q0, q1, q2, q3; public: image_filter_mitchell(double b = 1.0/3.0, double c = 1.0/3.0) : p0((6.0 - 2.0 * b) / 6.0), p2((-18.0 + 12.0 * b + 6.0 * c) / 6.0), p3((12.0 - 9.0 * b - 6.0 * c) / 6.0), q0((8.0 * b + 24.0 * c) / 6.0), q1((-12.0 * b - 48.0 * c) / 6.0), q2((6.0 * b + 30.0 * c) / 6.0), q3((-b - 6.0 * c) / 6.0) {} static double radius() { return 2.0; } double calc_weight(double x) const { if(x < 1.0) return p0 + x * x * (p2 + x * p3); if(x < 2.0) return q0 + x * (q1 + x * (q2 + x * q3)); return 0.0; } }; //----------------------------------------------image_filter_spline16 struct image_filter_spline16 { static double radius() { return 2.0; } static double calc_weight(double x) { if(x < 1.0) { return ((x - 9.0/5.0 ) * x - 1.0/5.0 ) * x + 1.0; } return ((-1.0/3.0 * (x-1) + 4.0/5.0) * (x-1) - 7.0/15.0 ) * (x-1); } }; //---------------------------------------------image_filter_spline36 struct image_filter_spline36 { static double radius() { return 3.0; } static double calc_weight(double x) { if(x < 1.0) { return ((13.0/11.0 * x - 453.0/209.0) * x - 3.0/209.0) * x + 1.0; } if(x < 2.0) { return ((-6.0/11.0 * (x-1) + 270.0/209.0) * (x-1) - 156.0/ 209.0) * (x-1); } return ((1.0/11.0 * (x-2) - 45.0/209.0) * (x-2) + 26.0/209.0) * (x-2); } }; //----------------------------------------------image_filter_gaussian struct image_filter_gaussian { static double radius() { return 2.0; } static double calc_weight(double x) { return exp(-2.0 * x * x) * sqrt(2.0 / pi); } }; //------------------------------------------------image_filter_bessel struct image_filter_bessel { static double radius() { return 3.2383; } static double calc_weight(double x) { return (x == 0.0) ? pi / 4.0 : besj(pi * x, 1) / (2.0 * x); } }; //-------------------------------------------------image_filter_sinc class image_filter_sinc { public: image_filter_sinc(double r) : m_radius(r < 2.0 ? 2.0 : r) {} double radius() const { return m_radius; } double calc_weight(double x) const { if(x == 0.0) return 1.0; x *= pi; return sin(x) / x; } private: double m_radius; }; //-----------------------------------------------image_filter_lanczos class image_filter_lanczos { public: image_filter_lanczos(double r) : m_radius(r < 2.0 ? 2.0 : r) {} double radius() const { return m_radius; } double calc_weight(double x) const { if(x == 0.0) return 1.0; if(x > m_radius) return 0.0; x *= pi; double xr = x / m_radius; return (sin(x) / x) * (sin(xr) / xr); } private: double m_radius; }; //----------------------------------------------image_filter_blackman class image_filter_blackman { public: image_filter_blackman(double r) : m_radius(r < 2.0 ? 2.0 : r) {} double radius() const { return m_radius; } double calc_weight(double x) const { if(x == 0.0) return 1.0; if(x > m_radius) return 0.0; x *= pi; double xr = x / m_radius; return (sin(x) / x) * (0.42 + 0.5*cos(xr) + 0.08*cos(2*xr)); } private: double m_radius; }; //------------------------------------------------image_filter_sinc36 class image_filter_sinc36 : public image_filter_sinc { public: image_filter_sinc36() : image_filter_sinc(3.0){} }; //------------------------------------------------image_filter_sinc64 class image_filter_sinc64 : public image_filter_sinc { public: image_filter_sinc64() : image_filter_sinc(4.0){} }; //-----------------------------------------------image_filter_sinc100 class image_filter_sinc100 : public image_filter_sinc { public: image_filter_sinc100() : image_filter_sinc(5.0){} }; //-----------------------------------------------image_filter_sinc144 class image_filter_sinc144 : public image_filter_sinc { public: image_filter_sinc144() : image_filter_sinc(6.0){} }; //-----------------------------------------------image_filter_sinc196 class image_filter_sinc196 : public image_filter_sinc { public: image_filter_sinc196() : image_filter_sinc(7.0){} }; //-----------------------------------------------image_filter_sinc256 class image_filter_sinc256 : public image_filter_sinc { public: image_filter_sinc256() : image_filter_sinc(8.0){} }; //---------------------------------------------image_filter_lanczos36 class image_filter_lanczos36 : public image_filter_lanczos { public: image_filter_lanczos36() : image_filter_lanczos(3.0){} }; //---------------------------------------------image_filter_lanczos64 class image_filter_lanczos64 : public image_filter_lanczos { public: image_filter_lanczos64() : image_filter_lanczos(4.0){} }; //--------------------------------------------image_filter_lanczos100 class image_filter_lanczos100 : public image_filter_lanczos { public: image_filter_lanczos100() : image_filter_lanczos(5.0){} }; //--------------------------------------------image_filter_lanczos144 class image_filter_lanczos144 : public image_filter_lanczos { public: image_filter_lanczos144() : image_filter_lanczos(6.0){} }; //--------------------------------------------image_filter_lanczos196 class image_filter_lanczos196 : public image_filter_lanczos { public: image_filter_lanczos196() : image_filter_lanczos(7.0){} }; //--------------------------------------------image_filter_lanczos256 class image_filter_lanczos256 : public image_filter_lanczos { public: image_filter_lanczos256() : image_filter_lanczos(8.0){} }; //--------------------------------------------image_filter_blackman36 class image_filter_blackman36 : public image_filter_blackman { public: image_filter_blackman36() : image_filter_blackman(3.0){} }; //--------------------------------------------image_filter_blackman64 class image_filter_blackman64 : public image_filter_blackman { public: image_filter_blackman64() : image_filter_blackman(4.0){} }; //-------------------------------------------image_filter_blackman100 class image_filter_blackman100 : public image_filter_blackman { public: image_filter_blackman100() : image_filter_blackman(5.0){} }; //-------------------------------------------image_filter_blackman144 class image_filter_blackman144 : public image_filter_blackman { public: image_filter_blackman144() : image_filter_blackman(6.0){} }; //-------------------------------------------image_filter_blackman196 class image_filter_blackman196 : public image_filter_blackman { public: image_filter_blackman196() : image_filter_blackman(7.0){} }; //-------------------------------------------image_filter_blackman256 class image_filter_blackman256 : public image_filter_blackman { public: image_filter_blackman256() : image_filter_blackman(8.0){} }; } #endif �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_line_aa_basics.h����������������������������������������������������������0000644�0000000�0000000�00000015670�10703246330�020615� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_LINE_AA_BASICS_INCLUDED #define AGG_LINE_AA_BASICS_INCLUDED #include <stdlib.h> #include "agg_basics.h" namespace agg { // See Implementation agg_line_aa_basics.cpp //------------------------------------------------------------------------- enum line_subpixel_scale_e { line_subpixel_shift = 8, //----line_subpixel_shift line_subpixel_scale = 1 << line_subpixel_shift, //----line_subpixel_scale line_subpixel_mask = line_subpixel_scale - 1, //----line_subpixel_mask line_max_coord = (1 << 28) - 1, //----line_max_coord line_max_length = 1 << (line_subpixel_shift + 10) //----line_max_length }; //------------------------------------------------------------------------- enum line_mr_subpixel_scale_e { line_mr_subpixel_shift = 4, //----line_mr_subpixel_shift line_mr_subpixel_scale = 1 << line_mr_subpixel_shift, //----line_mr_subpixel_scale line_mr_subpixel_mask = line_mr_subpixel_scale - 1 //----line_mr_subpixel_mask }; //------------------------------------------------------------------line_mr AGG_INLINE int line_mr(int x) { return x >> (line_subpixel_shift - line_mr_subpixel_shift); } //-------------------------------------------------------------------line_hr AGG_INLINE int line_hr(int x) { return x << (line_subpixel_shift - line_mr_subpixel_shift); } //---------------------------------------------------------------line_dbl_hr AGG_INLINE int line_dbl_hr(int x) { return x << line_subpixel_shift; } //---------------------------------------------------------------line_coord struct line_coord { AGG_INLINE static int conv(double x) { return iround(x * line_subpixel_scale); } }; //-----------------------------------------------------------line_coord_sat struct line_coord_sat { AGG_INLINE static int conv(double x) { return saturation<line_max_coord>::iround(x * line_subpixel_scale); } }; //==========================================================line_parameters struct line_parameters { //--------------------------------------------------------------------- line_parameters() {} line_parameters(int x1_, int y1_, int x2_, int y2_, int len_) : x1(x1_), y1(y1_), x2(x2_), y2(y2_), dx(abs(x2_ - x1_)), dy(abs(y2_ - y1_)), sx((x2_ > x1_) ? 1 : -1), sy((y2_ > y1_) ? 1 : -1), vertical(dy >= dx), inc(vertical ? sy : sx), len(len_), octant((sy & 4) | (sx & 2) | int(vertical)) { } //--------------------------------------------------------------------- unsigned orthogonal_quadrant() const { return s_orthogonal_quadrant[octant]; } unsigned diagonal_quadrant() const { return s_diagonal_quadrant[octant]; } //--------------------------------------------------------------------- bool same_orthogonal_quadrant(const line_parameters& lp) const { return s_orthogonal_quadrant[octant] == s_orthogonal_quadrant[lp.octant]; } //--------------------------------------------------------------------- bool same_diagonal_quadrant(const line_parameters& lp) const { return s_diagonal_quadrant[octant] == s_diagonal_quadrant[lp.octant]; } //--------------------------------------------------------------------- void divide(line_parameters& lp1, line_parameters& lp2) const { int xmid = (x1 + x2) >> 1; int ymid = (y1 + y2) >> 1; int len2 = len >> 1; lp1 = *this; lp2 = *this; lp1.x2 = xmid; lp1.y2 = ymid; lp1.len = len2; lp1.dx = abs(lp1.x2 - lp1.x1); lp1.dy = abs(lp1.y2 - lp1.y1); lp2.x1 = xmid; lp2.y1 = ymid; lp2.len = len2; lp2.dx = abs(lp2.x2 - lp2.x1); lp2.dy = abs(lp2.y2 - lp2.y1); } //--------------------------------------------------------------------- int x1, y1, x2, y2, dx, dy, sx, sy; bool vertical; int inc; int len; int octant; //--------------------------------------------------------------------- static const int8u s_orthogonal_quadrant[8]; static const int8u s_diagonal_quadrant[8]; }; // See Implementation agg_line_aa_basics.cpp //----------------------------------------------------------------bisectrix 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, int* x, int* y) { int d = iround((double(*x - lp.x2) * double(lp.y2 - lp.y1) - double(*y - lp.y2) * double(lp.x2 - lp.x1)) / lp.len); if(d < line_subpixel_scale/2) { *x = lp.x1 + (lp.y2 - lp.y1); *y = lp.y1 - (lp.x2 - lp.x1); } } //---------------------------------------------fix_degenerate_bisectrix_end void inline fix_degenerate_bisectrix_end(const line_parameters& lp, int* x, int* y) { int d = iround((double(*x - lp.x2) * double(lp.y2 - lp.y1) - double(*y - lp.y2) * double(lp.x2 - lp.x1)) / lp.len); if(d < line_subpixel_scale/2) { *x = lp.x2 + (lp.y2 - lp.y1); *y = lp.y2 - (lp.x2 - lp.x1); } } } #endif ������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_math.h��������������������������������������������������������������������0000644�0000000�0000000�00000035526�10703246330�016634� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- // Bessel function (besj) was adapted for use in AGG library by Andy Wilk // Contact: castor.vulgaris@gmail.com //---------------------------------------------------------------------------- #ifndef AGG_MATH_INCLUDED #define AGG_MATH_INCLUDED #include <math.h> #include "agg_basics.h" namespace agg { //------------------------------------------------------vertex_dist_epsilon // Coinciding points maximal distance (Epsilon) const double vertex_dist_epsilon = 1e-14; //-----------------------------------------------------intersection_epsilon // See calc_intersection const double intersection_epsilon = 1.0e-30; //------------------------------------------------------------cross_product AGG_INLINE double cross_product(double x1, double y1, double x2, double y2, double x, double y) { return (x - x2) * (y2 - y1) - (y - y2) * (x2 - x1); } //--------------------------------------------------------point_in_triangle AGG_INLINE bool point_in_triangle(double x1, double y1, double x2, double y2, double x3, double y3, double x, double y) { bool cp1 = cross_product(x1, y1, x2, y2, x, y) < 0.0; bool cp2 = cross_product(x2, y2, x3, y3, x, y) < 0.0; bool cp3 = cross_product(x3, y3, x1, y1, x, y) < 0.0; return cp1 == cp2 && cp2 == cp3 && cp3 == cp1; } //-----------------------------------------------------------calc_distance AGG_INLINE double calc_distance(double x1, double y1, double x2, double y2) { double dx = x2-x1; double dy = y2-y1; return sqrt(dx * dx + dy * dy); } //--------------------------------------------------------calc_sq_distance AGG_INLINE double calc_sq_distance(double x1, double y1, double x2, double y2) { double dx = x2-x1; double dy = y2-y1; return dx * dx + dy * dy; } //------------------------------------------------calc_line_point_distance AGG_INLINE double calc_line_point_distance(double x1, double y1, double x2, double y2, double x, double y) { double dx = x2-x1; double dy = y2-y1; double d = sqrt(dx * dx + dy * dy); if(d < vertex_dist_epsilon) { return calc_distance(x1, y1, x, y); } return ((x - x2) * dy - (y - y2) * dx) / d; } //-------------------------------------------------------calc_line_point_u AGG_INLINE double calc_segment_point_u(double x1, double y1, double x2, double y2, double x, double y) { double dx = x2 - x1; double dy = y2 - y1; if(dx == 0 && dy == 0) { return 0; } double pdx = x - x1; double pdy = y - y1; return (pdx * dx + pdy * dy) / (dx * dx + dy * dy); } //---------------------------------------------calc_line_point_sq_distance AGG_INLINE double calc_segment_point_sq_distance(double x1, double y1, double x2, double y2, double x, double y, double u) { if(u <= 0) { return calc_sq_distance(x, y, x1, y1); } else if(u >= 1) { return calc_sq_distance(x, y, x2, y2); } return calc_sq_distance(x, y, x1 + u * (x2 - x1), y1 + u * (y2 - y1)); } //---------------------------------------------calc_line_point_sq_distance AGG_INLINE double calc_segment_point_sq_distance(double x1, double y1, double x2, double y2, double x, double y) { return calc_segment_point_sq_distance( x1, y1, x2, y2, x, y, calc_segment_point_u(x1, y1, x2, y2, x, y)); } //-------------------------------------------------------calc_intersection AGG_INLINE bool calc_intersection(double ax, double ay, double bx, double by, double cx, double cy, double dx, double dy, double* x, double* y) { double num = (ay-cy) * (dx-cx) - (ax-cx) * (dy-cy); double den = (bx-ax) * (dy-cy) - (by-ay) * (dx-cx); if(fabs(den) < intersection_epsilon) return false; double r = num / den; *x = ax + r * (bx-ax); *y = ay + r * (by-ay); return true; } //-----------------------------------------------------intersection_exists AGG_INLINE bool intersection_exists(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4) { // It's less expensive but you can't control the // boundary conditions: Less or LessEqual double dx1 = x2 - x1; double dy1 = y2 - y1; double dx2 = x4 - x3; double dy2 = y4 - y3; return ((x3 - x2) * dy1 - (y3 - y2) * dx1 < 0.0) != ((x4 - x2) * dy1 - (y4 - y2) * dx1 < 0.0) && ((x1 - x4) * dy2 - (y1 - y4) * dx2 < 0.0) != ((x2 - x4) * dy2 - (y2 - y4) * dx2 < 0.0); // It's is more expensive but more flexible // in terms of boundary conditions. //-------------------- //double den = (x2-x1) * (y4-y3) - (y2-y1) * (x4-x3); //if(fabs(den) < intersection_epsilon) return false; //double nom1 = (x4-x3) * (y1-y3) - (y4-y3) * (x1-x3); //double nom2 = (x2-x1) * (y1-y3) - (y2-y1) * (x1-x3); //double ua = nom1 / den; //double ub = nom2 / den; //return ua >= 0.0 && ua <= 1.0 && ub >= 0.0 && ub <= 1.0; } //--------------------------------------------------------calc_orthogonal AGG_INLINE void calc_orthogonal(double thickness, double x1, double y1, double x2, double y2, double* x, double* y) { double dx = x2 - x1; double dy = y2 - y1; double d = sqrt(dx*dx + dy*dy); *x = thickness * dy / d; *y = -thickness * dx / d; } //--------------------------------------------------------dilate_triangle AGG_INLINE void dilate_triangle(double x1, double y1, double x2, double y2, double x3, double y3, double *x, double* y, double d) { double dx1=0.0; double dy1=0.0; double dx2=0.0; double dy2=0.0; double dx3=0.0; double dy3=0.0; double loc = cross_product(x1, y1, x2, y2, x3, y3); if(fabs(loc) > intersection_epsilon) { if(cross_product(x1, y1, x2, y2, x3, y3) > 0.0) { d = -d; } calc_orthogonal(d, x1, y1, x2, y2, &dx1, &dy1); calc_orthogonal(d, x2, y2, x3, y3, &dx2, &dy2); calc_orthogonal(d, x3, y3, x1, y1, &dx3, &dy3); } *x++ = x1 + dx1; *y++ = y1 + dy1; *x++ = x2 + dx1; *y++ = y2 + dy1; *x++ = x2 + dx2; *y++ = y2 + dy2; *x++ = x3 + dx2; *y++ = y3 + dy2; *x++ = x3 + dx3; *y++ = y3 + dy3; *x++ = x1 + dx3; *y++ = y1 + dy3; } //------------------------------------------------------calc_triangle_area AGG_INLINE double calc_triangle_area(double x1, double y1, double x2, double y2, double x3, double y3) { return (x1*y2 - x2*y1 + x2*y3 - x3*y2 + x3*y1 - x1*y3) * 0.5; } //-------------------------------------------------------calc_polygon_area template<class Storage> double calc_polygon_area(const Storage& st) { unsigned i; double sum = 0.0; double x = st[0].x; double y = st[0].y; double xs = x; double ys = y; for(i = 1; i < st.size(); i++) { const typename Storage::value_type& v = st[i]; sum += x * v.y - y * v.x; x = v.x; y = v.y; } return (sum + x * ys - y * xs) * 0.5; } //------------------------------------------------------------------------ // Tables for fast sqrt extern int16u g_sqrt_table[1024]; extern int8 g_elder_bit_table[256]; //---------------------------------------------------------------fast_sqrt //Fast integer Sqrt - really fast: no cycles, divisions or multiplications #if defined(_MSC_VER) #pragma warning(push) #pragma warning(disable : 4035) //Disable warning "no return value" #endif 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 //significant bit of the value. For other processors //(and maybe compilers) the pure C "#else" section is used. __asm { mov ebx, val mov edx, 11 bsr ecx, ebx sub ecx, 9 jle less_than_9_bits shr ecx, 1 adc ecx, 0 sub edx, ecx shl ecx, 1 shr ebx, cl less_than_9_bits: xor eax, eax mov ax, g_sqrt_table[ebx*2] mov ecx, edx shr eax, cl } #else //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 //faster (sic!) then just one "bsr". On PIII and PIV the //bsr is optimized quite well. bit = t >> 24; if(bit) { bit = g_elder_bit_table[bit] + 24; } else { bit = (t >> 16) & 0xFF; if(bit) { bit = g_elder_bit_table[bit] + 16; } else { bit = (t >> 8) & 0xFF; if(bit) { bit = g_elder_bit_table[bit] + 8; } else { bit = g_elder_bit_table[t]; } } } //This code calculates the sqrt. bit -= 9; if(bit > 0) { bit = (bit >> 1) + (bit & 1); shift -= bit; val >>= (bit << 1); } return g_sqrt_table[val] >> shift; #endif } #if defined(_MSC_VER) #pragma warning(pop) #endif //--------------------------------------------------------------------besj // Function BESJ calculates Bessel function of first kind of order n // Arguments: // n - an integer (>=0), the order // x - value at which the Bessel function is required //-------------------- // C++ Mathematical Library // Convereted from equivalent FORTRAN library // Converetd by Gareth Walker for use by course 392 computational project // All functions tested and yield the same results as the corresponding // FORTRAN versions. // // If you have any problems using these functions please report them to // M.Muldoon@UMIST.ac.uk // // Documentation available on the web // http://www.ma.umist.ac.uk/mrm/Teaching/392/libs/392.html // Version 1.0 8/98 // 29 October, 1999 //-------------------- // Adapted for use in AGG library by Andy Wilk (castor.vulgaris@gmail.com) //------------------------------------------------------------------------ inline double besj(double x, int n) { if(n < 0) { return 0; } double d = 1E-6; double b = 0; if(fabs(x) <= d) { if(n != 0) return 0; return 1; } double b1 = 0; // b1 is the value from the previous iteration // Set up a starting order for recurrence int m1 = (int)fabs(x) + 6; if(fabs(x) > 5) { m1 = (int)(fabs(1.4 * x + 60 / x)); } int m2 = (int)(n + 2 + fabs(x) / 4); if (m1 > m2) { m2 = m1; } // Apply recurrence down from curent max order for(;;) { double c3 = 0; double c2 = 1E-30; double c4 = 0; int m8 = 1; if (m2 / 2 * 2 == m2) { m8 = -1; } int imax = m2 - 2; for (int i = 1; i <= imax; i++) { double c6 = 2 * (m2 - i) * c2 / x - c3; c3 = c2; c2 = c6; if(m2 - i - 1 == n) { b = c6; } m8 = -1 * m8; if (m8 > 0) { c4 = c4 + 2 * c6; } } double c6 = 2 * c2 / x - c3; if(n == 0) { b = c6; } c4 += c6; b /= c4; if(fabs(b - b1) < d) { return b; } b1 = b; m2 += 3; } } } #endif ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_math_stroke.h�������������������������������������������������������������0000644�0000000�0000000�00000044575�10703246330�020227� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_STROKE_MATH_INCLUDED #define AGG_STROKE_MATH_INCLUDED #include "agg_math.h" #include "agg_vertex_sequence.h" namespace agg { //-------------------------------------------------------------line_cap_e enum line_cap_e { butt_cap, square_cap, round_cap }; //------------------------------------------------------------line_join_e enum line_join_e { miter_join = 0, miter_join_revert = 1, round_join = 2, bevel_join = 3, miter_join_round = 4 }; //-----------------------------------------------------------inner_join_e enum inner_join_e { inner_bevel, inner_miter, inner_jag, inner_round }; //------------------------------------------------------------math_stroke template<class VertexConsumer> class math_stroke { public: typedef typename VertexConsumer::value_type coord_type; math_stroke(); void line_cap(line_cap_e lc) { m_line_cap = lc; } void line_join(line_join_e lj) { m_line_join = lj; } void inner_join(inner_join_e ij) { m_inner_join = ij; } line_cap_e line_cap() const { return m_line_cap; } line_join_e line_join() const { return m_line_join; } inner_join_e inner_join() const { return m_inner_join; } void width(double w); void miter_limit(double ml) { m_miter_limit = ml; } void miter_limit_theta(double t); void inner_miter_limit(double ml) { m_inner_miter_limit = ml; } void approximation_scale(double as) { m_approx_scale = as; } double width() const { return m_width * 2.0; } double miter_limit() const { return m_miter_limit; } double inner_miter_limit() const { return m_inner_miter_limit; } double approximation_scale() const { return m_approx_scale; } void calc_cap(VertexConsumer& vc, const vertex_dist& v0, const vertex_dist& v1, double len); void calc_join(VertexConsumer& vc, const vertex_dist& v0, const vertex_dist& v1, const vertex_dist& v2, double len1, double len2); private: AGG_INLINE void add_vertex(VertexConsumer& vc, double x, double y) { vc.add(coord_type(x, y)); } void calc_arc(VertexConsumer& vc, double x, double y, double dx1, double dy1, double dx2, double dy2); void calc_miter(VertexConsumer& vc, const vertex_dist& v0, const vertex_dist& v1, const vertex_dist& v2, double dx1, double dy1, double dx2, double dy2, line_join_e lj, double mlimit, double dbevel); double m_width; double m_width_abs; double m_width_eps; int m_width_sign; double m_miter_limit; double m_inner_miter_limit; double m_approx_scale; line_cap_e m_line_cap; line_join_e m_line_join; inner_join_e m_inner_join; }; //----------------------------------------------------------------------- template<class VC> math_stroke<VC>::math_stroke() : m_width(0.5), m_width_abs(0.5), m_width_eps(0.5/1024.0), m_width_sign(1), m_miter_limit(4.0), m_inner_miter_limit(1.01), m_approx_scale(1.0), m_line_cap(butt_cap), m_line_join(miter_join), m_inner_join(inner_miter) { } //----------------------------------------------------------------------- template<class VC> void math_stroke<VC>::width(double w) { m_width = w * 0.5; if(m_width < 0) { m_width_abs = -m_width; m_width_sign = -1; } else { m_width_abs = m_width; m_width_sign = 1; } m_width_eps = m_width / 1024.0; } //----------------------------------------------------------------------- template<class VC> void math_stroke<VC>::miter_limit_theta(double t) { m_miter_limit = 1.0 / sin(t * 0.5) ; } //----------------------------------------------------------------------- template<class VC> void math_stroke<VC>::calc_arc(VC& vc, double x, double y, double dx1, double dy1, double dx2, double dy2) { double a1 = atan2(dy1 * m_width_sign, dx1 * m_width_sign); double a2 = atan2(dy2 * m_width_sign, dx2 * m_width_sign); double da = a1 - a2; int i, n; da = acos(m_width_abs / (m_width_abs + 0.125 / m_approx_scale)) * 2; add_vertex(vc, x + dx1, y + dy1); if(m_width_sign > 0) { if(a1 > a2) a2 += 2 * pi; n = int((a2 - a1) / da); da = (a2 - a1) / (n + 1); a1 += da; for(i = 0; i < n; i++) { add_vertex(vc, x + cos(a1) * m_width, y + sin(a1) * m_width); a1 += da; } } else { if(a1 < a2) a2 -= 2 * pi; n = int((a1 - a2) / da); da = (a1 - a2) / (n + 1); a1 -= da; for(i = 0; i < n; i++) { add_vertex(vc, x + cos(a1) * m_width, y + sin(a1) * m_width); a1 -= da; } } add_vertex(vc, x + dx2, y + dy2); } //----------------------------------------------------------------------- template<class VC> void math_stroke<VC>::calc_miter(VC& vc, const vertex_dist& v0, const vertex_dist& v1, const vertex_dist& v2, double dx1, double dy1, double dx2, double dy2, line_join_e lj, double mlimit, double dbevel) { double xi = v1.x; double yi = v1.y; double di = 1; double lim = m_width_abs * mlimit; bool miter_limit_exceeded = true; // Assume the worst bool intersection_failed = true; // Assume the worst if(calc_intersection(v0.x + dx1, v0.y - dy1, v1.x + dx1, v1.y - dy1, v1.x + dx2, v1.y - dy2, v2.x + dx2, v2.y - dy2, &xi, &yi)) { // Calculation of the intersection succeeded //--------------------- di = calc_distance(v1.x, v1.y, xi, yi); if(di <= lim) { // Inside the miter limit //--------------------- add_vertex(vc, xi, yi); miter_limit_exceeded = false; } intersection_failed = false; } else { // Calculation of the intersection failed, most probably // the three points lie one straight line. // First check if v0 and v2 lie on the opposite sides of vector: // (v1.x, v1.y) -> (v1.x+dx1, v1.y-dy1), that is, the perpendicular // to the line determined by vertices v0 and v1. // This condition determines whether the next line segments continues // the previous one or goes back. //---------------- double x2 = v1.x + dx1; double y2 = v1.y - dy1; if((cross_product(v0.x, v0.y, v1.x, v1.y, x2, y2) < 0.0) == (cross_product(v1.x, v1.y, v2.x, v2.y, x2, y2) < 0.0)) { // This case means that the next segment continues // the previous one (straight line) //----------------- add_vertex(vc, v1.x + dx1, v1.y - dy1); miter_limit_exceeded = false; } } if(miter_limit_exceeded) { // Miter limit exceeded //------------------------ switch(lj) { case miter_join_revert: // For the compatibility with SVG, PDF, etc, // we use a simple bevel join instead of // "smart" bevel //------------------- add_vertex(vc, v1.x + dx1, v1.y - dy1); add_vertex(vc, v1.x + dx2, v1.y - dy2); break; case miter_join_round: calc_arc(vc, v1.x, v1.y, dx1, -dy1, dx2, -dy2); break; default: // If no miter-revert, calculate new dx1, dy1, dx2, dy2 //---------------- if(intersection_failed) { mlimit *= m_width_sign; add_vertex(vc, v1.x + dx1 + dy1 * mlimit, v1.y - dy1 + dx1 * mlimit); add_vertex(vc, v1.x + dx2 - dy2 * mlimit, v1.y - dy2 - dx2 * mlimit); } else { double x1 = v1.x + dx1; double y1 = v1.y - dy1; double x2 = v1.x + dx2; double y2 = v1.y - dy2; di = (lim - dbevel) / (di - dbevel); add_vertex(vc, x1 + (xi - x1) * di, y1 + (yi - y1) * di); add_vertex(vc, x2 + (xi - x2) * di, y2 + (yi - y2) * di); } break; } } } //--------------------------------------------------------stroke_calc_cap template<class VC> void math_stroke<VC>::calc_cap(VC& vc, const vertex_dist& v0, const vertex_dist& v1, double len) { vc.remove_all(); double dx1 = (v1.y - v0.y) / len; double dy1 = (v1.x - v0.x) / len; double dx2 = 0; double dy2 = 0; dx1 *= m_width; dy1 *= m_width; if(m_line_cap != round_cap) { if(m_line_cap == square_cap) { dx2 = dy1 * m_width_sign; dy2 = dx1 * m_width_sign; } add_vertex(vc, v0.x - dx1 - dx2, v0.y + dy1 - dy2); add_vertex(vc, v0.x + dx1 - dx2, v0.y - dy1 - dy2); } else { double da = acos(m_width_abs / (m_width_abs + 0.125 / m_approx_scale)) * 2; double a1; int i; int n = int(pi / da); da = pi / (n + 1); add_vertex(vc, v0.x - dx1, v0.y + dy1); if(m_width_sign > 0) { a1 = atan2(dy1, -dx1); a1 += da; for(i = 0; i < n; i++) { add_vertex(vc, v0.x + cos(a1) * m_width, v0.y + sin(a1) * m_width); a1 += da; } } else { a1 = atan2(-dy1, dx1); a1 -= da; for(i = 0; i < n; i++) { add_vertex(vc, v0.x + cos(a1) * m_width, v0.y + sin(a1) * m_width); a1 -= da; } } add_vertex(vc, v0.x + dx1, v0.y - dy1); } } //----------------------------------------------------------------------- template<class VC> void math_stroke<VC>::calc_join(VC& vc, const vertex_dist& v0, const vertex_dist& v1, const vertex_dist& v2, double len1, double len2) { double dx1 = m_width * (v1.y - v0.y) / len1; double dy1 = m_width * (v1.x - v0.x) / len1; double dx2 = m_width * (v2.y - v1.y) / len2; double dy2 = m_width * (v2.x - v1.x) / len2; vc.remove_all(); double cp = cross_product(v0.x, v0.y, v1.x, v1.y, v2.x, v2.y); if(cp != 0 && (cp > 0) == (m_width > 0)) { // Inner join //--------------- double limit = ((len1 < len2) ? len1 : len2) / m_width_abs; if(limit < m_inner_miter_limit) { limit = m_inner_miter_limit; } switch(m_inner_join) { default: // inner_bevel add_vertex(vc, v1.x + dx1, v1.y - dy1); add_vertex(vc, v1.x + dx2, v1.y - dy2); break; case inner_miter: calc_miter(vc, v0, v1, v2, dx1, dy1, dx2, dy2, miter_join_revert, limit, 0); break; case inner_jag: case inner_round: cp = (dx1-dx2) * (dx1-dx2) + (dy1-dy2) * (dy1-dy2); if(cp < len1 * len1 && cp < len2 * len2) { calc_miter(vc, v0, v1, v2, dx1, dy1, dx2, dy2, miter_join_revert, limit, 0); } else { if(m_inner_join == inner_jag) { add_vertex(vc, v1.x + dx1, v1.y - dy1); add_vertex(vc, v1.x, v1.y ); add_vertex(vc, v1.x + dx2, v1.y - dy2); } else { add_vertex(vc, v1.x + dx1, v1.y - dy1); add_vertex(vc, v1.x, v1.y ); calc_arc(vc, v1.x, v1.y, dx2, -dy2, dx1, -dy1); add_vertex(vc, v1.x, v1.y ); add_vertex(vc, v1.x + dx2, v1.y - dy2); } } break; } } else { // Outer join //--------------- // Calculate the distance between v1 and // the central point of the bevel line segment //--------------- double dx = (dx1 + dx2) / 2; double dy = (dy1 + dy2) / 2; double dbevel = sqrt(dx * dx + dy * dy); if(m_line_join == round_join || m_line_join == bevel_join) { // This is an optimization that reduces the number of points // in cases of almost collinear segments. If there's no // visible difference between bevel and miter joins we'd rather // use miter join because it adds only one point instead of two. // // Here we calculate the middle point between the bevel points // and then, the distance between v1 and this middle point. // At outer joins this distance always less than stroke width, // because it's actually the height of an isosceles triangle of // v1 and its two bevel points. If the difference between this // width and this value is small (no visible bevel) we can // add just one point. // // The constant in the expression makes the result approximately // the same as in round joins and caps. You can safely comment // out this entire "if". //------------------- if(m_approx_scale * (m_width_abs - dbevel) < m_width_eps) { if(calc_intersection(v0.x + dx1, v0.y - dy1, v1.x + dx1, v1.y - dy1, v1.x + dx2, v1.y - dy2, v2.x + dx2, v2.y - dy2, &dx, &dy)) { add_vertex(vc, dx, dy); } else { add_vertex(vc, v1.x + dx1, v1.y - dy1); } return; } } switch(m_line_join) { case miter_join: case miter_join_revert: case miter_join_round: calc_miter(vc, v0, v1, v2, dx1, dy1, dx2, dy2, m_line_join, m_miter_limit, dbevel); break; case round_join: calc_arc(vc, v1.x, v1.y, dx1, -dy1, dx2, -dy2); break; default: // Bevel join add_vertex(vc, v1.x + dx1, v1.y - dy1); add_vertex(vc, v1.x + dx2, v1.y - dy2); break; } } } } #endif �����������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_path_length.h�������������������������������������������������������������0000644�0000000�0000000�00000004331�10703246330�020166� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_PATH_LENGTH_INCLUDED #define AGG_PATH_LENGTH_INCLUDED #include "agg_math.h" namespace agg { template<class VertexSource> double path_length(VertexSource& vs, unsigned path_id = 0) { double len = 0.0; double start_x = 0.0; double start_y = 0.0; double x1 = 0.0; double y1 = 0.0; double x2 = 0.0; double y2 = 0.0; bool first = true; unsigned cmd; vs.rewind(path_id); while(!is_stop(cmd = vs.vertex(&x2, &y2))) { if(is_vertex(cmd)) { if(first || is_move_to(cmd)) { start_x = x2; start_y = y2; } else { len += calc_distance(x1, y1, x2, y2); } x1 = x2; y1 = y2; first = false; } else { if(is_close(cmd) && !first) { len += calc_distance(x1, y1, start_x, start_y); } } } return len; } } #endif �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_path_storage.h������������������������������������������������������������0000644�0000000�0000000�00000142747�10703246330�020367� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_PATH_STORAGE_INCLUDED #define AGG_PATH_STORAGE_INCLUDED #include <string.h> #include <math.h> #include "agg_math.h" #include "agg_array.h" #include "agg_bezier_arc.h" namespace agg { //----------------------------------------------------vertex_block_storage template<class T, unsigned BlockShift=8, unsigned BlockPool=256> class vertex_block_storage { public: // Allocation parameters enum block_scale_e { block_shift = BlockShift, block_size = 1 << block_shift, block_mask = block_size - 1, block_pool = BlockPool }; typedef T value_type; typedef vertex_block_storage<T, BlockShift, BlockPool> self_type; ~vertex_block_storage(); vertex_block_storage(); vertex_block_storage(const self_type& v); const self_type& operator = (const self_type& ps); void remove_all(); void free_all(); void add_vertex(double x, double y, unsigned cmd); void modify_vertex(unsigned idx, double x, double y); void modify_vertex(unsigned idx, double x, double y, unsigned cmd); void modify_command(unsigned idx, unsigned cmd); void swap_vertices(unsigned v1, unsigned v2); unsigned last_command() const; unsigned last_vertex(double* x, double* y) const; unsigned prev_vertex(double* x, double* y) const; double last_x() const; double last_y() const; unsigned total_vertices() const; unsigned vertex(unsigned idx, double* x, double* y) const; unsigned command(unsigned idx) const; private: void allocate_block(unsigned nb); int8u* storage_ptrs(T** xy_ptr); private: unsigned m_total_vertices; unsigned m_total_blocks; unsigned m_max_blocks; T** m_coord_blocks; int8u** m_cmd_blocks; }; //------------------------------------------------------------------------ template<class T, unsigned S, unsigned P> void vertex_block_storage<T,S,P>::free_all() { if(m_total_blocks) { T** coord_blk = m_coord_blocks + m_total_blocks - 1; while(m_total_blocks--) { pod_allocator<T>::deallocate( *coord_blk, block_size * 2 + block_size / (sizeof(T) / sizeof(unsigned char))); --coord_blk; } pod_allocator<T*>::deallocate(m_coord_blocks, m_max_blocks * 2); m_total_blocks = 0; m_max_blocks = 0; m_coord_blocks = 0; m_cmd_blocks = 0; m_total_vertices = 0; } } //------------------------------------------------------------------------ template<class T, unsigned S, unsigned P> vertex_block_storage<T,S,P>::~vertex_block_storage() { free_all(); } //------------------------------------------------------------------------ template<class T, unsigned S, unsigned P> vertex_block_storage<T,S,P>::vertex_block_storage() : m_total_vertices(0), m_total_blocks(0), m_max_blocks(0), m_coord_blocks(0), m_cmd_blocks(0) { } //------------------------------------------------------------------------ template<class T, unsigned S, unsigned P> vertex_block_storage<T,S,P>::vertex_block_storage(const vertex_block_storage<T,S,P>& v) : m_total_vertices(0), m_total_blocks(0), m_max_blocks(0), m_coord_blocks(0), m_cmd_blocks(0) { *this = v; } //------------------------------------------------------------------------ template<class T, unsigned S, unsigned P> const vertex_block_storage<T,S,P>& vertex_block_storage<T,S,P>::operator = (const vertex_block_storage<T,S,P>& v) { remove_all(); unsigned i; for(i = 0; i < v.total_vertices(); i++) { double x, y; unsigned cmd = v.vertex(i, &x, &y); add_vertex(x, y, cmd); } return *this; } //------------------------------------------------------------------------ template<class T, unsigned S, unsigned P> inline void vertex_block_storage<T,S,P>::remove_all() { m_total_vertices = 0; } //------------------------------------------------------------------------ template<class T, unsigned S, unsigned P> inline void vertex_block_storage<T,S,P>::add_vertex(double x, double y, unsigned cmd) { T* coord_ptr = 0; *storage_ptrs(&coord_ptr) = (int8u)cmd; coord_ptr[0] = T(x); coord_ptr[1] = T(y); m_total_vertices++; } //------------------------------------------------------------------------ template<class T, unsigned S, unsigned P> inline void vertex_block_storage<T,S,P>::modify_vertex(unsigned idx, double x, double y) { T* pv = m_coord_blocks[idx >> block_shift] + ((idx & block_mask) << 1); pv[0] = T(x); pv[1] = T(y); } //------------------------------------------------------------------------ template<class T, unsigned S, unsigned P> inline void vertex_block_storage<T,S,P>::modify_vertex(unsigned idx, double x, double y, unsigned cmd) { unsigned block = idx >> block_shift; unsigned offset = idx & block_mask; T* pv = m_coord_blocks[block] + (offset << 1); pv[0] = T(x); pv[1] = T(y); m_cmd_blocks[block][offset] = (int8u)cmd; } //------------------------------------------------------------------------ template<class T, unsigned S, unsigned P> inline void vertex_block_storage<T,S,P>::modify_command(unsigned idx, unsigned cmd) { m_cmd_blocks[idx >> block_shift][idx & block_mask] = (int8u)cmd; } //------------------------------------------------------------------------ template<class T, unsigned S, unsigned P> inline void vertex_block_storage<T,S,P>::swap_vertices(unsigned v1, unsigned v2) { unsigned b1 = v1 >> block_shift; unsigned b2 = v2 >> block_shift; unsigned o1 = v1 & block_mask; unsigned o2 = v2 & block_mask; T* pv1 = m_coord_blocks[b1] + (o1 << 1); T* pv2 = m_coord_blocks[b2] + (o2 << 1); T val; val = pv1[0]; pv1[0] = pv2[0]; pv2[0] = val; val = pv1[1]; pv1[1] = pv2[1]; pv2[1] = val; int8u cmd = m_cmd_blocks[b1][o1]; m_cmd_blocks[b1][o1] = m_cmd_blocks[b2][o2]; m_cmd_blocks[b2][o2] = cmd; } //------------------------------------------------------------------------ template<class T, unsigned S, unsigned P> inline unsigned vertex_block_storage<T,S,P>::last_command() const { if(m_total_vertices) return command(m_total_vertices - 1); return path_cmd_stop; } //------------------------------------------------------------------------ template<class T, unsigned S, unsigned P> inline unsigned vertex_block_storage<T,S,P>::last_vertex(double* x, double* y) const { if(m_total_vertices) return vertex(m_total_vertices - 1, x, y); return path_cmd_stop; } //------------------------------------------------------------------------ template<class T, unsigned S, unsigned P> inline unsigned vertex_block_storage<T,S,P>::prev_vertex(double* x, double* y) const { if(m_total_vertices > 1) return vertex(m_total_vertices - 2, x, y); return path_cmd_stop; } //------------------------------------------------------------------------ template<class T, unsigned S, unsigned P> inline double vertex_block_storage<T,S,P>::last_x() const { if(m_total_vertices) { unsigned idx = m_total_vertices - 1; return m_coord_blocks[idx >> block_shift][(idx & block_mask) << 1]; } return 0.0; } //------------------------------------------------------------------------ template<class T, unsigned S, unsigned P> inline double vertex_block_storage<T,S,P>::last_y() const { if(m_total_vertices) { unsigned idx = m_total_vertices - 1; return m_coord_blocks[idx >> block_shift][((idx & block_mask) << 1) + 1]; } return 0.0; } //------------------------------------------------------------------------ template<class T, unsigned S, unsigned P> inline unsigned vertex_block_storage<T,S,P>::total_vertices() const { return m_total_vertices; } //------------------------------------------------------------------------ template<class T, unsigned S, unsigned P> inline unsigned vertex_block_storage<T,S,P>::vertex(unsigned idx, double* x, double* y) const { unsigned nb = idx >> block_shift; const T* pv = m_coord_blocks[nb] + ((idx & block_mask) << 1); *x = pv[0]; *y = pv[1]; return m_cmd_blocks[nb][idx & block_mask]; } //------------------------------------------------------------------------ template<class T, unsigned S, unsigned P> inline unsigned vertex_block_storage<T,S,P>::command(unsigned idx) const { return m_cmd_blocks[idx >> block_shift][idx & block_mask]; } //------------------------------------------------------------------------ template<class T, unsigned S, unsigned P> void vertex_block_storage<T,S,P>::allocate_block(unsigned nb) { if(nb >= m_max_blocks) { T** new_coords = pod_allocator<T*>::allocate((m_max_blocks + block_pool) * 2); unsigned char** new_cmds = (unsigned char**)(new_coords + m_max_blocks + block_pool); if(m_coord_blocks) { memcpy(new_coords, m_coord_blocks, m_max_blocks * sizeof(T*)); memcpy(new_cmds, m_cmd_blocks, m_max_blocks * sizeof(unsigned char*)); pod_allocator<T*>::deallocate(m_coord_blocks, m_max_blocks * 2); } m_coord_blocks = new_coords; m_cmd_blocks = new_cmds; m_max_blocks += block_pool; } m_coord_blocks[nb] = pod_allocator<T>::allocate(block_size * 2 + block_size / (sizeof(T) / sizeof(unsigned char))); m_cmd_blocks[nb] = (unsigned char*)(m_coord_blocks[nb] + block_size * 2); m_total_blocks++; } //------------------------------------------------------------------------ template<class T, unsigned S, unsigned P> int8u* vertex_block_storage<T,S,P>::storage_ptrs(T** xy_ptr) { unsigned nb = m_total_vertices >> block_shift; if(nb >= m_total_blocks) { allocate_block(nb); } *xy_ptr = m_coord_blocks[nb] + ((m_total_vertices & block_mask) << 1); return m_cmd_blocks[nb] + (m_total_vertices & block_mask); } //-----------------------------------------------------poly_plain_adaptor template<class T> class poly_plain_adaptor { public: typedef T value_type; poly_plain_adaptor() : m_data(0), m_ptr(0), m_end(0), m_closed(false), m_stop(false) {} poly_plain_adaptor(const T* data, unsigned num_points, bool closed) : m_data(data), m_ptr(data), m_end(data + num_points * 2), m_closed(closed), m_stop(false) {} void init(const T* data, unsigned num_points, bool closed) { m_data = data; m_ptr = data; m_end = data + num_points * 2; m_closed = closed; m_stop = false; } void rewind(unsigned) { m_ptr = m_data; m_stop = false; } unsigned vertex(double* x, double* y) { if(m_ptr < m_end) { bool first = m_ptr == m_data; *x = *m_ptr++; *y = *m_ptr++; return first ? path_cmd_move_to : path_cmd_line_to; } *x = *y = 0.0; if(m_closed && !m_stop) { m_stop = true; return path_cmd_end_poly | path_flags_close; } return path_cmd_stop; } private: const T* m_data; const T* m_ptr; const T* m_end; bool m_closed; bool m_stop; }; //-------------------------------------------------poly_container_adaptor template<class Container> class poly_container_adaptor { public: typedef typename Container::value_type vertex_type; poly_container_adaptor() : m_container(0), m_index(0), m_closed(false), m_stop(false) {} poly_container_adaptor(const Container& data, bool closed) : m_container(&data), m_index(0), m_closed(closed), m_stop(false) {} void init(const Container& data, bool closed) { m_container = &data; m_index = 0; m_closed = closed; m_stop = false; } void rewind(unsigned) { m_index = 0; m_stop = false; } unsigned vertex(double* x, double* y) { if(m_index < m_container->size()) { bool first = m_index == 0; const vertex_type& v = (*m_container)[m_index++]; *x = v.x; *y = v.y; return first ? path_cmd_move_to : path_cmd_line_to; } *x = *y = 0.0; if(m_closed && !m_stop) { m_stop = true; return path_cmd_end_poly | path_flags_close; } return path_cmd_stop; } private: const Container* m_container; unsigned m_index; bool m_closed; bool m_stop; }; //-----------------------------------------poly_container_reverse_adaptor template<class Container> class poly_container_reverse_adaptor { public: typedef typename Container::value_type vertex_type; poly_container_reverse_adaptor() : m_container(0), m_index(-1), m_closed(false), m_stop(false) {} poly_container_reverse_adaptor(const Container& data, bool closed) : m_container(&data), m_index(-1), m_closed(closed), m_stop(false) {} void init(const Container& data, bool closed) { m_container = &data; m_index = m_container->size() - 1; m_closed = closed; m_stop = false; } void rewind(unsigned) { m_index = m_container->size() - 1; m_stop = false; } unsigned vertex(double* x, double* y) { if(m_index >= 0) { bool first = m_index == int(m_container->size() - 1); const vertex_type& v = (*m_container)[m_index--]; *x = v.x; *y = v.y; return first ? path_cmd_move_to : path_cmd_line_to; } *x = *y = 0.0; if(m_closed && !m_stop) { m_stop = true; return path_cmd_end_poly | path_flags_close; } return path_cmd_stop; } private: const Container* m_container; int m_index; bool m_closed; bool m_stop; }; //--------------------------------------------------------line_adaptor class line_adaptor { public: typedef double value_type; line_adaptor() : m_line(m_coord, 2, false) {} line_adaptor(double x1, double y1, double x2, double y2) : m_line(m_coord, 2, false) { m_coord[0] = x1; m_coord[1] = y1; m_coord[2] = x2; m_coord[3] = y2; } void init(double x1, double y1, double x2, double y2) { m_coord[0] = x1; m_coord[1] = y1; m_coord[2] = x2; m_coord[3] = y2; m_line.rewind(0); } void rewind(unsigned) { m_line.rewind(0); } unsigned vertex(double* x, double* y) { return m_line.vertex(x, y); } private: double m_coord[4]; poly_plain_adaptor<double> m_line; }; //---------------------------------------------------------------path_base // 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. // 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 also: vertex_source concept //------------------------------------------------------------------------ template<class VertexContainer> class path_base { public: typedef VertexContainer container_type; typedef path_base<VertexContainer> self_type; //-------------------------------------------------------------------- path_base() : m_vertices(), m_iterator(0) {} void remove_all() { m_vertices.remove_all(); m_iterator = 0; } void free_all() { m_vertices.free_all(); m_iterator = 0; } // Make path functions //-------------------------------------------------------------------- unsigned start_new_path(); void move_to(double x, double y); void move_rel(double dx, double dy); void line_to(double x, double y); void line_rel(double dx, double dy); void hline_to(double x); void hline_rel(double dx); void vline_to(double y); void vline_rel(double dy); void arc_to(double rx, double ry, double angle, bool large_arc_flag, bool sweep_flag, double x, double y); void arc_rel(double rx, double ry, double angle, bool large_arc_flag, bool sweep_flag, double dx, double dy); void curve3(double x_ctrl, double y_ctrl, double x_to, double y_to); 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, double x_to, double y_to); 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, double x_to, double y_to); void curve4_rel(double x_ctrl2, double y_ctrl2, double x_to, double y_to); void end_poly(unsigned flags = path_flags_close); void close_polygon(unsigned flags = path_flags_none); // Accessors //-------------------------------------------------------------------- const container_type& vertices() const { return m_vertices; } container_type& vertices() { return m_vertices; } unsigned total_vertices() const; void rel_to_abs(double* x, double* y) const; unsigned last_vertex(double* x, double* y) const; unsigned prev_vertex(double* x, double* y) const; double last_x() const; double last_y() const; unsigned vertex(unsigned idx, double* x, double* y) const; unsigned command(unsigned idx) const; void modify_vertex(unsigned idx, double x, double y); void modify_vertex(unsigned idx, double x, double y, unsigned cmd); void modify_command(unsigned idx, unsigned cmd); // VertexSource interface //-------------------------------------------------------------------- void rewind(unsigned path_id); unsigned vertex(double* x, double* y); // Arrange the orientation of a polygon, all polygons in a path, // or in all paths. After calling arrange_orientations() or // arrange_orientations_all_paths(), all the polygons will have // the same orientation, i.e. path_flags_cw or path_flags_ccw //-------------------------------------------------------------------- unsigned arrange_polygon_orientation(unsigned start, path_flags_e orientation); unsigned arrange_orientations(unsigned path_id, path_flags_e orientation); void arrange_orientations_all_paths(path_flags_e orientation); void invert_polygon(unsigned start); // Flip all vertices horizontally or vertically, // between x1 and x2, or between y1 and y2 respectively //-------------------------------------------------------------------- void flip_x(double x1, double x2); void flip_y(double y1, double y2); // Concatenate path. The path is added as is. //-------------------------------------------------------------------- template<class VertexSource> void concat_path(VertexSource& vs, unsigned path_id = 0) { double x, y; unsigned cmd; vs.rewind(path_id); while(!is_stop(cmd = vs.vertex(&x, &y))) { m_vertices.add_vertex(x, y, cmd); } } //-------------------------------------------------------------------- // Join path. The path is joined with the existing one, that is, // it behaves as if the pen of a plotter was always down (drawing) template<class VertexSource> void join_path(VertexSource& vs, unsigned path_id = 0) { double x, y; unsigned cmd; vs.rewind(path_id); cmd = vs.vertex(&x, &y); if(!is_stop(cmd)) { if(is_vertex(cmd)) { double x0, y0; unsigned cmd0 = last_vertex(&x0, &y0); if(is_vertex(cmd0)) { if(calc_distance(x, y, x0, y0) > vertex_dist_epsilon) { if(is_move_to(cmd)) cmd = path_cmd_line_to; m_vertices.add_vertex(x, y, cmd); } } else { if(is_stop(cmd0)) { cmd = path_cmd_move_to; } else { if(is_move_to(cmd)) cmd = path_cmd_line_to; } m_vertices.add_vertex(x, y, cmd); } } while(!is_stop(cmd = vs.vertex(&x, &y))) { m_vertices.add_vertex(x, y, is_move_to(cmd) ? unsigned(path_cmd_line_to) : cmd); } } } // Concatenate polygon/polyline. //-------------------------------------------------------------------- template<class T> void concat_poly(const T* data, unsigned num_points, bool closed) { poly_plain_adaptor<T> poly(data, num_points, closed); concat_path(poly); } // Join polygon/polyline continuously. //-------------------------------------------------------------------- template<class T> void join_poly(const T* data, unsigned num_points, bool closed) { poly_plain_adaptor<T> poly(data, num_points, closed); join_path(poly); } //-------------------------------------------------------------------- void translate(double dx, double dy, unsigned path_id=0); void translate_all_paths(double dx, double dy); //-------------------------------------------------------------------- template<class Trans> void transform(const Trans& trans, unsigned path_id=0) { unsigned num_ver = m_vertices.total_vertices(); for(; path_id < num_ver; path_id++) { double x, y; unsigned cmd = m_vertices.vertex(path_id, &x, &y); if(is_stop(cmd)) break; if(is_vertex(cmd)) { trans.transform(&x, &y); m_vertices.modify_vertex(path_id, x, y); } } } //-------------------------------------------------------------------- template<class Trans> void transform_all_paths(const Trans& trans) { unsigned idx; unsigned num_ver = m_vertices.total_vertices(); for(idx = 0; idx < num_ver; idx++) { double x, y; if(is_vertex(m_vertices.vertex(idx, &x, &y))) { trans.transform(&x, &y); m_vertices.modify_vertex(idx, x, y); } } } private: unsigned perceive_polygon_orientation(unsigned start, unsigned end); void invert_polygon(unsigned start, unsigned end); VertexContainer m_vertices; unsigned m_iterator; }; //------------------------------------------------------------------------ template<class VC> unsigned path_base<VC>::start_new_path() { if(!is_stop(m_vertices.last_command())) { m_vertices.add_vertex(0.0, 0.0, path_cmd_stop); } return m_vertices.total_vertices(); } //------------------------------------------------------------------------ template<class VC> inline void path_base<VC>::rel_to_abs(double* x, double* y) const { if(m_vertices.total_vertices()) { double x2; double y2; if(is_vertex(m_vertices.last_vertex(&x2, &y2))) { *x += x2; *y += y2; } } } //------------------------------------------------------------------------ template<class VC> inline void path_base<VC>::move_to(double x, double y) { m_vertices.add_vertex(x, y, path_cmd_move_to); } //------------------------------------------------------------------------ template<class VC> inline void path_base<VC>::move_rel(double dx, double dy) { rel_to_abs(&dx, &dy); m_vertices.add_vertex(dx, dy, path_cmd_move_to); } //------------------------------------------------------------------------ template<class VC> inline void path_base<VC>::line_to(double x, double y) { m_vertices.add_vertex(x, y, path_cmd_line_to); } //------------------------------------------------------------------------ template<class VC> inline void path_base<VC>::line_rel(double dx, double dy) { rel_to_abs(&dx, &dy); m_vertices.add_vertex(dx, dy, path_cmd_line_to); } //------------------------------------------------------------------------ template<class VC> inline void path_base<VC>::hline_to(double x) { m_vertices.add_vertex(x, last_y(), path_cmd_line_to); } //------------------------------------------------------------------------ template<class VC> inline void path_base<VC>::hline_rel(double dx) { double dy = 0; rel_to_abs(&dx, &dy); m_vertices.add_vertex(dx, dy, path_cmd_line_to); } //------------------------------------------------------------------------ template<class VC> inline void path_base<VC>::vline_to(double y) { m_vertices.add_vertex(last_x(), y, path_cmd_line_to); } //------------------------------------------------------------------------ template<class VC> inline void path_base<VC>::vline_rel(double dy) { double dx = 0; rel_to_abs(&dx, &dy); m_vertices.add_vertex(dx, dy, path_cmd_line_to); } //------------------------------------------------------------------------ template<class VC> void path_base<VC>::arc_to(double rx, double ry, double angle, bool large_arc_flag, bool sweep_flag, double x, double y) { if(m_vertices.total_vertices() && is_vertex(m_vertices.last_command())) { const double epsilon = 1e-30; double x0 = 0.0; double y0 = 0.0; m_vertices.last_vertex(&x0, &y0); rx = fabs(rx); ry = fabs(ry); // Ensure radii are valid //------------------------- if(rx < epsilon || ry < epsilon) { line_to(x, y); return; } if(calc_distance(x0, y0, x, y) < epsilon) { // If the endpoints (x, y) and (x0, y0) are identical, then this // is equivalent to omitting the elliptical arc segment entirely. return; } bezier_arc_svg a(x0, y0, rx, ry, angle, large_arc_flag, sweep_flag, x, y); if(a.radii_ok()) { join_path(a); } else { line_to(x, y); } } else { move_to(x, y); } } //------------------------------------------------------------------------ template<class VC> void path_base<VC>::arc_rel(double rx, double ry, double angle, bool large_arc_flag, bool sweep_flag, double dx, double dy) { rel_to_abs(&dx, &dy); arc_to(rx, ry, angle, large_arc_flag, sweep_flag, dx, dy); } //------------------------------------------------------------------------ template<class VC> void path_base<VC>::curve3(double x_ctrl, double y_ctrl, double x_to, double y_to) { m_vertices.add_vertex(x_ctrl, y_ctrl, path_cmd_curve3); m_vertices.add_vertex(x_to, y_to, path_cmd_curve3); } //------------------------------------------------------------------------ template<class VC> void path_base<VC>::curve3_rel(double dx_ctrl, double dy_ctrl, double dx_to, double dy_to) { rel_to_abs(&dx_ctrl, &dy_ctrl); rel_to_abs(&dx_to, &dy_to); m_vertices.add_vertex(dx_ctrl, dy_ctrl, path_cmd_curve3); m_vertices.add_vertex(dx_to, dy_to, path_cmd_curve3); } //------------------------------------------------------------------------ template<class VC> void path_base<VC>::curve3(double x_to, double y_to) { double x0; double y0; if(is_vertex(m_vertices.last_vertex(&x0, &y0))) { double x_ctrl; double y_ctrl; unsigned cmd = m_vertices.prev_vertex(&x_ctrl, &y_ctrl); if(is_curve(cmd)) { x_ctrl = x0 + x0 - x_ctrl; y_ctrl = y0 + y0 - y_ctrl; } else { x_ctrl = x0; y_ctrl = y0; } curve3(x_ctrl, y_ctrl, x_to, y_to); } } //------------------------------------------------------------------------ template<class VC> void path_base<VC>::curve3_rel(double dx_to, double dy_to) { rel_to_abs(&dx_to, &dy_to); curve3(dx_to, dy_to); } //------------------------------------------------------------------------ template<class VC> void path_base<VC>::curve4(double x_ctrl1, double y_ctrl1, double x_ctrl2, double y_ctrl2, double x_to, double y_to) { m_vertices.add_vertex(x_ctrl1, y_ctrl1, path_cmd_curve4); m_vertices.add_vertex(x_ctrl2, y_ctrl2, path_cmd_curve4); m_vertices.add_vertex(x_to, y_to, path_cmd_curve4); } //------------------------------------------------------------------------ template<class VC> void path_base<VC>::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); rel_to_abs(&dx_ctrl2, &dy_ctrl2); rel_to_abs(&dx_to, &dy_to); m_vertices.add_vertex(dx_ctrl1, dy_ctrl1, path_cmd_curve4); m_vertices.add_vertex(dx_ctrl2, dy_ctrl2, path_cmd_curve4); m_vertices.add_vertex(dx_to, dy_to, path_cmd_curve4); } //------------------------------------------------------------------------ template<class VC> void path_base<VC>::curve4(double x_ctrl2, double y_ctrl2, double x_to, double y_to) { double x0; double y0; if(is_vertex(last_vertex(&x0, &y0))) { double x_ctrl1; double y_ctrl1; unsigned cmd = prev_vertex(&x_ctrl1, &y_ctrl1); if(is_curve(cmd)) { x_ctrl1 = x0 + x0 - x_ctrl1; y_ctrl1 = y0 + y0 - y_ctrl1; } else { x_ctrl1 = x0; y_ctrl1 = y0; } curve4(x_ctrl1, y_ctrl1, x_ctrl2, y_ctrl2, x_to, y_to); } } //------------------------------------------------------------------------ template<class VC> void path_base<VC>::curve4_rel(double dx_ctrl2, double dy_ctrl2, double dx_to, double dy_to) { rel_to_abs(&dx_ctrl2, &dy_ctrl2); rel_to_abs(&dx_to, &dy_to); curve4(dx_ctrl2, dy_ctrl2, dx_to, dy_to); } //------------------------------------------------------------------------ template<class VC> inline void path_base<VC>::end_poly(unsigned flags) { if(is_vertex(m_vertices.last_command())) { m_vertices.add_vertex(0.0, 0.0, path_cmd_end_poly | flags); } } //------------------------------------------------------------------------ template<class VC> inline void path_base<VC>::close_polygon(unsigned flags) { end_poly(path_flags_close | flags); } //------------------------------------------------------------------------ template<class VC> inline unsigned path_base<VC>::total_vertices() const { return m_vertices.total_vertices(); } //------------------------------------------------------------------------ template<class VC> inline unsigned path_base<VC>::last_vertex(double* x, double* y) const { return m_vertices.last_vertex(x, y); } //------------------------------------------------------------------------ template<class VC> inline unsigned path_base<VC>::prev_vertex(double* x, double* y) const { return m_vertices.prev_vertex(x, y); } //------------------------------------------------------------------------ template<class VC> inline double path_base<VC>::last_x() const { return m_vertices.last_x(); } //------------------------------------------------------------------------ template<class VC> inline double path_base<VC>::last_y() const { return m_vertices.last_y(); } //------------------------------------------------------------------------ template<class VC> inline unsigned path_base<VC>::vertex(unsigned idx, double* x, double* y) const { return m_vertices.vertex(idx, x, y); } //------------------------------------------------------------------------ template<class VC> inline unsigned path_base<VC>::command(unsigned idx) const { return m_vertices.command(idx); } //------------------------------------------------------------------------ template<class VC> void path_base<VC>::modify_vertex(unsigned idx, double x, double y) { m_vertices.modify_vertex(idx, x, y); } //------------------------------------------------------------------------ template<class VC> void path_base<VC>::modify_vertex(unsigned idx, double x, double y, unsigned cmd) { m_vertices.modify_vertex(idx, x, y, cmd); } //------------------------------------------------------------------------ template<class VC> void path_base<VC>::modify_command(unsigned idx, unsigned cmd) { m_vertices.modify_command(idx, cmd); } //------------------------------------------------------------------------ template<class VC> inline void path_base<VC>::rewind(unsigned path_id) { m_iterator = path_id; } //------------------------------------------------------------------------ template<class VC> inline unsigned path_base<VC>::vertex(double* x, double* y) { if(m_iterator >= m_vertices.total_vertices()) return path_cmd_stop; return m_vertices.vertex(m_iterator++, x, y); } //------------------------------------------------------------------------ template<class VC> unsigned path_base<VC>::perceive_polygon_orientation(unsigned start, unsigned end) { // Calculate signed area (double area to be exact) //--------------------- unsigned np = end - start; double area = 0.0; unsigned i; for(i = 0; i < np; i++) { double x1, y1, x2, y2; m_vertices.vertex(start + i, &x1, &y1); m_vertices.vertex(start + (i + 1) % np, &x2, &y2); area += x1 * y2 - y1 * x2; } return (area < 0.0) ? path_flags_cw : path_flags_ccw; } //------------------------------------------------------------------------ template<class VC> void path_base<VC>::invert_polygon(unsigned start, unsigned end) { unsigned i; unsigned tmp_cmd = m_vertices.command(start); --end; // Make "end" inclusive // Shift all commands to one position for(i = start; i < end; i++) { m_vertices.modify_command(i, m_vertices.command(i + 1)); } // Assign starting command to the ending command m_vertices.modify_command(end, tmp_cmd); // Reverse the polygon while(end > start) { m_vertices.swap_vertices(start++, end--); } } //------------------------------------------------------------------------ template<class VC> void path_base<VC>::invert_polygon(unsigned start) { // Skip all non-vertices at the beginning while(start < m_vertices.total_vertices() && !is_vertex(m_vertices.command(start))) ++start; // Skip all insignificant move_to while(start+1 < m_vertices.total_vertices() && is_move_to(m_vertices.command(start)) && is_move_to(m_vertices.command(start+1))) ++start; // Find the last vertex unsigned end = start + 1; while(end < m_vertices.total_vertices() && !is_next_poly(m_vertices.command(end))) ++end; invert_polygon(start, end); } //------------------------------------------------------------------------ template<class VC> unsigned path_base<VC>::arrange_polygon_orientation(unsigned start, path_flags_e orientation) { if(orientation == path_flags_none) return start; // Skip all non-vertices at the beginning while(start < m_vertices.total_vertices() && !is_vertex(m_vertices.command(start))) ++start; // Skip all insignificant move_to while(start+1 < m_vertices.total_vertices() && is_move_to(m_vertices.command(start)) && is_move_to(m_vertices.command(start+1))) ++start; // Find the last vertex unsigned end = start + 1; while(end < m_vertices.total_vertices() && !is_next_poly(m_vertices.command(end))) ++end; if(end - start > 2) { if(perceive_polygon_orientation(start, end) != unsigned(orientation)) { // Invert polygon, set orientation flag, and skip all end_poly invert_polygon(start, end); unsigned cmd; while(end < m_vertices.total_vertices() && is_end_poly(cmd = m_vertices.command(end))) { m_vertices.modify_command(end++, set_orientation(cmd, orientation)); } } } return end; } //------------------------------------------------------------------------ template<class VC> unsigned path_base<VC>::arrange_orientations(unsigned start, path_flags_e orientation) { if(orientation != path_flags_none) { while(start < m_vertices.total_vertices()) { start = arrange_polygon_orientation(start, orientation); if(is_stop(m_vertices.command(start))) { ++start; break; } } } return start; } //------------------------------------------------------------------------ template<class VC> void path_base<VC>::arrange_orientations_all_paths(path_flags_e orientation) { if(orientation != path_flags_none) { unsigned start = 0; while(start < m_vertices.total_vertices()) { start = arrange_orientations(start, orientation); } } } //------------------------------------------------------------------------ template<class VC> void path_base<VC>::flip_x(double x1, double x2) { unsigned i; double x, y; for(i = 0; i < m_vertices.total_vertices(); i++) { unsigned cmd = m_vertices.vertex(i, &x, &y); if(is_vertex(cmd)) { m_vertices.modify_vertex(i, x2 - x + x1, y); } } } //------------------------------------------------------------------------ template<class VC> void path_base<VC>::flip_y(double y1, double y2) { unsigned i; double x, y; for(i = 0; i < m_vertices.total_vertices(); i++) { unsigned cmd = m_vertices.vertex(i, &x, &y); if(is_vertex(cmd)) { m_vertices.modify_vertex(i, x, y2 - y + y1); } } } //------------------------------------------------------------------------ template<class VC> void path_base<VC>::translate(double dx, double dy, unsigned path_id) { unsigned num_ver = m_vertices.total_vertices(); for(; path_id < num_ver; path_id++) { double x, y; unsigned cmd = m_vertices.vertex(path_id, &x, &y); if(is_stop(cmd)) break; if(is_vertex(cmd)) { x += dx; y += dy; m_vertices.modify_vertex(path_id, x, y); } } } //------------------------------------------------------------------------ template<class VC> void path_base<VC>::translate_all_paths(double dx, double dy) { unsigned idx; unsigned num_ver = m_vertices.total_vertices(); for(idx = 0; idx < num_ver; idx++) { double x, y; if(is_vertex(m_vertices.vertex(idx, &x, &y))) { x += dx; y += dy; m_vertices.modify_vertex(idx, x, y); } } } //-----------------------------------------------------vertex_stl_storage template<class Container> class vertex_stl_storage { public: typedef typename Container::value_type vertex_type; typedef typename vertex_type::value_type value_type; void remove_all() { m_vertices.clear(); } void free_all() { m_vertices.clear(); } void add_vertex(double x, double y, unsigned cmd) { m_vertices.push_back(vertex_type(value_type(x), value_type(y), int8u(cmd))); } void modify_vertex(unsigned idx, double x, double y) { vertex_type& v = m_vertices[idx]; v.x = value_type(x); v.y = value_type(y); } void modify_vertex(unsigned idx, double x, double y, unsigned cmd) { vertex_type& v = m_vertices[idx]; v.x = value_type(x); v.y = value_type(y); v.cmd = int8u(cmd); } void modify_command(unsigned idx, unsigned cmd) { m_vertices[idx].cmd = int8u(cmd); } void swap_vertices(unsigned v1, unsigned v2) { vertex_type t = m_vertices[v1]; m_vertices[v1] = m_vertices[v2]; m_vertices[v2] = t; } unsigned last_command() const { return m_vertices.size() ? m_vertices[m_vertices.size() - 1].cmd : path_cmd_stop; } unsigned last_vertex(double* x, double* y) const { if(m_vertices.size() == 0) { *x = *y = 0.0; return path_cmd_stop; } return vertex(m_vertices.size() - 1, x, y); } unsigned prev_vertex(double* x, double* y) const { if(m_vertices.size() < 2) { *x = *y = 0.0; return path_cmd_stop; } return vertex(m_vertices.size() - 2, x, y); } double last_x() const { return m_vertices.size() ? m_vertices[m_vertices.size() - 1].x : 0.0; } double last_y() const { return m_vertices.size() ? m_vertices[m_vertices.size() - 1].y : 0.0; } unsigned total_vertices() const { return m_vertices.size(); } unsigned vertex(unsigned idx, double* x, double* y) const { const vertex_type& v = m_vertices[idx]; *x = v.x; *y = v.y; return v.cmd; } unsigned command(unsigned idx) const { return m_vertices[idx].cmd; } private: Container m_vertices; }; //-----------------------------------------------------------path_storage typedef path_base<vertex_block_storage<double> > path_storage; // Example of declarations path_storage with pod_bvector as a container //----------------------------------------------------------------------- //typedef path_base<vertex_stl_storage<pod_bvector<vertex_d> > > path_storage; } // Example of declarations path_storage with std::vector as a container //--------------------------------------------------------------------------- //#include <vector> //namespace agg //{ // typedef path_base<vertex_stl_storage<std::vector<vertex_d> > > stl_path_storage; //} #endif �������������������������agg-2.5+dfsg1/include/agg_path_storage_integer.h����������������������������������������������������0000644�0000000�0000000�00000023656�10703246330�022101� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_PATH_STORAGE_INTEGER_INCLUDED #define AGG_PATH_STORAGE_INTEGER_INCLUDED #include <string.h> #include "agg_array.h" namespace agg { //---------------------------------------------------------vertex_integer template<class T, unsigned CoordShift=6> struct vertex_integer { enum path_cmd { cmd_move_to = 0, cmd_line_to = 1, cmd_curve3 = 2, cmd_curve4 = 3 }; enum coord_scale_e { coord_shift = CoordShift, coord_scale = 1 << coord_shift }; T x,y; vertex_integer() {} vertex_integer(T x_, T y_, unsigned flag) : x(((x_ << 1) & ~1) | (flag & 1)), y(((y_ << 1) & ~1) | (flag >> 1)) {} unsigned vertex(double* x_, double* y_, double dx=0, double dy=0, double scale=1.0) const { *x_ = dx + (double(x >> 1) / coord_scale) * scale; *y_ = dy + (double(y >> 1) / coord_scale) * scale; switch(((y & 1) << 1) | (x & 1)) { case cmd_move_to: return path_cmd_move_to; case cmd_line_to: return path_cmd_line_to; case cmd_curve3: return path_cmd_curve3; case cmd_curve4: return path_cmd_curve4; } return path_cmd_stop; } }; //---------------------------------------------------path_storage_integer template<class T, unsigned CoordShift=6> class path_storage_integer { public: typedef T value_type; typedef vertex_integer<T, CoordShift> vertex_integer_type; //-------------------------------------------------------------------- path_storage_integer() : m_storage(), m_vertex_idx(0), m_closed(true) {} //-------------------------------------------------------------------- void remove_all() { m_storage.remove_all(); } //-------------------------------------------------------------------- void move_to(T x, T y) { m_storage.add(vertex_integer_type(x, y, vertex_integer_type::cmd_move_to)); } //-------------------------------------------------------------------- void line_to(T x, T y) { m_storage.add(vertex_integer_type(x, y, vertex_integer_type::cmd_line_to)); } //-------------------------------------------------------------------- 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)); m_storage.add(vertex_integer_type(x_to, y_to, vertex_integer_type::cmd_curve3)); } //-------------------------------------------------------------------- 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)); m_storage.add(vertex_integer_type(x_ctrl2, y_ctrl2, vertex_integer_type::cmd_curve4)); m_storage.add(vertex_integer_type(x_to, y_to, vertex_integer_type::cmd_curve4)); } //-------------------------------------------------------------------- void close_polygon() {} //-------------------------------------------------------------------- unsigned size() const { return m_storage.size(); } unsigned vertex(unsigned idx, double* x, double* y) const { return m_storage[idx].vertex(x, y); } //-------------------------------------------------------------------- unsigned byte_size() const { return m_storage.size() * sizeof(vertex_integer_type); } void serialize(int8u* ptr) const { unsigned i; for(i = 0; i < m_storage.size(); i++) { memcpy(ptr, &m_storage[i], sizeof(vertex_integer_type)); ptr += sizeof(vertex_integer_type); } } //-------------------------------------------------------------------- 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()) { *x = 0; *y = 0; return path_cmd_stop; } if(m_vertex_idx == m_storage.size()) { *x = 0; *y = 0; ++m_vertex_idx; return path_cmd_end_poly | path_flags_close; } unsigned cmd = m_storage[m_vertex_idx].vertex(x, y); if(is_move_to(cmd) && !m_closed) { *x = 0; *y = 0; m_closed = true; return path_cmd_end_poly | path_flags_close; } m_closed = false; ++m_vertex_idx; return cmd; } //-------------------------------------------------------------------- rect_d bounding_rect() const { rect_d bounds(1e100, 1e100, -1e100, -1e100); if(m_storage.size() == 0) { bounds.x1 = bounds.y1 = bounds.x2 = bounds.y2 = 0.0; } else { unsigned i; for(i = 0; i < m_storage.size(); i++) { double x, y; m_storage[i].vertex(&x, &y); if(x < bounds.x1) bounds.x1 = x; if(y < bounds.y1) bounds.y1 = y; if(x > bounds.x2) bounds.x2 = x; if(y > bounds.y2) bounds.y2 = y; } } return bounds; } private: pod_bvector<vertex_integer_type, 6> m_storage; unsigned m_vertex_idx; bool m_closed; }; //-----------------------------------------serialized_integer_path_adaptor template<class T, unsigned CoordShift=6> class serialized_integer_path_adaptor { public: typedef vertex_integer<T, CoordShift> vertex_integer_type; //-------------------------------------------------------------------- serialized_integer_path_adaptor() : m_data(0), m_end(0), m_ptr(0), m_dx(0.0), m_dy(0.0), m_scale(1.0), m_vertices(0) {} //-------------------------------------------------------------------- serialized_integer_path_adaptor(const int8u* data, unsigned size, double dx, double dy) : m_data(data), m_end(data + size), m_ptr(data), m_dx(dx), m_dy(dy), m_vertices(0) {} //-------------------------------------------------------------------- void init(const int8u* data, unsigned size, double dx, double dy, double scale=1.0) { m_data = data; m_end = data + size; m_ptr = data; m_dx = dx; m_dy = dy; m_scale = scale; m_vertices = 0; } //-------------------------------------------------------------------- void rewind(unsigned) { m_ptr = m_data; m_vertices = 0; } //-------------------------------------------------------------------- unsigned vertex(double* x, double* y) { if(m_data == 0 || m_ptr > m_end) { *x = 0; *y = 0; return path_cmd_stop; } if(m_ptr == m_end) { *x = 0; *y = 0; m_ptr += sizeof(vertex_integer_type); return path_cmd_end_poly | path_flags_close; } vertex_integer_type v; memcpy(&v, m_ptr, sizeof(vertex_integer_type)); unsigned cmd = v.vertex(x, y, m_dx, m_dy, m_scale); if(is_move_to(cmd) && m_vertices > 2) { *x = 0; *y = 0; m_vertices = 0; return path_cmd_end_poly | path_flags_close; } ++m_vertices; m_ptr += sizeof(vertex_integer_type); return cmd; } private: const int8u* m_data; const int8u* m_end; const int8u* m_ptr; double m_dx; double m_dy; double m_scale; unsigned m_vertices; }; } #endif ����������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_pattern_filters_rgba.h����������������������������������������������������0000644�0000000�0000000�00000010604�10703246330�022071� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_PATTERN_FILTERS_RGBA8_INCLUDED #define AGG_PATTERN_FILTERS_RGBA8_INCLUDED #include "agg_basics.h" #include "agg_line_aa_basics.h" #include "agg_color_rgba.h" namespace agg { //=======================================================pattern_filter_nn template<class ColorT> struct pattern_filter_nn { typedef ColorT color_type; static unsigned dilation() { return 0; } 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, color_type* p, int x, int y) { *p = buf[y >> line_subpixel_shift] [x >> line_subpixel_shift]; } }; typedef pattern_filter_nn<rgba8> pattern_filter_nn_rgba8; typedef pattern_filter_nn<rgba16> pattern_filter_nn_rgba16; //===========================================pattern_filter_bilinear_rgba template<class ColorT> struct pattern_filter_bilinear_rgba { typedef ColorT color_type; typedef typename color_type::value_type value_type; typedef typename color_type::calc_type calc_type; static unsigned dilation() { return 1; } 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, color_type* p, int x, int y) { calc_type r, g, b, a; r = g = b = a = line_subpixel_scale * line_subpixel_scale / 2; calc_type weight; int x_lr = x >> line_subpixel_shift; int y_lr = y >> line_subpixel_shift; x &= line_subpixel_mask; y &= line_subpixel_mask; const color_type* ptr = buf[y_lr] + x_lr; weight = (line_subpixel_scale - x) * (line_subpixel_scale - y); r += weight * ptr->r; g += weight * ptr->g; b += weight * ptr->b; a += weight * ptr->a; ++ptr; weight = x * (line_subpixel_scale - y); r += weight * ptr->r; g += weight * ptr->g; b += weight * ptr->b; a += weight * ptr->a; ptr = buf[y_lr + 1] + x_lr; weight = (line_subpixel_scale - x) * y; r += weight * ptr->r; g += weight * ptr->g; b += weight * ptr->b; a += weight * ptr->a; ++ptr; weight = x * y; r += weight * ptr->r; g += weight * ptr->g; b += weight * ptr->b; a += weight * ptr->a; p->r = (value_type)(r >> line_subpixel_shift * 2); p->g = (value_type)(g >> line_subpixel_shift * 2); p->b = (value_type)(b >> line_subpixel_shift * 2); p->a = (value_type)(a >> line_subpixel_shift * 2); } }; typedef pattern_filter_bilinear_rgba<rgba8> pattern_filter_bilinear_rgba8; typedef pattern_filter_bilinear_rgba<rgba16> pattern_filter_bilinear_rgba16; } #endif ����������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_pixfmt_amask_adaptor.h����������������������������������������������������0000644�0000000�0000000�00000021270�10703246330�022067� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_PIXFMT_AMASK_ADAPTOR_INCLUDED #define AGG_PIXFMT_AMASK_ADAPTOR_INCLUDED #include <string.h> #include "agg_array.h" #include "agg_rendering_buffer.h" namespace agg { //==================================================pixfmt_amask_adaptor template<class PixFmt, class AlphaMask> class pixfmt_amask_adaptor { public: typedef PixFmt pixfmt_type; typedef typename pixfmt_type::color_type color_type; typedef typename pixfmt_type::row_data row_data; typedef AlphaMask amask_type; typedef typename amask_type::cover_type cover_type; private: enum span_extra_tail_e { span_extra_tail = 256 }; void realloc_span(unsigned len) { if(len > m_span.size()) { m_span.resize(len + span_extra_tail); } } void init_span(unsigned len) { realloc_span(len); memset(&m_span[0], amask_type::cover_full, len * sizeof(cover_type)); } void init_span(unsigned len, const cover_type* covers) { realloc_span(len); memcpy(&m_span[0], covers, len * sizeof(cover_type)); } public: pixfmt_amask_adaptor(pixfmt_type& pixf, const amask_type& mask) : m_pixf(&pixf), m_mask(&mask), m_span() {} void attach_pixfmt(pixfmt_type& pixf) { m_pixf = &pixf; } void attach_alpha_mask(const amask_type& mask) { m_mask = &mask; } //-------------------------------------------------------------------- template<class PixFmt2> bool attach_pixfmt(PixFmt2& pixf, int x1, int y1, int x2, int y2) { return m_pixf->attach(pixf, x1, y1, x2, y2); } //-------------------------------------------------------------------- unsigned width() const { return m_pixf->width(); } unsigned height() const { return m_pixf->height(); } //-------------------------------------------------------------------- color_type pixel(int x, int y) { return m_pixf->pixel(x, y); } //-------------------------------------------------------------------- void copy_pixel(int x, int y, const color_type& c) { m_pixf->blend_pixel(x, y, c, m_mask->pixel(x, y)); } //-------------------------------------------------------------------- void blend_pixel(int x, int y, const color_type& c, cover_type cover) { m_pixf->blend_pixel(x, y, c, m_mask->combine_pixel(x, y, cover)); } //-------------------------------------------------------------------- void copy_hline(int x, int y, unsigned len, const color_type& c) { realloc_span(len); m_mask->fill_hspan(x, y, &m_span[0], len); m_pixf->blend_solid_hspan(x, y, len, c, &m_span[0]); } //-------------------------------------------------------------------- void blend_hline(int x, int y, unsigned len, const color_type& c, cover_type cover) { init_span(len); m_mask->combine_hspan(x, y, &m_span[0], len); m_pixf->blend_solid_hspan(x, y, len, c, &m_span[0]); } //-------------------------------------------------------------------- void copy_vline(int x, int y, unsigned len, const color_type& c) { realloc_span(len); m_mask->fill_vspan(x, y, &m_span[0], len); m_pixf->blend_solid_vspan(x, y, len, c, &m_span[0]); } //-------------------------------------------------------------------- void blend_vline(int x, int y, unsigned len, const color_type& c, cover_type cover) { init_span(len); m_mask->combine_vspan(x, y, &m_span[0], len); m_pixf->blend_solid_vspan(x, y, len, c, &m_span[0]); } //-------------------------------------------------------------------- void copy_from(const rendering_buffer& from, int xdst, int ydst, int xsrc, int ysrc, unsigned len) { m_pixf->copy_from(from, xdst, ydst, xsrc, ysrc, len); } //-------------------------------------------------------------------- void blend_solid_hspan(int x, int y, unsigned len, const color_type& c, const cover_type* covers) { init_span(len, covers); m_mask->combine_hspan(x, y, &m_span[0], len); m_pixf->blend_solid_hspan(x, y, len, c, &m_span[0]); } //-------------------------------------------------------------------- void blend_solid_vspan(int x, int y, unsigned len, const color_type& c, const cover_type* covers) { init_span(len, covers); m_mask->combine_vspan(x, y, &m_span[0], len); m_pixf->blend_solid_vspan(x, y, len, c, &m_span[0]); } //-------------------------------------------------------------------- void copy_color_hspan(int x, int y, unsigned len, const color_type* colors) { realloc_span(len); m_mask->fill_hspan(x, y, &m_span[0], len); m_pixf->blend_color_hspan(x, y, len, colors, &m_span[0], cover_full); } //-------------------------------------------------------------------- void copy_color_vspan(int x, int y, unsigned len, const color_type* colors) { realloc_span(len); m_mask->fill_vspan(x, y, &m_span[0], len); m_pixf->blend_color_vspan(x, y, len, colors, &m_span[0], cover_full); } //-------------------------------------------------------------------- void blend_color_hspan(int x, int y, unsigned len, const color_type* colors, const cover_type* covers, cover_type cover = cover_full) { if(covers) { init_span(len, covers); m_mask->combine_hspan(x, y, &m_span[0], len); } else { realloc_span(len); m_mask->fill_hspan(x, y, &m_span[0], len); } m_pixf->blend_color_hspan(x, y, len, colors, &m_span[0], cover); } //-------------------------------------------------------------------- void blend_color_vspan(int x, int y, unsigned len, const color_type* colors, const cover_type* covers, cover_type cover = cover_full) { if(covers) { init_span(len, covers); m_mask->combine_vspan(x, y, &m_span[0], len); } else { realloc_span(len); m_mask->fill_vspan(x, y, &m_span[0], len); } m_pixf->blend_color_vspan(x, y, len, colors, &m_span[0], cover); } private: pixfmt_type* m_pixf; const amask_type* m_mask; pod_array<cover_type> m_span; }; } #endif ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_pixfmt_gray.h�������������������������������������������������������������0000644�0000000�0000000�00000054136�10703246330�020232� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- // // 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 #define AGG_PIXFMT_GRAY_INCLUDED #include <string.h> #include "agg_basics.h" #include "agg_color_gray.h" #include "agg_rendering_buffer.h" namespace agg { //============================================================blender_gray template<class ColorT> struct blender_gray { typedef ColorT color_type; typedef typename color_type::value_type value_type; typedef typename color_type::calc_type calc_type; enum base_scale_e { base_shift = color_type::base_shift }; static AGG_INLINE void blend_pix(value_type* p, unsigned cv, unsigned alpha, unsigned cover=0) { *p = (value_type)((((cv - calc_type(*p)) * alpha) + (calc_type(*p) << base_shift)) >> base_shift); } }; //======================================================blender_gray_pre template<class ColorT> struct blender_gray_pre { typedef ColorT color_type; typedef typename color_type::value_type value_type; typedef typename color_type::calc_type calc_type; enum base_scale_e { base_shift = color_type::base_shift }; static AGG_INLINE void blend_pix(value_type* p, unsigned cv, unsigned alpha, unsigned cover) { alpha = color_type::base_mask - alpha; cover = (cover + 1) << (base_shift - 8); *p = (value_type)((*p * alpha + cv * cover) >> base_shift); } static AGG_INLINE void blend_pix(value_type* p, unsigned cv, unsigned alpha) { *p = (value_type)(((*p * (color_type::base_mask - alpha)) >> base_shift) + cv); } }; //=====================================================apply_gamma_dir_gray template<class ColorT, class GammaLut> class apply_gamma_dir_gray { public: typedef typename ColorT::value_type value_type; apply_gamma_dir_gray(const GammaLut& gamma) : m_gamma(gamma) {} AGG_INLINE void operator () (value_type* p) { *p = m_gamma.dir(*p); } private: const GammaLut& m_gamma; }; //=====================================================apply_gamma_inv_gray template<class ColorT, class GammaLut> class apply_gamma_inv_gray { public: typedef typename ColorT::value_type value_type; apply_gamma_inv_gray(const GammaLut& gamma) : m_gamma(gamma) {} AGG_INLINE void operator () (value_type* p) { *p = m_gamma.inv(*p); } private: const GammaLut& m_gamma; }; //=================================================pixfmt_alpha_blend_gray template<class Blender, class RenBuf, unsigned Step=1, unsigned Offset=0> class pixfmt_alpha_blend_gray { public: typedef RenBuf rbuf_type; typedef typename rbuf_type::row_data row_data; typedef Blender blender_type; typedef typename blender_type::color_type color_type; typedef int order_type; // A fake one typedef typename color_type::value_type value_type; typedef typename color_type::calc_type calc_type; enum base_scale_e { base_shift = color_type::base_shift, base_scale = color_type::base_scale, base_mask = color_type::base_mask, pix_width = sizeof(value_type), pix_step = Step, pix_offset = Offset }; private: //-------------------------------------------------------------------- static AGG_INLINE void copy_or_blend_pix(value_type* p, const color_type& c, unsigned cover) { if (c.a) { calc_type alpha = (calc_type(c.a) * (cover + 1)) >> 8; if(alpha == base_mask) { *p = c.v; } else { Blender::blend_pix(p, c.v, alpha, cover); } } } static AGG_INLINE void copy_or_blend_pix(value_type* p, const color_type& c) { if (c.a) { if(c.a == base_mask) { *p = c.v; } else { Blender::blend_pix(p, c.v, c.a); } } } public: //-------------------------------------------------------------------- explicit pixfmt_alpha_blend_gray(rbuf_type& rb) : m_rbuf(&rb) {} void attach(rbuf_type& rb) { m_rbuf = &rb; } //-------------------------------------------------------------------- template<class PixFmt> bool attach(PixFmt& pixf, int x1, int y1, int x2, int y2) { rect_i r(x1, y1, x2, y2); if(r.clip(rect_i(0, 0, pixf.width()-1, pixf.height()-1))) { int stride = pixf.stride(); m_rbuf->attach(pixf.pix_ptr(r.x1, stride < 0 ? r.y2 : r.y1), (r.x2 - r.x1) + 1, (r.y2 - r.y1) + 1, stride); return true; } return false; } //-------------------------------------------------------------------- AGG_INLINE unsigned width() const { return m_rbuf->width(); } AGG_INLINE unsigned height() const { return m_rbuf->height(); } AGG_INLINE int stride() const { return m_rbuf->stride(); } //-------------------------------------------------------------------- int8u* row_ptr(int y) { return m_rbuf->row_ptr(y); } const int8u* row_ptr(int y) const { return m_rbuf->row_ptr(y); } row_data row(int y) const { return m_rbuf->row(y); } const int8u* pix_ptr(int x, int y) const { return m_rbuf->row_ptr(y) + x * Step + Offset; } int8u* pix_ptr(int x, int y) { return m_rbuf->row_ptr(y) + x * Step + Offset; } //-------------------------------------------------------------------- AGG_INLINE static void make_pix(int8u* p, const color_type& c) { *(value_type*)p = c.v; } //-------------------------------------------------------------------- AGG_INLINE color_type pixel(int x, int y) const { value_type* p = (value_type*)m_rbuf->row_ptr(y) + x * Step + Offset; return color_type(*p); } //-------------------------------------------------------------------- AGG_INLINE void copy_pixel(int x, int y, const color_type& c) { *((value_type*)m_rbuf->row_ptr(x, y, 1) + x * Step + Offset) = c.v; } //-------------------------------------------------------------------- AGG_INLINE void blend_pixel(int x, int y, const color_type& c, int8u cover) { copy_or_blend_pix((value_type*) m_rbuf->row_ptr(x, y, 1) + x * Step + Offset, c, cover); } //-------------------------------------------------------------------- AGG_INLINE void copy_hline(int x, int y, unsigned len, const color_type& c) { value_type* p = (value_type*) m_rbuf->row_ptr(x, y, len) + x * Step + Offset; do { *p = c.v; p += Step; } while(--len); } //-------------------------------------------------------------------- AGG_INLINE void copy_vline(int x, int y, unsigned len, const color_type& c) { do { value_type* p = (value_type*) m_rbuf->row_ptr(x, y++, 1) + x * Step + Offset; *p = c.v; } while(--len); } //-------------------------------------------------------------------- void blend_hline(int x, int y, unsigned len, const color_type& c, int8u cover) { if (c.a) { value_type* p = (value_type*) m_rbuf->row_ptr(x, y, len) + x * Step + Offset; calc_type alpha = (calc_type(c.a) * (cover + 1)) >> 8; if(alpha == base_mask) { do { *p = c.v; p += Step; } while(--len); } else { do { Blender::blend_pix(p, c.v, alpha, cover); p += Step; } while(--len); } } } //-------------------------------------------------------------------- void blend_vline(int x, int y, unsigned len, const color_type& c, int8u cover) { if (c.a) { value_type* p; calc_type alpha = (calc_type(c.a) * (cover + 1)) >> 8; if(alpha == base_mask) { do { p = (value_type*) m_rbuf->row_ptr(x, y++, 1) + x * Step + Offset; *p = c.v; } while(--len); } else { do { p = (value_type*) m_rbuf->row_ptr(x, y++, 1) + x * Step + Offset; Blender::blend_pix(p, c.v, alpha, cover); } while(--len); } } } //-------------------------------------------------------------------- void blend_solid_hspan(int x, int y, unsigned len, const color_type& c, const int8u* covers) { if (c.a) { value_type* p = (value_type*) m_rbuf->row_ptr(x, y, len) + x * Step + Offset; do { calc_type alpha = (calc_type(c.a) * (calc_type(*covers) + 1)) >> 8; if(alpha == base_mask) { *p = c.v; } else { Blender::blend_pix(p, c.v, alpha, *covers); } p += Step; ++covers; } while(--len); } } //-------------------------------------------------------------------- void blend_solid_vspan(int x, int y, unsigned len, const color_type& c, const int8u* covers) { if (c.a) { do { calc_type alpha = (calc_type(c.a) * (calc_type(*covers) + 1)) >> 8; value_type* p = (value_type*) m_rbuf->row_ptr(x, y++, 1) + x * Step + Offset; if(alpha == base_mask) { *p = c.v; } else { Blender::blend_pix(p, c.v, alpha, *covers); } ++covers; } while(--len); } } //-------------------------------------------------------------------- void copy_color_hspan(int x, int y, unsigned len, const color_type* colors) { value_type* p = (value_type*) m_rbuf->row_ptr(x, y, len) + x * Step + Offset; do { *p = colors->v; p += Step; ++colors; } while(--len); } //-------------------------------------------------------------------- void copy_color_vspan(int x, int y, unsigned len, const color_type* colors) { do { value_type* p = (value_type*) m_rbuf->row_ptr(x, y++, 1) + x * Step + Offset; *p = colors->v; ++colors; } while(--len); } //-------------------------------------------------------------------- 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->row_ptr(x, y, len) + x * Step + Offset; if(covers) { do { copy_or_blend_pix(p, *colors++, *covers++); p += Step; } while(--len); } else { if(cover == 255) { do { if(colors->a == base_mask) { *p = colors->v; } else { copy_or_blend_pix(p, *colors); } p += Step; ++colors; } while(--len); } else { do { copy_or_blend_pix(p, *colors++, cover); p += Step; } while(--len); } } } //-------------------------------------------------------------------- void blend_color_vspan(int x, int y, unsigned len, const color_type* colors, const int8u* covers, int8u cover) { value_type* p; if(covers) { do { p = (value_type*) m_rbuf->row_ptr(x, y++, 1) + x * Step + Offset; copy_or_blend_pix(p, *colors++, *covers++); } while(--len); } else { if(cover == 255) { do { p = (value_type*) m_rbuf->row_ptr(x, y++, 1) + x * Step + Offset; if(colors->a == base_mask) { *p = colors->v; } else { copy_or_blend_pix(p, *colors); } ++colors; } while(--len); } else { do { p = (value_type*) m_rbuf->row_ptr(x, y++, 1) + x * Step + Offset; copy_or_blend_pix(p, *colors++, cover); } while(--len); } } } //-------------------------------------------------------------------- template<class Function> void for_each_pixel(Function f) { unsigned y; for(y = 0; y < height(); ++y) { row_data r = m_rbuf->row(y); if(r.ptr) { unsigned len = r.x2 - r.x1 + 1; value_type* p = (value_type*) m_rbuf->row_ptr(r.x1, y, len) + r.x1 * Step + Offset; do { f(p); p += Step; } while(--len); } } } //-------------------------------------------------------------------- template<class GammaLut> void apply_gamma_dir(const GammaLut& g) { for_each_pixel(apply_gamma_dir_gray<color_type, GammaLut>(g)); } //-------------------------------------------------------------------- template<class GammaLut> void apply_gamma_inv(const GammaLut& g) { for_each_pixel(apply_gamma_inv_gray<color_type, GammaLut>(g)); } //-------------------------------------------------------------------- template<class RenBuf2> void copy_from(const RenBuf2& from, int xdst, int ydst, int xsrc, int ysrc, unsigned len) { const int8u* p = from.row_ptr(ysrc); if(p) { memmove(m_rbuf->row_ptr(xdst, ydst, len) + xdst * pix_width, p + xsrc * pix_width, len * pix_width); } } //-------------------------------------------------------------------- template<class SrcPixelFormatRenderer> void blend_from_color(const SrcPixelFormatRenderer& from, const color_type& color, int xdst, int ydst, int xsrc, int ysrc, unsigned len, int8u cover) { typedef typename SrcPixelFormatRenderer::value_type src_value_type; const src_value_type* psrc = (src_value_type*)from.row_ptr(ysrc); if(psrc) { value_type* pdst = (value_type*)m_rbuf->row_ptr(xdst, ydst, len) + xdst; do { copy_or_blend_pix(pdst, color, (*psrc * cover + base_mask) >> base_shift); ++psrc; ++pdst; } while(--len); } } //-------------------------------------------------------------------- template<class SrcPixelFormatRenderer> void blend_from_lut(const SrcPixelFormatRenderer& from, const color_type* color_lut, int xdst, int ydst, int xsrc, int ysrc, unsigned len, int8u cover) { typedef typename SrcPixelFormatRenderer::value_type src_value_type; const src_value_type* psrc = (src_value_type*)from.row_ptr(ysrc); if(psrc) { value_type* pdst = (value_type*)m_rbuf->row_ptr(xdst, ydst, len) + xdst; do { copy_or_blend_pix(pdst, color_lut[*psrc], cover); ++psrc; ++pdst; } while(--len); } } private: rbuf_type* m_rbuf; }; typedef blender_gray<gray8> blender_gray8; typedef blender_gray_pre<gray8> blender_gray8_pre; typedef blender_gray<gray16> blender_gray16; typedef blender_gray_pre<gray16> blender_gray16_pre; typedef pixfmt_alpha_blend_gray<blender_gray8, rendering_buffer> pixfmt_gray8; //----pixfmt_gray8 typedef pixfmt_alpha_blend_gray<blender_gray8_pre, rendering_buffer> pixfmt_gray8_pre; //----pixfmt_gray8_pre typedef pixfmt_alpha_blend_gray<blender_gray16, rendering_buffer> pixfmt_gray16; //----pixfmt_gray16 typedef pixfmt_alpha_blend_gray<blender_gray16_pre, rendering_buffer> pixfmt_gray16_pre; //----pixfmt_gray16_pre } #endif ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_pixfmt_rgb.h��������������������������������������������������������������0000644�0000000�0000000�00000075631�10703246330�020045� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- // // 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 #define AGG_PIXFMT_RGB_INCLUDED #include <string.h> #include "agg_basics.h" #include "agg_color_rgba.h" #include "agg_rendering_buffer.h" namespace agg { //=====================================================apply_gamma_dir_rgb template<class ColorT, class Order, class GammaLut> class apply_gamma_dir_rgb { public: typedef typename ColorT::value_type value_type; apply_gamma_dir_rgb(const GammaLut& gamma) : m_gamma(gamma) {} AGG_INLINE void operator () (value_type* p) { p[Order::R] = m_gamma.dir(p[Order::R]); p[Order::G] = m_gamma.dir(p[Order::G]); p[Order::B] = m_gamma.dir(p[Order::B]); } private: const GammaLut& m_gamma; }; //=====================================================apply_gamma_inv_rgb template<class ColorT, class Order, class GammaLut> class apply_gamma_inv_rgb { public: typedef typename ColorT::value_type value_type; apply_gamma_inv_rgb(const GammaLut& gamma) : m_gamma(gamma) {} AGG_INLINE void operator () (value_type* p) { p[Order::R] = m_gamma.inv(p[Order::R]); p[Order::G] = m_gamma.inv(p[Order::G]); p[Order::B] = m_gamma.inv(p[Order::B]); } private: const GammaLut& m_gamma; }; //=========================================================blender_rgb template<class ColorT, class Order> struct blender_rgb { typedef ColorT color_type; typedef Order order_type; typedef typename color_type::value_type value_type; typedef typename color_type::calc_type calc_type; enum base_scale_e { base_shift = color_type::base_shift }; //-------------------------------------------------------------------- static AGG_INLINE void blend_pix(value_type* p, unsigned cr, unsigned cg, unsigned cb, unsigned alpha, unsigned cover=0) { p[Order::R] += (value_type)(((cr - p[Order::R]) * alpha) >> base_shift); p[Order::G] += (value_type)(((cg - p[Order::G]) * alpha) >> base_shift); p[Order::B] += (value_type)(((cb - p[Order::B]) * alpha) >> base_shift); } }; //======================================================blender_rgb_pre template<class ColorT, class Order> struct blender_rgb_pre { typedef ColorT color_type; typedef Order order_type; typedef typename color_type::value_type value_type; typedef typename color_type::calc_type calc_type; enum base_scale_e { base_shift = color_type::base_shift }; //-------------------------------------------------------------------- static AGG_INLINE void blend_pix(value_type* p, unsigned cr, unsigned cg, unsigned cb, unsigned alpha, unsigned cover) { alpha = color_type::base_mask - alpha; cover = (cover + 1) << (base_shift - 8); p[Order::R] = (value_type)((p[Order::R] * alpha + cr * cover) >> base_shift); p[Order::G] = (value_type)((p[Order::G] * alpha + cg * cover) >> base_shift); p[Order::B] = (value_type)((p[Order::B] * alpha + cb * cover) >> base_shift); } //-------------------------------------------------------------------- static AGG_INLINE void blend_pix(value_type* p, unsigned cr, unsigned cg, unsigned cb, unsigned alpha) { alpha = color_type::base_mask - alpha; p[Order::R] = (value_type)(((p[Order::R] * alpha) >> base_shift) + cr); p[Order::G] = (value_type)(((p[Order::G] * alpha) >> base_shift) + cg); p[Order::B] = (value_type)(((p[Order::B] * alpha) >> base_shift) + cb); } }; //===================================================blender_rgb_gamma template<class ColorT, class Order, class Gamma> class blender_rgb_gamma { public: typedef ColorT color_type; typedef Order order_type; typedef Gamma gamma_type; typedef typename color_type::value_type value_type; typedef typename color_type::calc_type calc_type; enum base_scale_e { base_shift = color_type::base_shift }; //-------------------------------------------------------------------- blender_rgb_gamma() : m_gamma(0) {} void gamma(const gamma_type& g) { m_gamma = &g; } //-------------------------------------------------------------------- AGG_INLINE void blend_pix(value_type* p, unsigned cr, unsigned cg, unsigned cb, unsigned alpha, unsigned cover=0) { calc_type r = m_gamma->dir(p[Order::R]); calc_type g = m_gamma->dir(p[Order::G]); calc_type b = m_gamma->dir(p[Order::B]); p[Order::R] = m_gamma->inv((((m_gamma->dir(cr) - r) * alpha) >> base_shift) + r); p[Order::G] = m_gamma->inv((((m_gamma->dir(cg) - g) * alpha) >> base_shift) + g); p[Order::B] = m_gamma->inv((((m_gamma->dir(cb) - b) * alpha) >> base_shift) + b); } private: const gamma_type* m_gamma; }; //==================================================pixfmt_alpha_blend_rgb template<class Blender, class RenBuf> class pixfmt_alpha_blend_rgb { public: typedef RenBuf rbuf_type; typedef Blender blender_type; typedef typename rbuf_type::row_data row_data; typedef typename blender_type::color_type color_type; typedef typename blender_type::order_type order_type; typedef typename color_type::value_type value_type; typedef typename color_type::calc_type calc_type; enum base_scale_e { base_shift = color_type::base_shift, base_scale = color_type::base_scale, base_mask = color_type::base_mask, pix_width = sizeof(value_type) * 3 }; private: //-------------------------------------------------------------------- AGG_INLINE void copy_or_blend_pix(value_type* p, const color_type& c, unsigned cover) { if (c.a) { calc_type alpha = (calc_type(c.a) * (cover + 1)) >> 8; if(alpha == base_mask) { p[order_type::R] = c.r; p[order_type::G] = c.g; p[order_type::B] = c.b; } else { m_blender.blend_pix(p, c.r, c.g, c.b, alpha, cover); } } } //-------------------------------------------------------------------- AGG_INLINE void copy_or_blend_pix(value_type* p, const color_type& c) { if (c.a) { if(c.a == base_mask) { p[order_type::R] = c.r; p[order_type::G] = c.g; p[order_type::B] = c.b; } else { m_blender.blend_pix(p, c.r, c.g, c.b, c.a); } } } public: //-------------------------------------------------------------------- explicit pixfmt_alpha_blend_rgb(rbuf_type& rb) : m_rbuf(&rb) {} void attach(rbuf_type& rb) { m_rbuf = &rb; } //-------------------------------------------------------------------- template<class PixFmt> bool attach(PixFmt& pixf, int x1, int y1, int x2, int y2) { rect_i r(x1, y1, x2, y2); if(r.clip(rect_i(0, 0, pixf.width()-1, pixf.height()-1))) { int stride = pixf.stride(); m_rbuf->attach(pixf.pix_ptr(r.x1, stride < 0 ? r.y2 : r.y1), (r.x2 - r.x1) + 1, (r.y2 - r.y1) + 1, stride); return true; } return false; } //-------------------------------------------------------------------- Blender& blender() { return m_blender; } //-------------------------------------------------------------------- AGG_INLINE unsigned width() const { return m_rbuf->width(); } AGG_INLINE unsigned height() const { return m_rbuf->height(); } AGG_INLINE int stride() const { return m_rbuf->stride(); } //-------------------------------------------------------------------- AGG_INLINE int8u* row_ptr(int y) { return m_rbuf->row_ptr(y); } AGG_INLINE const int8u* row_ptr(int y) const { return m_rbuf->row_ptr(y); } AGG_INLINE row_data row(int y) const { return m_rbuf->row(y); } //-------------------------------------------------------------------- AGG_INLINE int8u* pix_ptr(int x, int y) { return m_rbuf->row_ptr(y) + x * pix_width; } AGG_INLINE const int8u* pix_ptr(int x, int y) const { return m_rbuf->row_ptr(y) + x * pix_width; } //-------------------------------------------------------------------- AGG_INLINE static void make_pix(int8u* p, const color_type& c) { ((value_type*)p)[order_type::R] = c.r; ((value_type*)p)[order_type::G] = c.g; ((value_type*)p)[order_type::B] = c.b; } //-------------------------------------------------------------------- AGG_INLINE color_type pixel(int x, int y) const { value_type* p = (value_type*)m_rbuf->row_ptr(y) + x + x + x; return color_type(p[order_type::R], p[order_type::G], p[order_type::B]); } //-------------------------------------------------------------------- AGG_INLINE void copy_pixel(int x, int y, const color_type& c) { value_type* p = (value_type*)m_rbuf->row_ptr(x, y, 1) + x + x + x; p[order_type::R] = c.r; p[order_type::G] = c.g; p[order_type::B] = c.b; } //-------------------------------------------------------------------- AGG_INLINE void blend_pixel(int x, int y, const color_type& c, int8u cover) { copy_or_blend_pix((value_type*)m_rbuf->row_ptr(x, y, 1) + x + x + x, c, cover); } //-------------------------------------------------------------------- AGG_INLINE void copy_hline(int x, int y, unsigned len, const color_type& c) { value_type* p = (value_type*)m_rbuf->row_ptr(x, y, len) + x + x + x; do { p[order_type::R] = c.r; p[order_type::G] = c.g; p[order_type::B] = c.b; p += 3; } while(--len); } //-------------------------------------------------------------------- AGG_INLINE void copy_vline(int x, int y, unsigned len, const color_type& c) { do { value_type* p = (value_type*) m_rbuf->row_ptr(x, y++, 1) + x + x + x; p[order_type::R] = c.r; p[order_type::G] = c.g; p[order_type::B] = c.b; } while(--len); } //-------------------------------------------------------------------- void blend_hline(int x, int y, unsigned len, const color_type& c, int8u cover) { if (c.a) { value_type* p = (value_type*) m_rbuf->row_ptr(x, y, len) + x + x + x; calc_type alpha = (calc_type(c.a) * (calc_type(cover) + 1)) >> 8; if(alpha == base_mask) { do { p[order_type::R] = c.r; p[order_type::G] = c.g; p[order_type::B] = c.b; p += 3; } while(--len); } else { do { m_blender.blend_pix(p, c.r, c.g, c.b, alpha, cover); p += 3; } while(--len); } } } //-------------------------------------------------------------------- void blend_vline(int x, int y, unsigned len, const color_type& c, int8u cover) { if (c.a) { value_type* p; calc_type alpha = (calc_type(c.a) * (cover + 1)) >> 8; if(alpha == base_mask) { do { p = (value_type*) m_rbuf->row_ptr(x, y++, 1) + x + x + x; p[order_type::R] = c.r; p[order_type::G] = c.g; p[order_type::B] = c.b; } while(--len); } else { do { p = (value_type*) m_rbuf->row_ptr(x, y++, 1) + x + x + x; m_blender.blend_pix(p, c.r, c.g, c.b, alpha, cover); } while(--len); } } } //-------------------------------------------------------------------- void blend_solid_hspan(int x, int y, unsigned len, const color_type& c, const int8u* covers) { if (c.a) { value_type* p = (value_type*) m_rbuf->row_ptr(x, y, len) + x + x + x; do { calc_type alpha = (calc_type(c.a) * (calc_type(*covers) + 1)) >> 8; if(alpha == base_mask) { p[order_type::R] = c.r; p[order_type::G] = c.g; p[order_type::B] = c.b; } else { m_blender.blend_pix(p, c.r, c.g, c.b, alpha, *covers); } p += 3; ++covers; } while(--len); } } //-------------------------------------------------------------------- void blend_solid_vspan(int x, int y, unsigned len, const color_type& c, const int8u* covers) { if (c.a) { do { value_type* p = (value_type*) m_rbuf->row_ptr(x, y++, 1) + x + x + x; calc_type alpha = (calc_type(c.a) * (calc_type(*covers) + 1)) >> 8; if(alpha == base_mask) { p[order_type::R] = c.r; p[order_type::G] = c.g; p[order_type::B] = c.b; } else { m_blender.blend_pix(p, c.r, c.g, c.b, alpha, *covers); } ++covers; } while(--len); } } //-------------------------------------------------------------------- void copy_color_hspan(int x, int y, unsigned len, const color_type* colors) { value_type* p = (value_type*) m_rbuf->row_ptr(x, y, len) + x + x + x; do { p[order_type::R] = colors->r; p[order_type::G] = colors->g; p[order_type::B] = colors->b; ++colors; p += 3; } while(--len); } //-------------------------------------------------------------------- void copy_color_vspan(int x, int y, unsigned len, const color_type* colors) { do { value_type* p = (value_type*) m_rbuf->row_ptr(x, y++, 1) + x + x + x; p[order_type::R] = colors->r; p[order_type::G] = colors->g; p[order_type::B] = colors->b; ++colors; } while(--len); } //-------------------------------------------------------------------- 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->row_ptr(x, y, len) + x + x + x; if(covers) { do { copy_or_blend_pix(p, *colors++, *covers++); p += 3; } while(--len); } else { if(cover == 255) { do { copy_or_blend_pix(p, *colors++); p += 3; } while(--len); } else { do { copy_or_blend_pix(p, *colors++, cover); p += 3; } while(--len); } } } //-------------------------------------------------------------------- void blend_color_vspan(int x, int y, unsigned len, const color_type* colors, const int8u* covers, int8u cover) { value_type* p; if(covers) { do { p = (value_type*) m_rbuf->row_ptr(x, y++, 1) + x + x + x; copy_or_blend_pix(p, *colors++, *covers++); } while(--len); } else { if(cover == 255) { do { p = (value_type*) m_rbuf->row_ptr(x, y++, 1) + x + x + x; copy_or_blend_pix(p, *colors++); } while(--len); } else { do { p = (value_type*) m_rbuf->row_ptr(x, y++, 1) + x + x + x; copy_or_blend_pix(p, *colors++, cover); } while(--len); } } } //-------------------------------------------------------------------- template<class Function> void for_each_pixel(Function f) { unsigned y; for(y = 0; y < height(); ++y) { row_data r = m_rbuf->row(y); if(r.ptr) { unsigned len = r.x2 - r.x1 + 1; value_type* p = (value_type*) m_rbuf->row_ptr(r.x1, y, len) + r.x1 * 3; do { f(p); p += 3; } while(--len); } } } //-------------------------------------------------------------------- template<class GammaLut> void apply_gamma_dir(const GammaLut& g) { for_each_pixel(apply_gamma_dir_rgb<color_type, order_type, GammaLut>(g)); } //-------------------------------------------------------------------- template<class GammaLut> void apply_gamma_inv(const GammaLut& g) { for_each_pixel(apply_gamma_inv_rgb<color_type, order_type, GammaLut>(g)); } //-------------------------------------------------------------------- template<class RenBuf2> void copy_from(const RenBuf2& from, int xdst, int ydst, int xsrc, int ysrc, unsigned len) { const int8u* p = from.row_ptr(ysrc); if(p) { memmove(m_rbuf->row_ptr(xdst, ydst, len) + xdst * pix_width, p + xsrc * pix_width, len * pix_width); } } //-------------------------------------------------------------------- template<class SrcPixelFormatRenderer> void blend_from(const SrcPixelFormatRenderer& from, int xdst, int ydst, int xsrc, int ysrc, unsigned len, int8u cover) { typedef typename SrcPixelFormatRenderer::order_type src_order; const value_type* psrc = (const value_type*)from.row_ptr(ysrc); if(psrc) { psrc += xsrc * 4; value_type* pdst = (value_type*)m_rbuf->row_ptr(xdst, ydst, len) + xdst * 3; if(cover == 255) { do { value_type alpha = psrc[src_order::A]; if(alpha) { if(alpha == base_mask) { pdst[order_type::R] = psrc[src_order::R]; pdst[order_type::G] = psrc[src_order::G]; pdst[order_type::B] = psrc[src_order::B]; } else { m_blender.blend_pix(pdst, psrc[src_order::R], psrc[src_order::G], psrc[src_order::B], alpha); } } psrc += 4; pdst += 3; } while(--len); } else { color_type color; do { color.r = psrc[src_order::R]; color.g = psrc[src_order::G]; color.b = psrc[src_order::B]; color.a = psrc[src_order::A]; copy_or_blend_pix(pdst, color, cover); psrc += 4; pdst += 3; } while(--len); } } } //-------------------------------------------------------------------- template<class SrcPixelFormatRenderer> void blend_from_color(const SrcPixelFormatRenderer& from, const color_type& color, int xdst, int ydst, int xsrc, int ysrc, unsigned len, int8u cover) { typedef typename SrcPixelFormatRenderer::value_type src_value_type; const src_value_type* psrc = (src_value_type*)from.row_ptr(ysrc); if(psrc) { value_type* pdst = (value_type*)m_rbuf->row_ptr(xdst, ydst, len) + xdst * 3; do { copy_or_blend_pix(pdst, color, (*psrc * cover + base_mask) >> base_shift); ++psrc; pdst += 3; } while(--len); } } //-------------------------------------------------------------------- template<class SrcPixelFormatRenderer> void blend_from_lut(const SrcPixelFormatRenderer& from, const color_type* color_lut, int xdst, int ydst, int xsrc, int ysrc, unsigned len, int8u cover) { typedef typename SrcPixelFormatRenderer::value_type src_value_type; const src_value_type* psrc = (src_value_type*)from.row_ptr(ysrc); if(psrc) { value_type* pdst = (value_type*)m_rbuf->row_ptr(xdst, ydst, len) + xdst * 3; if(cover == 255) { do { const color_type& color = color_lut[*psrc]; m_blender.blend_pix(pdst, color.r, color.g, color.b, color.a); ++psrc; pdst += 3; } while(--len); } else { do { copy_or_blend_pix(pdst, color_lut[*psrc], cover); ++psrc; pdst += 3; } while(--len); } } } private: rbuf_type* m_rbuf; Blender m_blender; }; typedef pixfmt_alpha_blend_rgb<blender_rgb<rgba8, order_rgb>, rendering_buffer> pixfmt_rgb24; //----pixfmt_rgb24 typedef pixfmt_alpha_blend_rgb<blender_rgb<rgba8, order_bgr>, rendering_buffer> pixfmt_bgr24; //----pixfmt_bgr24 typedef pixfmt_alpha_blend_rgb<blender_rgb<rgba16, order_rgb>, rendering_buffer> pixfmt_rgb48; //----pixfmt_rgb48 typedef pixfmt_alpha_blend_rgb<blender_rgb<rgba16, order_bgr>, rendering_buffer> pixfmt_bgr48; //----pixfmt_bgr48 typedef pixfmt_alpha_blend_rgb<blender_rgb_pre<rgba8, order_rgb>, rendering_buffer> pixfmt_rgb24_pre; //----pixfmt_rgb24_pre typedef pixfmt_alpha_blend_rgb<blender_rgb_pre<rgba8, order_bgr>, rendering_buffer> pixfmt_bgr24_pre; //----pixfmt_bgr24_pre typedef pixfmt_alpha_blend_rgb<blender_rgb_pre<rgba16, order_rgb>, rendering_buffer> pixfmt_rgb48_pre; //----pixfmt_rgb48_pre typedef pixfmt_alpha_blend_rgb<blender_rgb_pre<rgba16, order_bgr>, rendering_buffer> pixfmt_bgr48_pre; //----pixfmt_bgr48_pre //-----------------------------------------------------pixfmt_rgb24_gamma template<class Gamma> class pixfmt_rgb24_gamma : public pixfmt_alpha_blend_rgb<blender_rgb_gamma<rgba8, order_rgb, Gamma>, rendering_buffer> { public: pixfmt_rgb24_gamma(rendering_buffer& rb, const Gamma& g) : pixfmt_alpha_blend_rgb<blender_rgb_gamma<rgba8, order_rgb, Gamma>, rendering_buffer>(rb) { this->blender().gamma(g); } }; //-----------------------------------------------------pixfmt_bgr24_gamma template<class Gamma> class pixfmt_bgr24_gamma : public pixfmt_alpha_blend_rgb<blender_rgb_gamma<rgba8, order_bgr, Gamma>, rendering_buffer> { public: pixfmt_bgr24_gamma(rendering_buffer& rb, const Gamma& g) : pixfmt_alpha_blend_rgb<blender_rgb_gamma<rgba8, order_bgr, Gamma>, rendering_buffer>(rb) { this->blender().gamma(g); } }; //-----------------------------------------------------pixfmt_rgb48_gamma template<class Gamma> class pixfmt_rgb48_gamma : public pixfmt_alpha_blend_rgb<blender_rgb_gamma<rgba16, order_rgb, Gamma>, rendering_buffer> { public: pixfmt_rgb48_gamma(rendering_buffer& rb, const Gamma& g) : pixfmt_alpha_blend_rgb<blender_rgb_gamma<rgba16, order_rgb, Gamma>, rendering_buffer>(rb) { this->blender().gamma(g); } }; //-----------------------------------------------------pixfmt_bgr48_gamma template<class Gamma> class pixfmt_bgr48_gamma : public pixfmt_alpha_blend_rgb<blender_rgb_gamma<rgba16, order_bgr, Gamma>, rendering_buffer> { public: pixfmt_bgr48_gamma(rendering_buffer& rb, const Gamma& g) : pixfmt_alpha_blend_rgb<blender_rgb_gamma<rgba16, order_bgr, Gamma>, rendering_buffer>(rb) { this->blender().gamma(g); } }; } #endif �������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_pixfmt_rgb_packed.h�������������������������������������������������������0000644�0000000�0000000�00000140746�10703246330�021354� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- // // 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 #define AGG_PIXFMT_RGB_PACKED_INCLUDED #include <string.h> #include "agg_basics.h" #include "agg_color_rgba.h" #include "agg_rendering_buffer.h" namespace agg { //=========================================================blender_rgb555 struct blender_rgb555 { typedef rgba8 color_type; typedef color_type::value_type value_type; typedef color_type::calc_type calc_type; typedef int16u pixel_type; static AGG_INLINE void blend_pix(pixel_type* p, unsigned cr, unsigned cg, unsigned cb, unsigned alpha, unsigned) { pixel_type rgb = *p; calc_type r = (rgb >> 7) & 0xF8; calc_type g = (rgb >> 2) & 0xF8; calc_type b = (rgb << 3) & 0xF8; *p = (pixel_type) (((((cr - r) * alpha + (r << 8)) >> 1) & 0x7C00) | ((((cg - g) * alpha + (g << 8)) >> 6) & 0x03E0) | (((cb - b) * alpha + (b << 8)) >> 11) | 0x8000); } static AGG_INLINE pixel_type make_pix(unsigned r, unsigned g, unsigned b) { 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, (p << 3) & 0xF8); } }; //=====================================================blender_rgb555_pre struct blender_rgb555_pre { typedef rgba8 color_type; typedef color_type::value_type value_type; typedef color_type::calc_type calc_type; typedef int16u pixel_type; static AGG_INLINE void blend_pix(pixel_type* p, unsigned cr, unsigned cg, unsigned cb, unsigned alpha, unsigned cover) { alpha = color_type::base_mask - alpha; pixel_type rgb = *p; calc_type r = (rgb >> 7) & 0xF8; calc_type g = (rgb >> 2) & 0xF8; calc_type b = (rgb << 3) & 0xF8; *p = (pixel_type) ((((r * alpha + cr * cover) >> 1) & 0x7C00) | (((g * alpha + cg * cover) >> 6) & 0x03E0) | ((b * alpha + cb * cover) >> 11) | 0x8000); } static AGG_INLINE pixel_type make_pix(unsigned r, unsigned g, unsigned b) { 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, (p << 3) & 0xF8); } }; //=====================================================blender_rgb555_gamma template<class Gamma> class blender_rgb555_gamma { public: typedef rgba8 color_type; typedef color_type::value_type value_type; typedef color_type::calc_type calc_type; typedef int16u pixel_type; typedef Gamma gamma_type; blender_rgb555_gamma() : m_gamma(0) {} void gamma(const gamma_type& g) { m_gamma = &g; } AGG_INLINE void blend_pix(pixel_type* p, unsigned cr, unsigned cg, unsigned cb, unsigned alpha, unsigned) { pixel_type rgb = *p; calc_type r = m_gamma->dir((rgb >> 7) & 0xF8); calc_type g = m_gamma->dir((rgb >> 2) & 0xF8); calc_type b = m_gamma->dir((rgb << 3) & 0xF8); *p = (pixel_type) (((m_gamma->inv(((m_gamma->dir(cr) - r) * alpha + (r << 8)) >> 8) << 7) & 0x7C00) | ((m_gamma->inv(((m_gamma->dir(cg) - g) * alpha + (g << 8)) >> 8) << 2) & 0x03E0) | (m_gamma->inv(((m_gamma->dir(cb) - b) * alpha + (b << 8)) >> 8) >> 3) | 0x8000); } static AGG_INLINE pixel_type make_pix(unsigned r, unsigned g, unsigned b) { 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, (p << 3) & 0xF8); } private: const Gamma* m_gamma; }; //=========================================================blender_rgb565 struct blender_rgb565 { typedef rgba8 color_type; typedef color_type::value_type value_type; typedef color_type::calc_type calc_type; typedef int16u pixel_type; static AGG_INLINE void blend_pix(pixel_type* p, unsigned cr, unsigned cg, unsigned cb, unsigned alpha, unsigned) { pixel_type rgb = *p; calc_type r = (rgb >> 8) & 0xF8; calc_type g = (rgb >> 3) & 0xFC; calc_type b = (rgb << 3) & 0xF8; *p = (pixel_type) (((((cr - r) * alpha + (r << 8)) ) & 0xF800) | ((((cg - g) * alpha + (g << 8)) >> 5) & 0x07E0) | (((cb - b) * alpha + (b << 8)) >> 11)); } static AGG_INLINE pixel_type make_pix(unsigned r, unsigned g, unsigned b) { return (pixel_type)(((r & 0xF8) << 8) | ((g & 0xFC) << 3) | (b >> 3)); } static AGG_INLINE color_type make_color(pixel_type p) { return color_type((p >> 8) & 0xF8, (p >> 3) & 0xFC, (p << 3) & 0xF8); } }; //=====================================================blender_rgb565_pre struct blender_rgb565_pre { typedef rgba8 color_type; typedef color_type::value_type value_type; typedef color_type::calc_type calc_type; typedef int16u pixel_type; static AGG_INLINE void blend_pix(pixel_type* p, unsigned cr, unsigned cg, unsigned cb, unsigned alpha, unsigned cover) { alpha = color_type::base_mask - alpha; pixel_type rgb = *p; calc_type r = (rgb >> 8) & 0xF8; calc_type g = (rgb >> 3) & 0xFC; calc_type b = (rgb << 3) & 0xF8; *p = (pixel_type) ((((r * alpha + cr * cover) ) & 0xF800) | (((g * alpha + cg * cover) >> 5 ) & 0x07E0) | ((b * alpha + cb * cover) >> 11)); } static AGG_INLINE pixel_type make_pix(unsigned r, unsigned g, unsigned b) { return (pixel_type)(((r & 0xF8) << 8) | ((g & 0xFC) << 3) | (b >> 3)); } static AGG_INLINE color_type make_color(pixel_type p) { return color_type((p >> 8) & 0xF8, (p >> 3) & 0xFC, (p << 3) & 0xF8); } }; //=====================================================blender_rgb565_gamma template<class Gamma> class blender_rgb565_gamma { public: typedef rgba8 color_type; typedef color_type::value_type value_type; typedef color_type::calc_type calc_type; typedef int16u pixel_type; typedef Gamma gamma_type; blender_rgb565_gamma() : m_gamma(0) {} void gamma(const gamma_type& g) { m_gamma = &g; } AGG_INLINE void blend_pix(pixel_type* p, unsigned cr, unsigned cg, unsigned cb, unsigned alpha, unsigned) { pixel_type rgb = *p; calc_type r = m_gamma->dir((rgb >> 8) & 0xF8); calc_type g = m_gamma->dir((rgb >> 3) & 0xFC); calc_type b = m_gamma->dir((rgb << 3) & 0xF8); *p = (pixel_type) (((m_gamma->inv(((m_gamma->dir(cr) - r) * alpha + (r << 8)) >> 8) << 8) & 0xF800) | ((m_gamma->inv(((m_gamma->dir(cg) - g) * alpha + (g << 8)) >> 8) << 3) & 0x07E0) | (m_gamma->inv(((m_gamma->dir(cb) - b) * alpha + (b << 8)) >> 8) >> 3)); } static AGG_INLINE pixel_type make_pix(unsigned r, unsigned g, unsigned b) { return (pixel_type)(((r & 0xF8) << 8) | ((g & 0xFC) << 3) | (b >> 3)); } static AGG_INLINE color_type make_color(pixel_type p) { return color_type((p >> 8) & 0xF8, (p >> 3) & 0xFC, (p << 3) & 0xF8); } private: const Gamma* m_gamma; }; //=====================================================blender_rgbAAA struct blender_rgbAAA { typedef rgba16 color_type; typedef color_type::value_type value_type; typedef color_type::calc_type calc_type; typedef int32u pixel_type; static AGG_INLINE void blend_pix(pixel_type* p, unsigned cr, unsigned cg, unsigned cb, unsigned alpha, unsigned) { pixel_type rgb = *p; calc_type r = (rgb >> 14) & 0xFFC0; calc_type g = (rgb >> 4) & 0xFFC0; calc_type b = (rgb << 6) & 0xFFC0; *p = (pixel_type) (((((cr - r) * alpha + (r << 16)) >> 2) & 0x3FF00000) | ((((cg - g) * alpha + (g << 16)) >> 12) & 0x000FFC00) | (((cb - b) * alpha + (b << 16)) >> 22) | 0xC0000000); } static AGG_INLINE pixel_type make_pix(unsigned r, unsigned g, unsigned b) { 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, (p << 6) & 0xFFC0); } }; //==================================================blender_rgbAAA_pre struct blender_rgbAAA_pre { typedef rgba16 color_type; typedef color_type::value_type value_type; typedef color_type::calc_type calc_type; typedef int32u pixel_type; static AGG_INLINE void blend_pix(pixel_type* p, unsigned cr, unsigned cg, unsigned cb, unsigned alpha, unsigned cover) { alpha = color_type::base_mask - alpha; cover = (cover + 1) << (color_type::base_shift - 8); pixel_type rgb = *p; calc_type r = (rgb >> 14) & 0xFFC0; calc_type g = (rgb >> 4) & 0xFFC0; calc_type b = (rgb << 6) & 0xFFC0; *p = (pixel_type) ((((r * alpha + cr * cover) >> 2) & 0x3FF00000) | (((g * alpha + cg * cover) >> 12) & 0x000FFC00) | ((b * alpha + cb * cover) >> 22) | 0xC0000000); } static AGG_INLINE pixel_type make_pix(unsigned r, unsigned g, unsigned b) { 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, (p << 6) & 0xFFC0); } }; //=================================================blender_rgbAAA_gamma template<class Gamma> class blender_rgbAAA_gamma { public: typedef rgba16 color_type; typedef color_type::value_type value_type; typedef color_type::calc_type calc_type; typedef int32u pixel_type; typedef Gamma gamma_type; blender_rgbAAA_gamma() : m_gamma(0) {} void gamma(const gamma_type& g) { m_gamma = &g; } AGG_INLINE void blend_pix(pixel_type* p, unsigned cr, unsigned cg, unsigned cb, unsigned alpha, unsigned) { pixel_type rgb = *p; calc_type r = m_gamma->dir((rgb >> 14) & 0xFFC0); calc_type g = m_gamma->dir((rgb >> 4) & 0xFFC0); calc_type b = m_gamma->dir((rgb << 6) & 0xFFC0); *p = (pixel_type) (((m_gamma->inv(((m_gamma->dir(cr) - r) * alpha + (r << 16)) >> 16) << 14) & 0x3FF00000) | ((m_gamma->inv(((m_gamma->dir(cg) - g) * alpha + (g << 16)) >> 16) << 4 ) & 0x000FFC00) | (m_gamma->inv(((m_gamma->dir(cb) - b) * alpha + (b << 16)) >> 16) >> 6 ) | 0xC0000000); } static AGG_INLINE pixel_type make_pix(unsigned r, unsigned g, unsigned b) { 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, (p << 6) & 0xFFC0); } private: const Gamma* m_gamma; }; //=====================================================blender_bgrAAA struct blender_bgrAAA { typedef rgba16 color_type; typedef color_type::value_type value_type; typedef color_type::calc_type calc_type; typedef int32u pixel_type; static AGG_INLINE void blend_pix(pixel_type* p, unsigned cr, unsigned cg, unsigned cb, unsigned alpha, unsigned) { pixel_type bgr = *p; calc_type b = (bgr >> 14) & 0xFFC0; calc_type g = (bgr >> 4) & 0xFFC0; calc_type r = (bgr << 6) & 0xFFC0; *p = (pixel_type) (((((cb - b) * alpha + (b << 16)) >> 2) & 0x3FF00000) | ((((cg - g) * alpha + (g << 16)) >> 12) & 0x000FFC00) | (((cr - r) * alpha + (r << 16)) >> 22) | 0xC0000000); } static AGG_INLINE pixel_type make_pix(unsigned r, unsigned g, unsigned b) { 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, (p >> 14) & 0xFFC0); } }; //=================================================blender_bgrAAA_pre struct blender_bgrAAA_pre { typedef rgba16 color_type; typedef color_type::value_type value_type; typedef color_type::calc_type calc_type; typedef int32u pixel_type; static AGG_INLINE void blend_pix(pixel_type* p, unsigned cr, unsigned cg, unsigned cb, unsigned alpha, unsigned cover) { alpha = color_type::base_mask - alpha; cover = (cover + 1) << (color_type::base_shift - 8); pixel_type bgr = *p; calc_type b = (bgr >> 14) & 0xFFC0; calc_type g = (bgr >> 4) & 0xFFC0; calc_type r = (bgr << 6) & 0xFFC0; *p = (pixel_type) ((((b * alpha + cb * cover) >> 2) & 0x3FF00000) | (((g * alpha + cg * cover) >> 12) & 0x000FFC00) | ((r * alpha + cr * cover) >> 22) | 0xC0000000); } static AGG_INLINE pixel_type make_pix(unsigned r, unsigned g, unsigned b) { 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, (p >> 14) & 0xFFC0); } }; //=================================================blender_bgrAAA_gamma template<class Gamma> class blender_bgrAAA_gamma { public: typedef rgba16 color_type; typedef color_type::value_type value_type; typedef color_type::calc_type calc_type; typedef int32u pixel_type; typedef Gamma gamma_type; blender_bgrAAA_gamma() : m_gamma(0) {} void gamma(const gamma_type& g) { m_gamma = &g; } AGG_INLINE void blend_pix(pixel_type* p, unsigned cr, unsigned cg, unsigned cb, unsigned alpha, unsigned) { pixel_type bgr = *p; calc_type b = m_gamma->dir((bgr >> 14) & 0xFFC0); calc_type g = m_gamma->dir((bgr >> 4) & 0xFFC0); calc_type r = m_gamma->dir((bgr << 6) & 0xFFC0); *p = (pixel_type) (((m_gamma->inv(((m_gamma->dir(cb) - b) * alpha + (b << 16)) >> 16) << 14) & 0x3FF00000) | ((m_gamma->inv(((m_gamma->dir(cg) - g) * alpha + (g << 16)) >> 16) << 4 ) & 0x000FFC00) | (m_gamma->inv(((m_gamma->dir(cr) - r) * alpha + (r << 16)) >> 16) >> 6 ) | 0xC0000000); } static AGG_INLINE pixel_type make_pix(unsigned r, unsigned g, unsigned b) { 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, (p >> 14) & 0xFFC0); } private: const Gamma* m_gamma; }; //=====================================================blender_rgbBBA struct blender_rgbBBA { typedef rgba16 color_type; typedef color_type::value_type value_type; typedef color_type::calc_type calc_type; typedef int32u pixel_type; static AGG_INLINE void blend_pix(pixel_type* p, unsigned cr, unsigned cg, unsigned cb, unsigned alpha, unsigned) { pixel_type rgb = *p; calc_type r = (rgb >> 16) & 0xFFE0; calc_type g = (rgb >> 5) & 0xFFE0; calc_type b = (rgb << 6) & 0xFFC0; *p = (pixel_type) (((((cr - r) * alpha + (r << 16)) ) & 0xFFE00000) | ((((cg - g) * alpha + (g << 16)) >> 11) & 0x001FFC00) | (((cb - b) * alpha + (b << 16)) >> 22)); } static AGG_INLINE pixel_type make_pix(unsigned r, unsigned g, unsigned b) { return (pixel_type)(((r & 0xFFE0) << 16) | ((g & 0xFFE0) << 5) | (b >> 6)); } static AGG_INLINE color_type make_color(pixel_type p) { return color_type((p >> 16) & 0xFFE0, (p >> 5) & 0xFFE0, (p << 6) & 0xFFC0); } }; //=================================================blender_rgbBBA_pre struct blender_rgbBBA_pre { typedef rgba16 color_type; typedef color_type::value_type value_type; typedef color_type::calc_type calc_type; typedef int32u pixel_type; static AGG_INLINE void blend_pix(pixel_type* p, unsigned cr, unsigned cg, unsigned cb, unsigned alpha, unsigned cover) { alpha = color_type::base_mask - alpha; cover = (cover + 1) << (color_type::base_shift - 8); pixel_type rgb = *p; calc_type r = (rgb >> 16) & 0xFFE0; calc_type g = (rgb >> 5) & 0xFFE0; calc_type b = (rgb << 6) & 0xFFC0; *p = (pixel_type) ((((r * alpha + cr * cover) ) & 0xFFE00000) | (((g * alpha + cg * cover) >> 11) & 0x001FFC00) | ((b * alpha + cb * cover) >> 22)); } static AGG_INLINE pixel_type make_pix(unsigned r, unsigned g, unsigned b) { return (pixel_type)(((r & 0xFFE0) << 16) | ((g & 0xFFE0) << 5) | (b >> 6)); } static AGG_INLINE color_type make_color(pixel_type p) { return color_type((p >> 16) & 0xFFE0, (p >> 5) & 0xFFE0, (p << 6) & 0xFFC0); } }; //=================================================blender_rgbBBA_gamma template<class Gamma> class blender_rgbBBA_gamma { public: typedef rgba16 color_type; typedef color_type::value_type value_type; typedef color_type::calc_type calc_type; typedef int32u pixel_type; typedef Gamma gamma_type; blender_rgbBBA_gamma() : m_gamma(0) {} void gamma(const gamma_type& g) { m_gamma = &g; } AGG_INLINE void blend_pix(pixel_type* p, unsigned cr, unsigned cg, unsigned cb, unsigned alpha, unsigned) { pixel_type rgb = *p; calc_type r = m_gamma->dir((rgb >> 16) & 0xFFE0); calc_type g = m_gamma->dir((rgb >> 5) & 0xFFE0); calc_type b = m_gamma->dir((rgb << 6) & 0xFFC0); *p = (pixel_type) (((m_gamma->inv(((m_gamma->dir(cr) - r) * alpha + (r << 16)) >> 16) << 16) & 0xFFE00000) | ((m_gamma->inv(((m_gamma->dir(cg) - g) * alpha + (g << 16)) >> 16) << 5 ) & 0x001FFC00) | (m_gamma->inv(((m_gamma->dir(cb) - b) * alpha + (b << 16)) >> 16) >> 6 )); } static AGG_INLINE pixel_type make_pix(unsigned r, unsigned g, unsigned b) { return (pixel_type)(((r & 0xFFE0) << 16) | ((g & 0xFFE0) << 5) | (b >> 6)); } static AGG_INLINE color_type make_color(pixel_type p) { return color_type((p >> 16) & 0xFFE0, (p >> 5) & 0xFFE0, (p << 6) & 0xFFC0); } private: const Gamma* m_gamma; }; //=====================================================blender_bgrABB struct blender_bgrABB { typedef rgba16 color_type; typedef color_type::value_type value_type; typedef color_type::calc_type calc_type; typedef int32u pixel_type; static AGG_INLINE void blend_pix(pixel_type* p, unsigned cr, unsigned cg, unsigned cb, unsigned alpha, unsigned) { pixel_type bgr = *p; calc_type b = (bgr >> 16) & 0xFFC0; calc_type g = (bgr >> 6) & 0xFFE0; calc_type r = (bgr << 5) & 0xFFE0; *p = (pixel_type) (((((cb - b) * alpha + (b << 16)) ) & 0xFFC00000) | ((((cg - g) * alpha + (g << 16)) >> 10) & 0x003FF800) | (((cr - r) * alpha + (r << 16)) >> 21)); } static AGG_INLINE pixel_type make_pix(unsigned r, unsigned g, unsigned b) { return (pixel_type)(((b & 0xFFC0) << 16) | ((g & 0xFFE0) << 6) | (r >> 5)); } static AGG_INLINE color_type make_color(pixel_type p) { return color_type((p << 5) & 0xFFE0, (p >> 6) & 0xFFE0, (p >> 16) & 0xFFC0); } }; //=================================================blender_bgrABB_pre struct blender_bgrABB_pre { typedef rgba16 color_type; typedef color_type::value_type value_type; typedef color_type::calc_type calc_type; typedef int32u pixel_type; static AGG_INLINE void blend_pix(pixel_type* p, unsigned cr, unsigned cg, unsigned cb, unsigned alpha, unsigned cover) { alpha = color_type::base_mask - alpha; cover = (cover + 1) << (color_type::base_shift - 8); pixel_type bgr = *p; calc_type b = (bgr >> 16) & 0xFFC0; calc_type g = (bgr >> 6) & 0xFFE0; calc_type r = (bgr << 5) & 0xFFE0; *p = (pixel_type) ((((b * alpha + cb * cover) ) & 0xFFC00000) | (((g * alpha + cg * cover) >> 10) & 0x003FF800) | ((r * alpha + cr * cover) >> 21)); } static AGG_INLINE pixel_type make_pix(unsigned r, unsigned g, unsigned b) { return (pixel_type)(((b & 0xFFC0) << 16) | ((g & 0xFFE0) << 6) | (r >> 5)); } static AGG_INLINE color_type make_color(pixel_type p) { return color_type((p << 5) & 0xFFE0, (p >> 6) & 0xFFE0, (p >> 16) & 0xFFC0); } }; //=================================================blender_bgrABB_gamma template<class Gamma> class blender_bgrABB_gamma { public: typedef rgba16 color_type; typedef color_type::value_type value_type; typedef color_type::calc_type calc_type; typedef int32u pixel_type; typedef Gamma gamma_type; blender_bgrABB_gamma() : m_gamma(0) {} void gamma(const gamma_type& g) { m_gamma = &g; } AGG_INLINE void blend_pix(pixel_type* p, unsigned cr, unsigned cg, unsigned cb, unsigned alpha, unsigned) { pixel_type bgr = *p; calc_type b = m_gamma->dir((bgr >> 16) & 0xFFC0); calc_type g = m_gamma->dir((bgr >> 6) & 0xFFE0); calc_type r = m_gamma->dir((bgr << 5) & 0xFFE0); *p = (pixel_type) (((m_gamma->inv(((m_gamma->dir(cb) - b) * alpha + (b << 16)) >> 16) << 16) & 0xFFC00000) | ((m_gamma->inv(((m_gamma->dir(cg) - g) * alpha + (g << 16)) >> 16) << 6 ) & 0x003FF800) | (m_gamma->inv(((m_gamma->dir(cr) - r) * alpha + (r << 16)) >> 16) >> 5 )); } static AGG_INLINE pixel_type make_pix(unsigned r, unsigned g, unsigned b) { return (pixel_type)(((b & 0xFFC0) << 16) | ((g & 0xFFE0) << 6) | (r >> 5)); } static AGG_INLINE color_type make_color(pixel_type p) { return color_type((p << 5) & 0xFFE0, (p >> 6) & 0xFFE0, (p >> 16) & 0xFFC0); } private: const Gamma* m_gamma; }; //===========================================pixfmt_alpha_blend_rgb_packed template<class Blender, class RenBuf> class pixfmt_alpha_blend_rgb_packed { public: typedef RenBuf rbuf_type; typedef typename rbuf_type::row_data row_data; typedef Blender blender_type; typedef typename blender_type::color_type color_type; typedef typename blender_type::pixel_type pixel_type; typedef int order_type; // A fake one typedef typename color_type::value_type value_type; typedef typename color_type::calc_type calc_type; enum base_scale_e { base_shift = color_type::base_shift, base_scale = color_type::base_scale, base_mask = color_type::base_mask, pix_width = sizeof(pixel_type) }; private: //-------------------------------------------------------------------- AGG_INLINE void copy_or_blend_pix(pixel_type* p, const color_type& c, unsigned cover) { if (c.a) { calc_type alpha = (calc_type(c.a) * (cover + 1)) >> 8; if(alpha == base_mask) { *p = m_blender.make_pix(c.r, c.g, c.b); } else { m_blender.blend_pix(p, c.r, c.g, c.b, alpha, cover); } } } public: //-------------------------------------------------------------------- explicit pixfmt_alpha_blend_rgb_packed(rbuf_type& rb) : m_rbuf(&rb) {} void attach(rbuf_type& rb) { m_rbuf = &rb; } //-------------------------------------------------------------------- template<class PixFmt> bool attach(PixFmt& pixf, int x1, int y1, int x2, int y2) { rect_i r(x1, y1, x2, y2); if(r.clip(rect_i(0, 0, pixf.width()-1, pixf.height()-1))) { int stride = pixf.stride(); m_rbuf->attach(pixf.pix_ptr(r.x1, stride < 0 ? r.y2 : r.y1), (r.x2 - r.x1) + 1, (r.y2 - r.y1) + 1, stride); return true; } return false; } Blender& blender() { return m_blender; } //-------------------------------------------------------------------- AGG_INLINE unsigned width() const { return m_rbuf->width(); } AGG_INLINE unsigned height() const { return m_rbuf->height(); } AGG_INLINE int stride() const { return m_rbuf->stride(); } //-------------------------------------------------------------------- AGG_INLINE int8u* row_ptr(int y) { return m_rbuf->row_ptr(y); } AGG_INLINE const int8u* row_ptr(int y) const { return m_rbuf->row_ptr(y); } AGG_INLINE row_data row(int y) const { return m_rbuf->row(y); } //-------------------------------------------------------------------- AGG_INLINE int8u* pix_ptr(int x, int y) { return m_rbuf->row_ptr(y) + x * pix_width; } AGG_INLINE const int8u* pix_ptr(int x, int y) const { return m_rbuf->row_ptr(y) + x * pix_width; } //-------------------------------------------------------------------- AGG_INLINE void make_pix(int8u* p, const color_type& c) { *(pixel_type*)p = m_blender.make_pix(c.r, c.g, c.b); } //-------------------------------------------------------------------- AGG_INLINE color_type pixel(int x, int y) const { return m_blender.make_color(((pixel_type*)m_rbuf->row_ptr(y))[x]); } //-------------------------------------------------------------------- AGG_INLINE void copy_pixel(int x, int y, const color_type& c) { ((pixel_type*) m_rbuf->row_ptr(x, y, 1))[x] = m_blender.make_pix(c.r, c.g, c.b); } //-------------------------------------------------------------------- AGG_INLINE void blend_pixel(int x, int y, const color_type& c, int8u cover) { copy_or_blend_pix((pixel_type*)m_rbuf->row_ptr(x, y, 1) + x, c, cover); } //-------------------------------------------------------------------- AGG_INLINE void copy_hline(int x, int y, unsigned len, const color_type& c) { pixel_type* p = (pixel_type*)m_rbuf->row_ptr(x, y, len) + x; pixel_type v = m_blender.make_pix(c.r, c.g, c.b); do { *p++ = v; } while(--len); } //-------------------------------------------------------------------- AGG_INLINE void copy_vline(int x, int y, unsigned len, const color_type& c) { pixel_type v = m_blender.make_pix(c.r, c.g, c.b); do { pixel_type* p = (pixel_type*)m_rbuf->row_ptr(x, y++, 1) + x; *p = v; } while(--len); } //-------------------------------------------------------------------- void blend_hline(int x, int y, unsigned len, const color_type& c, int8u cover) { if (c.a) { pixel_type* p = (pixel_type*)m_rbuf->row_ptr(x, y, len) + x; calc_type alpha = (calc_type(c.a) * (cover + 1)) >> 8; if(alpha == base_mask) { pixel_type v = m_blender.make_pix(c.r, c.g, c.b); do { *p++ = v; } while(--len); } else { do { m_blender.blend_pix(p, c.r, c.g, c.b, alpha, cover); ++p; } while(--len); } } } //-------------------------------------------------------------------- void blend_vline(int x, int y, unsigned len, const color_type& c, int8u cover) { if (c.a) { calc_type alpha = (calc_type(c.a) * (cover + 1)) >> 8; if(alpha == base_mask) { pixel_type v = m_blender.make_pix(c.r, c.g, c.b); do { ((pixel_type*)m_rbuf->row_ptr(x, y++, 1))[x] = v; } while(--len); } else { do { m_blender.blend_pix( (pixel_type*)m_rbuf->row_ptr(x, y++, 1), c.r, c.g, c.b, alpha, cover); } while(--len); } } } //-------------------------------------------------------------------- void blend_solid_hspan(int x, int y, unsigned len, const color_type& c, const int8u* covers) { pixel_type* p = (pixel_type*)m_rbuf->row_ptr(x, y, len) + x; do { copy_or_blend_pix(p, c, *covers++); ++p; } while(--len); } //-------------------------------------------------------------------- void blend_solid_vspan(int x, int y, unsigned len, const color_type& c, const int8u* covers) { do { copy_or_blend_pix((pixel_type*)m_rbuf->row_ptr(x, y++, 1) + x, c, *covers++); } while(--len); } //-------------------------------------------------------------------- void copy_color_hspan(int x, int y, unsigned len, const color_type* colors) { pixel_type* p = (pixel_type*)m_rbuf->row_ptr(x, y, len) + x; do { *p++ = m_blender.make_pix(colors->r, colors->g, colors->b); ++colors; } while(--len); } //-------------------------------------------------------------------- void copy_color_vspan(int x, int y, unsigned len, const color_type* colors) { do { pixel_type* p = (pixel_type*)m_rbuf->row_ptr(x, y++, 1) + x; *p = m_blender.make_pix(colors->r, colors->g, colors->b); ++colors; } while(--len); } //-------------------------------------------------------------------- void blend_color_hspan(int x, int y, unsigned len, const color_type* colors, const int8u* covers, int8u cover) { pixel_type* p = (pixel_type*)m_rbuf->row_ptr(x, y, len) + x; do { copy_or_blend_pix(p++, *colors++, covers ? *covers++ : cover); } while(--len); } //-------------------------------------------------------------------- void blend_color_vspan(int x, int y, unsigned len, const color_type* colors, const int8u* covers, int8u cover) { do { copy_or_blend_pix((pixel_type*)m_rbuf->row_ptr(x, y++, 1) + x, *colors++, covers ? *covers++ : cover); } while(--len); } //-------------------------------------------------------------------- template<class RenBuf2> void copy_from(const RenBuf2& from, int xdst, int ydst, int xsrc, int ysrc, unsigned len) { const int8u* p = from.row_ptr(ysrc); if(p) { memmove(m_rbuf->row_ptr(xdst, ydst, len) + xdst * pix_width, p + xsrc * pix_width, len * pix_width); } } //-------------------------------------------------------------------- template<class SrcPixelFormatRenderer> void blend_from(const SrcPixelFormatRenderer& from, int xdst, int ydst, int xsrc, int ysrc, unsigned len, int8u cover) { typedef typename SrcPixelFormatRenderer::order_type src_order; const value_type* psrc = (const value_type*)from.row_ptr(ysrc); if(psrc) { psrc += xsrc * 4; pixel_type* pdst = (pixel_type*)m_rbuf->row_ptr(xdst, ydst, len) + xdst; do { value_type alpha = psrc[src_order::A]; if(alpha) { if(alpha == base_mask && cover == 255) { *pdst = m_blender.make_pix(psrc[src_order::R], psrc[src_order::G], psrc[src_order::B]); } else { m_blender.blend_pix(pdst, psrc[src_order::R], psrc[src_order::G], psrc[src_order::B], alpha, cover); } } psrc += 4; ++pdst; } while(--len); } } //-------------------------------------------------------------------- template<class SrcPixelFormatRenderer> void blend_from_color(const SrcPixelFormatRenderer& from, const color_type& color, int xdst, int ydst, int xsrc, int ysrc, unsigned len, int8u cover) { typedef typename SrcPixelFormatRenderer::value_type src_value_type; const src_value_type* psrc = (src_value_type*)from.row_ptr(ysrc); if(psrc) { pixel_type* pdst = (pixel_type*)m_rbuf->row_ptr(xdst, ydst, len) + xdst; do { m_blender.blend_pix(pdst, color.r, color.g, color.b, color.a, cover); ++psrc; ++pdst; } while(--len); } } //-------------------------------------------------------------------- template<class SrcPixelFormatRenderer> void blend_from_lut(const SrcPixelFormatRenderer& from, const color_type* color_lut, int xdst, int ydst, int xsrc, int ysrc, unsigned len, int8u cover) { typedef typename SrcPixelFormatRenderer::value_type src_value_type; const src_value_type* psrc = (src_value_type*)from.row_ptr(ysrc); if(psrc) { pixel_type* pdst = (pixel_type*)m_rbuf->row_ptr(xdst, ydst, len) + xdst; do { const color_type& color = color_lut[*psrc]; m_blender.blend_pix(pdst, color.r, color.g, color.b, color.a, cover); ++psrc; ++pdst; } while(--len); } } private: rbuf_type* m_rbuf; Blender m_blender; }; typedef pixfmt_alpha_blend_rgb_packed<blender_rgb555, rendering_buffer> pixfmt_rgb555; //----pixfmt_rgb555 typedef pixfmt_alpha_blend_rgb_packed<blender_rgb565, rendering_buffer> pixfmt_rgb565; //----pixfmt_rgb565 typedef pixfmt_alpha_blend_rgb_packed<blender_rgb555_pre, rendering_buffer> pixfmt_rgb555_pre; //----pixfmt_rgb555_pre typedef pixfmt_alpha_blend_rgb_packed<blender_rgb565_pre, rendering_buffer> pixfmt_rgb565_pre; //----pixfmt_rgb565_pre typedef pixfmt_alpha_blend_rgb_packed<blender_rgbAAA, rendering_buffer> pixfmt_rgbAAA; //----pixfmt_rgbAAA typedef pixfmt_alpha_blend_rgb_packed<blender_bgrAAA, rendering_buffer> pixfmt_bgrAAA; //----pixfmt_bgrAAA typedef pixfmt_alpha_blend_rgb_packed<blender_rgbBBA, rendering_buffer> pixfmt_rgbBBA; //----pixfmt_rgbBBA typedef pixfmt_alpha_blend_rgb_packed<blender_bgrABB, rendering_buffer> pixfmt_bgrABB; //----pixfmt_bgrABB typedef pixfmt_alpha_blend_rgb_packed<blender_rgbAAA_pre, rendering_buffer> pixfmt_rgbAAA_pre; //----pixfmt_rgbAAA_pre typedef pixfmt_alpha_blend_rgb_packed<blender_bgrAAA_pre, rendering_buffer> pixfmt_bgrAAA_pre; //----pixfmt_bgrAAA_pre typedef pixfmt_alpha_blend_rgb_packed<blender_rgbBBA_pre, rendering_buffer> pixfmt_rgbBBA_pre; //----pixfmt_rgbBBA_pre typedef pixfmt_alpha_blend_rgb_packed<blender_bgrABB_pre, rendering_buffer> pixfmt_bgrABB_pre; //----pixfmt_bgrABB_pre //-----------------------------------------------------pixfmt_rgb555_gamma template<class Gamma> class pixfmt_rgb555_gamma : public pixfmt_alpha_blend_rgb_packed<blender_rgb555_gamma<Gamma>, rendering_buffer> { public: pixfmt_rgb555_gamma(rendering_buffer& rb, const Gamma& g) : pixfmt_alpha_blend_rgb_packed<blender_rgb555_gamma<Gamma>, rendering_buffer>(rb) { this->blender().gamma(g); } }; //-----------------------------------------------------pixfmt_rgb565_gamma template<class Gamma> class pixfmt_rgb565_gamma : public pixfmt_alpha_blend_rgb_packed<blender_rgb565_gamma<Gamma>, rendering_buffer> { public: pixfmt_rgb565_gamma(rendering_buffer& rb, const Gamma& g) : pixfmt_alpha_blend_rgb_packed<blender_rgb565_gamma<Gamma>, rendering_buffer>(rb) { this->blender().gamma(g); } }; //-----------------------------------------------------pixfmt_rgbAAA_gamma template<class Gamma> class pixfmt_rgbAAA_gamma : public pixfmt_alpha_blend_rgb_packed<blender_rgbAAA_gamma<Gamma>, rendering_buffer> { public: pixfmt_rgbAAA_gamma(rendering_buffer& rb, const Gamma& g) : pixfmt_alpha_blend_rgb_packed<blender_rgbAAA_gamma<Gamma>, rendering_buffer>(rb) { this->blender().gamma(g); } }; //-----------------------------------------------------pixfmt_bgrAAA_gamma template<class Gamma> class pixfmt_bgrAAA_gamma : public pixfmt_alpha_blend_rgb_packed<blender_bgrAAA_gamma<Gamma>, rendering_buffer> { public: pixfmt_bgrAAA_gamma(rendering_buffer& rb, const Gamma& g) : pixfmt_alpha_blend_rgb_packed<blender_bgrAAA_gamma<Gamma>, rendering_buffer>(rb) { this->blender().gamma(g); } }; //-----------------------------------------------------pixfmt_rgbBBA_gamma template<class Gamma> class pixfmt_rgbBBA_gamma : public pixfmt_alpha_blend_rgb_packed<blender_rgbBBA_gamma<Gamma>, rendering_buffer> { public: pixfmt_rgbBBA_gamma(rendering_buffer& rb, const Gamma& g) : pixfmt_alpha_blend_rgb_packed<blender_rgbBBA_gamma<Gamma>, rendering_buffer>(rb) { this->blender().gamma(g); } }; //-----------------------------------------------------pixfmt_bgrABB_gamma template<class Gamma> class pixfmt_bgrABB_gamma : public pixfmt_alpha_blend_rgb_packed<blender_bgrABB_gamma<Gamma>, rendering_buffer> { public: pixfmt_bgrABB_gamma(rendering_buffer& rb, const Gamma& g) : pixfmt_alpha_blend_rgb_packed<blender_bgrABB_gamma<Gamma>, rendering_buffer>(rb) { this->blender().gamma(g); } }; } #endif ��������������������������agg-2.5+dfsg1/include/agg_pixfmt_rgba.h�������������������������������������������������������������0000644�0000000�0000000�00000350741�10703246330�020204� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- // // 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 #define AGG_PIXFMT_RGBA_INCLUDED #include <string.h> #include <math.h> #include "agg_basics.h" #include "agg_color_rgba.h" #include "agg_rendering_buffer.h" namespace agg { //=========================================================multiplier_rgba template<class ColorT, class Order> struct multiplier_rgba { typedef typename ColorT::value_type value_type; typedef typename ColorT::calc_type calc_type; //-------------------------------------------------------------------- static AGG_INLINE void premultiply(value_type* p) { calc_type a = p[Order::A]; if(a < ColorT::base_mask) { if(a == 0) { p[Order::R] = p[Order::G] = p[Order::B] = 0; return; } p[Order::R] = value_type((p[Order::R] * a + ColorT::base_mask) >> ColorT::base_shift); p[Order::G] = value_type((p[Order::G] * a + ColorT::base_mask) >> ColorT::base_shift); p[Order::B] = value_type((p[Order::B] * a + ColorT::base_mask) >> ColorT::base_shift); } } //-------------------------------------------------------------------- static AGG_INLINE void demultiply(value_type* p) { calc_type a = p[Order::A]; if(a < ColorT::base_mask) { if(a == 0) { p[Order::R] = p[Order::G] = p[Order::B] = 0; return; } calc_type r = (calc_type(p[Order::R]) * ColorT::base_mask) / a; calc_type g = (calc_type(p[Order::G]) * ColorT::base_mask) / a; calc_type b = (calc_type(p[Order::B]) * ColorT::base_mask) / a; p[Order::R] = value_type((r > ColorT::base_mask) ? ColorT::base_mask : r); p[Order::G] = value_type((g > ColorT::base_mask) ? ColorT::base_mask : g); p[Order::B] = value_type((b > ColorT::base_mask) ? ColorT::base_mask : b); } } }; //=====================================================apply_gamma_dir_rgba template<class ColorT, class Order, class GammaLut> class apply_gamma_dir_rgba { public: typedef typename ColorT::value_type value_type; apply_gamma_dir_rgba(const GammaLut& gamma) : m_gamma(gamma) {} AGG_INLINE void operator () (value_type* p) { p[Order::R] = m_gamma.dir(p[Order::R]); p[Order::G] = m_gamma.dir(p[Order::G]); p[Order::B] = m_gamma.dir(p[Order::B]); } private: const GammaLut& m_gamma; }; //=====================================================apply_gamma_inv_rgba template<class ColorT, class Order, class GammaLut> class apply_gamma_inv_rgba { public: typedef typename ColorT::value_type value_type; apply_gamma_inv_rgba(const GammaLut& gamma) : m_gamma(gamma) {} AGG_INLINE void operator () (value_type* p) { p[Order::R] = m_gamma.inv(p[Order::R]); p[Order::G] = m_gamma.inv(p[Order::G]); p[Order::B] = m_gamma.inv(p[Order::B]); } private: const GammaLut& m_gamma; }; //=============================================================blender_rgba template<class ColorT, class Order> struct blender_rgba { typedef ColorT color_type; typedef Order order_type; typedef typename color_type::value_type value_type; typedef typename color_type::calc_type calc_type; enum base_scale_e { base_shift = color_type::base_shift, base_mask = color_type::base_mask }; //-------------------------------------------------------------------- static AGG_INLINE void blend_pix(value_type* p, unsigned cr, unsigned cg, unsigned cb, unsigned alpha, unsigned cover=0) { calc_type r = p[Order::R]; calc_type g = p[Order::G]; calc_type b = p[Order::B]; calc_type a = p[Order::A]; p[Order::R] = (value_type)(((cr - r) * alpha + (r << base_shift)) >> base_shift); p[Order::G] = (value_type)(((cg - g) * alpha + (g << base_shift)) >> base_shift); p[Order::B] = (value_type)(((cb - b) * alpha + (b << base_shift)) >> base_shift); p[Order::A] = (value_type)((alpha + a) - ((alpha * a + base_mask) >> base_shift)); } }; //=========================================================blender_rgba_pre template<class ColorT, class Order> struct blender_rgba_pre { typedef ColorT color_type; typedef Order order_type; typedef typename color_type::value_type value_type; typedef typename color_type::calc_type calc_type; enum base_scale_e { base_shift = color_type::base_shift, base_mask = color_type::base_mask }; //-------------------------------------------------------------------- static AGG_INLINE void blend_pix(value_type* p, unsigned cr, unsigned cg, unsigned cb, unsigned alpha, unsigned cover) { alpha = color_type::base_mask - alpha; cover = (cover + 1) << (base_shift - 8); p[Order::R] = (value_type)((p[Order::R] * alpha + cr * cover) >> base_shift); p[Order::G] = (value_type)((p[Order::G] * alpha + cg * cover) >> base_shift); p[Order::B] = (value_type)((p[Order::B] * alpha + cb * cover) >> base_shift); p[Order::A] = (value_type)(base_mask - ((alpha * (base_mask - p[Order::A])) >> base_shift)); } //-------------------------------------------------------------------- static AGG_INLINE void blend_pix(value_type* p, unsigned cr, unsigned cg, unsigned cb, unsigned alpha) { alpha = color_type::base_mask - alpha; p[Order::R] = (value_type)(((p[Order::R] * alpha) >> base_shift) + cr); p[Order::G] = (value_type)(((p[Order::G] * alpha) >> base_shift) + cg); p[Order::B] = (value_type)(((p[Order::B] * alpha) >> base_shift) + cb); p[Order::A] = (value_type)(base_mask - ((alpha * (base_mask - p[Order::A])) >> base_shift)); } }; //======================================================blender_rgba_plain template<class ColorT, class Order> struct blender_rgba_plain { typedef ColorT color_type; typedef Order order_type; typedef typename color_type::value_type value_type; typedef typename color_type::calc_type calc_type; enum base_scale_e { base_shift = color_type::base_shift }; //-------------------------------------------------------------------- static AGG_INLINE void blend_pix(value_type* p, unsigned cr, unsigned cg, unsigned cb, unsigned alpha, unsigned cover=0) { if(alpha == 0) return; calc_type a = p[Order::A]; calc_type r = p[Order::R] * a; calc_type g = p[Order::G] * a; calc_type b = p[Order::B] * a; a = ((alpha + a) << base_shift) - alpha * a; p[Order::A] = (value_type)(a >> base_shift); p[Order::R] = (value_type)((((cr << base_shift) - r) * alpha + (r << base_shift)) / a); p[Order::G] = (value_type)((((cg << base_shift) - g) * alpha + (g << base_shift)) / a); p[Order::B] = (value_type)((((cb << base_shift) - b) * alpha + (b << base_shift)) / a); } }; //=========================================================comp_op_rgba_clear template<class ColorT, class Order> struct comp_op_rgba_clear { typedef ColorT color_type; typedef Order order_type; typedef typename color_type::value_type value_type; enum base_scale_e { base_shift = color_type::base_shift, base_mask = color_type::base_mask }; static AGG_INLINE void blend_pix(value_type* p, unsigned, unsigned, unsigned, unsigned, unsigned cover) { if(cover < 255) { cover = 255 - cover; p[Order::R] = (value_type)((p[Order::R] * cover + 255) >> 8); p[Order::G] = (value_type)((p[Order::G] * cover + 255) >> 8); p[Order::B] = (value_type)((p[Order::B] * cover + 255) >> 8); p[Order::A] = (value_type)((p[Order::A] * cover + 255) >> 8); } else { p[0] = p[1] = p[2] = p[3] = 0; } } }; //===========================================================comp_op_rgba_src template<class ColorT, class Order> struct comp_op_rgba_src { typedef ColorT color_type; typedef Order order_type; typedef typename color_type::value_type value_type; static AGG_INLINE void blend_pix(value_type* p, unsigned sr, unsigned sg, unsigned sb, unsigned sa, unsigned cover) { if(cover < 255) { unsigned alpha = 255 - cover; p[Order::R] = (value_type)(((p[Order::R] * alpha + 255) >> 8) + ((sr * cover + 255) >> 8)); p[Order::G] = (value_type)(((p[Order::G] * alpha + 255) >> 8) + ((sg * cover + 255) >> 8)); p[Order::B] = (value_type)(((p[Order::B] * alpha + 255) >> 8) + ((sb * cover + 255) >> 8)); p[Order::A] = (value_type)(((p[Order::A] * alpha + 255) >> 8) + ((sa * cover + 255) >> 8)); } else { p[Order::R] = sr; p[Order::G] = sg; p[Order::B] = sb; p[Order::A] = sa; } } }; //===========================================================comp_op_rgba_dst template<class ColorT, class Order> struct comp_op_rgba_dst { typedef ColorT color_type; typedef Order order_type; typedef typename color_type::value_type value_type; static AGG_INLINE void blend_pix(value_type*, unsigned, unsigned, unsigned, unsigned, unsigned) { } }; //======================================================comp_op_rgba_src_over template<class ColorT, class Order> struct comp_op_rgba_src_over { typedef ColorT color_type; typedef Order order_type; typedef typename color_type::value_type value_type; typedef typename color_type::calc_type calc_type; enum base_scale_e { base_shift = color_type::base_shift, base_mask = color_type::base_mask }; // Dca' = Sca + Dca.(1 - Sa) // Da' = Sa + Da - Sa.Da static AGG_INLINE void blend_pix(value_type* p, unsigned sr, unsigned sg, unsigned sb, unsigned sa, unsigned cover) { if(cover < 255) { sr = (sr * cover + 255) >> 8; sg = (sg * cover + 255) >> 8; sb = (sb * cover + 255) >> 8; sa = (sa * cover + 255) >> 8; } calc_type s1a = base_mask - sa; p[Order::R] = (value_type)(sr + ((p[Order::R] * s1a + base_mask) >> base_shift)); p[Order::G] = (value_type)(sg + ((p[Order::G] * s1a + base_mask) >> base_shift)); p[Order::B] = (value_type)(sb + ((p[Order::B] * s1a + base_mask) >> base_shift)); p[Order::A] = (value_type)(sa + p[Order::A] - ((sa * p[Order::A] + base_mask) >> base_shift)); } }; //======================================================comp_op_rgba_dst_over template<class ColorT, class Order> struct comp_op_rgba_dst_over { typedef ColorT color_type; typedef Order order_type; typedef typename color_type::value_type value_type; typedef typename color_type::calc_type calc_type; enum base_scale_e { base_shift = color_type::base_shift, base_mask = color_type::base_mask }; // Dca' = Dca + Sca.(1 - Da) // Da' = Sa + Da - Sa.Da static AGG_INLINE void blend_pix(value_type* p, unsigned sr, unsigned sg, unsigned sb, unsigned sa, unsigned cover) { if(cover < 255) { sr = (sr * cover + 255) >> 8; sg = (sg * cover + 255) >> 8; sb = (sb * cover + 255) >> 8; sa = (sa * cover + 255) >> 8; } calc_type d1a = base_mask - p[Order::A]; p[Order::R] = (value_type)(p[Order::R] + ((sr * d1a + base_mask) >> base_shift)); p[Order::G] = (value_type)(p[Order::G] + ((sg * d1a + base_mask) >> base_shift)); p[Order::B] = (value_type)(p[Order::B] + ((sb * d1a + base_mask) >> base_shift)); p[Order::A] = (value_type)(sa + p[Order::A] - ((sa * p[Order::A] + base_mask) >> base_shift)); } }; //======================================================comp_op_rgba_src_in template<class ColorT, class Order> struct comp_op_rgba_src_in { typedef ColorT color_type; typedef Order order_type; typedef typename color_type::value_type value_type; typedef typename color_type::calc_type calc_type; enum base_scale_e { base_shift = color_type::base_shift, base_mask = color_type::base_mask }; // Dca' = Sca.Da // Da' = Sa.Da static AGG_INLINE void blend_pix(value_type* p, unsigned sr, unsigned sg, unsigned sb, unsigned sa, unsigned cover) { calc_type da = p[Order::A]; if(cover < 255) { unsigned alpha = 255 - cover; p[Order::R] = (value_type)(((p[Order::R] * alpha + 255) >> 8) + ((((sr * da + base_mask) >> base_shift) * cover + 255) >> 8)); p[Order::G] = (value_type)(((p[Order::G] * alpha + 255) >> 8) + ((((sg * da + base_mask) >> base_shift) * cover + 255) >> 8)); p[Order::B] = (value_type)(((p[Order::B] * alpha + 255) >> 8) + ((((sb * da + base_mask) >> base_shift) * cover + 255) >> 8)); p[Order::A] = (value_type)(((p[Order::A] * alpha + 255) >> 8) + ((((sa * da + base_mask) >> base_shift) * cover + 255) >> 8)); } else { p[Order::R] = (value_type)((sr * da + base_mask) >> base_shift); p[Order::G] = (value_type)((sg * da + base_mask) >> base_shift); p[Order::B] = (value_type)((sb * da + base_mask) >> base_shift); p[Order::A] = (value_type)((sa * da + base_mask) >> base_shift); } } }; //======================================================comp_op_rgba_dst_in template<class ColorT, class Order> struct comp_op_rgba_dst_in { typedef ColorT color_type; typedef Order order_type; typedef typename color_type::value_type value_type; typedef typename color_type::calc_type calc_type; enum base_scale_e { base_shift = color_type::base_shift, base_mask = color_type::base_mask }; // Dca' = Dca.Sa // Da' = Sa.Da static AGG_INLINE void blend_pix(value_type* p, unsigned, unsigned, unsigned, unsigned sa, unsigned cover) { if(cover < 255) { sa = base_mask - ((cover * (base_mask - sa) + 255) >> 8); } p[Order::R] = (value_type)((p[Order::R] * sa + base_mask) >> base_shift); p[Order::G] = (value_type)((p[Order::G] * sa + base_mask) >> base_shift); p[Order::B] = (value_type)((p[Order::B] * sa + base_mask) >> base_shift); p[Order::A] = (value_type)((p[Order::A] * sa + base_mask) >> base_shift); } }; //======================================================comp_op_rgba_src_out template<class ColorT, class Order> struct comp_op_rgba_src_out { typedef ColorT color_type; typedef Order order_type; typedef typename color_type::value_type value_type; typedef typename color_type::calc_type calc_type; enum base_scale_e { base_shift = color_type::base_shift, base_mask = color_type::base_mask }; // Dca' = Sca.(1 - Da) // Da' = Sa.(1 - Da) static AGG_INLINE void blend_pix(value_type* p, unsigned sr, unsigned sg, unsigned sb, unsigned sa, unsigned cover) { calc_type da = base_mask - p[Order::A]; if(cover < 255) { unsigned alpha = 255 - cover; p[Order::R] = (value_type)(((p[Order::R] * alpha + 255) >> 8) + ((((sr * da + base_mask) >> base_shift) * cover + 255) >> 8)); p[Order::G] = (value_type)(((p[Order::G] * alpha + 255) >> 8) + ((((sg * da + base_mask) >> base_shift) * cover + 255) >> 8)); p[Order::B] = (value_type)(((p[Order::B] * alpha + 255) >> 8) + ((((sb * da + base_mask) >> base_shift) * cover + 255) >> 8)); p[Order::A] = (value_type)(((p[Order::A] * alpha + 255) >> 8) + ((((sa * da + base_mask) >> base_shift) * cover + 255) >> 8)); } else { p[Order::R] = (value_type)((sr * da + base_mask) >> base_shift); p[Order::G] = (value_type)((sg * da + base_mask) >> base_shift); p[Order::B] = (value_type)((sb * da + base_mask) >> base_shift); p[Order::A] = (value_type)((sa * da + base_mask) >> base_shift); } } }; //======================================================comp_op_rgba_dst_out template<class ColorT, class Order> struct comp_op_rgba_dst_out { typedef ColorT color_type; typedef Order order_type; typedef typename color_type::value_type value_type; typedef typename color_type::calc_type calc_type; enum base_scale_e { base_shift = color_type::base_shift, base_mask = color_type::base_mask }; // Dca' = Dca.(1 - Sa) // Da' = Da.(1 - Sa) static AGG_INLINE void blend_pix(value_type* p, unsigned, unsigned, unsigned, unsigned sa, unsigned cover) { if(cover < 255) { sa = (sa * cover + 255) >> 8; } sa = base_mask - sa; p[Order::R] = (value_type)((p[Order::R] * sa + base_shift) >> base_shift); p[Order::G] = (value_type)((p[Order::G] * sa + base_shift) >> base_shift); p[Order::B] = (value_type)((p[Order::B] * sa + base_shift) >> base_shift); p[Order::A] = (value_type)((p[Order::A] * sa + base_shift) >> base_shift); } }; //=====================================================comp_op_rgba_src_atop template<class ColorT, class Order> struct comp_op_rgba_src_atop { typedef ColorT color_type; typedef Order order_type; typedef typename color_type::value_type value_type; typedef typename color_type::calc_type calc_type; enum base_scale_e { base_shift = color_type::base_shift, base_mask = color_type::base_mask }; // Dca' = Sca.Da + Dca.(1 - Sa) // Da' = Da static AGG_INLINE void blend_pix(value_type* p, unsigned sr, unsigned sg, unsigned sb, unsigned sa, unsigned cover) { if(cover < 255) { sr = (sr * cover + 255) >> 8; sg = (sg * cover + 255) >> 8; sb = (sb * cover + 255) >> 8; sa = (sa * cover + 255) >> 8; } calc_type da = p[Order::A]; sa = base_mask - sa; p[Order::R] = (value_type)((sr * da + p[Order::R] * sa + base_mask) >> base_shift); p[Order::G] = (value_type)((sg * da + p[Order::G] * sa + base_mask) >> base_shift); p[Order::B] = (value_type)((sb * da + p[Order::B] * sa + base_mask) >> base_shift); } }; //=====================================================comp_op_rgba_dst_atop template<class ColorT, class Order> struct comp_op_rgba_dst_atop { typedef ColorT color_type; typedef Order order_type; typedef typename color_type::value_type value_type; typedef typename color_type::calc_type calc_type; enum base_scale_e { base_shift = color_type::base_shift, base_mask = color_type::base_mask }; // Dca' = Dca.Sa + Sca.(1 - Da) // Da' = Sa static AGG_INLINE void blend_pix(value_type* p, unsigned sr, unsigned sg, unsigned sb, unsigned sa, unsigned cover) { calc_type da = base_mask - p[Order::A]; if(cover < 255) { unsigned alpha = 255 - cover; sr = (p[Order::R] * sa + sr * da + base_mask) >> base_shift; sg = (p[Order::G] * sa + sg * da + base_mask) >> base_shift; sb = (p[Order::B] * sa + sb * da + base_mask) >> base_shift; p[Order::R] = (value_type)(((p[Order::R] * alpha + 255) >> 8) + ((sr * cover + 255) >> 8)); p[Order::G] = (value_type)(((p[Order::G] * alpha + 255) >> 8) + ((sg * cover + 255) >> 8)); p[Order::B] = (value_type)(((p[Order::B] * alpha + 255) >> 8) + ((sb * cover + 255) >> 8)); p[Order::A] = (value_type)(((p[Order::A] * alpha + 255) >> 8) + ((sa * cover + 255) >> 8)); } else { p[Order::R] = (value_type)((p[Order::R] * sa + sr * da + base_mask) >> base_shift); p[Order::G] = (value_type)((p[Order::G] * sa + sg * da + base_mask) >> base_shift); p[Order::B] = (value_type)((p[Order::B] * sa + sb * da + base_mask) >> base_shift); p[Order::A] = (value_type)sa; } } }; //=========================================================comp_op_rgba_xor template<class ColorT, class Order> struct comp_op_rgba_xor { typedef ColorT color_type; typedef Order order_type; typedef typename color_type::value_type value_type; typedef typename color_type::calc_type calc_type; enum base_scale_e { base_shift = color_type::base_shift, base_mask = color_type::base_mask }; // Dca' = Sca.(1 - Da) + Dca.(1 - Sa) // Da' = Sa + Da - 2.Sa.Da static AGG_INLINE void blend_pix(value_type* p, unsigned sr, unsigned sg, unsigned sb, unsigned sa, unsigned cover) { if(cover < 255) { sr = (sr * cover + 255) >> 8; sg = (sg * cover + 255) >> 8; sb = (sb * cover + 255) >> 8; sa = (sa * cover + 255) >> 8; } if(sa) { calc_type s1a = base_mask - sa; calc_type d1a = base_mask - p[Order::A]; p[Order::R] = (value_type)((p[Order::R] * s1a + sr * d1a + base_mask) >> base_shift); p[Order::G] = (value_type)((p[Order::G] * s1a + sg * d1a + base_mask) >> base_shift); p[Order::B] = (value_type)((p[Order::B] * s1a + sb * d1a + base_mask) >> base_shift); p[Order::A] = (value_type)(sa + p[Order::A] - ((sa * p[Order::A] + base_mask/2) >> (base_shift - 1))); } } }; //=========================================================comp_op_rgba_plus template<class ColorT, class Order> struct comp_op_rgba_plus { typedef ColorT color_type; typedef Order order_type; typedef typename color_type::value_type value_type; typedef typename color_type::calc_type calc_type; enum base_scale_e { base_shift = color_type::base_shift, base_mask = color_type::base_mask }; // Dca' = Sca + Dca // Da' = Sa + Da static AGG_INLINE void blend_pix(value_type* p, unsigned sr, unsigned sg, unsigned sb, unsigned sa, unsigned cover) { if(cover < 255) { sr = (sr * cover + 255) >> 8; sg = (sg * cover + 255) >> 8; sb = (sb * cover + 255) >> 8; sa = (sa * cover + 255) >> 8; } if(sa) { calc_type dr = p[Order::R] + sr; calc_type dg = p[Order::G] + sg; calc_type db = p[Order::B] + sb; calc_type da = p[Order::A] + sa; p[Order::R] = (dr > base_mask) ? (value_type)base_mask : dr; p[Order::G] = (dg > base_mask) ? (value_type)base_mask : dg; p[Order::B] = (db > base_mask) ? (value_type)base_mask : db; p[Order::A] = (da > base_mask) ? (value_type)base_mask : da; } } }; //========================================================comp_op_rgba_minus template<class ColorT, class Order> struct comp_op_rgba_minus { typedef ColorT color_type; typedef Order order_type; typedef typename color_type::value_type value_type; typedef typename color_type::calc_type calc_type; enum base_scale_e { base_shift = color_type::base_shift, base_mask = color_type::base_mask }; // Dca' = Dca - Sca // Da' = 1 - (1 - Sa).(1 - Da) static AGG_INLINE void blend_pix(value_type* p, unsigned sr, unsigned sg, unsigned sb, unsigned sa, unsigned cover) { if(cover < 255) { sr = (sr * cover + 255) >> 8; sg = (sg * cover + 255) >> 8; sb = (sb * cover + 255) >> 8; sa = (sa * cover + 255) >> 8; } if(sa) { calc_type dr = p[Order::R] - sr; calc_type dg = p[Order::G] - sg; calc_type db = p[Order::B] - sb; p[Order::R] = (dr > base_mask) ? 0 : dr; p[Order::G] = (dg > base_mask) ? 0 : dg; p[Order::B] = (db > base_mask) ? 0 : db; p[Order::A] = (value_type)(sa + p[Order::A] - ((sa * p[Order::A] + base_mask) >> base_shift)); //p[Order::A] = (value_type)(base_mask - (((base_mask - sa) * (base_mask - p[Order::A]) + base_mask) >> base_shift)); } } }; //=====================================================comp_op_rgba_multiply template<class ColorT, class Order> struct comp_op_rgba_multiply { typedef ColorT color_type; typedef Order order_type; typedef typename color_type::value_type value_type; typedef typename color_type::calc_type calc_type; enum base_scale_e { base_shift = color_type::base_shift, base_mask = color_type::base_mask }; // Dca' = Sca.Dca + Sca.(1 - Da) + Dca.(1 - Sa) // Da' = Sa + Da - Sa.Da static AGG_INLINE void blend_pix(value_type* p, unsigned sr, unsigned sg, unsigned sb, unsigned sa, unsigned cover) { if(cover < 255) { sr = (sr * cover + 255) >> 8; sg = (sg * cover + 255) >> 8; sb = (sb * cover + 255) >> 8; sa = (sa * cover + 255) >> 8; } if(sa) { calc_type s1a = base_mask - sa; calc_type d1a = base_mask - p[Order::A]; calc_type dr = p[Order::R]; calc_type dg = p[Order::G]; calc_type db = p[Order::B]; p[Order::R] = (value_type)((sr * dr + sr * d1a + dr * s1a + base_mask) >> base_shift); p[Order::G] = (value_type)((sg * dg + sg * d1a + dg * s1a + base_mask) >> base_shift); p[Order::B] = (value_type)((sb * db + sb * d1a + db * s1a + base_mask) >> base_shift); p[Order::A] = (value_type)(sa + p[Order::A] - ((sa * p[Order::A] + base_mask) >> base_shift)); } } }; //=====================================================comp_op_rgba_screen template<class ColorT, class Order> struct comp_op_rgba_screen { typedef ColorT color_type; typedef Order order_type; typedef typename color_type::value_type value_type; typedef typename color_type::calc_type calc_type; enum base_scale_e { base_shift = color_type::base_shift, base_mask = color_type::base_mask }; // Dca' = Sca + Dca - Sca.Dca // Da' = Sa + Da - Sa.Da static AGG_INLINE void blend_pix(value_type* p, unsigned sr, unsigned sg, unsigned sb, unsigned sa, unsigned cover) { if(cover < 255) { sr = (sr * cover + 255) >> 8; sg = (sg * cover + 255) >> 8; sb = (sb * cover + 255) >> 8; sa = (sa * cover + 255) >> 8; } if(sa) { calc_type dr = p[Order::R]; calc_type dg = p[Order::G]; calc_type db = p[Order::B]; calc_type da = p[Order::A]; p[Order::R] = (value_type)(sr + dr - ((sr * dr + base_mask) >> base_shift)); p[Order::G] = (value_type)(sg + dg - ((sg * dg + base_mask) >> base_shift)); p[Order::B] = (value_type)(sb + db - ((sb * db + base_mask) >> base_shift)); p[Order::A] = (value_type)(sa + da - ((sa * da + base_mask) >> base_shift)); } } }; //=====================================================comp_op_rgba_overlay template<class ColorT, class Order> struct comp_op_rgba_overlay { typedef ColorT color_type; typedef Order order_type; typedef typename color_type::value_type value_type; typedef typename color_type::calc_type calc_type; enum base_scale_e { base_shift = color_type::base_shift, base_mask = color_type::base_mask }; // if 2.Dca < Da // Dca' = 2.Sca.Dca + Sca.(1 - Da) + Dca.(1 - Sa) // otherwise // Dca' = Sa.Da - 2.(Da - Dca).(Sa - Sca) + Sca.(1 - Da) + Dca.(1 - Sa) // // Da' = Sa + Da - Sa.Da static AGG_INLINE void blend_pix(value_type* p, unsigned sr, unsigned sg, unsigned sb, unsigned sa, unsigned cover) { if(cover < 255) { sr = (sr * cover + 255) >> 8; sg = (sg * cover + 255) >> 8; sb = (sb * cover + 255) >> 8; sa = (sa * cover + 255) >> 8; } if(sa) { calc_type d1a = base_mask - p[Order::A]; calc_type s1a = base_mask - sa; calc_type dr = p[Order::R]; calc_type dg = p[Order::G]; calc_type db = p[Order::B]; calc_type da = p[Order::A]; calc_type sada = sa * p[Order::A]; p[Order::R] = (value_type)(((2*dr < da) ? 2*sr*dr + sr*d1a + dr*s1a : sada - 2*(da - dr)*(sa - sr) + sr*d1a + dr*s1a + base_mask) >> base_shift); p[Order::G] = (value_type)(((2*dg < da) ? 2*sg*dg + sg*d1a + dg*s1a : sada - 2*(da - dg)*(sa - sg) + sg*d1a + dg*s1a + base_mask) >> base_shift); p[Order::B] = (value_type)(((2*db < da) ? 2*sb*db + sb*d1a + db*s1a : sada - 2*(da - db)*(sa - sb) + sb*d1a + db*s1a + base_mask) >> base_shift); p[Order::A] = (value_type)(sa + da - ((sa * da + base_mask) >> base_shift)); } } }; template<class T> inline T sd_min(T a, T b) { return (a < b) ? a : b; } template<class T> inline T sd_max(T a, T b) { return (a > b) ? a : b; } //=====================================================comp_op_rgba_darken template<class ColorT, class Order> struct comp_op_rgba_darken { typedef ColorT color_type; typedef Order order_type; typedef typename color_type::value_type value_type; typedef typename color_type::calc_type calc_type; enum base_scale_e { base_shift = color_type::base_shift, base_mask = color_type::base_mask }; // Dca' = min(Sca.Da, Dca.Sa) + Sca.(1 - Da) + Dca.(1 - Sa) // Da' = Sa + Da - Sa.Da static AGG_INLINE void blend_pix(value_type* p, unsigned sr, unsigned sg, unsigned sb, unsigned sa, unsigned cover) { if(cover < 255) { sr = (sr * cover + 255) >> 8; sg = (sg * cover + 255) >> 8; sb = (sb * cover + 255) >> 8; sa = (sa * cover + 255) >> 8; } if(sa) { calc_type d1a = base_mask - p[Order::A]; calc_type s1a = base_mask - sa; calc_type dr = p[Order::R]; calc_type dg = p[Order::G]; calc_type db = p[Order::B]; calc_type da = p[Order::A]; p[Order::R] = (value_type)((sd_min(sr * da, dr * sa) + sr * d1a + dr * s1a + base_mask) >> base_shift); p[Order::G] = (value_type)((sd_min(sg * da, dg * sa) + sg * d1a + dg * s1a + base_mask) >> base_shift); p[Order::B] = (value_type)((sd_min(sb * da, db * sa) + sb * d1a + db * s1a + base_mask) >> base_shift); p[Order::A] = (value_type)(sa + da - ((sa * da + base_mask) >> base_shift)); } } }; //=====================================================comp_op_rgba_lighten template<class ColorT, class Order> struct comp_op_rgba_lighten { typedef ColorT color_type; typedef Order order_type; typedef typename color_type::value_type value_type; typedef typename color_type::calc_type calc_type; enum base_scale_e { base_shift = color_type::base_shift, base_mask = color_type::base_mask }; // Dca' = max(Sca.Da, Dca.Sa) + Sca.(1 - Da) + Dca.(1 - Sa) // Da' = Sa + Da - Sa.Da static AGG_INLINE void blend_pix(value_type* p, unsigned sr, unsigned sg, unsigned sb, unsigned sa, unsigned cover) { if(cover < 255) { sr = (sr * cover + 255) >> 8; sg = (sg * cover + 255) >> 8; sb = (sb * cover + 255) >> 8; sa = (sa * cover + 255) >> 8; } if(sa) { calc_type d1a = base_mask - p[Order::A]; calc_type s1a = base_mask - sa; calc_type dr = p[Order::R]; calc_type dg = p[Order::G]; calc_type db = p[Order::B]; calc_type da = p[Order::A]; p[Order::R] = (value_type)((sd_max(sr * da, dr * sa) + sr * d1a + dr * s1a + base_mask) >> base_shift); p[Order::G] = (value_type)((sd_max(sg * da, dg * sa) + sg * d1a + dg * s1a + base_mask) >> base_shift); p[Order::B] = (value_type)((sd_max(sb * da, db * sa) + sb * d1a + db * s1a + base_mask) >> base_shift); p[Order::A] = (value_type)(sa + da - ((sa * da + base_mask) >> base_shift)); } } }; //=====================================================comp_op_rgba_color_dodge template<class ColorT, class Order> struct comp_op_rgba_color_dodge { typedef ColorT color_type; typedef Order order_type; typedef typename color_type::value_type value_type; typedef typename color_type::calc_type calc_type; typedef typename color_type::long_type long_type; enum base_scale_e { base_shift = color_type::base_shift, base_mask = color_type::base_mask }; // if Sca.Da + Dca.Sa >= Sa.Da // Dca' = Sa.Da + Sca.(1 - Da) + Dca.(1 - Sa) // otherwise // Dca' = Dca.Sa/(1-Sca/Sa) + Sca.(1 - Da) + Dca.(1 - Sa) // // Da' = Sa + Da - Sa.Da static AGG_INLINE void blend_pix(value_type* p, unsigned sr, unsigned sg, unsigned sb, unsigned sa, unsigned cover) { if(cover < 255) { sr = (sr * cover + 255) >> 8; sg = (sg * cover + 255) >> 8; sb = (sb * cover + 255) >> 8; sa = (sa * cover + 255) >> 8; } if(sa) { calc_type d1a = base_mask - p[Order::A]; calc_type s1a = base_mask - sa; calc_type dr = p[Order::R]; calc_type dg = p[Order::G]; calc_type db = p[Order::B]; calc_type da = p[Order::A]; long_type drsa = dr * sa; long_type dgsa = dg * sa; long_type dbsa = db * sa; long_type srda = sr * da; long_type sgda = sg * da; long_type sbda = sb * da; long_type sada = sa * da; p[Order::R] = (value_type)((srda + drsa >= sada) ? (sada + sr * d1a + dr * s1a + base_mask) >> base_shift : drsa / (base_mask - (sr << base_shift) / sa) + ((sr * d1a + dr * s1a + base_mask) >> base_shift)); p[Order::G] = (value_type)((sgda + dgsa >= sada) ? (sada + sg * d1a + dg * s1a + base_mask) >> base_shift : dgsa / (base_mask - (sg << base_shift) / sa) + ((sg * d1a + dg * s1a + base_mask) >> base_shift)); p[Order::B] = (value_type)((sbda + dbsa >= sada) ? (sada + sb * d1a + db * s1a + base_mask) >> base_shift : dbsa / (base_mask - (sb << base_shift) / sa) + ((sb * d1a + db * s1a + base_mask) >> base_shift)); p[Order::A] = (value_type)(sa + da - ((sa * da + base_mask) >> base_shift)); } } }; //=====================================================comp_op_rgba_color_burn template<class ColorT, class Order> struct comp_op_rgba_color_burn { typedef ColorT color_type; typedef Order order_type; typedef typename color_type::value_type value_type; typedef typename color_type::calc_type calc_type; typedef typename color_type::long_type long_type; enum base_scale_e { base_shift = color_type::base_shift, base_mask = color_type::base_mask }; // if Sca.Da + Dca.Sa <= Sa.Da // Dca' = Sca.(1 - Da) + Dca.(1 - Sa) // otherwise // Dca' = Sa.(Sca.Da + Dca.Sa - Sa.Da)/Sca + Sca.(1 - Da) + Dca.(1 - Sa) // // Da' = Sa + Da - Sa.Da static AGG_INLINE void blend_pix(value_type* p, unsigned sr, unsigned sg, unsigned sb, unsigned sa, unsigned cover) { if(cover < 255) { sr = (sr * cover + 255) >> 8; sg = (sg * cover + 255) >> 8; sb = (sb * cover + 255) >> 8; sa = (sa * cover + 255) >> 8; } if(sa) { calc_type d1a = base_mask - p[Order::A]; calc_type s1a = base_mask - sa; calc_type dr = p[Order::R]; calc_type dg = p[Order::G]; calc_type db = p[Order::B]; calc_type da = p[Order::A]; long_type drsa = dr * sa; long_type dgsa = dg * sa; long_type dbsa = db * sa; long_type srda = sr * da; long_type sgda = sg * da; long_type sbda = sb * da; long_type sada = sa * da; p[Order::R] = (value_type)(((srda + drsa <= sada) ? sr * d1a + dr * s1a : sa * (srda + drsa - sada) / sr + sr * d1a + dr * s1a + base_mask) >> base_shift); p[Order::G] = (value_type)(((sgda + dgsa <= sada) ? sg * d1a + dg * s1a : sa * (sgda + dgsa - sada) / sg + sg * d1a + dg * s1a + base_mask) >> base_shift); p[Order::B] = (value_type)(((sbda + dbsa <= sada) ? sb * d1a + db * s1a : sa * (sbda + dbsa - sada) / sb + sb * d1a + db * s1a + base_mask) >> base_shift); p[Order::A] = (value_type)(sa + da - ((sa * da + base_mask) >> base_shift)); } } }; //=====================================================comp_op_rgba_hard_light template<class ColorT, class Order> struct comp_op_rgba_hard_light { typedef ColorT color_type; typedef Order order_type; typedef typename color_type::value_type value_type; typedef typename color_type::calc_type calc_type; typedef typename color_type::long_type long_type; enum base_scale_e { base_shift = color_type::base_shift, base_mask = color_type::base_mask }; // if 2.Sca < Sa // Dca' = 2.Sca.Dca + Sca.(1 - Da) + Dca.(1 - Sa) // otherwise // Dca' = Sa.Da - 2.(Da - Dca).(Sa - Sca) + Sca.(1 - Da) + Dca.(1 - Sa) // // Da' = Sa + Da - Sa.Da static AGG_INLINE void blend_pix(value_type* p, unsigned sr, unsigned sg, unsigned sb, unsigned sa, unsigned cover) { if(cover < 255) { sr = (sr * cover + 255) >> 8; sg = (sg * cover + 255) >> 8; sb = (sb * cover + 255) >> 8; sa = (sa * cover + 255) >> 8; } if(sa) { calc_type d1a = base_mask - p[Order::A]; calc_type s1a = base_mask - sa; calc_type dr = p[Order::R]; calc_type dg = p[Order::G]; calc_type db = p[Order::B]; calc_type da = p[Order::A]; calc_type sada = sa * da; p[Order::R] = (value_type)(((2*sr < sa) ? 2*sr*dr + sr*d1a + dr*s1a : sada - 2*(da - dr)*(sa - sr) + sr*d1a + dr*s1a + base_mask) >> base_shift); p[Order::G] = (value_type)(((2*sg < sa) ? 2*sg*dg + sg*d1a + dg*s1a : sada - 2*(da - dg)*(sa - sg) + sg*d1a + dg*s1a + base_mask) >> base_shift); p[Order::B] = (value_type)(((2*sb < sa) ? 2*sb*db + sb*d1a + db*s1a : sada - 2*(da - db)*(sa - sb) + sb*d1a + db*s1a + base_mask) >> base_shift); p[Order::A] = (value_type)(sa + da - ((sa * da + base_mask) >> base_shift)); } } }; //=====================================================comp_op_rgba_soft_light template<class ColorT, class Order> struct comp_op_rgba_soft_light { typedef ColorT color_type; typedef Order order_type; typedef typename color_type::value_type value_type; typedef typename color_type::calc_type calc_type; typedef typename color_type::long_type long_type; enum base_scale_e { base_shift = color_type::base_shift, base_mask = color_type::base_mask }; // if 2.Sca < Sa // Dca' = Dca.(Sa + (1 - Dca/Da).(2.Sca - Sa)) + Sca.(1 - Da) + Dca.(1 - Sa) // otherwise if 8.Dca <= Da // Dca' = Dca.(Sa + (1 - Dca/Da).(2.Sca - Sa).(3 - 8.Dca/Da)) + Sca.(1 - Da) + Dca.(1 - Sa) // otherwise // Dca' = (Dca.Sa + ((Dca/Da)^(0.5).Da - Dca).(2.Sca - Sa)) + Sca.(1 - Da) + Dca.(1 - Sa) // // Da' = Sa + Da - Sa.Da static AGG_INLINE void blend_pix(value_type* p, unsigned r, unsigned g, unsigned b, unsigned a, unsigned cover) { double sr = double(r * cover) / (base_mask * 255); double sg = double(g * cover) / (base_mask * 255); double sb = double(b * cover) / (base_mask * 255); double sa = double(a * cover) / (base_mask * 255); if(sa > 0) { double dr = double(p[Order::R]) / base_mask; double dg = double(p[Order::G]) / base_mask; double db = double(p[Order::B]) / base_mask; double da = double(p[Order::A] ? p[Order::A] : 1) / base_mask; if(cover < 255) { a = (a * cover + 255) >> 8; } if(2*sr < sa) dr = dr*(sa + (1 - dr/da)*(2*sr - sa)) + sr*(1 - da) + dr*(1 - sa); else if(8*dr <= da) dr = dr*(sa + (1 - dr/da)*(2*sr - sa)*(3 - 8*dr/da)) + sr*(1 - da) + dr*(1 - sa); else dr = (dr*sa + (sqrt(dr/da)*da - dr)*(2*sr - sa)) + sr*(1 - da) + dr*(1 - sa); if(2*sg < sa) dg = dg*(sa + (1 - dg/da)*(2*sg - sa)) + sg*(1 - da) + dg*(1 - sa); else if(8*dg <= da) dg = dg*(sa + (1 - dg/da)*(2*sg - sa)*(3 - 8*dg/da)) + sg*(1 - da) + dg*(1 - sa); else dg = (dg*sa + (sqrt(dg/da)*da - dg)*(2*sg - sa)) + sg*(1 - da) + dg*(1 - sa); if(2*sb < sa) db = db*(sa + (1 - db/da)*(2*sb - sa)) + sb*(1 - da) + db*(1 - sa); else if(8*db <= da) db = db*(sa + (1 - db/da)*(2*sb - sa)*(3 - 8*db/da)) + sb*(1 - da) + db*(1 - sa); else db = (db*sa + (sqrt(db/da)*da - db)*(2*sb - sa)) + sb*(1 - da) + db*(1 - sa); p[Order::R] = (value_type)uround(dr * base_mask); p[Order::G] = (value_type)uround(dg * base_mask); p[Order::B] = (value_type)uround(db * base_mask); p[Order::A] = (value_type)(a + p[Order::A] - ((a * p[Order::A] + base_mask) >> base_shift)); } } }; //=====================================================comp_op_rgba_difference template<class ColorT, class Order> struct comp_op_rgba_difference { typedef ColorT color_type; typedef Order order_type; typedef typename color_type::value_type value_type; typedef typename color_type::calc_type calc_type; typedef typename color_type::long_type long_type; enum base_scale_e { base_shift = color_type::base_shift, base_scale = color_type::base_scale, base_mask = color_type::base_mask }; // Dca' = Sca + Dca - 2.min(Sca.Da, Dca.Sa) // Da' = Sa + Da - Sa.Da static AGG_INLINE void blend_pix(value_type* p, unsigned sr, unsigned sg, unsigned sb, unsigned sa, unsigned cover) { if(cover < 255) { sr = (sr * cover + 255) >> 8; sg = (sg * cover + 255) >> 8; sb = (sb * cover + 255) >> 8; sa = (sa * cover + 255) >> 8; } if(sa) { calc_type dr = p[Order::R]; calc_type dg = p[Order::G]; calc_type db = p[Order::B]; calc_type da = p[Order::A]; p[Order::R] = (value_type)(sr + dr - ((2 * sd_min(sr*da, dr*sa) + base_mask) >> base_shift)); p[Order::G] = (value_type)(sg + dg - ((2 * sd_min(sg*da, dg*sa) + base_mask) >> base_shift)); p[Order::B] = (value_type)(sb + db - ((2 * sd_min(sb*da, db*sa) + base_mask) >> base_shift)); p[Order::A] = (value_type)(sa + da - ((sa * da + base_mask) >> base_shift)); } } }; //=====================================================comp_op_rgba_exclusion template<class ColorT, class Order> struct comp_op_rgba_exclusion { typedef ColorT color_type; typedef Order order_type; typedef typename color_type::value_type value_type; typedef typename color_type::calc_type calc_type; typedef typename color_type::long_type long_type; enum base_scale_e { base_shift = color_type::base_shift, base_mask = color_type::base_mask }; // Dca' = (Sca.Da + Dca.Sa - 2.Sca.Dca) + Sca.(1 - Da) + Dca.(1 - Sa) // Da' = Sa + Da - Sa.Da static AGG_INLINE void blend_pix(value_type* p, unsigned sr, unsigned sg, unsigned sb, unsigned sa, unsigned cover) { if(cover < 255) { sr = (sr * cover + 255) >> 8; sg = (sg * cover + 255) >> 8; sb = (sb * cover + 255) >> 8; sa = (sa * cover + 255) >> 8; } if(sa) { calc_type d1a = base_mask - p[Order::A]; calc_type s1a = base_mask - sa; calc_type dr = p[Order::R]; calc_type dg = p[Order::G]; calc_type db = p[Order::B]; calc_type da = p[Order::A]; p[Order::R] = (value_type)((sr*da + dr*sa - 2*sr*dr + sr*d1a + dr*s1a + base_mask) >> base_shift); p[Order::G] = (value_type)((sg*da + dg*sa - 2*sg*dg + sg*d1a + dg*s1a + base_mask) >> base_shift); p[Order::B] = (value_type)((sb*da + db*sa - 2*sb*db + sb*d1a + db*s1a + base_mask) >> base_shift); p[Order::A] = (value_type)(sa + da - ((sa * da + base_mask) >> base_shift)); } } }; //=====================================================comp_op_rgba_contrast template<class ColorT, class Order> struct comp_op_rgba_contrast { typedef ColorT color_type; typedef Order order_type; typedef typename color_type::value_type value_type; typedef typename color_type::calc_type calc_type; typedef typename color_type::long_type long_type; enum base_scale_e { base_shift = color_type::base_shift, base_mask = color_type::base_mask }; static AGG_INLINE void blend_pix(value_type* p, unsigned sr, unsigned sg, unsigned sb, unsigned sa, unsigned cover) { if(cover < 255) { sr = (sr * cover + 255) >> 8; sg = (sg * cover + 255) >> 8; sb = (sb * cover + 255) >> 8; sa = (sa * cover + 255) >> 8; } long_type dr = p[Order::R]; long_type dg = p[Order::G]; long_type db = p[Order::B]; int da = p[Order::A]; long_type d2a = da >> 1; unsigned s2a = sa >> 1; int r = (int)((((dr - d2a) * int((sr - s2a)*2 + base_mask)) >> base_shift) + d2a); int g = (int)((((dg - d2a) * int((sg - s2a)*2 + base_mask)) >> base_shift) + d2a); int b = (int)((((db - d2a) * int((sb - s2a)*2 + base_mask)) >> base_shift) + d2a); r = (r < 0) ? 0 : r; g = (g < 0) ? 0 : g; b = (b < 0) ? 0 : b; p[Order::R] = (value_type)((r > da) ? da : r); p[Order::G] = (value_type)((g > da) ? da : g); p[Order::B] = (value_type)((b > da) ? da : b); } }; //=====================================================comp_op_rgba_invert template<class ColorT, class Order> struct comp_op_rgba_invert { typedef ColorT color_type; typedef Order order_type; typedef typename color_type::value_type value_type; typedef typename color_type::calc_type calc_type; typedef typename color_type::long_type long_type; enum base_scale_e { base_shift = color_type::base_shift, base_mask = color_type::base_mask }; // Dca' = (Da - Dca) * Sa + Dca.(1 - Sa) // Da' = Sa + Da - Sa.Da static AGG_INLINE void blend_pix(value_type* p, unsigned sr, unsigned sg, unsigned sb, unsigned sa, unsigned cover) { sa = (sa * cover + 255) >> 8; if(sa) { calc_type da = p[Order::A]; calc_type dr = ((da - p[Order::R]) * sa + base_mask) >> base_shift; calc_type dg = ((da - p[Order::G]) * sa + base_mask) >> base_shift; calc_type db = ((da - p[Order::B]) * sa + base_mask) >> base_shift; calc_type s1a = base_mask - sa; p[Order::R] = (value_type)(dr + ((p[Order::R] * s1a + base_mask) >> base_shift)); p[Order::G] = (value_type)(dg + ((p[Order::G] * s1a + base_mask) >> base_shift)); p[Order::B] = (value_type)(db + ((p[Order::B] * s1a + base_mask) >> base_shift)); p[Order::A] = (value_type)(sa + da - ((sa * da + base_mask) >> base_shift)); } } }; //=================================================comp_op_rgba_invert_rgb template<class ColorT, class Order> struct comp_op_rgba_invert_rgb { typedef ColorT color_type; typedef Order order_type; typedef typename color_type::value_type value_type; typedef typename color_type::calc_type calc_type; typedef typename color_type::long_type long_type; enum base_scale_e { base_shift = color_type::base_shift, base_mask = color_type::base_mask }; // Dca' = (Da - Dca) * Sca + Dca.(1 - Sa) // Da' = Sa + Da - Sa.Da static AGG_INLINE void blend_pix(value_type* p, unsigned sr, unsigned sg, unsigned sb, unsigned sa, unsigned cover) { if(cover < 255) { sr = (sr * cover + 255) >> 8; sg = (sg * cover + 255) >> 8; sb = (sb * cover + 255) >> 8; sa = (sa * cover + 255) >> 8; } if(sa) { calc_type da = p[Order::A]; calc_type dr = ((da - p[Order::R]) * sr + base_mask) >> base_shift; calc_type dg = ((da - p[Order::G]) * sg + base_mask) >> base_shift; calc_type db = ((da - p[Order::B]) * sb + base_mask) >> base_shift; calc_type s1a = base_mask - sa; p[Order::R] = (value_type)(dr + ((p[Order::R] * s1a + base_mask) >> base_shift)); p[Order::G] = (value_type)(dg + ((p[Order::G] * s1a + base_mask) >> base_shift)); p[Order::B] = (value_type)(db + ((p[Order::B] * s1a + base_mask) >> base_shift)); p[Order::A] = (value_type)(sa + da - ((sa * da + base_mask) >> base_shift)); } } }; //======================================================comp_op_table_rgba template<class ColorT, class Order> struct comp_op_table_rgba { typedef typename ColorT::value_type value_type; typedef void (*comp_op_func_type)(value_type* p, unsigned cr, unsigned cg, unsigned cb, unsigned ca, unsigned cover); static comp_op_func_type g_comp_op_func[]; }; //==========================================================g_comp_op_func template<class ColorT, class Order> typename comp_op_table_rgba<ColorT, Order>::comp_op_func_type comp_op_table_rgba<ColorT, Order>::g_comp_op_func[] = { comp_op_rgba_clear <ColorT,Order>::blend_pix, comp_op_rgba_src <ColorT,Order>::blend_pix, comp_op_rgba_dst <ColorT,Order>::blend_pix, comp_op_rgba_src_over <ColorT,Order>::blend_pix, comp_op_rgba_dst_over <ColorT,Order>::blend_pix, comp_op_rgba_src_in <ColorT,Order>::blend_pix, comp_op_rgba_dst_in <ColorT,Order>::blend_pix, comp_op_rgba_src_out <ColorT,Order>::blend_pix, comp_op_rgba_dst_out <ColorT,Order>::blend_pix, comp_op_rgba_src_atop <ColorT,Order>::blend_pix, comp_op_rgba_dst_atop <ColorT,Order>::blend_pix, comp_op_rgba_xor <ColorT,Order>::blend_pix, comp_op_rgba_plus <ColorT,Order>::blend_pix, comp_op_rgba_minus <ColorT,Order>::blend_pix, comp_op_rgba_multiply <ColorT,Order>::blend_pix, comp_op_rgba_screen <ColorT,Order>::blend_pix, comp_op_rgba_overlay <ColorT,Order>::blend_pix, comp_op_rgba_darken <ColorT,Order>::blend_pix, comp_op_rgba_lighten <ColorT,Order>::blend_pix, comp_op_rgba_color_dodge<ColorT,Order>::blend_pix, comp_op_rgba_color_burn <ColorT,Order>::blend_pix, comp_op_rgba_hard_light <ColorT,Order>::blend_pix, comp_op_rgba_soft_light <ColorT,Order>::blend_pix, comp_op_rgba_difference <ColorT,Order>::blend_pix, comp_op_rgba_exclusion <ColorT,Order>::blend_pix, comp_op_rgba_contrast <ColorT,Order>::blend_pix, comp_op_rgba_invert <ColorT,Order>::blend_pix, comp_op_rgba_invert_rgb <ColorT,Order>::blend_pix, 0 }; //==============================================================comp_op_e enum comp_op_e { comp_op_clear, //----comp_op_clear comp_op_src, //----comp_op_src comp_op_dst, //----comp_op_dst comp_op_src_over, //----comp_op_src_over comp_op_dst_over, //----comp_op_dst_over comp_op_src_in, //----comp_op_src_in comp_op_dst_in, //----comp_op_dst_in comp_op_src_out, //----comp_op_src_out comp_op_dst_out, //----comp_op_dst_out comp_op_src_atop, //----comp_op_src_atop comp_op_dst_atop, //----comp_op_dst_atop comp_op_xor, //----comp_op_xor comp_op_plus, //----comp_op_plus comp_op_minus, //----comp_op_minus comp_op_multiply, //----comp_op_multiply comp_op_screen, //----comp_op_screen comp_op_overlay, //----comp_op_overlay comp_op_darken, //----comp_op_darken comp_op_lighten, //----comp_op_lighten comp_op_color_dodge, //----comp_op_color_dodge comp_op_color_burn, //----comp_op_color_burn comp_op_hard_light, //----comp_op_hard_light comp_op_soft_light, //----comp_op_soft_light comp_op_difference, //----comp_op_difference comp_op_exclusion, //----comp_op_exclusion comp_op_contrast, //----comp_op_contrast comp_op_invert, //----comp_op_invert comp_op_invert_rgb, //----comp_op_invert_rgb end_of_comp_op_e }; //====================================================comp_op_adaptor_rgba template<class ColorT, class Order> struct comp_op_adaptor_rgba { typedef Order order_type; typedef ColorT color_type; typedef typename color_type::value_type value_type; enum base_scale_e { base_shift = color_type::base_shift, base_mask = color_type::base_mask }; static AGG_INLINE void blend_pix(unsigned op, value_type* p, unsigned cr, unsigned cg, unsigned cb, unsigned ca, unsigned cover) { comp_op_table_rgba<ColorT, Order>::g_comp_op_func[op] (p, (cr * ca + base_mask) >> base_shift, (cg * ca + base_mask) >> base_shift, (cb * ca + base_mask) >> base_shift, ca, cover); } }; //=========================================comp_op_adaptor_clip_to_dst_rgba template<class ColorT, class Order> struct comp_op_adaptor_clip_to_dst_rgba { typedef Order order_type; typedef ColorT color_type; typedef typename color_type::value_type value_type; enum base_scale_e { base_shift = color_type::base_shift, base_mask = color_type::base_mask }; static AGG_INLINE void blend_pix(unsigned op, value_type* p, unsigned cr, unsigned cg, unsigned cb, unsigned ca, unsigned cover) { cr = (cr * ca + base_mask) >> base_shift; cg = (cg * ca + base_mask) >> base_shift; cb = (cb * ca + base_mask) >> base_shift; unsigned da = p[Order::A]; comp_op_table_rgba<ColorT, Order>::g_comp_op_func[op] (p, (cr * da + base_mask) >> base_shift, (cg * da + base_mask) >> base_shift, (cb * da + base_mask) >> base_shift, (ca * da + base_mask) >> base_shift, cover); } }; //================================================comp_op_adaptor_rgba_pre template<class ColorT, class Order> struct comp_op_adaptor_rgba_pre { typedef Order order_type; typedef ColorT color_type; typedef typename color_type::value_type value_type; enum base_scale_e { base_shift = color_type::base_shift, base_mask = color_type::base_mask }; static AGG_INLINE void blend_pix(unsigned op, value_type* p, unsigned cr, unsigned cg, unsigned cb, unsigned ca, unsigned cover) { comp_op_table_rgba<ColorT, Order>::g_comp_op_func[op](p, cr, cg, cb, ca, cover); } }; //=====================================comp_op_adaptor_clip_to_dst_rgba_pre template<class ColorT, class Order> struct comp_op_adaptor_clip_to_dst_rgba_pre { typedef Order order_type; typedef ColorT color_type; typedef typename color_type::value_type value_type; enum base_scale_e { base_shift = color_type::base_shift, base_mask = color_type::base_mask }; static AGG_INLINE void blend_pix(unsigned op, value_type* p, unsigned cr, unsigned cg, unsigned cb, unsigned ca, unsigned cover) { unsigned da = p[Order::A]; comp_op_table_rgba<ColorT, Order>::g_comp_op_func[op] (p, (cr * da + base_mask) >> base_shift, (cg * da + base_mask) >> base_shift, (cb * da + base_mask) >> base_shift, (ca * da + base_mask) >> base_shift, cover); } }; //=======================================================comp_adaptor_rgba template<class BlenderPre> struct comp_adaptor_rgba { typedef typename BlenderPre::order_type order_type; typedef typename BlenderPre::color_type color_type; typedef typename color_type::value_type value_type; enum base_scale_e { base_shift = color_type::base_shift, base_mask = color_type::base_mask }; static AGG_INLINE void blend_pix(unsigned op, value_type* p, unsigned cr, unsigned cg, unsigned cb, unsigned ca, unsigned cover) { BlenderPre::blend_pix(p, (cr * ca + base_mask) >> base_shift, (cg * ca + base_mask) >> base_shift, (cb * ca + base_mask) >> base_shift, ca, cover); } }; //==========================================comp_adaptor_clip_to_dst_rgba template<class BlenderPre> struct comp_adaptor_clip_to_dst_rgba { typedef typename BlenderPre::order_type order_type; typedef typename BlenderPre::color_type color_type; typedef typename color_type::value_type value_type; enum base_scale_e { base_shift = color_type::base_shift, base_mask = color_type::base_mask }; static AGG_INLINE void blend_pix(unsigned op, value_type* p, unsigned cr, unsigned cg, unsigned cb, unsigned ca, unsigned cover) { cr = (cr * ca + base_mask) >> base_shift; cg = (cg * ca + base_mask) >> base_shift; cb = (cb * ca + base_mask) >> base_shift; unsigned da = p[order_type::A]; BlenderPre::blend_pix(p, (cr * da + base_mask) >> base_shift, (cg * da + base_mask) >> base_shift, (cb * da + base_mask) >> base_shift, (ca * da + base_mask) >> base_shift, cover); } }; //======================================comp_adaptor_clip_to_dst_rgba_pre template<class BlenderPre> struct comp_adaptor_clip_to_dst_rgba_pre { typedef typename BlenderPre::order_type order_type; typedef typename BlenderPre::color_type color_type; typedef typename color_type::value_type value_type; enum base_scale_e { base_shift = color_type::base_shift, base_mask = color_type::base_mask }; static AGG_INLINE void blend_pix(unsigned op, value_type* p, unsigned cr, unsigned cg, unsigned cb, unsigned ca, unsigned cover) { unsigned da = p[order_type::A]; BlenderPre::blend_pix(p, (cr * da + base_mask) >> base_shift, (cg * da + base_mask) >> base_shift, (cb * da + base_mask) >> base_shift, (ca * da + base_mask) >> base_shift, cover); } }; //===============================================copy_or_blend_rgba_wrapper template<class Blender> struct copy_or_blend_rgba_wrapper { typedef typename Blender::color_type color_type; typedef typename Blender::order_type order_type; typedef typename color_type::value_type value_type; typedef typename color_type::calc_type calc_type; enum base_scale_e { base_shift = color_type::base_shift, base_scale = color_type::base_scale, base_mask = color_type::base_mask }; //-------------------------------------------------------------------- static AGG_INLINE void copy_or_blend_pix(value_type* p, unsigned cr, unsigned cg, unsigned cb, unsigned alpha) { if(alpha) { if(alpha == base_mask) { p[order_type::R] = cr; p[order_type::G] = cg; p[order_type::B] = cb; p[order_type::A] = base_mask; } else { Blender::blend_pix(p, cr, cg, cb, alpha); } } } //-------------------------------------------------------------------- static AGG_INLINE void copy_or_blend_pix(value_type* p, unsigned cr, unsigned cg, unsigned cb, unsigned alpha, unsigned cover) { if(cover == 255) { copy_or_blend_pix(p, cr, cg, cb, alpha); } else { if(alpha) { alpha = (alpha * (cover + 1)) >> 8; if(alpha == base_mask) { p[order_type::R] = cr; p[order_type::G] = cg; p[order_type::B] = cb; p[order_type::A] = base_mask; } else { Blender::blend_pix(p, cr, cg, cb, alpha, cover); } } } } }; //=================================================pixfmt_alpha_blend_rgba template<class Blender, class RenBuf, class PixelT = int32u> class pixfmt_alpha_blend_rgba { public: typedef RenBuf rbuf_type; typedef typename rbuf_type::row_data row_data; typedef PixelT pixel_type; typedef Blender blender_type; typedef typename blender_type::color_type color_type; typedef typename blender_type::order_type order_type; typedef typename color_type::value_type value_type; typedef typename color_type::calc_type calc_type; typedef copy_or_blend_rgba_wrapper<blender_type> cob_type; enum base_scale_e { base_shift = color_type::base_shift, base_scale = color_type::base_scale, base_mask = color_type::base_mask, pix_width = sizeof(pixel_type) }; //-------------------------------------------------------------------- pixfmt_alpha_blend_rgba() : m_rbuf(0) {} explicit pixfmt_alpha_blend_rgba(rbuf_type& rb) : m_rbuf(&rb) {} void attach(rbuf_type& rb) { m_rbuf = &rb; } //-------------------------------------------------------------------- template<class PixFmt> bool attach(PixFmt& pixf, int x1, int y1, int x2, int y2) { rect_i r(x1, y1, x2, y2); if(r.clip(rect_i(0, 0, pixf.width()-1, pixf.height()-1))) { int stride = pixf.stride(); m_rbuf->attach(pixf.pix_ptr(r.x1, stride < 0 ? r.y2 : r.y1), (r.x2 - r.x1) + 1, (r.y2 - r.y1) + 1, stride); return true; } return false; } //-------------------------------------------------------------------- AGG_INLINE unsigned width() const { return m_rbuf->width(); } AGG_INLINE unsigned height() const { return m_rbuf->height(); } AGG_INLINE int stride() const { return m_rbuf->stride(); } //-------------------------------------------------------------------- AGG_INLINE int8u* row_ptr(int y) { return m_rbuf->row_ptr(y); } AGG_INLINE const int8u* row_ptr(int y) const { return m_rbuf->row_ptr(y); } AGG_INLINE row_data row(int y) const { return m_rbuf->row(y); } //-------------------------------------------------------------------- AGG_INLINE int8u* pix_ptr(int x, int y) { return m_rbuf->row_ptr(y) + x * pix_width; } AGG_INLINE const int8u* pix_ptr(int x, int y) const { return m_rbuf->row_ptr(y) + x * pix_width; } //-------------------------------------------------------------------- AGG_INLINE static void make_pix(int8u* p, const color_type& c) { ((value_type*)p)[order_type::R] = c.r; ((value_type*)p)[order_type::G] = c.g; ((value_type*)p)[order_type::B] = c.b; ((value_type*)p)[order_type::A] = c.a; } //-------------------------------------------------------------------- AGG_INLINE color_type pixel(int x, int y) const { const value_type* p = (const value_type*)m_rbuf->row_ptr(y); if(p) { p += x << 2; return color_type(p[order_type::R], p[order_type::G], p[order_type::B], p[order_type::A]); } return color_type::no_color(); } //-------------------------------------------------------------------- AGG_INLINE void copy_pixel(int x, int y, const color_type& c) { value_type* p = (value_type*)m_rbuf->row_ptr(x, y, 1) + (x << 2); p[order_type::R] = c.r; p[order_type::G] = c.g; p[order_type::B] = c.b; p[order_type::A] = c.a; } //-------------------------------------------------------------------- AGG_INLINE void blend_pixel(int x, int y, const color_type& c, int8u cover) { cob_type::copy_or_blend_pix( (value_type*)m_rbuf->row_ptr(x, y, 1) + (x << 2), c.r, c.g, c.b, c.a, cover); } //-------------------------------------------------------------------- AGG_INLINE void copy_hline(int x, int y, unsigned len, const color_type& c) { value_type* p = (value_type*)m_rbuf->row_ptr(x, y, len) + (x << 2); pixel_type v; ((value_type*)&v)[order_type::R] = c.r; ((value_type*)&v)[order_type::G] = c.g; ((value_type*)&v)[order_type::B] = c.b; ((value_type*)&v)[order_type::A] = c.a; do { *(pixel_type*)p = v; p += 4; } while(--len); } //-------------------------------------------------------------------- AGG_INLINE void copy_vline(int x, int y, unsigned len, const color_type& c) { pixel_type v; ((value_type*)&v)[order_type::R] = c.r; ((value_type*)&v)[order_type::G] = c.g; ((value_type*)&v)[order_type::B] = c.b; ((value_type*)&v)[order_type::A] = c.a; do { value_type* p = (value_type*)m_rbuf->row_ptr(x, y++, 1) + (x << 2); *(pixel_type*)p = v; } while(--len); } //-------------------------------------------------------------------- void blend_hline(int x, int y, unsigned len, const color_type& c, int8u cover) { if (c.a) { value_type* p = (value_type*)m_rbuf->row_ptr(x, y, len) + (x << 2); calc_type alpha = (calc_type(c.a) * (cover + 1)) >> 8; if(alpha == base_mask) { pixel_type v; ((value_type*)&v)[order_type::R] = c.r; ((value_type*)&v)[order_type::G] = c.g; ((value_type*)&v)[order_type::B] = c.b; ((value_type*)&v)[order_type::A] = c.a; do { *(pixel_type*)p = v; p += 4; } while(--len); } else { if(cover == 255) { do { blender_type::blend_pix(p, c.r, c.g, c.b, alpha); p += 4; } while(--len); } else { do { blender_type::blend_pix(p, c.r, c.g, c.b, alpha, cover); p += 4; } while(--len); } } } } //-------------------------------------------------------------------- void blend_vline(int x, int y, unsigned len, const color_type& c, int8u cover) { if (c.a) { value_type* p; calc_type alpha = (calc_type(c.a) * (cover + 1)) >> 8; if(alpha == base_mask) { pixel_type v; ((value_type*)&v)[order_type::R] = c.r; ((value_type*)&v)[order_type::G] = c.g; ((value_type*)&v)[order_type::B] = c.b; ((value_type*)&v)[order_type::A] = c.a; do { p = (value_type*)m_rbuf->row_ptr(x, y++, 1) + (x << 2); *(pixel_type*)p = v; } while(--len); } else { if(cover == 255) { do { p = (value_type*)m_rbuf->row_ptr(x, y++, 1) + (x << 2); blender_type::blend_pix(p, c.r, c.g, c.b, alpha); } while(--len); } else { do { p = (value_type*)m_rbuf->row_ptr(x, y++, 1) + (x << 2); blender_type::blend_pix(p, c.r, c.g, c.b, alpha, cover); } while(--len); } } } } //-------------------------------------------------------------------- void blend_solid_hspan(int x, int y, unsigned len, const color_type& c, const int8u* covers) { if (c.a) { value_type* p = (value_type*)m_rbuf->row_ptr(x, y, len) + (x << 2); do { calc_type alpha = (calc_type(c.a) * (calc_type(*covers) + 1)) >> 8; if(alpha == base_mask) { p[order_type::R] = c.r; p[order_type::G] = c.g; p[order_type::B] = c.b; p[order_type::A] = base_mask; } else { blender_type::blend_pix(p, c.r, c.g, c.b, alpha, *covers); } p += 4; ++covers; } while(--len); } } //-------------------------------------------------------------------- void blend_solid_vspan(int x, int y, unsigned len, const color_type& c, const int8u* covers) { if (c.a) { do { value_type* p = (value_type*)m_rbuf->row_ptr(x, y++, 1) + (x << 2); calc_type alpha = (calc_type(c.a) * (calc_type(*covers) + 1)) >> 8; if(alpha == base_mask) { p[order_type::R] = c.r; p[order_type::G] = c.g; p[order_type::B] = c.b; p[order_type::A] = base_mask; } else { blender_type::blend_pix(p, c.r, c.g, c.b, alpha, *covers); } ++covers; } while(--len); } } //-------------------------------------------------------------------- void copy_color_hspan(int x, int y, unsigned len, const color_type* colors) { value_type* p = (value_type*)m_rbuf->row_ptr(x, y, len) + (x << 2); do { p[order_type::R] = colors->r; p[order_type::G] = colors->g; p[order_type::B] = colors->b; p[order_type::A] = colors->a; ++colors; p += 4; } while(--len); } //-------------------------------------------------------------------- void copy_color_vspan(int x, int y, unsigned len, const color_type* colors) { do { value_type* p = (value_type*)m_rbuf->row_ptr(x, y++, 1) + (x << 2); p[order_type::R] = colors->r; p[order_type::G] = colors->g; p[order_type::B] = colors->b; p[order_type::A] = colors->a; ++colors; } while(--len); } //-------------------------------------------------------------------- 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->row_ptr(x, y, len) + (x << 2); if(covers) { do { cob_type::copy_or_blend_pix(p, colors->r, colors->g, colors->b, colors->a, *covers++); p += 4; ++colors; } while(--len); } else { if(cover == 255) { do { cob_type::copy_or_blend_pix(p, colors->r, colors->g, colors->b, colors->a); p += 4; ++colors; } while(--len); } else { do { cob_type::copy_or_blend_pix(p, colors->r, colors->g, colors->b, colors->a, cover); p += 4; ++colors; } while(--len); } } } //-------------------------------------------------------------------- void blend_color_vspan(int x, int y, unsigned len, const color_type* colors, const int8u* covers, int8u cover) { value_type* p; if(covers) { do { p = (value_type*)m_rbuf->row_ptr(x, y++, 1) + (x << 2); cob_type::copy_or_blend_pix(p, colors->r, colors->g, colors->b, colors->a, *covers++); ++colors; } while(--len); } else { if(cover == 255) { do { p = (value_type*)m_rbuf->row_ptr(x, y++, 1) + (x << 2); cob_type::copy_or_blend_pix(p, colors->r, colors->g, colors->b, colors->a); ++colors; } while(--len); } else { do { p = (value_type*)m_rbuf->row_ptr(x, y++, 1) + (x << 2); cob_type::copy_or_blend_pix(p, colors->r, colors->g, colors->b, colors->a, cover); ++colors; } while(--len); } } } //-------------------------------------------------------------------- template<class Function> void for_each_pixel(Function f) { unsigned y; for(y = 0; y < height(); ++y) { row_data r = m_rbuf->row(y); if(r.ptr) { unsigned len = r.x2 - r.x1 + 1; value_type* p = (value_type*)m_rbuf->row_ptr(r.x1, y, len) + (r.x1 << 2); do { f(p); p += 4; } while(--len); } } } //-------------------------------------------------------------------- void premultiply() { for_each_pixel(multiplier_rgba<color_type, order_type>::premultiply); } //-------------------------------------------------------------------- void demultiply() { for_each_pixel(multiplier_rgba<color_type, order_type>::demultiply); } //-------------------------------------------------------------------- template<class GammaLut> void apply_gamma_dir(const GammaLut& g) { for_each_pixel(apply_gamma_dir_rgba<color_type, order_type, GammaLut>(g)); } //-------------------------------------------------------------------- template<class GammaLut> void apply_gamma_inv(const GammaLut& g) { for_each_pixel(apply_gamma_inv_rgba<color_type, order_type, GammaLut>(g)); } //-------------------------------------------------------------------- template<class RenBuf2> void copy_from(const RenBuf2& from, int xdst, int ydst, int xsrc, int ysrc, unsigned len) { const int8u* p = from.row_ptr(ysrc); if(p) { memmove(m_rbuf->row_ptr(xdst, ydst, len) + xdst * pix_width, p + xsrc * pix_width, len * pix_width); } } //-------------------------------------------------------------------- template<class SrcPixelFormatRenderer> void blend_from(const SrcPixelFormatRenderer& from, int xdst, int ydst, int xsrc, int ysrc, unsigned len, int8u cover) { typedef typename SrcPixelFormatRenderer::order_type src_order; const value_type* psrc = (value_type*)from.row_ptr(ysrc); if(psrc) { psrc += xsrc << 2; value_type* pdst = (value_type*)m_rbuf->row_ptr(xdst, ydst, len) + (xdst << 2); int incp = 4; if(xdst > xsrc) { psrc += (len-1) << 2; pdst += (len-1) << 2; incp = -4; } if(cover == 255) { do { cob_type::copy_or_blend_pix(pdst, psrc[src_order::R], psrc[src_order::G], psrc[src_order::B], psrc[src_order::A]); psrc += incp; pdst += incp; } while(--len); } else { do { cob_type::copy_or_blend_pix(pdst, psrc[src_order::R], psrc[src_order::G], psrc[src_order::B], psrc[src_order::A], cover); psrc += incp; pdst += incp; } while(--len); } } } //-------------------------------------------------------------------- template<class SrcPixelFormatRenderer> void blend_from_color(const SrcPixelFormatRenderer& from, const color_type& color, int xdst, int ydst, int xsrc, int ysrc, unsigned len, int8u cover) { typedef typename SrcPixelFormatRenderer::value_type src_value_type; const src_value_type* psrc = (src_value_type*)from.row_ptr(ysrc); if(psrc) { value_type* pdst = (value_type*)m_rbuf->row_ptr(xdst, ydst, len) + (xdst << 2); do { cob_type::copy_or_blend_pix(pdst, color.r, color.g, color.b, color.a, (*psrc * cover + base_mask) >> base_shift); ++psrc; pdst += 4; } while(--len); } } //-------------------------------------------------------------------- template<class SrcPixelFormatRenderer> void blend_from_lut(const SrcPixelFormatRenderer& from, const color_type* color_lut, int xdst, int ydst, int xsrc, int ysrc, unsigned len, int8u cover) { typedef typename SrcPixelFormatRenderer::value_type src_value_type; const src_value_type* psrc = (src_value_type*)from.row_ptr(ysrc); if(psrc) { value_type* pdst = (value_type*)m_rbuf->row_ptr(xdst, ydst, len) + (xdst << 2); if(cover == 255) { do { const color_type& color = color_lut[*psrc]; cob_type::copy_or_blend_pix(pdst, color.r, color.g, color.b, color.a); ++psrc; pdst += 4; } while(--len); } else { do { const color_type& color = color_lut[*psrc]; cob_type::copy_or_blend_pix(pdst, color.r, color.g, color.b, color.a, cover); ++psrc; pdst += 4; } while(--len); } } } private: rbuf_type* m_rbuf; }; //================================================pixfmt_custom_blend_rgba template<class Blender, class RenBuf> class pixfmt_custom_blend_rgba { public: typedef RenBuf rbuf_type; typedef typename rbuf_type::row_data row_data; typedef Blender blender_type; typedef typename blender_type::color_type color_type; typedef typename blender_type::order_type order_type; typedef typename color_type::value_type value_type; typedef typename color_type::calc_type calc_type; enum base_scale_e { base_shift = color_type::base_shift, base_scale = color_type::base_scale, base_mask = color_type::base_mask, pix_width = sizeof(value_type) * 4 }; //-------------------------------------------------------------------- pixfmt_custom_blend_rgba() : m_rbuf(0), m_comp_op(3) {} explicit pixfmt_custom_blend_rgba(rbuf_type& rb, unsigned comp_op=3) : m_rbuf(&rb), m_comp_op(comp_op) {} void attach(rbuf_type& rb) { m_rbuf = &rb; } //-------------------------------------------------------------------- template<class PixFmt> bool attach(PixFmt& pixf, int x1, int y1, int x2, int y2) { rect_i r(x1, y1, x2, y2); if(r.clip(rect_i(0, 0, pixf.width()-1, pixf.height()-1))) { int stride = pixf.stride(); m_rbuf->attach(pixf.pix_ptr(r.x1, stride < 0 ? r.y2 : r.y1), (r.x2 - r.x1) + 1, (r.y2 - r.y1) + 1, stride); return true; } return false; } //-------------------------------------------------------------------- AGG_INLINE unsigned width() const { return m_rbuf->width(); } AGG_INLINE unsigned height() const { return m_rbuf->height(); } AGG_INLINE int stride() const { return m_rbuf->stride(); } //-------------------------------------------------------------------- AGG_INLINE int8u* row_ptr(int y) { return m_rbuf->row_ptr(y); } AGG_INLINE const int8u* row_ptr(int y) const { return m_rbuf->row_ptr(y); } AGG_INLINE row_data row(int y) const { return m_rbuf->row(y); } //-------------------------------------------------------------------- AGG_INLINE int8u* pix_ptr(int x, int y) { return m_rbuf->row_ptr(y) + x * pix_width; } AGG_INLINE const int8u* pix_ptr(int x, int y) const { return m_rbuf->row_ptr(y) + x * pix_width; } //-------------------------------------------------------------------- void comp_op(unsigned op) { m_comp_op = op; } unsigned comp_op() const { return m_comp_op; } //-------------------------------------------------------------------- AGG_INLINE static void make_pix(int8u* p, const color_type& c) { ((value_type*)p)[order_type::R] = c.r; ((value_type*)p)[order_type::G] = c.g; ((value_type*)p)[order_type::B] = c.b; ((value_type*)p)[order_type::A] = c.a; } //-------------------------------------------------------------------- color_type pixel(int x, int y) const { const value_type* p = (value_type*)m_rbuf->row_ptr(y) + (x << 2); return color_type(p[order_type::R], p[order_type::G], p[order_type::B], p[order_type::A]); } //-------------------------------------------------------------------- void copy_pixel(int x, int y, const color_type& c) { blender_type::blend_pix( m_comp_op, (value_type*)m_rbuf->row_ptr(x, y, 1) + (x << 2), c.r, c.g, c.b, c.a, 255); } //-------------------------------------------------------------------- void blend_pixel(int x, int y, const color_type& c, int8u cover) { blender_type::blend_pix( m_comp_op, (value_type*)m_rbuf->row_ptr(x, y, 1) + (x << 2), c.r, c.g, c.b, c.a, cover); } //-------------------------------------------------------------------- void copy_hline(int x, int y, unsigned len, const color_type& c) { value_type* p = (value_type*)m_rbuf->row_ptr(x, y, len) + (x << 2);; do { blender_type::blend_pix(m_comp_op, p, c.r, c.g, c.b, c.a, 255); p += 4; } while(--len); } //-------------------------------------------------------------------- void copy_vline(int x, int y, unsigned len, const color_type& c) { do { blender_type::blend_pix( m_comp_op, (value_type*)m_rbuf->row_ptr(x, y++, 1) + (x << 2), c.r, c.g, c.b, c.a, 255); } while(--len); } //-------------------------------------------------------------------- void blend_hline(int x, int y, unsigned len, const color_type& c, int8u cover) { value_type* p = (value_type*)m_rbuf->row_ptr(x, y, len) + (x << 2); do { blender_type::blend_pix(m_comp_op, p, c.r, c.g, c.b, c.a, cover); p += 4; } while(--len); } //-------------------------------------------------------------------- void blend_vline(int x, int y, unsigned len, const color_type& c, int8u cover) { do { blender_type::blend_pix( m_comp_op, (value_type*)m_rbuf->row_ptr(x, y++, 1) + (x << 2), c.r, c.g, c.b, c.a, cover); } while(--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->row_ptr(x, y, len) + (x << 2); do { blender_type::blend_pix(m_comp_op, p, c.r, c.g, c.b, c.a, *covers++); p += 4; } while(--len); } //-------------------------------------------------------------------- void blend_solid_vspan(int x, int y, unsigned len, const color_type& c, const int8u* covers) { do { blender_type::blend_pix( m_comp_op, (value_type*)m_rbuf->row_ptr(x, y++, 1) + (x << 2), c.r, c.g, c.b, c.a, *covers++); } while(--len); } //-------------------------------------------------------------------- void copy_color_hspan(int x, int y, unsigned len, const color_type* colors) { value_type* p = (value_type*)m_rbuf->row_ptr(x, y, len) + (x << 2); do { p[order_type::R] = colors->r; p[order_type::G] = colors->g; p[order_type::B] = colors->b; p[order_type::A] = colors->a; ++colors; p += 4; } while(--len); } //-------------------------------------------------------------------- void copy_color_vspan(int x, int y, unsigned len, const color_type* colors) { do { value_type* p = (value_type*)m_rbuf->row_ptr(x, y++, 1) + (x << 2); p[order_type::R] = colors->r; p[order_type::G] = colors->g; p[order_type::B] = colors->b; p[order_type::A] = colors->a; ++colors; } while(--len); } //-------------------------------------------------------------------- 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->row_ptr(x, y, len) + (x << 2); do { blender_type::blend_pix(m_comp_op, p, colors->r, colors->g, colors->b, colors->a, covers ? *covers++ : cover); p += 4; ++colors; } while(--len); } //-------------------------------------------------------------------- void blend_color_vspan(int x, int y, unsigned len, const color_type* colors, const int8u* covers, int8u cover) { do { blender_type::blend_pix( m_comp_op, (value_type*)m_rbuf->row_ptr(x, y++, 1) + (x << 2), colors->r, colors->g, colors->b, colors->a, covers ? *covers++ : cover); ++colors; } while(--len); } //-------------------------------------------------------------------- template<class Function> void for_each_pixel(Function f) { unsigned y; for(y = 0; y < height(); ++y) { row_data r = m_rbuf->row(y); if(r.ptr) { unsigned len = r.x2 - r.x1 + 1; value_type* p = (value_type*)m_rbuf->row_ptr(r.x1, y, len) + (r.x1 << 2); do { f(p); p += 4; } while(--len); } } } //-------------------------------------------------------------------- void premultiply() { for_each_pixel(multiplier_rgba<color_type, order_type>::premultiply); } //-------------------------------------------------------------------- void demultiply() { for_each_pixel(multiplier_rgba<color_type, order_type>::demultiply); } //-------------------------------------------------------------------- template<class GammaLut> void apply_gamma_dir(const GammaLut& g) { for_each_pixel(apply_gamma_dir_rgba<color_type, order_type, GammaLut>(g)); } //-------------------------------------------------------------------- template<class GammaLut> void apply_gamma_inv(const GammaLut& g) { for_each_pixel(apply_gamma_inv_rgba<color_type, order_type, GammaLut>(g)); } //-------------------------------------------------------------------- template<class RenBuf2> void copy_from(const RenBuf2& from, int xdst, int ydst, int xsrc, int ysrc, unsigned len) { const int8u* p = from.row_ptr(ysrc); if(p) { memmove(m_rbuf->row_ptr(xdst, ydst, len) + xdst * pix_width, p + xsrc * pix_width, len * pix_width); } } //-------------------------------------------------------------------- template<class SrcPixelFormatRenderer> void blend_from(const SrcPixelFormatRenderer& from, int xdst, int ydst, int xsrc, int ysrc, unsigned len, int8u cover) { typedef typename SrcPixelFormatRenderer::order_type src_order; const value_type* psrc = (const value_type*)from.row_ptr(ysrc); if(psrc) { psrc += xsrc << 2; value_type* pdst = (value_type*)m_rbuf->row_ptr(xdst, ydst, len) + (xdst << 2); int incp = 4; if(xdst > xsrc) { psrc += (len-1) << 2; pdst += (len-1) << 2; incp = -4; } do { blender_type::blend_pix(m_comp_op, pdst, psrc[src_order::R], psrc[src_order::G], psrc[src_order::B], psrc[src_order::A], cover); psrc += incp; pdst += incp; } while(--len); } } //-------------------------------------------------------------------- template<class SrcPixelFormatRenderer> void blend_from_color(const SrcPixelFormatRenderer& from, const color_type& color, int xdst, int ydst, int xsrc, int ysrc, unsigned len, int8u cover) { typedef typename SrcPixelFormatRenderer::value_type src_value_type; const src_value_type* psrc = (src_value_type*)from.row_ptr(ysrc); if(psrc) { value_type* pdst = (value_type*)m_rbuf->row_ptr(xdst, ydst, len) + (xdst << 2); do { blender_type::blend_pix(m_comp_op, pdst, color.r, color.g, color.b, color.a, (*psrc * cover + base_mask) >> base_shift); ++psrc; pdst += 4; } while(--len); } } //-------------------------------------------------------------------- template<class SrcPixelFormatRenderer> void blend_from_lut(const SrcPixelFormatRenderer& from, const color_type* color_lut, int xdst, int ydst, int xsrc, int ysrc, unsigned len, int8u cover) { typedef typename SrcPixelFormatRenderer::value_type src_value_type; const src_value_type* psrc = (src_value_type*)from.row_ptr(ysrc); if(psrc) { value_type* pdst = (value_type*)m_rbuf->row_ptr(xdst, ydst, len) + (xdst << 2); do { const color_type& color = color_lut[*psrc]; blender_type::blend_pix(m_comp_op, pdst, color.r, color.g, color.b, color.a, cover); ++psrc; pdst += 4; } while(--len); } } private: rbuf_type* m_rbuf; unsigned m_comp_op; }; //----------------------------------------------------------------------- typedef blender_rgba<rgba8, order_rgba> blender_rgba32; //----blender_rgba32 typedef blender_rgba<rgba8, order_argb> blender_argb32; //----blender_argb32 typedef blender_rgba<rgba8, order_abgr> blender_abgr32; //----blender_abgr32 typedef blender_rgba<rgba8, order_bgra> blender_bgra32; //----blender_bgra32 typedef blender_rgba_pre<rgba8, order_rgba> blender_rgba32_pre; //----blender_rgba32_pre typedef blender_rgba_pre<rgba8, order_argb> blender_argb32_pre; //----blender_argb32_pre typedef blender_rgba_pre<rgba8, order_abgr> blender_abgr32_pre; //----blender_abgr32_pre typedef blender_rgba_pre<rgba8, order_bgra> blender_bgra32_pre; //----blender_bgra32_pre typedef blender_rgba_plain<rgba8, order_rgba> blender_rgba32_plain; //----blender_rgba32_plain typedef blender_rgba_plain<rgba8, order_argb> blender_argb32_plain; //----blender_argb32_plain typedef blender_rgba_plain<rgba8, order_abgr> blender_abgr32_plain; //----blender_abgr32_plain typedef blender_rgba_plain<rgba8, order_bgra> blender_bgra32_plain; //----blender_bgra32_plain typedef blender_rgba<rgba16, order_rgba> blender_rgba64; //----blender_rgba64 typedef blender_rgba<rgba16, order_argb> blender_argb64; //----blender_argb64 typedef blender_rgba<rgba16, order_abgr> blender_abgr64; //----blender_abgr64 typedef blender_rgba<rgba16, order_bgra> blender_bgra64; //----blender_bgra64 typedef blender_rgba_pre<rgba16, order_rgba> blender_rgba64_pre; //----blender_rgba64_pre typedef blender_rgba_pre<rgba16, order_argb> blender_argb64_pre; //----blender_argb64_pre typedef blender_rgba_pre<rgba16, order_abgr> blender_abgr64_pre; //----blender_abgr64_pre typedef blender_rgba_pre<rgba16, order_bgra> blender_bgra64_pre; //----blender_bgra64_pre //----------------------------------------------------------------------- typedef int32u pixel32_type; typedef pixfmt_alpha_blend_rgba<blender_rgba32, rendering_buffer, pixel32_type> pixfmt_rgba32; //----pixfmt_rgba32 typedef pixfmt_alpha_blend_rgba<blender_argb32, rendering_buffer, pixel32_type> pixfmt_argb32; //----pixfmt_argb32 typedef pixfmt_alpha_blend_rgba<blender_abgr32, rendering_buffer, pixel32_type> pixfmt_abgr32; //----pixfmt_abgr32 typedef pixfmt_alpha_blend_rgba<blender_bgra32, rendering_buffer, pixel32_type> pixfmt_bgra32; //----pixfmt_bgra32 typedef pixfmt_alpha_blend_rgba<blender_rgba32_pre, rendering_buffer, pixel32_type> pixfmt_rgba32_pre; //----pixfmt_rgba32_pre typedef pixfmt_alpha_blend_rgba<blender_argb32_pre, rendering_buffer, pixel32_type> pixfmt_argb32_pre; //----pixfmt_argb32_pre typedef pixfmt_alpha_blend_rgba<blender_abgr32_pre, rendering_buffer, pixel32_type> pixfmt_abgr32_pre; //----pixfmt_abgr32_pre typedef pixfmt_alpha_blend_rgba<blender_bgra32_pre, rendering_buffer, pixel32_type> pixfmt_bgra32_pre; //----pixfmt_bgra32_pre typedef pixfmt_alpha_blend_rgba<blender_rgba32_plain, rendering_buffer, pixel32_type> pixfmt_rgba32_plain; //----pixfmt_rgba32_plain typedef pixfmt_alpha_blend_rgba<blender_argb32_plain, rendering_buffer, pixel32_type> pixfmt_argb32_plain; //----pixfmt_argb32_plain typedef pixfmt_alpha_blend_rgba<blender_abgr32_plain, rendering_buffer, pixel32_type> pixfmt_abgr32_plain; //----pixfmt_abgr32_plain typedef pixfmt_alpha_blend_rgba<blender_bgra32_plain, rendering_buffer, pixel32_type> pixfmt_bgra32_plain; //----pixfmt_bgra32_plain struct pixel64_type { int16u c[4]; }; typedef pixfmt_alpha_blend_rgba<blender_rgba64, rendering_buffer, pixel64_type> pixfmt_rgba64; //----pixfmt_rgba64 typedef pixfmt_alpha_blend_rgba<blender_argb64, rendering_buffer, pixel64_type> pixfmt_argb64; //----pixfmt_argb64 typedef pixfmt_alpha_blend_rgba<blender_abgr64, rendering_buffer, pixel64_type> pixfmt_abgr64; //----pixfmt_abgr64 typedef pixfmt_alpha_blend_rgba<blender_bgra64, rendering_buffer, pixel64_type> pixfmt_bgra64; //----pixfmt_bgra64 typedef pixfmt_alpha_blend_rgba<blender_rgba64_pre, rendering_buffer, pixel64_type> pixfmt_rgba64_pre; //----pixfmt_rgba64_pre typedef pixfmt_alpha_blend_rgba<blender_argb64_pre, rendering_buffer, pixel64_type> pixfmt_argb64_pre; //----pixfmt_argb64_pre typedef pixfmt_alpha_blend_rgba<blender_abgr64_pre, rendering_buffer, pixel64_type> pixfmt_abgr64_pre; //----pixfmt_abgr64_pre typedef pixfmt_alpha_blend_rgba<blender_bgra64_pre, rendering_buffer, pixel64_type> pixfmt_bgra64_pre; //----pixfmt_bgra64_pre } #endif �������������������������������agg-2.5+dfsg1/include/agg_pixfmt_transposer.h�������������������������������������������������������0000644�0000000�0000000�00000014662�10703246330�021470� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_PIXFMT_TRANSPOSER_INCLUDED #define AGG_PIXFMT_TRANSPOSER_INCLUDED #include "agg_basics.h" namespace agg { //=======================================================pixfmt_transposer template<class PixFmt> class pixfmt_transposer { public: typedef PixFmt pixfmt_type; typedef typename pixfmt_type::color_type color_type; typedef typename pixfmt_type::row_data row_data; typedef typename color_type::value_type value_type; typedef typename color_type::calc_type calc_type; //-------------------------------------------------------------------- pixfmt_transposer() : m_pixf(0) {} explicit pixfmt_transposer(pixfmt_type& pixf) : m_pixf(&pixf) {} void attach(pixfmt_type& pixf) { m_pixf = &pixf; } //-------------------------------------------------------------------- AGG_INLINE unsigned width() const { return m_pixf->height(); } AGG_INLINE unsigned height() const { return m_pixf->width(); } //-------------------------------------------------------------------- AGG_INLINE color_type pixel(int x, int y) const { return m_pixf->pixel(y, x); } //-------------------------------------------------------------------- AGG_INLINE void copy_pixel(int x, int y, const color_type& c) { m_pixf->copy_pixel(y, x, c); } //-------------------------------------------------------------------- AGG_INLINE void blend_pixel(int x, int y, const color_type& c, int8u cover) { m_pixf->blend_pixel(y, x, c, cover); } //-------------------------------------------------------------------- AGG_INLINE void copy_hline(int x, int y, unsigned len, const color_type& c) { m_pixf->copy_vline(y, x, len, c); } //-------------------------------------------------------------------- AGG_INLINE void copy_vline(int x, int y, unsigned len, const color_type& c) { m_pixf->copy_hline(y, x, len, c); } //-------------------------------------------------------------------- AGG_INLINE void blend_hline(int x, int y, unsigned len, const color_type& c, int8u cover) { m_pixf->blend_vline(y, x, len, c, cover); } //-------------------------------------------------------------------- AGG_INLINE void blend_vline(int x, int y, unsigned len, const color_type& c, int8u cover) { m_pixf->blend_hline(y, x, len, c, cover); } //-------------------------------------------------------------------- AGG_INLINE void blend_solid_hspan(int x, int y, unsigned len, const color_type& c, const int8u* covers) { m_pixf->blend_solid_vspan(y, x, len, c, covers); } //-------------------------------------------------------------------- AGG_INLINE void blend_solid_vspan(int x, int y, unsigned len, const color_type& c, const int8u* covers) { m_pixf->blend_solid_hspan(y, x, len, c, covers); } //-------------------------------------------------------------------- AGG_INLINE void copy_color_hspan(int x, int y, unsigned len, const color_type* colors) { m_pixf->copy_color_vspan(y, x, len, colors); } //-------------------------------------------------------------------- AGG_INLINE void copy_color_vspan(int x, int y, unsigned len, const color_type* colors) { m_pixf->copy_color_hspan(y, x, len, colors); } //-------------------------------------------------------------------- AGG_INLINE void blend_color_hspan(int x, int y, unsigned len, const color_type* colors, const int8u* covers, int8u cover) { m_pixf->blend_color_vspan(y, x, len, colors, covers, cover); } //-------------------------------------------------------------------- AGG_INLINE void blend_color_vspan(int x, int y, unsigned len, const color_type* colors, const int8u* covers, int8u cover) { m_pixf->blend_color_hspan(y, x, len, colors, covers, cover); } private: pixfmt_type* m_pixf; }; } #endif ������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_rasterizer_cells_aa.h�����������������������������������������������������0000644�0000000�0000000�00000052400�10703246330�021706� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- // // 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. // //---------------------------------------------------------------------------- // // Adaptation for 32-bit screen coordinates 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_RASTERIZER_CELLS_AA_INCLUDED #define AGG_RASTERIZER_CELLS_AA_INCLUDED #include <string.h> #include <math.h> #include "agg_math.h" #include "agg_array.h" namespace agg { //-----------------------------------------------------rasterizer_cells_aa // An internal class that implements the main rasterization algorithm. // Used in the rasterizer. Should not be used direcly. template<class Cell> class rasterizer_cells_aa { enum cell_block_scale_e { cell_block_shift = 12, cell_block_size = 1 << cell_block_shift, cell_block_mask = cell_block_size - 1, cell_block_pool = 256, cell_block_limit = 1024 }; struct sorted_y { unsigned start; unsigned num; }; public: typedef Cell cell_type; typedef rasterizer_cells_aa<Cell> self_type; ~rasterizer_cells_aa(); rasterizer_cells_aa(); void reset(); void style(const cell_type& style_cell); void line(int x1, int y1, int x2, int y2); int min_x() const { return m_min_x; } int min_y() const { return m_min_y; } int max_x() const { return m_max_x; } int max_y() const { return m_max_y; } void sort_cells(); unsigned total_cells() const { return m_num_cells; } unsigned scanline_num_cells(unsigned y) const { return m_sorted_y[y - m_min_y].num; } const cell_type* const* scanline_cells(unsigned y) const { return m_sorted_cells.data() + m_sorted_y[y - m_min_y].start; } bool sorted() const { return m_sorted; } private: rasterizer_cells_aa(const self_type&); const self_type& operator = (const self_type&); void set_curr_cell(int x, int y); void add_curr_cell(); void render_hline(int ey, int x1, int y1, int x2, int y2); void allocate_block(); private: unsigned m_num_blocks; unsigned m_max_blocks; unsigned m_curr_block; unsigned m_num_cells; cell_type** m_cells; cell_type* m_curr_cell_ptr; pod_vector<cell_type*> m_sorted_cells; pod_vector<sorted_y> m_sorted_y; cell_type m_curr_cell; cell_type m_style_cell; int m_min_x; int m_min_y; int m_max_x; int m_max_y; bool m_sorted; }; //------------------------------------------------------------------------ template<class Cell> rasterizer_cells_aa<Cell>::~rasterizer_cells_aa() { if(m_num_blocks) { cell_type** ptr = m_cells + m_num_blocks - 1; while(m_num_blocks--) { pod_allocator<cell_type>::deallocate(*ptr, cell_block_size); ptr--; } pod_allocator<cell_type*>::deallocate(m_cells, m_max_blocks); } } //------------------------------------------------------------------------ template<class Cell> rasterizer_cells_aa<Cell>::rasterizer_cells_aa() : m_num_blocks(0), m_max_blocks(0), m_curr_block(0), m_num_cells(0), m_cells(0), m_curr_cell_ptr(0), m_sorted_cells(), m_sorted_y(), m_min_x(0x7FFFFFFF), m_min_y(0x7FFFFFFF), m_max_x(-0x7FFFFFFF), m_max_y(-0x7FFFFFFF), m_sorted(false) { m_style_cell.initial(); m_curr_cell.initial(); } //------------------------------------------------------------------------ template<class Cell> void rasterizer_cells_aa<Cell>::reset() { m_num_cells = 0; m_curr_block = 0; m_curr_cell.initial(); m_style_cell.initial(); m_sorted = false; m_min_x = 0x7FFFFFFF; m_min_y = 0x7FFFFFFF; m_max_x = -0x7FFFFFFF; m_max_y = -0x7FFFFFFF; } //------------------------------------------------------------------------ template<class Cell> AGG_INLINE void rasterizer_cells_aa<Cell>::add_curr_cell() { if(m_curr_cell.area | m_curr_cell.cover) { if((m_num_cells & cell_block_mask) == 0) { if(m_num_blocks >= cell_block_limit) return; allocate_block(); } *m_curr_cell_ptr++ = m_curr_cell; ++m_num_cells; } } //------------------------------------------------------------------------ template<class Cell> AGG_INLINE void rasterizer_cells_aa<Cell>::set_curr_cell(int x, int y) { if(m_curr_cell.not_equal(x, y, m_style_cell)) { add_curr_cell(); m_curr_cell.style(m_style_cell); m_curr_cell.x = x; m_curr_cell.y = y; m_curr_cell.cover = 0; m_curr_cell.area = 0; } } //------------------------------------------------------------------------ template<class Cell> AGG_INLINE void rasterizer_cells_aa<Cell>::render_hline(int ey, int x1, int y1, int x2, int y2) { int ex1 = x1 >> poly_subpixel_shift; int ex2 = x2 >> poly_subpixel_shift; int fx1 = x1 & poly_subpixel_mask; int fx2 = x2 & poly_subpixel_mask; int delta, p, first, dx; int incr, lift, mod, rem; //trivial case. Happens often if(y1 == y2) { set_curr_cell(ex2, ey); return; } //everything is located in a single cell. That is easy! if(ex1 == ex2) { delta = y2 - y1; m_curr_cell.cover += delta; m_curr_cell.area += (fx1 + fx2) * delta; return; } //ok, we'll have to render a run of adjacent cells on the same //hline... p = (poly_subpixel_scale - fx1) * (y2 - y1); first = poly_subpixel_scale; incr = 1; dx = x2 - x1; if(dx < 0) { p = fx1 * (y2 - y1); first = 0; incr = -1; dx = -dx; } delta = p / dx; mod = p % dx; if(mod < 0) { delta--; mod += dx; } m_curr_cell.cover += delta; m_curr_cell.area += (fx1 + first) * delta; ex1 += incr; set_curr_cell(ex1, ey); y1 += delta; if(ex1 != ex2) { p = poly_subpixel_scale * (y2 - y1 + delta); lift = p / dx; rem = p % dx; if (rem < 0) { lift--; rem += dx; } mod -= dx; while (ex1 != ex2) { delta = lift; mod += rem; if(mod >= 0) { mod -= dx; delta++; } m_curr_cell.cover += delta; m_curr_cell.area += poly_subpixel_scale * delta; y1 += delta; ex1 += incr; set_curr_cell(ex1, ey); } } delta = y2 - y1; m_curr_cell.cover += delta; m_curr_cell.area += (fx2 + poly_subpixel_scale - first) * delta; } //------------------------------------------------------------------------ template<class Cell> AGG_INLINE void rasterizer_cells_aa<Cell>::style(const cell_type& style_cell) { m_style_cell.style(style_cell); } //------------------------------------------------------------------------ template<class Cell> void rasterizer_cells_aa<Cell>::line(int x1, int y1, int x2, int y2) { enum dx_limit_e { dx_limit = 16384 << poly_subpixel_shift }; int dx = x2 - x1; if(dx >= dx_limit || dx <= -dx_limit) { int cx = (x1 + x2) >> 1; int cy = (y1 + y2) >> 1; line(x1, y1, cx, cy); line(cx, cy, x2, y2); } int dy = y2 - y1; int ex1 = x1 >> poly_subpixel_shift; int ex2 = x2 >> poly_subpixel_shift; int ey1 = y1 >> poly_subpixel_shift; int ey2 = y2 >> poly_subpixel_shift; int fy1 = y1 & poly_subpixel_mask; int fy2 = y2 & poly_subpixel_mask; int x_from, x_to; int p, rem, mod, lift, delta, first, incr; if(ex1 < m_min_x) m_min_x = ex1; if(ex1 > m_max_x) m_max_x = ex1; if(ey1 < m_min_y) m_min_y = ey1; if(ey1 > m_max_y) m_max_y = ey1; if(ex2 < m_min_x) m_min_x = ex2; if(ex2 > m_max_x) m_max_x = ex2; if(ey2 < m_min_y) m_min_y = ey2; if(ey2 > m_max_y) m_max_y = ey2; set_curr_cell(ex1, ey1); //everything is on a single hline if(ey1 == ey2) { render_hline(ey1, x1, fy1, x2, fy2); return; } //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 //cell, so, we don't have to call render_hline(). incr = 1; if(dx == 0) { int ex = x1 >> poly_subpixel_shift; int two_fx = (x1 - (ex << poly_subpixel_shift)) << 1; int area; first = poly_subpixel_scale; if(dy < 0) { first = 0; incr = -1; } x_from = x1; //render_hline(ey1, x_from, fy1, x_from, first); delta = first - fy1; m_curr_cell.cover += delta; m_curr_cell.area += two_fx * delta; ey1 += incr; set_curr_cell(ex, ey1); delta = first + first - poly_subpixel_scale; area = two_fx * delta; while(ey1 != ey2) { //render_hline(ey1, x_from, poly_subpixel_scale - first, x_from, first); m_curr_cell.cover = delta; m_curr_cell.area = area; ey1 += incr; set_curr_cell(ex, ey1); } //render_hline(ey1, x_from, poly_subpixel_scale - first, x_from, fy2); delta = fy2 - poly_subpixel_scale + first; m_curr_cell.cover += delta; m_curr_cell.area += two_fx * delta; return; } //ok, we have to render several hlines p = (poly_subpixel_scale - fy1) * dx; first = poly_subpixel_scale; if(dy < 0) { p = fy1 * dx; first = 0; incr = -1; dy = -dy; } delta = p / dy; mod = p % dy; if(mod < 0) { delta--; mod += dy; } x_from = x1 + delta; render_hline(ey1, x1, fy1, x_from, first); ey1 += incr; set_curr_cell(x_from >> poly_subpixel_shift, ey1); if(ey1 != ey2) { p = poly_subpixel_scale * dx; lift = p / dy; rem = p % dy; if(rem < 0) { lift--; rem += dy; } mod -= dy; while(ey1 != ey2) { delta = lift; mod += rem; if (mod >= 0) { mod -= dy; delta++; } x_to = x_from + delta; render_hline(ey1, x_from, poly_subpixel_scale - first, x_to, first); x_from = x_to; ey1 += incr; set_curr_cell(x_from >> poly_subpixel_shift, ey1); } } render_hline(ey1, x_from, poly_subpixel_scale - first, x2, fy2); } //------------------------------------------------------------------------ template<class Cell> void rasterizer_cells_aa<Cell>::allocate_block() { if(m_curr_block >= m_num_blocks) { if(m_num_blocks >= m_max_blocks) { cell_type** new_cells = pod_allocator<cell_type*>::allocate(m_max_blocks + cell_block_pool); if(m_cells) { memcpy(new_cells, m_cells, m_max_blocks * sizeof(cell_type*)); pod_allocator<cell_type*>::deallocate(m_cells, m_max_blocks); } m_cells = new_cells; m_max_blocks += cell_block_pool; } m_cells[m_num_blocks++] = pod_allocator<cell_type>::allocate(cell_block_size); } m_curr_cell_ptr = m_cells[m_curr_block++]; } //------------------------------------------------------------------------ template <class T> static AGG_INLINE void swap_cells(T* a, T* b) { T temp = *a; *a = *b; *b = temp; } //------------------------------------------------------------------------ enum { qsort_threshold = 9 }; //------------------------------------------------------------------------ template<class Cell> void qsort_cells(Cell** start, unsigned num) { Cell** stack[80]; Cell*** top; Cell** limit; Cell** base; limit = start + num; base = start; top = stack; for (;;) { int len = int(limit - base); Cell** i; Cell** j; Cell** pivot; if(len > qsort_threshold) { // we use base + len/2 as the pivot pivot = base + len / 2; swap_cells(base, pivot); i = base + 1; j = limit - 1; // now ensure that *i <= *base <= *j if((*j)->x < (*i)->x) { swap_cells(i, j); } if((*base)->x < (*i)->x) { swap_cells(base, i); } if((*j)->x < (*base)->x) { swap_cells(base, j); } for(;;) { int x = (*base)->x; do i++; while( (*i)->x < x ); do j--; while( x < (*j)->x ); if(i > j) { break; } swap_cells(i, j); } swap_cells(base, j); // now, push the largest sub-array if(j - base > limit - i) { top[0] = base; top[1] = j; base = i; } else { top[0] = i; top[1] = limit; limit = j; } top += 2; } else { // the sub-array is small, perform insertion sort j = base; i = j + 1; for(; i < limit; j = i, i++) { for(; j[1]->x < (*j)->x; j--) { swap_cells(j + 1, j); if (j == base) { break; } } } if(top > stack) { top -= 2; base = top[0]; limit = top[1]; } else { break; } } } } //------------------------------------------------------------------------ template<class Cell> void rasterizer_cells_aa<Cell>::sort_cells() { if(m_sorted) return; //Perform sort only the first time. add_curr_cell(); m_curr_cell.x = 0x7FFFFFFF; m_curr_cell.y = 0x7FFFFFFF; m_curr_cell.cover = 0; m_curr_cell.area = 0; if(m_num_cells == 0) return; // DBG: Check to see if min/max works well. //for(unsigned nc = 0; nc < m_num_cells; nc++) //{ // cell_type* cell = m_cells[nc >> cell_block_shift] + (nc & cell_block_mask); // if(cell->x < m_min_x || // cell->y < m_min_y || // cell->x > m_max_x || // cell->y > m_max_y) // { // cell = cell; // Breakpoint here // } //} // Allocate the array of cell pointers m_sorted_cells.allocate(m_num_cells, 16); // Allocate and zero the Y array m_sorted_y.allocate(m_max_y - m_min_y + 1, 16); m_sorted_y.zero(); // Create the Y-histogram (count the numbers of cells for each Y) cell_type** block_ptr = m_cells; cell_type* cell_ptr; unsigned nb = m_num_cells >> cell_block_shift; unsigned i; while(nb--) { cell_ptr = *block_ptr++; i = cell_block_size; while(i--) { m_sorted_y[cell_ptr->y - m_min_y].start++; ++cell_ptr; } } cell_ptr = *block_ptr++; i = m_num_cells & cell_block_mask; while(i--) { m_sorted_y[cell_ptr->y - m_min_y].start++; ++cell_ptr; } // Convert the Y-histogram into the array of starting indexes unsigned start = 0; for(i = 0; i < m_sorted_y.size(); i++) { unsigned v = m_sorted_y[i].start; m_sorted_y[i].start = start; start += v; } // Fill the cell pointer array sorted by Y block_ptr = m_cells; nb = m_num_cells >> cell_block_shift; while(nb--) { cell_ptr = *block_ptr++; i = cell_block_size; while(i--) { sorted_y& curr_y = m_sorted_y[cell_ptr->y - m_min_y]; m_sorted_cells[curr_y.start + curr_y.num] = cell_ptr; ++curr_y.num; ++cell_ptr; } } cell_ptr = *block_ptr++; i = m_num_cells & cell_block_mask; while(i--) { sorted_y& curr_y = m_sorted_y[cell_ptr->y - m_min_y]; m_sorted_cells[curr_y.start + curr_y.num] = cell_ptr; ++curr_y.num; ++cell_ptr; } // Finally arrange the X-arrays for(i = 0; i < m_sorted_y.size(); i++) { const sorted_y& curr_y = m_sorted_y[i]; if(curr_y.num) { qsort_cells(m_sorted_cells.data() + curr_y.start, curr_y.num); } } m_sorted = true; } //------------------------------------------------------scanline_hit_test class scanline_hit_test { public: scanline_hit_test(int x) : m_x(x), m_hit(false) {} void reset_spans() {} void finalize(int) {} void add_cell(int x, int) { if(m_x == x) m_hit = true; } void add_span(int x, int len, int) { if(m_x >= x && m_x < x+len) m_hit = true; } unsigned num_spans() const { return 1; } bool hit() const { return m_hit; } private: int m_x; bool m_hit; }; } #endif ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_rasterizer_compound_aa.h��������������������������������������������������0000644�0000000�0000000�00000055511�10703246330�022436� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry - Version 2.3 // Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com) // // Permission to copy, use, modify, sell and distribute this software // is granted provided this copyright notice appears in all copies. // This software is provided "as is" without express or implied // warranty, and with no claim as to its suitability for any purpose. // //---------------------------------------------------------------------------- // // 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. // //---------------------------------------------------------------------------- // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://www.antigrain.com //---------------------------------------------------------------------------- // // Adaptation for 32-bit screen coordinates 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_RASTERIZER_COMPOUND_AA_INCLUDED #define AGG_RASTERIZER_COMPOUND_AA_INCLUDED #include "agg_rasterizer_cells_aa.h" #include "agg_rasterizer_sl_clip.h" namespace agg { //-----------------------------------------------------------cell_style_aa // 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_style_aa { int x; int y; int cover; int area; int16 left, right; void initial() { x = 0x7FFFFFFF; y = 0x7FFFFFFF; cover = 0; area = 0; left = -1; right = -1; } void style(const cell_style_aa& c) { left = c.left; right = c.right; } int not_equal(int ex, int ey, const cell_style_aa& c) const { return (ex - x) | (ey - y) | (left - c.left) | (right - c.right); } }; //===========================================================layer_order_e enum layer_order_e { layer_unsorted, //------layer_unsorted layer_direct, //------layer_direct layer_inverse //------layer_inverse }; //==================================================rasterizer_compound_aa template<class Clip=rasterizer_sl_clip_int> class rasterizer_compound_aa { struct style_info { unsigned start_cell; unsigned num_cells; int last_x; }; struct cell_info { int x, area, cover; }; public: typedef Clip clip_type; typedef typename Clip::conv_type conv_type; typedef typename Clip::coord_type coord_type; enum aa_scale_e { aa_shift = 8, aa_scale = 1 << aa_shift, aa_mask = aa_scale - 1, aa_scale2 = aa_scale * 2, aa_mask2 = aa_scale2 - 1 }; //-------------------------------------------------------------------- rasterizer_compound_aa() : m_outline(), m_clipper(), m_filling_rule(fill_non_zero), m_layer_order(layer_direct), m_styles(), // Active Styles m_ast(), // Active Style Table (unique values) m_asm(), // Active Style Mask m_cells(), m_cover_buf(), m_master_alpha(), m_min_style(0x7FFFFFFF), m_max_style(-0x7FFFFFFF), m_start_x(0), m_start_y(0), m_scan_y(0x7FFFFFFF), m_sl_start(0), m_sl_len(0) {} //-------------------------------------------------------------------- void reset(); void reset_clipping(); void clip_box(double x1, double y1, double x2, double y2); void filling_rule(filling_rule_e filling_rule); void layer_order(layer_order_e order); void master_alpha(int style, double alpha); //-------------------------------------------------------------------- void styles(int left, int right); void move_to(int x, int y); void line_to(int x, int y); void move_to_d(double x, double y); void line_to_d(double x, double y); void add_vertex(double x, double y, unsigned cmd); void edge(int x1, int y1, int x2, int y2); void edge_d(double x1, double y1, double x2, double y2); //------------------------------------------------------------------- template<class VertexSource> void add_path(VertexSource& vs, unsigned path_id=0) { double x; double y; unsigned cmd; vs.rewind(path_id); if(m_outline.sorted()) reset(); while(!is_stop(cmd = vs.vertex(&x, &y))) { add_vertex(x, y, cmd); } } //-------------------------------------------------------------------- int min_x() const { return m_outline.min_x(); } int min_y() const { return m_outline.min_y(); } int max_x() const { return m_outline.max_x(); } int max_y() const { return m_outline.max_y(); } int min_style() const { return m_min_style; } int max_style() const { return m_max_style; } //-------------------------------------------------------------------- void sort(); bool rewind_scanlines(); unsigned sweep_styles(); int scanline_start() const { return m_sl_start; } unsigned scanline_length() const { return m_sl_len; } unsigned style(unsigned style_idx) const; cover_type* allocate_cover_buffer(unsigned len); //-------------------------------------------------------------------- bool navigate_scanline(int y); bool hit_test(int tx, int ty); //-------------------------------------------------------------------- AGG_INLINE unsigned calculate_alpha(int area, unsigned master_alpha) const { int cover = area >> (poly_subpixel_shift*2 + 1 - aa_shift); if(cover < 0) cover = -cover; if(m_filling_rule == fill_even_odd) { cover &= aa_mask2; if(cover > aa_scale) { cover = aa_scale2 - cover; } } if(cover > aa_mask) cover = aa_mask; return (cover * master_alpha + aa_mask) >> aa_shift; } //-------------------------------------------------------------------- // Sweeps one scanline with one style index. The style ID can be // determined by calling style(). template<class Scanline> bool sweep_scanline(Scanline& sl, int style_idx) { int scan_y = m_scan_y - 1; if(scan_y > m_outline.max_y()) return false; sl.reset_spans(); unsigned master_alpha = aa_mask; if(style_idx < 0) { style_idx = 0; } else { style_idx++; master_alpha = m_master_alpha[m_ast[style_idx] + m_min_style - 1]; } const style_info& st = m_styles[m_ast[style_idx]]; unsigned num_cells = st.num_cells; cell_info* cell = &m_cells[st.start_cell]; int cover = 0; while(num_cells--) { unsigned alpha; int x = cell->x; int area = cell->area; cover += cell->cover; ++cell; if(area) { alpha = calculate_alpha((cover << (poly_subpixel_shift + 1)) - area, master_alpha); sl.add_cell(x, alpha); x++; } if(num_cells && cell->x > x) { alpha = calculate_alpha(cover << (poly_subpixel_shift + 1), master_alpha); if(alpha) { sl.add_span(x, cell->x - x, alpha); } } } if(sl.num_spans() == 0) return false; sl.finalize(scan_y); return true; } private: void add_style(int style_id); void allocate_master_alpha(); //-------------------------------------------------------------------- // Disable copying rasterizer_compound_aa(const rasterizer_compound_aa<Clip>&); const rasterizer_compound_aa<Clip>& operator = (const rasterizer_compound_aa<Clip>&); private: rasterizer_cells_aa<cell_style_aa> m_outline; clip_type m_clipper; filling_rule_e m_filling_rule; layer_order_e m_layer_order; pod_vector<style_info> m_styles; // Active Styles pod_vector<unsigned> m_ast; // Active Style Table (unique values) pod_vector<int8u> m_asm; // Active Style Mask pod_vector<cell_info> m_cells; pod_vector<cover_type> m_cover_buf; pod_bvector<unsigned> m_master_alpha; int m_min_style; int m_max_style; coord_type m_start_x; coord_type m_start_y; int m_scan_y; int m_sl_start; unsigned m_sl_len; }; //------------------------------------------------------------------------ template<class Clip> void rasterizer_compound_aa<Clip>::reset() { m_outline.reset(); m_min_style = 0x7FFFFFFF; m_max_style = -0x7FFFFFFF; m_scan_y = 0x7FFFFFFF; m_sl_start = 0; m_sl_len = 0; } //------------------------------------------------------------------------ template<class Clip> void rasterizer_compound_aa<Clip>::filling_rule(filling_rule_e filling_rule) { m_filling_rule = filling_rule; } //------------------------------------------------------------------------ template<class Clip> void rasterizer_compound_aa<Clip>::layer_order(layer_order_e order) { m_layer_order = order; } //------------------------------------------------------------------------ template<class Clip> void rasterizer_compound_aa<Clip>::clip_box(double x1, double y1, double x2, double y2) { reset(); m_clipper.clip_box(conv_type::upscale(x1), conv_type::upscale(y1), conv_type::upscale(x2), conv_type::upscale(y2)); } //------------------------------------------------------------------------ template<class Clip> void rasterizer_compound_aa<Clip>::reset_clipping() { reset(); m_clipper.reset_clipping(); } //------------------------------------------------------------------------ template<class Clip> void rasterizer_compound_aa<Clip>::styles(int left, int right) { cell_style_aa cell; cell.initial(); cell.left = (int16)left; cell.right = (int16)right; m_outline.style(cell); if(left >= 0 && left < m_min_style) m_min_style = left; if(left >= 0 && left > m_max_style) m_max_style = left; if(right >= 0 && right < m_min_style) m_min_style = right; if(right >= 0 && right > m_max_style) m_max_style = right; } //------------------------------------------------------------------------ template<class Clip> void rasterizer_compound_aa<Clip>::move_to(int x, int y) { if(m_outline.sorted()) reset(); m_clipper.move_to(m_start_x = conv_type::downscale(x), m_start_y = conv_type::downscale(y)); } //------------------------------------------------------------------------ template<class Clip> void rasterizer_compound_aa<Clip>::line_to(int x, int y) { m_clipper.line_to(m_outline, conv_type::downscale(x), conv_type::downscale(y)); } //------------------------------------------------------------------------ template<class Clip> void rasterizer_compound_aa<Clip>::move_to_d(double x, double y) { if(m_outline.sorted()) reset(); m_clipper.move_to(m_start_x = conv_type::upscale(x), m_start_y = conv_type::upscale(y)); } //------------------------------------------------------------------------ template<class Clip> void rasterizer_compound_aa<Clip>::line_to_d(double x, double y) { m_clipper.line_to(m_outline, conv_type::upscale(x), conv_type::upscale(y)); } //------------------------------------------------------------------------ template<class Clip> void rasterizer_compound_aa<Clip>::add_vertex(double x, double y, unsigned cmd) { if(is_move_to(cmd)) { move_to_d(x, y); } else if(is_vertex(cmd)) { line_to_d(x, y); } else if(is_close(cmd)) { m_clipper.line_to(m_outline, m_start_x, m_start_y); } } //------------------------------------------------------------------------ template<class Clip> void rasterizer_compound_aa<Clip>::edge(int x1, int y1, int x2, int y2) { if(m_outline.sorted()) reset(); m_clipper.move_to(conv_type::downscale(x1), conv_type::downscale(y1)); m_clipper.line_to(m_outline, conv_type::downscale(x2), conv_type::downscale(y2)); } //------------------------------------------------------------------------ template<class Clip> void rasterizer_compound_aa<Clip>::edge_d(double x1, double y1, double x2, double y2) { if(m_outline.sorted()) reset(); m_clipper.move_to(conv_type::upscale(x1), conv_type::upscale(y1)); m_clipper.line_to(m_outline, conv_type::upscale(x2), conv_type::upscale(y2)); } //------------------------------------------------------------------------ template<class Clip> AGG_INLINE void rasterizer_compound_aa<Clip>::sort() { m_outline.sort_cells(); } //------------------------------------------------------------------------ template<class Clip> AGG_INLINE bool rasterizer_compound_aa<Clip>::rewind_scanlines() { m_outline.sort_cells(); if(m_outline.total_cells() == 0) { return false; } if(m_max_style < m_min_style) { return false; } m_scan_y = m_outline.min_y(); m_styles.allocate(m_max_style - m_min_style + 2, 128); allocate_master_alpha(); return true; } //------------------------------------------------------------------------ template<class Clip> AGG_INLINE void rasterizer_compound_aa<Clip>::add_style(int style_id) { if(style_id < 0) style_id = 0; else style_id -= m_min_style - 1; unsigned nbyte = style_id >> 3; unsigned mask = 1 << (style_id & 7); style_info* style = &m_styles[style_id]; if((m_asm[nbyte] & mask) == 0) { m_ast.add(style_id); m_asm[nbyte] |= mask; style->start_cell = 0; style->num_cells = 0; style->last_x = -0x7FFFFFFF; } ++style->start_cell; } //------------------------------------------------------------------------ // Returns the number of styles template<class Clip> unsigned rasterizer_compound_aa<Clip>::sweep_styles() { for(;;) { if(m_scan_y > m_outline.max_y()) return 0; unsigned num_cells = m_outline.scanline_num_cells(m_scan_y); const cell_style_aa* const* cells = m_outline.scanline_cells(m_scan_y); unsigned num_styles = m_max_style - m_min_style + 2; const cell_style_aa* curr_cell; unsigned style_id; style_info* style; cell_info* cell; m_cells.allocate(num_cells * 2, 256); // Each cell can have two styles m_ast.capacity(num_styles, 64); m_asm.allocate((num_styles + 7) >> 3, 8); m_asm.zero(); if(num_cells) { // Pre-add zero (for no-fill style, that is, -1). // We need that to ensure that the "-1 style" would go first. m_asm[0] |= 1; m_ast.add(0); style = &m_styles[0]; style->start_cell = 0; style->num_cells = 0; style->last_x = -0x7FFFFFFF; m_sl_start = cells[0]->x; m_sl_len = cells[num_cells-1]->x - m_sl_start + 1; while(num_cells--) { curr_cell = *cells++; add_style(curr_cell->left); add_style(curr_cell->right); } // Convert the Y-histogram into the array of starting indexes unsigned i; unsigned start_cell = 0; for(i = 0; i < m_ast.size(); i++) { style_info& st = m_styles[m_ast[i]]; unsigned v = st.start_cell; st.start_cell = start_cell; start_cell += v; } cells = m_outline.scanline_cells(m_scan_y); num_cells = m_outline.scanline_num_cells(m_scan_y); while(num_cells--) { curr_cell = *cells++; style_id = (curr_cell->left < 0) ? 0 : curr_cell->left - m_min_style + 1; style = &m_styles[style_id]; if(curr_cell->x == style->last_x) { cell = &m_cells[style->start_cell + style->num_cells - 1]; cell->area += curr_cell->area; cell->cover += curr_cell->cover; } else { cell = &m_cells[style->start_cell + style->num_cells]; cell->x = curr_cell->x; cell->area = curr_cell->area; cell->cover = curr_cell->cover; style->last_x = curr_cell->x; style->num_cells++; } style_id = (curr_cell->right < 0) ? 0 : curr_cell->right - m_min_style + 1; style = &m_styles[style_id]; if(curr_cell->x == style->last_x) { cell = &m_cells[style->start_cell + style->num_cells - 1]; cell->area -= curr_cell->area; cell->cover -= curr_cell->cover; } else { cell = &m_cells[style->start_cell + style->num_cells]; cell->x = curr_cell->x; cell->area = -curr_cell->area; cell->cover = -curr_cell->cover; style->last_x = curr_cell->x; style->num_cells++; } } } if(m_ast.size() > 1) break; ++m_scan_y; } ++m_scan_y; if(m_layer_order != layer_unsorted) { range_adaptor<pod_vector<unsigned> > ra(m_ast, 1, m_ast.size() - 1); if(m_layer_order == layer_direct) quick_sort(ra, unsigned_greater); else quick_sort(ra, unsigned_less); } return m_ast.size() - 1; } //------------------------------------------------------------------------ // Returns style ID depending of the existing style index template<class Clip> AGG_INLINE unsigned rasterizer_compound_aa<Clip>::style(unsigned style_idx) const { return m_ast[style_idx + 1] + m_min_style - 1; } //------------------------------------------------------------------------ template<class Clip> AGG_INLINE bool rasterizer_compound_aa<Clip>::navigate_scanline(int y) { m_outline.sort_cells(); if(m_outline.total_cells() == 0) { return false; } if(m_max_style < m_min_style) { return false; } if(y < m_outline.min_y() || y > m_outline.max_y()) { return false; } m_scan_y = y; m_styles.allocate(m_max_style - m_min_style + 2, 128); allocate_master_alpha(); return true; } //------------------------------------------------------------------------ template<class Clip> bool rasterizer_compound_aa<Clip>::hit_test(int tx, int ty) { if(!navigate_scanline(ty)) { return false; } unsigned num_styles = sweep_styles(); if(num_styles <= 0) { return false; } scanline_hit_test sl(tx); sweep_scanline(sl, -1); return sl.hit(); } //------------------------------------------------------------------------ template<class Clip> cover_type* rasterizer_compound_aa<Clip>::allocate_cover_buffer(unsigned len) { m_cover_buf.allocate(len, 256); return &m_cover_buf[0]; } //------------------------------------------------------------------------ template<class Clip> void rasterizer_compound_aa<Clip>::allocate_master_alpha() { while((int)m_master_alpha.size() <= m_max_style) { m_master_alpha.add(aa_mask); } } //------------------------------------------------------------------------ template<class Clip> void rasterizer_compound_aa<Clip>::master_alpha(int style, double alpha) { if(style >= 0) { while((int)m_master_alpha.size() <= style) { m_master_alpha.add(aa_mask); } m_master_alpha[style] = uround(alpha * aa_mask); } } } #endif ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_rasterizer_outline.h������������������������������������������������������0000644�0000000�0000000�00000011015�10703246330�021617� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_RASTERIZER_OUTLINE_INCLUDED #define AGG_RASTERIZER_OUTLINE_INCLUDED #include "agg_basics.h" namespace agg { //======================================================rasterizer_outline template<class Renderer> class rasterizer_outline { public: explicit rasterizer_outline(Renderer& ren) : m_ren(&ren), m_start_x(0), m_start_y(0), m_vertices(0) {} void attach(Renderer& ren) { m_ren = &ren; } //-------------------------------------------------------------------- void move_to(int x, int y) { m_vertices = 1; m_ren->move_to(m_start_x = x, m_start_y = y); } //-------------------------------------------------------------------- void line_to(int x, int y) { ++m_vertices; m_ren->line_to(x, y); } //-------------------------------------------------------------------- void move_to_d(double x, double y) { move_to(m_ren->coord(x), m_ren->coord(y)); } //-------------------------------------------------------------------- void line_to_d(double x, double y) { line_to(m_ren->coord(x), m_ren->coord(y)); } //-------------------------------------------------------------------- void close() { if(m_vertices > 2) { line_to(m_start_x, m_start_y); } m_vertices = 0; } //-------------------------------------------------------------------- void add_vertex(double x, double y, unsigned cmd) { if(is_move_to(cmd)) { move_to_d(x, y); } else { if(is_end_poly(cmd)) { if(is_closed(cmd)) close(); } else { line_to_d(x, y); } } } //-------------------------------------------------------------------- template<class VertexSource> void add_path(VertexSource& vs, unsigned path_id=0) { double x; double y; unsigned cmd; vs.rewind(path_id); while(!is_stop(cmd = vs.vertex(&x, &y))) { add_vertex(x, y, cmd); } } //-------------------------------------------------------------------- template<class VertexSource, class ColorStorage, class PathId> void render_all_paths(VertexSource& vs, const ColorStorage& colors, const PathId& path_id, unsigned num_paths) { for(unsigned i = 0; i < num_paths; i++) { m_ren->line_color(colors[i]); add_path(vs, path_id[i]); } } //-------------------------------------------------------------------- template<class Ctrl> void render_ctrl(Ctrl& c) { unsigned i; for(i = 0; i < c.num_paths(); i++) { m_ren->line_color(c.color(i)); add_path(c, i); } } private: Renderer* m_ren; int m_start_x; int m_start_y; unsigned m_vertices; }; } #endif �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_rasterizer_outline_aa.h���������������������������������������������������0000644�0000000�0000000�00000051141�10703246330�022264� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_RASTERIZER_OUTLINE_AA_INCLUDED #define AGG_RASTERIZER_OUTLINE_AA_INCLUDED #include "agg_basics.h" #include "agg_line_aa_basics.h" #include "agg_vertex_sequence.h" namespace agg { //------------------------------------------------------------------------- inline bool cmp_dist_start(int d) { return d > 0; } inline bool cmp_dist_end(int d) { return d <= 0; } //-----------------------------------------------------------line_aa_vertex // 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 { int x; int y; int len; line_aa_vertex() {} line_aa_vertex(int x_, int y_) : x(x_), y(y_), len(0) { } bool operator () (const line_aa_vertex& val) { double dx = val.x - x; double dy = val.y - y; return (len = uround(sqrt(dx * dx + dy * dy))) > (line_subpixel_scale + line_subpixel_scale / 2); } }; //----------------------------------------------------------outline_aa_join_e enum outline_aa_join_e { outline_no_join, //-----outline_no_join outline_miter_join, //-----outline_miter_join outline_round_join, //-----outline_round_join outline_miter_accurate_join //-----outline_accurate_join }; //=======================================================rasterizer_outline_aa template<class Renderer, class Coord=line_coord> class rasterizer_outline_aa { private: //------------------------------------------------------------------------ struct draw_vars { unsigned idx; int x1, y1, x2, y2; line_parameters curr, next; int lcurr, lnext; int xb1, yb1, xb2, yb2; unsigned flags; }; void draw(draw_vars& dv, unsigned start, unsigned end); public: typedef line_aa_vertex vertex_type; typedef vertex_sequence<vertex_type, 6> vertex_storage_type; explicit rasterizer_outline_aa(Renderer& ren) : m_ren(&ren), m_line_join(ren.accurate_join_only() ? outline_miter_accurate_join : outline_round_join), m_round_cap(false), m_start_x(0), m_start_y(0) {} void attach(Renderer& ren) { m_ren = &ren; } //------------------------------------------------------------------------ void line_join(outline_aa_join_e join) { m_line_join = m_ren->accurate_join_only() ? outline_miter_accurate_join : join; } bool line_join() const { return m_line_join; } //------------------------------------------------------------------------ void round_cap(bool v) { m_round_cap = v; } bool round_cap() const { return m_round_cap; } //------------------------------------------------------------------------ void move_to(int x, int y) { m_src_vertices.modify_last(vertex_type(m_start_x = x, m_start_y = y)); } //------------------------------------------------------------------------ void line_to(int x, int y) { m_src_vertices.add(vertex_type(x, y)); } //------------------------------------------------------------------------ void move_to_d(double x, double y) { move_to(Coord::conv(x), Coord::conv(y)); } //------------------------------------------------------------------------ void line_to_d(double x, double y) { line_to(Coord::conv(x), Coord::conv(y)); } //------------------------------------------------------------------------ void render(bool close_polygon); //------------------------------------------------------------------------ void add_vertex(double x, double y, unsigned cmd) { if(is_move_to(cmd)) { render(false); move_to_d(x, y); } else { if(is_end_poly(cmd)) { render(is_closed(cmd)); if(is_closed(cmd)) { move_to(m_start_x, m_start_y); } } else { line_to_d(x, y); } } } //------------------------------------------------------------------------ template<class VertexSource> void add_path(VertexSource& vs, unsigned path_id=0) { double x; double y; unsigned cmd; vs.rewind(path_id); while(!is_stop(cmd = vs.vertex(&x, &y))) { add_vertex(x, y, cmd); } render(false); } //------------------------------------------------------------------------ template<class VertexSource, class ColorStorage, class PathId> void render_all_paths(VertexSource& vs, const ColorStorage& colors, const PathId& path_id, unsigned num_paths) { for(unsigned i = 0; i < num_paths; i++) { m_ren->color(colors[i]); add_path(vs, path_id[i]); } } //------------------------------------------------------------------------ template<class Ctrl> void render_ctrl(Ctrl& c) { unsigned i; for(i = 0; i < c.num_paths(); i++) { m_ren->color(c.color(i)); add_path(c, i); } } private: rasterizer_outline_aa(const rasterizer_outline_aa<Renderer, Coord>&); const rasterizer_outline_aa<Renderer, Coord>& operator = (const rasterizer_outline_aa<Renderer, Coord>&); Renderer* m_ren; vertex_storage_type m_src_vertices; outline_aa_join_e m_line_join; bool m_round_cap; int m_start_x; int m_start_y; }; //---------------------------------------------------------------------------- template<class Renderer, class Coord> void rasterizer_outline_aa<Renderer, Coord>::draw(draw_vars& dv, unsigned start, unsigned end) { unsigned i; const vertex_storage_type::value_type* v; for(i = start; i < end; i++) { if(m_line_join == outline_round_join) { dv.xb1 = dv.curr.x1 + (dv.curr.y2 - dv.curr.y1); dv.yb1 = dv.curr.y1 - (dv.curr.x2 - dv.curr.x1); dv.xb2 = dv.curr.x2 + (dv.curr.y2 - dv.curr.y1); dv.yb2 = dv.curr.y2 - (dv.curr.x2 - dv.curr.x1); } switch(dv.flags) { case 0: m_ren->line3(dv.curr, dv.xb1, dv.yb1, dv.xb2, dv.yb2); break; case 1: m_ren->line2(dv.curr, dv.xb2, dv.yb2); break; case 2: m_ren->line1(dv.curr, dv.xb1, dv.yb1); break; case 3: m_ren->line0(dv.curr); break; } if(m_line_join == outline_round_join && (dv.flags & 2) == 0) { m_ren->pie(dv.curr.x2, dv.curr.y2, dv.curr.x2 + (dv.curr.y2 - dv.curr.y1), dv.curr.y2 - (dv.curr.x2 - dv.curr.x1), dv.curr.x2 + (dv.next.y2 - dv.next.y1), dv.curr.y2 - (dv.next.x2 - dv.next.x1)); } dv.x1 = dv.x2; dv.y1 = dv.y2; dv.lcurr = dv.lnext; dv.lnext = m_src_vertices[dv.idx].len; ++dv.idx; if(dv.idx >= m_src_vertices.size()) dv.idx = 0; v = &m_src_vertices[dv.idx]; dv.x2 = v->x; dv.y2 = v->y; dv.curr = dv.next; dv.next = line_parameters(dv.x1, dv.y1, dv.x2, dv.y2, dv.lnext); dv.xb1 = dv.xb2; dv.yb1 = dv.yb2; switch(m_line_join) { case outline_no_join: dv.flags = 3; break; case outline_miter_join: dv.flags >>= 1; dv.flags |= ((dv.curr.diagonal_quadrant() == dv.next.diagonal_quadrant()) << 1); if((dv.flags & 2) == 0) { bisectrix(dv.curr, dv.next, &dv.xb2, &dv.yb2); } break; case outline_round_join: dv.flags >>= 1; dv.flags |= ((dv.curr.diagonal_quadrant() == dv.next.diagonal_quadrant()) << 1); break; case outline_miter_accurate_join: dv.flags = 0; bisectrix(dv.curr, dv.next, &dv.xb2, &dv.yb2); break; } } } //---------------------------------------------------------------------------- template<class Renderer, class Coord> void rasterizer_outline_aa<Renderer, Coord>::render(bool close_polygon) { m_src_vertices.close(close_polygon); draw_vars dv; const vertex_storage_type::value_type* v; int x1; int y1; int x2; int y2; int lprev; if(close_polygon) { if(m_src_vertices.size() >= 3) { dv.idx = 2; v = &m_src_vertices[m_src_vertices.size() - 1]; x1 = v->x; y1 = v->y; lprev = v->len; v = &m_src_vertices[0]; x2 = v->x; y2 = v->y; dv.lcurr = v->len; line_parameters prev(x1, y1, x2, y2, lprev); v = &m_src_vertices[1]; dv.x1 = v->x; dv.y1 = v->y; dv.lnext = v->len; dv.curr = line_parameters(x2, y2, dv.x1, dv.y1, dv.lcurr); v = &m_src_vertices[dv.idx]; dv.x2 = v->x; dv.y2 = v->y; dv.next = line_parameters(dv.x1, dv.y1, dv.x2, dv.y2, dv.lnext); dv.xb1 = 0; dv.yb1 = 0; dv.xb2 = 0; dv.yb2 = 0; switch(m_line_join) { case outline_no_join: dv.flags = 3; break; case outline_miter_join: case outline_round_join: dv.flags = (prev.diagonal_quadrant() == dv.curr.diagonal_quadrant()) | ((dv.curr.diagonal_quadrant() == dv.next.diagonal_quadrant()) << 1); break; case outline_miter_accurate_join: dv.flags = 0; break; } if((dv.flags & 1) == 0 && m_line_join != outline_round_join) { bisectrix(prev, dv.curr, &dv.xb1, &dv.yb1); } if((dv.flags & 2) == 0 && m_line_join != outline_round_join) { bisectrix(dv.curr, dv.next, &dv.xb2, &dv.yb2); } draw(dv, 0, m_src_vertices.size()); } } else { switch(m_src_vertices.size()) { case 0: case 1: break; case 2: { v = &m_src_vertices[0]; x1 = v->x; y1 = v->y; lprev = v->len; v = &m_src_vertices[1]; x2 = v->x; y2 = v->y; line_parameters lp(x1, y1, x2, y2, lprev); 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), y1 - (x2 - x1), x2 + (y2 - y1), y2 - (x2 - x1)); if(m_round_cap) { m_ren->semidot(cmp_dist_end, x2, y2, x2 + (y2 - y1), y2 - (x2 - x1)); } } break; case 3: { int x3, y3; int lnext; v = &m_src_vertices[0]; x1 = v->x; y1 = v->y; lprev = v->len; v = &m_src_vertices[1]; x2 = v->x; y2 = v->y; lnext = v->len; v = &m_src_vertices[2]; x3 = v->x; y3 = v->y; line_parameters lp1(x1, y1, x2, y2, lprev); line_parameters lp2(x2, y2, x3, y3, lnext); if(m_round_cap) { m_ren->semidot(cmp_dist_start, x1, y1, x1 + (y2 - y1), y1 - (x2 - x1)); } if(m_line_join == outline_round_join) { m_ren->line3(lp1, x1 + (y2 - y1), y1 - (x2 - x1), x2 + (y2 - y1), y2 - (x2 - x1)); m_ren->pie(x2, y2, x2 + (y2 - y1), y2 - (x2 - x1), x2 + (y3 - y2), y2 - (x3 - x2)); m_ren->line3(lp2, x2 + (y3 - y2), y2 - (x3 - x2), x3 + (y3 - y2), y3 - (x3 - x2)); } else { bisectrix(lp1, lp2, &dv.xb1, &dv.yb1); m_ren->line3(lp1, x1 + (y2 - y1), y1 - (x2 - x1), dv.xb1, dv.yb1); m_ren->line3(lp2, dv.xb1, dv.yb1, x3 + (y3 - y2), y3 - (x3 - x2)); } if(m_round_cap) { m_ren->semidot(cmp_dist_end, x3, y3, x3 + (y3 - y2), y3 - (x3 - x2)); } } break; default: { dv.idx = 3; v = &m_src_vertices[0]; x1 = v->x; y1 = v->y; lprev = v->len; v = &m_src_vertices[1]; x2 = v->x; y2 = v->y; dv.lcurr = v->len; line_parameters prev(x1, y1, x2, y2, lprev); v = &m_src_vertices[2]; dv.x1 = v->x; dv.y1 = v->y; dv.lnext = v->len; dv.curr = line_parameters(x2, y2, dv.x1, dv.y1, dv.lcurr); v = &m_src_vertices[dv.idx]; dv.x2 = v->x; dv.y2 = v->y; dv.next = line_parameters(dv.x1, dv.y1, dv.x2, dv.y2, dv.lnext); dv.xb1 = 0; dv.yb1 = 0; dv.xb2 = 0; dv.yb2 = 0; switch(m_line_join) { case outline_no_join: dv.flags = 3; break; case outline_miter_join: case outline_round_join: dv.flags = (prev.diagonal_quadrant() == dv.curr.diagonal_quadrant()) | ((dv.curr.diagonal_quadrant() == dv.next.diagonal_quadrant()) << 1); break; case outline_miter_accurate_join: dv.flags = 0; break; } if(m_round_cap) { m_ren->semidot(cmp_dist_start, x1, y1, x1 + (y2 - y1), y1 - (x2 - x1)); } if((dv.flags & 1) == 0) { if(m_line_join == outline_round_join) { m_ren->line3(prev, x1 + (y2 - y1), y1 - (x2 - x1), x2 + (y2 - y1), y2 - (x2 - x1)); m_ren->pie(prev.x2, prev.y2, x2 + (y2 - y1), y2 - (x2 - x1), dv.curr.x1 + (dv.curr.y2 - dv.curr.y1), dv.curr.y1 - (dv.curr.x2 - dv.curr.x1)); } else { bisectrix(prev, dv.curr, &dv.xb1, &dv.yb1); m_ren->line3(prev, x1 + (y2 - y1), y1 - (x2 - x1), dv.xb1, dv.yb1); } } else { m_ren->line1(prev, x1 + (y2 - y1), y1 - (x2 - x1)); } if((dv.flags & 2) == 0 && m_line_join != outline_round_join) { bisectrix(dv.curr, dv.next, &dv.xb2, &dv.yb2); } draw(dv, 1, m_src_vertices.size() - 2); if((dv.flags & 1) == 0) { if(m_line_join == outline_round_join) { m_ren->line3(dv.curr, dv.curr.x1 + (dv.curr.y2 - dv.curr.y1), dv.curr.y1 - (dv.curr.x2 - dv.curr.x1), dv.curr.x2 + (dv.curr.y2 - dv.curr.y1), dv.curr.y2 - (dv.curr.x2 - dv.curr.x1)); } else { m_ren->line3(dv.curr, dv.xb1, dv.yb1, 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), dv.curr.y2 - (dv.curr.x2 - dv.curr.x1)); } 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), dv.curr.y2 - (dv.curr.x2 - dv.curr.x1)); } } break; } } m_src_vertices.remove_all(); } } #endif �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_rasterizer_scanline_aa.h��������������������������������������������������0000644�0000000�0000000�00000042104�10703246330�022400� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- // // 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. // //---------------------------------------------------------------------------- // // Adaptation for 32-bit screen coordinates 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_RASTERIZER_SCANLINE_AA_INCLUDED #define AGG_RASTERIZER_SCANLINE_AA_INCLUDED #include "agg_rasterizer_cells_aa.h" #include "agg_rasterizer_sl_clip.h" #include "agg_gamma_functions.h" 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 // array of cells. struct cell_aa { int x; int y; int cover; int area; void initial() { x = 0x7FFFFFFF; y = 0x7FFFFFFF; cover = 0; area = 0; } void style(const cell_aa&) {} int not_equal(int ex, int ey, const cell_aa&) const { return (ex - x) | (ey - y); } }; //==================================================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_subpixel_shift. This class can be // used in the following way: // // 1. filling_rule(filling_rule_e ft) - optional. // // 2. gamma() - optional. // // 3. reset() // // 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 // won't draw anything. // 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" // while the intersecting contours with different orders will have "holes". // // filling_rule() and gamma() can be called anytime before "sweeping". //------------------------------------------------------------------------ template<class Clip=rasterizer_sl_clip_int> class rasterizer_scanline_aa { enum status { status_initial, status_move_to, status_line_to, status_closed }; public: typedef Clip clip_type; typedef typename Clip::conv_type conv_type; typedef typename Clip::coord_type coord_type; enum aa_scale_e { aa_shift = 8, aa_scale = 1 << aa_shift, aa_mask = aa_scale - 1, aa_scale2 = aa_scale * 2, aa_mask2 = aa_scale2 - 1 }; //-------------------------------------------------------------------- rasterizer_scanline_aa() : m_outline(), m_clipper(), m_filling_rule(fill_non_zero), m_auto_close(true), m_start_x(0), m_start_y(0), m_status(status_initial) { int i; for(i = 0; i < aa_scale; i++) m_gamma[i] = i; } //-------------------------------------------------------------------- template<class GammaF> rasterizer_scanline_aa(const GammaF& gamma_function) : m_outline(), m_clipper(m_outline), m_filling_rule(fill_non_zero), m_auto_close(true), m_start_x(0), m_start_y(0), m_status(status_initial) { gamma(gamma_function); } //-------------------------------------------------------------------- void reset(); void reset_clipping(); void clip_box(double x1, double y1, double x2, double y2); void filling_rule(filling_rule_e filling_rule); void auto_close(bool flag) { m_auto_close = flag; } //-------------------------------------------------------------------- template<class GammaF> void gamma(const GammaF& gamma_function) { int i; for(i = 0; i < aa_scale; i++) { m_gamma[i] = uround(gamma_function(double(i) / aa_mask) * aa_mask); } } //-------------------------------------------------------------------- unsigned apply_gamma(unsigned cover) const { return m_gamma[cover]; } //-------------------------------------------------------------------- void move_to(int x, int y); void line_to(int x, int y); void move_to_d(double x, double y); void line_to_d(double x, double y); void close_polygon(); void add_vertex(double x, double y, unsigned cmd); void edge(int x1, int y1, int x2, int y2); void edge_d(double x1, double y1, double x2, double y2); //------------------------------------------------------------------- template<class VertexSource> void add_path(VertexSource& vs, unsigned path_id=0) { double x; double y; unsigned cmd; vs.rewind(path_id); if(m_outline.sorted()) reset(); while(!is_stop(cmd = vs.vertex(&x, &y))) { add_vertex(x, y, cmd); } } //-------------------------------------------------------------------- int min_x() const { return m_outline.min_x(); } int min_y() const { return m_outline.min_y(); } int max_x() const { return m_outline.max_x(); } int max_y() const { return m_outline.max_y(); } //-------------------------------------------------------------------- void sort(); bool rewind_scanlines(); bool navigate_scanline(int y); //-------------------------------------------------------------------- AGG_INLINE unsigned calculate_alpha(int area) const { int cover = area >> (poly_subpixel_shift*2 + 1 - aa_shift); if(cover < 0) cover = -cover; if(m_filling_rule == fill_even_odd) { cover &= aa_mask2; if(cover > aa_scale) { cover = aa_scale2 - cover; } } if(cover > aa_mask) cover = aa_mask; return m_gamma[cover]; } //-------------------------------------------------------------------- template<class Scanline> bool sweep_scanline(Scanline& sl) { for(;;) { if(m_scan_y > m_outline.max_y()) return false; sl.reset_spans(); unsigned num_cells = m_outline.scanline_num_cells(m_scan_y); const cell_aa* const* cells = m_outline.scanline_cells(m_scan_y); int cover = 0; while(num_cells) { const cell_aa* cur_cell = *cells; int x = cur_cell->x; int area = cur_cell->area; unsigned alpha; cover += cur_cell->cover; //accumulate all cells with the same X while(--num_cells) { cur_cell = *++cells; if(cur_cell->x != x) break; area += cur_cell->area; cover += cur_cell->cover; } if(area) { alpha = calculate_alpha((cover << (poly_subpixel_shift + 1)) - area); if(alpha) { sl.add_cell(x, alpha); } x++; } if(num_cells && cur_cell->x > x) { alpha = calculate_alpha(cover << (poly_subpixel_shift + 1)); if(alpha) { sl.add_span(x, cur_cell->x - x, alpha); } } } if(sl.num_spans()) break; ++m_scan_y; } sl.finalize(m_scan_y); ++m_scan_y; return true; } //-------------------------------------------------------------------- bool hit_test(int tx, int ty); private: //-------------------------------------------------------------------- // Disable copying rasterizer_scanline_aa(const rasterizer_scanline_aa<Clip>&); const rasterizer_scanline_aa<Clip>& operator = (const rasterizer_scanline_aa<Clip>&); private: rasterizer_cells_aa<cell_aa> m_outline; clip_type m_clipper; int m_gamma[aa_scale]; filling_rule_e m_filling_rule; bool m_auto_close; coord_type m_start_x; coord_type m_start_y; unsigned m_status; int m_scan_y; }; //------------------------------------------------------------------------ template<class Clip> void rasterizer_scanline_aa<Clip>::reset() { m_outline.reset(); m_status = status_initial; } //------------------------------------------------------------------------ template<class Clip> void rasterizer_scanline_aa<Clip>::filling_rule(filling_rule_e filling_rule) { m_filling_rule = filling_rule; } //------------------------------------------------------------------------ template<class Clip> void rasterizer_scanline_aa<Clip>::clip_box(double x1, double y1, double x2, double y2) { reset(); m_clipper.clip_box(conv_type::upscale(x1), conv_type::upscale(y1), conv_type::upscale(x2), conv_type::upscale(y2)); } //------------------------------------------------------------------------ template<class Clip> void rasterizer_scanline_aa<Clip>::reset_clipping() { reset(); m_clipper.reset_clipping(); } //------------------------------------------------------------------------ template<class Clip> void rasterizer_scanline_aa<Clip>::close_polygon() { if(m_status == status_line_to) { m_clipper.line_to(m_outline, m_start_x, m_start_y); m_status = status_closed; } } //------------------------------------------------------------------------ template<class Clip> void rasterizer_scanline_aa<Clip>::move_to(int x, int y) { if(m_outline.sorted()) reset(); if(m_auto_close) close_polygon(); m_clipper.move_to(m_start_x = conv_type::downscale(x), m_start_y = conv_type::downscale(y)); m_status = status_move_to; } //------------------------------------------------------------------------ template<class Clip> void rasterizer_scanline_aa<Clip>::line_to(int x, int y) { m_clipper.line_to(m_outline, conv_type::downscale(x), conv_type::downscale(y)); m_status = status_line_to; } //------------------------------------------------------------------------ template<class Clip> void rasterizer_scanline_aa<Clip>::move_to_d(double x, double y) { if(m_outline.sorted()) reset(); if(m_auto_close) close_polygon(); m_clipper.move_to(m_start_x = conv_type::upscale(x), m_start_y = conv_type::upscale(y)); m_status = status_move_to; } //------------------------------------------------------------------------ template<class Clip> void rasterizer_scanline_aa<Clip>::line_to_d(double x, double y) { m_clipper.line_to(m_outline, conv_type::upscale(x), conv_type::upscale(y)); m_status = status_line_to; } //------------------------------------------------------------------------ template<class Clip> void rasterizer_scanline_aa<Clip>::add_vertex(double x, double y, unsigned cmd) { if(is_move_to(cmd)) { move_to_d(x, y); } else if(is_vertex(cmd)) { line_to_d(x, y); } else if(is_close(cmd)) { close_polygon(); } } //------------------------------------------------------------------------ template<class Clip> void rasterizer_scanline_aa<Clip>::edge(int x1, int y1, int x2, int y2) { if(m_outline.sorted()) reset(); m_clipper.move_to(conv_type::downscale(x1), conv_type::downscale(y1)); m_clipper.line_to(m_outline, conv_type::downscale(x2), conv_type::downscale(y2)); m_status = status_move_to; } //------------------------------------------------------------------------ template<class Clip> void rasterizer_scanline_aa<Clip>::edge_d(double x1, double y1, double x2, double y2) { if(m_outline.sorted()) reset(); m_clipper.move_to(conv_type::upscale(x1), conv_type::upscale(y1)); m_clipper.line_to(m_outline, conv_type::upscale(x2), conv_type::upscale(y2)); m_status = status_move_to; } //------------------------------------------------------------------------ template<class Clip> void rasterizer_scanline_aa<Clip>::sort() { if(m_auto_close) close_polygon(); m_outline.sort_cells(); } //------------------------------------------------------------------------ template<class Clip> AGG_INLINE bool rasterizer_scanline_aa<Clip>::rewind_scanlines() { if(m_auto_close) close_polygon(); m_outline.sort_cells(); if(m_outline.total_cells() == 0) { return false; } m_scan_y = m_outline.min_y(); return true; } //------------------------------------------------------------------------ template<class Clip> AGG_INLINE bool rasterizer_scanline_aa<Clip>::navigate_scanline(int y) { if(m_auto_close) close_polygon(); m_outline.sort_cells(); if(m_outline.total_cells() == 0 || y < m_outline.min_y() || y > m_outline.max_y()) { return false; } m_scan_y = y; return true; } //------------------------------------------------------------------------ template<class Clip> bool rasterizer_scanline_aa<Clip>::hit_test(int tx, int ty) { if(!navigate_scanline(ty)) return false; scanline_hit_test sl(tx); sweep_scanline(sl); return sl.hit(); } } #endif ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_rasterizer_sl_clip.h������������������������������������������������������0000644�0000000�0000000�00000031722�10703246330�021574� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_RASTERIZER_SL_CLIP_INCLUDED #define AGG_RASTERIZER_SL_CLIP_INCLUDED #include "agg_clip_liang_barsky.h" namespace agg { //--------------------------------------------------------poly_max_coord_e enum poly_max_coord_e { poly_max_coord = (1 << 30) - 1 //----poly_max_coord }; //------------------------------------------------------------ras_conv_int struct ras_conv_int { typedef int coord_type; static AGG_INLINE int mul_div(double a, double b, double c) { return iround(a * b / c); } static int xi(int v) { return v; } static int yi(int v) { return v; } static int upscale(double v) { return iround(v * poly_subpixel_scale); } static int downscale(int v) { return v; } }; //--------------------------------------------------------ras_conv_int_sat struct ras_conv_int_sat { typedef int coord_type; static AGG_INLINE int mul_div(double a, double b, double c) { return saturation<poly_max_coord>::iround(a * b / c); } static int xi(int v) { return v; } static int yi(int v) { return v; } static int upscale(double v) { return saturation<poly_max_coord>::iround(v * poly_subpixel_scale); } static int downscale(int v) { return v; } }; //---------------------------------------------------------ras_conv_int_3x struct ras_conv_int_3x { typedef int coord_type; static AGG_INLINE int mul_div(double a, double b, double c) { return iround(a * b / c); } static int xi(int v) { return v * 3; } static int yi(int v) { return v; } static int upscale(double v) { return iround(v * poly_subpixel_scale); } static int downscale(int v) { return v; } }; //-----------------------------------------------------------ras_conv_dbl struct ras_conv_dbl { typedef double coord_type; static AGG_INLINE double mul_div(double a, double b, double c) { return a * b / c; } static int xi(double v) { return iround(v * poly_subpixel_scale); } static int yi(double v) { return iround(v * poly_subpixel_scale); } static double upscale(double v) { return v; } static double downscale(int v) { return v / double(poly_subpixel_scale); } }; //--------------------------------------------------------ras_conv_dbl_3x struct ras_conv_dbl_3x { typedef double coord_type; static AGG_INLINE double mul_div(double a, double b, double c) { return a * b / c; } static int xi(double v) { return iround(v * poly_subpixel_scale * 3); } static int yi(double v) { return iround(v * poly_subpixel_scale); } static double upscale(double v) { return v; } static double downscale(int v) { return v / double(poly_subpixel_scale); } }; //------------------------------------------------------rasterizer_sl_clip template<class Conv> class rasterizer_sl_clip { public: typedef Conv conv_type; typedef typename Conv::coord_type coord_type; typedef rect_base<coord_type> rect_type; //-------------------------------------------------------------------- rasterizer_sl_clip() : m_clip_box(0,0,0,0), m_x1(0), m_y1(0), m_f1(0), m_clipping(false) {} //-------------------------------------------------------------------- void reset_clipping() { m_clipping = false; } //-------------------------------------------------------------------- void clip_box(coord_type x1, coord_type y1, coord_type x2, coord_type y2) { m_clip_box = rect_type(x1, y1, x2, y2); m_clip_box.normalize(); m_clipping = true; } //-------------------------------------------------------------------- void move_to(coord_type x1, coord_type y1) { m_x1 = x1; m_y1 = y1; if(m_clipping) m_f1 = clipping_flags(x1, y1, m_clip_box); } private: //------------------------------------------------------------------------ template<class Rasterizer> AGG_INLINE void line_clip_y(Rasterizer& ras, coord_type x1, coord_type y1, coord_type x2, coord_type y2, unsigned f1, unsigned f2) const { f1 &= 10; f2 &= 10; if((f1 | f2) == 0) { // Fully visible ras.line(Conv::xi(x1), Conv::yi(y1), Conv::xi(x2), Conv::yi(y2)); } else { if(f1 == f2) { // Invisible by Y return; } coord_type tx1 = x1; coord_type ty1 = y1; coord_type tx2 = x2; coord_type ty2 = y2; if(f1 & 8) // y1 < clip.y1 { tx1 = x1 + Conv::mul_div(m_clip_box.y1-y1, x2-x1, y2-y1); ty1 = m_clip_box.y1; } if(f1 & 2) // y1 > clip.y2 { tx1 = x1 + Conv::mul_div(m_clip_box.y2-y1, x2-x1, y2-y1); ty1 = m_clip_box.y2; } if(f2 & 8) // y2 < clip.y1 { tx2 = x1 + Conv::mul_div(m_clip_box.y1-y1, x2-x1, y2-y1); ty2 = m_clip_box.y1; } if(f2 & 2) // y2 > clip.y2 { tx2 = x1 + Conv::mul_div(m_clip_box.y2-y1, x2-x1, y2-y1); ty2 = m_clip_box.y2; } ras.line(Conv::xi(tx1), Conv::yi(ty1), Conv::xi(tx2), Conv::yi(ty2)); } } public: //-------------------------------------------------------------------- template<class Rasterizer> void line_to(Rasterizer& ras, coord_type x2, coord_type y2) { if(m_clipping) { unsigned f2 = clipping_flags(x2, y2, m_clip_box); if((m_f1 & 10) == (f2 & 10) && (m_f1 & 10) != 0) { // Invisible by Y m_x1 = x2; m_y1 = y2; m_f1 = f2; return; } coord_type x1 = m_x1; coord_type y1 = m_y1; unsigned f1 = m_f1; coord_type y3, y4; unsigned f3, f4; switch(((f1 & 5) << 1) | (f2 & 5)) { case 0: // Visible by X line_clip_y(ras, x1, y1, x2, y2, f1, f2); break; case 1: // x2 > clip.x2 y3 = y1 + Conv::mul_div(m_clip_box.x2-x1, y2-y1, x2-x1); f3 = clipping_flags_y(y3, m_clip_box); line_clip_y(ras, x1, y1, m_clip_box.x2, y3, f1, f3); line_clip_y(ras, m_clip_box.x2, y3, m_clip_box.x2, y2, f3, f2); break; case 2: // x1 > clip.x2 y3 = y1 + Conv::mul_div(m_clip_box.x2-x1, y2-y1, x2-x1); f3 = clipping_flags_y(y3, m_clip_box); line_clip_y(ras, m_clip_box.x2, y1, m_clip_box.x2, y3, f1, f3); line_clip_y(ras, m_clip_box.x2, y3, x2, y2, f3, f2); break; case 3: // x1 > clip.x2 && x2 > clip.x2 line_clip_y(ras, m_clip_box.x2, y1, m_clip_box.x2, y2, f1, f2); break; case 4: // x2 < clip.x1 y3 = y1 + Conv::mul_div(m_clip_box.x1-x1, y2-y1, x2-x1); f3 = clipping_flags_y(y3, m_clip_box); line_clip_y(ras, x1, y1, m_clip_box.x1, y3, f1, f3); line_clip_y(ras, m_clip_box.x1, y3, m_clip_box.x1, y2, f3, f2); break; case 6: // x1 > clip.x2 && x2 < clip.x1 y3 = y1 + Conv::mul_div(m_clip_box.x2-x1, y2-y1, x2-x1); y4 = y1 + Conv::mul_div(m_clip_box.x1-x1, y2-y1, x2-x1); f3 = clipping_flags_y(y3, m_clip_box); f4 = clipping_flags_y(y4, m_clip_box); line_clip_y(ras, m_clip_box.x2, y1, m_clip_box.x2, y3, f1, f3); line_clip_y(ras, m_clip_box.x2, y3, m_clip_box.x1, y4, f3, f4); line_clip_y(ras, m_clip_box.x1, y4, m_clip_box.x1, y2, f4, f2); break; case 8: // x1 < clip.x1 y3 = y1 + Conv::mul_div(m_clip_box.x1-x1, y2-y1, x2-x1); f3 = clipping_flags_y(y3, m_clip_box); line_clip_y(ras, m_clip_box.x1, y1, m_clip_box.x1, y3, f1, f3); line_clip_y(ras, m_clip_box.x1, y3, x2, y2, f3, f2); break; case 9: // x1 < clip.x1 && x2 > clip.x2 y3 = y1 + Conv::mul_div(m_clip_box.x1-x1, y2-y1, x2-x1); y4 = y1 + Conv::mul_div(m_clip_box.x2-x1, y2-y1, x2-x1); f3 = clipping_flags_y(y3, m_clip_box); f4 = clipping_flags_y(y4, m_clip_box); line_clip_y(ras, m_clip_box.x1, y1, m_clip_box.x1, y3, f1, f3); line_clip_y(ras, m_clip_box.x1, y3, m_clip_box.x2, y4, f3, f4); line_clip_y(ras, m_clip_box.x2, y4, m_clip_box.x2, y2, f4, f2); break; case 12: // x1 < clip.x1 && x2 < clip.x1 line_clip_y(ras, m_clip_box.x1, y1, m_clip_box.x1, y2, f1, f2); break; } m_f1 = f2; } else { ras.line(Conv::xi(m_x1), Conv::yi(m_y1), Conv::xi(x2), Conv::yi(y2)); } m_x1 = x2; m_y1 = y2; } private: rect_type m_clip_box; coord_type m_x1; coord_type m_y1; unsigned m_f1; bool m_clipping; }; //---------------------------------------------------rasterizer_sl_no_clip class rasterizer_sl_no_clip { public: typedef ras_conv_int conv_type; typedef int coord_type; rasterizer_sl_no_clip() : m_x1(0), m_y1(0) {} void reset_clipping() {} void clip_box(coord_type x1, coord_type y1, coord_type x2, coord_type y2) {} void move_to(coord_type x1, coord_type y1) { m_x1 = x1; m_y1 = y1; } template<class Rasterizer> void line_to(Rasterizer& ras, coord_type x2, coord_type y2) { ras.line(m_x1, m_y1, x2, y2); m_x1 = x2; m_y1 = y2; } private: int m_x1, m_y1; }; // -----rasterizer_sl_clip_int // -----rasterizer_sl_clip_int_sat // -----rasterizer_sl_clip_int_3x // -----rasterizer_sl_clip_dbl // -----rasterizer_sl_clip_dbl_3x //------------------------------------------------------------------------ typedef rasterizer_sl_clip<ras_conv_int> rasterizer_sl_clip_int; typedef rasterizer_sl_clip<ras_conv_int_sat> rasterizer_sl_clip_int_sat; typedef rasterizer_sl_clip<ras_conv_int_3x> rasterizer_sl_clip_int_3x; typedef rasterizer_sl_clip<ras_conv_dbl> rasterizer_sl_clip_dbl; typedef rasterizer_sl_clip<ras_conv_dbl_3x> rasterizer_sl_clip_dbl_3x; } #endif ����������������������������������������������agg-2.5+dfsg1/include/agg_renderer_base.h�����������������������������������������������������������0000644�0000000�0000000�00000061277�10703246330�020505� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_RENDERER_BASE_INCLUDED #define AGG_RENDERER_BASE_INCLUDED #include "agg_basics.h" #include "agg_rendering_buffer.h" namespace agg { //-----------------------------------------------------------renderer_base template<class PixelFormat> class renderer_base { public: typedef PixelFormat pixfmt_type; typedef typename pixfmt_type::color_type color_type; typedef typename pixfmt_type::row_data row_data; //-------------------------------------------------------------------- renderer_base() : m_ren(0), m_clip_box(1, 1, 0, 0) {} explicit renderer_base(pixfmt_type& ren) : m_ren(&ren), m_clip_box(0, 0, ren.width() - 1, ren.height() - 1) {} void attach(pixfmt_type& ren) { m_ren = &ren; m_clip_box = rect_i(0, 0, ren.width() - 1, ren.height() - 1); } //-------------------------------------------------------------------- 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(); } //-------------------------------------------------------------------- bool clip_box(int x1, int y1, int x2, int y2) { rect_i cb(x1, y1, x2, y2); cb.normalize(); if(cb.clip(rect_i(0, 0, width() - 1, height() - 1))) { m_clip_box = cb; return true; } m_clip_box.x1 = 1; m_clip_box.y1 = 1; m_clip_box.x2 = 0; m_clip_box.y2 = 0; return false; } //-------------------------------------------------------------------- void reset_clipping(bool visibility) { if(visibility) { m_clip_box.x1 = 0; m_clip_box.y1 = 0; m_clip_box.x2 = width() - 1; m_clip_box.y2 = height() - 1; } else { m_clip_box.x1 = 1; m_clip_box.y1 = 1; m_clip_box.x2 = 0; m_clip_box.y2 = 0; } } //-------------------------------------------------------------------- void clip_box_naked(int x1, int y1, int x2, int y2) { m_clip_box.x1 = x1; m_clip_box.y1 = y1; m_clip_box.x2 = x2; m_clip_box.y2 = y2; } //-------------------------------------------------------------------- bool inbox(int x, int y) const { return x >= m_clip_box.x1 && y >= m_clip_box.y1 && x <= m_clip_box.x2 && y <= m_clip_box.y2; } //-------------------------------------------------------------------- const rect_i& clip_box() const { return m_clip_box; } int xmin() const { return m_clip_box.x1; } int ymin() const { return m_clip_box.y1; } int xmax() const { return m_clip_box.x2; } int ymax() const { return m_clip_box.y2; } //-------------------------------------------------------------------- const rect_i& bounding_clip_box() const { return m_clip_box; } int bounding_xmin() const { return m_clip_box.x1; } int bounding_ymin() const { return m_clip_box.y1; } int bounding_xmax() const { return m_clip_box.x2; } int bounding_ymax() const { return m_clip_box.y2; } //-------------------------------------------------------------------- void clear(const color_type& c) { unsigned y; if(width()) { for(y = 0; y < height(); y++) { m_ren->copy_hline(0, y, width(), c); } } } //-------------------------------------------------------------------- void copy_pixel(int x, int y, const color_type& c) { if(inbox(x, y)) { m_ren->copy_pixel(x, y, c); } } //-------------------------------------------------------------------- void blend_pixel(int x, int y, const color_type& c, cover_type cover) { if(inbox(x, y)) { m_ren->blend_pixel(x, y, c, cover); } } //-------------------------------------------------------------------- color_type pixel(int x, int y) const { return inbox(x, y) ? m_ren->pixel(x, y) : color_type::no_color(); } //-------------------------------------------------------------------- void copy_hline(int x1, int y, int x2, const color_type& c) { if(x1 > x2) { int t = x2; x2 = x1; x1 = t; } if(y > ymax()) return; if(y < ymin()) return; if(x1 > xmax()) return; if(x2 < xmin()) return; if(x1 < xmin()) x1 = xmin(); if(x2 > xmax()) x2 = xmax(); m_ren->copy_hline(x1, y, x2 - x1 + 1, c); } //-------------------------------------------------------------------- void copy_vline(int x, int y1, int y2, const color_type& c) { if(y1 > y2) { int t = y2; y2 = y1; y1 = t; } if(x > xmax()) return; if(x < xmin()) return; if(y1 > ymax()) return; if(y2 < ymin()) return; if(y1 < ymin()) y1 = ymin(); if(y2 > ymax()) y2 = ymax(); m_ren->copy_vline(x, y1, y2 - y1 + 1, c); } //-------------------------------------------------------------------- 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; } if(y > ymax()) return; if(y < ymin()) return; if(x1 > xmax()) return; if(x2 < xmin()) return; if(x1 < xmin()) x1 = xmin(); if(x2 > xmax()) x2 = xmax(); m_ren->blend_hline(x1, y, x2 - x1 + 1, c, cover); } //-------------------------------------------------------------------- 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; } if(x > xmax()) return; if(x < xmin()) return; if(y1 > ymax()) return; if(y2 < ymin()) return; if(y1 < ymin()) y1 = ymin(); if(y2 > ymax()) y2 = ymax(); m_ren->blend_vline(x, y1, y2 - y1 + 1, c, cover); } //-------------------------------------------------------------------- void copy_bar(int x1, int y1, int x2, int y2, const color_type& c) { rect_i rc(x1, y1, x2, y2); rc.normalize(); if(rc.clip(clip_box())) { int y; for(y = rc.y1; y <= rc.y2; y++) { m_ren->copy_hline(rc.x1, y, unsigned(rc.x2 - rc.x1 + 1), c); } } } //-------------------------------------------------------------------- void blend_bar(int x1, int y1, int x2, int y2, const color_type& c, cover_type cover) { rect_i rc(x1, y1, x2, y2); rc.normalize(); if(rc.clip(clip_box())) { int y; for(y = rc.y1; y <= rc.y2; y++) { m_ren->blend_hline(rc.x1, y, unsigned(rc.x2 - rc.x1 + 1), c, cover); } } } //-------------------------------------------------------------------- void blend_solid_hspan(int x, int y, int len, const color_type& c, const cover_type* covers) { if(y > ymax()) return; if(y < ymin()) return; if(x < xmin()) { len -= xmin() - x; if(len <= 0) return; covers += xmin() - x; x = xmin(); } if(x + len > xmax()) { len = xmax() - x + 1; if(len <= 0) return; } m_ren->blend_solid_hspan(x, y, len, c, covers); } //-------------------------------------------------------------------- void blend_solid_vspan(int x, int y, int len, const color_type& c, const cover_type* covers) { if(x > xmax()) return; if(x < xmin()) return; if(y < ymin()) { len -= ymin() - y; if(len <= 0) return; covers += ymin() - y; y = ymin(); } if(y + len > ymax()) { len = ymax() - y + 1; if(len <= 0) return; } m_ren->blend_solid_vspan(x, y, len, c, covers); } //-------------------------------------------------------------------- void copy_color_hspan(int x, int y, int len, const color_type* colors) { if(y > ymax()) return; if(y < ymin()) return; if(x < xmin()) { int d = xmin() - x; len -= d; if(len <= 0) return; colors += d; x = xmin(); } if(x + len > xmax()) { len = xmax() - x + 1; if(len <= 0) return; } m_ren->copy_color_hspan(x, y, len, colors); } //-------------------------------------------------------------------- void copy_color_vspan(int x, int y, int len, const color_type* colors) { if(x > xmax()) return; if(x < xmin()) return; if(y < ymin()) { int d = ymin() - y; len -= d; if(len <= 0) return; colors += d; y = ymin(); } if(y + len > ymax()) { len = ymax() - y + 1; if(len <= 0) return; } m_ren->copy_color_vspan(x, y, len, colors); } //-------------------------------------------------------------------- void blend_color_hspan(int x, int y, int len, const color_type* colors, const cover_type* covers, cover_type cover = agg::cover_full) { if(y > ymax()) return; if(y < ymin()) return; if(x < xmin()) { int d = xmin() - x; len -= d; if(len <= 0) return; if(covers) covers += d; colors += d; x = xmin(); } if(x + len > xmax()) { len = xmax() - x + 1; if(len <= 0) return; } m_ren->blend_color_hspan(x, y, len, colors, covers, cover); } //-------------------------------------------------------------------- void blend_color_vspan(int x, int y, int len, const color_type* colors, const cover_type* covers, cover_type cover = agg::cover_full) { if(x > xmax()) return; if(x < xmin()) return; if(y < ymin()) { int d = ymin() - y; len -= d; if(len <= 0) return; if(covers) covers += d; colors += d; y = ymin(); } if(y + len > ymax()) { len = ymax() - y + 1; if(len <= 0) return; } m_ren->blend_color_vspan(x, y, len, colors, covers, cover); } //-------------------------------------------------------------------- rect_i clip_rect_area(rect_i& dst, rect_i& src, int wsrc, int hsrc) const { rect_i rc(0,0,0,0); rect_i cb = clip_box(); ++cb.x2; ++cb.y2; if(src.x1 < 0) { dst.x1 -= src.x1; src.x1 = 0; } if(src.y1 < 0) { dst.y1 -= src.y1; src.y1 = 0; } if(src.x2 > wsrc) src.x2 = wsrc; if(src.y2 > hsrc) src.y2 = hsrc; if(dst.x1 < cb.x1) { src.x1 += cb.x1 - dst.x1; dst.x1 = cb.x1; } if(dst.y1 < cb.y1) { src.y1 += cb.y1 - dst.y1; dst.y1 = cb.y1; } if(dst.x2 > cb.x2) dst.x2 = cb.x2; if(dst.y2 > cb.y2) dst.y2 = cb.y2; rc.x2 = dst.x2 - dst.x1; rc.y2 = dst.y2 - dst.y1; if(rc.x2 > src.x2 - src.x1) rc.x2 = src.x2 - src.x1; if(rc.y2 > src.y2 - src.y1) rc.y2 = src.y2 - src.y1; return rc; } //-------------------------------------------------------------------- template<class RenBuf> void copy_from(const RenBuf& src, const rect_i* rect_src_ptr = 0, int dx = 0, int dy = 0) { rect_i rsrc(0, 0, src.width(), src.height()); if(rect_src_ptr) { 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; } // Version with xdst, ydst (absolute positioning) //rect_i rdst(xdst, ydst, xdst + rsrc.x2 - rsrc.x1, ydst + rsrc.y2 - rsrc.y1); // Version with dx, dy (relative positioning) rect_i rdst(rsrc.x1 + dx, rsrc.y1 + dy, rsrc.x2 + dx, rsrc.y2 + dy); rect_i rc = clip_rect_area(rdst, rsrc, src.width(), src.height()); if(rc.x2 > 0) { int incy = 1; if(rdst.y1 > rsrc.y1) { rsrc.y1 += rc.y2 - 1; rdst.y1 += rc.y2 - 1; incy = -1; } while(rc.y2 > 0) { m_ren->copy_from(src, rdst.x1, rdst.y1, rsrc.x1, rsrc.y1, rc.x2); rdst.y1 += incy; rsrc.y1 += incy; --rc.y2; } } } //-------------------------------------------------------------------- template<class SrcPixelFormatRenderer> void blend_from(const SrcPixelFormatRenderer& src, const rect_i* rect_src_ptr = 0, int dx = 0, int dy = 0, cover_type cover = agg::cover_full) { rect_i rsrc(0, 0, src.width(), src.height()); if(rect_src_ptr) { 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; } // Version with xdst, ydst (absolute positioning) //rect_i rdst(xdst, ydst, xdst + rsrc.x2 - rsrc.x1, ydst + rsrc.y2 - rsrc.y1); // Version with dx, dy (relative positioning) rect_i rdst(rsrc.x1 + dx, rsrc.y1 + dy, rsrc.x2 + dx, rsrc.y2 + dy); rect_i rc = clip_rect_area(rdst, rsrc, src.width(), src.height()); if(rc.x2 > 0) { int incy = 1; if(rdst.y1 > rsrc.y1) { rsrc.y1 += rc.y2 - 1; rdst.y1 += rc.y2 - 1; incy = -1; } while(rc.y2 > 0) { typename SrcPixelFormatRenderer::row_data rw = src.row(rsrc.y1); if(rw.ptr) { int x1src = rsrc.x1; int x1dst = rdst.x1; int len = rc.x2; if(rw.x1 > x1src) { x1dst += rw.x1 - x1src; len -= rw.x1 - x1src; x1src = rw.x1; } if(len > 0) { if(x1src + len-1 > rw.x2) { len -= x1src + len - rw.x2 - 1; } if(len > 0) { m_ren->blend_from(src, x1dst, rdst.y1, x1src, rsrc.y1, len, cover); } } } rdst.y1 += incy; rsrc.y1 += incy; --rc.y2; } } } //-------------------------------------------------------------------- template<class SrcPixelFormatRenderer> void blend_from_color(const SrcPixelFormatRenderer& src, const color_type& color, const rect_i* rect_src_ptr = 0, int dx = 0, int dy = 0, cover_type cover = agg::cover_full) { rect_i rsrc(0, 0, src.width(), src.height()); if(rect_src_ptr) { 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; } // Version with xdst, ydst (absolute positioning) //rect_i rdst(xdst, ydst, xdst + rsrc.x2 - rsrc.x1, ydst + rsrc.y2 - rsrc.y1); // Version with dx, dy (relative positioning) rect_i rdst(rsrc.x1 + dx, rsrc.y1 + dy, rsrc.x2 + dx, rsrc.y2 + dy); rect_i rc = clip_rect_area(rdst, rsrc, src.width(), src.height()); if(rc.x2 > 0) { int incy = 1; if(rdst.y1 > rsrc.y1) { rsrc.y1 += rc.y2 - 1; rdst.y1 += rc.y2 - 1; incy = -1; } while(rc.y2 > 0) { typename SrcPixelFormatRenderer::row_data rw = src.row(rsrc.y1); if(rw.ptr) { int x1src = rsrc.x1; int x1dst = rdst.x1; int len = rc.x2; if(rw.x1 > x1src) { x1dst += rw.x1 - x1src; len -= rw.x1 - x1src; x1src = rw.x1; } if(len > 0) { if(x1src + len-1 > rw.x2) { len -= x1src + len - rw.x2 - 1; } if(len > 0) { m_ren->blend_from_color(src, color, x1dst, rdst.y1, x1src, rsrc.y1, len, cover); } } } rdst.y1 += incy; rsrc.y1 += incy; --rc.y2; } } } //-------------------------------------------------------------------- template<class SrcPixelFormatRenderer> void blend_from_lut(const SrcPixelFormatRenderer& src, const color_type* color_lut, const rect_i* rect_src_ptr = 0, int dx = 0, int dy = 0, cover_type cover = agg::cover_full) { rect_i rsrc(0, 0, src.width(), src.height()); if(rect_src_ptr) { 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; } // Version with xdst, ydst (absolute positioning) //rect_i rdst(xdst, ydst, xdst + rsrc.x2 - rsrc.x1, ydst + rsrc.y2 - rsrc.y1); // Version with dx, dy (relative positioning) rect_i rdst(rsrc.x1 + dx, rsrc.y1 + dy, rsrc.x2 + dx, rsrc.y2 + dy); rect_i rc = clip_rect_area(rdst, rsrc, src.width(), src.height()); if(rc.x2 > 0) { int incy = 1; if(rdst.y1 > rsrc.y1) { rsrc.y1 += rc.y2 - 1; rdst.y1 += rc.y2 - 1; incy = -1; } while(rc.y2 > 0) { typename SrcPixelFormatRenderer::row_data rw = src.row(rsrc.y1); if(rw.ptr) { int x1src = rsrc.x1; int x1dst = rdst.x1; int len = rc.x2; if(rw.x1 > x1src) { x1dst += rw.x1 - x1src; len -= rw.x1 - x1src; x1src = rw.x1; } if(len > 0) { if(x1src + len-1 > rw.x2) { len -= x1src + len - rw.x2 - 1; } if(len > 0) { m_ren->blend_from_lut(src, color_lut, x1dst, rdst.y1, x1src, rsrc.y1, len, cover); } } } rdst.y1 += incy; rsrc.y1 += incy; --rc.y2; } } } private: pixfmt_type* m_ren; rect_i m_clip_box; }; } #endif ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_renderer_markers.h��������������������������������������������������������0000644�0000000�0000000�00000106660�10703246330�021233� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_RENDERER_MARKERS_INCLUDED #define AGG_RENDERER_MARKERS_INCLUDED #include "agg_basics.h" #include "agg_renderer_primitives.h" namespace agg { //---------------------------------------------------------------marker_e enum marker_e { marker_square, marker_diamond, marker_circle, marker_crossed_circle, marker_semiellipse_left, marker_semiellipse_right, marker_semiellipse_up, marker_semiellipse_down, marker_triangle_left, marker_triangle_right, marker_triangle_up, marker_triangle_down, marker_four_rays, marker_cross, marker_x, marker_dash, marker_dot, marker_pixel, end_of_markers }; //--------------------------------------------------------renderer_markers template<class BaseRenderer> class renderer_markers : public renderer_primitives<BaseRenderer> { public: typedef renderer_primitives<BaseRenderer> base_type; typedef BaseRenderer base_ren_type; typedef typename base_ren_type::color_type color_type; //-------------------------------------------------------------------- renderer_markers(base_ren_type& rbuf) : base_type(rbuf) {} //-------------------------------------------------------------------- bool visible(int x, int y, int r) const { rect_i rc(x-r, y-r, x+y, y+r); return rc.clip(base_type::ren().bounding_clip_box()); } //-------------------------------------------------------------------- void square(int x, int y, int 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); } } //-------------------------------------------------------------------- void diamond(int x, int y, int r) { if(visible(x, y, r)) { if(r) { int dy = -r; int dx = 0; do { 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); 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); base_type::ren().blend_hline(x-dx+1, y-dy, x+dx-1, base_type::fill_color(), cover_full); } ++dy; ++dx; } while(dy <= 0); } else { base_type::ren().blend_pixel(x, y, base_type::fill_color(), cover_full); } } } //-------------------------------------------------------------------- void circle(int x, int y, int r) { if(visible(x, y, r)) { if(r) base_type::outlined_ellipse(x, y, r, r); else base_type::ren().blend_pixel(x, y, base_type::fill_color(), cover_full); } } //-------------------------------------------------------------------- void crossed_circle(int x, int y, int r) { if(visible(x, y, r)) { if(r) { base_type::outlined_ellipse(x, y, r, r); int r6 = r + (r >> 1); if(r <= 2) r6++; r >>= 1; base_type::ren().blend_hline(x-r6, y, x-r, base_type::line_color(), cover_full); base_type::ren().blend_hline(x+r, y, x+r6, base_type::line_color(), cover_full); base_type::ren().blend_vline(x, y-r6, y-r, base_type::line_color(), cover_full); base_type::ren().blend_vline(x, y+r, y+r6, base_type::line_color(), cover_full); } else { base_type::ren().blend_pixel(x, y, base_type::fill_color(), cover_full); } } } //------------------------------------------------------------------------ void semiellipse_left(int x, int y, int r) { if(visible(x, y, r)) { if(r) { int r8 = r * 4 / 5; int dy = -r; int dx = 0; ellipse_bresenham_interpolator ei(r * 3 / 5, r+r8); do { 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); } ++ei; } while(dy < r8); base_type::ren().blend_vline(x+dy, y-dx, y+dx, base_type::line_color(), cover_full); } else { base_type::ren().blend_pixel(x, y, base_type::fill_color(), cover_full); } } } //-------------------------------------------------------------------- void semiellipse_right(int x, int y, int r) { if(visible(x, y, r)) { if(r) { int r8 = r * 4 / 5; int dy = -r; int dx = 0; ellipse_bresenham_interpolator ei(r * 3 / 5, r+r8); do { 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); } ++ei; } while(dy < r8); base_type::ren().blend_vline(x-dy, y-dx, y+dx, base_type::line_color(), cover_full); } else { base_type::ren().blend_pixel(x, y, base_type::fill_color(), cover_full); } } } //-------------------------------------------------------------------- void semiellipse_up(int x, int y, int r) { if(visible(x, y, r)) { if(r) { int r8 = r * 4 / 5; int dy = -r; int dx = 0; ellipse_bresenham_interpolator ei(r * 3 / 5, r+r8); do { 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); } ++ei; } while(dy < r8); base_type::ren().blend_hline(x-dx, y-dy-1, x+dx, base_type::line_color(), cover_full); } else { base_type::ren().blend_pixel(x, y, base_type::fill_color(), cover_full); } } } //-------------------------------------------------------------------- void semiellipse_down(int x, int y, int r) { if(visible(x, y, r)) { if(r) { int r8 = r * 4 / 5; int dy = -r; int dx = 0; ellipse_bresenham_interpolator ei(r * 3 / 5, r+r8); do { 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); } ++ei; } while(dy < r8); base_type::ren().blend_hline(x-dx, y+dy+1, x+dx, base_type::line_color(), cover_full); } else { base_type::ren().blend_pixel(x, y, base_type::fill_color(), cover_full); } } } //-------------------------------------------------------------------- void triangle_left(int x, int y, int r) { if(visible(x, y, r)) { if(r) { int dy = -r; int dx = 0; int flip = 0; int r6 = r * 3 / 5; do { 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); } ++dy; dx += flip; flip ^= 1; } while(dy < r6); base_type::ren().blend_vline(x+dy, y-dx, y+dx, base_type::line_color(), cover_full); } else { base_type::ren().blend_pixel(x, y, base_type::fill_color(), cover_full); } } } //-------------------------------------------------------------------- void triangle_right(int x, int y, int r) { if(visible(x, y, r)) { if(r) { int dy = -r; int dx = 0; int flip = 0; int r6 = r * 3 / 5; do { 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); } ++dy; dx += flip; flip ^= 1; } while(dy < r6); base_type::ren().blend_vline(x-dy, y-dx, y+dx, base_type::line_color(), cover_full); } else { base_type::ren().blend_pixel(x, y, base_type::fill_color(), cover_full); } } } //-------------------------------------------------------------------- void triangle_up(int x, int y, int r) { if(visible(x, y, r)) { if(r) { int dy = -r; int dx = 0; int flip = 0; int r6 = r * 3 / 5; do { 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); } ++dy; dx += flip; flip ^= 1; } while(dy < r6); base_type::ren().blend_hline(x-dx, y-dy, x+dx, base_type::line_color(), cover_full); } else { base_type::ren().blend_pixel(x, y, base_type::fill_color(), cover_full); } } } //-------------------------------------------------------------------- void triangle_down(int x, int y, int r) { if(visible(x, y, r)) { if(r) { int dy = -r; int dx = 0; int flip = 0; int r6 = r * 3 / 5; do { 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); } ++dy; dx += flip; flip ^= 1; } while(dy < r6); base_type::ren().blend_hline(x-dx, y+dy, x+dx, base_type::line_color(), cover_full); } else { base_type::ren().blend_pixel(x, y, base_type::fill_color(), cover_full); } } } //-------------------------------------------------------------------- void four_rays(int x, int y, int r) { if(visible(x, y, r)) { if(r) { int dy = -r; int dx = 0; int flip = 0; int r3 = -(r / 3); do { 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); base_type::ren().blend_pixel(x + dx, y - dy, 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); 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); base_type::ren().blend_hline(x-dx+1, y-dy, x+dx-1, base_type::fill_color(), cover_full); base_type::ren().blend_vline(x+dy, y-dx+1, y+dx-1, base_type::fill_color(), cover_full); base_type::ren().blend_vline(x-dy, y-dx+1, y+dx-1, base_type::fill_color(), cover_full); } ++dy; dx += flip; flip ^= 1; } while(dy <= r3); base_type::solid_rectangle(x+r3+1, y+r3+1, x-r3-1, y-r3-1); } else { base_type::ren().blend_pixel(x, y, base_type::fill_color(), cover_full); } } } //-------------------------------------------------------------------- void cross(int x, int y, int r) { if(visible(x, y, r)) { if(r) { base_type::ren().blend_vline(x, y-r, y+r, base_type::line_color(), cover_full); 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 xing(int x, int y, int r) { if(visible(x, y, r)) { if(r) { int dy = -r * 7 / 10; do { base_type::ren().blend_pixel(x + dy, y + dy, base_type::line_color(), cover_full); base_type::ren().blend_pixel(x - dy, y + dy, base_type::line_color(), cover_full); base_type::ren().blend_pixel(x + dy, y - dy, base_type::line_color(), cover_full); base_type::ren().blend_pixel(x - dy, y - dy, base_type::line_color(), cover_full); ++dy; } while(dy < 0); } 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(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(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) { switch(type) { case marker_square: square(x, y, r); break; case marker_diamond: diamond(x, y, r); break; case marker_circle: circle(x, y, r); break; case marker_crossed_circle: crossed_circle(x, y, r); break; case marker_semiellipse_left: semiellipse_left(x, y, r); break; case marker_semiellipse_right: semiellipse_right(x, y, r); break; case marker_semiellipse_up: semiellipse_up(x, y, r); break; case marker_semiellipse_down: semiellipse_down(x, y, r); break; case marker_triangle_left: triangle_left(x, y, r); break; case marker_triangle_right: triangle_right(x, y, r); break; case marker_triangle_up: triangle_up(x, y, r); break; case marker_triangle_down: triangle_down(x, y, r); break; case marker_four_rays: four_rays(x, y, r); break; case marker_cross: cross(x, y, r); break; case marker_x: xing(x, y, r); break; case marker_dash: dash(x, y, r); break; case marker_dot: dot(x, y, r); break; case marker_pixel: pixel(x, y, r); break; } } //-------------------------------------------------------------------- template<class T> void markers(int n, const T* x, const T* y, T r, marker_e type) { if(n <= 0) return; if(r == 0) { do { base_type::ren().blend_pixel(int(*x), int(*y), base_type::fill_color(), cover_full); ++x; ++y; } while(--n); return; } switch(type) { case marker_square: do { square (int(*x), int(*y), int(r)); ++x; ++y; } while(--n); break; case marker_diamond: do { diamond (int(*x), int(*y), int(r)); ++x; ++y; } while(--n); break; case marker_circle: do { circle (int(*x), int(*y), int(r)); ++x; ++y; } while(--n); break; case marker_crossed_circle: do { crossed_circle (int(*x), int(*y), int(r)); ++x; ++y; } while(--n); break; case marker_semiellipse_left: do { semiellipse_left (int(*x), int(*y), int(r)); ++x; ++y; } while(--n); break; case marker_semiellipse_right: do { semiellipse_right(int(*x), int(*y), int(r)); ++x; ++y; } while(--n); break; case marker_semiellipse_up: do { semiellipse_up (int(*x), int(*y), int(r)); ++x; ++y; } while(--n); break; case marker_semiellipse_down: do { semiellipse_down (int(*x), int(*y), int(r)); ++x; ++y; } while(--n); break; case marker_triangle_left: do { triangle_left (int(*x), int(*y), int(r)); ++x; ++y; } while(--n); break; case marker_triangle_right: do { triangle_right (int(*x), int(*y), int(r)); ++x; ++y; } while(--n); break; case marker_triangle_up: do { triangle_up (int(*x), int(*y), int(r)); ++x; ++y; } while(--n); break; case marker_triangle_down: do { triangle_down (int(*x), int(*y), int(r)); ++x; ++y; } while(--n); break; case marker_four_rays: do { four_rays (int(*x), int(*y), int(r)); ++x; ++y; } while(--n); break; case marker_cross: do { cross (int(*x), int(*y), int(r)); ++x; ++y; } while(--n); break; case marker_x: do { xing (int(*x), int(*y), int(r)); ++x; ++y; } while(--n); break; 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) { if(n <= 0) return; switch(type) { case marker_square: do { square (int(*x), int(*y), int(*r)); ++x; ++y; ++r; } while(--n); break; case marker_diamond: do { diamond (int(*x), int(*y), int(*r)); ++x; ++y; ++r; } while(--n); break; case marker_circle: do { circle (int(*x), int(*y), int(*r)); ++x; ++y; ++r; } while(--n); break; case marker_crossed_circle: do { crossed_circle (int(*x), int(*y), int(*r)); ++x; ++y; ++r; } while(--n); break; case marker_semiellipse_left: do { semiellipse_left (int(*x), int(*y), int(*r)); ++x; ++y; ++r; } while(--n); break; case marker_semiellipse_right: do { semiellipse_right(int(*x), int(*y), int(*r)); ++x; ++y; ++r; } while(--n); break; case marker_semiellipse_up: do { semiellipse_up (int(*x), int(*y), int(*r)); ++x; ++y; ++r; } while(--n); break; case marker_semiellipse_down: do { semiellipse_down (int(*x), int(*y), int(*r)); ++x; ++y; ++r; } while(--n); break; case marker_triangle_left: do { triangle_left (int(*x), int(*y), int(*r)); ++x; ++y; ++r; } while(--n); break; case marker_triangle_right: do { triangle_right (int(*x), int(*y), int(*r)); ++x; ++y; ++r; } while(--n); break; case marker_triangle_up: do { triangle_up (int(*x), int(*y), int(*r)); ++x; ++y; ++r; } while(--n); break; case marker_triangle_down: do { triangle_down (int(*x), int(*y), int(*r)); ++x; ++y; ++r; } while(--n); break; case marker_four_rays: do { four_rays (int(*x), int(*y), int(*r)); ++x; ++y; ++r; } while(--n); break; case marker_cross: do { cross (int(*x), int(*y), int(*r)); ++x; ++y; ++r; } while(--n); break; case marker_x: do { xing (int(*x), int(*y), int(*r)); ++x; ++y; ++r; } while(--n); break; 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) { if(n <= 0) return; switch(type) { case marker_square: do { base_type::fill_color(*fc); square (int(*x), int(*y), int(*r)); ++x; ++y; ++r; ++fc; } while(--n); break; case marker_diamond: do { base_type::fill_color(*fc); diamond (int(*x), int(*y), int(*r)); ++x; ++y; ++r; ++fc; } while(--n); break; case marker_circle: do { base_type::fill_color(*fc); circle (int(*x), int(*y), int(*r)); ++x; ++y; ++r; ++fc; } while(--n); break; case marker_crossed_circle: do { base_type::fill_color(*fc); crossed_circle (int(*x), int(*y), int(*r)); ++x; ++y; ++r; ++fc; } while(--n); break; case marker_semiellipse_left: do { base_type::fill_color(*fc); semiellipse_left (int(*x), int(*y), int(*r)); ++x; ++y; ++r; ++fc; } while(--n); break; case marker_semiellipse_right: do { base_type::fill_color(*fc); semiellipse_right(int(*x), int(*y), int(*r)); ++x; ++y; ++r; ++fc; } while(--n); break; case marker_semiellipse_up: do { base_type::fill_color(*fc); semiellipse_up (int(*x), int(*y), int(*r)); ++x; ++y; ++r; ++fc; } while(--n); break; case marker_semiellipse_down: do { base_type::fill_color(*fc); semiellipse_down (int(*x), int(*y), int(*r)); ++x; ++y; ++r; ++fc; } while(--n); break; case marker_triangle_left: do { base_type::fill_color(*fc); triangle_left (int(*x), int(*y), int(*r)); ++x; ++y; ++r; ++fc; } while(--n); break; case marker_triangle_right: do { base_type::fill_color(*fc); triangle_right (int(*x), int(*y), int(*r)); ++x; ++y; ++r; ++fc; } while(--n); break; case marker_triangle_up: do { base_type::fill_color(*fc); triangle_up (int(*x), int(*y), int(*r)); ++x; ++y; ++r; ++fc; } while(--n); break; case marker_triangle_down: do { base_type::fill_color(*fc); triangle_down (int(*x), int(*y), int(*r)); ++x; ++y; ++r; ++fc; } while(--n); break; case marker_four_rays: do { base_type::fill_color(*fc); four_rays (int(*x), int(*y), int(*r)); ++x; ++y; ++r; ++fc; } while(--n); break; case marker_cross: do { base_type::fill_color(*fc); cross (int(*x), int(*y), int(*r)); ++x; ++y; ++r; ++fc; } while(--n); break; case marker_x: do { base_type::fill_color(*fc); xing (int(*x), int(*y), int(*r)); ++x; ++y; ++r; ++fc; } while(--n); break; case marker_dash: do { base_type::fill_color(*fc); dash (int(*x), int(*y), int(*r)); ++x; ++y; ++r; ++fc; } while(--n); break; case marker_dot: do { base_type::fill_color(*fc); dot (int(*x), int(*y), int(*r)); ++x; ++y; ++r; ++fc; } while(--n); break; 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) { if(n <= 0) return; switch(type) { case marker_square: do { base_type::fill_color(*fc); base_type::line_color(*lc); square (int(*x), int(*y), int(*r)); ++x; ++y; ++r; ++fc; ++lc; } while(--n); break; case marker_diamond: do { base_type::fill_color(*fc); base_type::line_color(*lc); diamond (int(*x), int(*y), int(*r)); ++x; ++y; ++r; ++fc; ++lc; } while(--n); break; case marker_circle: do { base_type::fill_color(*fc); base_type::line_color(*lc); circle (int(*x), int(*y), int(*r)); ++x; ++y; ++r; ++fc; ++lc; } while(--n); break; case marker_crossed_circle: do { base_type::fill_color(*fc); base_type::line_color(*lc); crossed_circle (int(*x), int(*y), int(*r)); ++x; ++y; ++r; ++fc; ++lc; } while(--n); break; case marker_semiellipse_left: do { base_type::fill_color(*fc); base_type::line_color(*lc); semiellipse_left (int(*x), int(*y), int(*r)); ++x; ++y; ++r; ++fc; ++lc; } while(--n); break; case marker_semiellipse_right: do { base_type::fill_color(*fc); base_type::line_color(*lc); semiellipse_right(int(*x), int(*y), int(*r)); ++x; ++y; ++r; ++fc; ++lc; } while(--n); break; case marker_semiellipse_up: do { base_type::fill_color(*fc); base_type::line_color(*lc); semiellipse_up (int(*x), int(*y), int(*r)); ++x; ++y; ++r; ++fc; ++lc; } while(--n); break; case marker_semiellipse_down: do { base_type::fill_color(*fc); base_type::line_color(*lc); semiellipse_down (int(*x), int(*y), int(*r)); ++x; ++y; ++r; ++fc; ++lc; } while(--n); break; case marker_triangle_left: do { base_type::fill_color(*fc); base_type::line_color(*lc); triangle_left (int(*x), int(*y), int(*r)); ++x; ++y; ++r; ++fc; ++lc; } while(--n); break; case marker_triangle_right: do { base_type::fill_color(*fc); base_type::line_color(*lc); triangle_right (int(*x), int(*y), int(*r)); ++x; ++y; ++r; ++fc; ++lc; } while(--n); break; case marker_triangle_up: do { base_type::fill_color(*fc); base_type::line_color(*lc); triangle_up (int(*x), int(*y), int(*r)); ++x; ++y; ++r; ++fc; ++lc; } while(--n); break; case marker_triangle_down: do { base_type::fill_color(*fc); base_type::line_color(*lc); triangle_down (int(*x), int(*y), int(*r)); ++x; ++y; ++r; ++fc; ++lc; } while(--n); break; case marker_four_rays: do { base_type::fill_color(*fc); base_type::line_color(*lc); four_rays (int(*x), int(*y), int(*r)); ++x; ++y; ++r; ++fc; ++lc; } while(--n); break; case marker_cross: do { base_type::fill_color(*fc); base_type::line_color(*lc); cross (int(*x), int(*y), int(*r)); ++x; ++y; ++r; ++fc; ++lc; } while(--n); break; case marker_x: do { base_type::fill_color(*fc); base_type::line_color(*lc); xing (int(*x), int(*y), int(*r)); ++x; ++y; ++r; ++fc; ++lc; } while(--n); break; case marker_dash: do { base_type::fill_color(*fc); base_type::line_color(*lc); dash (int(*x), int(*y), int(*r)); ++x; ++y; ++r; ++fc; ++lc; } while(--n); break; case marker_dot: do { base_type::fill_color(*fc); base_type::line_color(*lc); dot (int(*x), int(*y), int(*r)); ++x; ++y; ++r; ++fc; ++lc; } while(--n); break; case marker_pixel: do { base_type::fill_color(*fc); base_type::line_color(*lc); pixel (int(*x), int(*y), int(*r)); ++x; ++y; ++r; ++fc; ++lc; } while(--n); break; } } }; } #endif ��������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_renderer_mclip.h����������������������������������������������������������0000644�0000000�0000000�00000027376�10703246330�020701� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_RENDERER_MCLIP_INCLUDED #define AGG_RENDERER_MCLIP_INCLUDED #include "agg_basics.h" #include "agg_array.h" #include "agg_renderer_base.h" namespace agg { //----------------------------------------------------------renderer_mclip template<class PixelFormat> class renderer_mclip { public: typedef PixelFormat pixfmt_type; typedef typename pixfmt_type::color_type color_type; typedef typename pixfmt_type::row_data row_data; typedef renderer_base<pixfmt_type> base_ren_type; //-------------------------------------------------------------------- explicit renderer_mclip(pixfmt_type& pixf) : m_ren(pixf), m_curr_cb(0), m_bounds(m_ren.xmin(), m_ren.ymin(), m_ren.xmax(), m_ren.ymax()) {} void attach(pixfmt_type& pixf) { m_ren.attach(pixf); reset_clipping(true); } //-------------------------------------------------------------------- const pixfmt_type& ren() const { return m_ren.ren(); } pixfmt_type& ren() { return m_ren.ren(); } //-------------------------------------------------------------------- unsigned width() const { return m_ren.width(); } unsigned height() const { return m_ren.height(); } //-------------------------------------------------------------------- const rect_i& clip_box() const { return m_ren.clip_box(); } int xmin() const { return m_ren.xmin(); } int ymin() const { return m_ren.ymin(); } int xmax() const { return m_ren.xmax(); } int ymax() const { return m_ren.ymax(); } //-------------------------------------------------------------------- const rect_i& bounding_clip_box() const { return m_bounds; } int bounding_xmin() const { return m_bounds.x1; } int bounding_ymin() const { return m_bounds.y1; } int bounding_xmax() const { return m_bounds.x2; } int bounding_ymax() const { return m_bounds.y2; } //-------------------------------------------------------------------- void first_clip_box() { m_curr_cb = 0; if(m_clip.size()) { const rect_i& cb = m_clip[0]; m_ren.clip_box_naked(cb.x1, cb.y1, cb.x2, cb.y2); } } //-------------------------------------------------------------------- bool next_clip_box() { if(++m_curr_cb < m_clip.size()) { const rect_i& cb = m_clip[m_curr_cb]; m_ren.clip_box_naked(cb.x1, cb.y1, cb.x2, cb.y2); return true; } return false; } //-------------------------------------------------------------------- void reset_clipping(bool visibility) { m_ren.reset_clipping(visibility); m_clip.remove_all(); m_curr_cb = 0; m_bounds = m_ren.clip_box(); } //-------------------------------------------------------------------- void add_clip_box(int x1, int y1, int x2, int y2) { rect_i cb(x1, y1, x2, y2); cb.normalize(); if(cb.clip(rect_i(0, 0, width() - 1, height() - 1))) { m_clip.add(cb); if(cb.x1 < m_bounds.x1) m_bounds.x1 = cb.x1; if(cb.y1 < m_bounds.y1) m_bounds.y1 = cb.y1; if(cb.x2 > m_bounds.x2) m_bounds.x2 = cb.x2; if(cb.y2 > m_bounds.y2) m_bounds.y2 = cb.y2; } } //-------------------------------------------------------------------- void clear(const color_type& c) { m_ren.clear(c); } //-------------------------------------------------------------------- void copy_pixel(int x, int y, const color_type& c) { first_clip_box(); do { if(m_ren.inbox(x, y)) { m_ren.ren().copy_pixel(x, y, c); break; } } while(next_clip_box()); } //-------------------------------------------------------------------- void blend_pixel(int x, int y, const color_type& c, cover_type cover) { first_clip_box(); do { if(m_ren.inbox(x, y)) { m_ren.ren().blend_pixel(x, y, c, cover); break; } } while(next_clip_box()); } //-------------------------------------------------------------------- color_type pixel(int x, int y) const { first_clip_box(); do { if(m_ren.inbox(x, y)) { return m_ren.ren().pixel(x, y); } } while(next_clip_box()); return color_type::no_color(); } //-------------------------------------------------------------------- void copy_hline(int x1, int y, int x2, const color_type& c) { first_clip_box(); do { m_ren.copy_hline(x1, y, x2, c); } while(next_clip_box()); } //-------------------------------------------------------------------- void copy_vline(int x, int y1, int y2, const color_type& c) { first_clip_box(); do { m_ren.copy_vline(x, y1, y2, c); } while(next_clip_box()); } //-------------------------------------------------------------------- void blend_hline(int x1, int y, int x2, const color_type& c, cover_type cover) { first_clip_box(); do { m_ren.blend_hline(x1, y, x2, c, cover); } while(next_clip_box()); } //-------------------------------------------------------------------- void blend_vline(int x, int y1, int y2, const color_type& c, cover_type cover) { first_clip_box(); do { m_ren.blend_vline(x, y1, y2, c, cover); } while(next_clip_box()); } //-------------------------------------------------------------------- void copy_bar(int x1, int y1, int x2, int y2, const color_type& c) { first_clip_box(); do { m_ren.copy_bar(x1, y1, x2, y2, c); } while(next_clip_box()); } //-------------------------------------------------------------------- void blend_bar(int x1, int y1, int x2, int y2, const color_type& c, cover_type cover) { first_clip_box(); do { m_ren.blend_bar(x1, y1, x2, y2, c, cover); } while(next_clip_box()); } //-------------------------------------------------------------------- void blend_solid_hspan(int x, int y, int len, const color_type& c, const cover_type* covers) { first_clip_box(); do { m_ren.blend_solid_hspan(x, y, len, c, covers); } while(next_clip_box()); } //-------------------------------------------------------------------- void blend_solid_vspan(int x, int y, int len, const color_type& c, const cover_type* covers) { first_clip_box(); do { m_ren.blend_solid_vspan(x, y, len, c, covers); } while(next_clip_box()); } //-------------------------------------------------------------------- void copy_color_hspan(int x, int y, int len, const color_type* colors) { first_clip_box(); do { m_ren.copy_color_hspan(x, y, len, colors); } while(next_clip_box()); } //-------------------------------------------------------------------- void blend_color_hspan(int x, int y, int len, const color_type* colors, const cover_type* covers, cover_type cover = cover_full) { first_clip_box(); do { m_ren.blend_color_hspan(x, y, len, colors, covers, cover); } while(next_clip_box()); } //-------------------------------------------------------------------- void blend_color_vspan(int x, int y, int len, const color_type* colors, const cover_type* covers, cover_type cover = cover_full) { first_clip_box(); do { m_ren.blend_color_vspan(x, y, len, colors, covers, cover); } while(next_clip_box()); } //-------------------------------------------------------------------- void copy_from(const rendering_buffer& from, const rect_i* rc=0, int x_to=0, int y_to=0) { first_clip_box(); do { m_ren.copy_from(from, rc, x_to, y_to); } while(next_clip_box()); } //-------------------------------------------------------------------- template<class SrcPixelFormatRenderer> void blend_from(const SrcPixelFormatRenderer& src, const rect_i* rect_src_ptr = 0, int dx = 0, int dy = 0, cover_type cover = cover_full) { first_clip_box(); do { m_ren.blend_from(src, rect_src_ptr, dx, dy, cover); } while(next_clip_box()); } private: renderer_mclip(const renderer_mclip<PixelFormat>&); const renderer_mclip<PixelFormat>& operator = (const renderer_mclip<PixelFormat>&); base_ren_type m_ren; pod_bvector<rect_i, 4> m_clip; unsigned m_curr_cb; rect_i m_bounds; }; } #endif ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_renderer_outline_aa.h�����������������������������������������������������0000644�0000000�0000000�00000174772�10703246330�021720� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_RENDERER_OUTLINE_AA_INCLUDED #define AGG_RENDERER_OUTLINE_AA_INCLUDED #include "agg_array.h" #include "agg_math.h" #include "agg_line_aa_basics.h" #include "agg_dda_line.h" #include "agg_ellipse_bresenham.h" #include "agg_renderer_base.h" #include "agg_gamma_functions.h" #include "agg_clip_liang_barsky.h" namespace agg { //===================================================distance_interpolator0 class distance_interpolator0 { public: //--------------------------------------------------------------------- distance_interpolator0() {} 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_scale/2) - line_mr(x2)) * m_dy - (line_mr(y + line_subpixel_scale/2) - line_mr(y2)) * m_dx) { m_dx <<= line_mr_subpixel_shift; m_dy <<= line_mr_subpixel_shift; } //--------------------------------------------------------------------- void inc_x() { m_dist += m_dy; } int dist() const { return m_dist; } private: //--------------------------------------------------------------------- int m_dx; int m_dy; int m_dist; }; //==================================================distance_interpolator00 class distance_interpolator00 { public: //--------------------------------------------------------------------- distance_interpolator00() {} distance_interpolator00(int xc, int yc, int x1, int y1, int x2, int y2, int x, int y) : m_dx1(line_mr(x1) - line_mr(xc)), m_dy1(line_mr(y1) - line_mr(yc)), m_dx2(line_mr(x2) - line_mr(xc)), m_dy2(line_mr(y2) - line_mr(yc)), m_dist1((line_mr(x + line_subpixel_scale/2) - line_mr(x1)) * m_dy1 - (line_mr(y + line_subpixel_scale/2) - line_mr(y1)) * m_dx1), m_dist2((line_mr(x + line_subpixel_scale/2) - line_mr(x2)) * m_dy2 - (line_mr(y + line_subpixel_scale/2) - line_mr(y2)) * m_dx2) { m_dx1 <<= line_mr_subpixel_shift; m_dy1 <<= line_mr_subpixel_shift; m_dx2 <<= line_mr_subpixel_shift; m_dy2 <<= line_mr_subpixel_shift; } //--------------------------------------------------------------------- void inc_x() { m_dist1 += m_dy1; m_dist2 += m_dy2; } int dist1() const { return m_dist1; } int dist2() const { return m_dist2; } private: //--------------------------------------------------------------------- int m_dx1; int m_dy1; int m_dx2; int m_dy2; int m_dist1; int m_dist2; }; //===================================================distance_interpolator1 class distance_interpolator1 { public: //--------------------------------------------------------------------- distance_interpolator1() {} distance_interpolator1(int x1, int y1, int x2, int y2, int x, int y) : m_dx(x2 - x1), m_dy(y2 - y1), m_dist(iround(double(x + line_subpixel_scale/2 - x2) * double(m_dy) - double(y + line_subpixel_scale/2 - y2) * double(m_dx))) { m_dx <<= line_subpixel_shift; m_dy <<= line_subpixel_shift; } //--------------------------------------------------------------------- void inc_x() { m_dist += m_dy; } void dec_x() { m_dist -= m_dy; } void inc_y() { m_dist -= m_dx; } void dec_y() { m_dist += m_dx; } //--------------------------------------------------------------------- void inc_x(int dy) { 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; } //--------------------------------------------------------------------- void inc_y(int dx) { 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; } //--------------------------------------------------------------------- int dist() const { return m_dist; } int dx() const { return m_dx; } int dy() const { return m_dy; } private: //--------------------------------------------------------------------- int m_dx; int m_dy; int m_dist; }; //===================================================distance_interpolator2 class distance_interpolator2 { public: //--------------------------------------------------------------------- distance_interpolator2() {} distance_interpolator2(int x1, int y1, int x2, int y2, int sx, int sy, int x, int y) : m_dx(x2 - x1), m_dy(y2 - y1), m_dx_start(line_mr(sx) - line_mr(x1)), m_dy_start(line_mr(sy) - line_mr(y1)), m_dist(iround(double(x + line_subpixel_scale/2 - x2) * double(m_dy) - double(y + line_subpixel_scale/2 - y2) * double(m_dx))), m_dist_start((line_mr(x + line_subpixel_scale/2) - line_mr(sx)) * m_dy_start - (line_mr(y + line_subpixel_scale/2) - line_mr(sy)) * m_dx_start) { m_dx <<= line_subpixel_shift; m_dy <<= line_subpixel_shift; m_dx_start <<= line_mr_subpixel_shift; m_dy_start <<= line_mr_subpixel_shift; } distance_interpolator2(int x1, int y1, int x2, int y2, int ex, int ey, int x, int y, int) : m_dx(x2 - x1), m_dy(y2 - y1), m_dx_start(line_mr(ex) - line_mr(x2)), m_dy_start(line_mr(ey) - line_mr(y2)), m_dist(iround(double(x + line_subpixel_scale/2 - x2) * double(m_dy) - double(y + line_subpixel_scale/2 - y2) * double(m_dx))), m_dist_start((line_mr(x + line_subpixel_scale/2) - line_mr(ex)) * m_dy_start - (line_mr(y + line_subpixel_scale/2) - line_mr(ey)) * m_dx_start) { m_dx <<= line_subpixel_shift; m_dy <<= line_subpixel_shift; m_dx_start <<= line_mr_subpixel_shift; m_dy_start <<= line_mr_subpixel_shift; } //--------------------------------------------------------------------- void inc_x() { m_dist += m_dy; m_dist_start += m_dy_start; } void dec_x() { m_dist -= m_dy; m_dist_start -= m_dy_start; } void inc_y() { m_dist -= m_dx; m_dist_start -= m_dx_start; } void dec_y() { m_dist += m_dx; m_dist_start += m_dx_start; } //--------------------------------------------------------------------- void inc_x(int dy) { m_dist += m_dy; m_dist_start += m_dy_start; if(dy > 0) { m_dist -= m_dx; m_dist_start -= m_dx_start; } if(dy < 0) { 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; if(dy > 0) { m_dist -= m_dx; m_dist_start -= m_dx_start; } if(dy < 0) { 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; if(dx > 0) { m_dist += m_dy; m_dist_start += m_dy_start; } if(dx < 0) { 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; if(dx > 0) { m_dist += m_dy; m_dist_start += m_dy_start; } if(dx < 0) { m_dist -= m_dy; m_dist_start -= m_dy_start; } } //--------------------------------------------------------------------- int dist() const { return m_dist; } int dist_start() const { return m_dist_start; } int dist_end() const { return m_dist_start; } //--------------------------------------------------------------------- int dx() const { return m_dx; } int dy() const { return m_dy; } int dx_start() const { return m_dx_start; } int dy_start() const { return m_dy_start; } int dx_end() const { return m_dx_start; } int dy_end() const { return m_dy_start; } private: //--------------------------------------------------------------------- int m_dx; int m_dy; int m_dx_start; int m_dy_start; int m_dist; int m_dist_start; }; //===================================================distance_interpolator3 class distance_interpolator3 { public: //--------------------------------------------------------------------- distance_interpolator3() {} distance_interpolator3(int x1, int y1, int x2, int y2, int sx, int sy, int ex, int ey, int x, int y) : m_dx(x2 - x1), m_dy(y2 - y1), m_dx_start(line_mr(sx) - line_mr(x1)), m_dy_start(line_mr(sy) - line_mr(y1)), m_dx_end(line_mr(ex) - line_mr(x2)), m_dy_end(line_mr(ey) - line_mr(y2)), m_dist(iround(double(x + line_subpixel_scale/2 - x2) * double(m_dy) - double(y + line_subpixel_scale/2 - y2) * double(m_dx))), m_dist_start((line_mr(x + line_subpixel_scale/2) - line_mr(sx)) * m_dy_start - (line_mr(y + line_subpixel_scale/2) - line_mr(sy)) * m_dx_start), m_dist_end((line_mr(x + line_subpixel_scale/2) - line_mr(ex)) * m_dy_end - (line_mr(y + line_subpixel_scale/2) - line_mr(ey)) * m_dx_end) { m_dx <<= line_subpixel_shift; m_dy <<= line_subpixel_shift; m_dx_start <<= line_mr_subpixel_shift; m_dy_start <<= line_mr_subpixel_shift; m_dx_end <<= line_mr_subpixel_shift; m_dy_end <<= line_mr_subpixel_shift; } //--------------------------------------------------------------------- void inc_x() { m_dist += m_dy; m_dist_start += m_dy_start; m_dist_end += m_dy_end; } void dec_x() { m_dist -= m_dy; m_dist_start -= m_dy_start; m_dist_end -= m_dy_end; } void inc_y() { m_dist -= m_dx; m_dist_start -= m_dx_start; m_dist_end -= m_dx_end; } void dec_y() { m_dist += m_dx; m_dist_start += m_dx_start; m_dist_end += m_dx_end; } //--------------------------------------------------------------------- void inc_x(int dy) { 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_end -= m_dx_end; } if(dy < 0) { m_dist += m_dx; m_dist_start += m_dx_start; m_dist_end += m_dx_end; } } //--------------------------------------------------------------------- void dec_x(int dy) { 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_end -= m_dx_end; } if(dy < 0) { m_dist += m_dx; m_dist_start += m_dx_start; m_dist_end += m_dx_end; } } //--------------------------------------------------------------------- void inc_y(int dx) { 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_end += m_dy_end; } if(dx < 0) { m_dist -= m_dy; m_dist_start -= m_dy_start; m_dist_end -= m_dy_end; } } //--------------------------------------------------------------------- void dec_y(int dx) { 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_end += m_dy_end; } if(dx < 0) { m_dist -= m_dy; m_dist_start -= m_dy_start; m_dist_end -= m_dy_end; } } //--------------------------------------------------------------------- int dist() const { return m_dist; } int dist_start() const { return m_dist_start; } int dist_end() const { return m_dist_end; } //--------------------------------------------------------------------- int dx() const { return m_dx; } int dy() const { return m_dy; } int dx_start() const { return m_dx_start; } int dy_start() const { return m_dy_start; } int dx_end() const { return m_dx_end; } int dy_end() const { return m_dy_end; } private: //--------------------------------------------------------------------- int m_dx; int m_dy; int m_dx_start; int m_dy_start; int m_dx_end; int m_dy_end; int m_dist; int m_dist_start; int m_dist_end; }; //================================================line_interpolator_aa_base template<class Renderer> class line_interpolator_aa_base { public: typedef Renderer renderer_type; typedef typename Renderer::color_type color_type; //--------------------------------------------------------------------- enum max_half_width_e { max_half_width = 64 }; //--------------------------------------------------------------------- line_interpolator_aa_base(renderer_type& ren, const line_parameters& lp) : 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) : abs(lp.x2 - lp.x1) + 1), m_ren(ren), m_len((lp.vertical == (lp.inc > 0)) ? -lp.len : lp.len), m_x(lp.x1 >> line_subpixel_shift), m_y(lp.y1 >> line_subpixel_shift), m_old_x(m_x), m_old_y(m_y), m_count((lp.vertical ? abs((lp.y2 >> line_subpixel_shift) - m_y) : abs((lp.x2 >> line_subpixel_shift) - m_x))), m_width(ren.subpixel_width()), //m_max_extent(m_width >> (line_subpixel_shift - 2)), m_max_extent((m_width + line_subpixel_mask) >> line_subpixel_shift), m_step(0) { agg::dda2_line_interpolator li(0, lp.vertical ? (lp.dy << agg::line_subpixel_shift) : (lp.dx << agg::line_subpixel_shift), lp.len); unsigned i; int stop = m_width + line_subpixel_scale * 2; for(i = 0; i < max_half_width; ++i) { m_dist[i] = li.y(); if(m_dist[i] >= stop) break; ++li; } m_dist[i++] = 0x7FFF0000; } //--------------------------------------------------------------------- template<class DI> int step_hor_base(DI& di) { ++m_li; m_x += m_lp->inc; m_y = (m_lp->y1 + m_li.y()) >> line_subpixel_shift; if(m_lp->inc > 0) di.inc_x(m_y - m_old_y); else di.dec_x(m_y - m_old_y); m_old_y = m_y; return di.dist() / m_len; } //--------------------------------------------------------------------- template<class DI> int step_ver_base(DI& di) { ++m_li; m_y += m_lp->inc; m_x = (m_lp->x1 + m_li.y()) >> line_subpixel_shift; if(m_lp->inc > 0) di.inc_y(m_x - m_old_x); else di.dec_y(m_x - m_old_x); m_old_x = m_x; return di.dist() / m_len; } //--------------------------------------------------------------------- bool vertical() const { return m_lp->vertical; } int width() const { return m_width; } int count() const { return m_count; } private: line_interpolator_aa_base(const line_interpolator_aa_base<Renderer>&); const line_interpolator_aa_base<Renderer>& operator = (const line_interpolator_aa_base<Renderer>&); protected: const line_parameters* m_lp; dda2_line_interpolator m_li; renderer_type& m_ren; int m_len; int m_x; int m_y; int m_old_x; int m_old_y; int m_count; int m_width; int m_max_extent; int m_step; int m_dist[max_half_width + 1]; cover_type m_covers[max_half_width * 2 + 4]; }; //====================================================line_interpolator_aa0 template<class Renderer> class line_interpolator_aa0 : public line_interpolator_aa_base<Renderer> { public: typedef Renderer renderer_type; typedef typename Renderer::color_type color_type; typedef line_interpolator_aa_base<Renderer> base_type; //--------------------------------------------------------------------- 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, lp.x1 & ~line_subpixel_mask, lp.y1 & ~line_subpixel_mask) { base_type::m_li.adjust_forward(); } //--------------------------------------------------------------------- bool step_hor() { int dist; int dy; int s1 = base_type::step_hor_base(m_di); cover_type* p0 = base_type::m_covers + base_type::max_half_width + 2; cover_type* p1 = p0; *p1++ = (cover_type)base_type::m_ren.cover(s1); dy = 1; while((dist = base_type::m_dist[dy] - s1) <= base_type::m_width) { *p1++ = (cover_type)base_type::m_ren.cover(dist); ++dy; } dy = 1; while((dist = base_type::m_dist[dy] + s1) <= base_type::m_width) { *--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), p0); return ++base_type::m_step < base_type::m_count; } //--------------------------------------------------------------------- bool step_ver() { int dist; int dx; int s1 = base_type::step_ver_base(m_di); cover_type* p0 = base_type::m_covers + base_type::max_half_width + 2; cover_type* p1 = p0; *p1++ = (cover_type)base_type::m_ren.cover(s1); dx = 1; while((dist = base_type::m_dist[dx] - s1) <= base_type::m_width) { *p1++ = (cover_type)base_type::m_ren.cover(dist); ++dx; } dx = 1; while((dist = base_type::m_dist[dx] + s1) <= base_type::m_width) { *--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_y, 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>& operator = (const line_interpolator_aa0<Renderer>&); //--------------------------------------------------------------------- distance_interpolator1 m_di; }; //====================================================line_interpolator_aa1 template<class Renderer> class line_interpolator_aa1 : public line_interpolator_aa_base<Renderer> { public: typedef Renderer renderer_type; typedef typename Renderer::color_type color_type; typedef line_interpolator_aa_base<Renderer> base_type; //--------------------------------------------------------------------- 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, lp.x1 & ~line_subpixel_mask, lp.y1 & ~line_subpixel_mask) { int dist1_start; int dist2_start; int npix = 1; if(lp.vertical) { do { --base_type::m_li; base_type::m_y -= lp.inc; base_type::m_x = (base_type::m_lp->x1 + base_type::m_li.y()) >> line_subpixel_shift; if(lp.inc > 0) m_di.dec_y(base_type::m_x - base_type::m_old_x); else m_di.inc_y(base_type::m_x - base_type::m_old_x); base_type::m_old_x = base_type::m_x; dist1_start = dist2_start = m_di.dist_start(); int dx = 0; if(dist1_start < 0) ++npix; do { dist1_start += m_di.dy_start(); dist2_start -= m_di.dy_start(); if(dist1_start < 0) ++npix; if(dist2_start < 0) ++npix; ++dx; } while(base_type::m_dist[dx] <= base_type::m_width); --base_type::m_step; if(npix == 0) break; npix = 0; } while(base_type::m_step >= -base_type::m_max_extent); } else { do { --base_type::m_li; base_type::m_x -= lp.inc; base_type::m_y = (base_type::m_lp->y1 + base_type::m_li.y()) >> line_subpixel_shift; if(lp.inc > 0) m_di.dec_x(base_type::m_y - base_type::m_old_y); else m_di.inc_x(base_type::m_y - base_type::m_old_y); base_type::m_old_y = base_type::m_y; dist1_start = dist2_start = m_di.dist_start(); int dy = 0; if(dist1_start < 0) ++npix; do { dist1_start -= m_di.dx_start(); dist2_start += m_di.dx_start(); if(dist1_start < 0) ++npix; if(dist2_start < 0) ++npix; ++dy; } while(base_type::m_dist[dy] <= base_type::m_width); --base_type::m_step; if(npix == 0) break; npix = 0; } while(base_type::m_step >= -base_type::m_max_extent); } base_type::m_li.adjust_forward(); } //--------------------------------------------------------------------- bool step_hor() { int dist_start; int dist; int dy; int s1 = base_type::step_hor_base(m_di); dist_start = m_di.dist_start(); cover_type* p0 = base_type::m_covers + base_type::max_half_width + 2; cover_type* p1 = p0; *p1 = 0; if(dist_start <= 0) { *p1 = (cover_type)base_type::m_ren.cover(s1); } ++p1; dy = 1; while((dist = base_type::m_dist[dy] - s1) <= base_type::m_width) { dist_start -= m_di.dx_start(); *p1 = 0; if(dist_start <= 0) { *p1 = (cover_type)base_type::m_ren.cover(dist); } ++p1; ++dy; } dy = 1; dist_start = m_di.dist_start(); while((dist = base_type::m_dist[dy] + s1) <= base_type::m_width) { 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_y - dy + 1, unsigned(p1 - p0), p0); return ++base_type::m_step < base_type::m_count; } //--------------------------------------------------------------------- bool step_ver() { int dist_start; int dist; int dx; int s1 = base_type::step_ver_base(m_di); cover_type* p0 = base_type::m_covers + base_type::max_half_width + 2; cover_type* p1 = p0; dist_start = m_di.dist_start(); *p1 = 0; if(dist_start <= 0) { *p1 = (cover_type)base_type::m_ren.cover(s1); } ++p1; dx = 1; while((dist = base_type::m_dist[dx] - s1) <= base_type::m_width) { dist_start += m_di.dy_start(); *p1 = 0; if(dist_start <= 0) { *p1 = (cover_type)base_type::m_ren.cover(dist); } ++p1; ++dx; } dx = 1; dist_start = m_di.dist_start(); while((dist = base_type::m_dist[dx] + s1) <= base_type::m_width) { 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_y, 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>& operator = (const line_interpolator_aa1<Renderer>&); //--------------------------------------------------------------------- distance_interpolator2 m_di; }; //====================================================line_interpolator_aa2 template<class Renderer> class line_interpolator_aa2 : public line_interpolator_aa_base<Renderer> { public: typedef Renderer renderer_type; typedef typename Renderer::color_type color_type; typedef line_interpolator_aa_base<Renderer> base_type; //--------------------------------------------------------------------- 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, lp.x1 & ~line_subpixel_mask, lp.y1 & ~line_subpixel_mask, 0) { base_type::m_li.adjust_forward(); base_type::m_step -= base_type::m_max_extent; } //--------------------------------------------------------------------- bool step_hor() { int dist_end; int dist; int dy; int s1 = base_type::step_hor_base(m_di); cover_type* p0 = base_type::m_covers + base_type::max_half_width + 2; cover_type* p1 = p0; dist_end = m_di.dist_end(); int npix = 0; *p1 = 0; if(dist_end > 0) { *p1 = (cover_type)base_type::m_ren.cover(s1); ++npix; } ++p1; dy = 1; while((dist = base_type::m_dist[dy] - s1) <= base_type::m_width) { dist_end -= m_di.dx_end(); *p1 = 0; if(dist_end > 0) { *p1 = (cover_type)base_type::m_ren.cover(dist); ++npix; } ++p1; ++dy; } dy = 1; dist_end = m_di.dist_end(); while((dist = base_type::m_dist[dy] + s1) <= base_type::m_width) { 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), p0); return npix && ++base_type::m_step < base_type::m_count; } //--------------------------------------------------------------------- bool step_ver() { int dist_end; int dist; int dx; int s1 = base_type::step_ver_base(m_di); cover_type* p0 = base_type::m_covers + base_type::max_half_width + 2; cover_type* p1 = p0; dist_end = m_di.dist_end(); int npix = 0; *p1 = 0; if(dist_end > 0) { *p1 = (cover_type)base_type::m_ren.cover(s1); ++npix; } ++p1; dx = 1; while((dist = base_type::m_dist[dx] - s1) <= base_type::m_width) { dist_end += m_di.dy_end(); *p1 = 0; if(dist_end > 0) { *p1 = (cover_type)base_type::m_ren.cover(dist); ++npix; } ++p1; ++dx; } dx = 1; dist_end = m_di.dist_end(); while((dist = base_type::m_dist[dx] + s1) <= base_type::m_width) { 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), 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>& operator = (const line_interpolator_aa2<Renderer>&); //--------------------------------------------------------------------- distance_interpolator2 m_di; }; //====================================================line_interpolator_aa3 template<class Renderer> class line_interpolator_aa3 : public line_interpolator_aa_base<Renderer> { public: typedef Renderer renderer_type; typedef typename Renderer::color_type color_type; typedef line_interpolator_aa_base<Renderer> base_type; //--------------------------------------------------------------------- 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, lp.x1 & ~line_subpixel_mask, lp.y1 & ~line_subpixel_mask) { int dist1_start; int dist2_start; int npix = 1; if(lp.vertical) { do { --base_type::m_li; base_type::m_y -= lp.inc; base_type::m_x = (base_type::m_lp->x1 + base_type::m_li.y()) >> line_subpixel_shift; if(lp.inc > 0) m_di.dec_y(base_type::m_x - base_type::m_old_x); else m_di.inc_y(base_type::m_x - base_type::m_old_x); base_type::m_old_x = base_type::m_x; dist1_start = dist2_start = m_di.dist_start(); int dx = 0; if(dist1_start < 0) ++npix; do { dist1_start += m_di.dy_start(); dist2_start -= m_di.dy_start(); if(dist1_start < 0) ++npix; if(dist2_start < 0) ++npix; ++dx; } while(base_type::m_dist[dx] <= base_type::m_width); if(npix == 0) break; npix = 0; } while(--base_type::m_step >= -base_type::m_max_extent); } else { do { --base_type::m_li; base_type::m_x -= lp.inc; base_type::m_y = (base_type::m_lp->y1 + base_type::m_li.y()) >> line_subpixel_shift; if(lp.inc > 0) m_di.dec_x(base_type::m_y - base_type::m_old_y); else m_di.inc_x(base_type::m_y - base_type::m_old_y); base_type::m_old_y = base_type::m_y; dist1_start = dist2_start = m_di.dist_start(); int dy = 0; if(dist1_start < 0) ++npix; do { dist1_start -= m_di.dx_start(); dist2_start += m_di.dx_start(); if(dist1_start < 0) ++npix; if(dist2_start < 0) ++npix; ++dy; } while(base_type::m_dist[dy] <= base_type::m_width); if(npix == 0) break; npix = 0; } while(--base_type::m_step >= -base_type::m_max_extent); } base_type::m_li.adjust_forward(); base_type::m_step -= base_type::m_max_extent; } //--------------------------------------------------------------------- bool step_hor() { int dist_start; int dist_end; int dist; int dy; int s1 = base_type::step_hor_base(m_di); cover_type* p0 = base_type::m_covers + base_type::max_half_width + 2; cover_type* p1 = p0; dist_start = m_di.dist_start(); dist_end = m_di.dist_end(); int npix = 0; *p1 = 0; if(dist_end > 0) { if(dist_start <= 0) { *p1 = (cover_type)base_type::m_ren.cover(s1); } ++npix; } ++p1; dy = 1; while((dist = base_type::m_dist[dy] - s1) <= base_type::m_width) { dist_start -= m_di.dx_start(); 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; } ++p1; ++dy; } dy = 1; dist_start = m_di.dist_start(); dist_end = m_di.dist_end(); while((dist = base_type::m_dist[dy] + s1) <= base_type::m_width) { dist_start += m_di.dx_start(); 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), p0); return npix && ++base_type::m_step < base_type::m_count; } //--------------------------------------------------------------------- bool step_ver() { int dist_start; int dist_end; int dist; int dx; int s1 = base_type::step_ver_base(m_di); cover_type* p0 = base_type::m_covers + base_type::max_half_width + 2; cover_type* p1 = p0; dist_start = m_di.dist_start(); dist_end = m_di.dist_end(); int npix = 0; *p1 = 0; if(dist_end > 0) { if(dist_start <= 0) { *p1 = (cover_type)base_type::m_ren.cover(s1); } ++npix; } ++p1; dx = 1; while((dist = base_type::m_dist[dx] - s1) <= base_type::m_width) { dist_start += m_di.dy_start(); 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; } ++p1; ++dx; } dx = 1; dist_start = m_di.dist_start(); dist_end = m_di.dist_end(); while((dist = base_type::m_dist[dx] + s1) <= base_type::m_width) { dist_start -= m_di.dy_start(); 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), 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>& operator = (const line_interpolator_aa3<Renderer>&); //--------------------------------------------------------------------- distance_interpolator3 m_di; }; //==========================================================line_profile_aa // // See Implementation agg_line_profile_aa.cpp // class line_profile_aa { public: //--------------------------------------------------------------------- typedef int8u value_type; enum subpixel_scale_e { subpixel_shift = line_subpixel_shift, subpixel_scale = 1 << subpixel_shift, subpixel_mask = subpixel_scale - 1 }; enum aa_scale_e { aa_shift = 8, aa_scale = 1 << aa_shift, aa_mask = aa_scale - 1 }; //--------------------------------------------------------------------- line_profile_aa() : m_subpixel_width(0), m_min_width(1.0), m_smoother_width(1.0) { int i; for(i = 0; i < aa_scale; i++) m_gamma[i] = (value_type)i; } //--------------------------------------------------------------------- template<class GammaF> line_profile_aa(double w, const GammaF& gamma_function) : m_subpixel_width(0), m_min_width(1.0), m_smoother_width(1.0) { gamma(gamma_function); width(w); } //--------------------------------------------------------------------- void min_width(double w) { m_min_width = w; } void smoother_width(double w) { m_smoother_width = w; } //--------------------------------------------------------------------- template<class GammaF> void gamma(const GammaF& gamma_function) { int i; for(i = 0; i < aa_scale; i++) { m_gamma[i] = value_type( uround(gamma_function(double(i) / aa_mask) * aa_mask)); } } void width(double w); unsigned profile_size() const { return m_profile.size(); } int subpixel_width() const { return m_subpixel_width; } //--------------------------------------------------------------------- double min_width() const { return m_min_width; } double smoother_width() const { return m_smoother_width; } //--------------------------------------------------------------------- value_type value(int dist) const { return m_profile[dist + subpixel_scale*2]; } private: line_profile_aa(const line_profile_aa&); const line_profile_aa& operator = (const line_profile_aa&); value_type* profile(double w); void set(double center_width, double smoother_width); //--------------------------------------------------------------------- pod_array<value_type> m_profile; value_type m_gamma[aa_scale]; int m_subpixel_width; double m_min_width; double m_smoother_width; }; //======================================================renderer_outline_aa template<class BaseRenderer> class renderer_outline_aa { public: //--------------------------------------------------------------------- typedef BaseRenderer base_ren_type; typedef renderer_outline_aa<base_ren_type> self_type; typedef typename base_ren_type::color_type color_type; //--------------------------------------------------------------------- renderer_outline_aa(base_ren_type& ren, const line_profile_aa& prof) : m_ren(&ren), m_profile(&prof), m_clip_box(0,0,0,0), m_clipping(false) {} void attach(base_ren_type& ren) { m_ren = &ren; } //--------------------------------------------------------------------- void color(const color_type& c) { m_color = c; } const color_type& color() const { return m_color; } //--------------------------------------------------------------------- void profile(const line_profile_aa& prof) { m_profile = &prof; } const line_profile_aa& profile() const { return *m_profile; } line_profile_aa& profile() { return *m_profile; } //--------------------------------------------------------------------- int subpixel_width() const { return m_profile->subpixel_width(); } //--------------------------------------------------------------------- void reset_clipping() { m_clipping = false; } void clip_box(double x1, double y1, double x2, double y2) { m_clip_box.x1 = line_coord_sat::conv(x1); m_clip_box.y1 = line_coord_sat::conv(y1); m_clip_box.x2 = line_coord_sat::conv(x2); m_clip_box.y2 = line_coord_sat::conv(y2); m_clipping = true; } //--------------------------------------------------------------------- int cover(int d) const { return m_profile->value(d); } //------------------------------------------------------------------------- void blend_solid_hspan(int x, int y, unsigned len, const cover_type* covers) { m_ren->blend_solid_hspan(x, y, len, m_color, covers); } //------------------------------------------------------------------------- void blend_solid_vspan(int x, int y, unsigned len, const cover_type* covers) { m_ren->blend_solid_vspan(x, y, len, m_color, covers); } //------------------------------------------------------------------------- static bool accurate_join_only() { return false; } //------------------------------------------------------------------------- template<class Cmp> void semidot_hline(Cmp cmp, 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]; cover_type* p0 = covers; cover_type* p1 = covers; int x = x1 << line_subpixel_shift; int y = y1 << line_subpixel_shift; int w = subpixel_width(); distance_interpolator0 di(xc1, yc1, xc2, yc2, x, y); x += line_subpixel_scale/2; y += line_subpixel_scale/2; int x0 = x1; int dx = x - xc1; int dy = y - yc1; do { int d = int(fast_sqrt(dx*dx + dy*dy)); *p1 = 0; if(cmp(di.dist()) && d <= w) { *p1 = (cover_type)cover(d); } ++p1; dx += line_subpixel_scale; di.inc_x(); } while(++x1 <= x2); m_ren->blend_solid_hspan(x0, y1, unsigned(p1 - p0), color(), p0); } //------------------------------------------------------------------------- template<class Cmp> void semidot(Cmp cmp, int xc1, int yc1, int xc2, int yc2) { if(m_clipping && clipping_flags(xc1, yc1, m_clip_box)) return; int r = ((subpixel_width() + line_subpixel_mask) >> line_subpixel_shift); if(r < 1) r = 1; ellipse_bresenham_interpolator ei(r, r); int dx = 0; int dy = -r; int dy0 = dy; int dx0 = dx; int x = xc1 >> line_subpixel_shift; int y = yc1 >> line_subpixel_shift; do { dx += ei.dx(); dy += ei.dy(); if(dy != dy0) { semidot_hline(cmp, xc1, yc1, xc2, yc2, x-dx0, y+dy0, x+dx0); semidot_hline(cmp, xc1, yc1, xc2, yc2, x-dx0, y-dy0, x+dx0); } dx0 = dx; dy0 = dy; ++ei; } while(dy < 0); semidot_hline(cmp, xc1, yc1, xc2, yc2, x-dx0, y+dy0, x+dx0); } //------------------------------------------------------------------------- void pie_hline(int xc, int yc, int xp1, int yp1, int xp2, int yp2, int xh1, int yh1, int xh2) { if(m_clipping && clipping_flags(xc, yc, m_clip_box)) return; cover_type covers[line_interpolator_aa_base<self_type>::max_half_width * 2 + 4]; cover_type* p0 = covers; cover_type* p1 = covers; int x = xh1 << line_subpixel_shift; int y = yh1 << line_subpixel_shift; int w = subpixel_width(); distance_interpolator00 di(xc, yc, xp1, yp1, xp2, yp2, x, y); x += line_subpixel_scale/2; y += line_subpixel_scale/2; int xh0 = xh1; int dx = x - xc; int dy = y - yc; do { int d = int(fast_sqrt(dx*dx + dy*dy)); *p1 = 0; if(di.dist1() <= 0 && di.dist2() > 0 && d <= w) { *p1 = (cover_type)cover(d); } ++p1; dx += line_subpixel_scale; di.inc_x(); } while(++xh1 <= xh2); m_ren->blend_solid_hspan(xh0, yh1, unsigned(p1 - p0), color(), p0); } //------------------------------------------------------------------------- void pie(int xc, int yc, int x1, int y1, int x2, int y2) { int r = ((subpixel_width() + line_subpixel_mask) >> line_subpixel_shift); if(r < 1) r = 1; ellipse_bresenham_interpolator ei(r, r); int dx = 0; int dy = -r; int dy0 = dy; int dx0 = dx; int x = xc >> line_subpixel_shift; int y = yc >> line_subpixel_shift; do { dx += ei.dx(); dy += ei.dy(); if(dy != dy0) { pie_hline(xc, yc, x1, y1, x2, y2, x-dx0, y+dy0, x+dx0); pie_hline(xc, yc, x1, y1, x2, y2, x-dx0, y-dy0, x+dx0); } dx0 = dx; dy0 = dy; ++ei; } while(dy < 0); pie_hline(xc, yc, x1, y1, x2, y2, x-dx0, y+dy0, x+dx0); } //------------------------------------------------------------------------- void line0_no_clip(const line_parameters& lp) { if(lp.len > line_max_length) { line_parameters lp1, lp2; lp.divide(lp1, lp2); line0_no_clip(lp1); line0_no_clip(lp2); return; } line_interpolator_aa0<self_type> li(*this, lp); if(li.count()) { if(li.vertical()) { while(li.step_ver()); } else { while(li.step_hor()); } } } //------------------------------------------------------------------------- void line0(const line_parameters& lp) { if(m_clipping) { int x1 = lp.x1; int y1 = lp.y1; int x2 = lp.x2; int y2 = lp.y2; unsigned flags = clip_line_segment(&x1, &y1, &x2, &y2, m_clip_box); if((flags & 4) == 0) { if(flags) { line_parameters lp2(x1, y1, x2, y2, uround(calc_distance(x1, y1, x2, y2))); line0_no_clip(lp2); } else { line0_no_clip(lp); } } } else { line0_no_clip(lp); } } //------------------------------------------------------------------------- void line1_no_clip(const line_parameters& lp, int sx, int sy) { if(lp.len > line_max_length) { line_parameters lp1, lp2; lp.divide(lp1, lp2); line1_no_clip(lp1, (lp.x1 + sx) >> 1, (lp.y1 + sy) >> 1); line1_no_clip(lp2, lp1.x2 + (lp1.y2 - lp1.y1), lp1.y2 - (lp1.x2 - lp1.x1)); return; } fix_degenerate_bisectrix_start(lp, &sx, &sy); line_interpolator_aa1<self_type> li(*this, lp, sx, sy); if(li.vertical()) { while(li.step_ver()); } else { while(li.step_hor()); } } //------------------------------------------------------------------------- void line1(const line_parameters& lp, int sx, int sy) { if(m_clipping) { int x1 = lp.x1; int y1 = lp.y1; int x2 = lp.x2; int y2 = lp.y2; unsigned flags = clip_line_segment(&x1, &y1, &x2, &y2, m_clip_box); if((flags & 4) == 0) { if(flags) { line_parameters lp2(x1, y1, x2, y2, uround(calc_distance(x1, y1, x2, y2))); if(flags & 1) { sx = x1 + (y2 - y1); sy = y1 - (x2 - x1); } else { while(abs(sx - lp.x1) + abs(sy - lp.y1) > lp2.len) { sx = (lp.x1 + sx) >> 1; sy = (lp.y1 + sy) >> 1; } } line1_no_clip(lp2, sx, sy); } else { line1_no_clip(lp, sx, sy); } } } else { line1_no_clip(lp, sx, sy); } } //------------------------------------------------------------------------- void line2_no_clip(const line_parameters& lp, int ex, int ey) { if(lp.len > line_max_length) { line_parameters lp1, lp2; lp.divide(lp1, lp2); line2_no_clip(lp1, lp1.x2 + (lp1.y2 - lp1.y1), lp1.y2 - (lp1.x2 - lp1.x1)); line2_no_clip(lp2, (lp.x2 + ex) >> 1, (lp.y2 + ey) >> 1); return; } fix_degenerate_bisectrix_end(lp, &ex, &ey); line_interpolator_aa2<self_type> li(*this, lp, ex, ey); if(li.vertical()) { while(li.step_ver()); } else { while(li.step_hor()); } } //------------------------------------------------------------------------- void line2(const line_parameters& lp, int ex, int ey) { if(m_clipping) { int x1 = lp.x1; int y1 = lp.y1; int x2 = lp.x2; int y2 = lp.y2; unsigned flags = clip_line_segment(&x1, &y1, &x2, &y2, m_clip_box); if((flags & 4) == 0) { if(flags) { line_parameters lp2(x1, y1, x2, y2, uround(calc_distance(x1, y1, x2, y2))); if(flags & 2) { ex = x2 + (y2 - y1); ey = y2 - (x2 - x1); } else { while(abs(ex - lp.x2) + abs(ey - lp.y2) > lp2.len) { ex = (lp.x2 + ex) >> 1; ey = (lp.y2 + ey) >> 1; } } line2_no_clip(lp2, ex, ey); } else { line2_no_clip(lp, ex, ey); } } } else { line2_no_clip(lp, ex, ey); } } //------------------------------------------------------------------------- void line3_no_clip(const line_parameters& lp, int sx, int sy, int ex, int ey) { if(lp.len > line_max_length) { line_parameters lp1, lp2; lp.divide(lp1, lp2); int mx = lp1.x2 + (lp1.y2 - lp1.y1); int my = lp1.y2 - (lp1.x2 - lp1.x1); line3_no_clip(lp1, (lp.x1 + sx) >> 1, (lp.y1 + sy) >> 1, mx, my); line3_no_clip(lp2, mx, my, (lp.x2 + ex) >> 1, (lp.y2 + ey) >> 1); return; } fix_degenerate_bisectrix_start(lp, &sx, &sy); fix_degenerate_bisectrix_end(lp, &ex, &ey); line_interpolator_aa3<self_type> li(*this, lp, sx, sy, ex, ey); if(li.vertical()) { while(li.step_ver()); } else { while(li.step_hor()); } } //------------------------------------------------------------------------- void line3(const line_parameters& lp, int sx, int sy, int ex, int ey) { if(m_clipping) { int x1 = lp.x1; int y1 = lp.y1; int x2 = lp.x2; int y2 = lp.y2; unsigned flags = clip_line_segment(&x1, &y1, &x2, &y2, m_clip_box); if((flags & 4) == 0) { if(flags) { line_parameters lp2(x1, y1, x2, y2, uround(calc_distance(x1, y1, x2, y2))); if(flags & 1) { sx = x1 + (y2 - y1); sy = y1 - (x2 - x1); } else { while(abs(sx - lp.x1) + abs(sy - lp.y1) > lp2.len) { sx = (lp.x1 + sx) >> 1; sy = (lp.y1 + sy) >> 1; } } if(flags & 2) { ex = x2 + (y2 - y1); ey = y2 - (x2 - x1); } else { while(abs(ex - lp.x2) + abs(ey - lp.y2) > lp2.len) { ex = (lp.x2 + ex) >> 1; ey = (lp.y2 + ey) >> 1; } } line3_no_clip(lp2, sx, sy, ex, ey); } else { line3_no_clip(lp, sx, sy, ex, ey); } } } else { line3_no_clip(lp, sx, sy, ex, ey); } } private: base_ren_type* m_ren; const line_profile_aa* m_profile; color_type m_color; rect_i m_clip_box; bool m_clipping; }; } #endif ������agg-2.5+dfsg1/include/agg_renderer_outline_image.h��������������������������������������������������0000644�0000000�0000000�00000105171�10703246330�022404� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_RENDERER_OUTLINE_IMAGE_INCLUDED #define AGG_RENDERER_OUTLINE_IMAGE_INCLUDED #include "agg_array.h" #include "agg_math.h" #include "agg_line_aa_basics.h" #include "agg_dda_line.h" #include "agg_rendering_buffer.h" #include "agg_clip_liang_barsky.h" namespace agg { //========================================================line_image_scale template<class Source> class line_image_scale { public: typedef typename Source::color_type color_type; line_image_scale(const Source& src, double height) : m_source(src), m_height(height), m_scale(src.height() / height) { } double width() const { return m_source.width(); } double height() const { return m_height; } color_type pixel(int x, int y) const { double src_y = (y + 0.5) * m_scale - 0.5; int h = m_source.height() - 1; int y1 = ufloor(src_y); int y2 = y1 + 1; color_type pix1 = (y1 < 0) ? color_type::no_color() : m_source.pixel(x, y1); color_type pix2 = (y2 > h) ? color_type::no_color() : m_source.pixel(x, y2); return pix1.gradient(pix2, src_y - y1); } private: line_image_scale(const line_image_scale<Source>&); const line_image_scale<Source>& operator = (const line_image_scale<Source>&); const Source& m_source; double m_height; double m_scale; }; //======================================================line_image_pattern template<class Filter> class line_image_pattern { public: typedef Filter filter_type; typedef typename filter_type::color_type color_type; //-------------------------------------------------------------------- line_image_pattern(const Filter& filter) : m_filter(&filter), m_dilation(filter.dilation() + 1), m_dilation_hr(m_dilation << line_subpixel_shift), m_data(), m_width(0), m_height(0), m_width_hr(0), m_half_height_hr(0), m_offset_y_hr(0) { } // Create //-------------------------------------------------------------------- template<class Source> line_image_pattern(const Filter& filter, const Source& src) : m_filter(&filter), m_dilation(filter.dilation() + 1), m_dilation_hr(m_dilation << line_subpixel_shift), m_data(), m_width(0), m_height(0), m_width_hr(0), m_half_height_hr(0), m_offset_y_hr(0) { create(src); } // Create //-------------------------------------------------------------------- template<class Source> void create(const Source& src) { m_height = uceil(src.height()); m_width = uceil(src.width()); m_width_hr = uround(src.width() * line_subpixel_scale); m_half_height_hr = uround(src.height() * line_subpixel_scale/2); m_offset_y_hr = m_dilation_hr + m_half_height_hr - line_subpixel_scale/2; m_half_height_hr += line_subpixel_scale/2; m_data.resize((m_width + m_dilation * 2) * (m_height + m_dilation * 2)); m_buf.attach(&m_data[0], m_width + m_dilation * 2, m_height + m_dilation * 2, m_width + m_dilation * 2); unsigned x, y; color_type* d1; color_type* d2; for(y = 0; y < m_height; y++) { d1 = m_buf.row_ptr(y + m_dilation) + m_dilation; for(x = 0; x < m_width; x++) { *d1++ = src.pixel(x, y); } } const color_type* s1; const color_type* s2; for(y = 0; y < m_dilation; y++) { //s1 = m_buf.row_ptr(m_height + m_dilation - 1) + m_dilation; //s2 = m_buf.row_ptr(m_dilation) + m_dilation; d1 = m_buf.row_ptr(m_dilation + m_height + y) + m_dilation; d2 = m_buf.row_ptr(m_dilation - y - 1) + m_dilation; for(x = 0; x < m_width; x++) { //*d1++ = color_type(*s1++, 0); //*d2++ = color_type(*s2++, 0); *d1++ = color_type::no_color(); *d2++ = color_type::no_color(); } } unsigned h = m_height + m_dilation * 2; for(y = 0; y < h; y++) { s1 = m_buf.row_ptr(y) + m_dilation; s2 = m_buf.row_ptr(y) + m_dilation + m_width; d1 = m_buf.row_ptr(y) + m_dilation + m_width; d2 = m_buf.row_ptr(y) + m_dilation; for(x = 0; x < m_dilation; x++) { *d1++ = *s1++; *--d2 = *--s2; } } } //-------------------------------------------------------------------- int pattern_width() const { return m_width_hr; } int line_width() const { return m_half_height_hr; } double width() const { return m_height; } //-------------------------------------------------------------------- void pixel(color_type* p, int x, int y) const { m_filter->pixel_high_res(m_buf.rows(), p, x % m_width_hr + m_dilation_hr, y + m_offset_y_hr); } //-------------------------------------------------------------------- const filter_type& filter() const { return *m_filter; } private: line_image_pattern(const line_image_pattern<filter_type>&); const line_image_pattern<filter_type>& operator = (const line_image_pattern<filter_type>&); protected: row_ptr_cache<color_type> m_buf; const filter_type* m_filter; unsigned m_dilation; int m_dilation_hr; pod_array<color_type> m_data; unsigned m_width; unsigned m_height; int m_width_hr; int m_half_height_hr; int m_offset_y_hr; }; //=================================================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> 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) { m_mask <<= 1; m_mask |= 1; } m_mask <<= line_subpixel_shift - 1; m_mask |= line_subpixel_mask; base_type::m_width_hr = m_mask + 1; } //-------------------------------------------------------------------- void pixel(color_type* p, int x, int y) const { base_type::m_filter->pixel_high_res( base_type::m_buf.rows(), p, (x & m_mask) + base_type::m_dilation_hr, y + base_type::m_offset_y_hr); } private: unsigned m_mask; }; //===================================================distance_interpolator4 class distance_interpolator4 { public: //--------------------------------------------------------------------- distance_interpolator4() {} distance_interpolator4(int x1, int y1, int x2, int y2, int sx, int sy, int ex, int ey, int len, double scale, int x, int y) : m_dx(x2 - x1), m_dy(y2 - y1), m_dx_start(line_mr(sx) - line_mr(x1)), m_dy_start(line_mr(sy) - line_mr(y1)), m_dx_end(line_mr(ex) - line_mr(x2)), m_dy_end(line_mr(ey) - line_mr(y2)), m_dist(iround(double(x + line_subpixel_scale/2 - x2) * double(m_dy) - double(y + line_subpixel_scale/2 - y2) * double(m_dx))), m_dist_start((line_mr(x + line_subpixel_scale/2) - line_mr(sx)) * m_dy_start - (line_mr(y + line_subpixel_scale/2) - line_mr(sy)) * m_dx_start), m_dist_end((line_mr(x + line_subpixel_scale/2) - line_mr(ex)) * m_dy_end - (line_mr(y + line_subpixel_scale/2) - line_mr(ey)) * m_dx_end), m_len(uround(len / scale)) { double d = len * scale; int dx = iround(((x2 - x1) << line_subpixel_shift) / d); int dy = iround(((y2 - y1) << line_subpixel_shift) / d); m_dx_pict = -dy; m_dy_pict = dx; m_dist_pict = ((x + line_subpixel_scale/2 - (x1 - dy)) * m_dy_pict - (y + line_subpixel_scale/2 - (y1 + dx)) * m_dx_pict) >> line_subpixel_shift; m_dx <<= line_subpixel_shift; m_dy <<= line_subpixel_shift; m_dx_start <<= line_mr_subpixel_shift; m_dy_start <<= line_mr_subpixel_shift; m_dx_end <<= line_mr_subpixel_shift; m_dy_end <<= line_mr_subpixel_shift; } //--------------------------------------------------------------------- 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 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 inc_x(int dy) { 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_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_end += m_dx_end; } } //--------------------------------------------------------------------- void dec_x(int dy) { 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_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_end += m_dx_end; } } //--------------------------------------------------------------------- void inc_y(int dx) { 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_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_end -= m_dy_end; } } //--------------------------------------------------------------------- void dec_y(int dx) { 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_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_end -= m_dy_end; } } //--------------------------------------------------------------------- int dist() const { return m_dist; } int dist_start() const { return m_dist_start; } int dist_pict() const { return m_dist_pict; } int dist_end() const { return m_dist_end; } //--------------------------------------------------------------------- int dx() const { return m_dx; } int dy() const { return m_dy; } int dx_start() const { return m_dx_start; } int dy_start() const { return m_dy_start; } int dx_pict() const { return m_dx_pict; } int dy_pict() const { return m_dy_pict; } int dx_end() const { return m_dx_end; } int dy_end() const { return m_dy_end; } int len() const { return m_len; } private: //--------------------------------------------------------------------- int m_dx; int m_dy; int m_dx_start; int m_dy_start; int m_dx_pict; int m_dy_pict; int m_dx_end; int m_dy_end; int m_dist; int m_dist_start; int m_dist_pict; int m_dist_end; int m_len; }; //==================================================line_interpolator_image template<class Renderer> class line_interpolator_image { public: typedef Renderer renderer_type; typedef typename Renderer::color_type color_type; //--------------------------------------------------------------------- enum max_half_width_e { max_half_width = 64 }; //--------------------------------------------------------------------- line_interpolator_image(renderer_type& ren, const line_parameters& lp, 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) : 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), m_ren(ren), m_x(lp.x1 >> line_subpixel_shift), m_y(lp.y1 >> line_subpixel_shift), m_old_x(m_x), m_old_y(m_y), m_count((lp.vertical ? abs((lp.y2 >> line_subpixel_shift) - m_y) : abs((lp.x2 >> line_subpixel_shift) - m_x))), m_width(ren.subpixel_width()), //m_max_extent(m_width >> (line_subpixel_shift - 2)), m_max_extent((m_width + line_subpixel_scale) >> line_subpixel_shift), m_start(pattern_start + (m_max_extent + 2) * ren.pattern_width()), m_step(0) { agg::dda2_line_interpolator li(0, lp.vertical ? (lp.dy << agg::line_subpixel_shift) : (lp.dx << agg::line_subpixel_shift), lp.len); unsigned i; int stop = m_width + line_subpixel_scale * 2; for(i = 0; i < max_half_width; ++i) { m_dist_pos[i] = li.y(); if(m_dist_pos[i] >= stop) break; ++li; } m_dist_pos[i] = 0x7FFF0000; int dist1_start; int dist2_start; int npix = 1; if(lp.vertical) { do { --m_li; m_y -= lp.inc; m_x = (m_lp.x1 + m_li.y()) >> line_subpixel_shift; if(lp.inc > 0) m_di.dec_y(m_x - m_old_x); else m_di.inc_y(m_x - m_old_x); m_old_x = m_x; dist1_start = dist2_start = m_di.dist_start(); int dx = 0; if(dist1_start < 0) ++npix; do { dist1_start += m_di.dy_start(); dist2_start -= m_di.dy_start(); if(dist1_start < 0) ++npix; if(dist2_start < 0) ++npix; ++dx; } while(m_dist_pos[dx] <= m_width); if(npix == 0) break; npix = 0; } while(--m_step >= -m_max_extent); } else { do { --m_li; m_x -= lp.inc; m_y = (m_lp.y1 + m_li.y()) >> line_subpixel_shift; if(lp.inc > 0) m_di.dec_x(m_y - m_old_y); else m_di.inc_x(m_y - m_old_y); m_old_y = m_y; dist1_start = dist2_start = m_di.dist_start(); int dy = 0; if(dist1_start < 0) ++npix; do { dist1_start -= m_di.dx_start(); dist2_start += m_di.dx_start(); if(dist1_start < 0) ++npix; if(dist2_start < 0) ++npix; ++dy; } while(m_dist_pos[dy] <= m_width); if(npix == 0) break; npix = 0; } while(--m_step >= -m_max_extent); } m_li.adjust_forward(); m_step -= m_max_extent; } //--------------------------------------------------------------------- bool step_hor() { ++m_li; m_x += m_lp.inc; m_y = (m_lp.y1 + m_li.y()) >> line_subpixel_shift; if(m_lp.inc > 0) m_di.inc_x(m_y - m_old_y); else m_di.dec_x(m_y - m_old_y); m_old_y = m_y; int s1 = m_di.dist() / m_lp.len; int s2 = -s1; if(m_lp.inc < 0) s1 = -s1; int dist_start; int dist_pict; int dist_end; int dy; int dist; dist_start = m_di.dist_start(); dist_pict = m_di.dist_pict() + m_start; dist_end = m_di.dist_end(); color_type* p0 = m_colors + max_half_width + 2; color_type* p1 = p0; int npix = 0; p1->clear(); if(dist_end > 0) { if(dist_start <= 0) { m_ren.pixel(p1, dist_pict, s2); } ++npix; } ++p1; dy = 1; while((dist = m_dist_pos[dy]) - s1 <= m_width) { dist_start -= m_di.dx_start(); dist_pict -= m_di.dx_pict(); 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; } ++p1; ++dy; } dy = 1; dist_start = m_di.dist_start(); dist_pict = m_di.dist_pict() + m_start; dist_end = m_di.dist_end(); while((dist = m_dist_pos[dy]) + s1 <= m_width) { dist_start += m_di.dx_start(); dist_pict += m_di.dx_pict(); dist_end += m_di.dx_end(); --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); return npix && ++m_step < m_count; } //--------------------------------------------------------------------- bool step_ver() { ++m_li; m_y += m_lp.inc; m_x = (m_lp.x1 + m_li.y()) >> line_subpixel_shift; if(m_lp.inc > 0) m_di.inc_y(m_x - m_old_x); else m_di.dec_y(m_x - m_old_x); m_old_x = m_x; int s1 = m_di.dist() / m_lp.len; int s2 = -s1; if(m_lp.inc > 0) s1 = -s1; int dist_start; int dist_pict; int dist_end; int dist; int dx; dist_start = m_di.dist_start(); dist_pict = m_di.dist_pict() + m_start; dist_end = m_di.dist_end(); color_type* p0 = m_colors + max_half_width + 2; color_type* p1 = p0; int npix = 0; p1->clear(); if(dist_end > 0) { if(dist_start <= 0) { m_ren.pixel(p1, dist_pict, s2); } ++npix; } ++p1; dx = 1; while((dist = m_dist_pos[dx]) - s1 <= m_width) { dist_start += m_di.dy_start(); dist_pict += m_di.dy_pict(); 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; } ++p1; ++dx; } dx = 1; dist_start = m_di.dist_start(); dist_pict = m_di.dist_pict() + m_start; dist_end = m_di.dist_end(); while((dist = m_dist_pos[dx]) + s1 <= m_width) { dist_start -= m_di.dy_start(); dist_pict -= m_di.dy_pict(); dist_end -= m_di.dy_end(); --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), p0); return npix && ++m_step < m_count; } //--------------------------------------------------------------------- int pattern_end() const { return m_start + m_di.len(); } //--------------------------------------------------------------------- bool vertical() const { return m_lp.vertical; } int width() const { return m_width; } int count() const { return m_count; } private: line_interpolator_image(const line_interpolator_image<Renderer>&); const line_interpolator_image<Renderer>& operator = (const line_interpolator_image<Renderer>&); protected: const line_parameters& m_lp; dda2_line_interpolator m_li; distance_interpolator4 m_di; renderer_type& m_ren; int m_plen; int m_x; int m_y; int m_old_x; int m_old_y; int m_count; int m_width; int m_max_extent; int m_start; int m_step; int m_dist_pos[max_half_width + 1]; color_type m_colors[max_half_width * 2 + 4]; }; //===================================================renderer_outline_image template<class BaseRenderer, class ImagePattern> class renderer_outline_image { public: //--------------------------------------------------------------------- typedef BaseRenderer base_ren_type; typedef renderer_outline_image<BaseRenderer, ImagePattern> self_type; typedef typename base_ren_type::color_type color_type; typedef ImagePattern pattern_type; //--------------------------------------------------------------------- renderer_outline_image(base_ren_type& ren, const pattern_type& patt) : m_ren(&ren), m_pattern(&patt), m_start(0), m_scale_x(1.0), m_clip_box(0,0,0,0), m_clipping(false) {} void attach(base_ren_type& ren) { m_ren = &ren; } //--------------------------------------------------------------------- void pattern(const pattern_type& p) { m_pattern = &p; } const pattern_type& pattern() const { return *m_pattern; } //--------------------------------------------------------------------- void reset_clipping() { m_clipping = false; } void clip_box(double x1, double y1, double x2, double y2) { m_clip_box.x1 = line_coord_sat::conv(x1); m_clip_box.y1 = line_coord_sat::conv(y1); m_clip_box.x2 = line_coord_sat::conv(x2); m_clip_box.y2 = line_coord_sat::conv(y2); m_clipping = true; } //--------------------------------------------------------------------- void scale_x(double s) { m_scale_x = s; } double scale_x() const { return m_scale_x; } //--------------------------------------------------------------------- void start_x(double s) { m_start = iround(s * line_subpixel_scale); } double start_x() const { return double(m_start) / line_subpixel_scale; } //--------------------------------------------------------------------- int subpixel_width() const { return m_pattern->line_width(); } int pattern_width() const { return m_pattern->pattern_width(); } double width() const { return double(subpixel_width()) / line_subpixel_scale; } //------------------------------------------------------------------------- void pixel(color_type* p, int x, int y) const { m_pattern->pixel(p, x, y); } //------------------------------------------------------------------------- void blend_color_hspan(int x, int y, unsigned len, const color_type* colors) { m_ren->blend_color_hspan(x, y, len, colors, 0); } //------------------------------------------------------------------------- void blend_color_vspan(int x, int y, unsigned len, const color_type* colors) { m_ren->blend_color_vspan(x, y, len, colors, 0); } //------------------------------------------------------------------------- static bool accurate_join_only() { return true; } //------------------------------------------------------------------------- template<class Cmp> void semidot(Cmp, int, int, int, int) { } //------------------------------------------------------------------------- void pie(int, int, int, int, int, int) { } //------------------------------------------------------------------------- void line0(const line_parameters&) { } //------------------------------------------------------------------------- void line1(const line_parameters&, int, int) { } //------------------------------------------------------------------------- void line2(const line_parameters&, int, int) { } //------------------------------------------------------------------------- void line3_no_clip(const line_parameters& lp, int sx, int sy, int ex, int ey) { if(lp.len > line_max_length) { line_parameters lp1, lp2; lp.divide(lp1, lp2); int mx = lp1.x2 + (lp1.y2 - lp1.y1); int my = lp1.y2 - (lp1.x2 - lp1.x1); line3_no_clip(lp1, (lp.x1 + sx) >> 1, (lp.y1 + sy) >> 1, mx, my); line3_no_clip(lp2, mx, my, (lp.x2 + ex) >> 1, (lp.y2 + ey) >> 1); return; } 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, m_start, m_scale_x); if(li.vertical()) { while(li.step_ver()); } else { while(li.step_hor()); } m_start += uround(lp.len / m_scale_x); } //------------------------------------------------------------------------- void line3(const line_parameters& lp, int sx, int sy, int ex, int ey) { if(m_clipping) { int x1 = lp.x1; int y1 = lp.y1; int x2 = lp.x2; int y2 = lp.y2; unsigned flags = clip_line_segment(&x1, &y1, &x2, &y2, m_clip_box); int start = m_start; if((flags & 4) == 0) { if(flags) { line_parameters lp2(x1, y1, x2, y2, uround(calc_distance(x1, y1, x2, y2))); if(flags & 1) { m_start += uround(calc_distance(lp.x1, lp.y1, x1, y1) / m_scale_x); sx = x1 + (y2 - y1); sy = y1 - (x2 - x1); } else { while(abs(sx - lp.x1) + abs(sy - lp.y1) > lp2.len) { sx = (lp.x1 + sx) >> 1; sy = (lp.y1 + sy) >> 1; } } if(flags & 2) { ex = x2 + (y2 - y1); ey = y2 - (x2 - x1); } else { while(abs(ex - lp.x2) + abs(ey - lp.y2) > lp2.len) { ex = (lp.x2 + ex) >> 1; ey = (lp.y2 + ey) >> 1; } } line3_no_clip(lp2, sx, sy, ex, ey); } else { line3_no_clip(lp, sx, sy, ex, ey); } } m_start = start + uround(lp.len / m_scale_x); } else { line3_no_clip(lp, sx, sy, ex, ey); } } private: base_ren_type* m_ren; const pattern_type* m_pattern; int m_start; double m_scale_x; rect_i m_clip_box; bool m_clipping; }; } #endif �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_renderer_primitives.h�����������������������������������������������������0000644�0000000�0000000�00000017563�10703246330�021765� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_RENDERER_PRIMITIVES_INCLUDED #define AGG_RENDERER_PRIMITIVES_INCLUDED #include "agg_basics.h" #include "agg_renderer_base.h" #include "agg_dda_line.h" #include "agg_ellipse_bresenham.h" namespace agg { //-----------------------------------------------------renderer_primitives template<class BaseRenderer> class renderer_primitives { public: typedef BaseRenderer base_ren_type; typedef typename base_ren_type::color_type color_type; //-------------------------------------------------------------------- explicit renderer_primitives(base_ren_type& ren) : m_ren(&ren), m_fill_color(), m_line_color(), m_curr_x(0), m_curr_y(0) {} void attach(base_ren_type& ren) { m_ren = &ren; } //-------------------------------------------------------------------- static int coord(double c) { return iround(c * line_bresenham_interpolator::subpixel_scale); } //-------------------------------------------------------------------- void fill_color(const color_type& c) { m_fill_color = c; } void line_color(const color_type& c) { m_line_color = c; } const color_type& fill_color() const { return m_fill_color; } const color_type& line_color() const { return m_line_color; } //-------------------------------------------------------------------- void rectangle(int x1, int y1, int x2, int y2) { m_ren->blend_hline(x1, y1, x2-1, m_line_color, cover_full); m_ren->blend_vline(x2, y1, y2-1, m_line_color, cover_full); m_ren->blend_hline(x1+1, y2, x2, m_line_color, cover_full); m_ren->blend_vline(x1, y1+1, y2, m_line_color, cover_full); } //-------------------------------------------------------------------- void solid_rectangle(int x1, int y1, int x2, int y2) { m_ren->blend_bar(x1, y1, x2, y2, m_fill_color, cover_full); } //-------------------------------------------------------------------- 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); } //-------------------------------------------------------------------- void ellipse(int x, int y, int rx, int ry) { ellipse_bresenham_interpolator ei(rx, ry); int dx = 0; int dy = -ry; do { dx += ei.dx(); dy += ei.dy(); m_ren->blend_pixel(x + dx, y + dy, m_line_color, cover_full); m_ren->blend_pixel(x + dx, y - dy, m_line_color, cover_full); m_ren->blend_pixel(x - dx, y - dy, m_line_color, cover_full); m_ren->blend_pixel(x - dx, y + dy, m_line_color, cover_full); ++ei; } while(dy < 0); } //-------------------------------------------------------------------- void solid_ellipse(int x, int y, int rx, int ry) { ellipse_bresenham_interpolator ei(rx, ry); int dx = 0; int dy = -ry; int dy0 = dy; int dx0 = dx; do { dx += ei.dx(); dy += ei.dy(); if(dy != dy0) { m_ren->blend_hline(x-dx0, y+dy0, x+dx0, m_fill_color, cover_full); m_ren->blend_hline(x-dx0, y-dy0, x+dx0, m_fill_color, cover_full); } dx0 = dx; dy0 = dy; ++ei; } while(dy < 0); m_ren->blend_hline(x-dx0, y+dy0, x+dx0, m_fill_color, cover_full); } //-------------------------------------------------------------------- void outlined_ellipse(int x, int y, int rx, int ry) { ellipse_bresenham_interpolator ei(rx, ry); int dx = 0; int dy = -ry; do { dx += ei.dx(); dy += ei.dy(); m_ren->blend_pixel(x + dx, y + dy, m_line_color, cover_full); m_ren->blend_pixel(x + dx, y - dy, m_line_color, cover_full); m_ren->blend_pixel(x - dx, y - dy, m_line_color, cover_full); m_ren->blend_pixel(x - dx, y + dy, m_line_color, cover_full); if(ei.dy() && dx) { m_ren->blend_hline(x-dx+1, y+dy, x+dx-1, m_fill_color, cover_full); m_ren->blend_hline(x-dx+1, y-dy, x+dx-1, m_fill_color, cover_full); } ++ei; } while(dy < 0); } //-------------------------------------------------------------------- void line(int x1, int y1, int x2, int y2, bool last=false) { line_bresenham_interpolator li(x1, y1, x2, y2); unsigned len = li.len(); if(len == 0) { if(last) { m_ren->blend_pixel(li.line_lr(x1), li.line_lr(y1), m_line_color, cover_full); } return; } if(last) ++len; if(li.is_ver()) { do { m_ren->blend_pixel(li.x2(), li.y1(), m_line_color, cover_full); li.vstep(); } while(--len); } else { do { m_ren->blend_pixel(li.x1(), li.y2(), m_line_color, cover_full); li.hstep(); } while(--len); } } //-------------------------------------------------------------------- void move_to(int x, int y) { m_curr_x = x; m_curr_y = y; } //-------------------------------------------------------------------- void line_to(int x, int y, bool last=false) { line(m_curr_x, m_curr_y, x, y, last); m_curr_x = x; m_curr_y = y; } //-------------------------------------------------------------------- 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(); } rendering_buffer& rbuf() { return m_ren->rbuf(); } private: base_ren_type* m_ren; color_type m_fill_color; color_type m_line_color; int m_curr_x; int m_curr_y; }; } #endif ���������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_renderer_raster_text.h����������������������������������������������������0000644�0000000�0000000�00000021573�10703246330�022132� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_RENDERER_RASTER_TEXT_INCLUDED #define AGG_RENDERER_RASTER_TEXT_INCLUDED #include "agg_basics.h" namespace agg { //==============================================renderer_raster_htext_solid template<class BaseRenderer, class GlyphGenerator> class renderer_raster_htext_solid { public: typedef BaseRenderer ren_type; typedef GlyphGenerator glyph_gen_type; typedef typename glyph_gen_type::glyph_rect glyph_rect; typedef typename ren_type::color_type color_type; renderer_raster_htext_solid(ren_type& ren, glyph_gen_type& glyph) : m_ren(&ren), m_glyph(&glyph) {} void attach(ren_type& ren) { m_ren = &ren; } //-------------------------------------------------------------------- void color(const color_type& c) { m_color = c; } const color_type& color() const { return m_color; } //-------------------------------------------------------------------- template<class CharT> void render_text(double x, double y, const CharT* str, bool flip=false) { glyph_rect r; while(*str) { m_glyph->prepare(&r, x, y, *str, flip); if(r.x2 >= r.x1) { int i; if(flip) { for(i = r.y1; i <= r.y2; i++) { m_ren->blend_solid_hspan(r.x1, i, (r.x2 - r.x1 + 1), m_color, m_glyph->span(r.y2 - i)); } } else { for(i = r.y1; i <= r.y2; i++) { m_ren->blend_solid_hspan(r.x1, i, (r.x2 - r.x1 + 1), m_color, m_glyph->span(i - r.y1)); } } } x += r.dx; y += r.dy; ++str; } } private: ren_type* m_ren; glyph_gen_type* m_glyph; color_type m_color; }; //=============================================renderer_raster_vtext_solid template<class BaseRenderer, class GlyphGenerator> class renderer_raster_vtext_solid { public: typedef BaseRenderer ren_type; typedef GlyphGenerator glyph_gen_type; typedef typename glyph_gen_type::glyph_rect glyph_rect; typedef typename ren_type::color_type color_type; renderer_raster_vtext_solid(ren_type& ren, glyph_gen_type& glyph) : m_ren(&ren), m_glyph(&glyph) { } //-------------------------------------------------------------------- void color(const color_type& c) { m_color = c; } const color_type& color() const { return m_color; } //-------------------------------------------------------------------- template<class CharT> void render_text(double x, double y, const CharT* str, bool flip=false) { glyph_rect r; while(*str) { m_glyph->prepare(&r, x, y, *str, !flip); if(r.x2 >= r.x1) { int i; if(flip) { for(i = r.y1; i <= r.y2; i++) { m_ren->blend_solid_vspan(i, r.x1, (r.x2 - r.x1 + 1), m_color, m_glyph->span(i - r.y1)); } } else { for(i = r.y1; i <= r.y2; i++) { m_ren->blend_solid_vspan(i, r.x1, (r.x2 - r.x1 + 1), m_color, m_glyph->span(r.y2 - i)); } } } x += r.dx; y += r.dy; ++str; } } private: ren_type* m_ren; glyph_gen_type* m_glyph; color_type m_color; }; //===================================================renderer_raster_htext template<class ScanlineRenderer, class GlyphGenerator> class renderer_raster_htext { public: typedef ScanlineRenderer ren_type; typedef GlyphGenerator glyph_gen_type; typedef typename glyph_gen_type::glyph_rect glyph_rect; class scanline_single_span { public: typedef agg::cover_type cover_type; //---------------------------------------------------------------- struct const_span { int x; unsigned len; const cover_type* covers; const_span() {} const_span(int x_, unsigned len_, const cover_type* covers_) : x(x_), len(len_), covers(covers_) {} }; typedef const const_span* const_iterator; //---------------------------------------------------------------- scanline_single_span(int x, int y, unsigned len, const cover_type* covers) : m_y(y), m_span(x, len, covers) {} //---------------------------------------------------------------- int y() const { return m_y; } unsigned num_spans() const { return 1; } const_iterator begin() const { return &m_span; } private: //---------------------------------------------------------------- int m_y; const_span m_span; }; //-------------------------------------------------------------------- renderer_raster_htext(ren_type& ren, glyph_gen_type& glyph) : m_ren(&ren), m_glyph(&glyph) { } //-------------------------------------------------------------------- template<class CharT> void render_text(double x, double y, const CharT* str, bool flip=false) { glyph_rect r; while(*str) { m_glyph->prepare(&r, x, y, *str, flip); if(r.x2 >= r.x1) { m_ren->prepare(); int i; if(flip) { for(i = r.y1; i <= r.y2; i++) { m_ren->render( scanline_single_span(r.x1, i, (r.x2 - r.x1 + 1), m_glyph->span(r.y2 - i))); } } else { for(i = r.y1; i <= r.y2; i++) { m_ren->render( scanline_single_span(r.x1, i, (r.x2 - r.x1 + 1), m_glyph->span(i - r.y1))); } } } x += r.dx; y += r.dy; ++str; } } private: ren_type* m_ren; glyph_gen_type* m_glyph; }; } #endif �������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_renderer_scanline.h�������������������������������������������������������0000644�0000000�0000000�00000103336�10703246330�021360� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_RENDERER_SCANLINE_INCLUDED #define AGG_RENDERER_SCANLINE_INCLUDED #include "agg_basics.h" #include "agg_renderer_base.h" namespace agg { //================================================render_scanline_aa_solid template<class Scanline, class BaseRenderer, class ColorT> void render_scanline_aa_solid(const Scanline& sl, BaseRenderer& ren, const ColorT& color) { int y = sl.y(); unsigned num_spans = sl.num_spans(); typename Scanline::const_iterator span = sl.begin(); for(;;) { int x = span->x; if(span->len > 0) { ren.blend_solid_hspan(x, y, (unsigned)span->len, color, span->covers); } else { ren.blend_hline(x, y, (unsigned)(x - span->len - 1), color, *(span->covers)); } if(--num_spans == 0) break; ++span; } } //===============================================render_scanlines_aa_solid template<class Rasterizer, class Scanline, class BaseRenderer, class ColorT> void render_scanlines_aa_solid(Rasterizer& ras, Scanline& sl, BaseRenderer& ren, const ColorT& color) { if(ras.rewind_scanlines()) { // Explicitly convert "color" to the BaseRenderer color type. // For example, it can be called with color type "rgba", while // "rgba8" is needed. Otherwise it will be implicitly // converted in the loop many times. //---------------------- typename BaseRenderer::color_type ren_color(color); sl.reset(ras.min_x(), ras.max_x()); while(ras.sweep_scanline(sl)) { //render_scanline_aa_solid(sl, ren, ren_color); // This code is equivalent to the above call (copy/paste). // It's just a "manual" optimization for old compilers, // like Microsoft Visual C++ v6.0 //------------------------------- int y = sl.y(); unsigned num_spans = sl.num_spans(); typename Scanline::const_iterator span = sl.begin(); for(;;) { int x = span->x; if(span->len > 0) { ren.blend_solid_hspan(x, y, (unsigned)span->len, ren_color, span->covers); } else { ren.blend_hline(x, y, (unsigned)(x - span->len - 1), ren_color, *(span->covers)); } if(--num_spans == 0) break; ++span; } } } } //==============================================renderer_scanline_aa_solid template<class BaseRenderer> class renderer_scanline_aa_solid { public: typedef BaseRenderer base_ren_type; typedef typename base_ren_type::color_type color_type; //-------------------------------------------------------------------- renderer_scanline_aa_solid() : m_ren(0) {} explicit renderer_scanline_aa_solid(base_ren_type& ren) : m_ren(&ren) {} void attach(base_ren_type& ren) { m_ren = &ren; } //-------------------------------------------------------------------- void color(const color_type& c) { m_color = c; } const color_type& color() const { return m_color; } //-------------------------------------------------------------------- void prepare() {} //-------------------------------------------------------------------- template<class Scanline> void render(const Scanline& sl) { render_scanline_aa_solid(sl, *m_ren, m_color); } private: base_ren_type* m_ren; color_type m_color; }; //======================================================render_scanline_aa template<class Scanline, class BaseRenderer, class SpanAllocator, class SpanGenerator> void render_scanline_aa(const Scanline& sl, BaseRenderer& ren, SpanAllocator& alloc, SpanGenerator& span_gen) { int y = sl.y(); unsigned num_spans = sl.num_spans(); typename Scanline::const_iterator span = sl.begin(); for(;;) { int x = span->x; int len = span->len; const typename Scanline::cover_type* covers = span->covers; if(len < 0) len = -len; typename BaseRenderer::color_type* colors = alloc.allocate(len); span_gen.generate(colors, x, y, len); ren.blend_color_hspan(x, y, len, colors, (span->len < 0) ? 0 : covers, *covers); if(--num_spans == 0) break; ++span; } } //=====================================================render_scanlines_aa template<class Rasterizer, class Scanline, class BaseRenderer, class SpanAllocator, class SpanGenerator> void render_scanlines_aa(Rasterizer& ras, Scanline& sl, BaseRenderer& ren, SpanAllocator& alloc, SpanGenerator& span_gen) { if(ras.rewind_scanlines()) { sl.reset(ras.min_x(), ras.max_x()); span_gen.prepare(); while(ras.sweep_scanline(sl)) { render_scanline_aa(sl, ren, alloc, span_gen); } } } //====================================================renderer_scanline_aa template<class BaseRenderer, class SpanAllocator, class SpanGenerator> class renderer_scanline_aa { public: typedef BaseRenderer base_ren_type; typedef SpanAllocator alloc_type; typedef SpanGenerator span_gen_type; //-------------------------------------------------------------------- renderer_scanline_aa() : m_ren(0), m_alloc(0), m_span_gen(0) {} renderer_scanline_aa(base_ren_type& ren, alloc_type& alloc, span_gen_type& span_gen) : m_ren(&ren), m_alloc(&alloc), m_span_gen(&span_gen) {} void attach(base_ren_type& ren, alloc_type& alloc, span_gen_type& span_gen) { m_ren = &ren; m_alloc = &alloc; m_span_gen = &span_gen; } //-------------------------------------------------------------------- void prepare() { m_span_gen->prepare(); } //-------------------------------------------------------------------- template<class Scanline> void render(const Scanline& sl) { render_scanline_aa(sl, *m_ren, *m_alloc, *m_span_gen); } private: base_ren_type* m_ren; alloc_type* m_alloc; span_gen_type* m_span_gen; }; //===============================================render_scanline_bin_solid template<class Scanline, class BaseRenderer, class ColorT> void render_scanline_bin_solid(const Scanline& sl, BaseRenderer& ren, const ColorT& color) { unsigned num_spans = sl.num_spans(); typename Scanline::const_iterator span = sl.begin(); for(;;) { ren.blend_hline(span->x, sl.y(), span->x - 1 + ((span->len < 0) ? -span->len : span->len), color, cover_full); if(--num_spans == 0) break; ++span; } } //==============================================render_scanlines_bin_solid template<class Rasterizer, class Scanline, class BaseRenderer, class ColorT> void render_scanlines_bin_solid(Rasterizer& ras, Scanline& sl, BaseRenderer& ren, const ColorT& color) { if(ras.rewind_scanlines()) { // Explicitly convert "color" to the BaseRenderer color type. // For example, it can be called with color type "rgba", while // "rgba8" is needed. Otherwise it will be implicitly // converted in the loop many times. //---------------------- typename BaseRenderer::color_type ren_color(color); sl.reset(ras.min_x(), ras.max_x()); while(ras.sweep_scanline(sl)) { //render_scanline_bin_solid(sl, ren, ren_color); // This code is equivalent to the above call (copy/paste). // It's just a "manual" optimization for old compilers, // like Microsoft Visual C++ v6.0 //------------------------------- unsigned num_spans = sl.num_spans(); typename Scanline::const_iterator span = sl.begin(); for(;;) { ren.blend_hline(span->x, sl.y(), span->x - 1 + ((span->len < 0) ? -span->len : span->len), ren_color, cover_full); if(--num_spans == 0) break; ++span; } } } } //=============================================renderer_scanline_bin_solid template<class BaseRenderer> class renderer_scanline_bin_solid { public: typedef BaseRenderer base_ren_type; typedef typename base_ren_type::color_type color_type; //-------------------------------------------------------------------- renderer_scanline_bin_solid() : m_ren(0) {} explicit renderer_scanline_bin_solid(base_ren_type& ren) : m_ren(&ren) {} void attach(base_ren_type& ren) { m_ren = &ren; } //-------------------------------------------------------------------- void color(const color_type& c) { m_color = c; } const color_type& color() const { return m_color; } //-------------------------------------------------------------------- void prepare() {} //-------------------------------------------------------------------- template<class Scanline> void render(const Scanline& sl) { render_scanline_bin_solid(sl, *m_ren, m_color); } private: base_ren_type* m_ren; color_type m_color; }; //======================================================render_scanline_bin template<class Scanline, class BaseRenderer, class SpanAllocator, class SpanGenerator> void render_scanline_bin(const Scanline& sl, BaseRenderer& ren, SpanAllocator& alloc, SpanGenerator& span_gen) { int y = sl.y(); unsigned num_spans = sl.num_spans(); typename Scanline::const_iterator span = sl.begin(); for(;;) { int x = span->x; int len = span->len; if(len < 0) len = -len; typename BaseRenderer::color_type* colors = alloc.allocate(len); span_gen.generate(colors, x, y, len); ren.blend_color_hspan(x, y, len, colors, 0, cover_full); if(--num_spans == 0) break; ++span; } } //=====================================================render_scanlines_bin template<class Rasterizer, class Scanline, class BaseRenderer, class SpanAllocator, class SpanGenerator> void render_scanlines_bin(Rasterizer& ras, Scanline& sl, BaseRenderer& ren, SpanAllocator& alloc, SpanGenerator& span_gen) { if(ras.rewind_scanlines()) { sl.reset(ras.min_x(), ras.max_x()); span_gen.prepare(); while(ras.sweep_scanline(sl)) { render_scanline_bin(sl, ren, alloc, span_gen); } } } //====================================================renderer_scanline_bin template<class BaseRenderer, class SpanAllocator, class SpanGenerator> class renderer_scanline_bin { public: typedef BaseRenderer base_ren_type; typedef SpanAllocator alloc_type; typedef SpanGenerator span_gen_type; //-------------------------------------------------------------------- renderer_scanline_bin() : m_ren(0), m_alloc(0), m_span_gen(0) {} renderer_scanline_bin(base_ren_type& ren, alloc_type& alloc, span_gen_type& span_gen) : m_ren(&ren), m_alloc(&alloc), m_span_gen(&span_gen) {} void attach(base_ren_type& ren, alloc_type& alloc, span_gen_type& span_gen) { m_ren = &ren; m_alloc = &alloc; m_span_gen = &span_gen; } //-------------------------------------------------------------------- void prepare() { m_span_gen->prepare(); } //-------------------------------------------------------------------- template<class Scanline> void render(const Scanline& sl) { render_scanline_bin(sl, *m_ren, *m_alloc, *m_span_gen); } private: base_ren_type* m_ren; alloc_type* m_alloc; span_gen_type* m_span_gen; }; //========================================================render_scanlines template<class Rasterizer, class Scanline, class Renderer> void render_scanlines(Rasterizer& ras, Scanline& sl, Renderer& ren) { if(ras.rewind_scanlines()) { sl.reset(ras.min_x(), ras.max_x()); ren.prepare(); while(ras.sweep_scanline(sl)) { ren.render(sl); } } } //========================================================render_all_paths template<class Rasterizer, class Scanline, class Renderer, class VertexSource, class ColorStorage, class PathId> void render_all_paths(Rasterizer& ras, Scanline& sl, Renderer& r, VertexSource& vs, const ColorStorage& as, const PathId& path_id, unsigned num_paths) { for(unsigned i = 0; i < num_paths; i++) { ras.reset(); ras.add_path(vs, path_id[i]); r.color(as[i]); render_scanlines(ras, sl, r); } } //=============================================render_scanlines_compound template<class Rasterizer, class ScanlineAA, class ScanlineBin, class BaseRenderer, class SpanAllocator, class StyleHandler> void render_scanlines_compound(Rasterizer& ras, ScanlineAA& sl_aa, ScanlineBin& sl_bin, BaseRenderer& ren, SpanAllocator& alloc, StyleHandler& sh) { if(ras.rewind_scanlines()) { int min_x = ras.min_x(); int len = ras.max_x() - min_x + 2; sl_aa.reset(min_x, ras.max_x()); sl_bin.reset(min_x, ras.max_x()); typedef typename BaseRenderer::color_type color_type; color_type* color_span = alloc.allocate(len * 2); color_type* mix_buffer = color_span + len; unsigned num_spans; unsigned num_styles; unsigned style; bool solid; while((num_styles = ras.sweep_styles()) > 0) { typename ScanlineAA::const_iterator span_aa; if(num_styles == 1) { // Optimization for a single style. Happens often //------------------------- if(ras.sweep_scanline(sl_aa, 0)) { style = ras.style(0); if(sh.is_solid(style)) { // Just solid fill //----------------------- render_scanline_aa_solid(sl_aa, ren, sh.color(style)); } else { // Arbitrary span generator //----------------------- span_aa = sl_aa.begin(); num_spans = sl_aa.num_spans(); for(;;) { len = span_aa->len; sh.generate_span(color_span, span_aa->x, sl_aa.y(), len, style); ren.blend_color_hspan(span_aa->x, sl_aa.y(), span_aa->len, color_span, span_aa->covers); if(--num_spans == 0) break; ++span_aa; } } } } else { if(ras.sweep_scanline(sl_bin, -1)) { // Clear the spans of the mix_buffer //-------------------- typename ScanlineBin::const_iterator span_bin = sl_bin.begin(); num_spans = sl_bin.num_spans(); for(;;) { memset(mix_buffer + span_bin->x - min_x, 0, span_bin->len * sizeof(color_type)); if(--num_spans == 0) break; ++span_bin; } unsigned i; for(i = 0; i < num_styles; i++) { style = ras.style(i); solid = sh.is_solid(style); if(ras.sweep_scanline(sl_aa, i)) { color_type* colors; color_type* cspan; typename ScanlineAA::cover_type* covers; span_aa = sl_aa.begin(); num_spans = sl_aa.num_spans(); if(solid) { // Just solid fill //----------------------- for(;;) { color_type c = sh.color(style); len = span_aa->len; colors = mix_buffer + span_aa->x - min_x; covers = span_aa->covers; do { if(*covers == cover_full) { *colors = c; } else { colors->add(c, *covers); } ++colors; ++covers; } while(--len); if(--num_spans == 0) break; ++span_aa; } } else { // Arbitrary span generator //----------------------- for(;;) { len = span_aa->len; colors = mix_buffer + span_aa->x - min_x; cspan = color_span; sh.generate_span(cspan, span_aa->x, sl_aa.y(), len, style); covers = span_aa->covers; do { if(*covers == cover_full) { *colors = *cspan; } else { colors->add(*cspan, *covers); } ++cspan; ++colors; ++covers; } while(--len); if(--num_spans == 0) break; ++span_aa; } } } } // Emit the blended result as a color hspan //------------------------- span_bin = sl_bin.begin(); num_spans = sl_bin.num_spans(); for(;;) { ren.blend_color_hspan(span_bin->x, sl_bin.y(), span_bin->len, mix_buffer + span_bin->x - min_x, 0, cover_full); if(--num_spans == 0) break; ++span_bin; } } // if(ras.sweep_scanline(sl_bin, -1)) } // if(num_styles == 1) ... else } // while((num_styles = ras.sweep_styles()) > 0) } // if(ras.rewind_scanlines()) } //=======================================render_scanlines_compound_layered template<class Rasterizer, class ScanlineAA, class BaseRenderer, class SpanAllocator, class StyleHandler> void render_scanlines_compound_layered(Rasterizer& ras, ScanlineAA& sl_aa, BaseRenderer& ren, SpanAllocator& alloc, StyleHandler& sh) { if(ras.rewind_scanlines()) { int min_x = ras.min_x(); int len = ras.max_x() - min_x + 2; sl_aa.reset(min_x, ras.max_x()); typedef typename BaseRenderer::color_type color_type; color_type* color_span = alloc.allocate(len * 2); color_type* mix_buffer = color_span + len; cover_type* cover_buffer = ras.allocate_cover_buffer(len); unsigned num_spans; unsigned num_styles; unsigned style; bool solid; while((num_styles = ras.sweep_styles()) > 0) { typename ScanlineAA::const_iterator span_aa; if(num_styles == 1) { // Optimization for a single style. Happens often //------------------------- if(ras.sweep_scanline(sl_aa, 0)) { style = ras.style(0); if(sh.is_solid(style)) { // Just solid fill //----------------------- render_scanline_aa_solid(sl_aa, ren, sh.color(style)); } else { // Arbitrary span generator //----------------------- span_aa = sl_aa.begin(); num_spans = sl_aa.num_spans(); for(;;) { len = span_aa->len; sh.generate_span(color_span, span_aa->x, sl_aa.y(), len, style); ren.blend_color_hspan(span_aa->x, sl_aa.y(), span_aa->len, color_span, span_aa->covers); if(--num_spans == 0) break; ++span_aa; } } } } else { int sl_start = ras.scanline_start(); unsigned sl_len = ras.scanline_length(); if(sl_len) { memset(mix_buffer + sl_start - min_x, 0, sl_len * sizeof(color_type)); memset(cover_buffer + sl_start - min_x, 0, sl_len * sizeof(cover_type)); int sl_y = 0x7FFFFFFF; unsigned i; for(i = 0; i < num_styles; i++) { style = ras.style(i); solid = sh.is_solid(style); if(ras.sweep_scanline(sl_aa, i)) { unsigned cover; color_type* colors; color_type* cspan; cover_type* src_covers; cover_type* dst_covers; span_aa = sl_aa.begin(); num_spans = sl_aa.num_spans(); sl_y = sl_aa.y(); if(solid) { // Just solid fill //----------------------- for(;;) { color_type c = sh.color(style); len = span_aa->len; colors = mix_buffer + span_aa->x - min_x; src_covers = span_aa->covers; dst_covers = cover_buffer + span_aa->x - min_x; do { cover = *src_covers; if(*dst_covers + cover > cover_full) { cover = cover_full - *dst_covers; } if(cover) { colors->add(c, cover); *dst_covers += cover; } ++colors; ++src_covers; ++dst_covers; } while(--len); if(--num_spans == 0) break; ++span_aa; } } else { // Arbitrary span generator //----------------------- for(;;) { len = span_aa->len; colors = mix_buffer + span_aa->x - min_x; cspan = color_span; sh.generate_span(cspan, span_aa->x, sl_aa.y(), len, style); src_covers = span_aa->covers; dst_covers = cover_buffer + span_aa->x - min_x; do { cover = *src_covers; if(*dst_covers + cover > cover_full) { cover = cover_full - *dst_covers; } if(cover) { colors->add(*cspan, cover); *dst_covers += cover; } ++cspan; ++colors; ++src_covers; ++dst_covers; } while(--len); if(--num_spans == 0) break; ++span_aa; } } } } ren.blend_color_hspan(sl_start, sl_y, sl_len, mix_buffer + sl_start - min_x, 0, cover_full); } //if(sl_len) } //if(num_styles == 1) ... else } //while((num_styles = ras.sweep_styles()) > 0) } //if(ras.rewind_scanlines()) } } #endif ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_rendering_buffer.h��������������������������������������������������������0000644�0000000�0000000�00000023664�10703246330�021211� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_RENDERING_BUFFER_INCLUDED #define AGG_RENDERING_BUFFER_INCLUDED #include "agg_array.h" namespace agg { //===========================================================row_accessor template<class T> class row_accessor { public: typedef const_row_info<T> row_data; //------------------------------------------------------------------- row_accessor() : m_buf(0), m_start(0), m_width(0), m_height(0), m_stride(0) { } //-------------------------------------------------------------------- row_accessor(T* buf, unsigned width, unsigned height, int stride) : m_buf(0), m_start(0), m_width(0), m_height(0), m_stride(0) { attach(buf, width, height, stride); } //-------------------------------------------------------------------- void attach(T* buf, unsigned width, unsigned height, int stride) { m_buf = m_start = buf; m_width = width; m_height = height; m_stride = stride; if(stride < 0) { m_start = m_buf - int(height - 1) * stride; } } //-------------------------------------------------------------------- AGG_INLINE T* buf() { return m_buf; } AGG_INLINE const T* buf() const { return m_buf; } AGG_INLINE unsigned width() const { return m_width; } AGG_INLINE unsigned height() const { return m_height; } AGG_INLINE int stride() const { return m_stride; } AGG_INLINE unsigned stride_abs() const { return (m_stride < 0) ? unsigned(-m_stride) : unsigned(m_stride); } //-------------------------------------------------------------------- AGG_INLINE T* row_ptr(int, int y, unsigned) { return m_start + y * m_stride; } AGG_INLINE T* row_ptr(int y) { return m_start + y * m_stride; } AGG_INLINE const T* row_ptr(int y) const { return m_start + y * m_stride; } AGG_INLINE row_data row (int y) const { return row_data(0, m_width-1, row_ptr(y)); } //-------------------------------------------------------------------- template<class RenBuf> void copy_from(const RenBuf& src) { unsigned h = height(); if(src.height() < h) h = src.height(); unsigned l = stride_abs(); if(src.stride_abs() < l) l = src.stride_abs(); l *= sizeof(T); unsigned y; unsigned w = width(); for (y = 0; y < h; y++) { memcpy(row_ptr(0, y, w), src.row_ptr(y), l); } } //-------------------------------------------------------------------- void clear(T value) { unsigned y; unsigned w = width(); unsigned stride = stride_abs(); for(y = 0; y < height(); y++) { T* p = row_ptr(0, y, w); unsigned x; for(x = 0; x < stride; x++) { *p++ = value; } } } private: //-------------------------------------------------------------------- T* m_buf; // Pointer to renrdering buffer T* m_start; // Pointer to first pixel depending on stride unsigned m_width; // Width in pixels unsigned m_height; // Height in pixels int m_stride; // Number of bytes per row. Can be < 0 }; //==========================================================row_ptr_cache template<class T> class row_ptr_cache { public: typedef const_row_info<T> row_data; //------------------------------------------------------------------- row_ptr_cache() : m_buf(0), m_rows(), m_width(0), m_height(0), m_stride(0) { } //-------------------------------------------------------------------- row_ptr_cache(T* buf, unsigned width, unsigned height, int stride) : m_buf(0), m_rows(), m_width(0), m_height(0), m_stride(0) { attach(buf, width, height, stride); } //-------------------------------------------------------------------- void attach(T* buf, unsigned width, unsigned height, int stride) { m_buf = buf; m_width = width; m_height = height; m_stride = stride; if(height > m_rows.size()) { m_rows.resize(height); } T* row_ptr = m_buf; if(stride < 0) { row_ptr = m_buf - int(height - 1) * stride; } T** rows = &m_rows[0]; while(height--) { *rows++ = row_ptr; row_ptr += stride; } } //-------------------------------------------------------------------- AGG_INLINE T* buf() { return m_buf; } AGG_INLINE const T* buf() const { return m_buf; } AGG_INLINE unsigned width() const { return m_width; } AGG_INLINE unsigned height() const { return m_height; } AGG_INLINE int stride() const { return m_stride; } AGG_INLINE unsigned stride_abs() const { return (m_stride < 0) ? unsigned(-m_stride) : unsigned(m_stride); } //-------------------------------------------------------------------- AGG_INLINE T* row_ptr(int, int y, unsigned) { return m_rows[y]; } AGG_INLINE T* row_ptr(int y) { return m_rows[y]; } AGG_INLINE const T* row_ptr(int y) const { return m_rows[y]; } AGG_INLINE row_data row (int y) const { return row_data(0, m_width-1, m_rows[y]); } //-------------------------------------------------------------------- T const* const* rows() const { return &m_rows[0]; } //-------------------------------------------------------------------- template<class RenBuf> void copy_from(const RenBuf& src) { unsigned h = height(); if(src.height() < h) h = src.height(); unsigned l = stride_abs(); if(src.stride_abs() < l) l = src.stride_abs(); l *= sizeof(T); unsigned y; unsigned w = width(); for (y = 0; y < h; y++) { memcpy(row_ptr(0, y, w), src.row_ptr(y), l); } } //-------------------------------------------------------------------- void clear(T value) { unsigned y; unsigned w = width(); unsigned stride = stride_abs(); for(y = 0; y < height(); y++) { T* p = row_ptr(0, y, w); unsigned x; for(x = 0; x < stride; x++) { *p++ = value; } } } private: //-------------------------------------------------------------------- T* m_buf; // Pointer to renrdering buffer pod_array<T*> m_rows; // Pointers to each row of the buffer unsigned m_width; // Width in pixels unsigned m_height; // Height in pixels int m_stride; // Number of bytes per row. Can be < 0 }; //========================================================rendering_buffer // // The definition of the main type for accessing the rows in the frame // buffer. It provides functionality to navigate to the rows in a // rectangular matrix, from top to bottom or from bottom to top depending // on stride. // // row_accessor is cheap to create/destroy, but performs one multiplication // when calling row_ptr(). // // row_ptr_cache creates an array of pointers to rows, so, the access // via row_ptr() may be faster. But it requires memory allocation // when creating. For example, on typical Intel Pentium hardware // row_ptr_cache speeds span_image_filter_rgb_nn up to 10% // // It's used only in short hand typedefs like pixfmt_rgba32 and can be // redefined in agg_config.h // In real applications you can use both, depending on your needs //------------------------------------------------------------------------ #ifdef AGG_RENDERING_BUFFER typedef AGG_RENDERING_BUFFER rendering_buffer; #else // typedef row_ptr_cache<int8u> rendering_buffer; typedef row_accessor<int8u> rendering_buffer; #endif } #endif ����������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_rendering_buffer_dynarow.h������������������������������������������������0000644�0000000�0000000�00000012230�10703246330�022737� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_RENDERING_BUFFER_DYNAROW_INCLUDED #define AGG_RENDERING_BUFFER_DYNAROW_INCLUDED #include "agg_array.h" namespace agg { //===============================================rendering_buffer_dynarow // Rendering buffer class with dynamic allocation of the rows. // The rows are allocated as needed when requesting for span_ptr(). // The class automatically calculates min_x and max_x for each row. // Generally it's more efficient to use this class as a temporary buffer // for rendering a few lines and then to blend it with another buffer. // class rendering_buffer_dynarow { public: typedef row_info<int8u> row_data; //------------------------------------------------------------------- ~rendering_buffer_dynarow() { init(0,0,0); } //------------------------------------------------------------------- rendering_buffer_dynarow() : m_rows(), m_width(0), m_height(0), m_byte_width(0) { } // Allocate and clear the buffer //-------------------------------------------------------------------- rendering_buffer_dynarow(unsigned width, unsigned height, unsigned byte_width) : m_rows(height), m_width(width), m_height(height), m_byte_width(byte_width) { memset(&m_rows[0], 0, sizeof(row_data) * height); } // Allocate and clear the buffer //-------------------------------------------------------------------- void init(unsigned width, unsigned height, unsigned byte_width) { unsigned i; for(i = 0; i < m_height; ++i) { pod_allocator<int8u>::deallocate((int8u*)m_rows[i].ptr, m_byte_width); } if(width && height) { m_width = width; m_height = height; m_byte_width = byte_width; m_rows.resize(height); memset(&m_rows[0], 0, sizeof(row_data) * height); } } //-------------------------------------------------------------------- unsigned width() const { return m_width; } unsigned height() const { return m_height; } unsigned byte_width() const { return m_byte_width; } // The main function used for rendering. Returns pointer to the // pre-allocated span. Memory for the row is allocated as needed. //-------------------------------------------------------------------- int8u* row_ptr(int x, int y, unsigned len) { row_data* r = &m_rows[y]; int x2 = x + len - 1; if(r->ptr) { if(x < r->x1) { r->x1 = x; } if(x2 > r->x2) { r->x2 = x2; } } else { int8u* p = pod_allocator<int8u>::allocate(m_byte_width); r->ptr = p; r->x1 = x; r->x2 = x2; memset(p, 0, m_byte_width); } return (int8u*)r->ptr; } //-------------------------------------------------------------------- const int8u* row_ptr(int y) const { return m_rows[y].ptr; } int8u* row_ptr(int y) { return row_ptr(0, y, m_width); } row_data row (int y) const { return m_rows[y]; } private: //-------------------------------------------------------------------- // Prohibit copying rendering_buffer_dynarow(const rendering_buffer_dynarow&); const rendering_buffer_dynarow& operator = (const rendering_buffer_dynarow&); private: //-------------------------------------------------------------------- pod_array<row_data> m_rows; // Pointers to each row of the buffer unsigned m_width; // Width in pixels unsigned m_height; // Height in pixels unsigned m_byte_width; // Width in bytes }; } #endif ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_rounded_rect.h������������������������������������������������������������0000644�0000000�0000000�00000004662�10703246330�020355� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_ROUNDED_RECT_INCLUDED #define AGG_ROUNDED_RECT_INCLUDED #include "agg_basics.h" #include "agg_arc.h" namespace agg { //------------------------------------------------------------rounded_rect // // See Implemantation agg_rounded_rect.cpp // class rounded_rect { public: rounded_rect() {} rounded_rect(double x1, double y1, double x2, double y2, double r); void rect(double x1, double y1, double x2, double y2); 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, double rx3, double ry3, double rx4, double ry4); void normalize_radius(); void approximation_scale(double s) { m_arc.approximation_scale(s); } double approximation_scale() const { return m_arc.approximation_scale(); } void rewind(unsigned); unsigned vertex(double* x, double* y); private: double m_x1; double m_y1; double m_x2; double m_y2; double m_rx1; double m_ry1; double m_rx2; double m_ry2; double m_rx3; double m_ry3; double m_rx4; double m_ry4; unsigned m_status; arc m_arc; }; } #endif ������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_scanline_bin.h������������������������������������������������������������0000644�0000000�0000000�00000017456�10703246330�020331� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- // // Adaptation for 32-bit screen coordinates (scanline32_bin) 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_SCANLINE_BIN_INCLUDED #define AGG_SCANLINE_BIN_INCLUDED #include "agg_array.h" namespace agg { //=============================================================scanline_bin // // This is binary scaline container which supports the interface // used in the rasterizer::render(). See description of agg_scanline_u8 // for details. // //------------------------------------------------------------------------ class scanline_bin { public: typedef int32 coord_type; struct span { int16 x; int16 len; }; typedef const span* const_iterator; //-------------------------------------------------------------------- scanline_bin() : m_last_x(0x7FFFFFF0), m_spans(), m_cur_span(0) { } //-------------------------------------------------------------------- void reset(int min_x, int max_x) { unsigned max_len = max_x - min_x + 3; if(max_len > m_spans.size()) { m_spans.resize(max_len); } m_last_x = 0x7FFFFFF0; m_cur_span = &m_spans[0]; } //-------------------------------------------------------------------- void add_cell(int x, unsigned) { if(x == m_last_x+1) { m_cur_span->len++; } else { ++m_cur_span; m_cur_span->x = (int16)x; m_cur_span->len = 1; } m_last_x = x; } //-------------------------------------------------------------------- void add_span(int x, unsigned len, unsigned) { if(x == m_last_x+1) { m_cur_span->len = (int16)(m_cur_span->len + len); } else { ++m_cur_span; m_cur_span->x = (int16)x; m_cur_span->len = (int16)len; } m_last_x = x + len - 1; } //-------------------------------------------------------------------- void add_cells(int x, unsigned len, const void*) { add_span(x, len, 0); } //-------------------------------------------------------------------- void finalize(int y) { m_y = y; } //-------------------------------------------------------------------- void reset_spans() { m_last_x = 0x7FFFFFF0; m_cur_span = &m_spans[0]; } //-------------------------------------------------------------------- int y() const { return m_y; } unsigned num_spans() const { return unsigned(m_cur_span - &m_spans[0]); } const_iterator begin() const { return &m_spans[1]; } private: scanline_bin(const scanline_bin&); const scanline_bin operator = (const scanline_bin&); int m_last_x; int m_y; pod_array<span> m_spans; span* m_cur_span; }; //===========================================================scanline32_bin class scanline32_bin { public: typedef int32 coord_type; //-------------------------------------------------------------------- struct span { span() {} span(coord_type x_, coord_type len_) : x(x_), len(len_) {} coord_type x; coord_type len; }; typedef pod_bvector<span, 4> span_array_type; //-------------------------------------------------------------------- class const_iterator { public: const_iterator(const span_array_type& spans) : m_spans(spans), m_span_idx(0) {} const span& operator*() const { return m_spans[m_span_idx]; } const span* operator->() const { return &m_spans[m_span_idx]; } void operator ++ () { ++m_span_idx; } private: const span_array_type& m_spans; unsigned m_span_idx; }; //-------------------------------------------------------------------- scanline32_bin() : m_max_len(0), m_last_x(0x7FFFFFF0) {} //-------------------------------------------------------------------- void reset(int min_x, int max_x) { m_last_x = 0x7FFFFFF0; m_spans.remove_all(); } //-------------------------------------------------------------------- void add_cell(int x, unsigned) { if(x == m_last_x+1) { m_spans.last().len++; } else { m_spans.add(span(coord_type(x), 1)); } m_last_x = x; } //-------------------------------------------------------------------- void add_span(int x, unsigned len, unsigned) { if(x == m_last_x+1) { m_spans.last().len += coord_type(len); } else { m_spans.add(span(coord_type(x), coord_type(len))); } m_last_x = x + len - 1; } //-------------------------------------------------------------------- void add_cells(int x, unsigned len, const void*) { add_span(x, len, 0); } //-------------------------------------------------------------------- void finalize(int y) { m_y = y; } //-------------------------------------------------------------------- void reset_spans() { m_last_x = 0x7FFFFFF0; m_spans.remove_all(); } //-------------------------------------------------------------------- int y() const { return m_y; } unsigned num_spans() const { return m_spans.size(); } const_iterator begin() const { return const_iterator(m_spans); } private: scanline32_bin(const scanline32_bin&); const scanline32_bin operator = (const scanline32_bin&); unsigned m_max_len; int m_last_x; int m_y; span_array_type m_spans; }; } #endif ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_scanline_boolean_algebra.h������������������������������������������������0000644�0000000�0000000�00000152735�10703246330�022655� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_SCANLINE_BOOLEAN_ALGEBRA_INCLUDED #define AGG_SCANLINE_BOOLEAN_ALGEBRA_INCLUDED #include <stdlib.h> #include <math.h> #include "agg_basics.h" namespace agg { //-----------------------------------------------sbool_combine_spans_bin // Functor. // Combine two binary encoded spans, i.e., when we don't have any // anti-aliasing information, but only X and Length. The function // is compatible with any type of scanlines. //---------------- 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, Scanline& sl) const { sl.add_span(x, len, cover_full); } }; //---------------------------------------------sbool_combine_spans_empty // Functor. // Combine two spans as empty ones. The functor does nothing // and is used to XOR binary spans. //---------------- 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, Scanline&) const {} }; //--------------------------------------------------sbool_add_span_empty // Functor. // Add nothing. Used in conbine_shapes_sub //---------------- template<class Scanline1, class Scanline> struct sbool_add_span_empty { void operator () (const typename Scanline1::const_iterator&, int, unsigned, Scanline&) const {} }; //----------------------------------------------------sbool_add_span_bin // Functor. // Add a binary span //---------------- template<class Scanline1, class Scanline> struct sbool_add_span_bin { 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 // Functor. // Add an anti-aliased span // anti-aliasing information, but only X and Length. The function // is compatible with any type of scanlines. //---------------- template<class Scanline1, class Scanline> struct sbool_add_span_aa { void operator () (const typename Scanline1::const_iterator& span, int x, unsigned len, Scanline& sl) const { if(span->len < 0) { sl.add_span(x, len, *span->covers); } else if(span->len > 0) { const typename Scanline1::cover_type* covers = span->covers; if(span->x < x) covers += x - span->x; sl.add_cells(x, len, covers); } } }; //----------------------------------------------sbool_intersect_spans_aa // Functor. // 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> struct sbool_intersect_spans_aa { enum cover_scale_e { cover_shift = CoverShift, cover_size = 1 << cover_shift, 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, Scanline& sl) const { unsigned cover; const typename Scanline1::cover_type* covers1; const typename Scanline2::cover_type* covers2; // Calculate the operation code and choose the // proper combination algorithm. // 0 = Both spans are of AA type // 1 = span1 is solid, span2 is AA // 2 = span1 is AA, span2 is solid // 3 = Both spans are of solid type //----------------- switch((span1->len < 0) | ((span2->len < 0) << 1)) { case 0: // Both are AA spans covers1 = span1->covers; covers2 = span2->covers; if(span1->x < x) covers1 += x - span1->x; if(span2->x < x) covers2 += x - span2->x; do { cover = *covers1++ * *covers2++; sl.add_cell(x++, (cover == cover_full * cover_full) ? cover_full : (cover >> cover_shift)); } while(--len); break; case 1: // span1 is solid, span2 is AA covers2 = span2->covers; if(span2->x < x) covers2 += x - span2->x; if(*(span1->covers) == cover_full) { sl.add_cells(x, len, covers2); } else { do { cover = *(span1->covers) * *covers2++; sl.add_cell(x++, (cover == cover_full * cover_full) ? cover_full : (cover >> cover_shift)); } while(--len); } break; case 2: // span1 is AA, span2 is solid covers1 = span1->covers; if(span1->x < x) covers1 += x - span1->x; if(*(span2->covers) == cover_full) { sl.add_cells(x, len, covers1); } else { do { cover = *covers1++ * *(span2->covers); sl.add_cell(x++, (cover == cover_full * cover_full) ? cover_full : (cover >> cover_shift)); } while(--len); } break; case 3: // Both are solid spans cover = *(span1->covers) * *(span2->covers); sl.add_span(x, len, (cover == cover_full * cover_full) ? cover_full : (cover >> cover_shift)); break; } } }; //--------------------------------------------------sbool_unite_spans_aa // Functor. // 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> struct sbool_unite_spans_aa { enum cover_scale_e { cover_shift = CoverShift, cover_size = 1 << cover_shift, 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, Scanline& sl) const { unsigned cover; const typename Scanline1::cover_type* covers1; const typename Scanline2::cover_type* covers2; // Calculate the operation code and choose the // proper combination algorithm. // 0 = Both spans are of AA type // 1 = span1 is solid, span2 is AA // 2 = span1 is AA, span2 is solid // 3 = Both spans are of solid type //----------------- switch((span1->len < 0) | ((span2->len < 0) << 1)) { case 0: // Both are AA spans covers1 = span1->covers; covers2 = span2->covers; if(span1->x < x) covers1 += x - span1->x; if(span2->x < x) covers2 += x - span2->x; do { cover = cover_mask * cover_mask - (cover_mask - *covers1++) * (cover_mask - *covers2++); sl.add_cell(x++, (cover == cover_full * cover_full) ? cover_full : (cover >> cover_shift)); } while(--len); break; case 1: // span1 is solid, span2 is AA covers2 = span2->covers; if(span2->x < x) covers2 += x - span2->x; if(*(span1->covers) == cover_full) { sl.add_span(x, len, cover_full); } else { do { cover = cover_mask * cover_mask - (cover_mask - *(span1->covers)) * (cover_mask - *covers2++); sl.add_cell(x++, (cover == cover_full * cover_full) ? cover_full : (cover >> cover_shift)); } while(--len); } break; case 2: // span1 is AA, span2 is solid covers1 = span1->covers; if(span1->x < x) covers1 += x - span1->x; if(*(span2->covers) == cover_full) { sl.add_span(x, len, cover_full); } else { do { cover = cover_mask * cover_mask - (cover_mask - *covers1++) * (cover_mask - *(span2->covers)); sl.add_cell(x++, (cover == cover_full * cover_full) ? cover_full : (cover >> cover_shift)); } while(--len); } break; case 3: // Both are solid spans cover = cover_mask * cover_mask - (cover_mask - *(span1->covers)) * (cover_mask - *(span2->covers)); sl.add_span(x, len, (cover == cover_full * cover_full) ? cover_full : (cover >> cover_shift)); break; } } }; //---------------------------------------------sbool_xor_formula_linear template<unsigned CoverShift = cover_shift> struct sbool_xor_formula_linear { enum cover_scale_e { cover_shift = CoverShift, cover_size = 1 << cover_shift, cover_mask = cover_size - 1 }; static AGG_INLINE unsigned calculate(unsigned a, unsigned b) { unsigned cover = a + b; if(cover > cover_mask) cover = cover_mask + cover_mask - cover; return cover; } }; //---------------------------------------------sbool_xor_formula_saddle template<unsigned CoverShift = cover_shift> struct sbool_xor_formula_saddle { enum cover_scale_e { cover_shift = CoverShift, cover_size = 1 << cover_shift, cover_mask = cover_size - 1 }; static AGG_INLINE unsigned calculate(unsigned a, unsigned b) { unsigned k = a * b; if(k == cover_mask * cover_mask) return 0; a = (cover_mask * cover_mask - (a << cover_shift) + k) >> cover_shift; b = (cover_mask * cover_mask - (b << cover_shift) + k) >> cover_shift; return cover_mask - ((a * b) >> cover_shift); } }; //-------------------------------------------sbool_xor_formula_abs_diff struct sbool_xor_formula_abs_diff { static AGG_INLINE unsigned calculate(unsigned a, unsigned b) { return unsigned(abs(int(a) - int(b))); } }; //----------------------------------------------------sbool_xor_spans_aa // Functor. // XOR two spans preserving the anti-aliasing information. // The result is added to the "sl" scanline. //------------------ template<class Scanline1, class Scanline2, class Scanline, class XorFormula, unsigned CoverShift = cover_shift> struct sbool_xor_spans_aa { enum cover_scale_e { cover_shift = CoverShift, cover_size = 1 << cover_shift, 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, Scanline& sl) const { unsigned cover; const typename Scanline1::cover_type* covers1; const typename Scanline2::cover_type* covers2; // Calculate the operation code and choose the // proper combination algorithm. // 0 = Both spans are of AA type // 1 = span1 is solid, span2 is AA // 2 = span1 is AA, span2 is solid // 3 = Both spans are of solid type //----------------- switch((span1->len < 0) | ((span2->len < 0) << 1)) { case 0: // Both are AA spans covers1 = span1->covers; covers2 = span2->covers; if(span1->x < x) covers1 += x - span1->x; if(span2->x < x) covers2 += x - span2->x; do { cover = XorFormula::calculate(*covers1++, *covers2++); if(cover) sl.add_cell(x, cover); ++x; } while(--len); break; case 1: // span1 is solid, span2 is AA covers2 = span2->covers; if(span2->x < x) covers2 += x - span2->x; do { cover = XorFormula::calculate(*(span1->covers), *covers2++); if(cover) sl.add_cell(x, cover); ++x; } while(--len); break; case 2: // span1 is AA, span2 is solid covers1 = span1->covers; if(span1->x < x) covers1 += x - span1->x; do { cover = XorFormula::calculate(*covers1++, *(span2->covers)); if(cover) sl.add_cell(x, cover); ++x; } while(--len); break; case 3: // Both are solid spans cover = XorFormula::calculate(*(span1->covers), *(span2->covers)); if(cover) sl.add_span(x, len, cover); break; } } }; //-----------------------------------------------sbool_subtract_spans_aa // Functor. // 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> struct sbool_subtract_spans_aa { enum cover_scale_e { cover_shift = CoverShift, cover_size = 1 << cover_shift, 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, Scanline& sl) const { unsigned cover; const typename Scanline1::cover_type* covers1; const typename Scanline2::cover_type* covers2; // Calculate the operation code and choose the // proper combination algorithm. // 0 = Both spans are of AA type // 1 = span1 is solid, span2 is AA // 2 = span1 is AA, span2 is solid // 3 = Both spans are of solid type //----------------- switch((span1->len < 0) | ((span2->len < 0) << 1)) { case 0: // Both are AA spans covers1 = span1->covers; covers2 = span2->covers; if(span1->x < x) covers1 += x - span1->x; if(span2->x < x) covers2 += x - span2->x; do { cover = *covers1++ * (cover_mask - *covers2++); if(cover) { sl.add_cell(x, (cover == cover_full * cover_full) ? cover_full : (cover >> cover_shift)); } ++x; } while(--len); break; case 1: // span1 is solid, span2 is AA covers2 = span2->covers; if(span2->x < x) covers2 += x - span2->x; do { cover = *(span1->covers) * (cover_mask - *covers2++); if(cover) { sl.add_cell(x, (cover == cover_full * cover_full) ? cover_full : (cover >> cover_shift)); } ++x; } while(--len); break; case 2: // span1 is AA, span2 is solid covers1 = span1->covers; if(span1->x < x) covers1 += x - span1->x; if(*(span2->covers) != cover_full) { do { cover = *covers1++ * (cover_mask - *(span2->covers)); if(cover) { sl.add_cell(x, (cover == cover_full * cover_full) ? cover_full : (cover >> cover_shift)); } ++x; } while(--len); } break; case 3: // Both are solid spans cover = *(span1->covers) * (cover_mask - *(span2->covers)); if(cover) { sl.add_span(x, len, (cover == cover_full * cover_full) ? cover_full : (cover >> cover_shift)); } break; } } }; //--------------------------------------------sbool_add_spans_and_render template<class Scanline1, class Scanline, class Renderer, class AddSpanFunctor> void sbool_add_spans_and_render(const Scanline1& sl1, Scanline& sl, Renderer& ren, AddSpanFunctor add_span) { sl.reset_spans(); typename Scanline1::const_iterator span = sl1.begin(); unsigned num_spans = sl1.num_spans(); for(;;) { add_span(span, span->x, abs((int)span->len), sl); if(--num_spans == 0) break; ++span; } sl.finalize(sl1.y()); ren.render(sl); } //---------------------------------------------sbool_intersect_scanlines // Intersect two scanlines, "sl1" and "sl2" and generate a new "sl" one. // The combine_spans functor can be of type sbool_combine_spans_bin or // sbool_intersect_spans_aa. First is a general functor to combine // two spans without Anti-Aliasing, the second preserves the AA // information, but works slower // template<class Scanline1, class Scanline2, class Scanline, class CombineSpansFunctor> void sbool_intersect_scanlines(const Scanline1& sl1, const Scanline2& sl2, Scanline& sl, CombineSpansFunctor combine_spans) { sl.reset_spans(); unsigned num1 = sl1.num_spans(); if(num1 == 0) return; unsigned num2 = sl2.num_spans(); if(num2 == 0) return; typename Scanline1::const_iterator span1 = sl1.begin(); typename Scanline2::const_iterator span2 = sl2.begin(); while(num1 && num2) { int xb1 = span1->x; int xb2 = span2->x; int xe1 = xb1 + abs((int)span1->len) - 1; int xe2 = xb2 + abs((int)span2->len) - 1; // 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 // coordinates are the same and we can advance both //-------------- bool advance_span1 = xe1 < xe2; bool advance_both = xe1 == xe2; // Find the intersection of the spans // and check if they intersect //-------------- if(xb1 < xb2) xb1 = xb2; if(xe1 > xe2) xe1 = xe2; if(xb1 <= xe1) { combine_spans(span1, span2, xb1, xe1 - xb1 + 1, sl); } // Advance the spans //-------------- if(advance_both) { --num1; --num2; if(num1) ++span1; if(num2) ++span2; } else { if(advance_span1) { --num1; if(num1) ++span1; } else { --num2; if(num2) ++span2; } } } } //------------------------------------------------sbool_intersect_shapes // 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. // "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_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, class Renderer, class CombineSpansFunctor> void sbool_intersect_shapes(ScanlineGen1& sg1, ScanlineGen2& sg2, Scanline1& sl1, Scanline2& sl2, Scanline& sl, Renderer& ren, CombineSpansFunctor combine_spans) { // Prepare the scanline generators. // If anyone of them doesn't contain // any scanlines, then return. //----------------- if(!sg1.rewind_scanlines()) return; if(!sg2.rewind_scanlines()) return; // Get the bounding boxes //---------------- rect_i r1(sg1.min_x(), sg1.min_y(), sg1.max_x(), sg1.max_y()); rect_i r2(sg2.min_x(), sg2.min_y(), sg2.max_x(), sg2.max_y()); // Calculate the intersection of the bounding // boxes and return if they don't intersect. //----------------- rect_i ir = intersect_rectangles(r1, r2); if(!ir.is_valid()) return; // Reset the scanlines and get two first ones //----------------- sl.reset(ir.x1, ir.x2); sl1.reset(sg1.min_x(), sg1.max_x()); sl2.reset(sg2.min_x(), sg2.max_x()); if(!sg1.sweep_scanline(sl1)) return; if(!sg2.sweep_scanline(sl2)) return; ren.prepare(); // The main loop // Here we synchronize the scanlines with // the same Y coordinate, ignoring all other ones. // Only scanlines having the same Y-coordinate // are to be combined. //----------------- for(;;) { while(sl1.y() < sl2.y()) { if(!sg1.sweep_scanline(sl1)) return; } while(sl2.y() < sl1.y()) { if(!sg2.sweep_scanline(sl2)) return; } if(sl1.y() == sl2.y()) { // The Y coordinates are the same. // Combine the scanlines, render if they contain any spans, // and advance both generators to the next scanlines //---------------------- sbool_intersect_scanlines(sl1, sl2, sl, combine_spans); if(sl.num_spans()) { sl.finalize(sl1.y()); ren.render(sl); } if(!sg1.sweep_scanline(sl1)) return; if(!sg2.sweep_scanline(sl2)) return; } } } //-------------------------------------------------sbool_unite_scanlines // Unite two scanlines, "sl1" and "sl2" and generate a new "sl" one. // The combine_spans functor can be of type sbool_combine_spans_bin or // sbool_intersect_spans_aa. First is a general functor to combine // two spans without Anti-Aliasing, the second preserves the AA // information, but works slower // 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, AddSpanFunctor1 add_span1, AddSpanFunctor2 add_span2, CombineSpansFunctor combine_spans) { sl.reset_spans(); unsigned num1 = sl1.num_spans(); unsigned num2 = sl2.num_spans(); typename Scanline1::const_iterator span1;// = sl1.begin(); typename Scanline2::const_iterator span2;// = sl2.begin(); enum invalidation_e { invalid_b = 0xFFFFFFF, invalid_e = invalid_b - 1 }; // Initialize the spans as invalid //--------------- int xb1 = invalid_b; int xb2 = invalid_b; int xe1 = invalid_e; int xe2 = invalid_e; // Initialize span1 if there are spans //--------------- if(num1) { span1 = sl1.begin(); xb1 = span1->x; xe1 = xb1 + abs((int)span1->len) - 1; --num1; } // Initialize span2 if there are spans //--------------- if(num2) { span2 = sl2.begin(); xb2 = span2->x; xe2 = xb2 + abs((int)span2->len) - 1; --num2; } for(;;) { // Retrieve a new span1 if it's invalid //---------------- if(num1 && xb1 > xe1) { --num1; ++span1; xb1 = span1->x; xe1 = xb1 + abs((int)span1->len) - 1; } // Retrieve a new span2 if it's invalid //---------------- if(num2 && xb2 > xe2) { --num2; ++span2; xb2 = span2->x; xe2 = xb2 + abs((int)span2->len) - 1; } if(xb1 > xe1 && xb2 > xe2) break; // Calculate the intersection //---------------- int xb = xb1; int xe = xe1; if(xb < xb2) xb = xb2; if(xe > xe2) xe = xe2; int len = xe - xb + 1; // The length of the intersection if(len > 0) { // The spans intersect, // add the beginning of the span //---------------- if(xb1 < xb2) { add_span1(span1, xb1, xb2 - xb1, sl); xb1 = xb2; } else if(xb2 < xb1) { add_span2(span2, xb2, xb1 - xb2, sl); xb2 = xb1; } // Add the combination part of the spans //---------------- combine_spans(span1, span2, xb, len, sl); // Invalidate the fully processed span or both //---------------- if(xe1 < xe2) { // Invalidate span1 and eat // the processed part of span2 //-------------- xb1 = invalid_b; xe1 = invalid_e; xb2 += len; } else if(xe2 < xe1) { // Invalidate span2 and eat // the processed part of span1 //-------------- xb2 = invalid_b; xe2 = invalid_e; xb1 += len; } else { xb1 = invalid_b; // Invalidate both xb2 = invalid_b; xe1 = invalid_e; xe2 = invalid_e; } } else { // The spans do not intersect //-------------- if(xb1 < xb2) { // Advance span1 //--------------- if(xb1 <= xe1) { add_span1(span1, xb1, xe1 - xb1 + 1, sl); } xb1 = invalid_b; // Invalidate xe1 = invalid_e; } else { // Advance span2 //--------------- if(xb2 <= xe2) { add_span2(span2, xb2, xe2 - xb2 + 1, sl); } xb2 = invalid_b; // Invalidate xe2 = invalid_e; } } } } //----------------------------------------------------sbool_unite_shapes // 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 // 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 // as the last argument. See sbool_unite_scanlines for details. //---------- 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, AddSpanFunctor1 add_span1, AddSpanFunctor2 add_span2, CombineSpansFunctor combine_spans) { // Prepare the scanline generators. // If anyone of them doesn't contain // any scanlines, then return. //----------------- bool flag1 = sg1.rewind_scanlines(); bool flag2 = sg2.rewind_scanlines(); if(!flag1 && !flag2) return; // Get the bounding boxes //---------------- rect_i r1(sg1.min_x(), sg1.min_y(), sg1.max_x(), sg1.max_y()); rect_i r2(sg2.min_x(), sg2.min_y(), sg2.max_x(), sg2.max_y()); // Calculate the union of the bounding boxes //----------------- rect_i ur(1,1,0,0); if(flag1 && flag2) ur = unite_rectangles(r1, r2); else if(flag1) ur = r1; else if(flag2) ur = r2; if(!ur.is_valid()) return; ren.prepare(); // Reset the scanlines and get two first ones //----------------- sl.reset(ur.x1, ur.x2); if(flag1) { sl1.reset(sg1.min_x(), sg1.max_x()); flag1 = sg1.sweep_scanline(sl1); } if(flag2) { sl2.reset(sg2.min_x(), sg2.max_x()); flag2 = sg2.sweep_scanline(sl2); } // The main loop // Here we synchronize the scanlines with // the same Y coordinate. //----------------- while(flag1 || flag2) { if(flag1 && flag2) { if(sl1.y() == sl2.y()) { // The Y coordinates are the same. // Combine the scanlines, render if they contain any spans, // and advance both generators to the next scanlines //---------------------- sbool_unite_scanlines(sl1, sl2, sl, add_span1, add_span2, combine_spans); if(sl.num_spans()) { sl.finalize(sl1.y()); ren.render(sl); } flag1 = sg1.sweep_scanline(sl1); flag2 = sg2.sweep_scanline(sl2); } else { if(sl1.y() < sl2.y()) { sbool_add_spans_and_render(sl1, sl, ren, add_span1); flag1 = sg1.sweep_scanline(sl1); } else { sbool_add_spans_and_render(sl2, sl, ren, add_span2); flag2 = sg2.sweep_scanline(sl2); } } } else { if(flag1) { sbool_add_spans_and_render(sl1, sl, ren, add_span1); flag1 = sg1.sweep_scanline(sl1); } if(flag2) { sbool_add_spans_and_render(sl2, sl, ren, add_span2); flag2 = sg2.sweep_scanline(sl2); } } } } //-------------------------------------------------sbool_subtract_shapes // 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. // "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_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, class Renderer, class AddSpanFunctor1, class CombineSpansFunctor> void sbool_subtract_shapes(ScanlineGen1& sg1, ScanlineGen2& sg2, Scanline1& sl1, Scanline2& sl2, Scanline& sl, Renderer& ren, AddSpanFunctor1 add_span1, CombineSpansFunctor combine_spans) { // Prepare the scanline generators. // Here "sg1" is master, "sg2" is slave. //----------------- if(!sg1.rewind_scanlines()) return; bool flag2 = sg2.rewind_scanlines(); // Get the bounding box //---------------- rect_i r1(sg1.min_x(), sg1.min_y(), sg1.max_x(), sg1.max_y()); // Reset the scanlines and get two first ones //----------------- sl.reset(sg1.min_x(), sg1.max_x()); sl1.reset(sg1.min_x(), sg1.max_x()); sl2.reset(sg2.min_x(), sg2.max_x()); if(!sg1.sweep_scanline(sl1)) return; if(flag2) flag2 = sg2.sweep_scanline(sl2); ren.prepare(); // A fake span2 processor sbool_add_span_empty<Scanline2, Scanline> add_span2; // The main loop // Here we synchronize the scanlines with // the same Y coordinate, ignoring all other ones. // Only scanlines having the same Y-coordinate // are to be combined. //----------------- bool flag1 = true; do { // Synchronize "slave" with "master" //----------------- while(flag2 && sl2.y() < sl1.y()) { flag2 = sg2.sweep_scanline(sl2); } if(flag2 && sl2.y() == sl1.y()) { // The Y coordinates are the same. // Combine the scanlines and render if they contain any spans. //---------------------- sbool_unite_scanlines(sl1, sl2, sl, add_span1, add_span2, combine_spans); if(sl.num_spans()) { sl.finalize(sl1.y()); ren.render(sl); } } else { sbool_add_spans_and_render(sl1, sl, ren, add_span1); } // Advance the "master" flag1 = sg1.sweep_scanline(sl1); } while(flag1); } //---------------------------------------------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 // 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, class Renderer> void sbool_intersect_shapes_aa(ScanlineGen1& sg1, ScanlineGen2& sg2, Scanline1& sl1, Scanline2& sl2, Scanline& sl, Renderer& ren) { sbool_intersect_spans_aa<Scanline1, Scanline2, Scanline> combine_functor; sbool_intersect_shapes(sg1, sg2, sl1, sl2, sl, ren, combine_functor); } //--------------------------------------------sbool_intersect_shapes_bin // 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, class Renderer> void sbool_intersect_shapes_bin(ScanlineGen1& sg1, ScanlineGen2& sg2, Scanline1& sl1, Scanline2& sl2, Scanline& sl, Renderer& ren) { sbool_combine_spans_bin<Scanline1, Scanline2, Scanline> combine_functor; sbool_intersect_shapes(sg1, sg2, sl1, sl2, sl, ren, combine_functor); } //-------------------------------------------------sbool_unite_shapes_aa // Unite two anti-aliased scanline shapes // See intersect_shapes_aa for more comments //---------- 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, Scanline& sl, Renderer& ren) { 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, add_functor1, add_functor2, combine_functor); } //------------------------------------------------sbool_unite_shapes_bin // 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, class Renderer> void sbool_unite_shapes_bin(ScanlineGen1& sg1, ScanlineGen2& sg2, Scanline1& sl1, Scanline2& sl2, Scanline& sl, Renderer& ren) { 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, add_functor1, add_functor2, combine_functor); } //---------------------------------------------------sbool_xor_shapes_aa // 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, class Renderer> void sbool_xor_shapes_aa(ScanlineGen1& sg1, ScanlineGen2& sg2, Scanline1& sl1, Scanline2& sl2, Scanline& sl, Renderer& ren) { 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_formula_linear<> > combine_functor; 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 // 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, class Renderer> void sbool_xor_shapes_saddle_aa(ScanlineGen1& sg1, ScanlineGen2& sg2, Scanline1& sl1, Scanline2& sl2, Scanline& sl, Renderer& ren) { 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_formula_saddle<> > combine_functor; 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 // 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, class Renderer> void sbool_xor_shapes_abs_diff_aa(ScanlineGen1& sg1, ScanlineGen2& sg2, Scanline1& sl1, Scanline2& sl2, Scanline& sl, Renderer& ren) { 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_formula_abs_diff> combine_functor; 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). // See intersect_shapes_aa for more comments //---------- 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, Scanline& sl, Renderer& ren) { 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, add_functor1, add_functor2, combine_functor); } //----------------------------------------------sbool_subtract_shapes_aa // 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, class Renderer> void sbool_subtract_shapes_aa(ScanlineGen1& sg1, ScanlineGen2& sg2, Scanline1& sl1, Scanline2& sl2, Scanline& sl, Renderer& ren) { 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, add_functor, combine_functor); } //---------------------------------------------sbool_subtract_shapes_bin // 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, class Renderer> void sbool_subtract_shapes_bin(ScanlineGen1& sg1, ScanlineGen2& sg2, Scanline1& sl1, Scanline2& sl2, Scanline& sl, Renderer& ren) { 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, add_functor, combine_functor); } //------------------------------------------------------------sbool_op_e enum sbool_op_e { sbool_or, //----sbool_or sbool_and, //----sbool_and sbool_xor, //----sbool_xor sbool_xor_saddle, //----sbool_xor_saddle sbool_xor_abs_diff, //----sbool_xor_abs_diff sbool_a_minus_b, //----sbool_a_minus_b sbool_b_minus_a //----sbool_b_minus_a }; //----------------------------------------------sbool_combine_shapes_bin 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, Scanline1& sl1, Scanline2& sl2, Scanline& sl, Renderer& ren) { switch(op) { 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_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; } } //-----------------------------------------------sbool_combine_shapes_aa 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, Scanline1& sl1, Scanline2& sl2, Scanline& sl, Renderer& ren) { switch(op) { case sbool_or : sbool_unite_shapes_aa (sg1, sg2, sl1, sl2, sl, ren); break; case sbool_and : sbool_intersect_shapes_aa (sg1, sg2, sl1, sl2, sl, ren); break; case sbool_xor : sbool_xor_shapes_aa (sg1, sg2, sl1, sl2, sl, ren); break; case sbool_xor_saddle : sbool_xor_shapes_saddle_aa (sg1, sg2, sl1, sl2, sl, ren); break; case sbool_xor_abs_diff: sbool_xor_shapes_abs_diff_aa(sg1, sg2, sl1, sl2, sl, ren); break; case sbool_a_minus_b : sbool_subtract_shapes_aa (sg1, sg2, sl1, sl2, sl, ren); break; case sbool_b_minus_a : sbool_subtract_shapes_aa (sg2, sg1, sl2, sl1, sl, ren); break; } } } #endif �����������������������������������agg-2.5+dfsg1/include/agg_scanline_p.h��������������������������������������������������������������0000644�0000000�0000000�00000024660�10703246330�020013� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- // // Adaptation for 32-bit screen coordinates (scanline32_p) 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_SCANLINE_P_INCLUDED #define AGG_SCANLINE_P_INCLUDED #include "agg_array.h" namespace agg { //=============================================================scanline_p8 // // This is a general purpose scaline container which supports the interface // used in the rasterizer::render(). See description of scanline_u8 // for details. // //------------------------------------------------------------------------ class scanline_p8 { public: typedef scanline_p8 self_type; typedef int8u cover_type; typedef int16 coord_type; //-------------------------------------------------------------------- struct span { coord_type x; coord_type len; // If negative, it's a solid span, covers is valid const cover_type* covers; }; typedef span* iterator; typedef const span* const_iterator; scanline_p8() : m_last_x(0x7FFFFFF0), m_covers(), m_cover_ptr(0), m_spans(), m_cur_span(0) { } //-------------------------------------------------------------------- void reset(int min_x, int max_x) { unsigned max_len = max_x - min_x + 3; if(max_len > m_spans.size()) { m_spans.resize(max_len); m_covers.resize(max_len); } m_last_x = 0x7FFFFFF0; m_cover_ptr = &m_covers[0]; m_cur_span = &m_spans[0]; m_cur_span->len = 0; } //-------------------------------------------------------------------- void add_cell(int x, unsigned cover) { *m_cover_ptr = (cover_type)cover; if(x == m_last_x+1 && m_cur_span->len > 0) { m_cur_span->len++; } else { m_cur_span++; m_cur_span->covers = m_cover_ptr; m_cur_span->x = (int16)x; m_cur_span->len = 1; } m_last_x = x; m_cover_ptr++; } //-------------------------------------------------------------------- void add_cells(int x, unsigned len, const cover_type* covers) { memcpy(m_cover_ptr, covers, len * sizeof(cover_type)); if(x == m_last_x+1 && m_cur_span->len > 0) { m_cur_span->len += (int16)len; } else { m_cur_span++; m_cur_span->covers = m_cover_ptr; m_cur_span->x = (int16)x; m_cur_span->len = (int16)len; } m_cover_ptr += len; m_last_x = x + len - 1; } //-------------------------------------------------------------------- void add_span(int x, unsigned len, unsigned cover) { if(x == m_last_x+1 && m_cur_span->len < 0 && cover == *m_cur_span->covers) { m_cur_span->len -= (int16)len; } else { *m_cover_ptr = (cover_type)cover; m_cur_span++; m_cur_span->covers = m_cover_ptr++; m_cur_span->x = (int16)x; m_cur_span->len = (int16)(-int(len)); } m_last_x = x + len - 1; } //-------------------------------------------------------------------- void finalize(int y) { m_y = y; } //-------------------------------------------------------------------- void reset_spans() { m_last_x = 0x7FFFFFF0; m_cover_ptr = &m_covers[0]; m_cur_span = &m_spans[0]; m_cur_span->len = 0; } //-------------------------------------------------------------------- int y() const { return m_y; } unsigned num_spans() const { return unsigned(m_cur_span - &m_spans[0]); } const_iterator begin() const { return &m_spans[1]; } private: scanline_p8(const self_type&); const self_type& operator = (const self_type&); int m_last_x; int m_y; pod_array<cover_type> m_covers; cover_type* m_cover_ptr; pod_array<span> m_spans; span* m_cur_span; }; //==========================================================scanline32_p8 class scanline32_p8 { public: typedef scanline32_p8 self_type; typedef int8u cover_type; typedef int32 coord_type; struct span { span() {} span(coord_type x_, coord_type len_, const cover_type* covers_) : x(x_), len(len_), covers(covers_) {} coord_type x; coord_type len; // If negative, it's a solid span, covers is valid const cover_type* covers; }; typedef pod_bvector<span, 4> span_array_type; //-------------------------------------------------------------------- class const_iterator { public: const_iterator(const span_array_type& spans) : m_spans(spans), m_span_idx(0) {} const span& operator*() const { return m_spans[m_span_idx]; } const span* operator->() const { return &m_spans[m_span_idx]; } void operator ++ () { ++m_span_idx; } private: const span_array_type& m_spans; unsigned m_span_idx; }; //-------------------------------------------------------------------- scanline32_p8() : m_max_len(0), m_last_x(0x7FFFFFF0), m_covers(), m_cover_ptr(0) { } //-------------------------------------------------------------------- void reset(int min_x, int max_x) { unsigned max_len = max_x - min_x + 3; if(max_len > m_covers.size()) { m_covers.resize(max_len); } m_last_x = 0x7FFFFFF0; m_cover_ptr = &m_covers[0]; m_spans.remove_all(); } //-------------------------------------------------------------------- void add_cell(int x, unsigned cover) { *m_cover_ptr = cover_type(cover); if(x == m_last_x+1 && m_spans.size() && m_spans.last().len > 0) { m_spans.last().len++; } else { m_spans.add(span(coord_type(x), 1, m_cover_ptr)); } m_last_x = x; m_cover_ptr++; } //-------------------------------------------------------------------- void add_cells(int x, unsigned len, const cover_type* covers) { memcpy(m_cover_ptr, covers, len * sizeof(cover_type)); if(x == m_last_x+1 && m_spans.size() && m_spans.last().len > 0) { m_spans.last().len += coord_type(len); } else { m_spans.add(span(coord_type(x), coord_type(len), m_cover_ptr)); } m_cover_ptr += len; m_last_x = x + len - 1; } //-------------------------------------------------------------------- void add_span(int x, unsigned len, unsigned cover) { if(x == m_last_x+1 && m_spans.size() && m_spans.last().len < 0 && cover == *m_spans.last().covers) { m_spans.last().len -= coord_type(len); } else { *m_cover_ptr = cover_type(cover); m_spans.add(span(coord_type(x), -coord_type(len), m_cover_ptr++)); } m_last_x = x + len - 1; } //-------------------------------------------------------------------- void finalize(int y) { m_y = y; } //-------------------------------------------------------------------- void reset_spans() { m_last_x = 0x7FFFFFF0; m_cover_ptr = &m_covers[0]; m_spans.remove_all(); } //-------------------------------------------------------------------- int y() const { return m_y; } unsigned num_spans() const { return m_spans.size(); } const_iterator begin() const { return const_iterator(m_spans); } private: scanline32_p8(const self_type&); const self_type& operator = (const self_type&); unsigned m_max_len; int m_last_x; int m_y; pod_array<cover_type> m_covers; cover_type* m_cover_ptr; span_array_type m_spans; }; } #endif ��������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_scanline_storage_aa.h�����������������������������������������������������0000644�0000000�0000000�00000064202�10703246330�021655� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- // // Adaptation for 32-bit screen coordinates 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_SCANLINE_STORAGE_AA_INCLUDED #define AGG_SCANLINE_STORAGE_AA_INCLUDED #include <string.h> #include <stdlib.h> #include <math.h> #include "agg_array.h" namespace agg { //----------------------------------------------scanline_cell_storage template<class T> class scanline_cell_storage { struct extra_span { unsigned len; T* ptr; }; public: typedef T value_type; //--------------------------------------------------------------- ~scanline_cell_storage() { remove_all(); } //--------------------------------------------------------------- scanline_cell_storage() : m_cells(128-2), m_extra_storage() {} // Copying //--------------------------------------------------------------- scanline_cell_storage(const scanline_cell_storage<T>& v) : m_cells(v.m_cells), m_extra_storage() { copy_extra_storage(v); } //--------------------------------------------------------------- const scanline_cell_storage<T>& operator = (const scanline_cell_storage<T>& v) { remove_all(); m_cells = v.m_cells; copy_extra_storage(v); return *this; } //--------------------------------------------------------------- void remove_all() { int i; for(i = m_extra_storage.size()-1; i >= 0; --i) { pod_allocator<T>::deallocate(m_extra_storage[i].ptr, m_extra_storage[i].len); } m_extra_storage.remove_all(); m_cells.remove_all(); } //--------------------------------------------------------------- int add_cells(const T* cells, unsigned num_cells) { int idx = m_cells.allocate_continuous_block(num_cells); if(idx >= 0) { T* ptr = &m_cells[idx]; memcpy(ptr, cells, sizeof(T) * num_cells); return idx; } extra_span s; s.len = num_cells; s.ptr = pod_allocator<T>::allocate(num_cells); memcpy(s.ptr, cells, sizeof(T) * num_cells); m_extra_storage.add(s); return -int(m_extra_storage.size()); } //--------------------------------------------------------------- const T* operator [] (int idx) const { if(idx >= 0) { if((unsigned)idx >= m_cells.size()) return 0; return &m_cells[(unsigned)idx]; } unsigned i = unsigned(-idx - 1); if(i >= m_extra_storage.size()) return 0; return m_extra_storage[i].ptr; } //--------------------------------------------------------------- T* operator [] (int idx) { if(idx >= 0) { if((unsigned)idx >= m_cells.size()) return 0; return &m_cells[(unsigned)idx]; } unsigned i = unsigned(-idx - 1); if(i >= m_extra_storage.size()) return 0; return m_extra_storage[i].ptr; } private: void copy_extra_storage(const scanline_cell_storage<T>& v) { unsigned i; for(i = 0; i < v.m_extra_storage.size(); ++i) { const extra_span& src = v.m_extra_storage[i]; extra_span dst; dst.len = src.len; dst.ptr = pod_allocator<T>::allocate(dst.len); memcpy(dst.ptr, src.ptr, dst.len * sizeof(T)); m_extra_storage.add(dst); } } pod_bvector<T, 12> m_cells; pod_bvector<extra_span, 6> m_extra_storage; }; //-----------------------------------------------scanline_storage_aa template<class T> class scanline_storage_aa { public: typedef T cover_type; //--------------------------------------------------------------- struct span_data { int32 x; int32 len; // If negative, it's a solid span, covers is valid int covers_id; // The index of the cells in the scanline_cell_storage }; //--------------------------------------------------------------- struct scanline_data { int y; unsigned num_spans; unsigned start_span; }; //--------------------------------------------------------------- class embedded_scanline { public: //----------------------------------------------------------- class const_iterator { public: struct span { int32 x; int32 len; // If negative, it's a solid span, covers is valid const T* covers; }; const_iterator() : m_storage(0) {} const_iterator(const embedded_scanline& sl) : m_storage(sl.m_storage), m_span_idx(sl.m_scanline.start_span) { init_span(); } const span& operator*() const { return m_span; } const span* operator->() const { return &m_span; } void operator ++ () { ++m_span_idx; init_span(); } private: void init_span() { const span_data& s = m_storage->span_by_index(m_span_idx); m_span.x = s.x; m_span.len = s.len; m_span.covers = m_storage->covers_by_index(s.covers_id); } const scanline_storage_aa* m_storage; unsigned m_span_idx; span m_span; }; friend class const_iterator; //----------------------------------------------------------- embedded_scanline(const scanline_storage_aa& storage) : m_storage(&storage) { init(0); } //----------------------------------------------------------- void reset(int, int) {} unsigned num_spans() const { return m_scanline.num_spans; } int y() const { return m_scanline.y; } const_iterator begin() const { return const_iterator(*this); } //----------------------------------------------------------- void init(unsigned scanline_idx) { m_scanline_idx = scanline_idx; m_scanline = m_storage->scanline_by_index(m_scanline_idx); } private: const scanline_storage_aa* m_storage; scanline_data m_scanline; unsigned m_scanline_idx; }; //--------------------------------------------------------------- scanline_storage_aa() : m_covers(), m_spans(256-2), // Block increment size m_scanlines(), m_min_x( 0x7FFFFFFF), m_min_y( 0x7FFFFFFF), m_max_x(-0x7FFFFFFF), m_max_y(-0x7FFFFFFF), m_cur_scanline(0) { m_fake_scanline.y = 0; m_fake_scanline.num_spans = 0; m_fake_scanline.start_span = 0; m_fake_span.x = 0; m_fake_span.len = 0; m_fake_span.covers_id = 0; } // Renderer Interface //--------------------------------------------------------------- void prepare() { m_covers.remove_all(); m_scanlines.remove_all(); m_spans.remove_all(); m_min_x = 0x7FFFFFFF; m_min_y = 0x7FFFFFFF; m_max_x = -0x7FFFFFFF; m_max_y = -0x7FFFFFFF; m_cur_scanline = 0; } //--------------------------------------------------------------- template<class Scanline> void render(const Scanline& sl) { scanline_data sl_this; int y = sl.y(); if(y < m_min_y) m_min_y = y; if(y > m_max_y) m_max_y = y; sl_this.y = y; sl_this.num_spans = sl.num_spans(); sl_this.start_span = m_spans.size(); typename Scanline::const_iterator span_iterator = sl.begin(); unsigned num_spans = sl_this.num_spans; for(;;) { span_data sp; 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, unsigned(len)); m_spans.add(sp); int x1 = sp.x; int x2 = sp.x + len - 1; if(x1 < m_min_x) m_min_x = x1; if(x2 > m_max_x) m_max_x = x2; if(--num_spans == 0) break; ++span_iterator; } m_scanlines.add(sl_this); } //--------------------------------------------------------------- // Iterate scanlines interface int min_x() const { return m_min_x; } int min_y() const { return m_min_y; } int max_x() const { return m_max_x; } int max_y() const { return m_max_y; } //--------------------------------------------------------------- bool rewind_scanlines() { m_cur_scanline = 0; return m_scanlines.size() > 0; } //--------------------------------------------------------------- template<class Scanline> bool sweep_scanline(Scanline& sl) { sl.reset_spans(); for(;;) { if(m_cur_scanline >= m_scanlines.size()) return false; const scanline_data& sl_this = m_scanlines[m_cur_scanline]; unsigned num_spans = sl_this.num_spans; unsigned span_idx = sl_this.start_span; do { const span_data& sp = m_spans[span_idx++]; const T* covers = covers_by_index(sp.covers_id); if(sp.len < 0) { sl.add_span(sp.x, unsigned(-sp.len), *covers); } else { sl.add_cells(sp.x, sp.len, covers); } } while(--num_spans); ++m_cur_scanline; if(sl.num_spans()) { sl.finalize(sl_this.y); break; } } return true; } //--------------------------------------------------------------- // Specialization for embedded_scanline bool sweep_scanline(embedded_scanline& sl) { do { if(m_cur_scanline >= m_scanlines.size()) return false; sl.init(m_cur_scanline); ++m_cur_scanline; } while(sl.num_spans() == 0); return true; } //--------------------------------------------------------------- unsigned byte_size() const { unsigned i; unsigned size = sizeof(int32) * 4; // min_x, min_y, max_x, max_y for(i = 0; i < m_scanlines.size(); ++i) { size += sizeof(int32) * 3; // scanline size in bytes, Y, num_spans const scanline_data& sl_this = m_scanlines[i]; unsigned num_spans = sl_this.num_spans; unsigned span_idx = sl_this.start_span; do { const span_data& sp = m_spans[span_idx++]; size += sizeof(int32) * 2; // X, span_len if(sp.len < 0) { size += sizeof(T); // cover } else { size += sizeof(T) * unsigned(sp.len); // covers } } while(--num_spans); } return size; } //--------------------------------------------------------------- static void write_int32(int8u* dst, int32 val) { dst[0] = ((const int8u*)&val)[0]; dst[1] = ((const int8u*)&val)[1]; dst[2] = ((const int8u*)&val)[2]; dst[3] = ((const int8u*)&val)[3]; } //--------------------------------------------------------------- void serialize(int8u* data) const { unsigned i; write_int32(data, min_x()); // min_x data += sizeof(int32); write_int32(data, min_y()); // min_y data += sizeof(int32); write_int32(data, max_x()); // max_x data += sizeof(int32); write_int32(data, max_y()); // max_y data += sizeof(int32); for(i = 0; i < m_scanlines.size(); ++i) { const scanline_data& sl_this = m_scanlines[i]; int8u* size_ptr = data; data += sizeof(int32); // Reserve space for scanline size in bytes write_int32(data, sl_this.y); // Y data += sizeof(int32); write_int32(data, sl_this.num_spans); // num_spans data += sizeof(int32); unsigned num_spans = sl_this.num_spans; unsigned span_idx = sl_this.start_span; do { const span_data& sp = m_spans[span_idx++]; const T* covers = covers_by_index(sp.covers_id); write_int32(data, sp.x); // X data += sizeof(int32); write_int32(data, sp.len); // span_len data += sizeof(int32); if(sp.len < 0) { memcpy(data, covers, sizeof(T)); data += sizeof(T); } else { memcpy(data, covers, unsigned(sp.len) * sizeof(T)); data += sizeof(T) * unsigned(sp.len); } } while(--num_spans); write_int32(size_ptr, int32(unsigned(data - size_ptr))); } } //--------------------------------------------------------------- const scanline_data& scanline_by_index(unsigned i) const { return (i < m_scanlines.size()) ? m_scanlines[i] : m_fake_scanline; } //--------------------------------------------------------------- const span_data& span_by_index(unsigned i) const { return (i < m_spans.size()) ? m_spans[i] : m_fake_span; } //--------------------------------------------------------------- const T* covers_by_index(int i) const { return m_covers[i]; } private: scanline_cell_storage<T> m_covers; pod_bvector<span_data, 10> m_spans; pod_bvector<scanline_data, 8> m_scanlines; span_data m_fake_span; scanline_data m_fake_scanline; int m_min_x; int m_min_y; int m_max_x; int m_max_y; unsigned m_cur_scanline; }; typedef scanline_storage_aa<int8u> scanline_storage_aa8; //--------scanline_storage_aa8 typedef scanline_storage_aa<int16u> scanline_storage_aa16; //--------scanline_storage_aa16 typedef scanline_storage_aa<int32u> scanline_storage_aa32; //--------scanline_storage_aa32 //------------------------------------------serialized_scanlines_adaptor_aa template<class T> class serialized_scanlines_adaptor_aa { public: typedef T cover_type; //--------------------------------------------------------------------- class embedded_scanline { public: typedef T cover_type; //----------------------------------------------------------------- class const_iterator { public: struct span { int32 x; int32 len; // If negative, it's a solid span, "covers" is valid const T* covers; }; const_iterator() : m_ptr(0) {} const_iterator(const embedded_scanline& sl) : m_ptr(sl.m_ptr), m_dx(sl.m_dx) { init_span(); } const span& operator*() const { return m_span; } const span* operator->() const { return &m_span; } void operator ++ () { if(m_span.len < 0) { m_ptr += sizeof(T); } else { m_ptr += m_span.len * sizeof(T); } init_span(); } private: int read_int32() { int32 val; ((int8u*)&val)[0] = *m_ptr++; ((int8u*)&val)[1] = *m_ptr++; ((int8u*)&val)[2] = *m_ptr++; ((int8u*)&val)[3] = *m_ptr++; return val; } void init_span() { m_span.x = read_int32() + m_dx; m_span.len = read_int32(); m_span.covers = m_ptr; } const int8u* m_ptr; span m_span; int m_dx; }; friend class const_iterator; //----------------------------------------------------------------- embedded_scanline() : m_ptr(0), m_y(0), m_num_spans(0) {} //----------------------------------------------------------------- void reset(int, int) {} unsigned num_spans() const { return m_num_spans; } int y() const { return m_y; } const_iterator begin() const { return const_iterator(*this); } private: //----------------------------------------------------------------- int read_int32() { int32 val; ((int8u*)&val)[0] = *m_ptr++; ((int8u*)&val)[1] = *m_ptr++; ((int8u*)&val)[2] = *m_ptr++; ((int8u*)&val)[3] = *m_ptr++; return val; } public: //----------------------------------------------------------------- void init(const int8u* ptr, int dx, int dy) { m_ptr = ptr; m_y = read_int32() + dy; m_num_spans = unsigned(read_int32()); m_dx = dx; } private: const int8u* m_ptr; int m_y; unsigned m_num_spans; int m_dx; }; public: //-------------------------------------------------------------------- serialized_scanlines_adaptor_aa() : m_data(0), m_end(0), m_ptr(0), m_dx(0), m_dy(0), m_min_x(0x7FFFFFFF), m_min_y(0x7FFFFFFF), m_max_x(-0x7FFFFFFF), m_max_y(-0x7FFFFFFF) {} //-------------------------------------------------------------------- serialized_scanlines_adaptor_aa(const int8u* data, unsigned size, double dx, double dy) : m_data(data), m_end(data + size), m_ptr(data), m_dx(iround(dx)), m_dy(iround(dy)), m_min_x(0x7FFFFFFF), m_min_y(0x7FFFFFFF), m_max_x(-0x7FFFFFFF), m_max_y(-0x7FFFFFFF) {} //-------------------------------------------------------------------- void init(const int8u* data, unsigned size, double dx, double dy) { m_data = data; m_end = data + size; m_ptr = data; m_dx = iround(dx); m_dy = iround(dy); m_min_x = 0x7FFFFFFF; m_min_y = 0x7FFFFFFF; m_max_x = -0x7FFFFFFF; m_max_y = -0x7FFFFFFF; } private: //-------------------------------------------------------------------- int read_int32() { int32 val; ((int8u*)&val)[0] = *m_ptr++; ((int8u*)&val)[1] = *m_ptr++; ((int8u*)&val)[2] = *m_ptr++; ((int8u*)&val)[3] = *m_ptr++; return val; } //-------------------------------------------------------------------- unsigned read_int32u() { int32u val; ((int8u*)&val)[0] = *m_ptr++; ((int8u*)&val)[1] = *m_ptr++; ((int8u*)&val)[2] = *m_ptr++; ((int8u*)&val)[3] = *m_ptr++; return val; } public: // Iterate scanlines interface //-------------------------------------------------------------------- bool rewind_scanlines() { m_ptr = m_data; if(m_ptr < m_end) { m_min_x = read_int32() + m_dx; m_min_y = read_int32() + m_dy; m_max_x = read_int32() + m_dx; m_max_y = read_int32() + m_dy; } return m_ptr < m_end; } //-------------------------------------------------------------------- int min_x() const { return m_min_x; } int min_y() const { return m_min_y; } int max_x() const { return m_max_x; } int max_y() const { return m_max_y; } //-------------------------------------------------------------------- template<class Scanline> bool sweep_scanline(Scanline& sl) { sl.reset_spans(); for(;;) { if(m_ptr >= m_end) return false; read_int32(); // Skip scanline size in bytes int y = read_int32() + m_dy; unsigned num_spans = read_int32(); do { int x = read_int32() + m_dx; int len = read_int32(); if(len < 0) { sl.add_span(x, unsigned(-len), *m_ptr); m_ptr += sizeof(T); } else { sl.add_cells(x, len, m_ptr); m_ptr += len * sizeof(T); } } while(--num_spans); if(sl.num_spans()) { sl.finalize(y); break; } } return true; } //-------------------------------------------------------------------- // Specialization for embedded_scanline bool sweep_scanline(embedded_scanline& sl) { do { if(m_ptr >= m_end) return false; unsigned byte_size = read_int32u(); sl.init(m_ptr, m_dx, m_dy); m_ptr += byte_size - sizeof(int32); } while(sl.num_spans() == 0); return true; } private: const int8u* m_data; const int8u* m_end; const int8u* m_ptr; int m_dx; int m_dy; int m_min_x; int m_min_y; int m_max_x; int m_max_y; }; typedef serialized_scanlines_adaptor_aa<int8u> serialized_scanlines_adaptor_aa8; //----serialized_scanlines_adaptor_aa8 typedef serialized_scanlines_adaptor_aa<int16u> serialized_scanlines_adaptor_aa16; //----serialized_scanlines_adaptor_aa16 typedef serialized_scanlines_adaptor_aa<int32u> serialized_scanlines_adaptor_aa32; //----serialized_scanlines_adaptor_aa32 } #endif ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_scanline_storage_bin.h����������������������������������������������������0000644�0000000�0000000�00000044234�10703246330�022047� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- // // Adaptation for 32-bit screen coordinates 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_SCANLINE_STORAGE_BIN_INCLUDED #define AGG_SCANLINE_STORAGE_BIN_INCLUDED #include <string.h> #include <stdlib.h> #include <math.h> #include "agg_array.h" namespace agg { //-----------------------------------------------scanline_storage_bin class scanline_storage_bin { public: //--------------------------------------------------------------- struct span_data { int32 x; int32 len; }; //--------------------------------------------------------------- struct scanline_data { int y; unsigned num_spans; unsigned start_span; }; //--------------------------------------------------------------- class embedded_scanline { public: //----------------------------------------------------------- class const_iterator { public: const_iterator() : m_storage(0) {} const_iterator(const embedded_scanline& sl) : m_storage(sl.m_storage), m_span_idx(sl.m_scanline.start_span) { m_span = m_storage->span_by_index(m_span_idx); } const span_data& operator*() const { return m_span; } const span_data* operator->() const { return &m_span; } void operator ++ () { ++m_span_idx; m_span = m_storage->span_by_index(m_span_idx); } private: const scanline_storage_bin* m_storage; unsigned m_span_idx; span_data m_span; }; friend class const_iterator; //----------------------------------------------------------- embedded_scanline(const scanline_storage_bin& storage) : m_storage(&storage) { setup(0); } //----------------------------------------------------------- void reset(int, int) {} unsigned num_spans() const { return m_scanline.num_spans; } int y() const { return m_scanline.y; } const_iterator begin() const { return const_iterator(*this); } //----------------------------------------------------------- void setup(unsigned scanline_idx) { m_scanline_idx = scanline_idx; m_scanline = m_storage->scanline_by_index(m_scanline_idx); } private: const scanline_storage_bin* m_storage; scanline_data m_scanline; unsigned m_scanline_idx; }; //--------------------------------------------------------------- scanline_storage_bin() : m_spans(256-2), // Block increment size m_scanlines(), m_min_x( 0x7FFFFFFF), m_min_y( 0x7FFFFFFF), m_max_x(-0x7FFFFFFF), m_max_y(-0x7FFFFFFF), m_cur_scanline(0) { m_fake_scanline.y = 0; m_fake_scanline.num_spans = 0; m_fake_scanline.start_span = 0; m_fake_span.x = 0; m_fake_span.len = 0; } // Renderer Interface //--------------------------------------------------------------- void prepare() { m_scanlines.remove_all(); m_spans.remove_all(); m_min_x = 0x7FFFFFFF; m_min_y = 0x7FFFFFFF; m_max_x = -0x7FFFFFFF; m_max_y = -0x7FFFFFFF; m_cur_scanline = 0; } //--------------------------------------------------------------- template<class Scanline> void render(const Scanline& sl) { scanline_data sl_this; int y = sl.y(); if(y < m_min_y) m_min_y = y; if(y > m_max_y) m_max_y = y; sl_this.y = y; sl_this.num_spans = sl.num_spans(); sl_this.start_span = m_spans.size(); typename Scanline::const_iterator span_iterator = sl.begin(); unsigned num_spans = sl_this.num_spans; for(;;) { span_data sp; sp.x = span_iterator->x; sp.len = (int32)abs((int)(span_iterator->len)); m_spans.add(sp); int x1 = sp.x; int x2 = sp.x + sp.len - 1; if(x1 < m_min_x) m_min_x = x1; if(x2 > m_max_x) m_max_x = x2; if(--num_spans == 0) break; ++span_iterator; } m_scanlines.add(sl_this); } //--------------------------------------------------------------- // Iterate scanlines interface int min_x() const { return m_min_x; } int min_y() const { return m_min_y; } int max_x() const { return m_max_x; } int max_y() const { return m_max_y; } //--------------------------------------------------------------- bool rewind_scanlines() { m_cur_scanline = 0; return m_scanlines.size() > 0; } //--------------------------------------------------------------- template<class Scanline> bool sweep_scanline(Scanline& sl) { sl.reset_spans(); for(;;) { if(m_cur_scanline >= m_scanlines.size()) return false; const scanline_data& sl_this = m_scanlines[m_cur_scanline]; unsigned num_spans = sl_this.num_spans; unsigned span_idx = sl_this.start_span; do { const span_data& sp = m_spans[span_idx++]; sl.add_span(sp.x, sp.len, cover_full); } while(--num_spans); ++m_cur_scanline; if(sl.num_spans()) { sl.finalize(sl_this.y); break; } } return true; } //--------------------------------------------------------------- // Specialization for embedded_scanline bool sweep_scanline(embedded_scanline& sl) { do { if(m_cur_scanline >= m_scanlines.size()) return false; sl.setup(m_cur_scanline); ++m_cur_scanline; } while(sl.num_spans() == 0); return true; } //--------------------------------------------------------------- unsigned byte_size() const { unsigned i; unsigned size = sizeof(int32) * 4; // min_x, min_y, max_x, max_y for(i = 0; i < m_scanlines.size(); ++i) { size += sizeof(int32) * 2 + // Y, num_spans unsigned(m_scanlines[i].num_spans) * sizeof(int32) * 2; // X, span_len } return size; } //--------------------------------------------------------------- static void write_int32(int8u* dst, int32 val) { dst[0] = ((const int8u*)&val)[0]; dst[1] = ((const int8u*)&val)[1]; dst[2] = ((const int8u*)&val)[2]; dst[3] = ((const int8u*)&val)[3]; } //--------------------------------------------------------------- void serialize(int8u* data) const { unsigned i; write_int32(data, min_x()); // min_x data += sizeof(int32); write_int32(data, min_y()); // min_y data += sizeof(int32); write_int32(data, max_x()); // max_x data += sizeof(int32); write_int32(data, max_y()); // max_y data += sizeof(int32); for(i = 0; i < m_scanlines.size(); ++i) { const scanline_data& sl_this = m_scanlines[i]; write_int32(data, sl_this.y); // Y data += sizeof(int32); write_int32(data, sl_this.num_spans); // num_spans data += sizeof(int32); unsigned num_spans = sl_this.num_spans; unsigned span_idx = sl_this.start_span; do { const span_data& sp = m_spans[span_idx++]; write_int32(data, sp.x); // X data += sizeof(int32); write_int32(data, sp.len); // len data += sizeof(int32); } while(--num_spans); } } //--------------------------------------------------------------- const scanline_data& scanline_by_index(unsigned i) const { return (i < m_scanlines.size()) ? m_scanlines[i] : m_fake_scanline; } //--------------------------------------------------------------- const span_data& span_by_index(unsigned i) const { return (i < m_spans.size()) ? m_spans[i] : m_fake_span; } private: pod_bvector<span_data, 10> m_spans; pod_bvector<scanline_data, 8> m_scanlines; span_data m_fake_span; scanline_data m_fake_scanline; int m_min_x; int m_min_y; int m_max_x; int m_max_y; unsigned m_cur_scanline; }; //---------------------------------------serialized_scanlines_adaptor_bin class serialized_scanlines_adaptor_bin { public: typedef bool cover_type; //-------------------------------------------------------------------- class embedded_scanline { public: //---------------------------------------------------------------- class const_iterator { public: struct span { int32 x; int32 len; }; const_iterator() : m_ptr(0) {} const_iterator(const embedded_scanline& sl) : m_ptr(sl.m_ptr), m_dx(sl.m_dx) { m_span.x = read_int32() + m_dx; m_span.len = read_int32(); } const span& operator*() const { return m_span; } const span* operator->() const { return &m_span; } void operator ++ () { m_span.x = read_int32() + m_dx; m_span.len = read_int32(); } private: int read_int32() { int32 val; ((int8u*)&val)[0] = *m_ptr++; ((int8u*)&val)[1] = *m_ptr++; ((int8u*)&val)[2] = *m_ptr++; ((int8u*)&val)[3] = *m_ptr++; return val; } const int8u* m_ptr; span m_span; int m_dx; }; friend class const_iterator; //---------------------------------------------------------------- embedded_scanline() : m_ptr(0), m_y(0), m_num_spans(0) {} //---------------------------------------------------------------- void reset(int, int) {} unsigned num_spans() const { return m_num_spans; } int y() const { return m_y; } const_iterator begin() const { return const_iterator(*this); } private: //---------------------------------------------------------------- int read_int32() { int32 val; ((int8u*)&val)[0] = *m_ptr++; ((int8u*)&val)[1] = *m_ptr++; ((int8u*)&val)[2] = *m_ptr++; ((int8u*)&val)[3] = *m_ptr++; return val; } public: //---------------------------------------------------------------- void init(const int8u* ptr, int dx, int dy) { m_ptr = ptr; m_y = read_int32() + dy; m_num_spans = unsigned(read_int32()); m_dx = dx; } private: const int8u* m_ptr; int m_y; unsigned m_num_spans; int m_dx; }; public: //-------------------------------------------------------------------- serialized_scanlines_adaptor_bin() : m_data(0), m_end(0), m_ptr(0), m_dx(0), m_dy(0), m_min_x(0x7FFFFFFF), m_min_y(0x7FFFFFFF), m_max_x(-0x7FFFFFFF), m_max_y(-0x7FFFFFFF) {} //-------------------------------------------------------------------- serialized_scanlines_adaptor_bin(const int8u* data, unsigned size, double dx, double dy) : m_data(data), m_end(data + size), m_ptr(data), m_dx(iround(dx)), m_dy(iround(dy)), m_min_x(0x7FFFFFFF), m_min_y(0x7FFFFFFF), m_max_x(-0x7FFFFFFF), m_max_y(-0x7FFFFFFF) {} //-------------------------------------------------------------------- void init(const int8u* data, unsigned size, double dx, double dy) { m_data = data; m_end = data + size; m_ptr = data; m_dx = iround(dx); m_dy = iround(dy); m_min_x = 0x7FFFFFFF; m_min_y = 0x7FFFFFFF; m_max_x = -0x7FFFFFFF; m_max_y = -0x7FFFFFFF; } private: //-------------------------------------------------------------------- int read_int32() { int32 val; ((int8u*)&val)[0] = *m_ptr++; ((int8u*)&val)[1] = *m_ptr++; ((int8u*)&val)[2] = *m_ptr++; ((int8u*)&val)[3] = *m_ptr++; return val; } public: // Iterate scanlines interface //-------------------------------------------------------------------- bool rewind_scanlines() { m_ptr = m_data; if(m_ptr < m_end) { m_min_x = read_int32() + m_dx; m_min_y = read_int32() + m_dy; m_max_x = read_int32() + m_dx; m_max_y = read_int32() + m_dy; } return m_ptr < m_end; } //-------------------------------------------------------------------- int min_x() const { return m_min_x; } int min_y() const { return m_min_y; } int max_x() const { return m_max_x; } int max_y() const { return m_max_y; } //-------------------------------------------------------------------- template<class Scanline> bool sweep_scanline(Scanline& sl) { sl.reset_spans(); for(;;) { if(m_ptr >= m_end) return false; int y = read_int32() + m_dy; unsigned num_spans = read_int32(); do { int x = read_int32() + m_dx; int len = read_int32(); if(len < 0) len = -len; sl.add_span(x, unsigned(len), cover_full); } while(--num_spans); if(sl.num_spans()) { sl.finalize(y); break; } } return true; } //-------------------------------------------------------------------- // Specialization for embedded_scanline bool sweep_scanline(embedded_scanline& sl) { do { if(m_ptr >= m_end) return false; sl.init(m_ptr, m_dx, m_dy); // Jump to the next scanline //-------------------------- read_int32(); // Y int num_spans = read_int32(); // num_spans m_ptr += num_spans * sizeof(int32) * 2; } while(sl.num_spans() == 0); return true; } private: const int8u* m_data; const int8u* m_end; const int8u* m_ptr; int m_dx; int m_dy; int m_min_x; int m_min_y; int m_max_x; int m_max_y; }; } #endif ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_scanline_u.h��������������������������������������������������������������0000644�0000000�0000000�00000042011�10703246330�020006� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- // // Adaptation for 32-bit screen coordinates (scanline32_u) 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_SCANLINE_U_INCLUDED #define AGG_SCANLINE_U_INCLUDED #include "agg_array.h" namespace agg { //=============================================================scanline_u8 // // Unpacked scanline container class // // This class is used to transfer data from a scanline rasterizer // 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. // 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. // Use scanline_u8::iterator to render spans: //------------------------------------------------------------------------- // // int y = sl.y(); // Y-coordinate of the scanline // // ************************************ // ...Perform vertical clipping here... // ************************************ // // scanline_u8::const_iterator span = sl.begin(); // // 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. // // do // { // const scanline_u8::cover_type* covers = // span->covers; // The array of the cover values // // int num_pix = span->len; // Number of pixels of the span. // // Always greater than 0, still it's // // better to use "int" instead of // // "unsigned" because it's more // // convenient for clipping // int x = span->x; // // ************************************** // ...Perform horizontal clipping here... // ...you have x, covers, and pix_count.. // ************************************** // // unsigned char* dst = row + x; // Calculate the start address of the row. // // In this case we assume a simple // // grayscale image 1-byte per pixel. // do // { // *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 scanline 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 // (that can be very large) occurs less frequently. //------------------------------------------------------------------------ class scanline_u8 { public: typedef scanline_u8 self_type; typedef int8u cover_type; typedef int16 coord_type; //-------------------------------------------------------------------- struct span { coord_type x; coord_type len; cover_type* covers; }; typedef span* iterator; typedef const span* const_iterator; //-------------------------------------------------------------------- scanline_u8() : m_min_x(0), m_last_x(0x7FFFFFF0), m_cur_span(0) {} //-------------------------------------------------------------------- void reset(int min_x, int max_x) { unsigned max_len = max_x - min_x + 2; if(max_len > m_spans.size()) { m_spans.resize(max_len); m_covers.resize(max_len); } m_last_x = 0x7FFFFFF0; m_min_x = min_x; m_cur_span = &m_spans[0]; } //-------------------------------------------------------------------- void add_cell(int x, unsigned cover) { x -= m_min_x; m_covers[x] = (cover_type)cover; if(x == m_last_x+1) { m_cur_span->len++; } else { m_cur_span++; m_cur_span->x = (coord_type)(x + m_min_x); m_cur_span->len = 1; m_cur_span->covers = &m_covers[x]; } m_last_x = x; } //-------------------------------------------------------------------- void add_cells(int x, unsigned len, const cover_type* covers) { x -= m_min_x; memcpy(&m_covers[x], covers, len * sizeof(cover_type)); if(x == m_last_x+1) { m_cur_span->len += (coord_type)len; } else { m_cur_span++; m_cur_span->x = (coord_type)(x + m_min_x); m_cur_span->len = (coord_type)len; m_cur_span->covers = &m_covers[x]; } m_last_x = x + len - 1; } //-------------------------------------------------------------------- void add_span(int x, unsigned len, unsigned cover) { x -= m_min_x; memset(&m_covers[x], cover, len); if(x == m_last_x+1) { m_cur_span->len += (coord_type)len; } else { m_cur_span++; m_cur_span->x = (coord_type)(x + m_min_x); m_cur_span->len = (coord_type)len; m_cur_span->covers = &m_covers[x]; } m_last_x = x + len - 1; } //-------------------------------------------------------------------- void finalize(int y) { m_y = y; } //-------------------------------------------------------------------- void reset_spans() { m_last_x = 0x7FFFFFF0; m_cur_span = &m_spans[0]; } //-------------------------------------------------------------------- int y() const { return m_y; } unsigned num_spans() const { return unsigned(m_cur_span - &m_spans[0]); } const_iterator begin() const { return &m_spans[1]; } iterator begin() { return &m_spans[1]; } private: scanline_u8(const self_type&); const self_type& operator = (const self_type&); private: int m_min_x; int m_last_x; int m_y; pod_array<cover_type> m_covers; pod_array<span> m_spans; span* m_cur_span; }; //==========================================================scanline_u8_am // // The scanline container with alpha-masking // //------------------------------------------------------------------------ template<class AlphaMask> class scanline_u8_am : public scanline_u8 { public: typedef scanline_u8 base_type; typedef AlphaMask alpha_mask_type; typedef base_type::cover_type cover_type; typedef base_type::coord_type coord_type; scanline_u8_am() : base_type(), m_alpha_mask(0) {} scanline_u8_am(const AlphaMask& am) : base_type(), m_alpha_mask(&am) {} //-------------------------------------------------------------------- void finalize(int span_y) { base_type::finalize(span_y); if(m_alpha_mask) { typename base_type::iterator span = base_type::begin(); unsigned count = base_type::num_spans(); do { m_alpha_mask->combine_hspan(span->x, base_type::y(), span->covers, span->len); ++span; } while(--count); } } private: const AlphaMask* m_alpha_mask; }; //===========================================================scanline32_u8 class scanline32_u8 { public: typedef scanline32_u8 self_type; typedef int8u cover_type; typedef int32 coord_type; //-------------------------------------------------------------------- struct span { span() {} span(coord_type x_, coord_type len_, cover_type* covers_) : x(x_), len(len_), covers(covers_) {} coord_type x; coord_type len; cover_type* covers; }; typedef pod_bvector<span, 4> span_array_type; //-------------------------------------------------------------------- class const_iterator { public: const_iterator(const span_array_type& spans) : m_spans(spans), m_span_idx(0) {} const span& operator*() const { return m_spans[m_span_idx]; } const span* operator->() const { return &m_spans[m_span_idx]; } void operator ++ () { ++m_span_idx; } private: const span_array_type& m_spans; unsigned m_span_idx; }; //-------------------------------------------------------------------- class iterator { public: iterator(span_array_type& spans) : m_spans(spans), m_span_idx(0) {} span& operator*() { return m_spans[m_span_idx]; } span* operator->() { return &m_spans[m_span_idx]; } void operator ++ () { ++m_span_idx; } private: span_array_type& m_spans; unsigned m_span_idx; }; //-------------------------------------------------------------------- scanline32_u8() : m_min_x(0), m_last_x(0x7FFFFFF0), m_covers() {} //-------------------------------------------------------------------- void reset(int min_x, int max_x) { unsigned max_len = max_x - min_x + 2; if(max_len > m_covers.size()) { m_covers.resize(max_len); } m_last_x = 0x7FFFFFF0; m_min_x = min_x; m_spans.remove_all(); } //-------------------------------------------------------------------- void add_cell(int x, unsigned cover) { x -= m_min_x; m_covers[x] = cover_type(cover); if(x == m_last_x+1) { m_spans.last().len++; } else { m_spans.add(span(coord_type(x + m_min_x), 1, &m_covers[x])); } m_last_x = x; } //-------------------------------------------------------------------- void add_cells(int x, unsigned len, const cover_type* covers) { x -= m_min_x; memcpy(&m_covers[x], covers, len * sizeof(cover_type)); if(x == m_last_x+1) { m_spans.last().len += coord_type(len); } else { m_spans.add(span(coord_type(x + m_min_x), coord_type(len), &m_covers[x])); } m_last_x = x + len - 1; } //-------------------------------------------------------------------- void add_span(int x, unsigned len, unsigned cover) { x -= m_min_x; memset(&m_covers[x], cover, len); if(x == m_last_x+1) { m_spans.last().len += coord_type(len); } else { m_spans.add(span(coord_type(x + m_min_x), coord_type(len), &m_covers[x])); } m_last_x = x + len - 1; } //-------------------------------------------------------------------- void finalize(int y) { m_y = y; } //-------------------------------------------------------------------- void reset_spans() { m_last_x = 0x7FFFFFF0; m_spans.remove_all(); } //-------------------------------------------------------------------- int y() const { return m_y; } unsigned num_spans() const { return m_spans.size(); } const_iterator begin() const { return const_iterator(m_spans); } iterator begin() { return iterator(m_spans); } private: scanline32_u8(const self_type&); const self_type& operator = (const self_type&); private: int m_min_x; int m_last_x; int m_y; pod_array<cover_type> m_covers; span_array_type m_spans; }; //========================================================scanline32_u8_am // // The scanline container with alpha-masking // //------------------------------------------------------------------------ template<class AlphaMask> class scanline32_u8_am : public scanline32_u8 { public: typedef scanline_u8 base_type; typedef AlphaMask alpha_mask_type; typedef base_type::cover_type cover_type; typedef base_type::coord_type coord_type; scanline32_u8_am() : base_type(), m_alpha_mask(0) {} scanline32_u8_am(const AlphaMask& am) : base_type(), m_alpha_mask(&am) {} //-------------------------------------------------------------------- void finalize(int span_y) { base_type::finalize(span_y); if(m_alpha_mask) { typename base_type::iterator span = base_type::begin(); unsigned count = base_type::num_spans(); do { m_alpha_mask->combine_hspan(span->x, base_type::y(), span->covers, span->len); ++span; } while(--count); } } private: const AlphaMask* m_alpha_mask; }; } #endif �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_shorten_path.h������������������������������������������������������������0000644�0000000�0000000�00000004530�10703246330�020370� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_SHORTEN_PATH_INCLUDED #define AGG_SHORTEN_PATH_INCLUDED #include "agg_basics.h" #include "agg_vertex_sequence.h" namespace agg { //===========================================================shorten_path template<class VertexSequence> void shorten_path(VertexSequence& vs, double s, unsigned closed = 0) { typedef typename VertexSequence::value_type vertex_type; if(s > 0.0 && vs.size() > 1) { double d; int n = int(vs.size() - 2); while(n) { d = vs[n].dist; if(d > s) break; vs.remove_last(); s -= d; --n; } if(vs.size() < 2) { vs.remove_all(); } else { n = vs.size() - 1; vertex_type& prev = vs[n-1]; vertex_type& last = vs[n]; d = (prev.dist - s) / prev.dist; double x = prev.x + (last.x - prev.x) * d; double y = prev.y + (last.y - prev.y) * d; last.x = x; last.y = y; if(!prev(last)) vs.remove_last(); vs.close(closed != 0); } } } } #endif ������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_simul_eq.h����������������������������������������������������������������0000644�0000000�0000000�00000010223�10703246330�017504� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_SIMUL_EQ_INCLUDED #define AGG_SIMUL_EQ_INCLUDED #include <math.h> #include "agg_basics.h" namespace agg { //=============================================================swap_arrays template<class T> void swap_arrays(T* a1, T* a2, unsigned n) { unsigned i; for(i = 0; i < n; i++) { T tmp = *a1; *a1++ = *a2; *a2++ = tmp; } } //============================================================matrix_pivot template<unsigned Rows, unsigned Cols> struct matrix_pivot { static int pivot(double m[Rows][Cols], unsigned row) { int k = int(row); double max_val, tmp; max_val = -1.0; unsigned i; for(i = row; i < Rows; i++) { if((tmp = fabs(m[i][row])) > max_val && tmp != 0.0) { max_val = tmp; k = i; } } if(m[k][row] == 0.0) { return -1; } if(k != int(row)) { swap_arrays(m[k], m[row], Cols); return k; } return 0; } }; //===============================================================simul_eq template<unsigned Size, unsigned RightCols> struct simul_eq { static bool solve(const double left[Size][Size], const double right[Size][RightCols], double result[Size][RightCols]) { unsigned i, j, k; double a1; double tmp[Size][Size + RightCols]; for(i = 0; i < Size; i++) { 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]; } } for(k = 0; k < Size; k++) { if(matrix_pivot<Size, Size + RightCols>::pivot(tmp, k) < 0) { return false; // Singularity.... } a1 = tmp[k][k]; for(j = k; j < Size + RightCols; j++) { tmp[k][j] /= a1; } for(i = k + 1; i < Size; i++) { a1 = tmp[i][k]; for (j = k; j < Size + RightCols; j++) { tmp[i][j] -= a1 * tmp[k][j]; } } } for(k = 0; k < RightCols; k++) { int m; for(m = int(Size - 1); m >= 0; m--) { result[m][k] = tmp[m][Size + k]; for(j = m + 1; j < Size; j++) { result[m][k] -= tmp[m][j] * result[j][k]; } } } return true; } }; } #endif �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_span_allocator.h����������������������������������������������������������0000644�0000000�0000000�00000004161�10703246330�020673� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_SPAN_ALLOCATOR_INCLUDED #define AGG_SPAN_ALLOCATOR_INCLUDED #include "agg_array.h" namespace agg { //----------------------------------------------------------span_allocator template<class ColorT> class span_allocator { public: typedef ColorT color_type; //-------------------------------------------------------------------- AGG_INLINE color_type* allocate(unsigned span_len) { if(span_len > m_span.size()) { // To reduce the number of reallocs we align the // span_len to 256 color elements. // Well, I just like this number and it looks reasonable. //----------------------- m_span.resize(((span_len + 255) >> 8) << 8); } return &m_span[0]; } AGG_INLINE color_type* span() { return &m_span[0]; } AGG_INLINE unsigned max_span_len() const { return m_span.size(); } private: pod_array<color_type> m_span; }; } #endif ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_span_converter.h����������������������������������������������������������0000644�0000000�0000000�00000004406�10703246330�020724� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_SPAN_CONVERTER_INCLUDED #define AGG_SPAN_CONVERTER_INCLUDED #include "agg_basics.h" namespace agg { //----------------------------------------------------------span_converter template<class SpanGenerator, class SpanConverter> class span_converter { public: typedef typename SpanGenerator::color_type color_type; span_converter(SpanGenerator& span_gen, SpanConverter& span_cnv) : m_span_gen(&span_gen), m_span_cnv(&span_cnv) {} void attach_generator(SpanGenerator& span_gen) { m_span_gen = &span_gen; } void attach_converter(SpanConverter& span_cnv) { m_span_cnv = &span_cnv; } //-------------------------------------------------------------------- void prepare() { m_span_gen->prepare(); m_span_cnv->prepare(); } //-------------------------------------------------------------------- void generate(color_type* span, int x, int y, unsigned len) { m_span_gen->generate(span, x, y, len); m_span_cnv->generate(span, x, y, len); } private: SpanGenerator* m_span_gen; SpanConverter* m_span_cnv; }; } #endif ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_span_gouraud.h������������������������������������������������������������0000644�0000000�0000000�00000013707�10703246330�020367� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_SPAN_GOURAUD_INCLUDED #define AGG_SPAN_GOURAUD_INCLUDED #include "agg_basics.h" #include "agg_math.h" namespace agg { //============================================================span_gouraud template<class ColorT> class span_gouraud { public: typedef ColorT color_type; struct coord_type { double x; double y; color_type color; }; //-------------------------------------------------------------------- span_gouraud() : m_vertex(0) { m_cmd[0] = path_cmd_stop; } //-------------------------------------------------------------------- span_gouraud(const color_type& c1, const color_type& c2, const color_type& c3, double x1, double y1, double x2, double y2, double x3, double y3, double d) : m_vertex(0) { colors(c1, c2, c3); triangle(x1, y1, x2, y2, x3, y3, d); } //-------------------------------------------------------------------- void colors(ColorT c1, ColorT c2, ColorT c3) { m_coord[0].color = c1; m_coord[1].color = c2; m_coord[2].color = c3; } //-------------------------------------------------------------------- // 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. // However, the coordinates to interpolate colors are calculated // as miter joins (calc_intersection). 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].y = m_y[0] = y1; 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].y = m_y[2] = y3; m_cmd[0] = path_cmd_move_to; m_cmd[1] = path_cmd_line_to; m_cmd[2] = path_cmd_line_to; 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, m_x, m_y, d); calc_intersection(m_x[4], m_y[4], m_x[5], m_y[5], m_x[0], m_y[0], m_x[1], m_y[1], &m_coord[0].x, &m_coord[0].y); calc_intersection(m_x[0], m_y[0], m_x[1], m_y[1], m_x[2], m_y[2], m_x[3], m_y[3], &m_coord[1].x, &m_coord[1].y); calc_intersection(m_x[2], m_y[2], m_x[3], m_y[3], m_x[4], m_y[4], m_x[5], m_y[5], &m_coord[2].x, &m_coord[2].y); m_cmd[3] = path_cmd_line_to; m_cmd[4] = path_cmd_line_to; m_cmd[5] = path_cmd_line_to; m_cmd[6] = path_cmd_stop; } } //-------------------------------------------------------------------- // Vertex Source Interface to feed the coordinates to the rasterizer void rewind(unsigned) { m_vertex = 0; } //-------------------------------------------------------------------- unsigned vertex(double* x, double* y) { *x = m_x[m_vertex]; *y = m_y[m_vertex]; return m_cmd[m_vertex++]; } protected: //-------------------------------------------------------------------- void arrange_vertices(coord_type* coord) const { coord[0] = m_coord[0]; coord[1] = m_coord[1]; coord[2] = m_coord[2]; if(m_coord[0].y > m_coord[2].y) { coord[0] = m_coord[2]; coord[2] = m_coord[0]; } coord_type tmp; if(coord[0].y > coord[1].y) { tmp = coord[1]; coord[1] = coord[0]; coord[0] = tmp; } if(coord[1].y > coord[2].y) { tmp = coord[2]; coord[2] = coord[1]; coord[1] = tmp; } } private: //-------------------------------------------------------------------- coord_type m_coord[3]; double m_x[8]; double m_y[8]; unsigned m_cmd[8]; unsigned m_vertex; }; } #endif ���������������������������������������������������������agg-2.5+dfsg1/include/agg_span_gouraud_gray.h�������������������������������������������������������0000644�0000000�0000000�00000020674�10703246330�021412� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- // // 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 #define AGG_SPAN_GOURAUD_GRAY_INCLUDED #include "agg_basics.h" #include "agg_color_gray.h" #include "agg_dda_line.h" #include "agg_span_gouraud.h" namespace agg { //=======================================================span_gouraud_gray template<class ColorT> class span_gouraud_gray : public span_gouraud<ColorT> { public: typedef ColorT color_type; typedef typename color_type::value_type value_type; typedef span_gouraud<color_type> base_type; typedef typename base_type::coord_type coord_type; enum subpixel_scale_e { subpixel_shift = 4, subpixel_scale = 1 << subpixel_shift }; private: //-------------------------------------------------------------------- struct gray_calc { void init(const coord_type& c1, const coord_type& c2) { m_x1 = c1.x - 0.5; m_y1 = c1.y - 0.5; m_dx = c2.x - c1.x; double dy = c2.y - c1.y; m_1dy = (fabs(dy) < 1e-10) ? 1e10 : 1.0 / dy; m_v1 = c1.color.v; m_a1 = c1.color.a; m_dv = c2.color.v - m_v1; m_da = c2.color.a - m_a1; } void calc(double y) { double k = (y - m_y1) * m_1dy; if(k < 0.0) k = 0.0; if(k > 1.0) k = 1.0; m_v = m_v1 + iround(m_dv * k); m_a = m_a1 + iround(m_da * k); m_x = iround((m_x1 + m_dx * k) * subpixel_scale); } double m_x1; double m_y1; double m_dx; double m_1dy; int m_v1; int m_a1; int m_dv; int m_da; int m_v; int m_a; int m_x; }; public: //-------------------------------------------------------------------- span_gouraud_gray() {} span_gouraud_gray(const color_type& c1, const color_type& c2, const color_type& c3, double x1, double y1, double x2, double y2, double x3, double y3, double d = 0) : base_type(c1, c2, c3, x1, y1, x2, y2, x3, y3, d) {} //-------------------------------------------------------------------- void prepare() { coord_type coord[3]; base_type::arrange_vertices(coord); m_y2 = int(coord[1].y); m_swap = cross_product(coord[0].x, coord[0].y, coord[2].x, coord[2].y, coord[1].x, coord[1].y) < 0.0; m_c1.init(coord[0], coord[2]); m_c2.init(coord[0], coord[1]); m_c3.init(coord[1], coord[2]); } //-------------------------------------------------------------------- void generate(color_type* span, int x, int y, unsigned len) { m_c1.calc(y); const gray_calc* pc1 = &m_c1; const gray_calc* pc2 = &m_c2; if(y < m_y2) { // Bottom part of the triangle (first subtriangle) //------------------------- m_c2.calc(y + m_c2.m_1dy); } else { // Upper part (second subtriangle) //------------------------- m_c3.calc(y - m_c3.m_1dy); pc2 = &m_c3; } if(m_swap) { // It means that the triangle is oriented clockwise, // so that we need to swap the controlling structures //------------------------- const gray_calc* t = pc2; pc2 = pc1; pc1 = t; } // Get the horizontal length with subpixel accuracy // and protect it from division by zero //------------------------- int nlen = abs(pc2->m_x - pc1->m_x); if(nlen <= 0) nlen = 1; dda_line_interpolator<14> v(pc1->m_v, pc2->m_v, nlen); dda_line_interpolator<14> a(pc1->m_a, pc2->m_a, nlen); // Calculate the starting point of the gradient with subpixel // accuracy and correct (roll back) the interpolators. // This operation will also clip the beginning of the span // if necessary. //------------------------- int start = pc1->m_x - (x << subpixel_shift); v -= start; a -= start; nlen += start; int vv, va; enum lim_e { lim = color_type::base_mask }; // Beginning part of the span. Since we rolled back the // interpolators, the color values may have overflow. // So that, we render the beginning part with checking // for overflow. It lasts until "start" is positive; // typically it's 1-2 pixels, but may be more in some cases. //------------------------- while(len && start > 0) { vv = v.y(); va = a.y(); if(vv < 0) vv = 0; if(vv > lim) vv = lim; if(va < 0) va = 0; if(va > lim) va = lim; span->v = (value_type)vv; span->a = (value_type)va; v += subpixel_scale; a += subpixel_scale; nlen -= subpixel_scale; start -= subpixel_scale; ++span; --len; } // Middle part, no checking for overflow. // Actual spans can be longer than the calculated length // because of anti-aliasing, thus, the interpolators can // overflow. But while "nlen" is positive we are safe. //------------------------- while(len && nlen > 0) { span->v = (value_type)v.y(); span->a = (value_type)a.y(); v += subpixel_scale; a += subpixel_scale; nlen -= subpixel_scale; ++span; --len; } // Ending part; checking for overflow. // Typically it's 1-2 pixels, but may be more in some cases. //------------------------- while(len) { vv = v.y(); va = a.y(); if(vv < 0) vv = 0; if(vv > lim) vv = lim; if(va < 0) va = 0; if(va > lim) va = lim; span->v = (value_type)vv; span->a = (value_type)va; v += subpixel_scale; a += subpixel_scale; ++span; --len; } } private: bool m_swap; int m_y2; gray_calc m_c1; gray_calc m_c2; gray_calc m_c3; }; } #endif ��������������������������������������������������������������������agg-2.5+dfsg1/include/agg_span_gouraud_rgba.h�������������������������������������������������������0000644�0000000�0000000�00000023666�10703246330�021367� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- // // 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 #define AGG_SPAN_GOURAUD_RGBA_INCLUDED #include "agg_basics.h" #include "agg_color_rgba.h" #include "agg_dda_line.h" #include "agg_span_gouraud.h" namespace agg { //=======================================================span_gouraud_rgba template<class ColorT> class span_gouraud_rgba : public span_gouraud<ColorT> { public: typedef ColorT color_type; typedef typename ColorT::value_type value_type; typedef span_gouraud<color_type> base_type; typedef typename base_type::coord_type coord_type; enum subpixel_scale_e { subpixel_shift = 4, subpixel_scale = 1 << subpixel_shift }; private: //-------------------------------------------------------------------- struct rgba_calc { void init(const coord_type& c1, const coord_type& c2) { m_x1 = c1.x - 0.5; m_y1 = c1.y - 0.5; m_dx = c2.x - c1.x; double dy = c2.y - c1.y; m_1dy = (dy < 1e-5) ? 1e5 : 1.0 / dy; m_r1 = c1.color.r; m_g1 = c1.color.g; m_b1 = c1.color.b; m_a1 = c1.color.a; m_dr = c2.color.r - m_r1; m_dg = c2.color.g - m_g1; m_db = c2.color.b - m_b1; m_da = c2.color.a - m_a1; } void calc(double y) { double k = (y - m_y1) * m_1dy; if(k < 0.0) k = 0.0; if(k > 1.0) k = 1.0; m_r = m_r1 + iround(m_dr * k); m_g = m_g1 + iround(m_dg * k); m_b = m_b1 + iround(m_db * k); m_a = m_a1 + iround(m_da * k); m_x = iround((m_x1 + m_dx * k) * subpixel_scale); } double m_x1; double m_y1; double m_dx; double m_1dy; int m_r1; int m_g1; int m_b1; int m_a1; int m_dr; int m_dg; int m_db; int m_da; int m_r; int m_g; int m_b; int m_a; int m_x; }; public: //-------------------------------------------------------------------- span_gouraud_rgba() {} span_gouraud_rgba(const color_type& c1, const color_type& c2, const color_type& c3, double x1, double y1, double x2, double y2, double x3, double y3, double d = 0) : base_type(c1, c2, c3, x1, y1, x2, y2, x3, y3, d) {} //-------------------------------------------------------------------- void prepare() { coord_type coord[3]; base_type::arrange_vertices(coord); m_y2 = int(coord[1].y); m_swap = cross_product(coord[0].x, coord[0].y, coord[2].x, coord[2].y, coord[1].x, coord[1].y) < 0.0; m_rgba1.init(coord[0], coord[2]); m_rgba2.init(coord[0], coord[1]); m_rgba3.init(coord[1], coord[2]); } //-------------------------------------------------------------------- void generate(color_type* span, int x, int y, unsigned len) { m_rgba1.calc(y);//(m_rgba1.m_1dy > 2) ? m_rgba1.m_y1 : y); const rgba_calc* pc1 = &m_rgba1; const rgba_calc* pc2 = &m_rgba2; if(y <= m_y2) { // Bottom part of the triangle (first subtriangle) //------------------------- m_rgba2.calc(y + m_rgba2.m_1dy); } else { // Upper part (second subtriangle) m_rgba3.calc(y - m_rgba3.m_1dy); //------------------------- pc2 = &m_rgba3; } if(m_swap) { // It means that the triangle is oriented clockwise, // so that we need to swap the controlling structures //------------------------- const rgba_calc* t = pc2; pc2 = pc1; pc1 = t; } // Get the horizontal length with subpixel accuracy // and protect it from division by zero //------------------------- int nlen = abs(pc2->m_x - pc1->m_x); if(nlen <= 0) nlen = 1; dda_line_interpolator<14> r(pc1->m_r, pc2->m_r, nlen); dda_line_interpolator<14> g(pc1->m_g, pc2->m_g, nlen); dda_line_interpolator<14> b(pc1->m_b, pc2->m_b, nlen); dda_line_interpolator<14> a(pc1->m_a, pc2->m_a, nlen); // Calculate the starting point of the gradient with subpixel // accuracy and correct (roll back) the interpolators. // This operation will also clip the beginning of the span // if necessary. //------------------------- int start = pc1->m_x - (x << subpixel_shift); r -= start; g -= start; b -= start; a -= start; nlen += start; int vr, vg, vb, va; enum lim_e { lim = color_type::base_mask }; // Beginning part of the span. Since we rolled back the // interpolators, the color values may have overflow. // So that, we render the beginning part with checking // for overflow. It lasts until "start" is positive; // typically it's 1-2 pixels, but may be more in some cases. //------------------------- while(len && start > 0) { vr = r.y(); vg = g.y(); vb = b.y(); va = a.y(); if(vr < 0) vr = 0; if(vr > lim) vr = lim; if(vg < 0) vg = 0; if(vg > lim) vg = lim; if(vb < 0) vb = 0; if(vb > lim) vb = lim; if(va < 0) va = 0; if(va > lim) va = lim; span->r = (value_type)vr; span->g = (value_type)vg; span->b = (value_type)vb; span->a = (value_type)va; r += subpixel_scale; g += subpixel_scale; b += subpixel_scale; a += subpixel_scale; nlen -= subpixel_scale; start -= subpixel_scale; ++span; --len; } // Middle part, no checking for overflow. // Actual spans can be longer than the calculated length // because of anti-aliasing, thus, the interpolators can // overflow. But while "nlen" is positive we are safe. //------------------------- while(len && nlen > 0) { span->r = (value_type)r.y(); span->g = (value_type)g.y(); span->b = (value_type)b.y(); span->a = (value_type)a.y(); r += subpixel_scale; g += subpixel_scale; b += subpixel_scale; a += subpixel_scale; nlen -= subpixel_scale; ++span; --len; } // Ending part; checking for overflow. // Typically it's 1-2 pixels, but may be more in some cases. //------------------------- while(len) { vr = r.y(); vg = g.y(); vb = b.y(); va = a.y(); if(vr < 0) vr = 0; if(vr > lim) vr = lim; if(vg < 0) vg = 0; if(vg > lim) vg = lim; if(vb < 0) vb = 0; if(vb > lim) vb = lim; if(va < 0) va = 0; if(va > lim) va = lim; span->r = (value_type)vr; span->g = (value_type)vg; span->b = (value_type)vb; span->a = (value_type)va; r += subpixel_scale; g += subpixel_scale; b += subpixel_scale; a += subpixel_scale; ++span; --len; } } private: bool m_swap; int m_y2; rgba_calc m_rgba1; rgba_calc m_rgba2; rgba_calc m_rgba3; }; } #endif ��������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_span_gradient.h�����������������������������������������������������������0000644�0000000�0000000�00000030001�10703246330�020500� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_SPAN_GRADIENT_INCLUDED #define AGG_SPAN_GRADIENT_INCLUDED #include <math.h> #include <stdlib.h> #include <string.h> #include "agg_basics.h" #include "agg_math.h" #include "agg_array.h" namespace agg { enum gradient_subpixel_scale_e { gradient_subpixel_shift = 4, //-----gradient_subpixel_shift gradient_subpixel_scale = 1 << gradient_subpixel_shift, //-----gradient_subpixel_scale gradient_subpixel_mask = gradient_subpixel_scale - 1 //-----gradient_subpixel_mask }; //==========================================================span_gradient template<class ColorT, class Interpolator, class GradientF, class ColorF> class span_gradient { public: typedef Interpolator interpolator_type; typedef ColorT color_type; enum downscale_shift_e { downscale_shift = interpolator_type::subpixel_shift - gradient_subpixel_shift }; //-------------------------------------------------------------------- span_gradient() {} //-------------------------------------------------------------------- span_gradient(interpolator_type& inter, const GradientF& gradient_function, const ColorF& color_function, double d1, double d2) : m_interpolator(&inter), m_gradient_function(&gradient_function), m_color_function(&color_function), m_d1(iround(d1 * gradient_subpixel_scale)), m_d2(iround(d2 * gradient_subpixel_scale)) {} //-------------------------------------------------------------------- interpolator_type& interpolator() { return *m_interpolator; } const GradientF& gradient_function() const { return *m_gradient_function; } const ColorF& color_function() const { return *m_color_function; } double d1() const { return double(m_d1) / gradient_subpixel_scale; } double d2() const { return double(m_d2) / gradient_subpixel_scale; } //-------------------------------------------------------------------- void interpolator(interpolator_type& i) { m_interpolator = &i; } void gradient_function(const GradientF& gf) { m_gradient_function = &gf; } void color_function(const ColorF& cf) { m_color_function = &cf; } void d1(double v) { m_d1 = iround(v * gradient_subpixel_scale); } void d2(double v) { m_d2 = iround(v * gradient_subpixel_scale); } //-------------------------------------------------------------------- void prepare() {} //-------------------------------------------------------------------- void generate(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, y >> downscale_shift, m_d2); d = ((d - m_d1) * (int)m_color_function->size()) / dd; if(d < 0) d = 0; if(d >= (int)m_color_function->size()) d = m_color_function->size() - 1; *span++ = (*m_color_function)[d]; ++(*m_interpolator); } while(--len); } private: interpolator_type* m_interpolator; const GradientF* m_gradient_function; const ColorF* m_color_function; int m_d1; int m_d2; }; //=====================================================gradient_linear_color 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, unsigned size = 256) : m_c1(c1), m_c2(c2), m_size(size) {} unsigned size() const { return m_size; } color_type operator [] (unsigned v) const { return m_c1.gradient(m_c2, double(v) / double(m_size - 1)); } void colors(const color_type& c1, const color_type& c2, unsigned size = 256) { m_c1 = c1; m_c2 = c2; m_size = size; } color_type m_c1; color_type m_c2; unsigned m_size; }; //==========================================================gradient_circle class gradient_circle { // Actually the same as radial. Just for compatibility public: static AGG_INLINE int calculate(int x, int y, int) { return int(fast_sqrt(x*x + y*y)); } }; //==========================================================gradient_radial class gradient_radial { public: static AGG_INLINE int calculate(int x, int y, int) { return int(fast_sqrt(x*x + y*y)); } }; //========================================================gradient_radial_d class gradient_radial_d { public: static AGG_INLINE int calculate(int x, int y, int) { return uround(sqrt(double(x)*double(x) + double(y)*double(y))); } }; //====================================================gradient_radial_focus class gradient_radial_focus { public: //--------------------------------------------------------------------- gradient_radial_focus() : m_r(100 * gradient_subpixel_scale), m_fx(0), m_fy(0) { update_values(); } //--------------------------------------------------------------------- gradient_radial_focus(double r, double fx, double fy) : m_r (iround(r * gradient_subpixel_scale)), m_fx(iround(fx * gradient_subpixel_scale)), m_fy(iround(fy * gradient_subpixel_scale)) { update_values(); } //--------------------------------------------------------------------- void init(double r, double fx, double fy) { m_r = iround(r * gradient_subpixel_scale); m_fx = iround(fx * gradient_subpixel_scale); m_fy = iround(fy * gradient_subpixel_scale); update_values(); } //--------------------------------------------------------------------- double radius() const { return double(m_r) / gradient_subpixel_scale; } double focus_x() const { return double(m_fx) / gradient_subpixel_scale; } double focus_y() const { return double(m_fy) / gradient_subpixel_scale; } //--------------------------------------------------------------------- int calculate(int x, int y, int) const { double dx = x - m_fx; double dy = y - m_fy; double d2 = dx * m_fy - dy * m_fx; double d3 = m_r2 * (dx * dx + dy * dy) - d2 * d2; return iround((dx * m_fx + dy * m_fy + sqrt(fabs(d3))) * m_mul); } private: //--------------------------------------------------------------------- void update_values() { // Calculate the invariant values. In case the focal center // lies exactly on the gradient circle the divisor degenerates // into zero. In this case we just move the focal center by // one subpixel unit possibly in the direction to the origin (0,0) // and calculate the values again. //------------------------- m_r2 = double(m_r) * double(m_r); m_fx2 = double(m_fx) * double(m_fx); m_fy2 = double(m_fy) * double(m_fy); double d = (m_r2 - (m_fx2 + m_fy2)); if(d == 0) { if(m_fx) { if(m_fx < 0) ++m_fx; else --m_fx; } if(m_fy) { if(m_fy < 0) ++m_fy; else --m_fy; } m_fx2 = double(m_fx) * double(m_fx); m_fy2 = double(m_fy) * double(m_fy); d = (m_r2 - (m_fx2 + m_fy2)); } m_mul = m_r / d; } int m_r; int m_fx; int m_fy; double m_r2; double m_fx2; double m_fy2; double m_mul; }; //==============================================================gradient_x class gradient_x { public: static int calculate(int x, int, int) { return x; } }; //==============================================================gradient_y class gradient_y { public: static int calculate(int, int y, int) { return y; } }; //========================================================gradient_diamond class gradient_diamond { public: static AGG_INLINE int calculate(int x, int y, int) { int ax = abs(x); int ay = abs(y); return ax > ay ? ax : ay; } }; //=============================================================gradient_xy class gradient_xy { public: static AGG_INLINE int calculate(int x, int y, int d) { return abs(x) * abs(y) / d; } }; //========================================================gradient_sqrt_xy class gradient_sqrt_xy { public: static AGG_INLINE int calculate(int x, int y, int) { return fast_sqrt(abs(x) * abs(y)); } }; //==========================================================gradient_conic class gradient_conic { public: static AGG_INLINE int calculate(int x, int y, int d) { return uround(fabs(atan2(double(y), double(x))) * double(d) / pi); } }; //=================================================gradient_repeat_adaptor template<class GradientF> class gradient_repeat_adaptor { public: gradient_repeat_adaptor(const GradientF& gradient) : m_gradient(&gradient) {} AGG_INLINE int calculate(int x, int y, int d) const { int ret = m_gradient->calculate(x, y, d) % d; if(ret < 0) ret += d; return ret; } private: const GradientF* m_gradient; }; //================================================gradient_reflect_adaptor template<class GradientF> class gradient_reflect_adaptor { public: gradient_reflect_adaptor(const GradientF& gradient) : m_gradient(&gradient) {} AGG_INLINE int calculate(int x, int y, int d) const { int d2 = d << 1; int ret = m_gradient->calculate(x, y, d) % d2; if(ret < 0) ret += d2; if(ret >= d) ret = d2 - ret; return ret; } private: const GradientF* m_gradient; }; } #endif �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_span_gradient_alpha.h�����������������������������������������������������0000644�0000000�0000000�00000012262�10703246330�021656� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_SPAN_GRADIENT_ALPHA_INCLUDED #define AGG_SPAN_GRADIENT_ALPHA_INCLUDED #include "agg_span_gradient.h" namespace agg { //======================================================span_gradient_alpha template<class ColorT, class Interpolator, class GradientF, class AlphaF> class span_gradient_alpha { public: typedef Interpolator interpolator_type; typedef ColorT color_type; typedef typename color_type::value_type alpha_type; enum downscale_shift_e { downscale_shift = interpolator_type::subpixel_shift - gradient_subpixel_shift }; //-------------------------------------------------------------------- span_gradient_alpha() {} //-------------------------------------------------------------------- span_gradient_alpha(interpolator_type& inter, const GradientF& gradient_function, const AlphaF& alpha_function, double d1, double d2) : m_interpolator(&inter), m_gradient_function(&gradient_function), m_alpha_function(&alpha_function), m_d1(iround(d1 * gradient_subpixel_scale)), m_d2(iround(d2 * gradient_subpixel_scale)) {} //-------------------------------------------------------------------- interpolator_type& interpolator() { return *m_interpolator; } const GradientF& gradient_function() const { return *m_gradient_function; } const AlphaF& alpha_function() const { return *m_alpha_function; } double d1() const { return double(m_d1) / gradient_subpixel_scale; } double d2() const { return double(m_d2) / gradient_subpixel_scale; } //-------------------------------------------------------------------- void interpolator(interpolator_type& i) { m_interpolator = &i; } void gradient_function(const GradientF& gf) { m_gradient_function = &gf; } void alpha_function(const AlphaF& af) { m_alpha_function = ⁡ } void d1(double v) { m_d1 = iround(v * gradient_subpixel_scale); } void d2(double v) { m_d2 = iround(v * gradient_subpixel_scale); } //-------------------------------------------------------------------- void prepare() {} //-------------------------------------------------------------------- void generate(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, y >> downscale_shift, m_d2); d = ((d - m_d1) * (int)m_alpha_function->size()) / dd; if(d < 0) d = 0; if(d >= (int)m_alpha_function->size()) d = m_alpha_function->size() - 1; span->a = (*m_alpha_function)[d]; ++span; ++(*m_interpolator); } while(--len); } private: interpolator_type* m_interpolator; const GradientF* m_gradient_function; const AlphaF* m_alpha_function; int m_d1; int m_d2; }; //=======================================================gradient_alpha_x template<class ColorT> struct gradient_alpha_x { typedef typename ColorT::value_type alpha_type; alpha_type operator [] (alpha_type x) const { return x; } }; //====================================================gradient_alpha_x_u8 struct gradient_alpha_x_u8 { typedef int8u alpha_type; alpha_type operator [] (alpha_type x) const { return x; } }; //==========================================gradient_alpha_one_munus_x_u8 struct gradient_alpha_one_munus_x_u8 { typedef int8u alpha_type; alpha_type operator [] (alpha_type x) const { return 255-x; } }; } #endif ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_span_image_filter.h�������������������������������������������������������0000644�0000000�0000000�00000022342�10703246330�021343� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_SPAN_IMAGE_FILTER_INCLUDED #define AGG_SPAN_IMAGE_FILTER_INCLUDED #include "agg_basics.h" #include "agg_image_filters.h" #include "agg_span_interpolator_linear.h" namespace agg { //-------------------------------------------------------span_image_filter template<class Source, class Interpolator> class span_image_filter { public: typedef Source source_type; typedef Interpolator interpolator_type; //-------------------------------------------------------------------- span_image_filter() {} span_image_filter(source_type& src, interpolator_type& interpolator, const image_filter_lut* filter) : m_src(&src), m_interpolator(&interpolator), m_filter(filter), m_dx_dbl(0.5), m_dy_dbl(0.5), m_dx_int(image_subpixel_scale / 2), m_dy_int(image_subpixel_scale / 2) {} void attach(source_type& v) { m_src = &v; } //-------------------------------------------------------------------- source_type& source() { return *m_src; } const source_type& source() const { return *m_src; } const image_filter_lut& filter() const { return *m_filter; } int filter_dx_int() const { return m_dx_int; } int filter_dy_int() const { return m_dy_int; } double filter_dx_dbl() const { return m_dx_dbl; } double filter_dy_dbl() const { return m_dy_dbl; } //-------------------------------------------------------------------- void interpolator(interpolator_type& v) { m_interpolator = &v; } void filter(const image_filter_lut& v) { m_filter = &v; } void filter_offset(double dx, double dy) { m_dx_dbl = dx; m_dy_dbl = dy; m_dx_int = iround(dx * image_subpixel_scale); m_dy_int = iround(dy * image_subpixel_scale); } void filter_offset(double d) { filter_offset(d, d); } //-------------------------------------------------------------------- interpolator_type& interpolator() { return *m_interpolator; } //-------------------------------------------------------------------- void prepare() {} //-------------------------------------------------------------------- private: source_type* m_src; interpolator_type* m_interpolator; const image_filter_lut* m_filter; double m_dx_dbl; double m_dy_dbl; unsigned m_dx_int; unsigned m_dy_int; }; //==============================================span_image_resample_affine template<class Source> class span_image_resample_affine : public span_image_filter<Source, span_interpolator_linear<trans_affine> > { public: typedef Source source_type; typedef span_interpolator_linear<trans_affine> interpolator_type; typedef span_image_filter<source_type, interpolator_type> base_type; //-------------------------------------------------------------------- span_image_resample_affine() : m_scale_limit(200.0), m_blur_x(1.0), m_blur_y(1.0) {} //-------------------------------------------------------------------- span_image_resample_affine(source_type& src, interpolator_type& inter, const image_filter_lut& filter) : base_type(src, inter, &filter), m_scale_limit(200.0), m_blur_x(1.0), m_blur_y(1.0) {} //-------------------------------------------------------------------- int scale_limit() const { return uround(m_scale_limit); } void scale_limit(int v) { m_scale_limit = v; } //-------------------------------------------------------------------- double blur_x() const { return m_blur_x; } double blur_y() const { return m_blur_y; } void blur_x(double v) { m_blur_x = v; } void blur_y(double v) { m_blur_y = v; } void blur(double v) { m_blur_x = m_blur_y = v; } //-------------------------------------------------------------------- void prepare() { double scale_x; double scale_y; base_type::interpolator().transformer().scaling_abs(&scale_x, &scale_y); if(scale_x * scale_y > m_scale_limit) { scale_x = scale_x * m_scale_limit / (scale_x * scale_y); scale_y = scale_y * m_scale_limit / (scale_x * scale_y); } if(scale_x < 1) scale_x = 1; if(scale_y < 1) scale_y = 1; if(scale_x > m_scale_limit) scale_x = m_scale_limit; if(scale_y > m_scale_limit) scale_y = m_scale_limit; scale_x *= m_blur_x; scale_y *= m_blur_y; if(scale_x < 1) scale_x = 1; if(scale_y < 1) scale_y = 1; m_rx = uround( scale_x * double(image_subpixel_scale)); m_rx_inv = uround(1.0/scale_x * double(image_subpixel_scale)); m_ry = uround( scale_y * double(image_subpixel_scale)); m_ry_inv = uround(1.0/scale_y * double(image_subpixel_scale)); } protected: int m_rx; int m_ry; int m_rx_inv; int m_ry_inv; private: double m_scale_limit; double m_blur_x; double m_blur_y; }; //=====================================================span_image_resample template<class Source, class Interpolator> class span_image_resample : public span_image_filter<Source, Interpolator> { public: typedef Source source_type; typedef Interpolator interpolator_type; typedef span_image_filter<source_type, interpolator_type> base_type; //-------------------------------------------------------------------- span_image_resample() : m_scale_limit(20), m_blur_x(image_subpixel_scale), m_blur_y(image_subpixel_scale) {} //-------------------------------------------------------------------- span_image_resample(source_type& src, interpolator_type& inter, const image_filter_lut& filter) : base_type(src, inter, &filter), m_scale_limit(20), m_blur_x(image_subpixel_scale), m_blur_y(image_subpixel_scale) {} //-------------------------------------------------------------------- int scale_limit() const { return m_scale_limit; } void scale_limit(int v) { m_scale_limit = v; } //-------------------------------------------------------------------- double blur_x() const { return double(m_blur_x) / double(image_subpixel_scale); } double blur_y() const { return double(m_blur_y) / double(image_subpixel_scale); } void blur_x(double v) { m_blur_x = uround(v * double(image_subpixel_scale)); } void blur_y(double v) { m_blur_y = uround(v * double(image_subpixel_scale)); } void blur(double v) { m_blur_x = m_blur_y = uround(v * double(image_subpixel_scale)); } protected: AGG_INLINE void adjust_scale(int* rx, int* ry) { if(*rx < image_subpixel_scale) *rx = image_subpixel_scale; if(*ry < image_subpixel_scale) *ry = image_subpixel_scale; if(*rx > image_subpixel_scale * m_scale_limit) { *rx = image_subpixel_scale * m_scale_limit; } if(*ry > image_subpixel_scale * m_scale_limit) { *ry = image_subpixel_scale * m_scale_limit; } *rx = (*rx * m_blur_x) >> image_subpixel_shift; *ry = (*ry * m_blur_y) >> image_subpixel_shift; if(*rx < image_subpixel_scale) *rx = image_subpixel_scale; if(*ry < image_subpixel_scale) *ry = image_subpixel_scale; } int m_scale_limit; int m_blur_x; int m_blur_y; }; } #endif ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_span_image_filter_gray.h��������������������������������������������������0000644�0000000�0000000�00000071233�10703246330�022370� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- // // 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 #define AGG_SPAN_IMAGE_FILTER_GRAY_INCLUDED #include "agg_basics.h" #include "agg_color_gray.h" #include "agg_span_image_filter.h" namespace agg { //==============================================span_image_filter_gray_nn template<class Source, class Interpolator> class span_image_filter_gray_nn : public span_image_filter<Source, Interpolator> { public: typedef Source source_type; typedef typename source_type::color_type color_type; typedef Interpolator interpolator_type; typedef span_image_filter<source_type, interpolator_type> base_type; typedef typename color_type::value_type value_type; typedef typename color_type::calc_type calc_type; enum base_scale_e { base_shift = color_type::base_shift, base_mask = color_type::base_mask }; //-------------------------------------------------------------------- span_image_filter_gray_nn() {} span_image_filter_gray_nn(source_type& src, interpolator_type& inter) : base_type(src, inter, 0) {} //-------------------------------------------------------------------- void generate(color_type* span, int x, int y, unsigned len) { base_type::interpolator().begin(x + base_type::filter_dx_dbl(), y + base_type::filter_dy_dbl(), len); do { base_type::interpolator().coordinates(&x, &y); span->v = *(const value_type*) base_type::source().span(x >> image_subpixel_shift, y >> image_subpixel_shift, 1); span->a = base_mask; ++span; ++base_type::interpolator(); } while(--len); } }; //=========================================span_image_filter_gray_bilinear template<class Source, class Interpolator> class span_image_filter_gray_bilinear : public span_image_filter<Source, Interpolator> { public: typedef Source source_type; typedef typename source_type::color_type color_type; typedef Interpolator interpolator_type; typedef span_image_filter<source_type, interpolator_type> base_type; typedef typename color_type::value_type value_type; typedef typename color_type::calc_type calc_type; enum base_scale_e { base_shift = color_type::base_shift, base_mask = color_type::base_mask }; //-------------------------------------------------------------------- span_image_filter_gray_bilinear() {} span_image_filter_gray_bilinear(source_type& src, interpolator_type& inter) : base_type(src, inter, 0) {} //-------------------------------------------------------------------- void generate(color_type* span, int x, int y, unsigned len) { base_type::interpolator().begin(x + base_type::filter_dx_dbl(), y + base_type::filter_dy_dbl(), len); calc_type fg; const value_type *fg_ptr; do { int x_hr; int y_hr; base_type::interpolator().coordinates(&x_hr, &y_hr); x_hr -= base_type::filter_dx_int(); y_hr -= base_type::filter_dy_int(); int x_lr = x_hr >> image_subpixel_shift; int y_lr = y_hr >> image_subpixel_shift; fg = image_subpixel_scale * image_subpixel_scale / 2; x_hr &= image_subpixel_mask; y_hr &= image_subpixel_mask; fg_ptr = (const value_type*)base_type::source().span(x_lr, y_lr, 2); fg += *fg_ptr * (image_subpixel_scale - x_hr) * (image_subpixel_scale - y_hr); fg_ptr = (const value_type*)base_type::source().next_x(); fg += *fg_ptr * x_hr * (image_subpixel_scale - y_hr); fg_ptr = (const value_type*)base_type::source().next_y(); fg += *fg_ptr * (image_subpixel_scale - x_hr) * y_hr; fg_ptr = (const value_type*)base_type::source().next_x(); fg += *fg_ptr * x_hr * y_hr; span->v = value_type(fg >> (image_subpixel_shift * 2)); span->a = base_mask; ++span; ++base_type::interpolator(); } while(--len); } }; //====================================span_image_filter_gray_bilinear_clip template<class Source, class Interpolator> class span_image_filter_gray_bilinear_clip : public span_image_filter<Source, Interpolator> { public: typedef Source source_type; typedef typename source_type::color_type color_type; typedef Interpolator interpolator_type; typedef span_image_filter<source_type, interpolator_type> base_type; typedef typename color_type::value_type value_type; typedef typename color_type::calc_type calc_type; enum base_scale_e { base_shift = color_type::base_shift, base_mask = color_type::base_mask }; //-------------------------------------------------------------------- span_image_filter_gray_bilinear_clip() {} span_image_filter_gray_bilinear_clip(source_type& src, const color_type& back_color, interpolator_type& inter) : base_type(src, inter, 0), m_back_color(back_color) {} const color_type& background_color() const { return m_back_color; } void background_color(const color_type& v) { m_back_color = v; } //-------------------------------------------------------------------- void generate(color_type* span, int x, int y, unsigned len) { base_type::interpolator().begin(x + base_type::filter_dx_dbl(), y + base_type::filter_dy_dbl(), len); calc_type fg; calc_type src_alpha; value_type back_v = m_back_color.v; value_type back_a = m_back_color.a; const value_type *fg_ptr; int maxx = base_type::source().width() - 1; int maxy = base_type::source().height() - 1; do { int x_hr; int y_hr; base_type::interpolator().coordinates(&x_hr, &y_hr); x_hr -= base_type::filter_dx_int(); y_hr -= base_type::filter_dy_int(); int x_lr = x_hr >> image_subpixel_shift; int y_lr = y_hr >> image_subpixel_shift; if(x_lr >= 0 && y_lr >= 0 && x_lr < maxx && y_lr < maxy) { fg = image_subpixel_scale * image_subpixel_scale / 2; x_hr &= image_subpixel_mask; y_hr &= image_subpixel_mask; fg_ptr = (const value_type*)base_type::source().row_ptr(y_lr) + x_lr; fg += *fg_ptr++ * (image_subpixel_scale - x_hr) * (image_subpixel_scale - y_hr); fg += *fg_ptr++ * (image_subpixel_scale - y_hr) * x_hr; ++y_lr; fg_ptr = (const value_type*)base_type::source().row_ptr(y_lr) + x_lr; fg += *fg_ptr++ * (image_subpixel_scale - x_hr) * y_hr; fg += *fg_ptr++ * x_hr * y_hr; fg >>= image_subpixel_shift * 2; src_alpha = base_mask; } else { unsigned weight; if(x_lr < -1 || y_lr < -1 || x_lr > maxx || y_lr > maxy) { fg = back_v; src_alpha = back_a; } else { fg = src_alpha = image_subpixel_scale * image_subpixel_scale / 2; x_hr &= image_subpixel_mask; y_hr &= image_subpixel_mask; weight = (image_subpixel_scale - x_hr) * (image_subpixel_scale - y_hr); if(x_lr >= 0 && y_lr >= 0 && x_lr <= maxx && y_lr <= maxy) { fg += weight * *((const value_type*)base_type::source().row_ptr(y_lr) + x_lr); src_alpha += weight * base_mask; } else { fg += back_v * weight; src_alpha += back_a * weight; } x_lr++; weight = x_hr * (image_subpixel_scale - y_hr); if(x_lr >= 0 && y_lr >= 0 && x_lr <= maxx && y_lr <= maxy) { fg += weight * *((const value_type*)base_type::source().row_ptr(y_lr) + x_lr); src_alpha += weight * base_mask; } else { fg += back_v * weight; src_alpha += back_a * weight; } x_lr--; y_lr++; weight = (image_subpixel_scale - x_hr) * y_hr; if(x_lr >= 0 && y_lr >= 0 && x_lr <= maxx && y_lr <= maxy) { fg += weight * *((const value_type*)base_type::source().row_ptr(y_lr) + x_lr); src_alpha += weight * base_mask; } else { fg += back_v * weight; src_alpha += back_a * weight; } x_lr++; weight = x_hr * y_hr; if(x_lr >= 0 && y_lr >= 0 && x_lr <= maxx && y_lr <= maxy) { fg += weight * *((const value_type*)base_type::source().row_ptr(y_lr) + x_lr); src_alpha += weight * base_mask; } else { fg += back_v * weight; src_alpha += back_a * weight; } fg >>= image_subpixel_shift * 2; src_alpha >>= image_subpixel_shift * 2; } } span->v = (value_type)fg; span->a = (value_type)src_alpha; ++span; ++base_type::interpolator(); } while(--len); } private: color_type m_back_color; }; //==============================================span_image_filter_gray_2x2 template<class Source, class Interpolator> class span_image_filter_gray_2x2 : public span_image_filter<Source, Interpolator> { public: typedef Source source_type; typedef typename source_type::color_type color_type; typedef Interpolator interpolator_type; typedef span_image_filter<source_type, interpolator_type> base_type; typedef typename color_type::value_type value_type; typedef typename color_type::calc_type calc_type; enum base_scale_e { base_shift = color_type::base_shift, base_mask = color_type::base_mask }; //-------------------------------------------------------------------- span_image_filter_gray_2x2() {} span_image_filter_gray_2x2(source_type& src, interpolator_type& inter, const image_filter_lut& filter) : base_type(src, inter, &filter) {} //-------------------------------------------------------------------- void generate(color_type* span, int x, int y, unsigned len) { base_type::interpolator().begin(x + base_type::filter_dx_dbl(), y + base_type::filter_dy_dbl(), len); calc_type fg; const value_type *fg_ptr; const int16* weight_array = base_type::filter().weight_array() + ((base_type::filter().diameter()/2 - 1) << image_subpixel_shift); do { int x_hr; int y_hr; base_type::interpolator().coordinates(&x_hr, &y_hr); x_hr -= base_type::filter_dx_int(); y_hr -= base_type::filter_dy_int(); int x_lr = x_hr >> image_subpixel_shift; int y_lr = y_hr >> image_subpixel_shift; unsigned weight; fg = image_filter_scale / 2; x_hr &= image_subpixel_mask; y_hr &= image_subpixel_mask; fg_ptr = (const value_type*)base_type::source().span(x_lr, y_lr, 2); weight = (weight_array[x_hr + image_subpixel_scale] * weight_array[y_hr + image_subpixel_scale] + image_filter_scale / 2) >> image_filter_shift; fg += weight * *fg_ptr; fg_ptr = (const value_type*)base_type::source().next_x(); weight = (weight_array[x_hr] * weight_array[y_hr + image_subpixel_scale] + image_filter_scale / 2) >> image_filter_shift; fg += weight * *fg_ptr; fg_ptr = (const value_type*)base_type::source().next_y(); weight = (weight_array[x_hr + image_subpixel_scale] * weight_array[y_hr] + image_filter_scale / 2) >> image_filter_shift; fg += weight * *fg_ptr; fg_ptr = (const value_type*)base_type::source().next_x(); weight = (weight_array[x_hr] * weight_array[y_hr] + image_filter_scale / 2) >> image_filter_shift; fg += weight * *fg_ptr; fg >>= image_filter_shift; if(fg > base_mask) fg = base_mask; span->v = (value_type)fg; span->a = base_mask; ++span; ++base_type::interpolator(); } while(--len); } }; //==================================================span_image_filter_gray template<class Source, class Interpolator> class span_image_filter_gray : public span_image_filter<Source, Interpolator> { public: typedef Source source_type; typedef typename source_type::color_type color_type; typedef Interpolator interpolator_type; typedef span_image_filter<source_type, interpolator_type> base_type; typedef typename color_type::value_type value_type; typedef typename color_type::calc_type calc_type; enum base_scale_e { base_shift = color_type::base_shift, base_mask = color_type::base_mask }; //-------------------------------------------------------------------- span_image_filter_gray() {} span_image_filter_gray(source_type& src, interpolator_type& inter, const image_filter_lut& filter) : base_type(src, inter, &filter) {} //-------------------------------------------------------------------- void generate(color_type* span, int x, int y, unsigned len) { base_type::interpolator().begin(x + base_type::filter_dx_dbl(), y + base_type::filter_dy_dbl(), len); int fg; const value_type *fg_ptr; unsigned diameter = base_type::filter().diameter(); int start = base_type::filter().start(); const int16* weight_array = base_type::filter().weight_array(); int x_count; int weight_y; do { base_type::interpolator().coordinates(&x, &y); x -= base_type::filter_dx_int(); y -= base_type::filter_dy_int(); int x_hr = x; int y_hr = y; int x_lr = x_hr >> image_subpixel_shift; int y_lr = y_hr >> image_subpixel_shift; fg = image_filter_scale / 2; int x_fract = x_hr & image_subpixel_mask; unsigned y_count = diameter; y_hr = image_subpixel_mask - (y_hr & image_subpixel_mask); fg_ptr = (const value_type*)base_type::source().span(x_lr + start, y_lr + start, diameter); for(;;) { x_count = diameter; weight_y = weight_array[y_hr]; x_hr = image_subpixel_mask - x_fract; for(;;) { fg += *fg_ptr * ((weight_y * weight_array[x_hr] + image_filter_scale / 2) >> image_filter_shift); if(--x_count == 0) break; x_hr += image_subpixel_scale; fg_ptr = (const value_type*)base_type::source().next_x(); } if(--y_count == 0) break; y_hr += image_subpixel_scale; fg_ptr = (const value_type*)base_type::source().next_y(); } fg >>= image_filter_shift; if(fg < 0) fg = 0; if(fg > base_mask) fg = base_mask; span->v = (value_type)fg; span->a = base_mask; ++span; ++base_type::interpolator(); } while(--len); } }; //=========================================span_image_resample_gray_affine template<class Source> class span_image_resample_gray_affine : public span_image_resample_affine<Source> { public: typedef Source source_type; typedef typename source_type::color_type color_type; typedef span_image_resample_affine<source_type> base_type; typedef typename base_type::interpolator_type interpolator_type; typedef typename color_type::value_type value_type; typedef typename color_type::long_type long_type; enum base_scale_e { base_shift = color_type::base_shift, base_mask = color_type::base_mask, downscale_shift = image_filter_shift }; //-------------------------------------------------------------------- span_image_resample_gray_affine() {} span_image_resample_gray_affine(source_type& src, interpolator_type& inter, const image_filter_lut& filter) : base_type(src, inter, filter) {} //-------------------------------------------------------------------- void generate(color_type* span, int x, int y, unsigned len) { base_type::interpolator().begin(x + base_type::filter_dx_dbl(), y + base_type::filter_dy_dbl(), len); long_type fg; int diameter = base_type::filter().diameter(); int filter_scale = diameter << image_subpixel_shift; int radius_x = (diameter * base_type::m_rx) >> 1; int radius_y = (diameter * base_type::m_ry) >> 1; int len_x_lr = (diameter * base_type::m_rx + image_subpixel_mask) >> image_subpixel_shift; const int16* weight_array = base_type::filter().weight_array(); do { base_type::interpolator().coordinates(&x, &y); x += base_type::filter_dx_int() - radius_x; y += base_type::filter_dy_int() - radius_y; fg = image_filter_scale / 2; int y_lr = y >> image_subpixel_shift; 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 = x >> image_subpixel_shift; int x_hr = ((image_subpixel_mask - (x & image_subpixel_mask)) * base_type::m_rx_inv) >> image_subpixel_shift; int x_hr2 = x_hr; const value_type* fg_ptr = (const value_type*)base_type::source().span(x_lr, y_lr, len_x_lr); for(;;) { int weight_y = weight_array[y_hr]; x_hr = x_hr2; for(;;) { int weight = (weight_y * weight_array[x_hr] + image_filter_scale / 2) >> downscale_shift; fg += *fg_ptr * weight; total_weight += weight; x_hr += base_type::m_rx_inv; if(x_hr >= filter_scale) break; fg_ptr = (const value_type*)base_type::source().next_x(); } y_hr += base_type::m_ry_inv; if(y_hr >= filter_scale) break; fg_ptr = (const value_type*)base_type::source().next_y(); } fg /= total_weight; if(fg < 0) fg = 0; if(fg > base_mask) fg = base_mask; span->v = (value_type)fg; span->a = base_mask; ++span; ++base_type::interpolator(); } while(--len); } }; //================================================span_image_resample_gray template<class Source, class Interpolator> class span_image_resample_gray : public span_image_resample<Source, Interpolator> { public: typedef Source source_type; typedef typename source_type::color_type color_type; typedef Interpolator interpolator_type; typedef span_image_resample<source_type, interpolator_type> base_type; typedef typename color_type::value_type value_type; typedef typename color_type::long_type long_type; enum base_scale_e { base_shift = color_type::base_shift, base_mask = color_type::base_mask, downscale_shift = image_filter_shift }; //-------------------------------------------------------------------- span_image_resample_gray() {} span_image_resample_gray(source_type& src, interpolator_type& inter, const image_filter_lut& filter) : base_type(src, inter, filter) {} //-------------------------------------------------------------------- void generate(color_type* span, int x, int y, unsigned len) { base_type::interpolator().begin(x + base_type::filter_dx_dbl(), y + base_type::filter_dy_dbl(), len); long_type fg; int diameter = base_type::filter().diameter(); int filter_scale = diameter << image_subpixel_shift; const int16* weight_array = base_type::filter().weight_array(); do { int rx; int ry; int rx_inv = image_subpixel_scale; int ry_inv = image_subpixel_scale; base_type::interpolator().coordinates(&x, &y); base_type::interpolator().local_scale(&rx, &ry); base_type::adjust_scale(&rx, &ry); rx_inv = image_subpixel_scale * image_subpixel_scale / rx; ry_inv = image_subpixel_scale * image_subpixel_scale / ry; int radius_x = (diameter * rx) >> 1; int radius_y = (diameter * ry) >> 1; int len_x_lr = (diameter * rx + image_subpixel_mask) >> image_subpixel_shift; x += base_type::filter_dx_int() - radius_x; y += base_type::filter_dy_int() - radius_y; fg = image_filter_scale / 2; int y_lr = y >> image_subpixel_shift; int y_hr = ((image_subpixel_mask - (y & image_subpixel_mask)) * ry_inv) >> image_subpixel_shift; int total_weight = 0; int x_lr = x >> image_subpixel_shift; int x_hr = ((image_subpixel_mask - (x & image_subpixel_mask)) * rx_inv) >> image_subpixel_shift; int x_hr2 = x_hr; const value_type* fg_ptr = (const value_type*)base_type::source().span(x_lr, y_lr, len_x_lr); for(;;) { int weight_y = weight_array[y_hr]; x_hr = x_hr2; for(;;) { int weight = (weight_y * weight_array[x_hr] + image_filter_scale / 2) >> downscale_shift; fg += *fg_ptr * weight; total_weight += weight; x_hr += rx_inv; if(x_hr >= filter_scale) break; fg_ptr = (const value_type*)base_type::source().next_x(); } y_hr += ry_inv; if(y_hr >= filter_scale) break; fg_ptr = (const value_type*)base_type::source().next_y(); } fg /= total_weight; if(fg < 0) fg = 0; if(fg > base_mask) fg = base_mask; span->v = (value_type)fg; span->a = base_mask; ++span; ++base_type::interpolator(); } while(--len); } }; } #endif ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_span_image_filter_rgb.h���������������������������������������������������0000644�0000000�0000000�00000106402�10703246330�022175� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- // // 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 #define AGG_SPAN_IMAGE_FILTER_RGB_INCLUDED #include "agg_basics.h" #include "agg_color_rgba.h" #include "agg_span_image_filter.h" namespace agg { //===============================================span_image_filter_rgb_nn template<class Source, class Interpolator> class span_image_filter_rgb_nn : public span_image_filter<Source, Interpolator> { public: typedef Source source_type; typedef typename source_type::color_type color_type; typedef typename source_type::order_type order_type; typedef Interpolator interpolator_type; typedef span_image_filter<source_type, interpolator_type> base_type; typedef typename color_type::value_type value_type; typedef typename color_type::calc_type calc_type; enum base_scale_e { base_shift = color_type::base_shift, base_mask = color_type::base_mask }; //-------------------------------------------------------------------- span_image_filter_rgb_nn() {} span_image_filter_rgb_nn(source_type& src, interpolator_type& inter) : base_type(src, inter, 0) {} //-------------------------------------------------------------------- void generate(color_type* span, int x, int y, unsigned len) { base_type::interpolator().begin(x + base_type::filter_dx_dbl(), y + base_type::filter_dy_dbl(), len); do { base_type::interpolator().coordinates(&x, &y); const value_type* fg_ptr = (const value_type*) base_type::source().span(x >> image_subpixel_shift, y >> image_subpixel_shift, 1); span->r = fg_ptr[order_type::R]; span->g = fg_ptr[order_type::G]; span->b = fg_ptr[order_type::B]; span->a = base_mask; ++span; ++base_type::interpolator(); } while(--len); } }; //==========================================span_image_filter_rgb_bilinear template<class Source, class Interpolator> class span_image_filter_rgb_bilinear : public span_image_filter<Source, Interpolator> { public: typedef Source source_type; typedef typename source_type::color_type color_type; typedef typename source_type::order_type order_type; typedef Interpolator interpolator_type; typedef span_image_filter<source_type, interpolator_type> base_type; typedef typename color_type::value_type value_type; typedef typename color_type::calc_type calc_type; enum base_scale_e { base_shift = color_type::base_shift, base_mask = color_type::base_mask }; //-------------------------------------------------------------------- span_image_filter_rgb_bilinear() {} span_image_filter_rgb_bilinear(source_type& src, interpolator_type& inter) : base_type(src, inter, 0) {} //-------------------------------------------------------------------- void generate(color_type* span, int x, int y, unsigned len) { base_type::interpolator().begin(x + base_type::filter_dx_dbl(), y + base_type::filter_dy_dbl(), len); calc_type fg[3]; const value_type *fg_ptr; do { int x_hr; int y_hr; base_type::interpolator().coordinates(&x_hr, &y_hr); x_hr -= base_type::filter_dx_int(); y_hr -= base_type::filter_dy_int(); int x_lr = x_hr >> image_subpixel_shift; int y_lr = y_hr >> image_subpixel_shift; unsigned weight; fg[0] = fg[1] = fg[2] = image_subpixel_scale * image_subpixel_scale / 2; x_hr &= image_subpixel_mask; y_hr &= image_subpixel_mask; fg_ptr = (const value_type*)base_type::source().span(x_lr, y_lr, 2); weight = (image_subpixel_scale - x_hr) * (image_subpixel_scale - y_hr); fg[0] += weight * *fg_ptr++; fg[1] += weight * *fg_ptr++; fg[2] += weight * *fg_ptr; fg_ptr = (const value_type*)base_type::source().next_x(); weight = x_hr * (image_subpixel_scale - y_hr); fg[0] += weight * *fg_ptr++; fg[1] += weight * *fg_ptr++; fg[2] += weight * *fg_ptr; fg_ptr = (const value_type*)base_type::source().next_y(); weight = (image_subpixel_scale - x_hr) * y_hr; fg[0] += weight * *fg_ptr++; fg[1] += weight * *fg_ptr++; fg[2] += weight * *fg_ptr; fg_ptr = (const value_type*)base_type::source().next_x(); weight = x_hr * y_hr; fg[0] += weight * *fg_ptr++; fg[1] += weight * *fg_ptr++; fg[2] += weight * *fg_ptr; span->r = value_type(fg[order_type::R] >> (image_subpixel_shift * 2)); span->g = value_type(fg[order_type::G] >> (image_subpixel_shift * 2)); span->b = value_type(fg[order_type::B] >> (image_subpixel_shift * 2)); span->a = base_mask; ++span; ++base_type::interpolator(); } while(--len); } }; //=====================================span_image_filter_rgb_bilinear_clip template<class Source, class Interpolator> class span_image_filter_rgb_bilinear_clip : public span_image_filter<Source, Interpolator> { public: typedef Source source_type; typedef typename source_type::color_type color_type; typedef typename source_type::order_type order_type; typedef Interpolator interpolator_type; typedef span_image_filter<source_type, interpolator_type> base_type; typedef typename color_type::value_type value_type; typedef typename color_type::calc_type calc_type; enum base_scale_e { base_shift = color_type::base_shift, base_mask = color_type::base_mask }; //-------------------------------------------------------------------- span_image_filter_rgb_bilinear_clip() {} span_image_filter_rgb_bilinear_clip(source_type& src, const color_type& back_color, interpolator_type& inter) : base_type(src, inter, 0), m_back_color(back_color) {} const color_type& background_color() const { return m_back_color; } void background_color(const color_type& v) { m_back_color = v; } //-------------------------------------------------------------------- void generate(color_type* span, int x, int y, unsigned len) { 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; value_type back_r = m_back_color.r; value_type back_g = m_back_color.g; value_type back_b = m_back_color.b; value_type back_a = m_back_color.a; const value_type *fg_ptr; int maxx = base_type::source().width() - 1; int maxy = base_type::source().height() - 1; do { int x_hr; int y_hr; base_type::interpolator().coordinates(&x_hr, &y_hr); x_hr -= base_type::filter_dx_int(); y_hr -= base_type::filter_dy_int(); int x_lr = x_hr >> image_subpixel_shift; int y_lr = y_hr >> image_subpixel_shift; unsigned weight; if(x_lr >= 0 && y_lr >= 0 && x_lr < maxx && y_lr < maxy) { fg[0] = fg[1] = fg[2] = image_subpixel_scale * image_subpixel_scale / 2; x_hr &= image_subpixel_mask; y_hr &= image_subpixel_mask; fg_ptr = (const value_type*) base_type::source().row_ptr(y_lr) + x_lr + x_lr + x_lr; weight = (image_subpixel_scale - x_hr) * (image_subpixel_scale - y_hr); fg[0] += weight * *fg_ptr++; fg[1] += weight * *fg_ptr++; fg[2] += weight * *fg_ptr++; weight = x_hr * (image_subpixel_scale - y_hr); fg[0] += weight * *fg_ptr++; fg[1] += weight * *fg_ptr++; fg[2] += weight * *fg_ptr++; ++y_lr; fg_ptr = (const value_type*) base_type::source().row_ptr(y_lr) + x_lr + x_lr + x_lr; weight = (image_subpixel_scale - x_hr) * y_hr; fg[0] += weight * *fg_ptr++; fg[1] += weight * *fg_ptr++; fg[2] += weight * *fg_ptr++; weight = x_hr * y_hr; fg[0] += weight * *fg_ptr++; fg[1] += weight * *fg_ptr++; fg[2] += weight * *fg_ptr++; fg[0] >>= image_subpixel_shift * 2; fg[1] >>= image_subpixel_shift * 2; fg[2] >>= image_subpixel_shift * 2; src_alpha = base_mask; } else { if(x_lr < -1 || y_lr < -1 || x_lr > maxx || y_lr > maxy) { fg[order_type::R] = back_r; fg[order_type::G] = back_g; fg[order_type::B] = back_b; src_alpha = back_a; } else { fg[0] = fg[1] = fg[2] = src_alpha = image_subpixel_scale * image_subpixel_scale / 2; x_hr &= image_subpixel_mask; y_hr &= image_subpixel_mask; weight = (image_subpixel_scale - x_hr) * (image_subpixel_scale - y_hr); if(x_lr >= 0 && y_lr >= 0 && x_lr <= maxx && y_lr <= maxy) { fg_ptr = (const value_type*) base_type::source().row_ptr(y_lr) + x_lr + x_lr + x_lr; fg[0] += weight * *fg_ptr++; fg[1] += weight * *fg_ptr++; fg[2] += weight * *fg_ptr++; src_alpha += weight * base_mask; } else { fg[order_type::R] += back_r * weight; fg[order_type::G] += back_g * weight; fg[order_type::B] += back_b * weight; src_alpha += back_a * weight; } x_lr++; weight = x_hr * (image_subpixel_scale - y_hr); if(x_lr >= 0 && y_lr >= 0 && x_lr <= maxx && y_lr <= maxy) { fg_ptr = (const value_type*) base_type::source().row_ptr(y_lr) + x_lr + x_lr + x_lr; fg[0] += weight * *fg_ptr++; fg[1] += weight * *fg_ptr++; fg[2] += weight * *fg_ptr++; src_alpha += weight * base_mask; } else { fg[order_type::R] += back_r * weight; fg[order_type::G] += back_g * weight; fg[order_type::B] += back_b * weight; src_alpha += back_a * weight; } x_lr--; y_lr++; weight = (image_subpixel_scale - x_hr) * y_hr; if(x_lr >= 0 && y_lr >= 0 && x_lr <= maxx && y_lr <= maxy) { fg_ptr = (const value_type*) base_type::source().row_ptr(y_lr) + x_lr + x_lr + x_lr; fg[0] += weight * *fg_ptr++; fg[1] += weight * *fg_ptr++; fg[2] += weight * *fg_ptr++; src_alpha += weight * base_mask; } else { fg[order_type::R] += back_r * weight; fg[order_type::G] += back_g * weight; fg[order_type::B] += back_b * weight; src_alpha += back_a * weight; } x_lr++; weight = x_hr * y_hr; if(x_lr >= 0 && y_lr >= 0 && x_lr <= maxx && y_lr <= maxy) { fg_ptr = (const value_type*) base_type::source().row_ptr(y_lr) + x_lr + x_lr + x_lr; fg[0] += weight * *fg_ptr++; fg[1] += weight * *fg_ptr++; fg[2] += weight * *fg_ptr++; src_alpha += weight * base_mask; } else { fg[order_type::R] += back_r * weight; fg[order_type::G] += back_g * weight; fg[order_type::B] += back_b * weight; src_alpha += back_a * weight; } fg[0] >>= image_subpixel_shift * 2; fg[1] >>= image_subpixel_shift * 2; fg[2] >>= image_subpixel_shift * 2; src_alpha >>= image_subpixel_shift * 2; } } span->r = (value_type)fg[order_type::R]; span->g = (value_type)fg[order_type::G]; span->b = (value_type)fg[order_type::B]; span->a = (value_type)src_alpha; ++span; ++base_type::interpolator(); } while(--len); } private: color_type m_back_color; }; //===============================================span_image_filter_rgb_2x2 template<class Source, class Interpolator> class span_image_filter_rgb_2x2 : public span_image_filter<Source, Interpolator> { public: typedef Source source_type; typedef typename source_type::color_type color_type; typedef typename source_type::order_type order_type; typedef Interpolator interpolator_type; typedef span_image_filter<source_type, interpolator_type> base_type; typedef typename color_type::value_type value_type; typedef typename color_type::calc_type calc_type; enum base_scale_e { base_shift = color_type::base_shift, base_mask = color_type::base_mask }; //-------------------------------------------------------------------- span_image_filter_rgb_2x2() {} span_image_filter_rgb_2x2(source_type& src, interpolator_type& inter, const image_filter_lut& filter) : base_type(src, inter, &filter) {} //-------------------------------------------------------------------- void generate(color_type* span, int x, int y, unsigned len) { base_type::interpolator().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) << image_subpixel_shift); do { int x_hr; int y_hr; base_type::interpolator().coordinates(&x_hr, &y_hr); x_hr -= base_type::filter_dx_int(); y_hr -= base_type::filter_dy_int(); int x_lr = x_hr >> image_subpixel_shift; int y_lr = y_hr >> image_subpixel_shift; unsigned weight; fg[0] = fg[1] = fg[2] = image_filter_scale / 2; x_hr &= image_subpixel_mask; y_hr &= image_subpixel_mask; fg_ptr = (const value_type*)base_type::source().span(x_lr, y_lr, 2); weight = (weight_array[x_hr + image_subpixel_scale] * weight_array[y_hr + image_subpixel_scale] + image_filter_scale / 2) >> image_filter_shift; fg[0] += weight * *fg_ptr++; fg[1] += weight * *fg_ptr++; fg[2] += weight * *fg_ptr; fg_ptr = (const value_type*)base_type::source().next_x(); weight = (weight_array[x_hr] * weight_array[y_hr + image_subpixel_scale] + image_filter_scale / 2) >> image_filter_shift; fg[0] += weight * *fg_ptr++; fg[1] += weight * *fg_ptr++; fg[2] += weight * *fg_ptr; fg_ptr = (const value_type*)base_type::source().next_y(); weight = (weight_array[x_hr + image_subpixel_scale] * weight_array[y_hr] + image_filter_scale / 2) >> image_filter_shift; fg[0] += weight * *fg_ptr++; fg[1] += weight * *fg_ptr++; fg[2] += weight * *fg_ptr; fg_ptr = (const value_type*)base_type::source().next_x(); weight = (weight_array[x_hr] * weight_array[y_hr] + image_filter_scale / 2) >> image_filter_shift; fg[0] += weight * *fg_ptr++; fg[1] += weight * *fg_ptr++; fg[2] += weight * *fg_ptr; fg[0] >>= image_filter_shift; fg[1] >>= image_filter_shift; fg[2] >>= image_filter_shift; if(fg[order_type::R] > base_mask) fg[order_type::R] = base_mask; if(fg[order_type::G] > base_mask) fg[order_type::G] = base_mask; if(fg[order_type::B] > base_mask) fg[order_type::B] = base_mask; span->r = (value_type)fg[order_type::R]; span->g = (value_type)fg[order_type::G]; span->b = (value_type)fg[order_type::B]; span->a = base_mask; ++span; ++base_type::interpolator(); } while(--len); } }; //===================================================span_image_filter_rgb template<class Source, class Interpolator> class span_image_filter_rgb : public span_image_filter<Source, Interpolator> { public: typedef Source source_type; typedef typename source_type::color_type color_type; typedef typename source_type::order_type order_type; typedef Interpolator interpolator_type; typedef span_image_filter<source_type, interpolator_type> base_type; typedef typename color_type::value_type value_type; typedef typename color_type::calc_type calc_type; enum base_scale_e { base_shift = color_type::base_shift, base_mask = color_type::base_mask }; //-------------------------------------------------------------------- span_image_filter_rgb() {} span_image_filter_rgb(source_type& src, interpolator_type& inter, const image_filter_lut& filter) : base_type(src, inter, &filter) {} //-------------------------------------------------------------------- void generate(color_type* span, int x, int y, unsigned len) { base_type::interpolator().begin(x + base_type::filter_dx_dbl(), y + base_type::filter_dy_dbl(), len); int fg[3]; const value_type *fg_ptr; unsigned diameter = base_type::filter().diameter(); int start = base_type::filter().start(); const int16* weight_array = base_type::filter().weight_array(); int x_count; int weight_y; do { base_type::interpolator().coordinates(&x, &y); x -= base_type::filter_dx_int(); y -= base_type::filter_dy_int(); int x_hr = x; int y_hr = y; int x_lr = x_hr >> image_subpixel_shift; int y_lr = y_hr >> image_subpixel_shift; fg[0] = fg[1] = fg[2] = image_filter_scale / 2; int x_fract = x_hr & image_subpixel_mask; unsigned y_count = diameter; y_hr = image_subpixel_mask - (y_hr & image_subpixel_mask); fg_ptr = (const value_type*)base_type::source().span(x_lr + start, y_lr + start, diameter); for(;;) { x_count = diameter; weight_y = weight_array[y_hr]; x_hr = image_subpixel_mask - x_fract; for(;;) { int weight = (weight_y * weight_array[x_hr] + image_filter_scale / 2) >> image_filter_shift; fg[0] += weight * *fg_ptr++; fg[1] += weight * *fg_ptr++; fg[2] += weight * *fg_ptr; if(--x_count == 0) break; x_hr += image_subpixel_scale; fg_ptr = (const value_type*)base_type::source().next_x(); } if(--y_count == 0) break; y_hr += image_subpixel_scale; fg_ptr = (const value_type*)base_type::source().next_y(); } fg[0] >>= image_filter_shift; fg[1] >>= image_filter_shift; fg[2] >>= image_filter_shift; if(fg[0] < 0) fg[0] = 0; if(fg[1] < 0) fg[1] = 0; if(fg[2] < 0) fg[2] = 0; if(fg[order_type::R] > base_mask) fg[order_type::R] = base_mask; if(fg[order_type::G] > base_mask) fg[order_type::G] = base_mask; if(fg[order_type::B] > base_mask) fg[order_type::B] = base_mask; span->r = (value_type)fg[order_type::R]; span->g = (value_type)fg[order_type::G]; span->b = (value_type)fg[order_type::B]; span->a = base_mask; ++span; ++base_type::interpolator(); } while(--len); } }; //==========================================span_image_resample_rgb_affine template<class Source> class span_image_resample_rgb_affine : public span_image_resample_affine<Source> { public: typedef Source source_type; typedef typename source_type::color_type color_type; typedef typename source_type::order_type order_type; typedef span_image_resample_affine<source_type> base_type; typedef typename base_type::interpolator_type interpolator_type; typedef typename color_type::value_type value_type; typedef typename color_type::long_type long_type; enum base_scale_e { base_shift = color_type::base_shift, base_mask = color_type::base_mask, downscale_shift = image_filter_shift }; //-------------------------------------------------------------------- span_image_resample_rgb_affine() {} span_image_resample_rgb_affine(source_type& src, interpolator_type& inter, const image_filter_lut& filter) : base_type(src, inter, filter) {} //-------------------------------------------------------------------- void generate(color_type* span, int x, int y, unsigned len) { base_type::interpolator().begin(x + base_type::filter_dx_dbl(), y + base_type::filter_dy_dbl(), len); long_type fg[3]; int diameter = base_type::filter().diameter(); int filter_scale = diameter << image_subpixel_shift; int radius_x = (diameter * base_type::m_rx) >> 1; int radius_y = (diameter * base_type::m_ry) >> 1; int len_x_lr = (diameter * base_type::m_rx + image_subpixel_mask) >> image_subpixel_shift; const int16* weight_array = base_type::filter().weight_array(); do { base_type::interpolator().coordinates(&x, &y); x += base_type::filter_dx_int() - radius_x; y += base_type::filter_dy_int() - radius_y; fg[0] = fg[1] = fg[2] = image_filter_scale / 2; int y_lr = y >> image_subpixel_shift; 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 = x >> image_subpixel_shift; int x_hr = ((image_subpixel_mask - (x & image_subpixel_mask)) * base_type::m_rx_inv) >> image_subpixel_shift; int x_hr2 = x_hr; const value_type* fg_ptr = (const value_type*)base_type::source().span(x_lr, y_lr, len_x_lr); for(;;) { int weight_y = weight_array[y_hr]; x_hr = x_hr2; for(;;) { int weight = (weight_y * weight_array[x_hr] + image_filter_scale / 2) >> downscale_shift; fg[0] += *fg_ptr++ * weight; fg[1] += *fg_ptr++ * weight; fg[2] += *fg_ptr * weight; total_weight += weight; x_hr += base_type::m_rx_inv; if(x_hr >= filter_scale) break; fg_ptr = (const value_type*)base_type::source().next_x(); } y_hr += base_type::m_ry_inv; if(y_hr >= filter_scale) break; fg_ptr = (const value_type*)base_type::source().next_y(); } fg[0] /= total_weight; fg[1] /= total_weight; fg[2] /= total_weight; if(fg[0] < 0) fg[0] = 0; if(fg[1] < 0) fg[1] = 0; if(fg[2] < 0) fg[2] = 0; if(fg[order_type::R] > base_mask) fg[order_type::R] = base_mask; if(fg[order_type::G] > base_mask) fg[order_type::G] = base_mask; if(fg[order_type::B] > base_mask) fg[order_type::B] = base_mask; span->r = (value_type)fg[order_type::R]; span->g = (value_type)fg[order_type::G]; span->b = (value_type)fg[order_type::B]; span->a = base_mask; ++span; ++base_type::interpolator(); } while(--len); } }; //=================================================span_image_resample_rgb template<class Source, class Interpolator> class span_image_resample_rgb : public span_image_resample<Source, Interpolator> { public: typedef Source source_type; typedef typename source_type::color_type color_type; typedef typename source_type::order_type order_type; typedef Interpolator interpolator_type; typedef span_image_resample<source_type, interpolator_type> base_type; typedef typename color_type::value_type value_type; typedef typename color_type::long_type long_type; enum base_scale_e { base_shift = color_type::base_shift, base_mask = color_type::base_mask, downscale_shift = image_filter_shift }; //-------------------------------------------------------------------- span_image_resample_rgb() {} span_image_resample_rgb(source_type& src, interpolator_type& inter, const image_filter_lut& filter) : base_type(src, inter, filter) {} //-------------------------------------------------------------------- void generate(color_type* span, int x, int y, unsigned len) { base_type::interpolator().begin(x + base_type::filter_dx_dbl(), y + base_type::filter_dy_dbl(), len); long_type fg[3]; int diameter = base_type::filter().diameter(); int filter_scale = diameter << image_subpixel_shift; const int16* weight_array = base_type::filter().weight_array(); do { int rx; int ry; int rx_inv = image_subpixel_scale; int ry_inv = image_subpixel_scale; base_type::interpolator().coordinates(&x, &y); base_type::interpolator().local_scale(&rx, &ry); base_type::adjust_scale(&rx, &ry); rx_inv = image_subpixel_scale * image_subpixel_scale / rx; ry_inv = image_subpixel_scale * image_subpixel_scale / ry; int radius_x = (diameter * rx) >> 1; int radius_y = (diameter * ry) >> 1; int len_x_lr = (diameter * rx + image_subpixel_mask) >> image_subpixel_shift; x += base_type::filter_dx_int() - radius_x; y += base_type::filter_dy_int() - radius_y; fg[0] = fg[1] = fg[2] = image_filter_scale / 2; int y_lr = y >> image_subpixel_shift; int y_hr = ((image_subpixel_mask - (y & image_subpixel_mask)) * ry_inv) >> image_subpixel_shift; int total_weight = 0; int x_lr = x >> image_subpixel_shift; int x_hr = ((image_subpixel_mask - (x & image_subpixel_mask)) * rx_inv) >> image_subpixel_shift; int x_hr2 = x_hr; const value_type* fg_ptr = (const value_type*)base_type::source().span(x_lr, y_lr, len_x_lr); for(;;) { int weight_y = weight_array[y_hr]; x_hr = x_hr2; for(;;) { int weight = (weight_y * weight_array[x_hr] + image_filter_scale / 2) >> downscale_shift; fg[0] += *fg_ptr++ * weight; fg[1] += *fg_ptr++ * weight; fg[2] += *fg_ptr * weight; total_weight += weight; x_hr += rx_inv; if(x_hr >= filter_scale) break; fg_ptr = (const value_type*)base_type::source().next_x(); } y_hr += ry_inv; if(y_hr >= filter_scale) break; fg_ptr = (const value_type*)base_type::source().next_y(); } fg[0] /= total_weight; fg[1] /= total_weight; fg[2] /= total_weight; if(fg[0] < 0) fg[0] = 0; if(fg[1] < 0) fg[1] = 0; if(fg[2] < 0) fg[2] = 0; if(fg[order_type::R] > base_mask) fg[order_type::R] = base_mask; if(fg[order_type::G] > base_mask) fg[order_type::G] = base_mask; if(fg[order_type::B] > base_mask) fg[order_type::B] = base_mask; span->r = (value_type)fg[order_type::R]; span->g = (value_type)fg[order_type::G]; span->b = (value_type)fg[order_type::B]; span->a = base_mask; ++span; ++base_type::interpolator(); } while(--len); } }; } #endif ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_span_image_filter_rgba.h��������������������������������������������������0000644�0000000�0000000�00000111661�10703246330�022341� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- // // 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_RGBA_INCLUDED #define AGG_SPAN_IMAGE_FILTER_RGBA_INCLUDED #include "agg_basics.h" #include "agg_color_rgba.h" #include "agg_span_image_filter.h" namespace agg { //==============================================span_image_filter_rgba_nn template<class Source, class Interpolator> class span_image_filter_rgba_nn : public span_image_filter<Source, Interpolator> { public: typedef Source source_type; typedef typename source_type::color_type color_type; typedef typename source_type::order_type order_type; typedef Interpolator interpolator_type; typedef span_image_filter<source_type, interpolator_type> base_type; typedef typename color_type::value_type value_type; typedef typename color_type::calc_type calc_type; enum base_scale_e { base_shift = color_type::base_shift, base_mask = color_type::base_mask }; //-------------------------------------------------------------------- span_image_filter_rgba_nn() {} span_image_filter_rgba_nn(source_type& src, interpolator_type& inter) : base_type(src, inter, 0) {} //-------------------------------------------------------------------- void generate(color_type* span, int x, int y, unsigned len) { base_type::interpolator().begin(x + base_type::filter_dx_dbl(), y + base_type::filter_dy_dbl(), len); do { base_type::interpolator().coordinates(&x, &y); const value_type* fg_ptr = (const value_type*) base_type::source().span(x >> image_subpixel_shift, y >> image_subpixel_shift, 1); span->r = fg_ptr[order_type::R]; span->g = fg_ptr[order_type::G]; span->b = fg_ptr[order_type::B]; span->a = fg_ptr[order_type::A]; ++span; ++base_type::interpolator(); } while(--len); } }; //=========================================span_image_filter_rgba_bilinear template<class Source, class Interpolator> class span_image_filter_rgba_bilinear : public span_image_filter<Source, Interpolator> { public: typedef Source source_type; typedef typename source_type::color_type color_type; typedef typename source_type::order_type order_type; typedef Interpolator interpolator_type; typedef span_image_filter<source_type, interpolator_type> base_type; typedef typename color_type::value_type value_type; typedef typename color_type::calc_type calc_type; enum base_scale_e { base_shift = color_type::base_shift, base_mask = color_type::base_mask }; //-------------------------------------------------------------------- span_image_filter_rgba_bilinear() {} span_image_filter_rgba_bilinear(source_type& src, interpolator_type& inter) : base_type(src, inter, 0) {} //-------------------------------------------------------------------- void generate(color_type* span, int x, int y, unsigned len) { 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; do { int x_hr; int y_hr; base_type::interpolator().coordinates(&x_hr, &y_hr); x_hr -= base_type::filter_dx_int(); y_hr -= base_type::filter_dy_int(); int x_lr = x_hr >> image_subpixel_shift; int y_lr = y_hr >> image_subpixel_shift; unsigned weight; fg[0] = fg[1] = fg[2] = fg[3] = image_subpixel_scale * image_subpixel_scale / 2; x_hr &= image_subpixel_mask; y_hr &= image_subpixel_mask; fg_ptr = (const value_type*)base_type::source().span(x_lr, y_lr, 2); weight = (image_subpixel_scale - x_hr) * (image_subpixel_scale - y_hr); fg[0] += weight * *fg_ptr++; fg[1] += weight * *fg_ptr++; fg[2] += weight * *fg_ptr++; fg[3] += weight * *fg_ptr; fg_ptr = (const value_type*)base_type::source().next_x(); weight = x_hr * (image_subpixel_scale - y_hr); fg[0] += weight * *fg_ptr++; fg[1] += weight * *fg_ptr++; fg[2] += weight * *fg_ptr++; fg[3] += weight * *fg_ptr; fg_ptr = (const value_type*)base_type::source().next_y(); weight = (image_subpixel_scale - x_hr) * y_hr; fg[0] += weight * *fg_ptr++; fg[1] += weight * *fg_ptr++; fg[2] += weight * *fg_ptr++; fg[3] += weight * *fg_ptr; fg_ptr = (const value_type*)base_type::source().next_x(); weight = x_hr * y_hr; fg[0] += weight * *fg_ptr++; fg[1] += weight * *fg_ptr++; fg[2] += weight * *fg_ptr++; fg[3] += weight * *fg_ptr; span->r = value_type(fg[order_type::R] >> (image_subpixel_shift * 2)); span->g = value_type(fg[order_type::G] >> (image_subpixel_shift * 2)); span->b = value_type(fg[order_type::B] >> (image_subpixel_shift * 2)); span->a = value_type(fg[order_type::A] >> (image_subpixel_shift * 2)); ++span; ++base_type::interpolator(); } while(--len); } }; //====================================span_image_filter_rgba_bilinear_clip template<class Source, class Interpolator> class span_image_filter_rgba_bilinear_clip : public span_image_filter<Source, Interpolator> { public: typedef Source source_type; typedef typename source_type::color_type color_type; typedef typename source_type::order_type order_type; typedef Interpolator interpolator_type; typedef span_image_filter<source_type, interpolator_type> base_type; typedef typename color_type::value_type value_type; typedef typename color_type::calc_type calc_type; enum base_scale_e { base_shift = color_type::base_shift, base_mask = color_type::base_mask }; //-------------------------------------------------------------------- span_image_filter_rgba_bilinear_clip() {} span_image_filter_rgba_bilinear_clip(source_type& src, const color_type& back_color, interpolator_type& inter) : base_type(src, inter, 0), m_back_color(back_color) {} const color_type& background_color() const { return m_back_color; } void background_color(const color_type& v) { m_back_color = v; } //-------------------------------------------------------------------- void generate(color_type* span, int x, int y, unsigned len) { base_type::interpolator().begin(x + base_type::filter_dx_dbl(), y + base_type::filter_dy_dbl(), len); calc_type fg[4]; value_type back_r = m_back_color.r; value_type back_g = m_back_color.g; value_type back_b = m_back_color.b; value_type back_a = m_back_color.a; const value_type *fg_ptr; int maxx = base_type::source().width() - 1; int maxy = base_type::source().height() - 1; do { int x_hr; int y_hr; base_type::interpolator().coordinates(&x_hr, &y_hr); x_hr -= base_type::filter_dx_int(); y_hr -= base_type::filter_dy_int(); int x_lr = x_hr >> image_subpixel_shift; int y_lr = y_hr >> image_subpixel_shift; unsigned weight; if(x_lr >= 0 && y_lr >= 0 && x_lr < maxx && y_lr < maxy) { fg[0] = fg[1] = fg[2] = fg[3] = image_subpixel_scale * image_subpixel_scale / 2; x_hr &= image_subpixel_mask; y_hr &= image_subpixel_mask; fg_ptr = (const value_type*) base_type::source().row_ptr(y_lr) + (x_lr << 2); weight = (image_subpixel_scale - x_hr) * (image_subpixel_scale - y_hr); fg[0] += weight * *fg_ptr++; fg[1] += weight * *fg_ptr++; fg[2] += weight * *fg_ptr++; fg[3] += weight * *fg_ptr++; weight = x_hr * (image_subpixel_scale - y_hr); fg[0] += weight * *fg_ptr++; fg[1] += weight * *fg_ptr++; fg[2] += weight * *fg_ptr++; fg[3] += weight * *fg_ptr++; ++y_lr; fg_ptr = (const value_type*) base_type::source().row_ptr(y_lr) + (x_lr << 2); weight = (image_subpixel_scale - x_hr) * y_hr; fg[0] += weight * *fg_ptr++; fg[1] += weight * *fg_ptr++; fg[2] += weight * *fg_ptr++; fg[3] += weight * *fg_ptr++; weight = x_hr * y_hr; fg[0] += weight * *fg_ptr++; fg[1] += weight * *fg_ptr++; fg[2] += weight * *fg_ptr++; fg[3] += weight * *fg_ptr++; fg[0] >>= image_subpixel_shift * 2; fg[1] >>= image_subpixel_shift * 2; fg[2] >>= image_subpixel_shift * 2; fg[3] >>= image_subpixel_shift * 2; } else { if(x_lr < -1 || y_lr < -1 || x_lr > maxx || y_lr > maxy) { fg[order_type::R] = back_r; fg[order_type::G] = back_g; fg[order_type::B] = back_b; fg[order_type::A] = back_a; } else { fg[0] = fg[1] = fg[2] = fg[3] = image_subpixel_scale * image_subpixel_scale / 2; x_hr &= image_subpixel_mask; y_hr &= image_subpixel_mask; weight = (image_subpixel_scale - x_hr) * (image_subpixel_scale - y_hr); if(x_lr >= 0 && y_lr >= 0 && x_lr <= maxx && y_lr <= maxy) { fg_ptr = (const value_type*) base_type::source().row_ptr(y_lr) + (x_lr << 2); fg[0] += weight * *fg_ptr++; fg[1] += weight * *fg_ptr++; fg[2] += weight * *fg_ptr++; fg[3] += weight * *fg_ptr++; } else { fg[order_type::R] += back_r * weight; fg[order_type::G] += back_g * weight; fg[order_type::B] += back_b * weight; fg[order_type::A] += back_a * weight; } x_lr++; weight = x_hr * (image_subpixel_scale - y_hr); if(x_lr >= 0 && y_lr >= 0 && x_lr <= maxx && y_lr <= maxy) { fg_ptr = (const value_type*) base_type::source().row_ptr(y_lr) + (x_lr << 2); fg[0] += weight * *fg_ptr++; fg[1] += weight * *fg_ptr++; fg[2] += weight * *fg_ptr++; fg[3] += weight * *fg_ptr++; } else { fg[order_type::R] += back_r * weight; fg[order_type::G] += back_g * weight; fg[order_type::B] += back_b * weight; fg[order_type::A] += back_a * weight; } x_lr--; y_lr++; weight = (image_subpixel_scale - x_hr) * y_hr; if(x_lr >= 0 && y_lr >= 0 && x_lr <= maxx && y_lr <= maxy) { fg_ptr = (const value_type*) base_type::source().row_ptr(y_lr) + (x_lr << 2); fg[0] += weight * *fg_ptr++; fg[1] += weight * *fg_ptr++; fg[2] += weight * *fg_ptr++; fg[3] += weight * *fg_ptr++; } else { fg[order_type::R] += back_r * weight; fg[order_type::G] += back_g * weight; fg[order_type::B] += back_b * weight; fg[order_type::A] += back_a * weight; } x_lr++; weight = x_hr * y_hr; if(x_lr >= 0 && y_lr >= 0 && x_lr <= maxx && y_lr <= maxy) { fg_ptr = (const value_type*) base_type::source().row_ptr(y_lr) + (x_lr << 2); fg[0] += weight * *fg_ptr++; fg[1] += weight * *fg_ptr++; fg[2] += weight * *fg_ptr++; fg[3] += weight * *fg_ptr++; } else { fg[order_type::R] += back_r * weight; fg[order_type::G] += back_g * weight; fg[order_type::B] += back_b * weight; fg[order_type::A] += back_a * weight; } fg[0] >>= image_subpixel_shift * 2; fg[1] >>= image_subpixel_shift * 2; fg[2] >>= image_subpixel_shift * 2; fg[3] >>= image_subpixel_shift * 2; } } span->r = (value_type)fg[order_type::R]; span->g = (value_type)fg[order_type::G]; span->b = (value_type)fg[order_type::B]; span->a = (value_type)fg[order_type::A]; ++span; ++base_type::interpolator(); } while(--len); } private: color_type m_back_color; }; //==============================================span_image_filter_rgba_2x2 template<class Source, class Interpolator> class span_image_filter_rgba_2x2 : public span_image_filter<Source, Interpolator> { public: typedef Source source_type; typedef typename source_type::color_type color_type; typedef typename source_type::order_type order_type; typedef Interpolator interpolator_type; typedef span_image_filter<source_type, interpolator_type> base_type; typedef typename color_type::value_type value_type; typedef typename color_type::calc_type calc_type; enum base_scale_e { base_shift = color_type::base_shift, base_mask = color_type::base_mask }; //-------------------------------------------------------------------- span_image_filter_rgba_2x2() {} span_image_filter_rgba_2x2(source_type& src, interpolator_type& inter, const image_filter_lut& filter) : base_type(src, inter, &filter) {} //-------------------------------------------------------------------- void generate(color_type* span, int x, int y, unsigned len) { 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; const int16* weight_array = base_type::filter().weight_array() + ((base_type::filter().diameter()/2 - 1) << image_subpixel_shift); do { int x_hr; int y_hr; base_type::interpolator().coordinates(&x_hr, &y_hr); x_hr -= base_type::filter_dx_int(); y_hr -= base_type::filter_dy_int(); int x_lr = x_hr >> image_subpixel_shift; int y_lr = y_hr >> image_subpixel_shift; unsigned weight; fg[0] = fg[1] = fg[2] = fg[3] = image_filter_scale / 2; x_hr &= image_subpixel_mask; y_hr &= image_subpixel_mask; fg_ptr = (const value_type*)base_type::source().span(x_lr, y_lr, 2); weight = (weight_array[x_hr + image_subpixel_scale] * weight_array[y_hr + image_subpixel_scale] + image_filter_scale / 2) >> image_filter_shift; fg[0] += weight * *fg_ptr++; fg[1] += weight * *fg_ptr++; fg[2] += weight * *fg_ptr++; fg[3] += weight * *fg_ptr; fg_ptr = (const value_type*)base_type::source().next_x(); weight = (weight_array[x_hr] * weight_array[y_hr + image_subpixel_scale] + image_filter_scale / 2) >> image_filter_shift; fg[0] += weight * *fg_ptr++; fg[1] += weight * *fg_ptr++; fg[2] += weight * *fg_ptr++; fg[3] += weight * *fg_ptr; fg_ptr = (const value_type*)base_type::source().next_y(); weight = (weight_array[x_hr + image_subpixel_scale] * weight_array[y_hr] + image_filter_scale / 2) >> image_filter_shift; fg[0] += weight * *fg_ptr++; fg[1] += weight * *fg_ptr++; fg[2] += weight * *fg_ptr++; fg[3] += weight * *fg_ptr; fg_ptr = (const value_type*)base_type::source().next_x(); weight = (weight_array[x_hr] * weight_array[y_hr] + image_filter_scale / 2) >> image_filter_shift; fg[0] += weight * *fg_ptr++; fg[1] += weight * *fg_ptr++; fg[2] += weight * *fg_ptr++; fg[3] += weight * *fg_ptr; fg[0] >>= image_filter_shift; fg[1] >>= image_filter_shift; fg[2] >>= image_filter_shift; fg[3] >>= image_filter_shift; if(fg[order_type::A] > base_mask) fg[order_type::A] = base_mask; if(fg[order_type::R] > fg[order_type::A]) fg[order_type::R] = fg[order_type::A]; if(fg[order_type::G] > fg[order_type::A]) fg[order_type::G] = fg[order_type::A]; if(fg[order_type::B] > fg[order_type::A]) fg[order_type::B] = fg[order_type::A]; span->r = (value_type)fg[order_type::R]; span->g = (value_type)fg[order_type::G]; span->b = (value_type)fg[order_type::B]; span->a = (value_type)fg[order_type::A]; ++span; ++base_type::interpolator(); } while(--len); } }; //==================================================span_image_filter_rgba template<class Source, class Interpolator> class span_image_filter_rgba : public span_image_filter<Source, Interpolator> { public: typedef Source source_type; typedef typename source_type::color_type color_type; typedef typename source_type::order_type order_type; typedef Interpolator interpolator_type; typedef span_image_filter<source_type, interpolator_type> base_type; typedef typename color_type::value_type value_type; typedef typename color_type::calc_type calc_type; enum base_scale_e { base_shift = color_type::base_shift, base_mask = color_type::base_mask }; //-------------------------------------------------------------------- span_image_filter_rgba() {} span_image_filter_rgba(source_type& src, interpolator_type& inter, const image_filter_lut& filter) : base_type(src, inter, &filter) {} //-------------------------------------------------------------------- void generate(color_type* span, int x, int y, unsigned len) { base_type::interpolator().begin(x + base_type::filter_dx_dbl(), y + base_type::filter_dy_dbl(), len); int fg[4]; const value_type *fg_ptr; unsigned diameter = base_type::filter().diameter(); int start = base_type::filter().start(); const int16* weight_array = base_type::filter().weight_array(); int x_count; int weight_y; do { base_type::interpolator().coordinates(&x, &y); x -= base_type::filter_dx_int(); y -= base_type::filter_dy_int(); int x_hr = x; int y_hr = y; int x_lr = x_hr >> image_subpixel_shift; int y_lr = y_hr >> image_subpixel_shift; fg[0] = fg[1] = fg[2] = fg[3] = image_filter_scale / 2; int x_fract = x_hr & image_subpixel_mask; unsigned y_count = diameter; y_hr = image_subpixel_mask - (y_hr & image_subpixel_mask); fg_ptr = (const value_type*)base_type::source().span(x_lr + start, y_lr + start, diameter); for(;;) { x_count = diameter; weight_y = weight_array[y_hr]; x_hr = image_subpixel_mask - x_fract; for(;;) { int weight = (weight_y * weight_array[x_hr] + image_filter_scale / 2) >> image_filter_shift; fg[0] += weight * *fg_ptr++; fg[1] += weight * *fg_ptr++; fg[2] += weight * *fg_ptr++; fg[3] += weight * *fg_ptr; if(--x_count == 0) break; x_hr += image_subpixel_scale; fg_ptr = (const value_type*)base_type::source().next_x(); } if(--y_count == 0) break; y_hr += image_subpixel_scale; fg_ptr = (const value_type*)base_type::source().next_y(); } fg[0] >>= image_filter_shift; fg[1] >>= image_filter_shift; fg[2] >>= image_filter_shift; fg[3] >>= image_filter_shift; if(fg[0] < 0) fg[0] = 0; if(fg[1] < 0) fg[1] = 0; if(fg[2] < 0) fg[2] = 0; if(fg[3] < 0) fg[3] = 0; if(fg[order_type::A] > base_mask) fg[order_type::A] = base_mask; if(fg[order_type::R] > fg[order_type::A]) fg[order_type::R] = fg[order_type::A]; if(fg[order_type::G] > fg[order_type::A]) fg[order_type::G] = fg[order_type::A]; if(fg[order_type::B] > fg[order_type::A]) fg[order_type::B] = fg[order_type::A]; span->r = (value_type)fg[order_type::R]; span->g = (value_type)fg[order_type::G]; span->b = (value_type)fg[order_type::B]; span->a = (value_type)fg[order_type::A]; ++span; ++base_type::interpolator(); } while(--len); } }; //========================================span_image_resample_rgba_affine template<class Source> class span_image_resample_rgba_affine : public span_image_resample_affine<Source> { public: typedef Source source_type; typedef typename source_type::color_type color_type; typedef typename source_type::order_type order_type; typedef span_image_resample_affine<source_type> base_type; typedef typename base_type::interpolator_type interpolator_type; typedef typename color_type::value_type value_type; typedef typename color_type::long_type long_type; enum base_scale_e { base_shift = color_type::base_shift, base_mask = color_type::base_mask, downscale_shift = image_filter_shift }; //-------------------------------------------------------------------- span_image_resample_rgba_affine() {} span_image_resample_rgba_affine(source_type& src, interpolator_type& inter, const image_filter_lut& filter) : base_type(src, inter, filter) {} //-------------------------------------------------------------------- void generate(color_type* span, int x, int y, unsigned len) { base_type::interpolator().begin(x + base_type::filter_dx_dbl(), y + base_type::filter_dy_dbl(), len); long_type fg[4]; int diameter = base_type::filter().diameter(); int filter_scale = diameter << image_subpixel_shift; int radius_x = (diameter * base_type::m_rx) >> 1; int radius_y = (diameter * base_type::m_ry) >> 1; int len_x_lr = (diameter * base_type::m_rx + image_subpixel_mask) >> image_subpixel_shift; const int16* weight_array = base_type::filter().weight_array(); do { base_type::interpolator().coordinates(&x, &y); x += base_type::filter_dx_int() - radius_x; y += base_type::filter_dy_int() - radius_y; fg[0] = fg[1] = fg[2] = fg[3] = image_filter_scale / 2; int y_lr = y >> image_subpixel_shift; 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 = x >> image_subpixel_shift; int x_hr = ((image_subpixel_mask - (x & image_subpixel_mask)) * base_type::m_rx_inv) >> image_subpixel_shift; int x_hr2 = x_hr; const value_type* fg_ptr = (const value_type*)base_type::source().span(x_lr, y_lr, len_x_lr); for(;;) { int weight_y = weight_array[y_hr]; x_hr = x_hr2; for(;;) { int weight = (weight_y * weight_array[x_hr] + image_filter_scale / 2) >> downscale_shift; fg[0] += *fg_ptr++ * weight; fg[1] += *fg_ptr++ * weight; fg[2] += *fg_ptr++ * weight; fg[3] += *fg_ptr++ * weight; total_weight += weight; x_hr += base_type::m_rx_inv; if(x_hr >= filter_scale) break; fg_ptr = (const value_type*)base_type::source().next_x(); } y_hr += base_type::m_ry_inv; if(y_hr >= filter_scale) break; fg_ptr = (const value_type*)base_type::source().next_y(); } fg[0] /= total_weight; fg[1] /= total_weight; fg[2] /= total_weight; fg[3] /= total_weight; if(fg[0] < 0) fg[0] = 0; if(fg[1] < 0) fg[1] = 0; if(fg[2] < 0) fg[2] = 0; if(fg[3] < 0) fg[3] = 0; if(fg[order_type::A] > base_mask) fg[order_type::A] = base_mask; if(fg[order_type::R] > fg[order_type::A]) fg[order_type::R] = fg[order_type::A]; if(fg[order_type::G] > fg[order_type::A]) fg[order_type::G] = fg[order_type::A]; if(fg[order_type::B] > fg[order_type::A]) fg[order_type::B] = fg[order_type::A]; span->r = (value_type)fg[order_type::R]; span->g = (value_type)fg[order_type::G]; span->b = (value_type)fg[order_type::B]; span->a = (value_type)fg[order_type::A]; ++span; ++base_type::interpolator(); } while(--len); } }; //==============================================span_image_resample_rgba template<class Source, class Interpolator> class span_image_resample_rgba : public span_image_resample<Source, Interpolator> { public: typedef Source source_type; typedef typename source_type::color_type color_type; typedef typename source_type::order_type order_type; typedef Interpolator interpolator_type; typedef span_image_resample<source_type, interpolator_type> base_type; typedef typename color_type::value_type value_type; typedef typename color_type::long_type long_type; enum base_scale_e { base_shift = color_type::base_shift, base_mask = color_type::base_mask, downscale_shift = image_filter_shift }; //-------------------------------------------------------------------- span_image_resample_rgba() {} span_image_resample_rgba(source_type& src, interpolator_type& inter, const image_filter_lut& filter) : base_type(src, inter, filter) {} //-------------------------------------------------------------------- void generate(color_type* span, int x, int y, unsigned len) { base_type::interpolator().begin(x + base_type::filter_dx_dbl(), y + base_type::filter_dy_dbl(), len); long_type fg[4]; int diameter = base_type::filter().diameter(); int filter_scale = diameter << image_subpixel_shift; const int16* weight_array = base_type::filter().weight_array(); do { int rx; int ry; int rx_inv = image_subpixel_scale; int ry_inv = image_subpixel_scale; base_type::interpolator().coordinates(&x, &y); base_type::interpolator().local_scale(&rx, &ry); base_type::adjust_scale(&rx, &ry); rx_inv = image_subpixel_scale * image_subpixel_scale / rx; ry_inv = image_subpixel_scale * image_subpixel_scale / ry; int radius_x = (diameter * rx) >> 1; int radius_y = (diameter * ry) >> 1; int len_x_lr = (diameter * rx + image_subpixel_mask) >> image_subpixel_shift; x += base_type::filter_dx_int() - radius_x; y += base_type::filter_dy_int() - radius_y; fg[0] = fg[1] = fg[2] = fg[3] = image_filter_scale / 2; int y_lr = y >> image_subpixel_shift; int y_hr = ((image_subpixel_mask - (y & image_subpixel_mask)) * ry_inv) >> image_subpixel_shift; int total_weight = 0; int x_lr = x >> image_subpixel_shift; int x_hr = ((image_subpixel_mask - (x & image_subpixel_mask)) * rx_inv) >> image_subpixel_shift; int x_hr2 = x_hr; const value_type* fg_ptr = (const value_type*)base_type::source().span(x_lr, y_lr, len_x_lr); for(;;) { int weight_y = weight_array[y_hr]; x_hr = x_hr2; for(;;) { int weight = (weight_y * weight_array[x_hr] + image_filter_scale / 2) >> downscale_shift; fg[0] += *fg_ptr++ * weight; fg[1] += *fg_ptr++ * weight; fg[2] += *fg_ptr++ * weight; fg[3] += *fg_ptr++ * weight; total_weight += weight; x_hr += rx_inv; if(x_hr >= filter_scale) break; fg_ptr = (const value_type*)base_type::source().next_x(); } y_hr += ry_inv; if(y_hr >= filter_scale) break; fg_ptr = (const value_type*)base_type::source().next_y(); } fg[0] /= total_weight; fg[1] /= total_weight; fg[2] /= total_weight; fg[3] /= total_weight; if(fg[0] < 0) fg[0] = 0; if(fg[1] < 0) fg[1] = 0; if(fg[2] < 0) fg[2] = 0; if(fg[3] < 0) fg[3] = 0; if(fg[order_type::A] > base_mask) fg[order_type::A] = base_mask; if(fg[order_type::R] > fg[order_type::R]) fg[order_type::R] = fg[order_type::R]; if(fg[order_type::G] > fg[order_type::G]) fg[order_type::G] = fg[order_type::G]; if(fg[order_type::B] > fg[order_type::B]) fg[order_type::B] = fg[order_type::B]; span->r = (value_type)fg[order_type::R]; span->g = (value_type)fg[order_type::G]; span->b = (value_type)fg[order_type::B]; span->a = (value_type)fg[order_type::A]; ++span; ++base_type::interpolator(); } while(--len); } }; } #endif �������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_span_interpolator_adaptor.h�����������������������������������������������0000644�0000000�0000000�00000005722�10703246330�023153� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_SPAN_INTERPOLATOR_ADAPTOR_INCLUDED #define AGG_SPAN_INTERPOLATOR_ADAPTOR_INCLUDED #include "agg_basics.h" namespace agg { //===============================================span_interpolator_adaptor template<class Interpolator, class Distortion> class span_interpolator_adaptor : public Interpolator { public: typedef Interpolator base_type; typedef typename base_type::trans_type trans_type; typedef Distortion distortion_type; //-------------------------------------------------------------------- span_interpolator_adaptor() {} span_interpolator_adaptor(const trans_type& trans, const distortion_type& dist) : base_type(trans), m_distortion(&dist) { } //-------------------------------------------------------------------- span_interpolator_adaptor(const trans_type& trans, const distortion_type& dist, double x, double y, unsigned len) : base_type(trans, x, y, len), m_distortion(&dist) { } //-------------------------------------------------------------------- const distortion_type& distortion() const { return *m_distortion; } //-------------------------------------------------------------------- void distortion(const distortion_type& dist) { m_distortion = dist; } //-------------------------------------------------------------------- void coordinates(int* x, int* y) const { base_type::coordinates(x, y); m_distortion->calculate(x, y); } private: //-------------------------------------------------------------------- const distortion_type* m_distortion; }; } #endif ����������������������������������������������agg-2.5+dfsg1/include/agg_span_interpolator_linear.h������������������������������������������������0000644�0000000�0000000�00000017432�10703246330�022774� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_SPAN_INTERPOLATOR_LINEAR_INCLUDED #define AGG_SPAN_INTERPOLATOR_LINEAR_INCLUDED #include "agg_basics.h" #include "agg_dda_line.h" #include "agg_trans_affine.h" namespace agg { //================================================span_interpolator_linear template<class Transformer = trans_affine, unsigned SubpixelShift = 8> class span_interpolator_linear { public: typedef Transformer trans_type; enum subpixel_scale_e { subpixel_shift = SubpixelShift, subpixel_scale = 1 << subpixel_shift }; //-------------------------------------------------------------------- span_interpolator_linear() {} span_interpolator_linear(const trans_type& trans) : m_trans(&trans) {} span_interpolator_linear(const trans_type& trans, double x, double y, unsigned len) : m_trans(&trans) { begin(x, y, len); } //---------------------------------------------------------------- const trans_type& transformer() const { return *m_trans; } void transformer(const trans_type& trans) { m_trans = &trans; } //---------------------------------------------------------------- void begin(double x, double y, unsigned len) { double tx; double ty; tx = x; ty = y; m_trans->transform(&tx, &ty); int x1 = iround(tx * subpixel_scale); int y1 = iround(ty * subpixel_scale); tx = x + len; ty = y; m_trans->transform(&tx, &ty); int x2 = iround(tx * subpixel_scale); int y2 = iround(ty * subpixel_scale); m_li_x = dda2_line_interpolator(x1, x2, len); m_li_y = dda2_line_interpolator(y1, y2, len); } //---------------------------------------------------------------- void resynchronize(double xe, double ye, unsigned len) { m_trans->transform(&xe, &ye); m_li_x = dda2_line_interpolator(m_li_x.y(), iround(xe * subpixel_scale), len); m_li_y = dda2_line_interpolator(m_li_y.y(), iround(ye * subpixel_scale), len); } //---------------------------------------------------------------- void operator++() { ++m_li_x; ++m_li_y; } //---------------------------------------------------------------- void coordinates(int* x, int* y) const { *x = m_li_x.y(); *y = m_li_y.y(); } private: const trans_type* m_trans; dda2_line_interpolator m_li_x; dda2_line_interpolator m_li_y; }; //=====================================span_interpolator_linear_subdiv template<class Transformer = trans_affine, unsigned SubpixelShift = 8> class span_interpolator_linear_subdiv { public: typedef Transformer trans_type; enum subpixel_scale_e { subpixel_shift = SubpixelShift, subpixel_scale = 1 << subpixel_shift }; //---------------------------------------------------------------- span_interpolator_linear_subdiv() : m_subdiv_shift(4), 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) : m_subdiv_shift(subdiv_shift), m_subdiv_size(1 << m_subdiv_shift), m_subdiv_mask(m_subdiv_size - 1), m_trans(&trans) {} span_interpolator_linear_subdiv(const trans_type& trans, double x, double y, unsigned len, unsigned subdiv_shift = 4) : m_subdiv_shift(subdiv_shift), m_subdiv_size(1 << m_subdiv_shift), m_subdiv_mask(m_subdiv_size - 1), m_trans(&trans) { begin(x, y, len); } //---------------------------------------------------------------- const trans_type& transformer() const { return *m_trans; } void transformer(const trans_type& trans) { m_trans = &trans; } //---------------------------------------------------------------- unsigned subdiv_shift() const { return m_subdiv_shift; } void subdiv_shift(unsigned shift) { m_subdiv_shift = shift; m_subdiv_size = 1 << m_subdiv_shift; m_subdiv_mask = m_subdiv_size - 1; } //---------------------------------------------------------------- void begin(double x, double y, unsigned len) { double tx; double ty; m_pos = 1; m_src_x = iround(x * subpixel_scale) + subpixel_scale; m_src_y = y; m_len = len; if(len > m_subdiv_size) len = m_subdiv_size; tx = x; ty = y; m_trans->transform(&tx, &ty); int x1 = iround(tx * subpixel_scale); int y1 = iround(ty * subpixel_scale); tx = x + len; ty = y; m_trans->transform(&tx, &ty); m_li_x = dda2_line_interpolator(x1, iround(tx * subpixel_scale), len); m_li_y = dda2_line_interpolator(y1, iround(ty * subpixel_scale), len); } //---------------------------------------------------------------- void operator++() { ++m_li_x; ++m_li_y; if(m_pos >= m_subdiv_size) { unsigned len = m_len; if(len > m_subdiv_size) len = m_subdiv_size; double tx = double(m_src_x) / double(subpixel_scale) + len; double ty = m_src_y; m_trans->transform(&tx, &ty); m_li_x = dda2_line_interpolator(m_li_x.y(), iround(tx * subpixel_scale), len); m_li_y = dda2_line_interpolator(m_li_y.y(), iround(ty * subpixel_scale), len); m_pos = 0; } m_src_x += subpixel_scale; ++m_pos; --m_len; } //---------------------------------------------------------------- void coordinates(int* x, int* y) const { *x = m_li_x.y(); *y = m_li_y.y(); } private: unsigned m_subdiv_shift; unsigned m_subdiv_size; unsigned m_subdiv_mask; const trans_type* m_trans; dda2_line_interpolator m_li_x; dda2_line_interpolator m_li_y; int m_src_x; double m_src_y; unsigned m_pos; unsigned m_len; }; } #endif ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_span_interpolator_persp.h�������������������������������������������������0000644�0000000�0000000�00000037247�10703246330�022661� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_SPAN_INTERPOLATOR_PERSP_INCLUDED #define AGG_SPAN_INTERPOLATOR_PERSP_INCLUDED #include "agg_trans_perspective.h" #include "agg_dda_line.h" namespace agg { //===========================================span_interpolator_persp_exact template<unsigned SubpixelShift = 8> class span_interpolator_persp_exact { public: typedef trans_perspective trans_type; typedef trans_perspective::iterator_x iterator_type; enum subpixel_scale_e { subpixel_shift = SubpixelShift, subpixel_scale = 1 << subpixel_shift }; //-------------------------------------------------------------------- span_interpolator_persp_exact() {} //-------------------------------------------------------------------- // Arbitrary quadrangle transformations 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, const double* quad) { rect_to_quad(x1, y1, x2, y2, quad); } //-------------------------------------------------------------------- // 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); } //-------------------------------------------------------------------- // Set the transformations using two arbitrary quadrangles. void quad_to_quad(const double* src, const double* dst) { m_trans_dir.quad_to_quad(src, dst); m_trans_inv.quad_to_quad(dst, src); } //-------------------------------------------------------------------- // Set the direct transformations, i.e., rectangle -> quadrangle void rect_to_quad(double x1, double y1, double x2, double y2, const double* quad) { double src[8]; src[0] = src[6] = x1; src[2] = src[4] = x2; src[1] = src[3] = y1; src[5] = src[7] = y2; quad_to_quad(src, quad); } //-------------------------------------------------------------------- // Set the reverse transformations, i.e., quadrangle -> rectangle void quad_to_rect(const double* quad, double x1, double y1, double x2, double y2) { double dst[8]; dst[0] = dst[6] = x1; dst[2] = dst[4] = x2; dst[1] = dst[3] = y1; dst[5] = dst[7] = y2; quad_to_quad(quad, dst); } //-------------------------------------------------------------------- // Check if the equations were solved successfully bool is_valid() const { return m_trans_dir.is_valid(); } //---------------------------------------------------------------- void begin(double x, double y, unsigned len) { m_iterator = m_trans_dir.begin(x, y, 1.0); double xt = m_iterator.x; double yt = m_iterator.y; double dx; double dy; const double delta = 1/double(subpixel_scale); dx = xt + delta; dy = yt; m_trans_inv.transform(&dx, &dy); dx -= x; dy -= y; int sx1 = uround(subpixel_scale/sqrt(dx*dx + dy*dy)) >> subpixel_shift; dx = xt; dy = yt + delta; m_trans_inv.transform(&dx, &dy); dx -= x; dy -= y; int sy1 = uround(subpixel_scale/sqrt(dx*dx + dy*dy)) >> subpixel_shift; x += len; xt = x; yt = y; m_trans_dir.transform(&xt, &yt); dx = xt + delta; dy = yt; m_trans_inv.transform(&dx, &dy); dx -= x; dy -= y; int sx2 = uround(subpixel_scale/sqrt(dx*dx + dy*dy)) >> subpixel_shift; dx = xt; dy = yt + delta; m_trans_inv.transform(&dx, &dy); dx -= x; dy -= y; int sy2 = uround(subpixel_scale/sqrt(dx*dx + dy*dy)) >> subpixel_shift; m_scale_x = dda2_line_interpolator(sx1, sx2, len); m_scale_y = dda2_line_interpolator(sy1, sy2, len); } //---------------------------------------------------------------- void resynchronize(double xe, double ye, unsigned len) { // 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 double xt = xe; double yt = ye; m_trans_dir.transform(&xt, &yt); const double delta = 1/double(subpixel_scale); double dx; double dy; // Calculate scale by X at x2,y2 dx = xt + delta; dy = yt; m_trans_inv.transform(&dx, &dy); dx -= xe; dy -= ye; int sx2 = uround(subpixel_scale/sqrt(dx*dx + dy*dy)) >> subpixel_shift; // Calculate scale by Y at x2,y2 dx = xt; dy = yt + delta; m_trans_inv.transform(&dx, &dy); dx -= xe; dy -= ye; int sy2 = uround(subpixel_scale/sqrt(dx*dx + dy*dy)) >> subpixel_shift; // Initialize the interpolators m_scale_x = dda2_line_interpolator(sx1, sx2, len); m_scale_y = dda2_line_interpolator(sy1, sy2, len); } //---------------------------------------------------------------- void operator++() { ++m_iterator; ++m_scale_x; ++m_scale_y; } //---------------------------------------------------------------- void coordinates(int* x, int* y) const { *x = iround(m_iterator.x * subpixel_scale); *y = iround(m_iterator.y * subpixel_scale); } //---------------------------------------------------------------- void local_scale(int* x, int* y) { *x = m_scale_x.y(); *y = m_scale_y.y(); } //---------------------------------------------------------------- void transform(double* x, double* y) const { m_trans_dir.transform(x, y); } private: trans_type m_trans_dir; trans_type m_trans_inv; iterator_type m_iterator; dda2_line_interpolator m_scale_x; dda2_line_interpolator m_scale_y; }; //============================================span_interpolator_persp_lerp template<unsigned SubpixelShift = 8> class span_interpolator_persp_lerp { public: typedef trans_perspective trans_type; enum subpixel_scale_e { subpixel_shift = SubpixelShift, subpixel_scale = 1 << subpixel_shift }; //-------------------------------------------------------------------- span_interpolator_persp_lerp() {} //-------------------------------------------------------------------- // Arbitrary quadrangle transformations 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, const double* quad) { rect_to_quad(x1, y1, x2, y2, quad); } //-------------------------------------------------------------------- // 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); } //-------------------------------------------------------------------- // Set the transformations using two arbitrary quadrangles. void quad_to_quad(const double* src, const double* dst) { m_trans_dir.quad_to_quad(src, dst); m_trans_inv.quad_to_quad(dst, src); } //-------------------------------------------------------------------- // Set the direct transformations, i.e., rectangle -> quadrangle void rect_to_quad(double x1, double y1, double x2, double y2, const double* quad) { double src[8]; src[0] = src[6] = x1; src[2] = src[4] = x2; src[1] = src[3] = y1; src[5] = src[7] = y2; quad_to_quad(src, quad); } //-------------------------------------------------------------------- // Set the reverse transformations, i.e., quadrangle -> rectangle void quad_to_rect(const double* quad, double x1, double y1, double x2, double y2) { double dst[8]; dst[0] = dst[6] = x1; dst[2] = dst[4] = x2; dst[1] = dst[3] = y1; dst[5] = dst[7] = y2; quad_to_quad(quad, dst); } //-------------------------------------------------------------------- // Check if the equations were solved successfully bool is_valid() const { return m_trans_dir.is_valid(); } //---------------------------------------------------------------- void begin(double x, double y, unsigned len) { // Calculate transformed coordinates at x1,y1 double xt = x; double yt = y; m_trans_dir.transform(&xt, &yt); int x1 = iround(xt * subpixel_scale); int y1 = iround(yt * subpixel_scale); double dx; double dy; const double delta = 1/double(subpixel_scale); // Calculate scale by X at x1,y1 dx = xt + delta; dy = yt; m_trans_inv.transform(&dx, &dy); dx -= x; dy -= y; int sx1 = uround(subpixel_scale/sqrt(dx*dx + dy*dy)) >> subpixel_shift; // Calculate scale by Y at x1,y1 dx = xt; dy = yt + delta; m_trans_inv.transform(&dx, &dy); dx -= x; dy -= y; int sy1 = uround(subpixel_scale/sqrt(dx*dx + dy*dy)) >> subpixel_shift; // Calculate transformed coordinates at x2,y2 x += len; xt = x; yt = y; m_trans_dir.transform(&xt, &yt); int x2 = iround(xt * subpixel_scale); int y2 = iround(yt * subpixel_scale); // Calculate scale by X at x2,y2 dx = xt + delta; dy = yt; m_trans_inv.transform(&dx, &dy); dx -= x; dy -= y; int sx2 = uround(subpixel_scale/sqrt(dx*dx + dy*dy)) >> subpixel_shift; // Calculate scale by Y at x2,y2 dx = xt; dy = yt + delta; m_trans_inv.transform(&dx, &dy); dx -= x; dy -= y; int sy2 = uround(subpixel_scale/sqrt(dx*dx + dy*dy)) >> subpixel_shift; // Initialize the interpolators m_coord_x = dda2_line_interpolator(x1, x2, len); m_coord_y = dda2_line_interpolator(y1, y2, len); m_scale_x = dda2_line_interpolator(sx1, sx2, len); m_scale_y = dda2_line_interpolator(sy1, sy2, len); } //---------------------------------------------------------------- void resynchronize(double xe, double ye, unsigned len) { // 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 double xt = xe; double yt = ye; m_trans_dir.transform(&xt, &yt); int x2 = iround(xt * subpixel_scale); int y2 = iround(yt * subpixel_scale); const double delta = 1/double(subpixel_scale); double dx; double dy; // Calculate scale by X at x2,y2 dx = xt + delta; dy = yt; m_trans_inv.transform(&dx, &dy); dx -= xe; dy -= ye; int sx2 = uround(subpixel_scale/sqrt(dx*dx + dy*dy)) >> subpixel_shift; // Calculate scale by Y at x2,y2 dx = xt; dy = yt + delta; m_trans_inv.transform(&dx, &dy); dx -= xe; dy -= ye; int sy2 = uround(subpixel_scale/sqrt(dx*dx + dy*dy)) >> subpixel_shift; // Initialize the interpolators m_coord_x = dda2_line_interpolator(x1, x2, len); m_coord_y = dda2_line_interpolator(y1, y2, len); m_scale_x = dda2_line_interpolator(sx1, sx2, len); m_scale_y = dda2_line_interpolator(sy1, sy2, len); } //---------------------------------------------------------------- void operator++() { ++m_coord_x; ++m_coord_y; ++m_scale_x; ++m_scale_y; } //---------------------------------------------------------------- void coordinates(int* x, int* y) const { *x = m_coord_x.y(); *y = m_coord_y.y(); } //---------------------------------------------------------------- void local_scale(int* x, int* y) { *x = m_scale_x.y(); *y = m_scale_y.y(); } //---------------------------------------------------------------- void transform(double* x, double* y) const { m_trans_dir.transform(x, y); } private: trans_type m_trans_dir; trans_type m_trans_inv; dda2_line_interpolator m_coord_x; dda2_line_interpolator m_coord_y; dda2_line_interpolator m_scale_x; dda2_line_interpolator m_scale_y; }; } #endif ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_span_interpolator_trans.h�������������������������������������������������0000644�0000000�0000000�00000006620�10703246330�022646� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- // // Horizontal span interpolator for use with an arbitrary transformer // The efficiency highly depends on the operations done in the transformer // //---------------------------------------------------------------------------- #ifndef AGG_SPAN_INTERPOLATOR_TRANS_INCLUDED #define AGG_SPAN_INTERPOLATOR_TRANS_INCLUDED #include "agg_basics.h" namespace agg { //=================================================span_interpolator_trans template<class Transformer, unsigned SubpixelShift = 8> class span_interpolator_trans { public: typedef Transformer trans_type; enum subpixel_scale_e { subpixel_shift = SubpixelShift, subpixel_scale = 1 << subpixel_shift }; //-------------------------------------------------------------------- span_interpolator_trans() {} span_interpolator_trans(const trans_type& trans) : m_trans(&trans) {} span_interpolator_trans(const trans_type& trans, double x, double y, unsigned) : m_trans(&trans) { begin(x, y, 0); } //---------------------------------------------------------------- const trans_type& transformer() const { return *m_trans; } void transformer(const trans_type& trans) { m_trans = &trans; } //---------------------------------------------------------------- void begin(double x, double y, unsigned) { m_x = x; m_y = y; m_trans->transform(&x, &y); m_ix = iround(x * subpixel_scale); m_iy = iround(y * subpixel_scale); } //---------------------------------------------------------------- void operator++() { m_x += 1.0; double x = m_x; double y = m_y; m_trans->transform(&x, &y); m_ix = iround(x * subpixel_scale); m_iy = iround(y * subpixel_scale); } //---------------------------------------------------------------- void coordinates(int* x, int* y) const { *x = m_ix; *y = m_iy; } private: const trans_type* m_trans; double m_x; double m_y; int m_ix; int m_iy; }; } #endif ����������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_span_pattern_gray.h�������������������������������������������������������0000644�0000000�0000000�00000007074�10703246330�021420� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- // // 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_PATTERN_GRAY_INCLUDED #define AGG_SPAN_PATTERN_GRAY_INCLUDED #include "agg_basics.h" namespace agg { //=======================================================span_pattern_gray template<class Source> class span_pattern_gray { public: typedef Source source_type; typedef typename source_type::color_type color_type; typedef typename color_type::value_type value_type; typedef typename color_type::calc_type calc_type; //-------------------------------------------------------------------- span_pattern_gray() {} span_pattern_gray(source_type& src, unsigned offset_x, unsigned offset_y) : m_src(&src), m_offset_x(offset_x), m_offset_y(offset_y), m_alpha(color_type::base_mask) {} //-------------------------------------------------------------------- void attach(source_type& v) { m_src = &v; } source_type& source() { return *m_src; } const source_type& source() const { return *m_src; } //-------------------------------------------------------------------- void offset_x(unsigned v) { m_offset_x = v; } void offset_y(unsigned v) { m_offset_y = v; } unsigned offset_x() const { return m_offset_x; } unsigned offset_y() const { return m_offset_y; } void alpha(value_type v) { m_alpha = v; } value_type alpha() const { return m_alpha; } //-------------------------------------------------------------------- void prepare() {} void generate(color_type* span, int x, int y, unsigned len) { x += m_offset_x; y += m_offset_y; const value_type* p = (const value_type*)m_src->span(x, y, len); do { span->v = *p; span->a = m_alpha; p = m_src->next_x(); ++span; } while(--len); } private: source_type* m_src; unsigned m_offset_x; unsigned m_offset_y; value_type m_alpha; }; } #endif ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_span_pattern_rgb.h��������������������������������������������������������0000644�0000000�0000000�00000007331�10703246330�021224� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- // // 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_PATTERN_RGB_INCLUDED #define AGG_SPAN_PATTERN_RGB_INCLUDED #include "agg_basics.h" namespace agg { //========================================================span_pattern_rgb template<class Source> class span_pattern_rgb { public: typedef Source source_type; typedef typename source_type::color_type color_type; typedef typename source_type::order_type order_type; typedef typename color_type::value_type value_type; typedef typename color_type::calc_type calc_type; //-------------------------------------------------------------------- span_pattern_rgb() {} span_pattern_rgb(source_type& src, unsigned offset_x, unsigned offset_y) : m_src(&src), m_offset_x(offset_x), m_offset_y(offset_y), m_alpha(color_type::base_mask) {} //-------------------------------------------------------------------- void attach(source_type& v) { m_src = &v; } source_type& source() { return *m_src; } const source_type& source() const { return *m_src; } //-------------------------------------------------------------------- void offset_x(unsigned v) { m_offset_x = v; } void offset_y(unsigned v) { m_offset_y = v; } unsigned offset_x() const { return m_offset_x; } unsigned offset_y() const { return m_offset_y; } void alpha(value_type v) { m_alpha = v; } value_type alpha() const { return m_alpha; } //-------------------------------------------------------------------- void prepare() {} void generate(color_type* span, int x, int y, unsigned len) { x += m_offset_x; y += m_offset_y; const value_type* p = (const value_type*)m_src->span(x, y, len); do { span->r = p[order_type::R]; span->g = p[order_type::G]; span->b = p[order_type::B]; span->a = m_alpha; p = m_src->next_x(); ++span; } while(--len); } private: source_type* m_src; unsigned m_offset_x; unsigned m_offset_y; value_type m_alpha; }; } #endif �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_span_pattern_rgba.h�������������������������������������������������������0000644�0000000�0000000�00000007232�10703246330�021365� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- // // 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_PATTERN_RGBA_INCLUDED #define AGG_SPAN_PATTERN_RGBA_INCLUDED #include "agg_basics.h" namespace agg { //======================================================span_pattern_rgba template<class Source> class span_pattern_rgba { public: typedef Source source_type; typedef typename source_type::color_type color_type; typedef typename source_type::order_type order_type; typedef typename color_type::value_type value_type; typedef typename color_type::calc_type calc_type; //-------------------------------------------------------------------- span_pattern_rgba() {} span_pattern_rgba(source_type& src, unsigned offset_x, unsigned offset_y) : m_src(&src), m_offset_x(offset_x), m_offset_y(offset_y) {} //-------------------------------------------------------------------- void attach(source_type& v) { m_src = &v; } source_type& source() { return *m_src; } const source_type& source() const { return *m_src; } //-------------------------------------------------------------------- void offset_x(unsigned v) { m_offset_x = v; } void offset_y(unsigned v) { m_offset_y = v; } unsigned offset_x() const { return m_offset_x; } unsigned offset_y() const { return m_offset_y; } void alpha(value_type) {} value_type alpha() const { return 0; } //-------------------------------------------------------------------- void prepare() {} void generate(color_type* span, int x, int y, unsigned len) { x += m_offset_x; y += m_offset_y; const value_type* p = (const value_type*)m_src->span(x, y, len); do { span->r = p[order_type::R]; span->g = p[order_type::G]; span->b = p[order_type::B]; span->a = p[order_type::A]; p = (const value_type*)m_src->next_x(); ++span; } while(--len); } private: source_type* m_src; unsigned m_offset_x; unsigned m_offset_y; }; } #endif ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_span_solid.h��������������������������������������������������������������0000644�0000000�0000000�00000003645�10703246330�020033� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_SPAN_SOLID_INCLUDED #define AGG_SPAN_SOLID_INCLUDED #include "agg_basics.h" namespace agg { //--------------------------------------------------------------span_solid template<class ColorT> class span_solid { public: typedef ColorT color_type; //-------------------------------------------------------------------- void color(const color_type& c) { m_color = c; } const color_type& color() const { return m_color; } //-------------------------------------------------------------------- void prepare() {} //-------------------------------------------------------------------- void generate(color_type* span, int x, int y, unsigned len) { do { *span++ = m_color; } while(--len); } private: color_type m_color; }; } #endif �������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_span_subdiv_adaptor.h�����������������������������������������������������0000644�0000000�0000000�00000012075�10703246330�021724� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_SPAN_SUBDIV_ADAPTOR_INCLUDED #define AGG_SPAN_SUBDIV_ADAPTOR_INCLUDED #include "agg_basics.h" namespace agg { //=================================================span_subdiv_adaptor template<class Interpolator, unsigned SubpixelShift = 8> class span_subdiv_adaptor { public: typedef Interpolator interpolator_type; typedef typename interpolator_type::trans_type trans_type; enum sublixel_scale_e { subpixel_shift = SubpixelShift, subpixel_scale = 1 << subpixel_shift }; //---------------------------------------------------------------- span_subdiv_adaptor() : m_subdiv_shift(4), m_subdiv_size(1 << m_subdiv_shift), m_subdiv_mask(m_subdiv_size - 1) {} 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, double x, double y, unsigned len, 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) { begin(x, y, len); } //---------------------------------------------------------------- const interpolator_type& interpolator() const { return *m_interpolator; } void interpolator(interpolator_type& intr) { m_interpolator = &intr; } //---------------------------------------------------------------- const trans_type& transformer() const { return *m_interpolator->transformer(); } void transformer(const trans_type& trans) { m_interpolator->transformer(trans); } //---------------------------------------------------------------- unsigned subdiv_shift() const { return m_subdiv_shift; } void subdiv_shift(unsigned shift) { m_subdiv_shift = shift; m_subdiv_size = 1 << m_subdiv_shift; m_subdiv_mask = m_subdiv_size - 1; } //---------------------------------------------------------------- void begin(double x, double y, unsigned len) { m_pos = 1; m_src_x = iround(x * subpixel_scale) + subpixel_scale; m_src_y = y; m_len = len; if(len > m_subdiv_size) len = m_subdiv_size; m_interpolator->begin(x, y, len); } //---------------------------------------------------------------- void operator++() { ++(*m_interpolator); if(m_pos >= m_subdiv_size) { unsigned len = m_len; if(len > m_subdiv_size) len = m_subdiv_size; m_interpolator->resynchronize(double(m_src_x) / double(subpixel_scale) + len, m_src_y, len); m_pos = 0; } m_src_x += subpixel_scale; ++m_pos; --m_len; } //---------------------------------------------------------------- void coordinates(int* x, int* y) const { m_interpolator->coordinates(x, y); } //---------------------------------------------------------------- void local_scale(int* x, int* y) const { m_interpolator->local_scale(x, y); } private: unsigned m_subdiv_shift; unsigned m_subdiv_size; unsigned m_subdiv_mask; interpolator_type* m_interpolator; int m_src_x; double m_src_y; unsigned m_pos; unsigned m_len; }; } #endif �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_trans_affine.h������������������������������������������������������������0000644�0000000�0000000�00000045177�10703246330�020345� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_TRANS_AFFINE_INCLUDED #define AGG_TRANS_AFFINE_INCLUDED #include <math.h> #include "agg_basics.h" namespace agg { const double affine_epsilon = 1e-14; //============================================================trans_affine // // 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. // // 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 // 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: // * 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, // and the advantage of matrix is that the sequence of discret calls: // 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 *= scaleX_matrix(2.0); // m *= scaleY_matrix(1.5); // m *= move_matrix(100,100); // // 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 // combination of transformations. // // So, how to use it? Very easy - literally as it's shown above. Not quite, // let us write a correct example: // // agg::trans_affine m; // m *= agg::trans_affine_rotation(30.0 * 3.1415926 / 180.0); // m *= agg::trans_affine_scaling(2.0, 1.5); // m *= agg::trans_affine_translation(100.0, 100.0); // 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 // 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) //---------------------------------------------------------------------- struct trans_affine { double sx, shy, shx, sy, tx, ty; //------------------------------------------ Construction // Identity matrix trans_affine() : sx(1.0), shy(0.0), shx(0.0), sy(1.0), tx(0.0), ty(0.0) {} // Custom matrix. Usually used in derived classes trans_affine(double v0, double v1, double v2, double v3, double v4, double v5) : sx(v0), shy(v1), shx(v2), sy(v3), tx(v4), ty(v5) {} // Custom matrix from m[6] explicit trans_affine(const double* m) : sx(m[0]), shy(m[1]), shx(m[2]), sy(m[3]), tx(m[4]), ty(m[5]) {} // Rectangle to a parallelogram. trans_affine(double x1, double y1, double x2, double y2, const double* parl) { rect_to_parl(x1, y1, x2, y2, parl); } // Parallelogram to a rectangle. trans_affine(const double* parl, double x1, double y1, double x2, double y2) { parl_to_rect(parl, x1, y1, x2, y2); } // Arbitrary parallelogram transformation. trans_affine(const double* src, const double* dst) { parl_to_parl(src, dst); } //---------------------------------- Parellelogram transformations // transform a parallelogram to another one. Src and dst are // pointers to arrays of three points (double[6], x1,y1,...) that // identify three corners of the parallelograms assuming implicit // fourth point. The arguments are arrays of double[6] mapped // to x1,y1, x2,y2, x3,y3 where the coordinates are: // *-----------------* // / (x3,y3)/ // / / // /(x1,y1) (x2,y2)/ // *-----------------* 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 double* parl); const trans_affine& parl_to_rect(const double* parl, double x1, double y1, double x2, double y2); //------------------------------------------ Operations // Reset - load an identity matrix const trans_affine& reset(); // Direct transformations operations const trans_affine& translate(double x, double y); const trans_affine& rotate(double a); const trans_affine& scale(double s); const trans_affine& scale(double x, double y); // Multiply matrix to another one const trans_affine& multiply(const trans_affine& m); // Multiply "m" to "this" and assign the result to "this" const trans_affine& premultiply(const trans_affine& m); // Multiply matrix to inverse of another one const trans_affine& multiply_inv(const trans_affine& m); // Multiply inverse of "m" to "this" and assign the result to "this" const trans_affine& premultiply_inv(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 // then try to invert matrix, expect unpredictable result. const trans_affine& invert(); // Mirroring around X const trans_affine& flip_x(); // Mirroring around Y const trans_affine& flip_y(); //------------------------------------------- Load/Store // Store matrix to an array [6] of double void store_to(double* m) const { *m++ = sx; *m++ = shy; *m++ = shx; *m++ = sy; *m++ = tx; *m++ = ty; } // Load matrix from an array [6] of double const trans_affine& load_from(const double* m) { sx = *m++; shy = *m++; shx = *m++; sy = *m++; tx = *m++; ty = *m++; return *this; } //------------------------------------------- Operators // Multiply the matrix by another one const trans_affine& operator *= (const trans_affine& m) { return multiply(m); } // Multiply the matrix by inverse of another one const trans_affine& operator /= (const trans_affine& m) { return multiply_inv(m); } // Multiply the matrix by another one and return // the result in a separete matrix. trans_affine operator * (const trans_affine& m) { return trans_affine(*this).multiply(m); } // Multiply the matrix by inverse of another one // and return the result in a separete matrix. trans_affine operator / (const trans_affine& m) { return trans_affine(*this).multiply_inv(m); } // Calculate and return the inverse matrix trans_affine operator ~ () const { trans_affine ret = *this; return ret.invert(); } // Equal operator with default epsilon bool operator == (const trans_affine& m) const { return is_equal(m, affine_epsilon); } // Not Equal operator with default epsilon bool operator != (const trans_affine& m) const { return !is_equal(m, affine_epsilon); } //-------------------------------------------- Transformations // Direct transformation of x and y void transform(double* x, double* y) const; // Direct transformation of x and y, 2x2 matrix only, no translation void transform_2x2(double* x, double* y) const; // Inverse transformation of x and y. It works slower than the // direct transformation. For massive operations it's better to // invert() the matrix and then use direct transformations. void inverse_transform(double* x, double* y) const; //-------------------------------------------- Auxiliary // Calculate the determinant of matrix double determinant() const { return sx * sy - shy * shx; } // Calculate the reciprocal of the determinant double determinant_reciprocal() const { return 1.0 / (sx * sy - shy * shx); } // Get the average scale (by X and Y). // Basically used to calculate the approximation_scale when // decomposinting curves into line segments. double scale() const; // Check to see if the matrix is not degenerate bool is_valid(double epsilon = affine_epsilon) const; // Check to see if it's an identity matrix bool is_identity(double epsilon = affine_epsilon) const; // Check to see if two matrices are equal bool is_equal(const trans_affine& m, double epsilon = affine_epsilon) const; // Determine the major parameters. Use with caution considering // possible degenerate cases. double rotation() const; void translation(double* dx, double* dy) const; void scaling(double* x, double* y) const; void scaling_abs(double* x, double* y) const; }; //------------------------------------------------------------------------ inline void trans_affine::transform(double* x, double* y) const { register double tmp = *x; *x = tmp * sx + *y * shx + tx; *y = tmp * shy + *y * sy + ty; } //------------------------------------------------------------------------ inline void trans_affine::transform_2x2(double* x, double* y) const { register double tmp = *x; *x = tmp * sx + *y * shx; *y = tmp * shy + *y * sy; } //------------------------------------------------------------------------ inline void trans_affine::inverse_transform(double* x, double* y) const { register double d = determinant_reciprocal(); register double a = (*x - tx) * d; register double b = (*y - ty) * d; *x = a * sy - b * shx; *y = b * sx - a * shy; } //------------------------------------------------------------------------ inline double trans_affine::scale() const { double x = 0.707106781 * sx + 0.707106781 * shx; double y = 0.707106781 * shy + 0.707106781 * sy; return sqrt(x*x + y*y); } //------------------------------------------------------------------------ inline const trans_affine& trans_affine::translate(double x, double y) { tx += x; ty += y; return *this; } //------------------------------------------------------------------------ inline const trans_affine& trans_affine::rotate(double a) { double ca = cos(a); double sa = sin(a); double t0 = sx * ca - shy * sa; double t2 = shx * ca - sy * sa; double t4 = tx * ca - ty * sa; shy = sx * sa + shy * ca; sy = shx * sa + sy * ca; ty = tx * sa + ty * ca; sx = t0; shx = t2; tx = t4; return *this; } //------------------------------------------------------------------------ inline const trans_affine& trans_affine::scale(double x, double y) { double mm0 = x; // Possible hint for the optimizer double mm3 = y; sx *= mm0; shx *= mm0; tx *= mm0; shy *= mm3; sy *= mm3; ty *= mm3; return *this; } //------------------------------------------------------------------------ inline const trans_affine& trans_affine::scale(double s) { double m = s; // Possible hint for the optimizer sx *= m; shx *= m; tx *= m; shy *= m; sy *= m; ty *= m; return *this; } //------------------------------------------------------------------------ inline const trans_affine& trans_affine::premultiply(const trans_affine& m) { trans_affine t = m; return *this = t.multiply(*this); } //------------------------------------------------------------------------ inline const trans_affine& trans_affine::multiply_inv(const trans_affine& m) { trans_affine t = m; t.invert(); return multiply(t); } //------------------------------------------------------------------------ inline const trans_affine& trans_affine::premultiply_inv(const trans_affine& m) { trans_affine t = m; t.invert(); return *this = t.multiply(*this); } //------------------------------------------------------------------------ inline void trans_affine::scaling_abs(double* x, double* y) const { // Used to calculate scaling coefficients in image resampling. // When there is considerable shear this method gives us much // better estimation than just sx, sy. *x = sqrt(sx * sx + shx * shx); *y = sqrt(shy * shy + sy * sy); } //====================================================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 // often. class trans_affine_rotation : public trans_affine { public: trans_affine_rotation(double a) : trans_affine(cos(a), sin(a), -sin(a), cos(a), 0.0, 0.0) {} }; //====================================================trans_affine_scaling // Scaling matrix. x, y - scale coefficients by X and Y respectively class trans_affine_scaling : public trans_affine { public: trans_affine_scaling(double x, double y) : trans_affine(x, 0.0, 0.0, y, 0.0, 0.0) {} trans_affine_scaling(double s) : trans_affine(s, 0.0, 0.0, s, 0.0, 0.0) {} }; //================================================trans_affine_translation // Translation matrix class trans_affine_translation : public trans_affine { public: trans_affine_translation(double x, double y) : trans_affine(1.0, 0.0, 0.0, 1.0, x, y) {} }; //====================================================trans_affine_skewing // Sckewing (shear) matrix class trans_affine_skewing : public trans_affine { public: trans_affine_skewing(double x, double y) : trans_affine(1.0, tan(y), tan(x), 1.0, 0.0, 0.0) {} }; //===============================================trans_affine_line_segment // Rotate, Scale and Translate, associating 0...dist with line segment // x1,y1,x2,y2 class trans_affine_line_segment : public trans_affine { public: trans_affine_line_segment(double x1, double y1, double x2, double y2, double dist) { double dx = x2 - x1; double dy = y2 - y1; if(dist > 0.0) { multiply(trans_affine_scaling(sqrt(dx * dx + dy * dy) / dist)); } multiply(trans_affine_rotation(atan2(dy, dx))); multiply(trans_affine_translation(x1, y1)); } }; //============================================trans_affine_reflection_unit // Reflection matrix. Reflect coordinates across the line through // the origin containing the unit vector (ux, uy). // Contributed by John Horigan class trans_affine_reflection_unit : public trans_affine { public: trans_affine_reflection_unit(double ux, double uy) : trans_affine(2.0 * ux * ux - 1.0, 2.0 * ux * uy, 2.0 * ux * uy, 2.0 * uy * uy - 1.0, 0.0, 0.0) {} }; //=================================================trans_affine_reflection // Reflection matrix. Reflect coordinates across the line through // the origin at the angle a or containing the non-unit vector (x, y). // Contributed by John Horigan class trans_affine_reflection : public trans_affine_reflection_unit { public: trans_affine_reflection(double a) : trans_affine_reflection_unit(cos(a), sin(a)) {} trans_affine_reflection(double x, double y) : trans_affine_reflection_unit(x / sqrt(x * x + y * y), y / sqrt(x * x + y * y)) {} }; } #endif �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_trans_bilinear.h����������������������������������������������������������0000644�0000000�0000000�00000013067�10703246330�020673� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_TRANS_BILINEAR_INCLUDED #define AGG_TRANS_BILINEAR_INCLUDED #include "agg_basics.h" #include "agg_simul_eq.h" namespace agg { //==========================================================trans_bilinear class trans_bilinear { public: //-------------------------------------------------------------------- trans_bilinear() : m_valid(false) {} //-------------------------------------------------------------------- // Arbitrary quadrangle transformations 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, const double* quad) { rect_to_quad(x1, y1, x2, y2, quad); } //-------------------------------------------------------------------- // Reverse transformations trans_bilinear(const double* quad, double x1, double y1, double x2, double y2) { quad_to_rect(quad, x1, y1, x2, y2); } //-------------------------------------------------------------------- // Set the transformations using two arbitrary quadrangles. void quad_to_quad(const double* src, const double* dst) { double left[4][4]; double right[4][2]; unsigned i; for(i = 0; i < 4; i++) { unsigned ix = i * 2; unsigned iy = ix + 1; left[i][0] = 1.0; left[i][1] = src[ix] * src[iy]; left[i][2] = src[ix]; left[i][3] = src[iy]; right[i][0] = dst[ix]; right[i][1] = dst[iy]; } m_valid = simul_eq<4, 2>::solve(left, right, m_mtx); } //-------------------------------------------------------------------- // Set the direct transformations, i.e., rectangle -> quadrangle void rect_to_quad(double x1, double y1, double x2, double y2, const double* quad) { double src[8]; src[0] = src[6] = x1; src[2] = src[4] = x2; src[1] = src[3] = y1; src[5] = src[7] = y2; quad_to_quad(src, quad); } //-------------------------------------------------------------------- // Set the reverse transformations, i.e., quadrangle -> rectangle void quad_to_rect(const double* quad, double x1, double y1, double x2, double y2) { double dst[8]; dst[0] = dst[6] = x1; dst[2] = dst[4] = x2; dst[1] = dst[3] = y1; dst[5] = dst[7] = y2; quad_to_quad(quad, dst); } //-------------------------------------------------------------------- // Check if the equations were solved successfully bool is_valid() const { return m_valid; } //-------------------------------------------------------------------- // Transform a point (x, y) void transform(double* x, double* y) const { double tx = *x; double ty = *y; double xy = tx * ty; *x = m_mtx[0][0] + m_mtx[1][0] * xy + m_mtx[2][0] * tx + m_mtx[3][0] * ty; *y = m_mtx[0][1] + m_mtx[1][1] * xy + m_mtx[2][1] * tx + m_mtx[3][1] * ty; } //-------------------------------------------------------------------- class iterator_x { double inc_x; double inc_y; public: double x; double y; iterator_x() {} iterator_x(double tx, double ty, double step, const double m[4][2]) : inc_x(m[1][0] * step * ty + m[2][0] * step), inc_y(m[1][1] * step * ty + m[2][1] * step), x(m[0][0] + m[1][0] * tx * ty + m[2][0] * tx + m[3][0] * ty), y(m[0][1] + m[1][1] * tx * ty + m[2][1] * tx + m[3][1] * ty) { } void operator ++ () { x += inc_x; y += inc_y; } }; iterator_x begin(double x, double y, double step) const { return iterator_x(x, y, step, m_mtx); } private: double m_mtx[4][2]; bool m_valid; }; } #endif �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_trans_double_path.h�������������������������������������������������������0000644�0000000�0000000�00000010703�10703246330�021366� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_TRANS_DOUBLE_PATH_INCLUDED #define AGG_TRANS_DOUBLE_PATH_INCLUDED #include "agg_basics.h" #include "agg_vertex_sequence.h" namespace agg { // See also: agg_trans_double_path.cpp // //-------------------------------------------------------trans_double_path class trans_double_path { enum status_e { initial, making_path, ready }; public: typedef vertex_sequence<vertex_dist, 6> vertex_storage; trans_double_path(); //-------------------------------------------------------------------- void base_length(double v) { m_base_length = v; } double base_length() const { return m_base_length; } //-------------------------------------------------------------------- void base_height(double v) { m_base_height = v; } double base_height() const { return m_base_height; } //-------------------------------------------------------------------- void preserve_x_scale(bool f) { m_preserve_x_scale = f; } bool preserve_x_scale() const { return m_preserve_x_scale; } //-------------------------------------------------------------------- void reset(); void move_to1(double x, double y); void line_to1(double x, double y); void move_to2(double x, double y); void line_to2(double x, double y); void finalize_paths(); //-------------------------------------------------------------------- template<class VertexSource1, class VertexSource2> void add_paths(VertexSource1& vs1, VertexSource2& vs2, unsigned path1_id=0, unsigned path2_id=0) { double x; double y; unsigned cmd; vs1.rewind(path1_id); while(!is_stop(cmd = vs1.vertex(&x, &y))) { if(is_move_to(cmd)) { move_to1(x, y); } else { if(is_vertex(cmd)) { line_to1(x, y); } } } vs2.rewind(path2_id); while(!is_stop(cmd = vs2.vertex(&x, &y))) { if(is_move_to(cmd)) { move_to2(x, y); } else { if(is_vertex(cmd)) { line_to2(x, y); } } } finalize_paths(); } //-------------------------------------------------------------------- double total_length1() const; double total_length2() const; void transform(double *x, double *y) const; private: double finalize_path(vertex_storage& vertices); void transform1(const vertex_storage& vertices, double kindex, double kx, double *x, double* y) const; vertex_storage m_src_vertices1; vertex_storage m_src_vertices2; double m_base_length; double m_base_height; double m_kindex1; double m_kindex2; status_e m_status1; status_e m_status2; bool m_preserve_x_scale; }; } #endif �������������������������������������������������������������agg-2.5+dfsg1/include/agg_trans_perspective.h�������������������������������������������������������0000644�0000000�0000000�00000062171�10703246330�021437� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_TRANS_PERSPECTIVE_INCLUDED #define AGG_TRANS_PERSPECTIVE_INCLUDED #include "agg_trans_affine.h" namespace agg { //=======================================================trans_perspective struct trans_perspective { double sx, shy, w0, shx, sy, w1, tx, ty, w2; //------------------------------------------------------- Construction // Identity matrix trans_perspective() : sx (1), shy(0), w0(0), shx(0), sy (1), w1(0), tx (0), ty (0), w2(1) {} // Custom matrix trans_perspective(double v0, double v1, double v2, double v3, double v4, double v5, double v6, double v7, double v8) : sx (v0), shy(v1), w0(v2), shx(v3), sy (v4), w1(v5), tx (v6), ty (v7), w2(v8) {} // Custom matrix from m[9] explicit trans_perspective(const double* m) : sx (m[0]), shy(m[1]), w0(m[2]), shx(m[3]), sy (m[4]), w1(m[5]), tx (m[6]), ty (m[7]), w2(m[8]) {} // From affine explicit trans_perspective(const trans_affine& a) : sx (a.sx ), shy(a.shy), w0(0), shx(a.shx), sy (a.sy ), w1(0), tx (a.tx ), ty (a.ty ), w2(1) {} // Rectangle to quadrilateral trans_perspective(double x1, double y1, double x2, double y2, const double* quad); // Quadrilateral to rectangle trans_perspective(const double* quad, double x1, double y1, double x2, double y2); // Arbitrary quadrilateral transformations trans_perspective(const double* src, const double* dst); //-------------------------------------- Quadrilateral transformations // The arguments are double[8] that are mapped to quadrilaterals: // x1,y1, x2,y2, x3,y3, x4,y4 bool quad_to_quad(const double* qs, const double* qd); bool rect_to_quad(double x1, double y1, double x2, double y2, const double* q); bool quad_to_rect(const double* q, double x1, double y1, double x2, double y2); // Map square (0,0,1,1) to the quadrilateral and vice versa bool square_to_quad(const double* q); bool quad_to_square(const double* q); //--------------------------------------------------------- Operations // Reset - load an identity matrix const trans_perspective& reset(); // Invert matrix. Returns false in degenerate case bool invert(); // Direct transformations operations const trans_perspective& translate(double x, double y); const trans_perspective& rotate(double a); const trans_perspective& scale(double s); const trans_perspective& scale(double x, double y); // Multiply the matrix by another one const trans_perspective& multiply(const trans_perspective& m); // Multiply "m" by "this" and assign the result to "this" const trans_perspective& premultiply(const trans_perspective& m); // Multiply matrix to inverse of another one const trans_perspective& multiply_inv(const trans_perspective& m); // Multiply inverse of "m" by "this" and assign the result to "this" const trans_perspective& premultiply_inv(const trans_perspective& m); // Multiply the matrix by another one const trans_perspective& multiply(const trans_affine& m); // Multiply "m" by "this" and assign the result to "this" const trans_perspective& premultiply(const trans_affine& m); // Multiply the matrix by inverse of another one const trans_perspective& multiply_inv(const trans_affine& m); // Multiply inverse of "m" by "this" and assign the result to "this" const trans_perspective& premultiply_inv(const trans_affine& m); //--------------------------------------------------------- Load/Store void store_to(double* m) const; const trans_perspective& load_from(const double* m); //---------------------------------------------------------- Operators // Multiply the matrix by another one const trans_perspective& operator *= (const trans_perspective& m) { return multiply(m); } const trans_perspective& operator *= (const trans_affine& m) { return multiply(m); } // Multiply the matrix by inverse of another one const trans_perspective& operator /= (const trans_perspective& m) { return multiply_inv(m); } const trans_perspective& operator /= (const trans_affine& m) { return multiply_inv(m); } // Multiply the matrix by another one and return // the result in a separete matrix. trans_perspective operator * (const trans_perspective& m) { return trans_perspective(*this).multiply(m); } trans_perspective operator * (const trans_affine& m) { return trans_perspective(*this).multiply(m); } // Multiply the matrix by inverse of another one // and return the result in a separete matrix. trans_perspective operator / (const trans_perspective& m) { return trans_perspective(*this).multiply_inv(m); } trans_perspective operator / (const trans_affine& m) { return trans_perspective(*this).multiply_inv(m); } // Calculate and return the inverse matrix trans_perspective operator ~ () const { trans_perspective ret = *this; ret.invert(); return ret; } // Equal operator with default epsilon bool operator == (const trans_perspective& m) const { return is_equal(m, affine_epsilon); } // Not Equal operator with default epsilon bool operator != (const trans_perspective& m) const { return !is_equal(m, affine_epsilon); } //---------------------------------------------------- Transformations // Direct transformation of x and y void transform(double* x, double* y) const; // Direct transformation of x and y, affine part only void transform_affine(double* x, double* y) const; // Direct transformation of x and y, 2x2 matrix only, no translation void transform_2x2(double* x, double* y) const; // Inverse transformation of x and y. It works slow because // it explicitly inverts the matrix on every call. For massive // operations it's better to invert() the matrix and then use // direct transformations. void inverse_transform(double* x, double* y) const; //---------------------------------------------------------- Auxiliary const trans_perspective& from_affine(const trans_affine& a); double determinant() const; double determinant_reciprocal() const; bool is_valid(double epsilon = affine_epsilon) const; bool is_identity(double epsilon = affine_epsilon) const; bool is_equal(const trans_perspective& m, double epsilon = affine_epsilon) const; // Determine the major affine parameters. Use with caution // considering possible degenerate cases. double scale() const; double rotation() const; void translation(double* dx, double* dy) const; void scaling(double* x, double* y) const; void scaling_abs(double* x, double* y) const; //-------------------------------------------------------------------- class iterator_x { double den; double den_step; double nom_x; double nom_x_step; double nom_y; double nom_y_step; public: double x; double y; iterator_x() {} iterator_x(double px, double py, double step, const trans_perspective& m) : den(px * m.w0 + py * m.w1 + m.w2), den_step(m.w0 * step), nom_x(px * m.sx + py * m.shx + m.tx), nom_x_step(step * m.sx), nom_y(px * m.shy + py * m.sy + m.ty), nom_y_step(step * m.shy), x(nom_x / den), y(nom_y / den) {} void operator ++ () { den += den_step; nom_x += nom_x_step; nom_y += nom_y_step; double d = 1.0 / den; x = nom_x * d; y = nom_y * d; } }; //-------------------------------------------------------------------- iterator_x begin(double x, double y, double step) const { return iterator_x(x, y, step, *this); } }; //------------------------------------------------------------------------ inline bool trans_perspective::square_to_quad(const double* q) { double dx = q[0] - q[2] + q[4] - q[6]; double dy = q[1] - q[3] + q[5] - q[7]; if(dx == 0.0 && dy == 0.0) { // Affine case (parallelogram) //--------------- sx = q[2] - q[0]; shy = q[3] - q[1]; w0 = 0.0; shx = q[4] - q[2]; sy = q[5] - q[3]; w1 = 0.0; tx = q[0]; ty = q[1]; w2 = 1.0; } else { double dx1 = q[2] - q[4]; double dy1 = q[3] - q[5]; double dx2 = q[6] - q[4]; double dy2 = q[7] - q[5]; double den = dx1 * dy2 - dx2 * dy1; if(den == 0.0) { // Singular case //--------------- sx = shy = w0 = shx = sy = w1 = tx = ty = w2 = 0.0; return false; } // General case //--------------- double u = (dx * dy2 - dy * dx2) / den; double v = (dy * dx1 - dx * dy1) / den; sx = q[2] - q[0] + u * q[2]; shy = q[3] - q[1] + u * q[3]; w0 = u; shx = q[6] - q[0] + v * q[6]; sy = q[7] - q[1] + v * q[7]; w1 = v; tx = q[0]; ty = q[1]; w2 = 1.0; } return true; } //------------------------------------------------------------------------ inline bool trans_perspective::invert() { double d0 = sy * w2 - w1 * ty; double d1 = w0 * ty - shy * w2; double d2 = shy * w1 - w0 * sy; double d = sx * d0 + shx * d1 + tx * d2; if(d == 0.0) { sx = shy = w0 = shx = sy = w1 = tx = ty = w2 = 0.0; return false; } d = 1.0 / d; trans_perspective a = *this; sx = d * d0; shy = d * d1; w0 = d * d2; shx = d * (a.w1 *a.tx - a.shx*a.w2); sy = d * (a.sx *a.w2 - a.w0 *a.tx); w1 = d * (a.w0 *a.shx - a.sx *a.w1); tx = d * (a.shx*a.ty - a.sy *a.tx); ty = d * (a.shy*a.tx - a.sx *a.ty); w2 = d * (a.sx *a.sy - a.shy*a.shx); return true; } //------------------------------------------------------------------------ inline bool trans_perspective::quad_to_square(const double* q) { if(!square_to_quad(q)) return false; invert(); return true; } //------------------------------------------------------------------------ inline bool trans_perspective::quad_to_quad(const double* qs, const double* qd) { trans_perspective p; if(! quad_to_square(qs)) return false; if(!p.square_to_quad(qd)) return false; multiply(p); return true; } //------------------------------------------------------------------------ inline bool trans_perspective::rect_to_quad(double x1, double y1, double x2, double y2, const double* q) { double r[8]; r[0] = r[6] = x1; r[2] = r[4] = x2; r[1] = r[3] = y1; r[5] = r[7] = y2; return quad_to_quad(r, q); } //------------------------------------------------------------------------ inline bool trans_perspective::quad_to_rect(const double* q, double x1, double y1, double x2, double y2) { double r[8]; r[0] = r[6] = x1; r[2] = r[4] = x2; r[1] = r[3] = y1; r[5] = r[7] = y2; return quad_to_quad(q, r); } //------------------------------------------------------------------------ inline trans_perspective::trans_perspective(double x1, double y1, double x2, double y2, const double* quad) { rect_to_quad(x1, y1, x2, y2, quad); } //------------------------------------------------------------------------ inline trans_perspective::trans_perspective(const double* quad, double x1, double y1, double x2, double y2) { quad_to_rect(quad, x1, y1, x2, y2); } //------------------------------------------------------------------------ inline trans_perspective::trans_perspective(const double* src, const double* dst) { quad_to_quad(src, dst); } //------------------------------------------------------------------------ inline const trans_perspective& trans_perspective::reset() { sx = 1; shy = 0; w0 = 0; shx = 0; sy = 1; w1 = 0; tx = 0; ty = 0; w2 = 1; return *this; } //------------------------------------------------------------------------ inline const trans_perspective& trans_perspective::multiply(const trans_perspective& a) { trans_perspective b = *this; sx = a.sx *b.sx + a.shx*b.shy + a.tx*b.w0; shx = a.sx *b.shx + a.shx*b.sy + a.tx*b.w1; tx = a.sx *b.tx + a.shx*b.ty + a.tx*b.w2; shy = a.shy*b.sx + a.sy *b.shy + a.ty*b.w0; sy = a.shy*b.shx + a.sy *b.sy + a.ty*b.w1; ty = a.shy*b.tx + a.sy *b.ty + a.ty*b.w2; w0 = a.w0 *b.sx + a.w1 *b.shy + a.w2*b.w0; w1 = a.w0 *b.shx + a.w1 *b.sy + a.w2*b.w1; w2 = a.w0 *b.tx + a.w1 *b.ty + a.w2*b.w2; return *this; } //------------------------------------------------------------------------ inline const trans_perspective& trans_perspective::multiply(const trans_affine& a) { trans_perspective b = *this; sx = a.sx *b.sx + a.shx*b.shy + a.tx*b.w0; shx = a.sx *b.shx + a.shx*b.sy + a.tx*b.w1; tx = a.sx *b.tx + a.shx*b.ty + a.tx*b.w2; shy = a.shy*b.sx + a.sy *b.shy + a.ty*b.w0; sy = a.shy*b.shx + a.sy *b.sy + a.ty*b.w1; ty = a.shy*b.tx + a.sy *b.ty + a.ty*b.w2; return *this; } //------------------------------------------------------------------------ inline const trans_perspective& trans_perspective::premultiply(const trans_perspective& b) { trans_perspective a = *this; sx = a.sx *b.sx + a.shx*b.shy + a.tx*b.w0; shx = a.sx *b.shx + a.shx*b.sy + a.tx*b.w1; tx = a.sx *b.tx + a.shx*b.ty + a.tx*b.w2; shy = a.shy*b.sx + a.sy *b.shy + a.ty*b.w0; sy = a.shy*b.shx + a.sy *b.sy + a.ty*b.w1; ty = a.shy*b.tx + a.sy *b.ty + a.ty*b.w2; w0 = a.w0 *b.sx + a.w1 *b.shy + a.w2*b.w0; w1 = a.w0 *b.shx + a.w1 *b.sy + a.w2*b.w1; w2 = a.w0 *b.tx + a.w1 *b.ty + a.w2*b.w2; return *this; } //------------------------------------------------------------------------ inline const trans_perspective& trans_perspective::premultiply(const trans_affine& b) { trans_perspective a = *this; sx = a.sx *b.sx + a.shx*b.shy; shx = a.sx *b.shx + a.shx*b.sy; tx = a.sx *b.tx + a.shx*b.ty + a.tx; shy = a.shy*b.sx + a.sy *b.shy; sy = a.shy*b.shx + a.sy *b.sy; ty = a.shy*b.tx + a.sy *b.ty + a.ty; w0 = a.w0 *b.sx + a.w1 *b.shy; w1 = a.w0 *b.shx + a.w1 *b.sy; w2 = a.w0 *b.tx + a.w1 *b.ty + a.w2; return *this; } //------------------------------------------------------------------------ const trans_perspective& trans_perspective::multiply_inv(const trans_perspective& m) { trans_perspective t = m; t.invert(); return multiply(t); } //------------------------------------------------------------------------ const trans_perspective& trans_perspective::multiply_inv(const trans_affine& m) { trans_affine t = m; t.invert(); return multiply(t); } //------------------------------------------------------------------------ const trans_perspective& trans_perspective::premultiply_inv(const trans_perspective& m) { trans_perspective t = m; t.invert(); return *this = t.multiply(*this); } //------------------------------------------------------------------------ const trans_perspective& trans_perspective::premultiply_inv(const trans_affine& m) { trans_perspective t(m); t.invert(); return *this = t.multiply(*this); } //------------------------------------------------------------------------ inline const trans_perspective& trans_perspective::translate(double x, double y) { tx += x; ty += y; return *this; } //------------------------------------------------------------------------ inline const trans_perspective& trans_perspective::rotate(double a) { multiply(trans_affine_rotation(a)); return *this; } //------------------------------------------------------------------------ inline const trans_perspective& trans_perspective::scale(double s) { multiply(trans_affine_scaling(s)); return *this; } //------------------------------------------------------------------------ inline const trans_perspective& trans_perspective::scale(double x, double y) { multiply(trans_affine_scaling(x, y)); return *this; } //------------------------------------------------------------------------ inline void trans_perspective::transform(double* px, double* py) const { double x = *px; double y = *py; double m = 1.0 / (x*w0 + y*w1 + w2); *px = m * (x*sx + y*shx + tx); *py = m * (x*shy + y*sy + ty); } //------------------------------------------------------------------------ inline void trans_perspective::transform_affine(double* x, double* y) const { double tmp = *x; *x = tmp * sx + *y * shx + tx; *y = tmp * shy + *y * sy + ty; } //------------------------------------------------------------------------ inline void trans_perspective::transform_2x2(double* x, double* y) const { double tmp = *x; *x = tmp * sx + *y * shx; *y = tmp * shy + *y * sy; } //------------------------------------------------------------------------ inline void trans_perspective::inverse_transform(double* x, double* y) const { trans_perspective t(*this); if(t.invert()) t.transform(x, y); } //------------------------------------------------------------------------ inline void trans_perspective::store_to(double* m) const { *m++ = sx; *m++ = shy; *m++ = w0; *m++ = shx; *m++ = sy; *m++ = w1; *m++ = tx; *m++ = ty; *m++ = w2; } //------------------------------------------------------------------------ inline const trans_perspective& trans_perspective::load_from(const double* m) { sx = *m++; shy = *m++; w0 = *m++; shx = *m++; sy = *m++; w1 = *m++; tx = *m++; ty = *m++; w2 = *m++; return *this; } //------------------------------------------------------------------------ inline const trans_perspective& trans_perspective::from_affine(const trans_affine& a) { sx = a.sx; shy = a.shy; w0 = 0; shx = a.shx; sy = a.sy; w1 = 0; tx = a.tx; ty = a.ty; w2 = 1; return *this; } //------------------------------------------------------------------------ inline double trans_perspective::determinant() const { return sx * (sy * w2 - ty * w1) + shx * (ty * w0 - shy * w2) + tx * (shy * w1 - sy * w0); } //------------------------------------------------------------------------ inline double trans_perspective::determinant_reciprocal() const { return 1.0 / determinant(); } //------------------------------------------------------------------------ inline bool trans_perspective::is_valid(double epsilon) const { return fabs(sx) > epsilon && fabs(sy) > epsilon && fabs(w2) > epsilon; } //------------------------------------------------------------------------ inline bool trans_perspective::is_identity(double epsilon) const { return is_equal_eps(sx, 1.0, epsilon) && is_equal_eps(shy, 0.0, epsilon) && is_equal_eps(w0, 0.0, epsilon) && is_equal_eps(shx, 0.0, epsilon) && is_equal_eps(sy, 1.0, epsilon) && is_equal_eps(w1, 0.0, epsilon) && is_equal_eps(tx, 0.0, epsilon) && is_equal_eps(ty, 0.0, epsilon) && is_equal_eps(w2, 1.0, epsilon); } //------------------------------------------------------------------------ inline bool trans_perspective::is_equal(const trans_perspective& m, double epsilon) const { return is_equal_eps(sx, m.sx, epsilon) && is_equal_eps(shy, m.shy, epsilon) && is_equal_eps(w0, m.w0, epsilon) && is_equal_eps(shx, m.shx, epsilon) && is_equal_eps(sy, m.sy, epsilon) && is_equal_eps(w1, m.w1, epsilon) && is_equal_eps(tx, m.tx, epsilon) && is_equal_eps(ty, m.ty, epsilon) && is_equal_eps(w2, m.w2, epsilon); } //------------------------------------------------------------------------ inline double trans_perspective::scale() const { double x = 0.707106781 * sx + 0.707106781 * shx; double y = 0.707106781 * shy + 0.707106781 * sy; return sqrt(x*x + y*y); } //------------------------------------------------------------------------ inline double trans_perspective::rotation() const { double x1 = 0.0; double y1 = 0.0; double x2 = 1.0; double y2 = 0.0; transform(&x1, &y1); transform(&x2, &y2); return atan2(y2-y1, x2-x1); } //------------------------------------------------------------------------ void trans_perspective::translation(double* dx, double* dy) const { *dx = tx; *dy = ty; } //------------------------------------------------------------------------ void trans_perspective::scaling(double* x, double* y) const { double x1 = 0.0; double y1 = 0.0; double x2 = 1.0; double y2 = 1.0; trans_perspective t(*this); t *= trans_affine_rotation(-rotation()); t.transform(&x1, &y1); t.transform(&x2, &y2); *x = x2 - x1; *y = y2 - y1; } //------------------------------------------------------------------------ void trans_perspective::scaling_abs(double* x, double* y) const { *x = sqrt(sx * sx + shx * shx); *y = sqrt(shy * shy + sy * sy); } } #endif �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_trans_single_path.h�������������������������������������������������������0000644�0000000�0000000�00000006416�10703246330�021403� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_TRANS_SINGLE_PATH_INCLUDED #define AGG_TRANS_SINGLE_PATH_INCLUDED #include "agg_basics.h" #include "agg_vertex_sequence.h" namespace agg { // See also: agg_trans_single_path.cpp // //-------------------------------------------------------trans_single_path class trans_single_path { enum status_e { initial, making_path, ready }; public: typedef vertex_sequence<vertex_dist, 6> vertex_storage; trans_single_path(); //-------------------------------------------------------------------- void base_length(double v) { m_base_length = v; } double base_length() const { return m_base_length; } //-------------------------------------------------------------------- void preserve_x_scale(bool f) { m_preserve_x_scale = f; } bool preserve_x_scale() const { return m_preserve_x_scale; } //-------------------------------------------------------------------- void reset(); void move_to(double x, double y); void line_to(double x, double y); void finalize_path(); //-------------------------------------------------------------------- template<class VertexSource> void add_path(VertexSource& vs, unsigned path_id=0) { double x; double y; unsigned cmd; vs.rewind(path_id); while(!is_stop(cmd = vs.vertex(&x, &y))) { if(is_move_to(cmd)) { move_to(x, y); } else { if(is_vertex(cmd)) { line_to(x, y); } } } finalize_path(); } //-------------------------------------------------------------------- double total_length() const; void transform(double *x, double *y) const; private: vertex_storage m_src_vertices; double m_base_length; double m_kindex; status_e m_status; bool m_preserve_x_scale; }; } #endif ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_trans_viewport.h����������������������������������������������������������0000644�0000000�0000000�00000023352�10703246330�020763� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- // // Viewport transformer - simple orthogonal conversions from world coordinates // to screen (device) ones. // //---------------------------------------------------------------------------- #ifndef AGG_TRANS_VIEWPORT_INCLUDED #define AGG_TRANS_VIEWPORT_INCLUDED #include <string.h> #include "agg_trans_affine.h" namespace agg { enum aspect_ratio_e { aspect_ratio_stretch, aspect_ratio_meet, aspect_ratio_slice }; //----------------------------------------------------------trans_viewport class trans_viewport { public: //------------------------------------------------------------------- trans_viewport() : m_world_x1(0.0), m_world_y1(0.0), m_world_x2(1.0), m_world_y2(1.0), m_device_x1(0.0), m_device_y1(0.0), m_device_x2(1.0), m_device_y2(1.0), m_aspect(aspect_ratio_stretch), m_is_valid(true), m_align_x(0.5), m_align_y(0.5), m_wx1(0.0), m_wy1(0.0), m_wx2(1.0), m_wy2(1.0), m_dx1(0.0), m_dy1(0.0), m_kx(1.0), m_ky(1.0) {} //------------------------------------------------------------------- void preserve_aspect_ratio(double alignx, double aligny, aspect_ratio_e aspect) { m_align_x = alignx; m_align_y = aligny; m_aspect = aspect; update(); } //------------------------------------------------------------------- void device_viewport(double x1, double y1, double x2, double y2) { m_device_x1 = x1; m_device_y1 = y1; m_device_x2 = x2; m_device_y2 = y2; update(); } //------------------------------------------------------------------- void world_viewport(double x1, double y1, double x2, double y2) { m_world_x1 = x1; m_world_y1 = y1; m_world_x2 = x2; m_world_y2 = y2; update(); } //------------------------------------------------------------------- void device_viewport(double* x1, double* y1, double* x2, double* y2) const { *x1 = m_device_x1; *y1 = m_device_y1; *x2 = m_device_x2; *y2 = m_device_y2; } //------------------------------------------------------------------- void world_viewport(double* x1, double* y1, double* x2, double* y2) const { *x1 = m_world_x1; *y1 = m_world_y1; *x2 = m_world_x2; *y2 = m_world_y2; } //------------------------------------------------------------------- void world_viewport_actual(double* x1, double* y1, double* x2, double* y2) const { *x1 = m_wx1; *y1 = m_wy1; *x2 = m_wx2; *y2 = m_wy2; } //------------------------------------------------------------------- bool is_valid() const { return m_is_valid; } double align_x() const { return m_align_x; } double align_y() const { return m_align_y; } aspect_ratio_e aspect_ratio() const { return m_aspect; } //------------------------------------------------------------------- void transform(double* x, double* y) const { *x = (*x - m_wx1) * m_kx + m_dx1; *y = (*y - m_wy1) * m_ky + m_dy1; } //------------------------------------------------------------------- void transform_scale_only(double* x, double* y) const { *x *= m_kx; *y *= m_ky; } //------------------------------------------------------------------- void inverse_transform(double* x, double* y) const { *x = (*x - m_dx1) / m_kx + m_wx1; *y = (*y - m_dy1) / m_ky + m_wy1; } //------------------------------------------------------------------- void inverse_transform_scale_only(double* x, double* y) const { *x /= m_kx; *y /= m_ky; } //------------------------------------------------------------------- double device_dx() const { return m_dx1 - m_wx1 * m_kx; } double device_dy() const { return m_dy1 - m_wy1 * m_ky; } //------------------------------------------------------------------- double scale_x() const { return m_kx; } //------------------------------------------------------------------- double scale_y() const { return m_ky; } //------------------------------------------------------------------- double scale() const { return (m_kx + m_ky) * 0.5; } //------------------------------------------------------------------- trans_affine to_affine() const { trans_affine mtx = trans_affine_translation(-m_wx1, -m_wy1); mtx *= trans_affine_scaling(m_kx, m_ky); mtx *= trans_affine_translation(m_dx1, m_dy1); return mtx; } //------------------------------------------------------------------- trans_affine to_affine_scale_only() const { return trans_affine_scaling(m_kx, m_ky); } //------------------------------------------------------------------- unsigned byte_size() const { return sizeof(*this); } void serialize(int8u* ptr) const { memcpy(ptr, this, sizeof(*this)); } void deserialize(const int8u* ptr) { memcpy(this, ptr, sizeof(*this)); } private: void update(); double m_world_x1; double m_world_y1; double m_world_x2; double m_world_y2; double m_device_x1; double m_device_y1; double m_device_x2; double m_device_y2; aspect_ratio_e m_aspect; bool m_is_valid; double m_align_x; double m_align_y; double m_wx1; double m_wy1; double m_wx2; double m_wy2; double m_dx1; double m_dy1; double m_kx; double m_ky; }; //----------------------------------------------------------------------- inline void trans_viewport::update() { const double epsilon = 1e-30; if(fabs(m_world_x1 - m_world_x2) < epsilon || fabs(m_world_y1 - m_world_y2) < epsilon || fabs(m_device_x1 - m_device_x2) < epsilon || fabs(m_device_y1 - m_device_y2) < epsilon) { m_wx1 = m_world_x1; m_wy1 = m_world_y1; m_wx2 = m_world_x1 + 1.0; m_wy2 = m_world_y2 + 1.0; m_dx1 = m_device_x1; m_dy1 = m_device_y1; m_kx = 1.0; m_ky = 1.0; m_is_valid = false; return; } double world_x1 = m_world_x1; double world_y1 = m_world_y1; double world_x2 = m_world_x2; double world_y2 = m_world_y2; double device_x1 = m_device_x1; double device_y1 = m_device_y1; double device_x2 = m_device_x2; double device_y2 = m_device_y2; if(m_aspect != aspect_ratio_stretch) { double d; m_kx = (device_x2 - device_x1) / (world_x2 - world_x1); m_ky = (device_y2 - device_y1) / (world_y2 - world_y1); if((m_aspect == aspect_ratio_meet) == (m_kx < m_ky)) { d = (world_y2 - world_y1) * m_ky / m_kx; world_y1 += (world_y2 - world_y1 - d) * m_align_y; world_y2 = world_y1 + d; } else { d = (world_x2 - world_x1) * m_kx / m_ky; world_x1 += (world_x2 - world_x1 - d) * m_align_x; world_x2 = world_x1 + d; } } m_wx1 = world_x1; m_wy1 = world_y1; m_wx2 = world_x2; m_wy2 = world_y2; m_dx1 = device_x1; m_dy1 = device_y1; m_kx = (device_x2 - device_x1) / (world_x2 - world_x1); m_ky = (device_y2 - device_y1) / (world_y2 - world_y1); m_is_valid = true; } } #endif ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_trans_warp_magnifier.h����������������������������������������������������0000644�0000000�0000000�00000004107�10703246330�022073� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_WARP_MAGNIFIER_INCLUDED #define AGG_WARP_MAGNIFIER_INCLUDED namespace agg { //----------------------------------------------------trans_warp_magnifier // // See Inmplementation agg_trans_warp_magnifier.cpp // class trans_warp_magnifier { 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; } double xc() const { return m_xc; } double yc() const { return m_yc; } double magnification() const { return m_magn; } double radius() const { return m_radius; } void transform(double* x, double* y) const; void inverse_transform(double* x, double* y) const; private: double m_xc; double m_yc; double m_magn; double m_radius; }; } #endif ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_vcgen_bspline.h�����������������������������������������������������������0000644�0000000�0000000�00000004652�10703246330�020515� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_VCGEN_BSPLINE_INCLUDED #define AGG_VCGEN_BSPLINE_INCLUDED #include "agg_basics.h" #include "agg_array.h" #include "agg_bspline.h" namespace agg { //==========================================================vcgen_bspline class vcgen_bspline { enum status_e { initial, ready, polygon, end_poly, stop }; public: typedef pod_bvector<point_d, 6> vertex_storage; vcgen_bspline(); void interpolation_step(double v) { m_interpolation_step = v; } double interpolation_step() const { return m_interpolation_step; } // Vertex Generator Interface void remove_all(); void add_vertex(double x, double y, unsigned cmd); // Vertex Source Interface void rewind(unsigned path_id); unsigned vertex(double* x, double* y); private: vcgen_bspline(const vcgen_bspline&); const vcgen_bspline& operator = (const vcgen_bspline&); vertex_storage m_src_vertices; bspline m_spline_x; bspline m_spline_y; double m_interpolation_step; unsigned m_closed; status_e m_status; unsigned m_src_vertex; double m_cur_abscissa; double m_max_abscissa; }; } #endif ��������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_vcgen_contour.h�����������������������������������������������������������0000644�0000000�0000000�00000007344�10703246330�020553� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_VCGEN_CONTOUR_INCLUDED #define AGG_VCGEN_CONTOUR_INCLUDED #include "agg_math_stroke.h" namespace agg { //----------------------------------------------------------vcgen_contour // // See Implementation agg_vcgen_contour.cpp // class vcgen_contour { enum status_e { initial, ready, outline, out_vertices, end_poly, stop }; public: typedef vertex_sequence<vertex_dist, 6> vertex_storage; typedef pod_bvector<point_d, 6> coord_storage; vcgen_contour(); void line_cap(line_cap_e lc) { m_stroker.line_cap(lc); } void line_join(line_join_e lj) { m_stroker.line_join(lj); } void inner_join(inner_join_e ij) { m_stroker.inner_join(ij); } line_cap_e line_cap() const { return m_stroker.line_cap(); } line_join_e line_join() const { return m_stroker.line_join(); } inner_join_e inner_join() const { return m_stroker.inner_join(); } void width(double w) { m_stroker.width(m_width = w); } void miter_limit(double ml) { m_stroker.miter_limit(ml); } void miter_limit_theta(double t) { m_stroker.miter_limit_theta(t); } void inner_miter_limit(double ml) { m_stroker.inner_miter_limit(ml); } void approximation_scale(double as) { m_stroker.approximation_scale(as); } double width() const { return m_width; } double miter_limit() const { return m_stroker.miter_limit(); } double inner_miter_limit() const { return m_stroker.inner_miter_limit(); } double approximation_scale() const { return m_stroker.approximation_scale(); } void auto_detect_orientation(bool v) { m_auto_detect = v; } bool auto_detect_orientation() const { return m_auto_detect; } // Generator interface void remove_all(); void add_vertex(double x, double y, unsigned cmd); // Vertex Source Interface void rewind(unsigned path_id); unsigned vertex(double* x, double* y); private: vcgen_contour(const vcgen_contour&); const vcgen_contour& operator = (const vcgen_contour&); math_stroke<coord_storage> m_stroker; double m_width; vertex_storage m_src_vertices; coord_storage m_out_vertices; status_e m_status; unsigned m_src_vertex; unsigned m_out_vertex; unsigned m_closed; unsigned m_orientation; bool m_auto_detect; }; } #endif ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_vcgen_dash.h��������������������������������������������������������������0000644�0000000�0000000�00000005520�10703246330�017773� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_VCGEN_DASH_INCLUDED #define AGG_VCGEN_DASH_INCLUDED #include "agg_basics.h" #include "agg_vertex_sequence.h" namespace agg { //---------------------------------------------------------------vcgen_dash // // See Implementation agg_vcgen_dash.cpp // class vcgen_dash { enum max_dashes_e { max_dashes = 32 }; enum status_e { initial, ready, polyline, stop }; public: typedef vertex_sequence<vertex_dist, 6> vertex_storage; vcgen_dash(); void remove_all_dashes(); void add_dash(double dash_len, double gap_len); void dash_start(double ds); void shorten(double s) { m_shorten = s; } double shorten() const { return m_shorten; } // Vertex Generator Interface void remove_all(); void add_vertex(double x, double y, unsigned cmd); // Vertex Source Interface void rewind(unsigned path_id); unsigned vertex(double* x, double* y); private: vcgen_dash(const vcgen_dash&); const vcgen_dash& operator = (const vcgen_dash&); void calc_dash_start(double ds); double m_dashes[max_dashes]; double m_total_dash_len; unsigned m_num_dashes; double m_dash_start; double m_shorten; double m_curr_dash_start; unsigned m_curr_dash; double m_curr_rest; const vertex_dist* m_v1; const vertex_dist* m_v2; vertex_storage m_src_vertices; unsigned m_closed; status_e m_status; unsigned m_src_vertex; }; } #endif ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_vcgen_markers_term.h������������������������������������������������������0000644�0000000�0000000�00000004501�10703246330�021545� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_VCGEN_MARKERS_TERM_INCLUDED #define AGG_VCGEN_MARKERS_TERM_INCLUDED #include "agg_basics.h" #include "agg_vertex_sequence.h" namespace agg { //======================================================vcgen_markers_term // // See Implemantation agg_vcgen_markers_term.cpp // Terminal markers generator (arrowhead/arrowtail) // //------------------------------------------------------------------------ class vcgen_markers_term { public: vcgen_markers_term() : m_curr_id(0), m_curr_idx(0) {} // Vertex Generator Interface void remove_all(); void add_vertex(double x, double y, unsigned cmd); // Vertex Source Interface void rewind(unsigned path_id); unsigned vertex(double* x, double* y); private: vcgen_markers_term(const vcgen_markers_term&); const vcgen_markers_term& operator = (const vcgen_markers_term&); struct coord_type { double x, y; coord_type() {} coord_type(double x_, double y_) : x(x_), y(y_) {} }; typedef pod_bvector<coord_type, 6> coord_storage; coord_storage m_markers; unsigned m_curr_id; unsigned m_curr_idx; }; } #endif �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_vcgen_smooth_poly1.h������������������������������������������������������0000644�0000000�0000000�00000005555�10703246330�021521� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_VCGEN_SMOOTH_POLY1_INCLUDED #define AGG_VCGEN_SMOOTH_POLY1_INCLUDED #include "agg_basics.h" #include "agg_vertex_sequence.h" namespace agg { //======================================================vcgen_smooth_poly1 // // See Implementation agg_vcgen_smooth_poly1.cpp // Smooth polygon generator // //------------------------------------------------------------------------ class vcgen_smooth_poly1 { enum status_e { initial, ready, polygon, ctrl_b, ctrl_e, ctrl1, ctrl2, end_poly, stop }; public: typedef vertex_sequence<vertex_dist, 6> vertex_storage; vcgen_smooth_poly1(); void smooth_value(double v) { m_smooth_value = v * 0.5; } double smooth_value() const { return m_smooth_value * 2.0; } // Vertex Generator Interface void remove_all(); void add_vertex(double x, double y, unsigned cmd); // Vertex Source Interface void rewind(unsigned path_id); unsigned vertex(double* x, double* y); private: 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, const vertex_dist& v2, const vertex_dist& v3); vertex_storage m_src_vertices; double m_smooth_value; unsigned m_closed; status_e m_status; unsigned m_src_vertex; double m_ctrl1_x; double m_ctrl1_y; double m_ctrl2_x; double m_ctrl2_y; }; } #endif ���������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_vcgen_stroke.h������������������������������������������������������������0000644�0000000�0000000�00000007544�10703246330�020373� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_VCGEN_STROKE_INCLUDED #define AGG_VCGEN_STROKE_INCLUDED #include "agg_math_stroke.h" namespace agg { //============================================================vcgen_stroke // // See Implementation agg_vcgen_stroke.cpp // Stroke generator // //------------------------------------------------------------------------ class vcgen_stroke { enum status_e { initial, ready, cap1, cap2, outline1, close_first, outline2, out_vertices, end_poly1, end_poly2, stop }; public: typedef vertex_sequence<vertex_dist, 6> vertex_storage; typedef pod_bvector<point_d, 6> coord_storage; vcgen_stroke(); void line_cap(line_cap_e lc) { m_stroker.line_cap(lc); } void line_join(line_join_e lj) { m_stroker.line_join(lj); } void inner_join(inner_join_e ij) { m_stroker.inner_join(ij); } line_cap_e line_cap() const { return m_stroker.line_cap(); } line_join_e line_join() const { return m_stroker.line_join(); } inner_join_e inner_join() const { return m_stroker.inner_join(); } void width(double w) { m_stroker.width(w); } void miter_limit(double ml) { m_stroker.miter_limit(ml); } void miter_limit_theta(double t) { m_stroker.miter_limit_theta(t); } void inner_miter_limit(double ml) { m_stroker.inner_miter_limit(ml); } void approximation_scale(double as) { m_stroker.approximation_scale(as); } double width() const { return m_stroker.width(); } double miter_limit() const { return m_stroker.miter_limit(); } double inner_miter_limit() const { return m_stroker.inner_miter_limit(); } double approximation_scale() const { return m_stroker.approximation_scale(); } void shorten(double s) { m_shorten = s; } double shorten() const { return m_shorten; } // Vertex Generator Interface void remove_all(); void add_vertex(double x, double y, unsigned cmd); // Vertex Source Interface void rewind(unsigned path_id); unsigned vertex(double* x, double* y); private: vcgen_stroke(const vcgen_stroke&); const vcgen_stroke& operator = (const vcgen_stroke&); math_stroke<coord_storage> m_stroker; vertex_storage m_src_vertices; coord_storage m_out_vertices; double m_shorten; unsigned m_closed; status_e m_status; status_e m_prev_status; unsigned m_src_vertex; unsigned m_out_vertex; }; } #endif ������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_vcgen_vertex_sequence.h���������������������������������������������������0000644�0000000�0000000�00000010140�10703246330�022253� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_VCGEN_VERTEX_SEQUENCE_INCLUDED #define AGG_VCGEN_VERTEX_SEQUENCE_INCLUDED #include "agg_basics.h" #include "agg_vertex_sequence.h" #include "agg_shorten_path.h" namespace agg { //===================================================vcgen_vertex_sequence class vcgen_vertex_sequence { public: typedef vertex_dist_cmd vertex_type; typedef vertex_sequence<vertex_type, 6> vertex_storage; vcgen_vertex_sequence() : m_flags(0), m_cur_vertex(0), m_shorten(0.0), m_ready(false) { } // Vertex Generator Interface void remove_all(); void add_vertex(double x, double y, unsigned cmd); // Vertex Source Interface void rewind(unsigned path_id); unsigned vertex(double* x, double* y); void shorten(double s) { m_shorten = s; } double shorten() const { return m_shorten; } private: vcgen_vertex_sequence(const vcgen_vertex_sequence&); const vcgen_vertex_sequence& operator = (const vcgen_vertex_sequence&); vertex_storage m_src_vertices; unsigned m_flags; unsigned m_cur_vertex; double m_shorten; bool m_ready; }; //------------------------------------------------------------------------ inline void vcgen_vertex_sequence::remove_all() { m_ready = false; m_src_vertices.remove_all(); m_cur_vertex = 0; m_flags = 0; } //------------------------------------------------------------------------ inline void vcgen_vertex_sequence::add_vertex(double x, double y, unsigned cmd) { m_ready = false; if(is_move_to(cmd)) { m_src_vertices.modify_last(vertex_dist_cmd(x, y, cmd)); } else { if(is_vertex(cmd)) { m_src_vertices.add(vertex_dist_cmd(x, y, cmd)); } else { m_flags = cmd & path_flags_mask; } } } //------------------------------------------------------------------------ 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; } //------------------------------------------------------------------------ inline unsigned vcgen_vertex_sequence::vertex(double* x, double* y) { if(!m_ready) { rewind(0); } if(m_cur_vertex == m_src_vertices.size()) { ++m_cur_vertex; return path_cmd_end_poly | m_flags; } if(m_cur_vertex > m_src_vertices.size()) { return path_cmd_stop; } vertex_type& v = m_src_vertices[m_cur_vertex++]; *x = v.x; *y = v.y; return v.cmd; } } #endif ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_vertex_sequence.h���������������������������������������������������������0000644�0000000�0000000�00000012432�10703246330�021077� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_VERTEX_SEQUENCE_INCLUDED #define AGG_VERTEX_SEQUENCE_INCLUDED #include "agg_basics.h" #include "agg_array.h" #include "agg_math.h" namespace agg { //----------------------------------------------------------vertex_sequence // Modified agg::pod_bvector. The data is interpreted as a sequence // of vertices. It means that the type T must expose: // // bool T::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 // 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 // of the distance between the current and previous ones: // // struct vertex_dist // { // double x; // double y; // double dist; // // vertex_dist() {} // vertex_dist(double x_, double y_) : // x(x_), // y(y_), // dist(0.0) // { // } // // bool operator () (const vertex_dist& val) // { // return (dist = calc_distance(x, y, val.x, val.y)) > EPSILON; // } // }; // // Function close() calls this operator and removes the last vertex if // necessary. //------------------------------------------------------------------------ template<class T, unsigned S=6> class vertex_sequence : public pod_bvector<T, S> { public: typedef pod_bvector<T, S> base_type; void add(const T& val); void modify_last(const T& val); void close(bool remove_flag); }; //------------------------------------------------------------------------ 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])) { base_type::remove_last(); } } base_type::add(val); } //------------------------------------------------------------------------ template<class T, unsigned S> void vertex_sequence<T, S>::modify_last(const T& val) { base_type::remove_last(); add(val); } //------------------------------------------------------------------------ template<class T, unsigned S> void vertex_sequence<T, S>::close(bool closed) { while(base_type::size() > 1) { if((*this)[base_type::size() - 2]((*this)[base_type::size() - 1])) break; T t = (*this)[base_type::size() - 1]; base_type::remove_last(); modify_last(t); } if(closed) { while(base_type::size() > 1) { if((*this)[base_type::size() - 1]((*this)[0])) break; base_type::remove_last(); } } } //-------------------------------------------------------------vertex_dist // 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 { double x; double y; double dist; vertex_dist() {} vertex_dist(double x_, double y_) : x(x_), y(y_), dist(0.0) { } bool operator () (const vertex_dist& val) { bool ret = (dist = calc_distance(x, y, val.x, val.y)) > vertex_dist_epsilon; if(!ret) dist = 1.0 / vertex_dist_epsilon; return ret; } }; //--------------------------------------------------------vertex_dist_cmd // Save as the above but with additional "command" value struct vertex_dist_cmd : public vertex_dist { unsigned cmd; vertex_dist_cmd() {} vertex_dist_cmd(double x_, double y_, unsigned cmd_) : vertex_dist(x_, y_), cmd(cmd_) { } }; } #endif ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_vpgen_clip_polygon.h������������������������������������������������������0000644�0000000�0000000�00000005326�10703246330�021573� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_VPGEN_CLIP_POLYGON_INCLUDED #define AGG_VPGEN_CLIP_POLYGON_INCLUDED #include "agg_basics.h" namespace agg { //======================================================vpgen_clip_polygon // // See Implementation agg_vpgen_clip_polygon.cpp // class vpgen_clip_polygon { public: vpgen_clip_polygon() : m_clip_box(0, 0, 1, 1), m_x1(0), m_y1(0), m_clip_flags(0), m_num_vertices(0), m_vertex(0), m_cmd(path_cmd_move_to) { } void clip_box(double x1, double y1, double x2, double y2) { m_clip_box.x1 = x1; m_clip_box.y1 = y1; m_clip_box.x2 = x2; m_clip_box.y2 = y2; m_clip_box.normalize(); } double x1() const { return m_clip_box.x1; } double y1() const { return m_clip_box.y1; } double x2() const { return m_clip_box.x2; } double y2() const { return m_clip_box.y2; } static bool auto_close() { return true; } static bool auto_unclose() { return false; } void reset(); void move_to(double x, double y); void line_to(double x, double y); unsigned vertex(double* x, double* y); private: unsigned clipping_flags(double x, double y); private: rect_d m_clip_box; double m_x1; double m_y1; unsigned m_clip_flags; double m_x[4]; double m_y[4]; unsigned m_num_vertices; unsigned m_vertex; unsigned m_cmd; }; } #endif ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_vpgen_clip_polyline.h�����������������������������������������������������0000644�0000000�0000000�00000005163�10703246330�021736� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_VPGEN_CLIP_POLYLINE_INCLUDED #define AGG_VPGEN_CLIP_POLYLINE_INCLUDED #include "agg_basics.h" namespace agg { //======================================================vpgen_clip_polyline // // See Implementation agg_vpgen_clip_polyline.cpp // class vpgen_clip_polyline { public: vpgen_clip_polyline() : m_clip_box(0, 0, 1, 1), m_x1(0), m_y1(0), m_num_vertices(0), m_vertex(0), m_move_to(false) { } void clip_box(double x1, double y1, double x2, double y2) { m_clip_box.x1 = x1; m_clip_box.y1 = y1; m_clip_box.x2 = x2; m_clip_box.y2 = y2; m_clip_box.normalize(); } double x1() const { return m_clip_box.x1; } double y1() const { return m_clip_box.y1; } double x2() const { return m_clip_box.x2; } double y2() const { return m_clip_box.y2; } static bool auto_close() { return false; } static bool auto_unclose() { return true; } void reset(); void move_to(double x, double y); void line_to(double x, double y); unsigned vertex(double* x, double* y); private: rect_d m_clip_box; double m_x1; double m_y1; double m_x[2]; double m_y[2]; unsigned m_cmd[2]; unsigned m_num_vertices; unsigned m_vertex; bool m_move_to; }; } #endif �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/agg_vpgen_segmentator.h�������������������������������������������������������0000644�0000000�0000000�00000004161�10703246330�021421� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_VPGEN_SEGMENTATOR_INCLUDED #define AGG_VPGEN_SEGMENTATOR_INCLUDED #include <math.h> #include "agg_basics.h" namespace agg { //=======================================================vpgen_segmentator // // See Implementation agg_vpgen_segmentator.cpp // class vpgen_segmentator { public: vpgen_segmentator() : m_approximation_scale(1.0) {} void approximation_scale(double s) { m_approximation_scale = s; } double approximation_scale() const { return m_approximation_scale; } static bool auto_close() { return false; } static bool auto_unclose() { return false; } void reset() { m_cmd = path_cmd_stop; } void move_to(double x, double y); void line_to(double x, double y); unsigned vertex(double* x, double* y); private: double m_approximation_scale; double m_x1; double m_y1; double m_dx; double m_dy; double m_dl; double m_ddl; unsigned m_cmd; }; } #endif ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/ctrl/�������������������������������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�015645� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/ctrl/Makefile.am��������������������������������������������������������������0000644�0000000�0000000�00000000365�10703246330�017705� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������aggincludedir = $(includedir)/agg2/ctrl agginclude_HEADERS = agg_ctrl.h agg_gamma_spline.h agg_scale_ctrl.h agg_spline_ctrl.h \ agg_cbox_ctrl.h agg_gamma_ctrl.h agg_rbox_ctrl.h agg_slider_ctrl.h \ agg_bezier_ctrl.h agg_polygon_ctrl.h ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/ctrl/agg_bezier_ctrl.h��������������������������������������������������������0000644�0000000�0000000�00000014575�10703246330�021154� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_BEZIER_CTRL_INCLUDED #define AGG_BEZIER_CTRL_INCLUDED #include "agg_math.h" #include "agg_ellipse.h" #include "agg_trans_affine.h" #include "agg_color_rgba.h" #include "agg_conv_stroke.h" #include "agg_conv_curve.h" #include "agg_polygon_ctrl.h" namespace agg { //--------------------------------------------------------bezier_ctrl_impl class bezier_ctrl_impl : public ctrl { public: bezier_ctrl_impl(); void curve(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4); curve4& curve(); double x1() const { return m_poly.xn(0); } double y1() const { return m_poly.yn(0); } double x2() const { return m_poly.xn(1); } double y2() const { return m_poly.yn(1); } double x3() const { return m_poly.xn(2); } double y3() const { return m_poly.yn(2); } double x4() const { return m_poly.xn(3); } double y4() const { return m_poly.yn(3); } void x1(double x) { m_poly.xn(0) = x; } void y1(double y) { m_poly.yn(0) = y; } void x2(double x) { m_poly.xn(1) = x; } void y2(double y) { m_poly.yn(1) = y; } void x3(double x) { m_poly.xn(2) = x; } void y3(double y) { m_poly.yn(2) = y; } void x4(double x) { m_poly.xn(3) = x; } void y4(double y) { m_poly.yn(3) = y; } void line_width(double w) { m_stroke.width(w); } double line_width() const { return m_stroke.width(); } void point_radius(double r) { m_poly.point_radius(r); } double point_radius() const { return m_poly.point_radius(); } virtual bool in_rect(double x, double y) const; virtual bool on_mouse_button_down(double x, double y); virtual bool on_mouse_button_up(double x, double y); virtual bool on_mouse_move(double x, double y, bool button_flag); virtual bool on_arrow_keys(bool left, bool right, bool down, bool up); // Vertex source interface unsigned num_paths() { return 7; }; void rewind(unsigned path_id); unsigned vertex(double* x, double* y); private: curve4 m_curve; ellipse m_ellipse; conv_stroke<curve4> m_stroke; polygon_ctrl_impl m_poly; unsigned m_idx; }; //----------------------------------------------------------bezier_ctrl template<class ColorT> class bezier_ctrl : public bezier_ctrl_impl { public: bezier_ctrl() : m_color(rgba(0.0, 0.0, 0.0)) { } void line_color(const ColorT& c) { m_color = c; } const ColorT& color(unsigned i) const { return m_color; } private: bezier_ctrl(const bezier_ctrl<ColorT>&); const bezier_ctrl<ColorT>& operator = (const bezier_ctrl<ColorT>&); ColorT m_color; }; //--------------------------------------------------------curve3_ctrl_impl class curve3_ctrl_impl : public ctrl { public: curve3_ctrl_impl(); void curve(double x1, double y1, double x2, double y2, double x3, double y3); curve3& curve(); double x1() const { return m_poly.xn(0); } double y1() const { return m_poly.yn(0); } double x2() const { return m_poly.xn(1); } double y2() const { return m_poly.yn(1); } double x3() const { return m_poly.xn(2); } double y3() const { return m_poly.yn(2); } void x1(double x) { m_poly.xn(0) = x; } void y1(double y) { m_poly.yn(0) = y; } void x2(double x) { m_poly.xn(1) = x; } void y2(double y) { m_poly.yn(1) = y; } void x3(double x) { m_poly.xn(2) = x; } void y3(double y) { m_poly.yn(2) = y; } void line_width(double w) { m_stroke.width(w); } double line_width() const { return m_stroke.width(); } void point_radius(double r) { m_poly.point_radius(r); } double point_radius() const { return m_poly.point_radius(); } virtual bool in_rect(double x, double y) const; virtual bool on_mouse_button_down(double x, double y); virtual bool on_mouse_button_up(double x, double y); virtual bool on_mouse_move(double x, double y, bool button_flag); virtual bool on_arrow_keys(bool left, bool right, bool down, bool up); // Vertex source interface unsigned num_paths() { return 6; }; void rewind(unsigned path_id); unsigned vertex(double* x, double* y); private: curve3 m_curve; ellipse m_ellipse; conv_stroke<curve3> m_stroke; polygon_ctrl_impl m_poly; unsigned m_idx; }; //----------------------------------------------------------curve3_ctrl template<class ColorT> class curve3_ctrl : public curve3_ctrl_impl { public: curve3_ctrl() : m_color(rgba(0.0, 0.0, 0.0)) { } void line_color(const ColorT& c) { m_color = c; } const ColorT& color(unsigned i) const { return m_color; } private: curve3_ctrl(const curve3_ctrl<ColorT>&); const curve3_ctrl<ColorT>& operator = (const curve3_ctrl<ColorT>&); ColorT m_color; }; } #endif �����������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/ctrl/agg_cbox_ctrl.h����������������������������������������������������������0000644�0000000�0000000�00000007423�10703246330�020621� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_CBOX_CTRL_INCLUDED #define AGG_CBOX_CTRL_INCLUDED #include "agg_basics.h" #include "agg_conv_stroke.h" #include "agg_gsv_text.h" #include "agg_trans_affine.h" #include "agg_color_rgba.h" #include "agg_ctrl.h" namespace agg { //----------------------------------------------------------cbox_ctrl_impl class cbox_ctrl_impl : public ctrl { public: cbox_ctrl_impl(double x, double y, const char* label, bool flip_y=false); void text_thickness(double t) { m_text_thickness = t; } void text_size(double h, double w=0.0); const char* label() { return m_label; } void label(const char* l); bool status() const { return m_status; } void status(bool st) { m_status = st; } virtual bool in_rect(double x, double y) const; virtual bool on_mouse_button_down(double x, double y); virtual bool on_mouse_button_up(double x, double y); virtual bool on_mouse_move(double x, double y, bool button_flag); virtual bool on_arrow_keys(bool left, bool right, bool down, bool up); // Vertex soutce interface unsigned num_paths() { return 3; }; void rewind(unsigned path_id); unsigned vertex(double* x, double* y); private: double m_text_thickness; double m_text_height; double m_text_width; char m_label[128]; bool m_status; double m_vx[32]; double m_vy[32]; gsv_text m_text; conv_stroke<gsv_text> m_text_poly; unsigned m_idx; unsigned m_vertex; }; //----------------------------------------------------------cbox_ctrl_impl template<class ColorT> class cbox_ctrl : public cbox_ctrl_impl { public: cbox_ctrl(double x, double y, const char* label, bool flip_y=false) : cbox_ctrl_impl(x, y, label, flip_y), m_text_color(rgba(0.0, 0.0, 0.0)), m_inactive_color(rgba(0.0, 0.0, 0.0)), m_active_color(rgba(0.4, 0.0, 0.0)) { m_colors[0] = &m_inactive_color; m_colors[1] = &m_text_color; m_colors[2] = &m_active_color; } void text_color(const ColorT& c) { m_text_color = c; } void inactive_color(const ColorT& c) { m_inactive_color = c; } void active_color(const ColorT& c) { m_active_color = c; } const ColorT& color(unsigned i) const { return *m_colors[i]; } private: cbox_ctrl(const cbox_ctrl<ColorT>&); const cbox_ctrl<ColorT>& operator = (const cbox_ctrl<ColorT>&); ColorT m_text_color; ColorT m_inactive_color; ColorT m_active_color; ColorT* m_colors[3]; }; } #endif ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/ctrl/agg_ctrl.h���������������������������������������������������������������0000644�0000000�0000000�00000010004�10703246330�017573� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_CTRL_INCLUDED #define AGG_CTRL_INCLUDED #include "agg_trans_affine.h" #include "agg_renderer_scanline.h" namespace agg { //--------------------------------------------------------------------ctrl class ctrl { public: //-------------------------------------------------------------------- virtual ~ctrl() {} ctrl(double x1, double y1, double x2, double y2, bool flip_y) : m_x1(x1), m_y1(y1), m_x2(x2), m_y2(y2), m_flip_y(flip_y), m_mtx(0) { } //-------------------------------------------------------------------- virtual bool in_rect(double x, double y) const = 0; virtual bool on_mouse_button_down(double x, double y) = 0; virtual bool on_mouse_button_up(double x, double y) = 0; virtual bool on_mouse_move(double x, double y, bool button_flag) = 0; virtual bool on_arrow_keys(bool left, bool right, bool down, bool up) = 0; //-------------------------------------------------------------------- void transform(const trans_affine& mtx) { m_mtx = &mtx; } void no_transform() { m_mtx = 0; } //-------------------------------------------------------------------- void transform_xy(double* x, double* y) const { if(m_flip_y) *y = m_y1 + m_y2 - *y; if(m_mtx) m_mtx->transform(x, y); } //-------------------------------------------------------------------- void inverse_transform_xy(double* x, double* y) const { if(m_mtx) m_mtx->inverse_transform(x, y); if(m_flip_y) *y = m_y1 + m_y2 - *y; } //-------------------------------------------------------------------- double scale() const { return m_mtx ? m_mtx->scale() : 1.0; } private: ctrl(const ctrl&); const ctrl& operator = (const ctrl&); protected: double m_x1; double m_y1; double m_x2; double m_y2; private: bool m_flip_y; const trans_affine* m_mtx; }; //-------------------------------------------------------------------- template<class Rasterizer, class Scanline, class Renderer, class Ctrl> void render_ctrl(Rasterizer& ras, Scanline& sl, Renderer& r, Ctrl& c) { unsigned i; for(i = 0; i < c.num_paths(); i++) { ras.reset(); ras.add_path(c, i); render_scanlines_aa_solid(ras, sl, r, c.color(i)); } } //-------------------------------------------------------------------- template<class Rasterizer, class Scanline, class Renderer, class Ctrl> void render_ctrl_rs(Rasterizer& ras, Scanline& sl, Renderer& r, Ctrl& c) { unsigned i; for(i = 0; i < c.num_paths(); i++) { ras.reset(); ras.add_path(c, i); r.color(c.color(i)); render_scanlines(ras, sl, r); } } } #endif ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/ctrl/agg_gamma_ctrl.h���������������������������������������������������������0000644�0000000�0000000�00000014511�10703246330�020744� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_GAMMA_CTRL_INCLUDED #define AGG_GAMMA_CTRL_INCLUDED #include "agg_basics.h" #include "agg_gamma_spline.h" #include "agg_ellipse.h" #include "agg_conv_stroke.h" #include "agg_gsv_text.h" #include "agg_trans_affine.h" #include "agg_color_rgba.h" #include "agg_ctrl.h" namespace agg { //------------------------------------------------------------------------ // Class that can be used to create an interactive control to set up // gamma arrays. //------------------------------------------------------------------------ class gamma_ctrl_impl : public ctrl { public: gamma_ctrl_impl(double x1, double y1, double x2, double y2, bool flip_y=false); // Set other parameters void border_width(double t, double extra=0.0); void curve_width(double t) { m_curve_width = t; } void grid_width(double t) { m_grid_width = t; } void text_thickness(double t) { m_text_thickness = t; } void text_size(double h, double w=0.0); void point_size(double s) { m_point_size = s; } // Event handlers. Just call them if the respective events // in your system occure. The functions return true if redrawing // is required. virtual bool in_rect(double x, double y) const; virtual bool on_mouse_button_down(double x, double y); virtual bool on_mouse_button_up(double x, double y); virtual bool on_mouse_move(double x, double y, bool button_flag); virtual bool on_arrow_keys(bool left, bool right, bool down, bool up); void change_active_point(); // A copy of agg::gamma_spline interface void values(double kx1, double ky1, double kx2, double ky2); void values(double* kx1, double* ky1, double* kx2, double* ky2) const; const unsigned char* gamma() const { return m_gamma_spline.gamma(); } double y(double x) const { return m_gamma_spline.y(x); } double operator() (double x) const { return m_gamma_spline.y(x); } const gamma_spline& get_gamma_spline() const { return m_gamma_spline; } // Vertex soutce interface unsigned num_paths() { return 7; } void rewind(unsigned idx); unsigned vertex(double* x, double* y); private: void calc_spline_box(); void calc_points(); void calc_values(); gamma_spline m_gamma_spline; double m_border_width; double m_border_extra; double m_curve_width; double m_grid_width; double m_text_thickness; double m_point_size; double m_text_height; double m_text_width; double m_xc1; double m_yc1; double m_xc2; double m_yc2; double m_xs1; double m_ys1; double m_xs2; double m_ys2; double m_xt1; double m_yt1; double m_xt2; double m_yt2; conv_stroke<gamma_spline> m_curve_poly; ellipse m_ellipse; gsv_text m_text; conv_stroke<gsv_text> m_text_poly; unsigned m_idx; unsigned m_vertex; double m_vx[32]; double m_vy[32]; double m_xp1; double m_yp1; double m_xp2; double m_yp2; bool m_p1_active; unsigned m_mouse_point; double m_pdx; double m_pdy; }; template<class ColorT> class gamma_ctrl : public gamma_ctrl_impl { public: gamma_ctrl(double x1, double y1, double x2, double y2, bool flip_y=false) : gamma_ctrl_impl(x1, y1, x2, y2, flip_y), m_background_color(rgba(1.0, 1.0, 0.9)), m_border_color(rgba(0.0, 0.0, 0.0)), m_curve_color(rgba(0.0, 0.0, 0.0)), m_grid_color(rgba(0.2, 0.2, 0.0)), m_inactive_pnt_color(rgba(0.0, 0.0, 0.0)), m_active_pnt_color(rgba(1.0, 0.0, 0.0)), m_text_color(rgba(0.0, 0.0, 0.0)) { m_colors[0] = &m_background_color; m_colors[1] = &m_border_color; m_colors[2] = &m_curve_color; m_colors[3] = &m_grid_color; m_colors[4] = &m_inactive_pnt_color; m_colors[5] = &m_active_pnt_color; m_colors[6] = &m_text_color; } // Set colors void background_color(const ColorT& c) { m_background_color = c; } void border_color(const ColorT& c) { m_border_color = c; } void curve_color(const ColorT& c) { m_curve_color = c; } void grid_color(const ColorT& c) { m_grid_color = c; } void inactive_pnt_color(const ColorT& c) { m_inactive_pnt_color = c; } void active_pnt_color(const ColorT& c) { m_active_pnt_color = c; } void text_color(const ColorT& c) { m_text_color = c; } const ColorT& color(unsigned i) const { return *m_colors[i]; } private: gamma_ctrl(const gamma_ctrl<ColorT>&); const gamma_ctrl<ColorT>& operator = (const gamma_ctrl<ColorT>&); ColorT m_background_color; ColorT m_border_color; ColorT m_curve_color; ColorT m_grid_color; ColorT m_inactive_pnt_color; ColorT m_active_pnt_color; ColorT m_text_color; ColorT* m_colors[7]; }; } #endif ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/ctrl/agg_gamma_spline.h�������������������������������������������������������0000644�0000000�0000000�00000007653�10703246330�021303� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_GAMMA_SPLINE_INCLUDED #define AGG_GAMMA_SPLINE_INCLUDED #include "agg_basics.h" #include "agg_bspline.h" namespace agg { //------------------------------------------------------------------------ // Class-helper for calculation gamma-correction arrays. A gamma-correction // array is an array of 256 unsigned chars that determine the actual values // of Anti-Aliasing for each pixel coverage value from 0 to 255. If all the // values in the array are equal to its index, i.e. 0,1,2,3,... there's // no gamma-correction. Class agg::polyfill allows you to use custom // gamma-correction arrays. You can calculate it using any approach, and // class gamma_spline allows you to calculate almost any reasonable shape // of the gamma-curve with using only 4 values - kx1, ky1, kx2, ky2. // // kx2 // +----------------------------------+ // | | | . | // | | | . | ky2 // | | . ------| // | | . | // | | . | // |----------------.|----------------| // | . | | // | . | | // |-------. | | // ky1 | . | | | // | . | | | // +----------------------------------+ // kx1 // // Each value can be in range [0...2]. Value 1.0 means one quarter of the // bounding rectangle. Function values() calculates the curve by these // 4 values. After calling it one can get the gamma-array with call gamma(). // Class also supports the vertex source interface, i.e rewind() and // vertex(). It's made for convinience and used in class gamma_ctrl. // Before calling rewind/vertex one must set the bounding box // box() using pixel coordinates. //------------------------------------------------------------------------ class gamma_spline { public: gamma_spline(); void values(double kx1, double ky1, double kx2, double ky2); const unsigned char* gamma() const { return m_gamma; } double y(double x) const; void values(double* kx1, double* ky1, double* kx2, double* ky2) const; void box(double x1, double y1, double x2, double y2); void rewind(unsigned); unsigned vertex(double* x, double* y); private: unsigned char m_gamma[256]; double m_x[4]; double m_y[4]; bspline m_spline; double m_x1; double m_y1; double m_x2; double m_y2; double m_cur_x; }; } #endif �������������������������������������������������������������������������������������agg-2.5+dfsg1/include/ctrl/agg_polygon_ctrl.h�������������������������������������������������������0000644�0000000�0000000�00000012470�10703246330�021353� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef POLYGON_CTRL_INCLUDED #define POLYGON_CTRL_INCLUDED #include "agg_array.h" #include "agg_conv_stroke.h" #include "agg_ellipse.h" #include "agg_color_rgba.h" #include "agg_ctrl.h" namespace agg { class simple_polygon_vertex_source { public: simple_polygon_vertex_source(const double* polygon, unsigned np, bool roundoff = false, bool close = true) : m_polygon(polygon), m_num_points(np), m_vertex(0), m_roundoff(roundoff), m_close(close) { } void close(bool f) { m_close = f; } bool close() const { return m_close; } void rewind(unsigned) { m_vertex = 0; } unsigned vertex(double* x, double* y) { if(m_vertex > m_num_points) return path_cmd_stop; if(m_vertex == m_num_points) { ++m_vertex; return path_cmd_end_poly | (m_close ? path_flags_close : 0); } *x = m_polygon[m_vertex * 2]; *y = m_polygon[m_vertex * 2 + 1]; if(m_roundoff) { *x = floor(*x) + 0.5; *y = floor(*y) + 0.5; } ++m_vertex; return (m_vertex == 1) ? path_cmd_move_to : path_cmd_line_to; } private: const double* m_polygon; unsigned m_num_points; unsigned m_vertex; bool m_roundoff; bool m_close; }; class polygon_ctrl_impl : public ctrl { public: polygon_ctrl_impl(unsigned np, double point_radius=5); unsigned num_points() const { return m_num_points; } double xn(unsigned n) const { return m_polygon[n * 2]; } double yn(unsigned n) const { return m_polygon[n * 2 + 1]; } double& xn(unsigned n) { return m_polygon[n * 2]; } double& yn(unsigned n) { return m_polygon[n * 2 + 1]; } const double* polygon() const { return &m_polygon[0]; } void line_width(double w) { m_stroke.width(w); } double line_width() const { return m_stroke.width(); } void point_radius(double r) { m_point_radius = r; } double point_radius() const { return m_point_radius; } void in_polygon_check(bool f) { m_in_polygon_check = f; } bool in_polygon_check() const { return m_in_polygon_check; } void close(bool f) { m_vs.close(f); } bool close() const { return m_vs.close(); } // Vertex source interface unsigned num_paths() { return 1; } void rewind(unsigned path_id); unsigned vertex(double* x, double* y); virtual bool in_rect(double x, double y) const; virtual bool on_mouse_button_down(double x, double y); virtual bool on_mouse_button_up(double x, double y); virtual bool on_mouse_move(double x, double y, bool button_flag); virtual bool on_arrow_keys(bool left, bool right, bool down, bool up); private: bool check_edge(unsigned i, double x, double y) const; bool point_in_polygon(double x, double y) const; pod_array<double> m_polygon; unsigned m_num_points; int m_node; int m_edge; simple_polygon_vertex_source m_vs; conv_stroke<simple_polygon_vertex_source> m_stroke; ellipse m_ellipse; double m_point_radius; unsigned m_status; double m_dx; double m_dy; bool m_in_polygon_check; }; //----------------------------------------------------------polygon_ctrl template<class ColorT> class polygon_ctrl : public polygon_ctrl_impl { public: polygon_ctrl(unsigned np, double point_radius=5) : polygon_ctrl_impl(np, point_radius), m_color(rgba(0.0, 0.0, 0.0)) { } void line_color(const ColorT& c) { m_color = c; } const ColorT& color(unsigned i) const { return m_color; } private: polygon_ctrl(const polygon_ctrl<ColorT>&); const polygon_ctrl<ColorT>& operator = (const polygon_ctrl<ColorT>&); ColorT m_color; }; } #endif ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/ctrl/agg_rbox_ctrl.h����������������������������������������������������������0000644�0000000�0000000�00000011210�10703246330�020625� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_RBOX_CTRL_INCLUDED #define AGG_RBOX_CTRL_INCLUDED #include "agg_array.h" #include "agg_ellipse.h" #include "agg_conv_stroke.h" #include "agg_gsv_text.h" #include "agg_trans_affine.h" #include "agg_color_rgba.h" #include "agg_ctrl.h" namespace agg { //------------------------------------------------------------------------ class rbox_ctrl_impl : public ctrl { public: rbox_ctrl_impl(double x1, double y1, double x2, double y2, bool flip_y=false); void border_width(double t, double extra=0.0); void text_thickness(double t) { m_text_thickness = t; } void text_size(double h, double w=0.0); void add_item(const char* text); int cur_item() const { return m_cur_item; } void cur_item(int i) { m_cur_item = i; } virtual bool in_rect(double x, double y) const; virtual bool on_mouse_button_down(double x, double y); virtual bool on_mouse_button_up(double x, double y); virtual bool on_mouse_move(double x, double y, bool button_flag); virtual bool on_arrow_keys(bool left, bool right, bool down, bool up); // Vertex soutce interface unsigned num_paths() { return 5; }; void rewind(unsigned path_id); unsigned vertex(double* x, double* y); private: void calc_rbox(); double m_border_width; double m_border_extra; double m_text_thickness; double m_text_height; double m_text_width; pod_array<char> m_items[32]; unsigned m_num_items; int m_cur_item; double m_xs1; double m_ys1; double m_xs2; double m_ys2; double m_vx[32]; double m_vy[32]; unsigned m_draw_item; double m_dy; ellipse m_ellipse; conv_stroke<ellipse> m_ellipse_poly; gsv_text m_text; conv_stroke<gsv_text> m_text_poly; unsigned m_idx; unsigned m_vertex; }; //------------------------------------------------------------------------ template<class ColorT> class rbox_ctrl : public rbox_ctrl_impl { public: rbox_ctrl(double x1, double y1, double x2, double y2, bool flip_y=false) : rbox_ctrl_impl(x1, y1, x2, y2, flip_y), m_background_color(rgba(1.0, 1.0, 0.9)), m_border_color(rgba(0.0, 0.0, 0.0)), m_text_color(rgba(0.0, 0.0, 0.0)), m_inactive_color(rgba(0.0, 0.0, 0.0)), m_active_color(rgba(0.4, 0.0, 0.0)) { m_colors[0] = &m_background_color; m_colors[1] = &m_border_color; m_colors[2] = &m_text_color; m_colors[3] = &m_inactive_color; m_colors[4] = &m_active_color; } void background_color(const ColorT& c) { m_background_color = c; } void border_color(const ColorT& c) { m_border_color = c; } void text_color(const ColorT& c) { m_text_color = c; } void inactive_color(const ColorT& c) { m_inactive_color = c; } void active_color(const ColorT& c) { m_active_color = c; } const ColorT& color(unsigned i) const { return *m_colors[i]; } private: rbox_ctrl(const rbox_ctrl<ColorT>&); const rbox_ctrl<ColorT>& operator = (const rbox_ctrl<ColorT>&); ColorT m_background_color; ColorT m_border_color; ColorT m_text_color; ColorT m_inactive_color; ColorT m_active_color; ColorT* m_colors[5]; }; } #endif ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/ctrl/agg_scale_ctrl.h���������������������������������������������������������0000644�0000000�0000000�00000010775�10703246330�020761� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_SCALE_CTRL_INCLUDED #define AGG_SCALE_CTRL_INCLUDED #include "agg_basics.h" #include "agg_math.h" #include "agg_ellipse.h" #include "agg_trans_affine.h" #include "agg_color_rgba.h" #include "agg_ctrl.h" namespace agg { //------------------------------------------------------------------------ class scale_ctrl_impl : public ctrl { enum move_e { move_nothing, move_value1, move_value2, move_slider }; public: scale_ctrl_impl(double x1, double y1, double x2, double y2, bool flip_y=false); void border_thickness(double t, double extra=0.0); void resize(double x1, double y1, double x2, double y2); double min_delta() const { return m_min_d; } void min_delta(double d) { m_min_d = d; } double value1() const { return m_value1; } void value1(double value); double value2() const { return m_value2; } void value2(double value); void move(double d); virtual bool in_rect(double x, double y) const; virtual bool on_mouse_button_down(double x, double y); virtual bool on_mouse_button_up(double x, double y); virtual bool on_mouse_move(double x, double y, bool button_flag); virtual bool on_arrow_keys(bool left, bool right, bool down, bool up); // Vertex soutce interface unsigned num_paths() { return 5; }; void rewind(unsigned path_id); unsigned vertex(double* x, double* y); private: void calc_box(); double m_border_thickness; double m_border_extra; double m_value1; double m_value2; double m_min_d; double m_xs1; double m_ys1; double m_xs2; double m_ys2; double m_pdx; double m_pdy; move_e m_move_what; double m_vx[32]; double m_vy[32]; ellipse m_ellipse; unsigned m_idx; unsigned m_vertex; }; //------------------------------------------------------------------------ template<class ColorT> class scale_ctrl : public scale_ctrl_impl { public: scale_ctrl(double x1, double y1, double x2, double y2, bool flip_y=false) : scale_ctrl_impl(x1, y1, x2, y2, flip_y), m_background_color(rgba(1.0, 0.9, 0.8)), m_border_color(rgba(0.0, 0.0, 0.0)), m_pointers_color(rgba(0.8, 0.0, 0.0, 0.8)), m_slider_color(rgba(0.2, 0.1, 0.0, 0.6)) { m_colors[0] = &m_background_color; m_colors[1] = &m_border_color; m_colors[2] = &m_pointers_color; m_colors[3] = &m_pointers_color; m_colors[4] = &m_slider_color; } void background_color(const ColorT& c) { m_background_color = c; } void border_color(const ColorT& c) { m_border_color = c; } void pointers_color(const ColorT& c) { m_pointers_color = c; } void slider_color(const ColorT& c) { m_slider_color = c; } const ColorT& color(unsigned i) const { return *m_colors[i]; } private: scale_ctrl(const scale_ctrl<ColorT>&); const scale_ctrl<ColorT>& operator = (const scale_ctrl<ColorT>&); ColorT m_background_color; ColorT m_border_color; ColorT m_pointers_color; ColorT m_slider_color; ColorT* m_colors[5]; }; } #endif ���agg-2.5+dfsg1/include/ctrl/agg_slider_ctrl.h��������������������������������������������������������0000644�0000000�0000000�00000011473�10703246330�021150� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_SLIDER_CTRL_INCLUDED #define AGG_SLIDER_CTRL_INCLUDED #include "agg_basics.h" #include "agg_math.h" #include "agg_ellipse.h" #include "agg_trans_affine.h" #include "agg_color_rgba.h" #include "agg_gsv_text.h" #include "agg_conv_stroke.h" #include "agg_path_storage.h" #include "agg_ctrl.h" namespace agg { //--------------------------------------------------------slider_ctrl_impl class slider_ctrl_impl : public ctrl { public: slider_ctrl_impl(double x1, double y1, double x2, double y2, bool flip_y=false); void border_width(double t, double extra=0.0); void range(double min, double max) { m_min = min; m_max = max; } void num_steps(unsigned num) { m_num_steps = num; } void label(const char* fmt); void text_thickness(double t) { m_text_thickness = t; } bool descending() const { return m_descending; } void descending(bool v) { m_descending = v; } double value() const { return m_value * (m_max - m_min) + m_min; } void value(double value); virtual bool in_rect(double x, double y) const; virtual bool on_mouse_button_down(double x, double y); virtual bool on_mouse_button_up(double x, double y); virtual bool on_mouse_move(double x, double y, bool button_flag); virtual bool on_arrow_keys(bool left, bool right, bool down, bool up); // Vertex source interface unsigned num_paths() { return 6; }; void rewind(unsigned path_id); unsigned vertex(double* x, double* y); private: void calc_box(); bool normalize_value(bool preview_value_flag); double m_border_width; double m_border_extra; double m_text_thickness; double m_value; double m_preview_value; double m_min; double m_max; unsigned m_num_steps; bool m_descending; char m_label[64]; double m_xs1; double m_ys1; double m_xs2; double m_ys2; double m_pdx; bool m_mouse_move; double m_vx[32]; double m_vy[32]; ellipse m_ellipse; unsigned m_idx; unsigned m_vertex; gsv_text m_text; conv_stroke<gsv_text> m_text_poly; path_storage m_storage; }; //----------------------------------------------------------slider_ctrl template<class ColorT> class slider_ctrl : public slider_ctrl_impl { public: slider_ctrl(double x1, double y1, double x2, double y2, bool flip_y=false) : slider_ctrl_impl(x1, y1, x2, y2, flip_y), m_background_color(rgba(1.0, 0.9, 0.8)), m_triangle_color(rgba(0.7, 0.6, 0.6)), m_text_color(rgba(0.0, 0.0, 0.0)), m_pointer_preview_color(rgba(0.6, 0.4, 0.4, 0.4)), m_pointer_color(rgba(0.8, 0.0, 0.0, 0.6)) { m_colors[0] = &m_background_color; m_colors[1] = &m_triangle_color; m_colors[2] = &m_text_color; m_colors[3] = &m_pointer_preview_color; m_colors[4] = &m_pointer_color; m_colors[5] = &m_text_color; } void background_color(const ColorT& c) { m_background_color = c; } void pointer_color(const ColorT& c) { m_pointer_color = c; } const ColorT& color(unsigned i) const { return *m_colors[i]; } private: slider_ctrl(const slider_ctrl<ColorT>&); const slider_ctrl<ColorT>& operator = (const slider_ctrl<ColorT>&); ColorT m_background_color; ColorT m_triangle_color; ColorT m_text_color; ColorT m_pointer_preview_color; ColorT m_pointer_color; ColorT* m_colors[6]; }; } #endif �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/ctrl/agg_spline_ctrl.h��������������������������������������������������������0000644�0000000�0000000�00000013500�10703246330�021151� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_SPLINE_CTRL_INCLUDED #define AGG_SPLINE_CTRL_INCLUDED #include "agg_basics.h" #include "agg_ellipse.h" #include "agg_bspline.h" #include "agg_conv_stroke.h" #include "agg_path_storage.h" #include "agg_trans_affine.h" #include "agg_color_rgba.h" #include "agg_ctrl.h" namespace agg { //------------------------------------------------------------------------ // Class that can be used to create an interactive control to set up // gamma arrays. //------------------------------------------------------------------------ class spline_ctrl_impl : public ctrl { public: spline_ctrl_impl(double x1, double y1, double x2, double y2, unsigned num_pnt, bool flip_y=false); // Set other parameters void border_width(double t, double extra=0.0); void curve_width(double t) { m_curve_width = t; } void point_size(double s) { m_point_size = s; } // Event handlers. Just call them if the respective events // in your system occure. The functions return true if redrawing // is required. virtual bool in_rect(double x, double y) const; virtual bool on_mouse_button_down(double x, double y); virtual bool on_mouse_button_up(double x, double y); virtual bool on_mouse_move(double x, double y, bool button_flag); virtual bool on_arrow_keys(bool left, bool right, bool down, bool up); void active_point(int i); const double* spline() const { return m_spline_values; } const int8u* spline8() const { return m_spline_values8; } double value(double x) const; void value(unsigned idx, double y); void point(unsigned idx, double x, double y); void x(unsigned idx, double x) { m_xp[idx] = x; } void y(unsigned idx, double y) { m_yp[idx] = y; } double x(unsigned idx) const { return m_xp[idx]; } double y(unsigned idx) const { return m_yp[idx]; } void update_spline(); // Vertex soutce interface unsigned num_paths() { return 5; } void rewind(unsigned path_id); unsigned vertex(double* x, double* y); private: void calc_spline_box(); void calc_curve(); double calc_xp(unsigned idx); double calc_yp(unsigned idx); void set_xp(unsigned idx, double val); void set_yp(unsigned idx, double val); unsigned m_num_pnt; double m_xp[32]; double m_yp[32]; bspline m_spline; double m_spline_values[256]; int8u m_spline_values8[256]; double m_border_width; double m_border_extra; double m_curve_width; double m_point_size; double m_xs1; double m_ys1; double m_xs2; double m_ys2; path_storage m_curve_pnt; conv_stroke<path_storage> m_curve_poly; ellipse m_ellipse; unsigned m_idx; unsigned m_vertex; double m_vx[32]; double m_vy[32]; int m_active_pnt; int m_move_pnt; double m_pdx; double m_pdy; const trans_affine* m_mtx; }; template<class ColorT> class spline_ctrl : public spline_ctrl_impl { public: spline_ctrl(double x1, double y1, double x2, double y2, unsigned num_pnt, bool flip_y=false) : spline_ctrl_impl(x1, y1, x2, y2, num_pnt, flip_y), m_background_color(rgba(1.0, 1.0, 0.9)), m_border_color(rgba(0.0, 0.0, 0.0)), m_curve_color(rgba(0.0, 0.0, 0.0)), m_inactive_pnt_color(rgba(0.0, 0.0, 0.0)), m_active_pnt_color(rgba(1.0, 0.0, 0.0)) { m_colors[0] = &m_background_color; m_colors[1] = &m_border_color; m_colors[2] = &m_curve_color; m_colors[3] = &m_inactive_pnt_color; m_colors[4] = &m_active_pnt_color; } // Set colors void background_color(const ColorT& c) { m_background_color = c; } void border_color(const ColorT& c) { m_border_color = c; } void curve_color(const ColorT& c) { m_curve_color = c; } void inactive_pnt_color(const ColorT& c) { m_inactive_pnt_color = c; } void active_pnt_color(const ColorT& c) { m_active_pnt_color = c; } const ColorT& color(unsigned i) const { return *m_colors[i]; } private: spline_ctrl(const spline_ctrl<ColorT>&); const spline_ctrl<ColorT>& operator = (const spline_ctrl<ColorT>&); ColorT m_background_color; ColorT m_border_color; ColorT m_curve_color; ColorT m_inactive_pnt_color; ColorT m_active_pnt_color; ColorT* m_colors[5]; }; } #endif ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/platform/���������������������������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�016525� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/platform/Makefile.am����������������������������������������������������������0000644�0000000�0000000�00000000222�10703246330�020555� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������EXTRA_DIST=win32/agg_win32_bmp.h \ mac/agg_mac_pmap.h myincludedir = $(includedir)/agg2/platform myinclude_HEADERS = agg_platform_support.h ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/platform/agg_platform_support.h�����������������������������������������������0000644�0000000�0000000�00000071707�10703246330�023150� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- // // class platform_support // // It's not a part of the AGG library, it's just a helper class to create // interactive demo examples. Since the examples should not be too complex // this class is provided to support some very basic interactive graphical // funtionality, such as putting the rendered image to the window, simple // keyboard and mouse input, window resizing, setting the window title, // and catching the "idle" events. // // The idea is to have a single header file that does not depend on any // platform (I hate these endless #ifdef/#elif/#elif.../#endif) and a number // of different implementations depending on the concrete platform. // The most popular platforms are: // // Windows-32 API // X-Window API // SDL library (see http://www.libsdl.org/) // MacOS C/C++ API // // This file does not include any system dependent .h files such as // windows.h or X11.h, so, your demo applications do not depend on the // platform. The only file that can #include system dependend headers // is the implementation file agg_platform_support.cpp. Different // implementations are placed in different directories, such as // ~/agg/src/platform/win32 // ~/agg/src/platform/sdl // ~/agg/src/platform/X11 // and so on. // // All the system dependent stuff sits in the platform_specific // class which is forward-declared here but not defined. // The platform_support class has just a pointer to it and it's // the responsibility of the implementation to create/delete it. // This class being defined in the implementation file can have // any platform dependent stuff such as HWND, X11 Window and so on. // //---------------------------------------------------------------------------- #ifndef AGG_PLATFORM_SUPPORT_INCLUDED #define AGG_PLATFORM_SUPPORT_INCLUDED #include "agg_basics.h" #include "agg_rendering_buffer.h" #include "agg_trans_viewport.h" #include "ctrl/agg_ctrl.h" namespace agg { //----------------------------------------------------------window_flag_e // These are flags used in method init(). Not all of them are // applicable on different platforms, for example the win32_api // cannot use a hardware buffer (window_hw_buffer). // The implementation should simply ignore unsupported flags. enum window_flag_e { window_resize = 1, window_hw_buffer = 2, window_keep_aspect_ratio = 4, window_process_all_keys = 8 }; //-----------------------------------------------------------pix_format_e // Possible formats of the rendering buffer. Initially I thought that it's // reasonable to create the buffer and the rendering functions in // accordance with the native pixel format of the system because it // would have no overhead for pixel format conersion. // But eventually I came to a conclusion that having a possibility to // convert pixel formats on demand is a good idea. First, it was X11 where // there lots of different formats and visuals and it would be great to // render everything in, say, RGB-24 and display it automatically without // any additional efforts. The second reason is to have a possibility to // debug renderers for different pixel formats and colorspaces having only // one computer and one system. // // This stuff is not included into the basic AGG functionality because the // number of supported pixel formats (and/or colorspaces) can be great and // if one needs to add new format it would be good only to add new // rendering files without having to modify any existing ones (a general // principle of incapsulation and isolation). // // Using a particular pixel format doesn't obligatory mean the necessity // of software conversion. For example, win32 API can natively display // gray8, 15-bit RGB, 24-bit BGR, and 32-bit BGRA formats. // This list can be (and will be!) extended in future. enum pix_format_e { pix_format_undefined = 0, // By default. No conversions are applied pix_format_bw, // 1 bit per color B/W pix_format_gray8, // Simple 256 level grayscale pix_format_gray16, // Simple 65535 level grayscale pix_format_rgb555, // 15 bit rgb. Depends on the byte ordering! pix_format_rgb565, // 16 bit rgb. Depends on the byte ordering! pix_format_rgbAAA, // 30 bit rgb. Depends on the byte ordering! pix_format_rgbBBA, // 32 bit rgb. Depends on the byte ordering! pix_format_bgrAAA, // 30 bit bgr. Depends on the byte ordering! pix_format_bgrABB, // 32 bit bgr. Depends on the byte ordering! pix_format_rgb24, // R-G-B, one byte per color component pix_format_bgr24, // B-G-R, native win32 BMP format. pix_format_rgba32, // R-G-B-A, one byte per color component pix_format_argb32, // A-R-G-B, native MAC format pix_format_abgr32, // A-B-G-R, one byte per color component pix_format_bgra32, // B-G-R-A, native win32 BMP format pix_format_rgb48, // R-G-B, 16 bits per color component pix_format_bgr48, // B-G-R, native win32 BMP format. pix_format_rgba64, // R-G-B-A, 16 bits byte per color component pix_format_argb64, // A-R-G-B, native MAC format pix_format_abgr64, // A-B-G-R, one byte per color component pix_format_bgra64, // B-G-R-A, native win32 BMP format end_of_pix_formats }; //-------------------------------------------------------------input_flag_e // Mouse and keyboard flags. They can be different on different platforms // and the ways they are obtained are also different. But in any case // the system dependent flags should be mapped into these ones. The meaning // of that is as follows. For example, if kbd_ctrl is set it means that the // ctrl key is pressed and being held at the moment. They are also used in // the overridden methods such as on_mouse_move(), on_mouse_button_down(), // on_mouse_button_dbl_click(), on_mouse_button_up(), on_key(). // In the method on_mouse_button_up() the mouse flags have different // meaning. They mean that the respective button is being released, but // the meaning of the keyboard flags remains the same. // There's absolut minimal set of flags is used because they'll be most // probably supported on different platforms. Even the mouse_right flag // is restricted because Mac's mice have only one button, but AFAIK // it can be simulated with holding a special key on the keydoard. enum input_flag_e { mouse_left = 1, mouse_right = 2, kbd_shift = 4, kbd_ctrl = 8 }; //--------------------------------------------------------------key_code_e // Keyboard codes. There's also a restricted set of codes that are most // probably supported on different platforms. Any platform dependent codes // should be converted into these ones. There're only those codes are // defined that cannot be represented as printable ASCII-characters. // All printable ASCII-set can be used in a regular C/C++ manner: // ' ', 'A', '0' '+' and so on. // Since the class is used for creating very simple demo-applications // we don't need very rich possibilities here, just basic ones. // Actually the numeric key codes are taken from the SDL library, so, // the implementation of the SDL support does not require any mapping. enum key_code_e { // ASCII set. Should be supported everywhere key_backspace = 8, key_tab = 9, key_clear = 12, key_return = 13, key_pause = 19, key_escape = 27, // Keypad key_delete = 127, key_kp0 = 256, key_kp1 = 257, key_kp2 = 258, key_kp3 = 259, key_kp4 = 260, key_kp5 = 261, key_kp6 = 262, key_kp7 = 263, key_kp8 = 264, key_kp9 = 265, key_kp_period = 266, key_kp_divide = 267, key_kp_multiply = 268, key_kp_minus = 269, key_kp_plus = 270, key_kp_enter = 271, key_kp_equals = 272, // Arrow-keys and stuff key_up = 273, key_down = 274, key_right = 275, key_left = 276, key_insert = 277, key_home = 278, key_end = 279, key_page_up = 280, key_page_down = 281, // Functional keys. You'd better avoid using // f11...f15 in your applications if you want // the applications to be portable key_f1 = 282, key_f2 = 283, key_f3 = 284, key_f4 = 285, key_f5 = 286, key_f6 = 287, key_f7 = 288, key_f8 = 289, key_f9 = 290, key_f10 = 291, key_f11 = 292, key_f12 = 293, key_f13 = 294, key_f14 = 295, key_f15 = 296, // The possibility of using these keys is // very restricted. Actually it's guaranteed // only in win32_api and win32_sdl implementations key_numlock = 300, key_capslock = 301, key_scrollock = 302, // Phew! end_of_key_codes }; //------------------------------------------------------------------------ // A predeclaration of the platform dependent class. Since we do not // know anything here the only we can have is just a pointer to this // class as a data member. It should be created and destroyed explicitly // in the constructor/destructor of the platform_support class. // Although the pointer to platform_specific is public the application // cannot have access to its members or methods since it does not know // anything about them and it's a perfect incapsulation :-) class platform_specific; //----------------------------------------------------------ctrl_container // A helper class that contains pointers to a number of controls. // This class is used to ease the event handling with controls. // The implementation should simply call the appropriate methods // of this class when appropriate events occur. class ctrl_container { enum max_ctrl_e { max_ctrl = 64 }; public: //-------------------------------------------------------------------- ctrl_container() : m_num_ctrl(0), m_cur_ctrl(-1) {} //-------------------------------------------------------------------- void add(ctrl& c) { if(m_num_ctrl < max_ctrl) { m_ctrl[m_num_ctrl++] = &c; } } //-------------------------------------------------------------------- bool in_rect(double x, double y) { unsigned i; for(i = 0; i < m_num_ctrl; i++) { if(m_ctrl[i]->in_rect(x, y)) return true; } return false; } //-------------------------------------------------------------------- bool on_mouse_button_down(double x, double y) { unsigned i; for(i = 0; i < m_num_ctrl; i++) { if(m_ctrl[i]->on_mouse_button_down(x, y)) return true; } return false; } //-------------------------------------------------------------------- bool on_mouse_button_up(double x, double y) { unsigned i; bool flag = false; for(i = 0; i < m_num_ctrl; i++) { if(m_ctrl[i]->on_mouse_button_up(x, y)) flag = true; } return flag; } //-------------------------------------------------------------------- bool on_mouse_move(double x, double y, bool button_flag) { unsigned i; for(i = 0; i < m_num_ctrl; i++) { if(m_ctrl[i]->on_mouse_move(x, y, button_flag)) return true; } return false; } //-------------------------------------------------------------------- bool on_arrow_keys(bool left, bool right, bool down, bool up) { if(m_cur_ctrl >= 0) { return m_ctrl[m_cur_ctrl]->on_arrow_keys(left, right, down, up); } return false; } //-------------------------------------------------------------------- bool set_cur(double x, double y) { unsigned i; for(i = 0; i < m_num_ctrl; i++) { if(m_ctrl[i]->in_rect(x, y)) { if(m_cur_ctrl != int(i)) { m_cur_ctrl = i; return true; } return false; } } if(m_cur_ctrl != -1) { m_cur_ctrl = -1; return true; } return false; } private: ctrl* m_ctrl[max_ctrl]; unsigned m_num_ctrl; int m_cur_ctrl; }; //---------------------------------------------------------platform_support // This class is a base one to the apllication classes. It can be used // as follows: // // class the_application : public agg::platform_support // { // public: // the_application(unsigned bpp, bool flip_y) : // platform_support(bpp, flip_y) // . . . // // //override stuff . . . // virtual void on_init() // { // . . . // } // // virtual void on_draw() // { // . . . // } // // virtual void on_resize(int sx, int sy) // { // . . . // } // // . . . and so on, see virtual functions // // // //any your own stuff . . . // }; // // // int agg_main(int argc, char* argv[]) // { // the_application app(pix_format_rgb24, true); // app.caption("AGG Example. Lion"); // // if(app.init(500, 400, agg::window_resize)) // { // return app.run(); // } // return 1; // } // // The reason to have agg_main() instead of just main() is that SDL // for Windows requires including SDL.h if you define main(). Since // the demo applications cannot rely on any platform/library specific // stuff it's impossible to include SDL.h into the application files. // The demo applications are simple and their use is restricted, so, // this approach is quite reasonable. // class platform_support { public: enum max_images_e { max_images = 16 }; // format - see enum pix_format_e {}; // flip_y - true if you want to have the Y-axis flipped vertically. platform_support(pix_format_e format, bool flip_y); virtual ~platform_support(); // Setting the windows caption (title). Should be able // to be called at least before calling init(). // It's perfect if they can be called anytime. void caption(const char* cap); const char* caption() const { return m_caption; } //-------------------------------------------------------------------- // These 3 methods handle working with images. The image // formats are the simplest ones, such as .BMP in Windows or // .ppm in Linux. In the applications the names of the files // should not have any file extensions. Method load_img() can // be called before init(), so, the application could be able // to determine the initial size of the window depending on // the size of the loaded image. // The argument "idx" is the number of the image 0...max_images-1 bool load_img(unsigned idx, const char* file); bool save_img(unsigned idx, const char* file); bool create_img(unsigned idx, unsigned width=0, unsigned height=0); //-------------------------------------------------------------------- // init() and run(). See description before the class for details. // The necessity of calling init() after creation is that it's // impossible to call the overridden virtual function (on_init()) // from the constructor. On the other hand it's very useful to have // some on_init() event handler when the window is created but // not yet displayed. The rbuf_window() method (see below) is // accessible from on_init(). bool init(unsigned width, unsigned height, unsigned flags); int run(); //-------------------------------------------------------------------- // The very same parameters that were used in the constructor pix_format_e format() const { return m_format; } bool flip_y() const { return m_flip_y; } unsigned bpp() const { return m_bpp; } //-------------------------------------------------------------------- // The following provides a very simple mechanism of doing someting // in background. It's not multithreading. When wait_mode is true // the class waits for the events and it does not ever call on_idle(). // When it's false it calls on_idle() when the event queue is empty. // The mode can be changed anytime. This mechanism is satisfactory // to create very simple animations. bool wait_mode() const { return m_wait_mode; } void wait_mode(bool wait_mode) { m_wait_mode = wait_mode; } //-------------------------------------------------------------------- // These two functions control updating of the window. // force_redraw() is an analog of the Win32 InvalidateRect() function. // Being called it sets a flag (or sends a message) which results // in calling on_draw() and updating the content of the window // when the next event cycle comes. // update_window() results in just putting immediately the content // of the currently rendered buffer to the window without calling // on_draw(). void force_redraw(); void update_window(); //-------------------------------------------------------------------- // So, finally, how to draw anythig with AGG? Very simple. // rbuf_window() returns a reference to the main rendering // buffer which can be attached to any rendering class. // rbuf_img() returns a reference to the previously created // or loaded image buffer (see load_img()). The image buffers // are not displayed directly, they should be copied to or // combined somehow with the rbuf_window(). rbuf_window() is // the only buffer that can be actually displayed. rendering_buffer& rbuf_window() { return m_rbuf_window; } rendering_buffer& rbuf_img(unsigned idx) { return m_rbuf_img[idx]; } //-------------------------------------------------------------------- // Returns file extension used in the implementation for the particular // system. const char* img_ext() const; //-------------------------------------------------------------------- void copy_img_to_window(unsigned idx) { if(idx < max_images && rbuf_img(idx).buf()) { rbuf_window().copy_from(rbuf_img(idx)); } } //-------------------------------------------------------------------- void copy_window_to_img(unsigned idx) { if(idx < max_images) { create_img(idx, rbuf_window().width(), rbuf_window().height()); rbuf_img(idx).copy_from(rbuf_window()); } } //-------------------------------------------------------------------- void copy_img_to_img(unsigned idx_to, unsigned idx_from) { if(idx_from < max_images && idx_to < max_images && rbuf_img(idx_from).buf()) { create_img(idx_to, rbuf_img(idx_from).width(), rbuf_img(idx_from).height()); rbuf_img(idx_to).copy_from(rbuf_img(idx_from)); } } //-------------------------------------------------------------------- // Event handlers. They are not pure functions, so you don't have // to override them all. // In my demo applications these functions are defined inside // the the_application class (implicit inlining) which is in general // very bad practice, I mean vitual inline methods. At least it does // not make sense. // But in this case it's quite appropriate bacause we have the only // instance of the the_application class and it is in the same file // where this class is defined. virtual void on_init(); virtual void on_resize(int sx, int sy); virtual void on_idle(); virtual void on_mouse_move(int x, int y, unsigned flags); virtual void on_mouse_button_down(int x, int y, unsigned flags); virtual void on_mouse_button_up(int x, int y, unsigned flags); virtual void on_key(int x, int y, unsigned key, unsigned flags); virtual void on_ctrl_change(); virtual void on_draw(); virtual void on_post_draw(void* raw_handler); //-------------------------------------------------------------------- // Adding control elements. A control element once added will be // working and reacting to the mouse and keyboard events. Still, you // will have to render them in the on_draw() using function // render_ctrl() because platform_support doesn't know anything about // renderers you use. The controls will be also scaled automatically // if they provide a proper scaling mechanism (all the controls // included into the basic AGG package do). // If you don't need a particular control to be scaled automatically // call ctrl::no_transform() after adding. void add_ctrl(ctrl& c) { m_ctrls.add(c); c.transform(m_resize_mtx); } //-------------------------------------------------------------------- // Auxiliary functions. trans_affine_resizing() modifier sets up the resizing // matrix on the basis of the given width and height and the initial // width and height of the window. The implementation should simply // call this function every time when it catches the resizing event // passing in the new values of width and height of the window. // Nothing prevents you from "cheating" the scaling matrix if you // call this function from somewhere with wrong arguments. // trans_affine_resizing() accessor simply returns current resizing matrix // which can be used to apply additional scaling of any of your // stuff when the window is being resized. // width(), height(), initial_width(), and initial_height() must be // clear to understand with no comments :-) void trans_affine_resizing(int width, int height) { if(m_window_flags & window_keep_aspect_ratio) { //double sx = double(width) / double(m_initial_width); //double sy = double(height) / double(m_initial_height); //if(sy < sx) sx = sy; //m_resize_mtx = trans_affine_scaling(sx, sx); trans_viewport vp; vp.preserve_aspect_ratio(0.5, 0.5, aspect_ratio_meet); vp.device_viewport(0, 0, width, height); vp.world_viewport(0, 0, m_initial_width, m_initial_height); m_resize_mtx = vp.to_affine(); } else { m_resize_mtx = trans_affine_scaling( double(width) / double(m_initial_width), double(height) / double(m_initial_height)); } } const trans_affine& trans_affine_resizing() const { return m_resize_mtx; } double width() const { return m_rbuf_window.width(); } double height() const { return m_rbuf_window.height(); } double initial_width() const { return m_initial_width; } double initial_height() const { return m_initial_height; } unsigned window_flags() const { return m_window_flags; } //-------------------------------------------------------------------- // Get raw display handler depending on the system. // For win32 its an HDC, for other systems it can be a pointer to some // structure. See the implementation files for detals. // It's provided "as is", so, first you should check if it's not null. // If it's null the raw_display_handler is not supported. Also, there's // no guarantee that this function is implemented, so, in some // implementations you may have simply an unresolved symbol when linking. void* raw_display_handler(); //-------------------------------------------------------------------- // display message box or print the message to the console // (depending on implementation) void message(const char* msg); //-------------------------------------------------------------------- // Stopwatch functions. Function elapsed_time() returns time elapsed // since the latest start_timer() invocation in millisecods. // The resolutoin depends on the implementation. // In Win32 it uses QueryPerformanceFrequency() / QueryPerformanceCounter(). void start_timer(); double elapsed_time() const; //-------------------------------------------------------------------- // Get the full file name. In most cases it simply returns // file_name. As it's appropriate in many systems if you open // a file by its name without specifying the path, it tries to // open it in the current directory. The demos usually expect // all the supplementary files to be placed in the current // directory, that is usually coincides with the directory where // the the executable is. However, in some systems (BeOS) it's not so. // For those kinds of systems full_file_name() can help access files // preserving commonly used policy. // So, it's a good idea to use in the demos the following: // FILE* fd = fopen(full_file_name("some.file"), "r"); // instead of // FILE* fd = fopen("some.file", "r"); const char* full_file_name(const char* file_name); public: platform_specific* m_specific; ctrl_container m_ctrls; // Sorry, I'm too tired to describe the private // data membders. See the implementations for different // platforms for details. private: platform_support(const platform_support&); const platform_support& operator = (const platform_support&); pix_format_e m_format; unsigned m_bpp; rendering_buffer m_rbuf_window; rendering_buffer m_rbuf_img[max_images]; unsigned m_window_flags; bool m_wait_mode; bool m_flip_y; char m_caption[256]; int m_initial_width; int m_initial_height; trans_affine m_resize_mtx; }; } #endif ���������������������������������������������������������agg-2.5+dfsg1/include/platform/mac/�����������������������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�017265� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/platform/mac/agg_mac_pmap.h���������������������������������������������������0000644�0000000�0000000�00000005556�10703246330�022044� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Copyright (C) 2002 Hansruedi Baer (MacOS support) // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_MAC_PMAP_INCLUDED #define AGG_MAC_PMAP_INCLUDED #include <stdio.h> #include <Carbon.h> namespace agg { enum org_e { org_mono8 = 8, org_color16 = 16, org_color24 = 24, org_color32 = 32 }; class pixel_map { public: ~pixel_map(); pixel_map(); public: void destroy(); void create(unsigned width, unsigned height, org_e org, unsigned clear_val=255); void clear(unsigned clear_val=255); bool load_from_qt(const char* filename); bool save_as_qt(const char* filename) const; void draw(WindowRef window, const Rect* device_rect=0, const Rect* bmp_rect=0) const; void draw(WindowRef window, int x, int y, double scale=1.0) const; void blend(WindowRef window, const Rect* device_rect=0, const Rect* bmp_rect=0) const; void blend(WindowRef window, int x, int y, double scale=1.0) const; unsigned char* buf(); unsigned width() const; unsigned height() const; int row_bytes() const; unsigned bpp() const { return m_bpp; } //Auxiliary static functions static unsigned calc_row_len(unsigned width, unsigned bits_per_pixel); private: pixel_map(const pixel_map&); const pixel_map& operator = (const pixel_map&); private: GWorldPtr m_pmap; unsigned char* m_buf; unsigned m_bpp; unsigned m_img_size; }; } #endif ��������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/platform/win32/���������������������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�017467� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/platform/win32/agg_win32_bmp.h������������������������������������������������0000644�0000000�0000000�00000010453�10703246330�022261� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_WIN32_BMP_INCLUDED #define AGG_WIN32_BMP_INCLUDED #include <windows.h> #include <stdio.h> namespace agg { enum org_e { org_mono8 = 8, org_color16 = 16, org_color24 = 24, org_color32 = 32, org_color48 = 48, org_color64 = 64 }; class pixel_map { public: ~pixel_map(); pixel_map(); public: void destroy(); void create(unsigned width, unsigned height, org_e org, unsigned clear_val=256); HBITMAP create_dib_section(HDC h_dc, unsigned width, unsigned height, org_e org, unsigned clear_val=256); void clear(unsigned clear_val=256); void attach_to_bmp(BITMAPINFO* bmp); BITMAPINFO* bitmap_info() { return m_bmp; } bool load_from_bmp(FILE* fd); bool save_as_bmp(FILE* fd) const; bool load_from_bmp(const char* filename); bool save_as_bmp(const char* filename) const; void draw(HDC h_dc, const RECT* device_rect=0, const RECT* bmp_rect=0) const; void draw(HDC h_dc, int x, int y, double scale=1.0) const; void blend(HDC h_dc, const RECT* device_rect=0, const RECT* bmp_rect=0) const; void blend(HDC h_dc, int x, int y, double scale=1.0) const; unsigned char* buf(); unsigned width() const; unsigned height() const; int stride() const; unsigned bpp() const { return m_bpp; } //Auxiliary static functions static unsigned calc_full_size(BITMAPINFO *bmp); static unsigned calc_header_size(BITMAPINFO *bmp); static unsigned calc_palette_size(unsigned clr_used, unsigned bits_per_pixel); static unsigned calc_palette_size(BITMAPINFO *bmp); static unsigned char* calc_img_ptr(BITMAPINFO *bmp); static BITMAPINFO* create_bitmap_info(unsigned width, unsigned height, unsigned bits_per_pixel); static void create_gray_scale_palette(BITMAPINFO *bmp); static unsigned calc_row_len(unsigned width, unsigned bits_per_pixel); private: pixel_map(const pixel_map&); const pixel_map& operator = (const pixel_map&); void create_from_bmp(BITMAPINFO *bmp); HBITMAP create_dib_section_from_args(HDC h_dc, unsigned width, unsigned height, unsigned bits_per_pixel); private: BITMAPINFO* m_bmp; unsigned char* m_buf; unsigned m_bpp; bool m_is_internal; unsigned m_img_size; unsigned m_full_size; }; } #endif ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/util/�������������������������������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�015656� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/util/Makefile.am��������������������������������������������������������������0000644�0000000�0000000�00000000171�10703246330�017711� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������myincludedir = $(includedir)/agg2/util myinclude_HEADERS = agg_color_conv.h agg_color_conv_rgb8.h agg_color_conv_rgb16.h �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/util/agg_color_conv.h���������������������������������������������������������0000644�0000000�0000000�00000005114�10703246330�021011� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_COLOR_CONV_INCLUDED #define AGG_COLOR_CONV_INCLUDED #include <string.h> #include "agg_basics.h" #include "agg_rendering_buffer.h" namespace agg { //--------------------------------------------------------------color_conv template<class RenBuf, class CopyRow> void color_conv(RenBuf* dst, const RenBuf* src, CopyRow copy_row_functor) { unsigned width = src->width(); unsigned height = src->height(); if(dst->width() < width) width = dst->width(); if(dst->height() < height) height = dst->height(); if(width) { unsigned y; for(y = 0; y < height; y++) { copy_row_functor(dst->row_ptr(0, y, width), src->row_ptr(y), width); } } } //---------------------------------------------------------color_conv_row template<class CopyRow> void color_conv_row(int8u* dst, const int8u* src, unsigned width, CopyRow copy_row_functor) { copy_row_functor(dst, src, width); } //---------------------------------------------------------color_conv_same template<int BPP> class color_conv_same { public: void operator () (int8u* dst, const int8u* src, unsigned width) const { memmove(dst, src, width*BPP); } }; } #endif ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/util/agg_color_conv_rgb16.h���������������������������������������������������0000644�0000000�0000000�00000025465�10703246330�022025� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- // // This part of the library 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. // //---------------------------------------------------------------------------- // // A set of functors used with color_conv(). See file agg_color_conv.h // These functors can convert images with up to 8 bits per component. // Use convertors in the following way: // // agg::color_conv(dst, src, agg::color_conv_XXXX_to_YYYY()); //---------------------------------------------------------------------------- #ifndef AGG_COLOR_CONV_RGB16_INCLUDED #define AGG_COLOR_CONV_RGB16_INCLUDED #include "agg_basics.h" #include "agg_color_conv.h" namespace agg { //-------------------------------------------------color_conv_gray16_to_gray8 class color_conv_gray16_to_gray8 { public: void operator () (int8u* dst, const int8u* src, unsigned width) const { int16u* s = (int16u*)src; do { *dst++ = *s++ >> 8; } while(--width); } }; //-----------------------------------------------------color_conv_rgb24_rgb48 template<int I1, int I3> class color_conv_rgb24_rgb48 { public: void operator () (int8u* dst, const int8u* src, unsigned width) const { int16u* d = (int16u*)dst; do { *d++ = (src[I1] << 8) | src[I1]; *d++ = (src[1] << 8) | src[1] ; *d++ = (src[I3] << 8) | src[I3]; src += 3; } while(--width); } }; typedef color_conv_rgb24_rgb48<0,2> color_conv_rgb24_to_rgb48; typedef color_conv_rgb24_rgb48<0,2> color_conv_bgr24_to_bgr48; typedef color_conv_rgb24_rgb48<2,0> color_conv_rgb24_to_bgr48; typedef color_conv_rgb24_rgb48<2,0> color_conv_bgr24_to_rgb48; //-----------------------------------------------------color_conv_rgb24_rgb48 template<int I1, int I3> class color_conv_rgb48_rgb24 { public: void operator () (int8u* dst, const int8u* src, unsigned width) const { const int16u* s = (const int16u*)src; do { *dst++ = s[I1] >> 8; *dst++ = s[1] >> 8; *dst++ = s[I3] >> 8; s += 3; } while(--width); } }; typedef color_conv_rgb48_rgb24<0,2> color_conv_rgb48_to_rgb24; typedef color_conv_rgb48_rgb24<0,2> color_conv_bgr48_to_bgr24; typedef color_conv_rgb48_rgb24<2,0> color_conv_rgb48_to_bgr24; typedef color_conv_rgb48_rgb24<2,0> color_conv_bgr48_to_rgb24; //----------------------------------------------color_conv_rgbAAA_rgb24 template<int R, int B> class color_conv_rgbAAA_rgb24 { public: void operator () (int8u* dst, const int8u* src, unsigned width) const { do { int32u rgb = *(int32u*)src; dst[R] = int8u(rgb >> 22); dst[1] = int8u(rgb >> 12); dst[B] = int8u(rgb >> 2); src += 4; dst += 3; } while(--width); } }; typedef color_conv_rgbAAA_rgb24<0,2> color_conv_rgbAAA_to_rgb24; typedef color_conv_rgbAAA_rgb24<2,0> color_conv_rgbAAA_to_bgr24; typedef color_conv_rgbAAA_rgb24<2,0> color_conv_bgrAAA_to_rgb24; typedef color_conv_rgbAAA_rgb24<0,2> color_conv_bgrAAA_to_bgr24; //----------------------------------------------color_conv_rgbBBA_rgb24 template<int R, int B> class color_conv_rgbBBA_rgb24 { public: void operator () (int8u* dst, const int8u* src, unsigned width) const { do { int32u rgb = *(int32u*)src; dst[R] = int8u(rgb >> 24); dst[1] = int8u(rgb >> 13); dst[B] = int8u(rgb >> 2); src += 4; dst += 3; } while(--width); } }; typedef color_conv_rgbBBA_rgb24<0,2> color_conv_rgbBBA_to_rgb24; typedef color_conv_rgbBBA_rgb24<2,0> color_conv_rgbBBA_to_bgr24; //----------------------------------------------color_conv_bgrABB_rgb24 template<int B, int R> class color_conv_bgrABB_rgb24 { public: void operator () (int8u* dst, const int8u* src, unsigned width) const { do { int32u bgr = *(int32u*)src; dst[R] = int8u(bgr >> 3); dst[1] = int8u(bgr >> 14); dst[B] = int8u(bgr >> 24); src += 4; dst += 3; } while(--width); } }; typedef color_conv_bgrABB_rgb24<2,0> color_conv_bgrABB_to_rgb24; typedef color_conv_bgrABB_rgb24<0,2> color_conv_bgrABB_to_bgr24; //-------------------------------------------------color_conv_rgba64_rgba32 template<int I1, int I2, int I3, int I4> class color_conv_rgba64_rgba32 { public: void operator () (int8u* dst, const int8u* src, unsigned width) const { do { *dst++ = int8u(((int16u*)src)[I1] >> 8); *dst++ = int8u(((int16u*)src)[I2] >> 8); *dst++ = int8u(((int16u*)src)[I3] >> 8); *dst++ = int8u(((int16u*)src)[I4] >> 8); src += 8; } while(--width); } }; //------------------------------------------------------------------------ typedef color_conv_rgba64_rgba32<0,1,2,3> color_conv_rgba64_to_rgba32; //----color_conv_rgba64_to_rgba32 typedef color_conv_rgba64_rgba32<0,1,2,3> color_conv_argb64_to_argb32; //----color_conv_argb64_to_argb32 typedef color_conv_rgba64_rgba32<0,1,2,3> color_conv_bgra64_to_bgra32; //----color_conv_bgra64_to_bgra32 typedef color_conv_rgba64_rgba32<0,1,2,3> color_conv_abgr64_to_abgr32; //----color_conv_abgr64_to_abgr32 typedef color_conv_rgba64_rgba32<0,3,2,1> color_conv_argb64_to_abgr32; //----color_conv_argb64_to_abgr32 typedef color_conv_rgba64_rgba32<3,2,1,0> color_conv_argb64_to_bgra32; //----color_conv_argb64_to_bgra32 typedef color_conv_rgba64_rgba32<1,2,3,0> color_conv_argb64_to_rgba32; //----color_conv_argb64_to_rgba32 typedef color_conv_rgba64_rgba32<3,0,1,2> color_conv_bgra64_to_abgr32; //----color_conv_bgra64_to_abgr32 typedef color_conv_rgba64_rgba32<3,2,1,0> color_conv_bgra64_to_argb32; //----color_conv_bgra64_to_argb32 typedef color_conv_rgba64_rgba32<2,1,0,3> color_conv_bgra64_to_rgba32; //----color_conv_bgra64_to_rgba32 typedef color_conv_rgba64_rgba32<3,2,1,0> color_conv_rgba64_to_abgr32; //----color_conv_rgba64_to_abgr32 typedef color_conv_rgba64_rgba32<3,0,1,2> color_conv_rgba64_to_argb32; //----color_conv_rgba64_to_argb32 typedef color_conv_rgba64_rgba32<2,1,0,3> color_conv_rgba64_to_bgra32; //----color_conv_rgba64_to_bgra32 typedef color_conv_rgba64_rgba32<0,3,2,1> color_conv_abgr64_to_argb32; //----color_conv_abgr64_to_argb32 typedef color_conv_rgba64_rgba32<1,2,3,0> color_conv_abgr64_to_bgra32; //----color_conv_abgr64_to_bgra32 typedef color_conv_rgba64_rgba32<3,2,1,0> color_conv_abgr64_to_rgba32; //----color_conv_abgr64_to_rgba32 //--------------------------------------------color_conv_rgb24_rgba64 template<int I1, int I2, int I3, int A> class color_conv_rgb24_rgba64 { public: void operator () (int8u* dst, const int8u* src, unsigned width) const { int16u* d = (int16u*)dst; do { d[I1] = (src[0] << 8) | src[0]; d[I2] = (src[1] << 8) | src[1]; d[I3] = (src[2] << 8) | src[2]; d[A] = 65535; d += 4; src += 3; } while(--width); } }; //------------------------------------------------------------------------ typedef color_conv_rgb24_rgba64<1,2,3,0> color_conv_rgb24_to_argb64; //----color_conv_rgb24_to_argb64 typedef color_conv_rgb24_rgba64<3,2,1,0> color_conv_rgb24_to_abgr64; //----color_conv_rgb24_to_abgr64 typedef color_conv_rgb24_rgba64<2,1,0,3> color_conv_rgb24_to_bgra64; //----color_conv_rgb24_to_bgra64 typedef color_conv_rgb24_rgba64<0,1,2,3> color_conv_rgb24_to_rgba64; //----color_conv_rgb24_to_rgba64 typedef color_conv_rgb24_rgba64<3,2,1,0> color_conv_bgr24_to_argb64; //----color_conv_bgr24_to_argb64 typedef color_conv_rgb24_rgba64<1,2,3,0> color_conv_bgr24_to_abgr64; //----color_conv_bgr24_to_abgr64 typedef color_conv_rgb24_rgba64<0,1,2,3> color_conv_bgr24_to_bgra64; //----color_conv_bgr24_to_bgra64 typedef color_conv_rgb24_rgba64<2,1,0,3> color_conv_bgr24_to_rgba64; //----color_conv_bgr24_to_rgba64 template<int R, int B> class color_conv_rgb24_gray16 { public: void operator () (int8u* dst, const int8u* src, unsigned width) const { int16u* d = (int16u*)dst; do { *d++ = src[R]*77 + src[1]*150 + src[B]*29; src += 3; } while(--width); } }; typedef color_conv_rgb24_gray16<0,2> color_conv_rgb24_to_gray16; typedef color_conv_rgb24_gray16<2,0> color_conv_bgr24_to_gray16; } #endif �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/include/util/agg_color_conv_rgb8.h����������������������������������������������������0000644�0000000�0000000�00000043377�10703246330�021750� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- // // A set of functors used with color_conv(). See file agg_color_conv.h // These functors can convert images with up to 8 bits per component. // Use convertors in the following way: // // agg::color_conv(dst, src, agg::color_conv_XXXX_to_YYYY()); // whare XXXX and YYYY can be any of: // rgb24 // bgr24 // rgba32 // abgr32 // argb32 // bgra32 // rgb555 // rgb565 //---------------------------------------------------------------------------- #ifndef AGG_COLOR_CONV_RGB8_INCLUDED #define AGG_COLOR_CONV_RGB8_INCLUDED #include "agg_basics.h" #include "agg_color_conv.h" namespace agg { //-----------------------------------------------------color_conv_rgb24 class color_conv_rgb24 { public: void operator () (int8u* dst, const int8u* src, unsigned width) const { do { *dst++ = src[2]; *dst++ = src[1]; *dst++ = src[0]; src += 3; } while(--width); } }; typedef color_conv_rgb24 color_conv_rgb24_to_bgr24; typedef color_conv_rgb24 color_conv_bgr24_to_rgb24; typedef color_conv_same<3> color_conv_bgr24_to_bgr24; typedef color_conv_same<3> color_conv_rgb24_to_rgb24; //------------------------------------------------------color_conv_rgba32 template<int I1, int I2, int I3, int I4> class color_conv_rgba32 { public: void operator () (int8u* dst, const int8u* src, unsigned width) const { do { *dst++ = src[I1]; *dst++ = src[I2]; *dst++ = src[I3]; *dst++ = src[I4]; src += 4; } while(--width); } }; //------------------------------------------------------------------------ typedef color_conv_rgba32<0,3,2,1> color_conv_argb32_to_abgr32; //----color_conv_argb32_to_abgr32 typedef color_conv_rgba32<3,2,1,0> color_conv_argb32_to_bgra32; //----color_conv_argb32_to_bgra32 typedef color_conv_rgba32<1,2,3,0> color_conv_argb32_to_rgba32; //----color_conv_argb32_to_rgba32 typedef color_conv_rgba32<3,0,1,2> color_conv_bgra32_to_abgr32; //----color_conv_bgra32_to_abgr32 typedef color_conv_rgba32<3,2,1,0> color_conv_bgra32_to_argb32; //----color_conv_bgra32_to_argb32 typedef color_conv_rgba32<2,1,0,3> color_conv_bgra32_to_rgba32; //----color_conv_bgra32_to_rgba32 typedef color_conv_rgba32<3,2,1,0> color_conv_rgba32_to_abgr32; //----color_conv_rgba32_to_abgr32 typedef color_conv_rgba32<3,0,1,2> color_conv_rgba32_to_argb32; //----color_conv_rgba32_to_argb32 typedef color_conv_rgba32<2,1,0,3> color_conv_rgba32_to_bgra32; //----color_conv_rgba32_to_bgra32 typedef color_conv_rgba32<0,3,2,1> color_conv_abgr32_to_argb32; //----color_conv_abgr32_to_argb32 typedef color_conv_rgba32<1,2,3,0> color_conv_abgr32_to_bgra32; //----color_conv_abgr32_to_bgra32 typedef color_conv_rgba32<3,2,1,0> color_conv_abgr32_to_rgba32; //----color_conv_abgr32_to_rgba32 //------------------------------------------------------------------------ typedef color_conv_same<4> color_conv_rgba32_to_rgba32; //----color_conv_rgba32_to_rgba32 typedef color_conv_same<4> color_conv_argb32_to_argb32; //----color_conv_argb32_to_argb32 typedef color_conv_same<4> color_conv_bgra32_to_bgra32; //----color_conv_bgra32_to_bgra32 typedef color_conv_same<4> color_conv_abgr32_to_abgr32; //----color_conv_abgr32_to_abgr32 //--------------------------------------------color_conv_rgb24_rgba32 template<int I1, int I2, int I3, int A> class color_conv_rgb24_rgba32 { public: void operator () (int8u* dst, const int8u* src, unsigned width) const { do { dst[I1] = *src++; dst[I2] = *src++; dst[I3] = *src++; dst[A] = 255; dst += 4; } while(--width); } }; //------------------------------------------------------------------------ typedef color_conv_rgb24_rgba32<1,2,3,0> color_conv_rgb24_to_argb32; //----color_conv_rgb24_to_argb32 typedef color_conv_rgb24_rgba32<3,2,1,0> color_conv_rgb24_to_abgr32; //----color_conv_rgb24_to_abgr32 typedef color_conv_rgb24_rgba32<2,1,0,3> color_conv_rgb24_to_bgra32; //----color_conv_rgb24_to_bgra32 typedef color_conv_rgb24_rgba32<0,1,2,3> color_conv_rgb24_to_rgba32; //----color_conv_rgb24_to_rgba32 typedef color_conv_rgb24_rgba32<3,2,1,0> color_conv_bgr24_to_argb32; //----color_conv_bgr24_to_argb32 typedef color_conv_rgb24_rgba32<1,2,3,0> color_conv_bgr24_to_abgr32; //----color_conv_bgr24_to_abgr32 typedef color_conv_rgb24_rgba32<0,1,2,3> color_conv_bgr24_to_bgra32; //----color_conv_bgr24_to_bgra32 typedef color_conv_rgb24_rgba32<2,1,0,3> color_conv_bgr24_to_rgba32; //----color_conv_bgr24_to_rgba32 //-------------------------------------------------color_conv_rgba32_rgb24 template<int I1, int I2, int I3> class color_conv_rgba32_rgb24 { public: void operator () (int8u* dst, const int8u* src, unsigned width) const { do { *dst++ = src[I1]; *dst++ = src[I2]; *dst++ = src[I3]; src += 4; } while(--width); } }; //------------------------------------------------------------------------ typedef color_conv_rgba32_rgb24<1,2,3> color_conv_argb32_to_rgb24; //----color_conv_argb32_to_rgb24 typedef color_conv_rgba32_rgb24<3,2,1> color_conv_abgr32_to_rgb24; //----color_conv_abgr32_to_rgb24 typedef color_conv_rgba32_rgb24<2,1,0> color_conv_bgra32_to_rgb24; //----color_conv_bgra32_to_rgb24 typedef color_conv_rgba32_rgb24<0,1,2> color_conv_rgba32_to_rgb24; //----color_conv_rgba32_to_rgb24 typedef color_conv_rgba32_rgb24<3,2,1> color_conv_argb32_to_bgr24; //----color_conv_argb32_to_bgr24 typedef color_conv_rgba32_rgb24<1,2,3> color_conv_abgr32_to_bgr24; //----color_conv_abgr32_to_bgr24 typedef color_conv_rgba32_rgb24<0,1,2> color_conv_bgra32_to_bgr24; //----color_conv_bgra32_to_bgr24 typedef color_conv_rgba32_rgb24<2,1,0> color_conv_rgba32_to_bgr24; //----color_conv_rgba32_to_bgr24 //------------------------------------------------color_conv_rgb555_rgb24 template<int R, int B> class color_conv_rgb555_rgb24 { public: void operator () (int8u* dst, const int8u* src, unsigned width) const { do { unsigned rgb = *(int16u*)src; dst[R] = (int8u)((rgb >> 7) & 0xF8); dst[1] = (int8u)((rgb >> 2) & 0xF8); dst[B] = (int8u)((rgb << 3) & 0xF8); src += 2; dst += 3; } while(--width); } }; //------------------------------------------------------------------------ typedef color_conv_rgb555_rgb24<2,0> color_conv_rgb555_to_bgr24; //----color_conv_rgb555_to_bgr24 typedef color_conv_rgb555_rgb24<0,2> color_conv_rgb555_to_rgb24; //----color_conv_rgb555_to_rgb24 //-------------------------------------------------color_conv_rgb24_rgb555 template<int R, int B> class color_conv_rgb24_rgb555 { public: void operator () (int8u* dst, const int8u* src, unsigned width) const { do { *(int16u*)dst = (int16u)(((unsigned(src[R]) << 7) & 0x7C00) | ((unsigned(src[1]) << 2) & 0x3E0) | ((unsigned(src[B]) >> 3))); src += 3; dst += 2; } while(--width); } }; //------------------------------------------------------------------------ typedef color_conv_rgb24_rgb555<2,0> color_conv_bgr24_to_rgb555; //----color_conv_bgr24_to_rgb555 typedef color_conv_rgb24_rgb555<0,2> color_conv_rgb24_to_rgb555; //----color_conv_rgb24_to_rgb555 //-------------------------------------------------color_conv_rgb565_rgb24 template<int R, int B> class color_conv_rgb565_rgb24 { public: void operator () (int8u* dst, const int8u* src, unsigned width) const { do { unsigned rgb = *(int16u*)src; dst[R] = (rgb >> 8) & 0xF8; dst[1] = (rgb >> 3) & 0xFC; dst[B] = (rgb << 3) & 0xF8; src += 2; dst += 3; } while(--width); } }; //------------------------------------------------------------------------ typedef color_conv_rgb565_rgb24<2,0> color_conv_rgb565_to_bgr24; //----color_conv_rgb565_to_bgr24 typedef color_conv_rgb565_rgb24<0,2> color_conv_rgb565_to_rgb24; //----color_conv_rgb565_to_rgb24 //-------------------------------------------------color_conv_rgb24_rgb565 template<int R, int B> class color_conv_rgb24_rgb565 { public: void operator () (int8u* dst, const int8u* src, unsigned width) const { do { *(int16u*)dst = (int16u)(((unsigned(src[R]) << 8) & 0xF800) | ((unsigned(src[1]) << 3) & 0x7E0) | ((unsigned(src[B]) >> 3))); src += 3; dst += 2; } while(--width); } }; //------------------------------------------------------------------------ typedef color_conv_rgb24_rgb565<2,0> color_conv_bgr24_to_rgb565; //----color_conv_bgr24_to_rgb565 typedef color_conv_rgb24_rgb565<0,2> color_conv_rgb24_to_rgb565; //----color_conv_rgb24_to_rgb565 //-------------------------------------------------color_conv_rgb555_rgba32 template<int R, int G, int B, int A> class color_conv_rgb555_rgba32 { public: void operator () (int8u* dst, const int8u* src, unsigned width) const { do { int rgb = *(int16*)src; dst[R] = (int8u)((rgb >> 7) & 0xF8); dst[G] = (int8u)((rgb >> 2) & 0xF8); dst[B] = (int8u)((rgb << 3) & 0xF8); dst[A] = (int8u)(rgb >> 15); src += 2; dst += 4; } while(--width); } }; //------------------------------------------------------------------------ typedef color_conv_rgb555_rgba32<1,2,3,0> color_conv_rgb555_to_argb32; //----color_conv_rgb555_to_argb32 typedef color_conv_rgb555_rgba32<3,2,1,0> color_conv_rgb555_to_abgr32; //----color_conv_rgb555_to_abgr32 typedef color_conv_rgb555_rgba32<2,1,0,3> color_conv_rgb555_to_bgra32; //----color_conv_rgb555_to_bgra32 typedef color_conv_rgb555_rgba32<0,1,2,3> color_conv_rgb555_to_rgba32; //----color_conv_rgb555_to_rgba32 //------------------------------------------------color_conv_rgba32_rgb555 template<int R, int G, int B, int A> class color_conv_rgba32_rgb555 { public: void operator () (int8u* dst, const int8u* src, unsigned width) const { do { *(int16u*)dst = (int16u)(((unsigned(src[R]) << 7) & 0x7C00) | ((unsigned(src[G]) << 2) & 0x3E0) | ((unsigned(src[B]) >> 3)) | ((unsigned(src[A]) << 8) & 0x8000)); src += 4; dst += 2; } while(--width); } }; //------------------------------------------------------------------------ typedef color_conv_rgba32_rgb555<1,2,3,0> color_conv_argb32_to_rgb555; //----color_conv_argb32_to_rgb555 typedef color_conv_rgba32_rgb555<3,2,1,0> color_conv_abgr32_to_rgb555; //----color_conv_abgr32_to_rgb555 typedef color_conv_rgba32_rgb555<2,1,0,3> color_conv_bgra32_to_rgb555; //----color_conv_bgra32_to_rgb555 typedef color_conv_rgba32_rgb555<0,1,2,3> color_conv_rgba32_to_rgb555; //----color_conv_rgba32_to_rgb555 //------------------------------------------------color_conv_rgb565_rgba32 template<int R, int G, int B, int A> class color_conv_rgb565_rgba32 { public: void operator () (int8u* dst, const int8u* src, unsigned width) const { do { int rgb = *(int16*)src; dst[R] = (rgb >> 8) & 0xF8; dst[G] = (rgb >> 3) & 0xFC; dst[B] = (rgb << 3) & 0xF8; dst[A] = 255; src += 2; dst += 4; } while(--width); } }; //------------------------------------------------------------------------ typedef color_conv_rgb565_rgba32<1,2,3,0> color_conv_rgb565_to_argb32; //----color_conv_rgb565_to_argb32 typedef color_conv_rgb565_rgba32<3,2,1,0> color_conv_rgb565_to_abgr32; //----color_conv_rgb565_to_abgr32 typedef color_conv_rgb565_rgba32<2,1,0,3> color_conv_rgb565_to_bgra32; //----color_conv_rgb565_to_bgra32 typedef color_conv_rgb565_rgba32<0,1,2,3> color_conv_rgb565_to_rgba32; //----color_conv_rgb565_to_rgba32 //------------------------------------------------color_conv_rgba32_rgb565 template<int R, int G, int B> class color_conv_rgba32_rgb565 { public: void operator () (int8u* dst, const int8u* src, unsigned width) const { do { *(int16u*)dst = (int16u)(((unsigned(src[R]) << 8) & 0xF800) | ((unsigned(src[G]) << 3) & 0x7E0) | ((unsigned(src[B]) >> 3))); src += 4; dst += 2; } while(--width); } }; //------------------------------------------------------------------------ typedef color_conv_rgba32_rgb565<1,2,3> color_conv_argb32_to_rgb565; //----color_conv_argb32_to_rgb565 typedef color_conv_rgba32_rgb565<3,2,1> color_conv_abgr32_to_rgb565; //----color_conv_abgr32_to_rgb565 typedef color_conv_rgba32_rgb565<2,1,0> color_conv_bgra32_to_rgb565; //----color_conv_bgra32_to_rgb565 typedef color_conv_rgba32_rgb565<0,1,2> color_conv_rgba32_to_rgb565; //----color_conv_rgba32_to_rgb565 //---------------------------------------------color_conv_rgb555_to_rgb565 class color_conv_rgb555_to_rgb565 { public: void operator () (int8u* dst, const int8u* src, unsigned width) const { do { unsigned rgb = *(int16u*)src; *(int16u*)dst = (int16u)(((rgb << 1) & 0xFFC0) | (rgb & 0x1F)); src += 2; dst += 2; } while(--width); } }; //----------------------------------------------color_conv_rgb565_to_rgb555 class color_conv_rgb565_to_rgb555 { public: void operator () (int8u* dst, const int8u* src, unsigned width) const { do { unsigned rgb = *(int16u*)src; *(int16u*)dst = (int16u)(((rgb >> 1) & 0x7FE0) | (rgb & 0x1F)); src += 2; dst += 2; } while(--width); } }; //------------------------------------------------------------------------ typedef color_conv_same<2> color_conv_rgb555_to_rgb555; //----color_conv_rgb555_to_rgb555 typedef color_conv_same<2> color_conv_rgb565_to_rgb565; //----color_conv_rgb565_to_rgb565 template<int R, int B> class color_conv_rgb24_gray8 { public: void operator () (int8u* dst, const int8u* src, unsigned width) const { do { *dst++ = (src[R]*77 + src[1]*150 + src[B]*29) >> 8; src += 3; } while(--width); } }; typedef color_conv_rgb24_gray8<0,2> color_conv_rgb24_to_gray8; //----color_conv_rgb24_to_gray8 typedef color_conv_rgb24_gray8<2,0> color_conv_bgr24_to_gray8; //----color_conv_bgr24_to_gray8 } #endif �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/install�������������������������������������������������������������������������������0000644�0000000�0000000�00000003356�10703246330�014656� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Anti-Grain Geometry is a C++ library distributed in sources and does not require any installation procedure. The source code is platform independent and does not have any dependencies on system APIs (except for very standard C runtime library). You just take source files and include them into your project. The sources are maintained to be highly compatible with most popular C++ compilers, including poor ones, like Microsoft Visual C++ V6.0. On Unix/Linux/MacOS/BeOS/AmigaOS systems you can type "make" to build src/libagg.a There must be GNU Make utility installed. Makefiles are very simple, so that if something goes wrong you could easily fix it. There are no "include files" dependency suppoeted. Also note that there's no "make install" option either; basically the original Makefiles are needed only to build the examples. After building the library you do "cd examples/<YourOS>" and build the examples in a similar way. On most Linux platforms the "automake" environment should work. It's generously provided by Nikolas Zimmermann, aka WildFox, who is a key developer of KDE and KSVG. This process will replace the original Makefiles. On Windows there's no library or a DLL created at all. You just add source files into your project or create a preoject to build a LIB/DLL if you wish. The problem is that it's very tedious to maintain building environments for all possible configurations. I'm sorry for not automating it, but the compensation is that AGG compiles fine without any hidden problems, nor the neccesity to configure. All examples have building environments for Microsoft Visual C++ 6.0 (.dsp/.dsw) and they are self-sufficient. The newer versions of the studio can easily convert the projects. Also, see "readme" for more details.����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/libagg.m4�����������������������������������������������������������������������������0000644�0000000�0000000�00000001613�10703246330�014746� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Configure paths for libagg # Kirill Smelkov 2005-10-23, based on freetype2.m4 by Marcelo Magallon # AC_CHECK_LIBAGG([MINIMUM-VERSION [, ACTION-IF-FOUND [,ACTION-IF-NOT-FOUND]]]) # Test for libagg, and define LIBAGG_CFLAGS and LIBAGG_LIBS # AC_DEFUN([AC_CHECK_LIBAGG], [ # Get the cflags and libraries from pkg-config libagg ... AC_ARG_WITH([libagg], AS_HELP_STRING([--with-libagg=PREFIX], [Prefix where libagg is installed (optional)]), [libagg_prefix="$withval"], [libagg_prefix=""]) libagg_name=libagg if test "x$libagg_prefix" != "x"; then libagg_name="$libagg_prefix/lib/pkgconfig/libagg.pc" fi PKG_CHECK_MODULES([LIBAGG], "$libagg_name", success=yes, success=no) if test "x$success" = xyes; then ifelse([$2], , :, [$2]) AC_SUBST([LIBAGG_CFLAGS]) AC_SUBST([LIBAGG_LIBS]) else ifelse([$3], , :, [$3]) fi ]) # end of libagg.m4 ���������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/libagg.pc.in��������������������������������������������������������������������������0000644�0000000�0000000�00000000421�10703246330�015431� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@/agg2 Name: libagg Description: Anti Grain Geometry - A High Quality Rendering Engine for C++ Version: @VERSION@ Libs: -L${libdir} -Wl,-rpath,${exec_prefix}/lib -lagg Cflags: -I${includedir} �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/news����������������������������������������������������������������������������������0000644�0000000�0000000�00000000037�10703246330�014155� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Visit http://antigrain.com/news�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/readme��������������������������������������������������������������������������������0000644�0000000�0000000�00000004576�10703246330�014452� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Anti-Grain Geometry (AGG) - Version 2.5 A high quality rendering engine for C++ Copyright (C) 2002-2006 Maxim Shemanarev Contact: mcseem@antigrain.com mcseemagg@yahoo.com http://antigrain.com AGG is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. AGG is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with AGG; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. --------------------------------- Use automake to build the library. If automake is not available you still can use the old make. There is a very simple Makefile that can be used. Note that if you use automake it will overwrite Makefile. --------------------------------- If building on AmigaOS 4.0 or higher type the following for instructions on what targets are available. make -f Makefile.AmigaOS To just build and install AGG into the standard AmigaOS SDK ready for use type: make -f Makefile.AmigaOS install If you just want to build one demo (e.g. lion) use: make -f Makefile.AmigaOS bin/lion If you have any questions about the AmigaOS port please contact Steven Solie (ssolie@telus.net) for help. --------------------------------- To build all examples using SDL (Mac or Linux) just type: cd /examples/sdl make Individual examples can be built with make aa_test In the same way the native Carbon examples can be built with cd /examples/macosx_carbon make In both cases the static library will be built (if it was not already) from the existing global Makefile in /src/. The Makefiles for both SDL and Carbon will also attempt to download the required .bmp files if they are not found in the system for a given example. If the files could not be fetched (wget) the user will receive a message explaining where to download the samples from (sphere.bmp, etc.) Since all programs reside in the same directory there is no need to duplicate the .bmp files for each program that needs to use them. --------------------------------- ����������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/src/����������������������������������������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�014045� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/src/ChangeLog�������������������������������������������������������������������������0000644�0000000�0000000�00000000000�10703246330�015605� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/src/Makefile��������������������������������������������������������������������������0000644�0000000�0000000�00000002300�10703246330�015500� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������include ../Makefile.in.$(shell uname) CXXFLAGS= $(AGGCXXFLAGS) -I../include -L./ SRC_CXX=\ agg_arc.cpp \ agg_arrowhead.cpp \ agg_bezier_arc.cpp \ agg_bspline.cpp \ agg_curves.cpp \ agg_vcgen_contour.cpp \ agg_vcgen_dash.cpp \ agg_vcgen_markers_term.cpp \ agg_vcgen_smooth_poly1.cpp \ agg_vcgen_stroke.cpp \ agg_vcgen_bspline.cpp \ agg_gsv_text.cpp \ agg_image_filters.cpp \ agg_line_aa_basics.cpp \ agg_line_profile_aa.cpp \ agg_rounded_rect.cpp \ agg_sqrt_tables.cpp \ agg_embedded_raster_fonts.cpp \ agg_trans_affine.cpp \ agg_trans_warp_magnifier.cpp \ agg_trans_single_path.cpp \ agg_trans_double_path.cpp \ agg_vpgen_clip_polygon.cpp \ agg_vpgen_clip_polyline.cpp \ agg_vpgen_segmentator.cpp \ ctrl/agg_cbox_ctrl.cpp \ ctrl/agg_gamma_ctrl.cpp \ ctrl/agg_gamma_spline.cpp \ ctrl/agg_rbox_ctrl.cpp \ ctrl/agg_slider_ctrl.cpp \ ctrl/agg_spline_ctrl.cpp \ ctrl/agg_scale_ctrl.cpp \ ctrl/agg_polygon_ctrl.cpp \ ctrl/agg_bezier_ctrl.cpp SRC_C=\ ../gpc/gpc.c OBJ=$(SRC_CXX:.cpp=.o) $(SRC_C:.c=.o) all: $(OBJ) $(LIB) libagg.a $(OBJ) clean: rm -f *.o *.a ctrl/*.o ../gpc/*.o rm -rf SunWS_cache rm -rf ctrl/SunWS_cache %.o: %.cpp $(CXX) -c $(CXXFLAGS) $*.cpp -o $@ %.o: %.c $(C) -c $(CXXFLAGS) $*.c -o $@ ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/src/Makefile.am�����������������������������������������������������������������������0000644�0000000�0000000�00000002334�10703246330�016103� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������SUBDIRS = ctrl . platform INCLUDES = -I$(top_srcdir)/include lib_LTLIBRARIES = libagg.la libagg_la_LDFLAGS = -no-undefined -version-info @AGG_LIB_VERSION@ libagg_la_SOURCES = agg_arc.cpp \ agg_arrowhead.cpp \ agg_bezier_arc.cpp \ agg_bspline.cpp \ agg_curves.cpp \ agg_embedded_raster_fonts.cpp \ agg_gsv_text.cpp \ agg_image_filters.cpp \ agg_line_aa_basics.cpp \ agg_line_profile_aa.cpp \ agg_rounded_rect.cpp \ agg_sqrt_tables.cpp \ agg_trans_affine.cpp \ agg_trans_double_path.cpp \ agg_trans_single_path.cpp \ agg_trans_warp_magnifier.cpp \ agg_vcgen_bspline.cpp \ agg_vcgen_contour.cpp \ agg_vcgen_dash.cpp \ agg_vcgen_markers_term.cpp \ agg_vcgen_smooth_poly1.cpp \ agg_vcgen_stroke.cpp \ agg_vpgen_clip_polygon.cpp \ agg_vpgen_clip_polyline.cpp \ agg_vpgen_segmentator.cpp if ENABLE_GPC GPCLD=$(top_builddir)/gpc/libagggpc.la else GPCLD= endif if ENABLE_CTRL CTRLLD=$(top_builddir)/src/ctrl/libaggctrl.la else CTRLLD= endif libagg_la_LIBADD = $(GPCLD) $(CTRLLD) ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/src/agg_arc.cpp�����������������������������������������������������������������������0000644�0000000�0000000�00000006504�10703246330�016141� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #include <math.h> #include "agg_arc.h" namespace agg { //------------------------------------------------------------------------ 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) { normalize(a1, a2, ccw); } //------------------------------------------------------------------------ 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; normalize(a1, a2, ccw); } //------------------------------------------------------------------------ void arc::approximation_scale(double s) { m_scale = s; if(m_initialized) { normalize(m_start, m_end, m_ccw); } } //------------------------------------------------------------------------ void arc::rewind(unsigned) { m_path_cmd = path_cmd_move_to; m_angle = m_start; } //------------------------------------------------------------------------ unsigned arc::vertex(double* x, double* y) { if(is_stop(m_path_cmd)) return path_cmd_stop; if((m_angle < m_end - m_da/4) != m_ccw) { *x = m_x + cos(m_end) * m_rx; *y = m_y + sin(m_end) * m_ry; m_path_cmd = path_cmd_stop; return path_cmd_line_to; } *x = m_x + cos(m_angle) * m_rx; *y = m_y + sin(m_angle) * m_ry; m_angle += m_da; unsigned pf = m_path_cmd; m_path_cmd = path_cmd_line_to; return pf; } //------------------------------------------------------------------------ void arc::normalize(double a1, double a2, bool ccw) { double ra = (fabs(m_rx) + fabs(m_ry)) / 2; m_da = acos(ra / (ra + 0.125 / m_scale)) * 2; if(ccw) { while(a2 < a1) a2 += pi * 2.0; } else { while(a1 < a2) a1 += pi * 2.0; m_da = -m_da; } m_ccw = ccw; m_start = a1; m_end = a2; m_initialized = true; } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/src/agg_arrowhead.cpp�����������������������������������������������������������������0000644�0000000�0000000�00000007454�10703246330�017355� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #include "agg_arrowhead.h" namespace agg { //------------------------------------------------------------------------ arrowhead::arrowhead() : m_head_d1(1.0), m_head_d2(1.0), m_head_d3(1.0), m_head_d4(0.0), m_tail_d1(1.0), m_tail_d2(1.0), m_tail_d3(1.0), m_tail_d4(0.0), m_head_flag(false), m_tail_flag(false), m_curr_id(0), m_curr_coord(0) { } //------------------------------------------------------------------------ void arrowhead::rewind(unsigned path_id) { m_curr_id = path_id; m_curr_coord = 0; if(path_id == 0) { if(!m_tail_flag) { m_cmd[0] = path_cmd_stop; return; } m_coord[0] = m_tail_d1; m_coord[1] = 0.0; m_coord[2] = m_tail_d1 - m_tail_d4; m_coord[3] = m_tail_d3; m_coord[4] = -m_tail_d2 - m_tail_d4; m_coord[5] = m_tail_d3; m_coord[6] = -m_tail_d2; m_coord[7] = 0.0; m_coord[8] = -m_tail_d2 - m_tail_d4; m_coord[9] = -m_tail_d3; m_coord[10] = m_tail_d1 - m_tail_d4; m_coord[11] = -m_tail_d3; m_cmd[0] = path_cmd_move_to; m_cmd[1] = path_cmd_line_to; m_cmd[2] = path_cmd_line_to; m_cmd[3] = path_cmd_line_to; m_cmd[4] = path_cmd_line_to; m_cmd[5] = path_cmd_line_to; m_cmd[7] = path_cmd_end_poly | path_flags_close | path_flags_ccw; m_cmd[6] = path_cmd_stop; return; } if(path_id == 1) { if(!m_head_flag) { m_cmd[0] = path_cmd_stop; return; } m_coord[0] = -m_head_d1; m_coord[1] = 0.0; m_coord[2] = m_head_d2 + m_head_d4; m_coord[3] = -m_head_d3; m_coord[4] = m_head_d2; m_coord[5] = 0.0; m_coord[6] = m_head_d2 + m_head_d4; m_coord[7] = m_head_d3; m_cmd[0] = path_cmd_move_to; m_cmd[1] = path_cmd_line_to; m_cmd[2] = path_cmd_line_to; m_cmd[3] = path_cmd_line_to; m_cmd[4] = path_cmd_end_poly | path_flags_close | path_flags_ccw; m_cmd[5] = path_cmd_stop; return; } } //------------------------------------------------------------------------ unsigned arrowhead::vertex(double* x, double* y) { if(m_curr_id < 2) { unsigned curr_idx = m_curr_coord * 2; *x = m_coord[curr_idx]; *y = m_coord[curr_idx + 1]; return m_cmd[m_curr_coord++]; } return path_cmd_stop; } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/src/agg_bezier_arc.cpp����������������������������������������������������������������0000644�0000000�0000000�00000021165�10703246330�017501� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #include <math.h> #include "agg_bezier_arc.h" namespace agg { // This epsilon is used to prevent us from adding degenerate curves // (converging to a single point). // The value isn't very critical. Function arc_to_bezier() has a limit // of the sweep_angle. If fabs(sweep_angle) exceeds pi/2 the curve // becomes inaccurate. But slight exceeding is quite appropriate. //-------------------------------------------------bezier_arc_angle_epsilon const double bezier_arc_angle_epsilon = 0.01; //------------------------------------------------------------arc_to_bezier void arc_to_bezier(double cx, double cy, double rx, double ry, double start_angle, double sweep_angle, double* curve) { double x0 = cos(sweep_angle / 2.0); double y0 = sin(sweep_angle / 2.0); double tx = (1.0 - x0) * 4.0 / 3.0; double ty = y0 - tx * x0 / y0; double px[4]; double py[4]; px[0] = x0; py[0] = -y0; px[1] = x0 + tx; py[1] = -ty; px[2] = x0 + tx; py[2] = ty; px[3] = x0; py[3] = y0; double sn = sin(start_angle + sweep_angle / 2.0); double cs = cos(start_angle + sweep_angle / 2.0); unsigned i; for(i = 0; i < 4; i++) { curve[i * 2] = cx + rx * (px[i] * cs - py[i] * sn); curve[i * 2 + 1] = cy + ry * (px[i] * sn + py[i] * cs); } } //------------------------------------------------------------------------ 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); if(sweep_angle >= 2.0 * pi) sweep_angle = 2.0 * pi; if(sweep_angle <= -2.0 * pi) sweep_angle = -2.0 * pi; if(fabs(sweep_angle) < 1e-10) { m_num_vertices = 4; m_cmd = path_cmd_line_to; m_vertices[0] = x + rx * cos(start_angle); m_vertices[1] = y + ry * sin(start_angle); m_vertices[2] = x + rx * cos(start_angle + sweep_angle); m_vertices[3] = y + ry * sin(start_angle + sweep_angle); return; } double total_sweep = 0.0; double local_sweep = 0.0; double prev_sweep; m_num_vertices = 2; m_cmd = path_cmd_curve4; bool done = false; do { if(sweep_angle < 0.0) { prev_sweep = total_sweep; local_sweep = -pi * 0.5; total_sweep -= pi * 0.5; if(total_sweep <= sweep_angle + bezier_arc_angle_epsilon) { local_sweep = sweep_angle - prev_sweep; done = true; } } else { prev_sweep = total_sweep; local_sweep = pi * 0.5; total_sweep += pi * 0.5; if(total_sweep >= sweep_angle - bezier_arc_angle_epsilon) { local_sweep = sweep_angle - prev_sweep; done = true; } } arc_to_bezier(x, y, rx, ry, start_angle, local_sweep, m_vertices + m_num_vertices - 2); m_num_vertices += 6; start_angle += local_sweep; } while(!done && m_num_vertices < 26); } //-------------------------------------------------------------------- void bezier_arc_svg::init(double x0, double y0, double rx, double ry, double angle, bool large_arc_flag, bool sweep_flag, double x2, double y2) { m_radii_ok = true; if(rx < 0.0) rx = -rx; if(ry < 0.0) ry = -rx; // Calculate the middle point between // the current and the final points //------------------------ double dx2 = (x0 - x2) / 2.0; double dy2 = (y0 - y2) / 2.0; double cos_a = cos(angle); double sin_a = sin(angle); // Calculate (x1, y1) //------------------------ double x1 = cos_a * dx2 + sin_a * dy2; double y1 = -sin_a * dx2 + cos_a * dy2; // Ensure radii are large enough //------------------------ double prx = rx * rx; double pry = ry * ry; double px1 = x1 * x1; double py1 = y1 * y1; // Check that radii are large enough //------------------------ double radii_check = px1/prx + py1/pry; if(radii_check > 1.0) { rx = sqrt(radii_check) * rx; ry = sqrt(radii_check) * ry; prx = rx * rx; pry = ry * ry; if(radii_check > 10.0) m_radii_ok = false; } // Calculate (cx1, cy1) //------------------------ double sign = (large_arc_flag == sweep_flag) ? -1.0 : 1.0; double sq = (prx*pry - prx*py1 - pry*px1) / (prx*py1 + pry*px1); double coef = sign * sqrt((sq < 0) ? 0 : sq); double cx1 = coef * ((rx * y1) / ry); double cy1 = coef * -((ry * x1) / rx); // // Calculate (cx, cy) from (cx1, cy1) //------------------------ double sx2 = (x0 + x2) / 2.0; double sy2 = (y0 + y2) / 2.0; double cx = sx2 + (cos_a * cx1 - sin_a * cy1); double cy = sy2 + (sin_a * cx1 + cos_a * cy1); // Calculate the start_angle (angle1) and the sweep_angle (dangle) //------------------------ double ux = (x1 - cx1) / rx; double uy = (y1 - cy1) / ry; double vx = (-x1 - cx1) / rx; double vy = (-y1 - cy1) / ry; double p, n; // Calculate the angle start //------------------------ n = sqrt(ux*ux + uy*uy); p = ux; // (1 * ux) + (0 * uy) sign = (uy < 0) ? -1.0 : 1.0; double v = p / n; if(v < -1.0) v = -1.0; if(v > 1.0) v = 1.0; double start_angle = sign * acos(v); // Calculate the sweep angle //------------------------ n = sqrt((ux*ux + uy*uy) * (vx*vx + vy*vy)); p = ux * vx + uy * vy; sign = (ux * vy - uy * vx < 0) ? -1.0 : 1.0; v = p / n; 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) { sweep_angle -= pi * 2.0; } else if (sweep_flag && sweep_angle < 0) { sweep_angle += pi * 2.0; } // We can now build and transform the resulting arc //------------------------ 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); } // We must make sure that the starting and ending points // exactly coincide with the initial (x0,y0) and (x2,y2) m_arc.vertices()[0] = x0; m_arc.vertices()[1] = y0; if(m_arc.num_vertices() > 2) { m_arc.vertices()[m_arc.num_vertices() - 2] = x2; m_arc.vertices()[m_arc.num_vertices() - 1] = y2; } } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/src/agg_bspline.cpp�������������������������������������������������������������������0000644�0000000�0000000�00000017705�10703246330�017035� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #include "agg_bspline.h" namespace agg { //------------------------------------------------------------------------ bspline::bspline() : m_max(0), m_num(0), m_x(0), m_y(0), m_last_idx(-1) { } //------------------------------------------------------------------------ bspline::bspline(int num) : m_max(0), m_num(0), m_x(0), m_y(0), m_last_idx(-1) { init(num); } //------------------------------------------------------------------------ bspline::bspline(int num, const double* x, const double* y) : m_max(0), m_num(0), m_x(0), m_y(0), m_last_idx(-1) { init(num, x, y); } //------------------------------------------------------------------------ void bspline::init(int max) { if(max > 2 && max > m_max) { m_am.resize(max * 3); m_max = max; m_x = &m_am[m_max]; m_y = &m_am[m_max * 2]; } m_num = 0; m_last_idx = -1; } //------------------------------------------------------------------------ void bspline::add_point(double x, double y) { if(m_num < m_max) { m_x[m_num] = x; m_y[m_num] = y; ++m_num; } } //------------------------------------------------------------------------ void bspline::prepare() { if(m_num > 2) { int i, k, n1; double* temp; double* r; double* s; double h, p, d, f, e; for(k = 0; k < m_num; k++) { m_am[k] = 0.0; } n1 = 3 * m_num; pod_array<double> al(n1); temp = &al[0]; for(k = 0; k < n1; k++) { temp[k] = 0.0; } r = temp + m_num; s = temp + m_num * 2; n1 = m_num - 1; d = m_x[1] - m_x[0]; e = (m_y[1] - m_y[0]) / d; for(k = 1; k < n1; k++) { h = d; d = m_x[k + 1] - m_x[k]; f = e; e = (m_y[k + 1] - m_y[k]) / d; al[k] = d / (d + h); r[k] = 1.0 - al[k]; s[k] = 6.0 * (e - f) / (h + d); } 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; } 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--) { al[k] = al[k] * al[k + 1] + s[k]; m_am[k] = al[k]; } } m_last_idx = -1; } //------------------------------------------------------------------------ void bspline::init(int num, const double* x, const double* y) { if(num > 2) { init(num); int i; for(i = 0; i < num; i++) { add_point(*x++, *y++); } prepare(); } m_last_idx = -1; } //------------------------------------------------------------------------ void bspline::bsearch(int n, const double *x, double x0, int *i) { int j = n - 1; int k; for(*i = 0; (j - *i) > 1; ) { if(x0 < x[k = (*i + j) >> 1]) j = k; else *i = k; } } //------------------------------------------------------------------------ double bspline::interpolation(double x, int i) const { int j = i + 1; double d = m_x[i] - m_x[j]; double h = x - m_x[j]; double r = m_x[i] - x; double p = d * d / 6.0; return (m_am[j] * r * r * r + m_am[i] * h * h * h) / 6.0 / d + ((m_y[j] - m_am[j] * p) * r + (m_y[i] - m_am[i] * p) * h) / d; } //------------------------------------------------------------------------ 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]) + m_y[0]; } //------------------------------------------------------------------------ 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]) + m_y[m_num - 1]; } //------------------------------------------------------------------------ double bspline::get(double x) const { if(m_num > 2) { int i; // Extrapolation on the left if(x < m_x[0]) return extrapolation_left(x); // Extrapolation on the right if(x >= m_x[m_num - 1]) return extrapolation_right(x); // Interpolation bsearch(m_num, m_x, x, &i); return interpolation(x, i); } return 0.0; } //------------------------------------------------------------------------ double bspline::get_stateful(double x) const { if(m_num > 2) { // Extrapolation on the left if(x < m_x[0]) return extrapolation_left(x); // Extrapolation on the right if(x >= m_x[m_num - 1]) return extrapolation_right(x); if(m_last_idx >= 0) { // Check if x is not in current range 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 && 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] && x <= m_x[m_last_idx]) { // x is between pevious points --m_last_idx; } else { // Else perform full search bsearch(m_num, m_x, x, &m_last_idx); } } return interpolation(x, m_last_idx); } else { // Interpolation bsearch(m_num, m_x, x, &m_last_idx); return interpolation(x, m_last_idx); } } return 0.0; } } �����������������������������������������������������������agg-2.5+dfsg1/src/agg_curves.cpp��������������������������������������������������������������������0000644�0000000�0000000�00000046720�10703246330�016707� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #include <math.h> #include "agg_curves.h" #include "agg_math.h" namespace agg { //------------------------------------------------------------------------ const double curve_distance_epsilon = 1e-30; const double curve_collinearity_epsilon = 1e-30; const double curve_angle_tolerance_epsilon = 0.01; enum curve_recursion_limit_e { curve_recursion_limit = 32 }; //------------------------------------------------------------------------ void curve3_inc::approximation_scale(double s) { m_scale = s; } //------------------------------------------------------------------------ double curve3_inc::approximation_scale() const { return m_scale; } //------------------------------------------------------------------------ void curve3_inc::init(double x1, double y1, double x2, double y2, double x3, double y3) { m_start_x = x1; m_start_y = y1; m_end_x = x3; m_end_y = y3; double dx1 = x2 - x1; double dy1 = y2 - y1; double dx2 = x3 - x2; double dy2 = y3 - y2; double len = sqrt(dx1 * dx1 + dy1 * dy1) + sqrt(dx2 * dx2 + dy2 * dy2); m_num_steps = uround(len * 0.25 * m_scale); if(m_num_steps < 4) { m_num_steps = 4; } double subdivide_step = 1.0 / m_num_steps; double subdivide_step2 = subdivide_step * subdivide_step; double tmpx = (x1 - x2 * 2.0 + x3) * subdivide_step2; double tmpy = (y1 - y2 * 2.0 + y3) * subdivide_step2; 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); m_ddfx = tmpx * 2.0; m_ddfy = tmpy * 2.0; m_step = m_num_steps; } //------------------------------------------------------------------------ void curve3_inc::rewind(unsigned) { if(m_num_steps == 0) { m_step = -1; return; } m_step = m_num_steps; m_fx = m_saved_fx; m_fy = m_saved_fy; m_dfx = m_saved_dfx; m_dfy = m_saved_dfy; } //------------------------------------------------------------------------ unsigned curve3_inc::vertex(double* x, double* y) { if(m_step < 0) return path_cmd_stop; if(m_step == m_num_steps) { *x = m_start_x; *y = m_start_y; --m_step; return path_cmd_move_to; } if(m_step == 0) { *x = m_end_x; *y = m_end_y; --m_step; return path_cmd_line_to; } m_fx += m_dfx; m_fy += m_dfy; m_dfx += m_ddfx; m_dfy += m_ddfy; *x = m_fx; *y = m_fy; --m_step; return path_cmd_line_to; } //------------------------------------------------------------------------ void curve3_div::init(double x1, double y1, double x2, double y2, double x3, double y3) { m_points.remove_all(); m_distance_tolerance_square = 0.5 / m_approximation_scale; m_distance_tolerance_square *= m_distance_tolerance_square; bezier(x1, y1, x2, y2, x3, y3); m_count = 0; } //------------------------------------------------------------------------ void curve3_div::recursive_bezier(double x1, double y1, double x2, double y2, double x3, double y3, unsigned level) { if(level > curve_recursion_limit) { return; } // Calculate all the mid-points of the line segments //---------------------- double x12 = (x1 + x2) / 2; double y12 = (y1 + y2) / 2; double x23 = (x2 + x3) / 2; double y23 = (y2 + y3) / 2; double x123 = (x12 + x23) / 2; double y123 = (y12 + y23) / 2; double dx = x3-x1; double dy = y3-y1; double d = fabs(((x2 - x3) * dy - (y2 - y3) * dx)); double da; if(d > curve_collinearity_epsilon) { // Regular case //----------------- if(d * d <= m_distance_tolerance_square * (dx*dx + dy*dy)) { // If the curvature doesn't exceed the distance_tolerance value // we tend to finish subdivisions. //---------------------- if(m_angle_tolerance < curve_angle_tolerance_epsilon) { m_points.add(point_d(x123, y123)); return; } // Angle & Cusp Condition //---------------------- da = fabs(atan2(y3 - y2, x3 - x2) - atan2(y2 - y1, x2 - x1)); if(da >= pi) da = 2*pi - da; if(da < m_angle_tolerance) { // Finally we can stop the recursion //---------------------- m_points.add(point_d(x123, y123)); return; } } } else { // Collinear case //------------------ da = dx*dx + dy*dy; if(da == 0) { d = calc_sq_distance(x1, y1, x2, y2); } else { d = ((x2 - x1)*dx + (y2 - y1)*dy) / da; if(d > 0 && d < 1) { // Simple collinear case, 1---2---3 // We can leave just two endpoints return; } if(d <= 0) d = calc_sq_distance(x2, y2, x1, y1); else if(d >= 1) d = calc_sq_distance(x2, y2, x3, y3); else d = calc_sq_distance(x2, y2, x1 + d*dx, y1 + d*dy); } if(d < m_distance_tolerance_square) { m_points.add(point_d(x2, y2)); return; } } // Continue subdivision //---------------------- recursive_bezier(x1, y1, x12, y12, x123, y123, level + 1); recursive_bezier(x123, y123, x23, y23, x3, y3, level + 1); } //------------------------------------------------------------------------ void curve3_div::bezier(double x1, double y1, double x2, double y2, double x3, double y3) { m_points.add(point_d(x1, y1)); recursive_bezier(x1, y1, x2, y2, x3, y3, 0); m_points.add(point_d(x3, y3)); } //------------------------------------------------------------------------ void curve4_inc::approximation_scale(double s) { m_scale = s; } //------------------------------------------------------------------------ double curve4_inc::approximation_scale() const { return m_scale; } //------------------------------------------------------------------------ static double MSC60_fix_ICE(double v) { return v; } //------------------------------------------------------------------------ void curve4_inc::init(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4) { m_start_x = x1; m_start_y = y1; m_end_x = x4; m_end_y = y4; double dx1 = x2 - x1; double dy1 = y2 - y1; double dx2 = x3 - x2; double dy2 = y3 - y2; double dx3 = x4 - x3; double dy3 = y4 - y3; double len = (sqrt(dx1 * dx1 + dy1 * dy1) + sqrt(dx2 * dx2 + dy2 * dy2) + sqrt(dx3 * dx3 + dy3 * dy3)) * 0.25 * m_scale; #if defined(_MSC_VER) && _MSC_VER <= 1200 m_num_steps = uround(MSC60_fix_ICE(len)); #else m_num_steps = uround(len); #endif if(m_num_steps < 4) { m_num_steps = 4; } double subdivide_step = 1.0 / m_num_steps; double subdivide_step2 = subdivide_step * subdivide_step; double subdivide_step3 = subdivide_step * subdivide_step * subdivide_step; double pre1 = 3.0 * subdivide_step; 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; double tmp2x = (x2 - x3) * 3.0 - x1 + x4; double tmp2y = (y2 - y3) * 3.0 - y1 + y4; m_saved_fx = m_fx = x1; m_saved_fy = m_fy = y1; m_saved_dfx = m_dfx = (x2 - x1) * pre1 + tmp1x * pre2 + tmp2x * subdivide_step3; m_saved_dfy = m_dfy = (y2 - y1) * pre1 + tmp1y * pre2 + tmp2y * subdivide_step3; m_saved_ddfx = m_ddfx = tmp1x * pre4 + tmp2x * pre5; m_saved_ddfy = m_ddfy = tmp1y * pre4 + tmp2y * pre5; m_dddfx = tmp2x * pre5; m_dddfy = tmp2y * pre5; m_step = m_num_steps; } //------------------------------------------------------------------------ void curve4_inc::rewind(unsigned) { if(m_num_steps == 0) { m_step = -1; return; } m_step = m_num_steps; m_fx = m_saved_fx; m_fy = m_saved_fy; m_dfx = m_saved_dfx; m_dfy = m_saved_dfy; m_ddfx = m_saved_ddfx; m_ddfy = m_saved_ddfy; } //------------------------------------------------------------------------ unsigned curve4_inc::vertex(double* x, double* y) { if(m_step < 0) return path_cmd_stop; if(m_step == m_num_steps) { *x = m_start_x; *y = m_start_y; --m_step; return path_cmd_move_to; } if(m_step == 0) { *x = m_end_x; *y = m_end_y; --m_step; return path_cmd_line_to; } m_fx += m_dfx; m_fy += m_dfy; m_dfx += m_ddfx; m_dfy += m_ddfy; m_ddfx += m_dddfx; m_ddfy += m_dddfy; *x = m_fx; *y = m_fy; --m_step; return path_cmd_line_to; } //------------------------------------------------------------------------ void curve4_div::init(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4) { m_points.remove_all(); m_distance_tolerance_square = 0.5 / m_approximation_scale; m_distance_tolerance_square *= m_distance_tolerance_square; bezier(x1, y1, x2, y2, x3, y3, x4, y4); m_count = 0; } //------------------------------------------------------------------------ void curve4_div::recursive_bezier(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4, unsigned level) { if(level > curve_recursion_limit) { return; } // Calculate all the mid-points of the line segments //---------------------- double x12 = (x1 + x2) / 2; double y12 = (y1 + y2) / 2; double x23 = (x2 + x3) / 2; double y23 = (y2 + y3) / 2; double x34 = (x3 + x4) / 2; double y34 = (y3 + y4) / 2; double x123 = (x12 + x23) / 2; double y123 = (y12 + y23) / 2; double x234 = (x23 + x34) / 2; double y234 = (y23 + y34) / 2; double x1234 = (x123 + x234) / 2; double y1234 = (y123 + y234) / 2; // Try to approximate the full cubic curve by a single straight line //------------------ double dx = x4-x1; double dy = y4-y1; double d2 = fabs(((x2 - x4) * dy - (y2 - y4) * dx)); double d3 = fabs(((x3 - x4) * dy - (y3 - y4) * dx)); double da1, da2, k; switch((int(d2 > curve_collinearity_epsilon) << 1) + int(d3 > curve_collinearity_epsilon)) { case 0: // All collinear OR p1==p4 //---------------------- k = dx*dx + dy*dy; if(k == 0) { d2 = calc_sq_distance(x1, y1, x2, y2); d3 = calc_sq_distance(x4, y4, x3, y3); } else { k = 1 / k; da1 = x2 - x1; da2 = y2 - y1; d2 = k * (da1*dx + da2*dy); da1 = x3 - x1; da2 = y3 - y1; d3 = k * (da1*dx + da2*dy); if(d2 > 0 && d2 < 1 && d3 > 0 && d3 < 1) { // Simple collinear case, 1---2---3---4 // We can leave just two endpoints return; } if(d2 <= 0) d2 = calc_sq_distance(x2, y2, x1, y1); else if(d2 >= 1) d2 = calc_sq_distance(x2, y2, x4, y4); else d2 = calc_sq_distance(x2, y2, x1 + d2*dx, y1 + d2*dy); if(d3 <= 0) d3 = calc_sq_distance(x3, y3, x1, y1); else if(d3 >= 1) d3 = calc_sq_distance(x3, y3, x4, y4); else d3 = calc_sq_distance(x3, y3, x1 + d3*dx, y1 + d3*dy); } if(d2 > d3) { if(d2 < m_distance_tolerance_square) { m_points.add(point_d(x2, y2)); return; } } else { if(d3 < m_distance_tolerance_square) { m_points.add(point_d(x3, y3)); return; } } break; case 1: // p1,p2,p4 are collinear, p3 is significant //---------------------- if(d3 * d3 <= m_distance_tolerance_square * (dx*dx + dy*dy)) { if(m_angle_tolerance < curve_angle_tolerance_epsilon) { m_points.add(point_d(x23, y23)); return; } // Angle Condition //---------------------- da1 = fabs(atan2(y4 - y3, x4 - x3) - atan2(y3 - y2, x3 - x2)); if(da1 >= pi) da1 = 2*pi - da1; if(da1 < m_angle_tolerance) { m_points.add(point_d(x2, y2)); m_points.add(point_d(x3, y3)); return; } if(m_cusp_limit != 0.0) { if(da1 > m_cusp_limit) { m_points.add(point_d(x3, y3)); return; } } } break; case 2: // p1,p3,p4 are collinear, p2 is significant //---------------------- if(d2 * d2 <= m_distance_tolerance_square * (dx*dx + dy*dy)) { if(m_angle_tolerance < curve_angle_tolerance_epsilon) { m_points.add(point_d(x23, y23)); return; } // Angle Condition //---------------------- da1 = fabs(atan2(y3 - y2, x3 - x2) - atan2(y2 - y1, x2 - x1)); if(da1 >= pi) da1 = 2*pi - da1; if(da1 < m_angle_tolerance) { m_points.add(point_d(x2, y2)); m_points.add(point_d(x3, y3)); return; } if(m_cusp_limit != 0.0) { if(da1 > m_cusp_limit) { m_points.add(point_d(x2, y2)); return; } } } break; case 3: // Regular case //----------------- if((d2 + d3)*(d2 + d3) <= m_distance_tolerance_square * (dx*dx + dy*dy)) { // If the curvature doesn't exceed the distance_tolerance value // we tend to finish subdivisions. //---------------------- if(m_angle_tolerance < curve_angle_tolerance_epsilon) { m_points.add(point_d(x23, y23)); return; } // Angle & Cusp Condition //---------------------- k = atan2(y3 - y2, x3 - x2); da1 = fabs(k - atan2(y2 - y1, x2 - x1)); da2 = fabs(atan2(y4 - y3, x4 - x3) - k); if(da1 >= pi) da1 = 2*pi - da1; if(da2 >= pi) da2 = 2*pi - da2; if(da1 + da2 < m_angle_tolerance) { // Finally we can stop the recursion //---------------------- m_points.add(point_d(x23, y23)); return; } if(m_cusp_limit != 0.0) { if(da1 > m_cusp_limit) { m_points.add(point_d(x2, y2)); return; } if(da2 > m_cusp_limit) { m_points.add(point_d(x3, y3)); return; } } } break; } // Continue subdivision //---------------------- recursive_bezier(x1, y1, x12, y12, x123, y123, x1234, y1234, level + 1); recursive_bezier(x1234, y1234, x234, y234, x34, y34, x4, y4, level + 1); } //------------------------------------------------------------------------ void curve4_div::bezier(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4) { m_points.add(point_d(x1, y1)); recursive_bezier(x1, y1, x2, y2, x3, y3, x4, y4, 0); m_points.add(point_d(x4, y4)); } } ������������������������������������������������agg-2.5+dfsg1/src/agg_embedded_raster_fonts.cpp�����������������������������������������������������0000644�0000000�0000000�00001402570�10703246330�021722� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #include "agg_embedded_raster_fonts.h" namespace agg { const int8u gse4x6[] = { 6, 0, 32, 128-32, 0x00,0x00,0x07,0x00,0x0e,0x00,0x15,0x00,0x1c,0x00,0x23,0x00,0x2a,0x00,0x31,0x00,0x38,0x00, 0x3f,0x00,0x46,0x00,0x4d,0x00,0x54,0x00,0x5b,0x00,0x62,0x00,0x69,0x00,0x70,0x00,0x77,0x00, 0x7e,0x00,0x85,0x00,0x8c,0x00,0x93,0x00,0x9a,0x00,0xa1,0x00,0xa8,0x00,0xaf,0x00,0xb6,0x00, 0xbd,0x00,0xc4,0x00,0xcb,0x00,0xd2,0x00,0xd9,0x00,0xe0,0x00,0xe7,0x00,0xee,0x00,0xf5,0x00, 0xfc,0x00,0x03,0x01,0x0a,0x01,0x11,0x01,0x18,0x01,0x1f,0x01,0x26,0x01,0x2d,0x01,0x34,0x01, 0x3b,0x01,0x42,0x01,0x49,0x01,0x50,0x01,0x57,0x01,0x5e,0x01,0x65,0x01,0x6c,0x01,0x73,0x01, 0x7a,0x01,0x81,0x01,0x88,0x01,0x8f,0x01,0x96,0x01,0x9d,0x01,0xa4,0x01,0xab,0x01,0xb2,0x01, 0xb9,0x01,0xc0,0x01,0xc7,0x01,0xce,0x01,0xd5,0x01,0xdc,0x01,0xe3,0x01,0xea,0x01,0xf1,0x01, 0xf8,0x01,0xff,0x01,0x06,0x02,0x0d,0x02,0x14,0x02,0x1b,0x02,0x22,0x02,0x29,0x02,0x30,0x02, 0x37,0x02,0x3e,0x02,0x45,0x02,0x4c,0x02,0x53,0x02,0x5a,0x02,0x61,0x02,0x68,0x02,0x6f,0x02, 0x76,0x02,0x7d,0x02,0x84,0x02,0x8b,0x02,0x92,0x02,0x99,0x02, 4, // 0x20 ' ' 0x00,0x00,0x00,0x00,0x00,0x00, 4, // 0x21 '!' 0x40,0x40,0x40,0x00,0x40,0x00, 4, // 0x22 '"' 0xa0,0xa0,0x00,0x00,0x00,0x00, 4, // 0x23 '#' 0x60,0xf0,0x60,0xf0,0x60,0x00, 4, // 0x24 '$' 0x40,0x60,0xc0,0x60,0xc0,0x40, 4, // 0x25 '%' 0xa0,0x20,0x40,0x80,0xa0,0x00, 4, // 0x26 '&' 0xe0,0xa0,0x50,0xa0,0xd0,0x00, 4, // 0x27 ''' 0x40,0x40,0x00,0x00,0x00,0x00, 4, // 0x28 '(' 0x20,0x40,0x40,0x40,0x20,0x00, 4, // 0x29 ')' 0x40,0x20,0x20,0x20,0x40,0x00, 4, // 0x2a '*' 0xa0,0x40,0xe0,0x40,0xa0,0x00, 4, // 0x2b '+' 0x40,0x40,0xe0,0x40,0x40,0x00, 4, // 0x2c ',' 0x00,0x00,0x00,0x40,0x40,0x80, 4, // 0x2d '-' 0x00,0x00,0xe0,0x00,0x00,0x00, 4, // 0x2e '.' 0x00,0x00,0x00,0x00,0x40,0x00, 4, // 0x2f '/' 0x10,0x20,0x20,0x40,0x40,0x80, 4, // 0x30 '0' 0xe0,0xa0,0xa0,0xa0,0xe0,0x00, 4, // 0x31 '1' 0x40,0xc0,0x40,0x40,0xe0,0x00, 4, // 0x32 '2' 0xe0,0xa0,0x20,0x40,0xe0,0x00, 4, // 0x33 '3' 0xe0,0x20,0x40,0x20,0xe0,0x00, 4, // 0x34 '4' 0xa0,0xa0,0xe0,0x20,0x20,0x00, 4, // 0x35 '5' 0xe0,0x80,0xc0,0x20,0xc0,0x00, 4, // 0x36 '6' 0x40,0x80,0xe0,0xa0,0xe0,0x00, 4, // 0x37 '7' 0xe0,0xa0,0x20,0x40,0x40,0x00, 4, // 0x38 '8' 0xe0,0xa0,0x40,0xa0,0xe0,0x00, 4, // 0x39 '9' 0xe0,0xa0,0xe0,0x20,0xc0,0x00, 4, // 0x3a ':' 0x00,0x40,0x00,0x40,0x00,0x00, 4, // 0x3b ';' 0x00,0x40,0x00,0x40,0x40,0x80, 4, // 0x3c '<' 0x20,0x40,0x80,0x40,0x20,0x00, 4, // 0x3d '=' 0x00,0xe0,0x00,0xe0,0x00,0x00, 4, // 0x3e '>' 0x80,0x40,0x20,0x40,0x80,0x00, 4, // 0x3f '?' 0xc0,0x20,0x40,0x00,0x40,0x00, 4, // 0x40 '@' 0x40,0xa0,0xe0,0xe0,0x80,0x60, 4, // 0x41 'A' 0x40,0xa0,0xe0,0xa0,0xa0,0x00, 4, // 0x42 'B' 0xc0,0xa0,0xc0,0xa0,0xc0,0x00, 4, // 0x43 'C' 0x60,0x80,0x80,0x80,0x60,0x00, 4, // 0x44 'D' 0xc0,0xa0,0xa0,0xa0,0xc0,0x00, 4, // 0x45 'E' 0xe0,0x80,0xc0,0x80,0xe0,0x00, 4, // 0x46 'F' 0xe0,0x80,0xc0,0x80,0x80,0x00, 4, // 0x47 'G' 0x60,0x80,0xa0,0xa0,0x40,0x00, 4, // 0x48 'H' 0xa0,0xa0,0xe0,0xa0,0xa0,0x00, 4, // 0x49 'I' 0xe0,0x40,0x40,0x40,0xe0,0x00, 4, // 0x4a 'J' 0x20,0x20,0x20,0x20,0xa0,0x40, 4, // 0x4b 'K' 0xa0,0xa0,0xc0,0xc0,0xa0,0x00, 4, // 0x4c 'L' 0x80,0x80,0x80,0x80,0xe0,0x00, 4, // 0x4d 'M' 0xa0,0xe0,0xa0,0xa0,0xa0,0x00, 4, // 0x4e 'N' 0x90,0xd0,0xb0,0x90,0x90,0x00, 4, // 0x4f 'O' 0x40,0xa0,0xa0,0xa0,0x40,0x00, 4, // 0x50 'P' 0xc0,0xa0,0xa0,0xc0,0x80,0x00, 4, // 0x51 'Q' 0x40,0xa0,0xa0,0xa0,0x60,0x00, 4, // 0x52 'R' 0xc0,0xa0,0xa0,0xc0,0xa0,0x00, 4, // 0x53 'S' 0x60,0x80,0x40,0x20,0xc0,0x00, 4, // 0x54 'T' 0xe0,0x40,0x40,0x40,0x40,0x00, 4, // 0x55 'U' 0xa0,0xa0,0xa0,0xa0,0xe0,0x00, 4, // 0x56 'V' 0xa0,0xa0,0xa0,0xa0,0x40,0x00, 4, // 0x57 'W' 0xa0,0xa0,0xa0,0xe0,0xa0,0x00, 4, // 0x58 'X' 0xa0,0xa0,0x40,0xa0,0xa0,0x00, 4, // 0x59 'Y' 0xa0,0xa0,0x40,0x40,0x40,0x00, 4, // 0x5a 'Z' 0xe0,0x20,0x40,0x80,0xe0,0x00, 4, // 0x5b '[' 0xc0,0x80,0x80,0x80,0xc0,0x00, 4, // 0x5c '\' 0x80,0x40,0x40,0x20,0x20,0x10, 4, // 0x5d ']' 0xc0,0x40,0x40,0x40,0xc0,0x00, 4, // 0x5e '^' 0x40,0xa0,0x00,0x00,0x00,0x00, 4, // 0x5f '_' 0x00,0x00,0x00,0x00,0x00,0xf0, 4, // 0x60 '`' 0x40,0x20,0x00,0x00,0x00,0x00, 4, // 0x61 'a' 0x00,0x60,0xa0,0xa0,0x70,0x00, 4, // 0x62 'b' 0x80,0x80,0xc0,0xa0,0xc0,0x00, 4, // 0x63 'c' 0x00,0x60,0x80,0x80,0x60,0x00, 4, // 0x64 'd' 0x20,0x20,0x60,0xa0,0x60,0x00, 4, // 0x65 'e' 0x00,0x40,0xe0,0x80,0x60,0x00, 4, // 0x66 'f' 0x20,0x40,0xe0,0x40,0x40,0x00, 4, // 0x67 'g' 0x00,0x60,0xa0,0x60,0x20,0xc0, 4, // 0x68 'h' 0x80,0x80,0xc0,0xa0,0xa0,0x00, 4, // 0x69 'i' 0x40,0x00,0xc0,0x40,0xe0,0x00, 4, // 0x6a 'j' 0x40,0x00,0xc0,0x40,0x40,0x80, 4, // 0x6b 'k' 0x80,0x80,0xa0,0xc0,0xa0,0x00, 4, // 0x6c 'l' 0xc0,0x40,0x40,0x40,0xe0,0x00, 4, // 0x6d 'm' 0x00,0xa0,0xf0,0xf0,0x90,0x00, 4, // 0x6e 'n' 0x00,0xc0,0xa0,0xa0,0xa0,0x00, 4, // 0x6f 'o' 0x00,0x40,0xa0,0xa0,0x40,0x00, 4, // 0x70 'p' 0x00,0xc0,0xa0,0xc0,0x80,0x80, 4, // 0x71 'q' 0x00,0x60,0xa0,0x60,0x20,0x20, 4, // 0x72 'r' 0x00,0xa0,0x50,0x40,0x40,0x00, 4, // 0x73 's' 0x00,0x60,0xc0,0x20,0xc0,0x00, 4, // 0x74 't' 0x40,0x40,0xe0,0x40,0x60,0x00, 4, // 0x75 'u' 0x00,0xa0,0xa0,0xa0,0x60,0x00, 4, // 0x76 'v' 0x00,0xa0,0xa0,0xa0,0x40,0x00, 4, // 0x77 'w' 0x00,0xa0,0xa0,0xe0,0xa0,0x00, 4, // 0x78 'x' 0x00,0xa0,0x40,0xa0,0xa0,0x00, 4, // 0x79 'y' 0x00,0xa0,0xa0,0x60,0x20,0xc0, 4, // 0x7a 'z' 0x00,0xe0,0x40,0x80,0xe0,0x00, 4, // 0x7b '{' 0x30,0x20,0xc0,0x20,0x30,0x00, 4, // 0x7c '|' 0x40,0x40,0x00,0x40,0x40,0x40, 4, // 0x7d '}' 0xc0,0x40,0x30,0x40,0xc0,0x00, 4, // 0x7e '~' 0x50,0xa0,0x00,0x00,0x00,0x00, 4, // 0x7f '' 0x00,0x60,0x90,0xf0,0x00,0x00, 0 }; const int8u gse4x8[] = { 8, 0, 32, 128-32, 0x00,0x00,0x09,0x00,0x12,0x00,0x1b,0x00,0x24,0x00,0x2d,0x00,0x36,0x00,0x3f,0x00,0x48,0x00, 0x51,0x00,0x5a,0x00,0x63,0x00,0x6c,0x00,0x75,0x00,0x7e,0x00,0x87,0x00,0x90,0x00,0x99,0x00, 0xa2,0x00,0xab,0x00,0xb4,0x00,0xbd,0x00,0xc6,0x00,0xcf,0x00,0xd8,0x00,0xe1,0x00,0xea,0x00, 0xf3,0x00,0xfc,0x00,0x05,0x01,0x0e,0x01,0x17,0x01,0x20,0x01,0x29,0x01,0x32,0x01,0x3b,0x01, 0x44,0x01,0x4d,0x01,0x56,0x01,0x5f,0x01,0x68,0x01,0x71,0x01,0x7a,0x01,0x83,0x01,0x8c,0x01, 0x95,0x01,0x9e,0x01,0xa7,0x01,0xb0,0x01,0xb9,0x01,0xc2,0x01,0xcb,0x01,0xd4,0x01,0xdd,0x01, 0xe6,0x01,0xef,0x01,0xf8,0x01,0x01,0x02,0x0a,0x02,0x13,0x02,0x1c,0x02,0x25,0x02,0x2e,0x02, 0x37,0x02,0x40,0x02,0x49,0x02,0x52,0x02,0x5b,0x02,0x64,0x02,0x6d,0x02,0x76,0x02,0x7f,0x02, 0x88,0x02,0x91,0x02,0x9a,0x02,0xa3,0x02,0xac,0x02,0xb5,0x02,0xbe,0x02,0xc7,0x02,0xd0,0x02, 0xd9,0x02,0xe2,0x02,0xeb,0x02,0xf4,0x02,0xfd,0x02,0x06,0x03,0x0f,0x03,0x18,0x03,0x21,0x03, 0x2a,0x03,0x33,0x03,0x3c,0x03,0x45,0x03,0x4e,0x03,0x57,0x03, 4, // 0x20 ' ' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 4, // 0x21 '!' 0x00,0x40,0x40,0x40,0x40,0x00,0x40,0x00, 4, // 0x22 '"' 0x00,0xa0,0xa0,0x00,0x00,0x00,0x00,0x00, 4, // 0x23 '#' 0x60,0x60,0xf0,0x60,0x60,0xf0,0x60,0x60, 4, // 0x24 '$' 0x40,0x60,0xc0,0xc0,0x60,0x60,0xc0,0x40, 4, // 0x25 '%' 0x00,0xa0,0x20,0x40,0x40,0x80,0xa0,0x00, 4, // 0x26 '&' 0x00,0x40,0xa0,0xa0,0x40,0xb0,0xa0,0x70, 4, // 0x27 ''' 0x00,0x40,0x40,0x00,0x00,0x00,0x00,0x00, 4, // 0x28 '(' 0x20,0x40,0x80,0x80,0x80,0x80,0x40,0x20, 4, // 0x29 ')' 0x80,0x40,0x20,0x20,0x20,0x20,0x40,0x80, 4, // 0x2a '*' 0x00,0xa0,0x40,0xe0,0x40,0xa0,0x00,0x00, 4, // 0x2b '+' 0x00,0x40,0x40,0xe0,0x40,0x40,0x00,0x00, 4, // 0x2c ',' 0x00,0x00,0x00,0x00,0x00,0x40,0x40,0x80, 4, // 0x2d '-' 0x00,0x00,0x00,0xe0,0x00,0x00,0x00,0x00, 4, // 0x2e '.' 0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00, 4, // 0x2f '/' 0x10,0x10,0x20,0x20,0x40,0x40,0x80,0x80, 4, // 0x30 '0' 0x00,0xe0,0xa0,0xa0,0xa0,0xa0,0xe0,0x00, 4, // 0x31 '1' 0x00,0x40,0xc0,0x40,0x40,0x40,0xe0,0x00, 4, // 0x32 '2' 0x00,0xe0,0xa0,0x20,0x40,0x80,0xe0,0x00, 4, // 0x33 '3' 0x00,0xe0,0x20,0x40,0x20,0x20,0xe0,0x00, 4, // 0x34 '4' 0x00,0x60,0xa0,0xa0,0xf0,0x20,0x20,0x00, 4, // 0x35 '5' 0x00,0xe0,0x80,0xc0,0x20,0x20,0xc0,0x00, 4, // 0x36 '6' 0x00,0x40,0x80,0xe0,0xa0,0xa0,0xe0,0x00, 4, // 0x37 '7' 0x00,0xe0,0xa0,0x20,0x40,0x40,0x40,0x00, 4, // 0x38 '8' 0x00,0xe0,0xa0,0x40,0xa0,0xa0,0xe0,0x00, 4, // 0x39 '9' 0x00,0xe0,0xa0,0xe0,0x20,0x20,0x40,0x00, 4, // 0x3a ':' 0x00,0x00,0x40,0x00,0x00,0x40,0x00,0x00, 4, // 0x3b ';' 0x00,0x00,0x40,0x00,0x00,0x40,0x40,0x80, 4, // 0x3c '<' 0x00,0x20,0x40,0x80,0x40,0x20,0x00,0x00, 4, // 0x3d '=' 0x00,0x00,0xe0,0x00,0xe0,0x00,0x00,0x00, 4, // 0x3e '>' 0x00,0x80,0x40,0x20,0x40,0x80,0x00,0x00, 4, // 0x3f '?' 0x00,0x40,0xa0,0x20,0x40,0x00,0x40,0x00, 4, // 0x40 '@' 0x00,0x40,0xa0,0xe0,0xe0,0x80,0x60,0x00, 4, // 0x41 'A' 0x00,0x40,0xa0,0xa0,0xe0,0xa0,0xa0,0x00, 4, // 0x42 'B' 0x00,0xc0,0xa0,0xc0,0xa0,0xa0,0xc0,0x00, 4, // 0x43 'C' 0x00,0x40,0xa0,0x80,0x80,0xa0,0x40,0x00, 4, // 0x44 'D' 0x00,0xc0,0xa0,0xa0,0xa0,0xa0,0xc0,0x00, 4, // 0x45 'E' 0x00,0xe0,0x80,0xc0,0x80,0x80,0xe0,0x00, 4, // 0x46 'F' 0x00,0xe0,0x80,0xc0,0x80,0x80,0x80,0x00, 4, // 0x47 'G' 0x00,0x60,0x80,0xa0,0xa0,0xa0,0x40,0x00, 4, // 0x48 'H' 0x00,0xa0,0xa0,0xe0,0xa0,0xa0,0xa0,0x00, 4, // 0x49 'I' 0x00,0xe0,0x40,0x40,0x40,0x40,0xe0,0x00, 4, // 0x4a 'J' 0x00,0x20,0x20,0x20,0x20,0xa0,0x40,0x00, 4, // 0x4b 'K' 0x00,0xa0,0xa0,0xc0,0xc0,0xa0,0xa0,0x00, 4, // 0x4c 'L' 0x00,0x80,0x80,0x80,0x80,0x80,0xe0,0x00, 4, // 0x4d 'M' 0x00,0xa0,0xe0,0xa0,0xa0,0xa0,0xa0,0x00, 4, // 0x4e 'N' 0x00,0x90,0x90,0xd0,0xb0,0x90,0x90,0x00, 4, // 0x4f 'O' 0x00,0x40,0xa0,0xa0,0xa0,0xa0,0x40,0x00, 4, // 0x50 'P' 0x00,0xc0,0xa0,0xa0,0xc0,0x80,0x80,0x00, 4, // 0x51 'Q' 0x00,0x40,0xa0,0xa0,0xa0,0xa0,0x60,0x00, 4, // 0x52 'R' 0x00,0xc0,0xa0,0xa0,0xc0,0xc0,0xa0,0x00, 4, // 0x53 'S' 0x00,0x60,0x80,0x40,0x20,0x20,0xc0,0x00, 4, // 0x54 'T' 0x00,0xe0,0x40,0x40,0x40,0x40,0x40,0x00, 4, // 0x55 'U' 0x00,0xa0,0xa0,0xa0,0xa0,0xa0,0x40,0x00, 4, // 0x56 'V' 0x00,0xa0,0xa0,0xa0,0xa0,0x40,0x40,0x00, 4, // 0x57 'W' 0x00,0xa0,0xa0,0xa0,0xa0,0xe0,0xa0,0x00, 4, // 0x58 'X' 0x00,0xa0,0xa0,0x40,0xa0,0xa0,0xa0,0x00, 4, // 0x59 'Y' 0x00,0xa0,0xa0,0x40,0x40,0x40,0x40,0x00, 4, // 0x5a 'Z' 0x00,0xe0,0x20,0x40,0x40,0x80,0xe0,0x00, 4, // 0x5b '[' 0xc0,0x80,0x80,0x80,0x80,0x80,0x80,0xc0, 4, // 0x5c '\' 0x80,0x80,0x40,0x40,0x20,0x20,0x10,0x10, 4, // 0x5d ']' 0xc0,0x40,0x40,0x40,0x40,0x40,0x40,0xc0, 4, // 0x5e '^' 0x00,0x40,0xa0,0x00,0x00,0x00,0x00,0x00, 4, // 0x5f '_' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0, 4, // 0x60 '`' 0x00,0x40,0x20,0x00,0x00,0x00,0x00,0x00, 4, // 0x61 'a' 0x00,0x00,0x60,0xa0,0xa0,0xa0,0x70,0x00, 4, // 0x62 'b' 0x00,0x80,0x80,0xc0,0xa0,0xa0,0xc0,0x00, 4, // 0x63 'c' 0x00,0x00,0x40,0xa0,0x80,0xa0,0x40,0x00, 4, // 0x64 'd' 0x00,0x20,0x20,0x60,0xa0,0xa0,0x60,0x00, 4, // 0x65 'e' 0x00,0x00,0x40,0xa0,0xe0,0x80,0x60,0x00, 4, // 0x66 'f' 0x00,0x20,0x40,0x40,0xe0,0x40,0x40,0x00, 4, // 0x67 'g' 0x00,0x00,0x60,0xa0,0xa0,0x60,0x20,0xc0, 4, // 0x68 'h' 0x00,0x80,0x80,0xc0,0xa0,0xa0,0xa0,0x00, 4, // 0x69 'i' 0x00,0x40,0x00,0xc0,0x40,0x40,0xe0,0x00, 4, // 0x6a 'j' 0x00,0x40,0x00,0xc0,0x40,0x40,0x40,0x80, 4, // 0x6b 'k' 0x00,0x80,0x80,0xa0,0xc0,0xc0,0xa0,0x00, 4, // 0x6c 'l' 0x00,0xc0,0x40,0x40,0x40,0x40,0xe0,0x00, 4, // 0x6d 'm' 0x00,0x00,0xa0,0xf0,0xf0,0xf0,0x90,0x00, 4, // 0x6e 'n' 0x00,0x00,0xc0,0xa0,0xa0,0xa0,0xa0,0x00, 4, // 0x6f 'o' 0x00,0x00,0x40,0xa0,0xa0,0xa0,0x40,0x00, 4, // 0x70 'p' 0x00,0x00,0xc0,0xa0,0xa0,0xc0,0x80,0x80, 4, // 0x71 'q' 0x00,0x00,0x60,0xa0,0xa0,0x60,0x20,0x20, 4, // 0x72 'r' 0x00,0x00,0xa0,0x50,0x40,0x40,0x40,0x00, 4, // 0x73 's' 0x00,0x00,0x60,0x80,0x40,0x20,0xc0,0x00, 4, // 0x74 't' 0x00,0x40,0x40,0xe0,0x40,0x40,0x20,0x00, 4, // 0x75 'u' 0x00,0x00,0xa0,0xa0,0xa0,0xa0,0x60,0x00, 4, // 0x76 'v' 0x00,0x00,0xa0,0xa0,0xa0,0x40,0x40,0x00, 4, // 0x77 'w' 0x00,0x00,0xa0,0xa0,0xa0,0xe0,0xa0,0x00, 4, // 0x78 'x' 0x00,0x00,0xa0,0xa0,0x40,0xa0,0xa0,0x00, 4, // 0x79 'y' 0x00,0x00,0xa0,0xa0,0xa0,0x60,0x20,0xc0, 4, // 0x7a 'z' 0x00,0x00,0xe0,0x20,0x40,0x80,0xe0,0x00, 4, // 0x7b '{' 0x10,0x20,0x20,0xc0,0x20,0x20,0x10,0x00, 4, // 0x7c '|' 0x00,0x40,0x40,0x40,0x00,0x40,0x40,0x40, 4, // 0x7d '}' 0x80,0x40,0x40,0x30,0x40,0x40,0x80,0x00, 4, // 0x7e '~' 0x00,0x50,0xa0,0x00,0x00,0x00,0x00,0x00, 4, // 0x7f '' 0x00,0x00,0x00,0x60,0x90,0xf0,0x00,0x00, 0 }; const int8u gse5x7[] = { 7, 0, 32, 128-32, 0x00,0x00,0x08,0x00,0x10,0x00,0x18,0x00,0x20,0x00,0x28,0x00,0x30,0x00,0x38,0x00,0x40,0x00, 0x48,0x00,0x50,0x00,0x58,0x00,0x60,0x00,0x68,0x00,0x70,0x00,0x78,0x00,0x80,0x00,0x88,0x00, 0x90,0x00,0x98,0x00,0xa0,0x00,0xa8,0x00,0xb0,0x00,0xb8,0x00,0xc0,0x00,0xc8,0x00,0xd0,0x00, 0xd8,0x00,0xe0,0x00,0xe8,0x00,0xf0,0x00,0xf8,0x00,0x00,0x01,0x08,0x01,0x10,0x01,0x18,0x01, 0x20,0x01,0x28,0x01,0x30,0x01,0x38,0x01,0x40,0x01,0x48,0x01,0x50,0x01,0x58,0x01,0x60,0x01, 0x68,0x01,0x70,0x01,0x78,0x01,0x80,0x01,0x88,0x01,0x90,0x01,0x98,0x01,0xa0,0x01,0xa8,0x01, 0xb0,0x01,0xb8,0x01,0xc0,0x01,0xc8,0x01,0xd0,0x01,0xd8,0x01,0xe0,0x01,0xe8,0x01,0xf0,0x01, 0xf8,0x01,0x00,0x02,0x08,0x02,0x10,0x02,0x18,0x02,0x20,0x02,0x28,0x02,0x30,0x02,0x38,0x02, 0x40,0x02,0x48,0x02,0x50,0x02,0x58,0x02,0x60,0x02,0x68,0x02,0x70,0x02,0x78,0x02,0x80,0x02, 0x88,0x02,0x90,0x02,0x98,0x02,0xa0,0x02,0xa8,0x02,0xb0,0x02,0xb8,0x02,0xc0,0x02,0xc8,0x02, 0xd0,0x02,0xd8,0x02,0xe0,0x02,0xe8,0x02,0xf0,0x02,0xf8,0x02, 5, // 0x20 ' ' 0x00,0x00,0x00,0x00,0x00,0x00,0x00, 5, // 0x21 '!' 0x00,0x20,0x20,0x20,0x00,0x20,0x00, 5, // 0x22 '"' 0x00,0x50,0x50,0x00,0x00,0x00,0x00, 5, // 0x23 '#' 0x00,0x50,0xf8,0x50,0xf8,0x50,0x00, 5, // 0x24 '$' 0x20,0x78,0xa0,0x70,0x28,0xf0,0x20, 5, // 0x25 '%' 0x00,0x88,0x10,0x20,0x40,0x88,0x00, 5, // 0x26 '&' 0x00,0x40,0xa0,0x68,0x90,0x68,0x00, 5, // 0x27 ''' 0x00,0x20,0x20,0x00,0x00,0x00,0x00, 5, // 0x28 '(' 0x10,0x20,0x40,0x40,0x40,0x20,0x10, 5, // 0x29 ')' 0x80,0x40,0x20,0x20,0x20,0x40,0x80, 5, // 0x2a '*' 0x00,0x20,0xa8,0x70,0xa8,0x20,0x00, 5, // 0x2b '+' 0x00,0x20,0x20,0xf8,0x20,0x20,0x00, 5, // 0x2c ',' 0x00,0x00,0x00,0x00,0x20,0x20,0x40, 5, // 0x2d '-' 0x00,0x00,0x00,0xf0,0x00,0x00,0x00, 5, // 0x2e '.' 0x00,0x00,0x00,0x00,0x00,0x40,0x00, 5, // 0x2f '/' 0x00,0x08,0x10,0x20,0x40,0x80,0x00, 5, // 0x30 '0' 0x00,0x60,0x90,0x90,0x90,0x60,0x00, 5, // 0x31 '1' 0x00,0x20,0x60,0x20,0x20,0x70,0x00, 5, // 0x32 '2' 0x00,0x60,0x90,0x20,0x40,0xf0,0x00, 5, // 0x33 '3' 0x00,0xf0,0x20,0x60,0x10,0xe0,0x00, 5, // 0x34 '4' 0x00,0x30,0x50,0x90,0xf0,0x10,0x00, 5, // 0x35 '5' 0x00,0xf0,0x80,0xe0,0x10,0xe0,0x00, 5, // 0x36 '6' 0x00,0x60,0x80,0xe0,0x90,0x60,0x00, 5, // 0x37 '7' 0x00,0xf0,0x90,0x20,0x40,0x40,0x00, 5, // 0x38 '8' 0x00,0x60,0x90,0x60,0x90,0x60,0x00, 5, // 0x39 '9' 0x00,0x60,0x90,0x70,0x10,0x60,0x00, 5, // 0x3a ':' 0x00,0x00,0x20,0x00,0x20,0x00,0x00, 5, // 0x3b ';' 0x00,0x00,0x20,0x00,0x20,0x20,0x40, 5, // 0x3c '<' 0x00,0x10,0x20,0x40,0x20,0x10,0x00, 5, // 0x3d '=' 0x00,0x00,0xf0,0x00,0xf0,0x00,0x00, 5, // 0x3e '>' 0x00,0x80,0x40,0x20,0x40,0x80,0x00, 5, // 0x3f '?' 0x00,0x60,0x90,0x20,0x00,0x20,0x00, 5, // 0x40 '@' 0x00,0x60,0x90,0xb0,0x80,0x70,0x00, 5, // 0x41 'A' 0x00,0x60,0x90,0xf0,0x90,0x90,0x00, 5, // 0x42 'B' 0x00,0xe0,0x90,0xe0,0x90,0xe0,0x00, 5, // 0x43 'C' 0x00,0x60,0x90,0x80,0x90,0x60,0x00, 5, // 0x44 'D' 0x00,0xe0,0x90,0x90,0x90,0xe0,0x00, 5, // 0x45 'E' 0x00,0xf0,0x80,0xe0,0x80,0xf0,0x00, 5, // 0x46 'F' 0x00,0xf0,0x80,0xe0,0x80,0x80,0x00, 5, // 0x47 'G' 0x00,0x70,0x80,0xb0,0x90,0x60,0x00, 5, // 0x48 'H' 0x00,0x90,0x90,0xf0,0x90,0x90,0x00, 5, // 0x49 'I' 0x00,0x70,0x20,0x20,0x20,0x70,0x00, 5, // 0x4a 'J' 0x00,0x70,0x20,0x20,0xa0,0x40,0x00, 5, // 0x4b 'K' 0x00,0x90,0xa0,0xc0,0xa0,0x90,0x00, 5, // 0x4c 'L' 0x00,0x80,0x80,0x80,0x80,0xf0,0x00, 5, // 0x4d 'M' 0x00,0x90,0xf0,0x90,0x90,0x90,0x00, 5, // 0x4e 'N' 0x00,0x90,0xd0,0xb0,0x90,0x90,0x00, 5, // 0x4f 'O' 0x00,0x60,0x90,0x90,0x90,0x60,0x00, 5, // 0x50 'P' 0x00,0xe0,0x90,0xe0,0x80,0x80,0x00, 5, // 0x51 'Q' 0x00,0x60,0x90,0x90,0xa0,0x50,0x00, 5, // 0x52 'R' 0x00,0xe0,0x90,0xe0,0xa0,0x90,0x00, 5, // 0x53 'S' 0x00,0x70,0x80,0x60,0x10,0xe0,0x00, 5, // 0x54 'T' 0x00,0x70,0x20,0x20,0x20,0x20,0x00, 5, // 0x55 'U' 0x00,0x90,0x90,0x90,0x90,0x60,0x00, 5, // 0x56 'V' 0x00,0x50,0x50,0x50,0x20,0x20,0x00, 5, // 0x57 'W' 0x00,0x90,0x90,0x90,0xf0,0x90,0x00, 5, // 0x58 'X' 0x00,0x90,0x90,0x60,0x90,0x90,0x00, 5, // 0x59 'Y' 0x00,0x50,0x50,0x20,0x20,0x20,0x00, 5, // 0x5a 'Z' 0x00,0xf0,0x10,0x20,0x40,0xf0,0x00, 5, // 0x5b '[' 0x70,0x40,0x40,0x40,0x40,0x40,0x70, 5, // 0x5c '\' 0x00,0x80,0x40,0x20,0x10,0x08,0x00, 5, // 0x5d ']' 0xe0,0x20,0x20,0x20,0x20,0x20,0xe0, 5, // 0x5e '^' 0x00,0x20,0x50,0x00,0x00,0x00,0x00, 5, // 0x5f '_' 0x00,0x00,0x00,0x00,0x00,0xf8,0x00, 5, // 0x60 '`' 0x00,0x40,0x20,0x00,0x00,0x00,0x00, 5, // 0x61 'a' 0x00,0x00,0x60,0xa0,0xa0,0x50,0x00, 5, // 0x62 'b' 0x00,0x80,0x80,0xe0,0x90,0xe0,0x00, 5, // 0x63 'c' 0x00,0x00,0x70,0x80,0x80,0x70,0x00, 5, // 0x64 'd' 0x00,0x10,0x10,0x70,0x90,0x70,0x00, 5, // 0x65 'e' 0x00,0x00,0x60,0xf0,0x80,0x70,0x00, 5, // 0x66 'f' 0x00,0x30,0x40,0xe0,0x40,0x40,0x00, 5, // 0x67 'g' 0x00,0x00,0x70,0x90,0x70,0x10,0x60, 5, // 0x68 'h' 0x00,0x80,0x80,0xe0,0x90,0x90,0x00, 5, // 0x69 'i' 0x20,0x00,0x60,0x20,0x20,0x70,0x00, 5, // 0x6a 'j' 0x20,0x00,0x60,0x20,0x20,0xa0,0x40, 5, // 0x6b 'k' 0x80,0x80,0x90,0xa0,0xe0,0x90,0x00, 5, // 0x6c 'l' 0x00,0x60,0x20,0x20,0x20,0x70,0x00, 5, // 0x6d 'm' 0x00,0x00,0xa0,0xf0,0xf0,0x90,0x00, 5, // 0x6e 'n' 0x00,0x00,0xa0,0xd0,0x90,0x90,0x00, 5, // 0x6f 'o' 0x00,0x00,0x60,0x90,0x90,0x60,0x00, 5, // 0x70 'p' 0x00,0x00,0xe0,0x90,0xe0,0x80,0x80, 5, // 0x71 'q' 0x00,0x00,0x70,0x90,0x70,0x10,0x10, 5, // 0x72 'r' 0x00,0x00,0xe0,0x90,0x80,0x80,0x00, 5, // 0x73 's' 0x00,0x00,0x70,0xe0,0x10,0xe0,0x00, 5, // 0x74 't' 0x40,0x40,0xe0,0x40,0x40,0x70,0x00, 5, // 0x75 'u' 0x00,0x00,0x90,0x90,0x90,0x70,0x00, 5, // 0x76 'v' 0x00,0x00,0x50,0x50,0x50,0x20,0x00, 5, // 0x77 'w' 0x00,0x00,0x90,0x90,0xf0,0x90,0x00, 5, // 0x78 'x' 0x00,0x00,0x90,0x60,0x60,0x90,0x00, 5, // 0x79 'y' 0x00,0x00,0x90,0x90,0x70,0x10,0x60, 5, // 0x7a 'z' 0x00,0x00,0xf0,0x20,0x40,0xf0,0x00, 5, // 0x7b '{' 0x10,0x20,0x20,0xc0,0x20,0x20,0x10, 5, // 0x7c '|' 0x20,0x20,0x20,0x00,0x20,0x20,0x20, 5, // 0x7d '}' 0x40,0x20,0x20,0x18,0x20,0x20,0x40, 5, // 0x7e '~' 0x00,0x40,0xa8,0x10,0x00,0x00,0x00, 5, // 0x7f '' 0x00,0x00,0x20,0x50,0x88,0xf8,0x00, 0 }; const int8u gse5x9[] = { 9, 0, 32, 128-32, 0x00,0x00,0x0a,0x00,0x14,0x00,0x1e,0x00,0x28,0x00,0x32,0x00,0x3c,0x00,0x46,0x00,0x50,0x00, 0x5a,0x00,0x64,0x00,0x6e,0x00,0x78,0x00,0x82,0x00,0x8c,0x00,0x96,0x00,0xa0,0x00,0xaa,0x00, 0xb4,0x00,0xbe,0x00,0xc8,0x00,0xd2,0x00,0xdc,0x00,0xe6,0x00,0xf0,0x00,0xfa,0x00,0x04,0x01, 0x0e,0x01,0x18,0x01,0x22,0x01,0x2c,0x01,0x36,0x01,0x40,0x01,0x4a,0x01,0x54,0x01,0x5e,0x01, 0x68,0x01,0x72,0x01,0x7c,0x01,0x86,0x01,0x90,0x01,0x9a,0x01,0xa4,0x01,0xae,0x01,0xb8,0x01, 0xc2,0x01,0xcc,0x01,0xd6,0x01,0xe0,0x01,0xea,0x01,0xf4,0x01,0xfe,0x01,0x08,0x02,0x12,0x02, 0x1c,0x02,0x26,0x02,0x30,0x02,0x3a,0x02,0x44,0x02,0x4e,0x02,0x58,0x02,0x62,0x02,0x6c,0x02, 0x76,0x02,0x80,0x02,0x8a,0x02,0x94,0x02,0x9e,0x02,0xa8,0x02,0xb2,0x02,0xbc,0x02,0xc6,0x02, 0xd0,0x02,0xda,0x02,0xe4,0x02,0xee,0x02,0xf8,0x02,0x02,0x03,0x0c,0x03,0x16,0x03,0x20,0x03, 0x2a,0x03,0x34,0x03,0x3e,0x03,0x48,0x03,0x52,0x03,0x5c,0x03,0x66,0x03,0x70,0x03,0x7a,0x03, 0x84,0x03,0x8e,0x03,0x98,0x03,0xa2,0x03,0xac,0x03,0xb6,0x03, 5, // 0x20 ' ' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 5, // 0x21 '!' 0x00,0x20,0x20,0x20,0x20,0x20,0x00,0x20,0x00, 5, // 0x22 '"' 0x00,0x50,0x50,0x00,0x00,0x00,0x00,0x00,0x00, 5, // 0x23 '#' 0x00,0x50,0x50,0xf8,0x50,0xf8,0x50,0x50,0x00, 5, // 0x24 '$' 0x00,0x20,0x78,0xa0,0x70,0x28,0xf0,0x20,0x00, 5, // 0x25 '%' 0x00,0xc8,0xc8,0x10,0x20,0x40,0x98,0x98,0x00, 5, // 0x26 '&' 0x00,0x40,0xa0,0xa0,0x40,0xa8,0x90,0x68,0x00, 5, // 0x27 ''' 0x00,0x20,0x20,0x00,0x00,0x00,0x00,0x00,0x00, 5, // 0x28 '(' 0x10,0x20,0x40,0x40,0x40,0x40,0x40,0x20,0x10, 5, // 0x29 ')' 0x80,0x40,0x20,0x20,0x20,0x20,0x20,0x40,0x80, 5, // 0x2a '*' 0x00,0x00,0x20,0xa8,0x70,0xa8,0x20,0x00,0x00, 5, // 0x2b '+' 0x00,0x00,0x20,0x20,0xf8,0x20,0x20,0x00,0x00, 5, // 0x2c ',' 0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x40, 5, // 0x2d '-' 0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00, 5, // 0x2e '.' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00, 5, // 0x2f '/' 0x00,0x10,0x10,0x20,0x20,0x40,0x40,0x80,0x80, 5, // 0x30 '0' 0x00,0x60,0x90,0xb0,0xd0,0x90,0x90,0x60,0x00, 5, // 0x31 '1' 0x00,0x20,0x60,0x20,0x20,0x20,0x20,0x70,0x00, 5, // 0x32 '2' 0x00,0x60,0x90,0x10,0x20,0x40,0x80,0xf0,0x00, 5, // 0x33 '3' 0x00,0xf0,0x10,0x20,0x60,0x10,0x90,0x60,0x00, 5, // 0x34 '4' 0x00,0x30,0x50,0x90,0x90,0xf8,0x10,0x10,0x00, 5, // 0x35 '5' 0x00,0xf0,0x80,0xe0,0x10,0x10,0x10,0xe0,0x00, 5, // 0x36 '6' 0x00,0x60,0x80,0xe0,0x90,0x90,0x90,0x60,0x00, 5, // 0x37 '7' 0x00,0xf0,0x90,0x10,0x20,0x40,0x40,0x40,0x00, 5, // 0x38 '8' 0x00,0x60,0x90,0x90,0x60,0x90,0x90,0x60,0x00, 5, // 0x39 '9' 0x00,0x60,0x90,0x90,0x70,0x10,0x90,0x60,0x00, 5, // 0x3a ':' 0x00,0x00,0x00,0x20,0x00,0x00,0x20,0x00,0x00, 5, // 0x3b ';' 0x00,0x00,0x00,0x20,0x00,0x00,0x20,0x20,0x40, 5, // 0x3c '<' 0x00,0x10,0x20,0x40,0x80,0x40,0x20,0x10,0x00, 5, // 0x3d '=' 0x00,0x00,0x00,0xf0,0x00,0xf0,0x00,0x00,0x00, 5, // 0x3e '>' 0x00,0x80,0x40,0x20,0x10,0x20,0x40,0x80,0x00, 5, // 0x3f '?' 0x00,0x60,0x90,0x10,0x20,0x20,0x00,0x20,0x00, 5, // 0x40 '@' 0x00,0x60,0x90,0xb0,0xb0,0xb0,0x80,0x70,0x00, 5, // 0x41 'A' 0x00,0x60,0x90,0x90,0xf0,0x90,0x90,0x90,0x00, 5, // 0x42 'B' 0x00,0xe0,0x90,0x90,0xe0,0x90,0x90,0xe0,0x00, 5, // 0x43 'C' 0x00,0x60,0x90,0x80,0x80,0x80,0x90,0x60,0x00, 5, // 0x44 'D' 0x00,0xe0,0x90,0x90,0x90,0x90,0x90,0xe0,0x00, 5, // 0x45 'E' 0x00,0xf0,0x80,0x80,0xe0,0x80,0x80,0xf0,0x00, 5, // 0x46 'F' 0x00,0xf0,0x80,0x80,0xe0,0x80,0x80,0x80,0x00, 5, // 0x47 'G' 0x00,0x60,0x90,0x80,0xb0,0x90,0x90,0x60,0x00, 5, // 0x48 'H' 0x00,0x90,0x90,0x90,0xf0,0x90,0x90,0x90,0x00, 5, // 0x49 'I' 0x00,0x70,0x20,0x20,0x20,0x20,0x20,0x70,0x00, 5, // 0x4a 'J' 0x00,0x70,0x20,0x20,0x20,0x20,0xa0,0x40,0x00, 5, // 0x4b 'K' 0x00,0x90,0x90,0xa0,0xc0,0xa0,0x90,0x90,0x00, 5, // 0x4c 'L' 0x00,0x80,0x80,0x80,0x80,0x80,0x80,0xf0,0x00, 5, // 0x4d 'M' 0x00,0x90,0xf0,0x90,0x90,0x90,0x90,0x90,0x00, 5, // 0x4e 'N' 0x00,0x90,0x90,0xd0,0xb0,0x90,0x90,0x90,0x00, 5, // 0x4f 'O' 0x00,0x60,0x90,0x90,0x90,0x90,0x90,0x60,0x00, 5, // 0x50 'P' 0x00,0xe0,0x90,0x90,0xe0,0x80,0x80,0x80,0x00, 5, // 0x51 'Q' 0x00,0x60,0x90,0x90,0x90,0x90,0xa0,0x50,0x00, 5, // 0x52 'R' 0x00,0xe0,0x90,0x90,0xe0,0xa0,0x90,0x90,0x00, 5, // 0x53 'S' 0x00,0x60,0x90,0x80,0x60,0x10,0x90,0x60,0x00, 5, // 0x54 'T' 0x00,0x70,0x20,0x20,0x20,0x20,0x20,0x20,0x00, 5, // 0x55 'U' 0x00,0x90,0x90,0x90,0x90,0x90,0x90,0x60,0x00, 5, // 0x56 'V' 0x00,0x50,0x50,0x50,0x50,0x50,0x20,0x20,0x00, 5, // 0x57 'W' 0x00,0x90,0x90,0x90,0x90,0x90,0xf0,0x90,0x00, 5, // 0x58 'X' 0x00,0x90,0x90,0x60,0x60,0x90,0x90,0x90,0x00, 5, // 0x59 'Y' 0x00,0x50,0x50,0x50,0x20,0x20,0x20,0x20,0x00, 5, // 0x5a 'Z' 0x00,0xf0,0x10,0x10,0x20,0x40,0x80,0xf0,0x00, 5, // 0x5b '[' 0x70,0x40,0x40,0x40,0x40,0x40,0x40,0x70,0x00, 5, // 0x5c '\' 0x80,0x80,0x40,0x40,0x20,0x20,0x10,0x10,0x00, 5, // 0x5d ']' 0xe0,0x20,0x20,0x20,0x20,0x20,0x20,0xe0,0x00, 5, // 0x5e '^' 0x00,0x20,0x50,0x88,0x00,0x00,0x00,0x00,0x00, 5, // 0x5f '_' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0x00, 5, // 0x60 '`' 0x00,0x40,0x20,0x00,0x00,0x00,0x00,0x00,0x00, 5, // 0x61 'a' 0x00,0x00,0x60,0x10,0x70,0x90,0x90,0x70,0x00, 5, // 0x62 'b' 0x00,0x80,0x80,0xe0,0x90,0x90,0x90,0xe0,0x00, 5, // 0x63 'c' 0x00,0x00,0x60,0x90,0x80,0x80,0x90,0x60,0x00, 5, // 0x64 'd' 0x00,0x10,0x10,0x70,0x90,0x90,0x90,0x70,0x00, 5, // 0x65 'e' 0x00,0x00,0x60,0x90,0xf0,0x80,0x80,0x70,0x00, 5, // 0x66 'f' 0x00,0x30,0x40,0x40,0xe0,0x40,0x40,0x40,0x00, 5, // 0x67 'g' 0x00,0x00,0x70,0x90,0x90,0x70,0x10,0x90,0x60, 5, // 0x68 'h' 0x00,0x80,0x80,0xe0,0x90,0x90,0x90,0x90,0x00, 5, // 0x69 'i' 0x00,0x20,0x00,0x60,0x20,0x20,0x20,0x70,0x00, 5, // 0x6a 'j' 0x00,0x20,0x00,0x60,0x20,0x20,0x20,0xa0,0x40, 5, // 0x6b 'k' 0x00,0x80,0x80,0x90,0xa0,0xc0,0xa0,0x90,0x00, 5, // 0x6c 'l' 0x00,0x60,0x20,0x20,0x20,0x20,0x20,0x70,0x00, 5, // 0x6d 'm' 0x00,0x00,0xa0,0xf0,0xf0,0xf0,0x90,0x90,0x00, 5, // 0x6e 'n' 0x00,0x00,0xa0,0xd0,0x90,0x90,0x90,0x90,0x00, 5, // 0x6f 'o' 0x00,0x00,0x60,0x90,0x90,0x90,0x90,0x60,0x00, 5, // 0x70 'p' 0x00,0x00,0xe0,0x90,0x90,0x90,0xe0,0x80,0x80, 5, // 0x71 'q' 0x00,0x00,0x70,0x90,0x90,0x90,0x70,0x10,0x10, 5, // 0x72 'r' 0x00,0x00,0xe0,0x90,0x80,0x80,0x80,0x80,0x00, 5, // 0x73 's' 0x00,0x00,0x60,0x90,0x40,0x20,0x90,0x60,0x00, 5, // 0x74 't' 0x00,0x40,0x40,0xe0,0x40,0x40,0x50,0x20,0x00, 5, // 0x75 'u' 0x00,0x00,0x90,0x90,0x90,0x90,0x90,0x70,0x00, 5, // 0x76 'v' 0x00,0x00,0x50,0x50,0x50,0x50,0x20,0x20,0x00, 5, // 0x77 'w' 0x00,0x00,0x90,0x90,0x90,0x90,0xf0,0x90,0x00, 5, // 0x78 'x' 0x00,0x00,0x90,0x90,0x60,0x60,0x90,0x90,0x00, 5, // 0x79 'y' 0x00,0x00,0x90,0x90,0x90,0x90,0x70,0x10,0xe0, 5, // 0x7a 'z' 0x00,0x00,0xf0,0x10,0x20,0x40,0x80,0xf0,0x00, 5, // 0x7b '{' 0x10,0x20,0x20,0x20,0xc0,0x20,0x20,0x20,0x10, 5, // 0x7c '|' 0x00,0x20,0x20,0x20,0x00,0x20,0x20,0x20,0x00, 5, // 0x7d '}' 0x80,0x40,0x40,0x40,0x30,0x40,0x40,0x40,0x80, 5, // 0x7e '~' 0x00,0x40,0xa8,0x10,0x00,0x00,0x00,0x00,0x00, 5, // 0x7f '' 0x00,0x00,0x00,0x20,0x50,0x88,0xf8,0x00,0x00, 0 }; const int8u gse6x12[] = { 12, 0, 32, 128-32, 0x00,0x00,0x0d,0x00,0x1a,0x00,0x27,0x00,0x34,0x00,0x41,0x00,0x4e,0x00,0x5b,0x00,0x68,0x00, 0x75,0x00,0x82,0x00,0x8f,0x00,0x9c,0x00,0xa9,0x00,0xb6,0x00,0xc3,0x00,0xd0,0x00,0xdd,0x00, 0xea,0x00,0xf7,0x00,0x04,0x01,0x11,0x01,0x1e,0x01,0x2b,0x01,0x38,0x01,0x45,0x01,0x52,0x01, 0x5f,0x01,0x6c,0x01,0x79,0x01,0x86,0x01,0x93,0x01,0xa0,0x01,0xad,0x01,0xba,0x01,0xc7,0x01, 0xd4,0x01,0xe1,0x01,0xee,0x01,0xfb,0x01,0x08,0x02,0x15,0x02,0x22,0x02,0x2f,0x02,0x3c,0x02, 0x49,0x02,0x56,0x02,0x63,0x02,0x70,0x02,0x7d,0x02,0x8a,0x02,0x97,0x02,0xa4,0x02,0xb1,0x02, 0xbe,0x02,0xcb,0x02,0xd8,0x02,0xe5,0x02,0xf2,0x02,0xff,0x02,0x0c,0x03,0x19,0x03,0x26,0x03, 0x33,0x03,0x40,0x03,0x4d,0x03,0x5a,0x03,0x67,0x03,0x74,0x03,0x81,0x03,0x8e,0x03,0x9b,0x03, 0xa8,0x03,0xb5,0x03,0xc2,0x03,0xcf,0x03,0xdc,0x03,0xe9,0x03,0xf6,0x03,0x03,0x04,0x10,0x04, 0x1d,0x04,0x2a,0x04,0x37,0x04,0x44,0x04,0x51,0x04,0x5e,0x04,0x6b,0x04,0x78,0x04,0x85,0x04, 0x92,0x04,0x9f,0x04,0xac,0x04,0xb9,0x04,0xc6,0x04,0xd3,0x04, 6, // 0x20 ' ' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 6, // 0x21 '!' 0x00,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x00,0x20,0x00,0x00, 6, // 0x22 '"' 0x00,0x50,0x50,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 6, // 0x23 '#' 0x00,0x50,0x50,0xf8,0x50,0x50,0x50,0xf8,0x50,0x50,0x00,0x00, 6, // 0x24 '$' 0x00,0x20,0x70,0xa8,0xa0,0x70,0x28,0xa8,0x70,0x20,0x00,0x00, 6, // 0x25 '%' 0x00,0xc8,0xd8,0x10,0x30,0x20,0x60,0x40,0xd8,0x98,0x00,0x00, 6, // 0x26 '&' 0x00,0x60,0x90,0x90,0x90,0x60,0xa8,0x90,0x90,0x68,0x00,0x00, 6, // 0x27 ''' 0x00,0x20,0x20,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 6, // 0x28 '(' 0x00,0x10,0x20,0x40,0x40,0x40,0x40,0x40,0x20,0x10,0x00,0x00, 6, // 0x29 ')' 0x00,0x40,0x20,0x10,0x10,0x10,0x10,0x10,0x20,0x40,0x00,0x00, 6, // 0x2a '*' 0x00,0x00,0x00,0x50,0x20,0xf8,0x20,0x50,0x00,0x00,0x00,0x00, 6, // 0x2b '+' 0x00,0x00,0x20,0x20,0x20,0xf8,0x20,0x20,0x20,0x00,0x00,0x00, 6, // 0x2c ',' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x20,0x40, 6, // 0x2d '-' 0x00,0x00,0x00,0x00,0x00,0xf8,0x00,0x00,0x00,0x00,0x00,0x00, 6, // 0x2e '.' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00, 6, // 0x2f '/' 0x08,0x08,0x10,0x10,0x20,0x20,0x40,0x40,0x80,0x80,0x00,0x00, 6, // 0x30 '0' 0x00,0x70,0x88,0x88,0x98,0xa8,0xc8,0x88,0x88,0x70,0x00,0x00, 6, // 0x31 '1' 0x00,0x20,0x20,0x60,0x20,0x20,0x20,0x20,0x20,0x70,0x00,0x00, 6, // 0x32 '2' 0x00,0x70,0x88,0x88,0x08,0x10,0x20,0x40,0x80,0xf8,0x00,0x00, 6, // 0x33 '3' 0x00,0xf8,0x10,0x20,0x70,0x08,0x08,0x08,0x88,0x70,0x00,0x00, 6, // 0x34 '4' 0x00,0x10,0x20,0x40,0x90,0x90,0xf8,0x10,0x10,0x10,0x00,0x00, 6, // 0x35 '5' 0x00,0xf8,0x80,0x80,0xf0,0x08,0x08,0x08,0x88,0x70,0x00,0x00, 6, // 0x36 '6' 0x00,0x70,0x88,0x80,0x80,0xf0,0x88,0x88,0x88,0x70,0x00,0x00, 6, // 0x37 '7' 0x00,0xf8,0x88,0x08,0x08,0x10,0x20,0x20,0x20,0x20,0x00,0x00, 6, // 0x38 '8' 0x00,0x70,0x88,0x88,0x88,0x70,0x88,0x88,0x88,0x70,0x00,0x00, 6, // 0x39 '9' 0x00,0x70,0x88,0x88,0x88,0x78,0x08,0x08,0x88,0x70,0x00,0x00, 6, // 0x3a ':' 0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x20,0x00,0x00,0x00, 6, // 0x3b ';' 0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x20,0x20,0x20,0x40, 6, // 0x3c '<' 0x00,0x08,0x10,0x20,0x40,0x80,0x40,0x20,0x10,0x08,0x00,0x00, 6, // 0x3d '=' 0x00,0x00,0x00,0x00,0xf8,0x00,0xf8,0x00,0x00,0x00,0x00,0x00, 6, // 0x3e '>' 0x00,0x80,0x40,0x20,0x10,0x08,0x10,0x20,0x40,0x80,0x00,0x00, 6, // 0x3f '?' 0x00,0x70,0x88,0x88,0x08,0x10,0x20,0x20,0x00,0x20,0x00,0x00, 6, // 0x40 '@' 0x00,0x70,0x88,0x88,0xb8,0xb8,0xb0,0x80,0x88,0x70,0x00,0x00, 6, // 0x41 'A' 0x00,0x20,0x50,0x88,0x88,0x88,0xf8,0x88,0x88,0x88,0x00,0x00, 6, // 0x42 'B' 0x00,0xf0,0x88,0x88,0x88,0xf0,0x88,0x88,0x88,0xf0,0x00,0x00, 6, // 0x43 'C' 0x00,0x70,0x88,0x88,0x80,0x80,0x80,0x88,0x88,0x70,0x00,0x00, 6, // 0x44 'D' 0x00,0xe0,0x90,0x88,0x88,0x88,0x88,0x88,0x90,0xe0,0x00,0x00, 6, // 0x45 'E' 0x00,0xf8,0x80,0x80,0x80,0xf0,0x80,0x80,0x80,0xf8,0x00,0x00, 6, // 0x46 'F' 0x00,0xf8,0x80,0x80,0x80,0xf0,0x80,0x80,0x80,0x80,0x00,0x00, 6, // 0x47 'G' 0x00,0x70,0x88,0x80,0x80,0xb8,0x88,0x88,0x88,0x70,0x00,0x00, 6, // 0x48 'H' 0x00,0x88,0x88,0x88,0x88,0xf8,0x88,0x88,0x88,0x88,0x00,0x00, 6, // 0x49 'I' 0x00,0x70,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x70,0x00,0x00, 6, // 0x4a 'J' 0x00,0x38,0x10,0x10,0x10,0x10,0x10,0x10,0x90,0x60,0x00,0x00, 6, // 0x4b 'K' 0x00,0x88,0x88,0x90,0xa0,0xc0,0xa0,0x90,0x88,0x88,0x00,0x00, 6, // 0x4c 'L' 0x00,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0xf8,0x00,0x00, 6, // 0x4d 'M' 0x00,0x88,0x88,0xd8,0xa8,0x88,0x88,0x88,0x88,0x88,0x00,0x00, 6, // 0x4e 'N' 0x00,0x88,0x88,0xc8,0xa8,0x98,0x88,0x88,0x88,0x88,0x00,0x00, 6, // 0x4f 'O' 0x00,0x70,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x70,0x00,0x00, 6, // 0x50 'P' 0x00,0xf0,0x88,0x88,0x88,0xf0,0x80,0x80,0x80,0x80,0x00,0x00, 6, // 0x51 'Q' 0x00,0x70,0x88,0x88,0x88,0x88,0x88,0xa8,0x90,0x68,0x00,0x00, 6, // 0x52 'R' 0x00,0xf0,0x88,0x88,0x88,0x88,0xf0,0xa0,0x90,0x88,0x00,0x00, 6, // 0x53 'S' 0x00,0x70,0x88,0x80,0x80,0x70,0x08,0x08,0x88,0x70,0x00,0x00, 6, // 0x54 'T' 0x00,0xf8,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x00,0x00, 6, // 0x55 'U' 0x00,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x70,0x00,0x00, 6, // 0x56 'V' 0x00,0x88,0x88,0x88,0x88,0x88,0x50,0x50,0x20,0x20,0x00,0x00, 6, // 0x57 'W' 0x00,0x88,0x88,0x88,0x88,0x88,0xa8,0xa8,0xd8,0x88,0x00,0x00, 6, // 0x58 'X' 0x00,0x88,0x88,0x88,0x50,0x20,0x50,0x88,0x88,0x88,0x00,0x00, 6, // 0x59 'Y' 0x00,0x88,0x88,0x88,0x50,0x20,0x20,0x20,0x20,0x20,0x00,0x00, 6, // 0x5a 'Z' 0x00,0xf8,0x08,0x08,0x10,0x20,0x40,0x80,0x80,0xf8,0x00,0x00, 6, // 0x5b '[' 0x70,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x70,0x00, 6, // 0x5c '\' 0x80,0x80,0x40,0x40,0x20,0x20,0x10,0x10,0x08,0x08,0x00,0x00, 6, // 0x5d ']' 0x70,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x70,0x00, 6, // 0x5e '^' 0x00,0x00,0x20,0x50,0x88,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 6, // 0x5f '_' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0x00,0x00, 6, // 0x60 '`' 0x00,0x40,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 6, // 0x61 'a' 0x00,0x00,0x00,0x70,0x88,0x08,0x78,0x88,0x88,0x78,0x00,0x00, 6, // 0x62 'b' 0x00,0x80,0x80,0x80,0xf0,0x88,0x88,0x88,0x88,0xf0,0x00,0x00, 6, // 0x63 'c' 0x00,0x00,0x00,0x70,0x88,0x80,0x80,0x80,0x88,0x70,0x00,0x00, 6, // 0x64 'd' 0x00,0x08,0x08,0x08,0x78,0x88,0x88,0x88,0x88,0x78,0x00,0x00, 6, // 0x65 'e' 0x00,0x00,0x00,0x70,0x88,0x88,0xf8,0x80,0x80,0x78,0x00,0x00, 6, // 0x66 'f' 0x00,0x18,0x20,0x20,0xf8,0x20,0x20,0x20,0x20,0x20,0x00,0x00, 6, // 0x67 'g' 0x00,0x00,0x00,0x78,0x88,0x88,0x88,0x88,0x78,0x08,0x08,0xf0, 6, // 0x68 'h' 0x00,0x80,0x80,0x80,0xf0,0x88,0x88,0x88,0x88,0x88,0x00,0x00, 6, // 0x69 'i' 0x00,0x20,0x00,0x00,0x60,0x20,0x20,0x20,0x20,0x70,0x00,0x00, 6, // 0x6a 'j' 0x00,0x10,0x00,0x00,0x30,0x10,0x10,0x10,0x10,0x10,0x90,0x60, 6, // 0x6b 'k' 0x00,0x80,0x80,0x80,0x88,0x90,0xa0,0xd0,0x88,0x88,0x00,0x00, 6, // 0x6c 'l' 0x00,0x60,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x70,0x00,0x00, 6, // 0x6d 'm' 0x00,0x00,0x00,0xd0,0xa8,0xa8,0xa8,0xa8,0xa8,0xa8,0x00,0x00, 6, // 0x6e 'n' 0x00,0x00,0x00,0xb0,0xc8,0x88,0x88,0x88,0x88,0x88,0x00,0x00, 6, // 0x6f 'o' 0x00,0x00,0x00,0x70,0x88,0x88,0x88,0x88,0x88,0x70,0x00,0x00, 6, // 0x70 'p' 0x00,0x00,0x00,0xf0,0x88,0x88,0x88,0x88,0xf0,0x80,0x80,0x80, 6, // 0x71 'q' 0x00,0x00,0x00,0x78,0x88,0x88,0x88,0x88,0x78,0x08,0x08,0x08, 6, // 0x72 'r' 0x00,0x00,0x00,0xb0,0xc8,0x88,0x80,0x80,0x80,0x80,0x00,0x00, 6, // 0x73 's' 0x00,0x00,0x00,0x70,0x88,0x80,0x70,0x08,0x88,0x70,0x00,0x00, 6, // 0x74 't' 0x00,0x40,0x40,0x40,0xe0,0x40,0x40,0x40,0x48,0x30,0x00,0x00, 6, // 0x75 'u' 0x00,0x00,0x00,0x88,0x88,0x88,0x88,0x88,0x88,0x78,0x00,0x00, 6, // 0x76 'v' 0x00,0x00,0x00,0x88,0x88,0x88,0x50,0x50,0x20,0x20,0x00,0x00, 6, // 0x77 'w' 0x00,0x00,0x00,0x88,0x88,0x88,0xa8,0xa8,0xd8,0x88,0x00,0x00, 6, // 0x78 'x' 0x00,0x00,0x00,0x88,0x88,0x50,0x20,0x50,0x88,0x88,0x00,0x00, 6, // 0x79 'y' 0x00,0x00,0x00,0x88,0x88,0x88,0x88,0x88,0x78,0x08,0x10,0xe0, 6, // 0x7a 'z' 0x00,0x00,0x00,0xf8,0x08,0x10,0x20,0x40,0x80,0xf8,0x00,0x00, 6, // 0x7b '{' 0x18,0x20,0x20,0x20,0x20,0xc0,0x20,0x20,0x20,0x20,0x18,0x00, 6, // 0x7c '|' 0x00,0x20,0x20,0x20,0x20,0x00,0x20,0x20,0x20,0x20,0x00,0x00, 6, // 0x7d '}' 0xc0,0x20,0x20,0x20,0x20,0x18,0x20,0x20,0x20,0x20,0xc0,0x00, 6, // 0x7e '~' 0x00,0x00,0x40,0xa8,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 6, // 0x7f '' 0x00,0x00,0x00,0x00,0x20,0x50,0x88,0xf8,0x00,0x00,0x00,0x00, 0 }; const int8u gse6x9[] = { 9, 0, 32, 128-32, 0x00,0x00,0x0a,0x00,0x14,0x00,0x1e,0x00,0x28,0x00,0x32,0x00,0x3c,0x00,0x46,0x00,0x50,0x00, 0x5a,0x00,0x64,0x00,0x6e,0x00,0x78,0x00,0x82,0x00,0x8c,0x00,0x96,0x00,0xa0,0x00,0xaa,0x00, 0xb4,0x00,0xbe,0x00,0xc8,0x00,0xd2,0x00,0xdc,0x00,0xe6,0x00,0xf0,0x00,0xfa,0x00,0x04,0x01, 0x0e,0x01,0x18,0x01,0x22,0x01,0x2c,0x01,0x36,0x01,0x40,0x01,0x4a,0x01,0x54,0x01,0x5e,0x01, 0x68,0x01,0x72,0x01,0x7c,0x01,0x86,0x01,0x90,0x01,0x9a,0x01,0xa4,0x01,0xae,0x01,0xb8,0x01, 0xc2,0x01,0xcc,0x01,0xd6,0x01,0xe0,0x01,0xea,0x01,0xf4,0x01,0xfe,0x01,0x08,0x02,0x12,0x02, 0x1c,0x02,0x26,0x02,0x30,0x02,0x3a,0x02,0x44,0x02,0x4e,0x02,0x58,0x02,0x62,0x02,0x6c,0x02, 0x76,0x02,0x80,0x02,0x8a,0x02,0x94,0x02,0x9e,0x02,0xa8,0x02,0xb2,0x02,0xbc,0x02,0xc6,0x02, 0xd0,0x02,0xda,0x02,0xe4,0x02,0xee,0x02,0xf8,0x02,0x02,0x03,0x0c,0x03,0x16,0x03,0x20,0x03, 0x2a,0x03,0x34,0x03,0x3e,0x03,0x48,0x03,0x52,0x03,0x5c,0x03,0x66,0x03,0x70,0x03,0x7a,0x03, 0x84,0x03,0x8e,0x03,0x98,0x03,0xa2,0x03,0xac,0x03,0xb6,0x03, 6, // 0x20 ' ' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 6, // 0x21 '!' 0x00,0x20,0x20,0x20,0x20,0x20,0x00,0x20,0x00, 6, // 0x22 '"' 0x00,0x50,0x50,0x00,0x00,0x00,0x00,0x00,0x00, 6, // 0x23 '#' 0x00,0x50,0x50,0xf8,0x50,0xf8,0x50,0x50,0x00, 6, // 0x24 '$' 0x00,0x70,0xa8,0xa0,0x70,0x28,0xa8,0x70,0x00, 6, // 0x25 '%' 0x00,0xc8,0xc8,0x10,0x20,0x40,0x98,0x98,0x00, 6, // 0x26 '&' 0x00,0x60,0x90,0x90,0x60,0xa8,0x90,0x68,0x00, 6, // 0x27 ''' 0x00,0x20,0x20,0x00,0x00,0x00,0x00,0x00,0x00, 6, // 0x28 '(' 0x10,0x20,0x40,0x40,0x40,0x40,0x40,0x20,0x10, 6, // 0x29 ')' 0x40,0x20,0x10,0x10,0x10,0x10,0x10,0x20,0x40, 6, // 0x2a '*' 0x00,0x00,0x20,0xa8,0x70,0xa8,0x20,0x00,0x00, 6, // 0x2b '+' 0x00,0x00,0x20,0x20,0xf8,0x20,0x20,0x00,0x00, 6, // 0x2c ',' 0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x40, 6, // 0x2d '-' 0x00,0x00,0x00,0x00,0xf8,0x00,0x00,0x00,0x00, 6, // 0x2e '.' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00, 6, // 0x2f '/' 0x00,0x08,0x08,0x10,0x20,0x40,0x80,0x80,0x00, 6, // 0x30 '0' 0x00,0x70,0x88,0x98,0xa8,0xc8,0x88,0x70,0x00, 6, // 0x31 '1' 0x00,0x20,0x60,0x20,0x20,0x20,0x20,0x70,0x00, 6, // 0x32 '2' 0x00,0x70,0x88,0x08,0x10,0x20,0x40,0xf8,0x00, 6, // 0x33 '3' 0x00,0xf8,0x10,0x20,0x70,0x08,0x88,0x70,0x00, 6, // 0x34 '4' 0x00,0x10,0x20,0x40,0x90,0xf8,0x10,0x10,0x00, 6, // 0x35 '5' 0x00,0xf8,0x80,0xf0,0x08,0x08,0x88,0x70,0x00, 6, // 0x36 '6' 0x00,0x70,0x88,0x80,0xf0,0x88,0x88,0x70,0x00, 6, // 0x37 '7' 0x00,0xf8,0x08,0x08,0x10,0x20,0x40,0x40,0x00, 6, // 0x38 '8' 0x00,0x70,0x88,0x88,0x70,0x88,0x88,0x70,0x00, 6, // 0x39 '9' 0x00,0x70,0x88,0x88,0x78,0x08,0x88,0x70,0x00, 6, // 0x3a ':' 0x00,0x00,0x00,0x20,0x00,0x00,0x20,0x00,0x00, 6, // 0x3b ';' 0x00,0x00,0x00,0x20,0x00,0x00,0x20,0x20,0x40, 6, // 0x3c '<' 0x00,0x08,0x10,0x20,0x40,0x20,0x10,0x08,0x00, 6, // 0x3d '=' 0x00,0x00,0x00,0xf8,0x00,0xf8,0x00,0x00,0x00, 6, // 0x3e '>' 0x00,0x80,0x40,0x20,0x10,0x20,0x40,0x80,0x00, 6, // 0x3f '?' 0x00,0x70,0x88,0x08,0x10,0x20,0x00,0x20,0x00, 6, // 0x40 '@' 0x00,0x70,0x88,0x88,0xb8,0xb8,0x80,0x70,0x00, 6, // 0x41 'A' 0x00,0x20,0x50,0x88,0x88,0xf8,0x88,0x88,0x00, 6, // 0x42 'B' 0x00,0xf0,0x88,0x88,0xf0,0x88,0x88,0xf0,0x00, 6, // 0x43 'C' 0x00,0x70,0x88,0x80,0x80,0x80,0x88,0x70,0x00, 6, // 0x44 'D' 0x00,0xe0,0x90,0x88,0x88,0x88,0x90,0xe0,0x00, 6, // 0x45 'E' 0x00,0xf8,0x80,0x80,0xf0,0x80,0x80,0xf8,0x00, 6, // 0x46 'F' 0x00,0xf8,0x80,0x80,0xf0,0x80,0x80,0x80,0x00, 6, // 0x47 'G' 0x00,0x70,0x88,0x80,0xb8,0x88,0x88,0x70,0x00, 6, // 0x48 'H' 0x00,0x88,0x88,0x88,0xf8,0x88,0x88,0x88,0x00, 6, // 0x49 'I' 0x00,0x70,0x20,0x20,0x20,0x20,0x20,0x70,0x00, 6, // 0x4a 'J' 0x00,0x38,0x10,0x10,0x10,0x10,0x90,0x60,0x00, 6, // 0x4b 'K' 0x00,0x88,0x90,0xa0,0xc0,0xa0,0x90,0x88,0x00, 6, // 0x4c 'L' 0x00,0x80,0x80,0x80,0x80,0x80,0x80,0xf8,0x00, 6, // 0x4d 'M' 0x00,0x88,0xd8,0xa8,0x88,0x88,0x88,0x88,0x00, 6, // 0x4e 'N' 0x00,0x88,0x88,0xc8,0xa8,0x98,0x88,0x88,0x00, 6, // 0x4f 'O' 0x00,0x70,0x88,0x88,0x88,0x88,0x88,0x70,0x00, 6, // 0x50 'P' 0x00,0xf0,0x88,0x88,0xf0,0x80,0x80,0x80,0x00, 6, // 0x51 'Q' 0x00,0x70,0x88,0x88,0x88,0xa8,0x90,0x68,0x00, 6, // 0x52 'R' 0x00,0xf0,0x88,0x88,0x88,0xf0,0x90,0x88,0x00, 6, // 0x53 'S' 0x00,0x70,0x88,0x80,0x70,0x08,0x88,0x70,0x00, 6, // 0x54 'T' 0x00,0xf8,0x20,0x20,0x20,0x20,0x20,0x20,0x00, 6, // 0x55 'U' 0x00,0x88,0x88,0x88,0x88,0x88,0x88,0x70,0x00, 6, // 0x56 'V' 0x00,0x88,0x88,0x88,0x50,0x50,0x20,0x20,0x00, 6, // 0x57 'W' 0x00,0x88,0x88,0x88,0xa8,0xa8,0xd8,0x88,0x00, 6, // 0x58 'X' 0x00,0x88,0x88,0x50,0x20,0x50,0x88,0x88,0x00, 6, // 0x59 'Y' 0x00,0x88,0x88,0x50,0x20,0x20,0x20,0x20,0x00, 6, // 0x5a 'Z' 0x00,0xf8,0x08,0x10,0x20,0x40,0x80,0xf8,0x00, 6, // 0x5b '[' 0x70,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x70, 6, // 0x5c '\' 0x00,0x80,0x80,0x40,0x20,0x10,0x08,0x08,0x00, 6, // 0x5d ']' 0x70,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x70, 6, // 0x5e '^' 0x00,0x00,0x20,0x50,0x88,0x00,0x00,0x00,0x00, 6, // 0x5f '_' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0x00, 6, // 0x60 '`' 0x00,0x40,0x20,0x00,0x00,0x00,0x00,0x00,0x00, 6, // 0x61 'a' 0x00,0x00,0x00,0x70,0x08,0x78,0x88,0x78,0x00, 6, // 0x62 'b' 0x00,0x80,0x80,0xf0,0x88,0x88,0x88,0xf0,0x00, 6, // 0x63 'c' 0x00,0x00,0x00,0x70,0x88,0x80,0x88,0x70,0x00, 6, // 0x64 'd' 0x00,0x08,0x08,0x78,0x88,0x88,0x88,0x78,0x00, 6, // 0x65 'e' 0x00,0x00,0x00,0x70,0x88,0xf8,0x80,0x78,0x00, 6, // 0x66 'f' 0x00,0x18,0x20,0x20,0xf8,0x20,0x20,0x20,0x00, 6, // 0x67 'g' 0x00,0x00,0x00,0x78,0x88,0x88,0x78,0x08,0x70, 6, // 0x68 'h' 0x00,0x80,0x80,0xf0,0x88,0x88,0x88,0x88,0x00, 6, // 0x69 'i' 0x00,0x20,0x00,0x60,0x20,0x20,0x20,0x70,0x00, 6, // 0x6a 'j' 0x00,0x10,0x00,0x30,0x10,0x10,0x10,0x90,0x60, 6, // 0x6b 'k' 0x00,0x00,0x80,0x88,0x90,0xa0,0xd0,0x88,0x00, 6, // 0x6c 'l' 0x00,0x60,0x20,0x20,0x20,0x20,0x20,0x70,0x00, 6, // 0x6d 'm' 0x00,0x00,0x00,0xd0,0xa8,0xa8,0xa8,0xa8,0x00, 6, // 0x6e 'n' 0x00,0x00,0x00,0xb0,0xc8,0x88,0x88,0x88,0x00, 6, // 0x6f 'o' 0x00,0x00,0x00,0x70,0x88,0x88,0x88,0x70,0x00, 6, // 0x70 'p' 0x00,0x00,0x00,0xf0,0x88,0x88,0xf0,0x80,0x80, 6, // 0x71 'q' 0x00,0x00,0x00,0x78,0x88,0x88,0x78,0x08,0x08, 6, // 0x72 'r' 0x00,0x00,0x00,0xb8,0xc0,0x80,0x80,0x80,0x00, 6, // 0x73 's' 0x00,0x00,0x00,0x78,0x80,0x70,0x08,0xf0,0x00, 6, // 0x74 't' 0x00,0x40,0x40,0xe0,0x40,0x40,0x48,0x30,0x00, 6, // 0x75 'u' 0x00,0x00,0x00,0x88,0x88,0x88,0x88,0x78,0x00, 6, // 0x76 'v' 0x00,0x00,0x00,0x88,0x88,0x88,0x50,0x20,0x00, 6, // 0x77 'w' 0x00,0x00,0x00,0x88,0x88,0xa8,0xd8,0x88,0x00, 6, // 0x78 'x' 0x00,0x00,0x00,0x88,0x50,0x20,0x50,0x88,0x00, 6, // 0x79 'y' 0x00,0x00,0x00,0x88,0x88,0x88,0x78,0x08,0x70, 6, // 0x7a 'z' 0x00,0x00,0x00,0xf8,0x10,0x20,0x40,0xf8,0x00, 6, // 0x7b '{' 0x18,0x20,0x20,0x20,0xc0,0x20,0x20,0x20,0x18, 6, // 0x7c '|' 0x00,0x20,0x20,0x20,0x00,0x20,0x20,0x20,0x00, 6, // 0x7d '}' 0xc0,0x20,0x20,0x20,0x18,0x20,0x20,0x20,0xc0, 6, // 0x7e '~' 0x00,0x40,0xa8,0x10,0x00,0x00,0x00,0x00,0x00, 6, // 0x7f '' 0x00,0x00,0x00,0x20,0x50,0x88,0xf8,0x00,0x00, 0 }; const int8u gse7x11[] = { 11, 0, 32, 128-32, 0x00,0x00,0x0c,0x00,0x18,0x00,0x24,0x00,0x30,0x00,0x3c,0x00,0x48,0x00,0x54,0x00,0x60,0x00, 0x6c,0x00,0x78,0x00,0x84,0x00,0x90,0x00,0x9c,0x00,0xa8,0x00,0xb4,0x00,0xc0,0x00,0xcc,0x00, 0xd8,0x00,0xe4,0x00,0xf0,0x00,0xfc,0x00,0x08,0x01,0x14,0x01,0x20,0x01,0x2c,0x01,0x38,0x01, 0x44,0x01,0x50,0x01,0x5c,0x01,0x68,0x01,0x74,0x01,0x80,0x01,0x8c,0x01,0x98,0x01,0xa4,0x01, 0xb0,0x01,0xbc,0x01,0xc8,0x01,0xd4,0x01,0xe0,0x01,0xec,0x01,0xf8,0x01,0x04,0x02,0x10,0x02, 0x1c,0x02,0x28,0x02,0x34,0x02,0x40,0x02,0x4c,0x02,0x58,0x02,0x64,0x02,0x70,0x02,0x7c,0x02, 0x88,0x02,0x94,0x02,0xa0,0x02,0xac,0x02,0xb8,0x02,0xc4,0x02,0xd0,0x02,0xdc,0x02,0xe8,0x02, 0xf4,0x02,0x00,0x03,0x0c,0x03,0x18,0x03,0x24,0x03,0x30,0x03,0x3c,0x03,0x48,0x03,0x54,0x03, 0x60,0x03,0x6c,0x03,0x78,0x03,0x84,0x03,0x90,0x03,0x9c,0x03,0xa8,0x03,0xb4,0x03,0xc0,0x03, 0xcc,0x03,0xd8,0x03,0xe4,0x03,0xf0,0x03,0xfc,0x03,0x08,0x04,0x14,0x04,0x20,0x04,0x2c,0x04, 0x38,0x04,0x44,0x04,0x50,0x04,0x5c,0x04,0x68,0x04,0x74,0x04, 7, // 0x20 ' ' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 7, // 0x21 '!' 0x00,0x10,0x38,0x38,0x38,0x10,0x10,0x00,0x10,0x00,0x00, 7, // 0x22 '"' 0x00,0x00,0x24,0x24,0x24,0x00,0x00,0x00,0x00,0x00,0x00, 7, // 0x23 '#' 0x00,0x48,0x48,0xfc,0x48,0x48,0xfc,0x48,0x48,0x00,0x00, 7, // 0x24 '$' 0x00,0x10,0x38,0x54,0x50,0x38,0x14,0x54,0x38,0x10,0x00, 7, // 0x25 '%' 0x00,0x00,0x42,0xa4,0x48,0x10,0x24,0x4a,0x84,0x00,0x00, 7, // 0x26 '&' 0x00,0x30,0x48,0x48,0x30,0x60,0x94,0x98,0x6c,0x00,0x00, 7, // 0x27 ''' 0x00,0x20,0x20,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 7, // 0x28 '(' 0x00,0x04,0x08,0x10,0x10,0x10,0x10,0x08,0x04,0x00,0x00, 7, // 0x29 ')' 0x00,0x40,0x20,0x10,0x10,0x10,0x10,0x20,0x40,0x00,0x00, 7, // 0x2a '*' 0x00,0x00,0x00,0x20,0xa8,0x70,0xa8,0x20,0x00,0x00,0x00, 7, // 0x2b '+' 0x00,0x00,0x00,0x10,0x10,0x7c,0x10,0x10,0x00,0x00,0x00, 7, // 0x2c ',' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x30,0x60, 7, // 0x2d '-' 0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x00, 7, // 0x2e '.' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x00,0x00, 7, // 0x2f '/' 0x00,0x08,0x08,0x10,0x10,0x20,0x20,0x40,0x40,0x00,0x00, 7, // 0x30 '0' 0x00,0x38,0x44,0x4c,0x54,0x64,0x44,0x44,0x38,0x00,0x00, 7, // 0x31 '1' 0x00,0x10,0x30,0x10,0x10,0x10,0x10,0x10,0x7c,0x00,0x00, 7, // 0x32 '2' 0x00,0x38,0x44,0x04,0x08,0x10,0x20,0x44,0x7c,0x00,0x00, 7, // 0x33 '3' 0x00,0x7c,0x48,0x10,0x38,0x04,0x04,0x44,0x38,0x00,0x00, 7, // 0x34 '4' 0x00,0x08,0x10,0x20,0x48,0x48,0x7c,0x08,0x1c,0x00,0x00, 7, // 0x35 '5' 0x00,0x7c,0x40,0x40,0x78,0x04,0x04,0x44,0x38,0x00,0x00, 7, // 0x36 '6' 0x00,0x18,0x20,0x40,0x78,0x44,0x44,0x44,0x38,0x00,0x00, 7, // 0x37 '7' 0x00,0x7c,0x44,0x04,0x08,0x10,0x10,0x10,0x10,0x00,0x00, 7, // 0x38 '8' 0x00,0x38,0x44,0x44,0x38,0x44,0x44,0x44,0x38,0x00,0x00, 7, // 0x39 '9' 0x00,0x38,0x44,0x44,0x44,0x3c,0x04,0x08,0x30,0x00,0x00, 7, // 0x3a ':' 0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x30,0x00,0x00,0x00, 7, // 0x3b ';' 0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x30,0x30,0x60,0x00, 7, // 0x3c '<' 0x00,0x00,0x04,0x08,0x10,0x20,0x10,0x08,0x04,0x00,0x00, 7, // 0x3d '=' 0x00,0x00,0x00,0x00,0xfc,0x00,0xfc,0x00,0x00,0x00,0x00, 7, // 0x3e '>' 0x00,0x00,0x40,0x20,0x10,0x08,0x10,0x20,0x40,0x00,0x00, 7, // 0x3f '?' 0x00,0x70,0x88,0x88,0x10,0x20,0x20,0x00,0x20,0x00,0x00, 7, // 0x40 '@' 0x00,0x30,0x48,0x04,0x34,0x54,0x54,0x54,0x28,0x00,0x00, 7, // 0x41 'A' 0x00,0x10,0x28,0x44,0x44,0x7c,0x44,0x44,0x44,0x00,0x00, 7, // 0x42 'B' 0x00,0x78,0x44,0x44,0x78,0x44,0x44,0x44,0x78,0x00,0x00, 7, // 0x43 'C' 0x00,0x38,0x44,0x40,0x40,0x40,0x40,0x44,0x38,0x00,0x00, 7, // 0x44 'D' 0x00,0x70,0x48,0x44,0x44,0x44,0x44,0x48,0x70,0x00,0x00, 7, // 0x45 'E' 0x00,0x7c,0x40,0x40,0x70,0x40,0x40,0x40,0x7c,0x00,0x00, 7, // 0x46 'F' 0x00,0x7c,0x40,0x40,0x70,0x40,0x40,0x40,0x40,0x00,0x00, 7, // 0x47 'G' 0x00,0x38,0x44,0x40,0x40,0x5c,0x44,0x44,0x38,0x00,0x00, 7, // 0x48 'H' 0x00,0x44,0x44,0x44,0x7c,0x44,0x44,0x44,0x44,0x00,0x00, 7, // 0x49 'I' 0x00,0x38,0x10,0x10,0x10,0x10,0x10,0x10,0x38,0x00,0x00, 7, // 0x4a 'J' 0x00,0x1c,0x08,0x08,0x08,0x08,0x08,0x48,0x30,0x00,0x00, 7, // 0x4b 'K' 0x00,0x44,0x48,0x50,0x60,0x50,0x48,0x44,0x44,0x00,0x00, 7, // 0x4c 'L' 0x00,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x7c,0x00,0x00, 7, // 0x4d 'M' 0x00,0x44,0x6c,0x54,0x54,0x44,0x44,0x44,0x44,0x00,0x00, 7, // 0x4e 'N' 0x00,0x44,0x44,0x64,0x54,0x4c,0x44,0x44,0x44,0x00,0x00, 7, // 0x4f 'O' 0x00,0x38,0x44,0x44,0x44,0x44,0x44,0x44,0x38,0x00,0x00, 7, // 0x50 'P' 0x00,0x78,0x44,0x44,0x44,0x78,0x40,0x40,0x40,0x00,0x00, 7, // 0x51 'Q' 0x00,0x38,0x44,0x44,0x44,0x44,0x54,0x48,0x34,0x00,0x00, 7, // 0x52 'R' 0x00,0x78,0x44,0x44,0x44,0x78,0x50,0x48,0x44,0x00,0x00, 7, // 0x53 'S' 0x00,0x38,0x44,0x40,0x38,0x04,0x44,0x44,0x38,0x00,0x00, 7, // 0x54 'T' 0x00,0x7c,0x54,0x10,0x10,0x10,0x10,0x10,0x10,0x00,0x00, 7, // 0x55 'U' 0x00,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x38,0x00,0x00, 7, // 0x56 'V' 0x00,0x44,0x44,0x44,0x44,0x28,0x28,0x10,0x10,0x00,0x00, 7, // 0x57 'W' 0x00,0x44,0x44,0x44,0x44,0x54,0x54,0x6c,0x44,0x00,0x00, 7, // 0x58 'X' 0x00,0x44,0x44,0x28,0x10,0x28,0x44,0x44,0x44,0x00,0x00, 7, // 0x59 'Y' 0x00,0x44,0x44,0x44,0x28,0x10,0x10,0x10,0x38,0x00,0x00, 7, // 0x5a 'Z' 0x00,0x7c,0x04,0x08,0x10,0x20,0x40,0x44,0x7c,0x00,0x00, 7, // 0x5b '[' 0x00,0x38,0x20,0x20,0x20,0x20,0x20,0x20,0x38,0x00,0x00, 7, // 0x5c '\' 0x00,0x40,0x40,0x20,0x20,0x10,0x10,0x08,0x08,0x00,0x00, 7, // 0x5d ']' 0x00,0x38,0x08,0x08,0x08,0x08,0x08,0x08,0x38,0x00,0x00, 7, // 0x5e '^' 0x00,0x10,0x28,0x44,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 7, // 0x5f '_' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00, 7, // 0x60 '`' 0x00,0x20,0x20,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 7, // 0x61 'a' 0x00,0x00,0x00,0x38,0x04,0x3c,0x44,0x44,0x3c,0x00,0x00, 7, // 0x62 'b' 0x00,0x40,0x40,0x78,0x44,0x44,0x44,0x44,0x78,0x00,0x00, 7, // 0x63 'c' 0x00,0x00,0x00,0x38,0x44,0x40,0x40,0x44,0x38,0x00,0x00, 7, // 0x64 'd' 0x00,0x04,0x04,0x3c,0x44,0x44,0x44,0x44,0x3c,0x00,0x00, 7, // 0x65 'e' 0x00,0x00,0x00,0x38,0x44,0x7c,0x40,0x44,0x38,0x00,0x00, 7, // 0x66 'f' 0x00,0x18,0x24,0x20,0x70,0x20,0x20,0x20,0x70,0x00,0x00, 7, // 0x67 'g' 0x00,0x00,0x00,0x3c,0x44,0x44,0x44,0x3c,0x04,0x44,0x38, 7, // 0x68 'h' 0x00,0x40,0x40,0x40,0x58,0x64,0x44,0x44,0x44,0x00,0x00, 7, // 0x69 'i' 0x00,0x10,0x00,0x30,0x10,0x10,0x10,0x10,0x38,0x00,0x00, 7, // 0x6a 'j' 0x00,0x08,0x00,0x18,0x08,0x08,0x08,0x08,0x48,0x30,0x00, 7, // 0x6b 'k' 0x00,0x40,0x40,0x44,0x48,0x50,0x68,0x44,0x44,0x00,0x00, 7, // 0x6c 'l' 0x00,0x30,0x10,0x10,0x10,0x10,0x10,0x10,0x38,0x00,0x00, 7, // 0x6d 'm' 0x00,0x00,0x00,0xa8,0x54,0x54,0x54,0x54,0x54,0x00,0x00, 7, // 0x6e 'n' 0x00,0x00,0x00,0xb8,0x44,0x44,0x44,0x44,0x44,0x00,0x00, 7, // 0x6f 'o' 0x00,0x00,0x00,0x38,0x44,0x44,0x44,0x44,0x38,0x00,0x00, 7, // 0x70 'p' 0x00,0x00,0x00,0x78,0x44,0x44,0x44,0x44,0x78,0x40,0x40, 7, // 0x71 'q' 0x00,0x00,0x00,0x3c,0x44,0x44,0x44,0x44,0x3c,0x04,0x04, 7, // 0x72 'r' 0x00,0x00,0x00,0x58,0x64,0x44,0x40,0x40,0x40,0x00,0x00, 7, // 0x73 's' 0x00,0x00,0x00,0x3c,0x40,0x38,0x04,0x04,0x78,0x00,0x00, 7, // 0x74 't' 0x00,0x20,0x20,0x70,0x20,0x20,0x20,0x24,0x18,0x00,0x00, 7, // 0x75 'u' 0x00,0x00,0x00,0x44,0x44,0x44,0x44,0x44,0x3a,0x00,0x00, 7, // 0x76 'v' 0x00,0x00,0x00,0x44,0x44,0x44,0x44,0x28,0x10,0x00,0x00, 7, // 0x77 'w' 0x00,0x00,0x00,0x44,0x44,0x54,0x54,0x6c,0x44,0x00,0x00, 7, // 0x78 'x' 0x00,0x00,0x00,0x44,0x28,0x10,0x28,0x44,0x44,0x00,0x00, 7, // 0x79 'y' 0x00,0x00,0x00,0x44,0x44,0x44,0x3c,0x04,0x08,0x30,0x00, 7, // 0x7a 'z' 0x00,0x00,0x00,0x7c,0x08,0x10,0x20,0x44,0x7c,0x00,0x00, 7, // 0x7b '{' 0x00,0x0c,0x10,0x10,0x10,0x60,0x10,0x10,0x0c,0x00,0x00, 7, // 0x7c '|' 0x00,0x20,0x20,0x20,0x00,0x20,0x20,0x20,0x20,0x00,0x00, 7, // 0x7d '}' 0x00,0x60,0x10,0x10,0x10,0x0c,0x10,0x10,0x60,0x00,0x00, 7, // 0x7e '~' 0x00,0x00,0x64,0x98,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 7, // 0x7f '' 0x00,0x00,0x00,0x10,0x28,0x44,0x44,0x7c,0x00,0x00,0x00, 0 }; const int8u gse7x11_bold[] = { 11, 0, 32, 128-32, 0x00,0x00,0x0c,0x00,0x18,0x00,0x24,0x00,0x30,0x00,0x3c,0x00,0x48,0x00,0x54,0x00,0x60,0x00, 0x6c,0x00,0x78,0x00,0x84,0x00,0x90,0x00,0x9c,0x00,0xa8,0x00,0xb4,0x00,0xc0,0x00,0xcc,0x00, 0xd8,0x00,0xe4,0x00,0xf0,0x00,0xfc,0x00,0x08,0x01,0x14,0x01,0x20,0x01,0x2c,0x01,0x38,0x01, 0x44,0x01,0x50,0x01,0x5c,0x01,0x68,0x01,0x74,0x01,0x80,0x01,0x8c,0x01,0x98,0x01,0xa4,0x01, 0xb0,0x01,0xbc,0x01,0xc8,0x01,0xd4,0x01,0xe0,0x01,0xec,0x01,0xf8,0x01,0x04,0x02,0x10,0x02, 0x1c,0x02,0x28,0x02,0x34,0x02,0x40,0x02,0x4c,0x02,0x58,0x02,0x64,0x02,0x70,0x02,0x7c,0x02, 0x88,0x02,0x94,0x02,0xa0,0x02,0xac,0x02,0xb8,0x02,0xc4,0x02,0xd0,0x02,0xdc,0x02,0xe8,0x02, 0xf4,0x02,0x00,0x03,0x0c,0x03,0x18,0x03,0x24,0x03,0x30,0x03,0x3c,0x03,0x48,0x03,0x54,0x03, 0x60,0x03,0x6c,0x03,0x78,0x03,0x84,0x03,0x90,0x03,0x9c,0x03,0xa8,0x03,0xb4,0x03,0xc0,0x03, 0xcc,0x03,0xd8,0x03,0xe4,0x03,0xf0,0x03,0xfc,0x03,0x08,0x04,0x14,0x04,0x20,0x04,0x2c,0x04, 0x38,0x04,0x44,0x04,0x50,0x04,0x5c,0x04,0x68,0x04,0x74,0x04, 7, // 0x20 ' ' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 7, // 0x21 '!' 0x00,0x30,0x30,0x30,0x30,0x30,0x00,0x30,0x30,0x00,0x00, 7, // 0x22 '"' 0x00,0x6c,0x6c,0x28,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 7, // 0x23 '#' 0x00,0x48,0x48,0xfc,0x48,0x48,0xfc,0x48,0x48,0x00,0x00, 7, // 0x24 '$' 0x30,0x30,0x78,0xcc,0xc0,0x78,0x0c,0xcc,0x78,0x30,0x30, 7, // 0x25 '%' 0x00,0x00,0xc4,0x0c,0x18,0x30,0x60,0xc0,0x8c,0x00,0x00, 7, // 0x26 '&' 0x00,0x30,0x58,0x58,0x30,0x74,0xdc,0xd8,0x6c,0x00,0x00, 7, // 0x27 ''' 0x00,0x30,0x30,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 7, // 0x28 '(' 0x00,0x0c,0x18,0x30,0x30,0x30,0x30,0x18,0x0c,0x00,0x00, 7, // 0x29 ')' 0x00,0xc0,0x60,0x30,0x30,0x30,0x30,0x60,0xc0,0x00,0x00, 7, // 0x2a '*' 0x00,0x00,0x00,0x20,0xa8,0x70,0xa8,0x20,0x00,0x00,0x00, 7, // 0x2b '+' 0x00,0x00,0x00,0x30,0x30,0xfc,0x30,0x30,0x00,0x00,0x00, 7, // 0x2c ',' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x60,0x00, 7, // 0x2d '-' 0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x00, 7, // 0x2e '.' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x00,0x00, 7, // 0x2f '/' 0x00,0x0c,0x0c,0x18,0x18,0x30,0x30,0x60,0x60,0x00,0x00, 7, // 0x30 '0' 0x00,0x78,0xcc,0xcc,0xdc,0xec,0xcc,0xcc,0x78,0x00,0x00, 7, // 0x31 '1' 0x00,0x30,0x70,0xf0,0x30,0x30,0x30,0x30,0xfc,0x00,0x00, 7, // 0x32 '2' 0x00,0x78,0xcc,0xcc,0x18,0x30,0x60,0xcc,0xfc,0x00,0x00, 7, // 0x33 '3' 0x00,0xfc,0x98,0x30,0x78,0x0c,0x0c,0xcc,0x78,0x00,0x00, 7, // 0x34 '4' 0x00,0x18,0x30,0x68,0xd8,0xd8,0xfc,0x18,0x3c,0x00,0x00, 7, // 0x35 '5' 0x00,0xfc,0xc0,0xc0,0xf8,0x0c,0x0c,0xcc,0x78,0x00,0x00, 7, // 0x36 '6' 0x00,0x38,0x60,0xc0,0xf8,0xcc,0xcc,0xcc,0x78,0x00,0x00, 7, // 0x37 '7' 0x00,0xfc,0x8c,0x0c,0x18,0x30,0x30,0x30,0x30,0x00,0x00, 7, // 0x38 '8' 0x00,0x78,0xcc,0xcc,0x78,0xcc,0xcc,0xcc,0x78,0x00,0x00, 7, // 0x39 '9' 0x00,0x78,0xcc,0xcc,0xcc,0x7c,0x0c,0x18,0x70,0x00,0x00, 7, // 0x3a ':' 0x00,0x00,0x30,0x30,0x00,0x00,0x30,0x30,0x00,0x00,0x00, 7, // 0x3b ';' 0x00,0x00,0x30,0x30,0x00,0x00,0x30,0x30,0x30,0x60,0x00, 7, // 0x3c '<' 0x00,0x00,0x0c,0x18,0x30,0x60,0x30,0x18,0x0c,0x00,0x00, 7, // 0x3d '=' 0x00,0x00,0x00,0x00,0xfc,0x00,0xfc,0x00,0x00,0x00,0x00, 7, // 0x3e '>' 0x00,0x00,0x60,0x30,0x18,0x0c,0x18,0x30,0x60,0x00,0x00, 7, // 0x3f '?' 0x00,0x78,0xcc,0xcc,0x18,0x30,0x30,0x00,0x30,0x00,0x00, 7, // 0x40 '@' 0x00,0x70,0x88,0x04,0x74,0xb4,0xb4,0xb4,0x68,0x00,0x00, 7, // 0x41 'A' 0x00,0x30,0x78,0xcc,0xcc,0xfc,0xcc,0xcc,0xcc,0x00,0x00, 7, // 0x42 'B' 0x00,0xf8,0xcc,0xcc,0xf8,0xcc,0xcc,0xcc,0xf8,0x00,0x00, 7, // 0x43 'C' 0x00,0x78,0xcc,0xc0,0xc0,0xc0,0xc0,0xcc,0x78,0x00,0x00, 7, // 0x44 'D' 0x00,0xf0,0xd8,0xcc,0xcc,0xcc,0xcc,0xd8,0xf0,0x00,0x00, 7, // 0x45 'E' 0x00,0xfc,0xc4,0xd0,0xf0,0xd0,0xc0,0xc4,0xfc,0x00,0x00, 7, // 0x46 'F' 0x00,0xfc,0xc4,0xd0,0xf0,0xd0,0xc0,0xc0,0xc0,0x00,0x00, 7, // 0x47 'G' 0x00,0x78,0xcc,0xc0,0xc0,0xdc,0xcc,0xcc,0x78,0x00,0x00, 7, // 0x48 'H' 0x00,0xcc,0xcc,0xcc,0xfc,0xcc,0xcc,0xcc,0xcc,0x00,0x00, 7, // 0x49 'I' 0x00,0x78,0x30,0x30,0x30,0x30,0x30,0x30,0x78,0x00,0x00, 7, // 0x4a 'J' 0x00,0x3c,0x18,0x18,0x18,0x18,0xd8,0xd8,0x70,0x00,0x00, 7, // 0x4b 'K' 0x00,0xcc,0xcc,0xd8,0xf0,0xd8,0xcc,0xcc,0xcc,0x00,0x00, 7, // 0x4c 'L' 0x00,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc4,0xfc,0x00,0x00, 7, // 0x4d 'M' 0x00,0x84,0xcc,0xfc,0xb4,0xcc,0xcc,0xcc,0xcc,0x00,0x00, 7, // 0x4e 'N' 0x00,0xcc,0xcc,0xec,0xfc,0xdc,0xcc,0xcc,0xcc,0x00,0x00, 7, // 0x4f 'O' 0x00,0x78,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0x78,0x00,0x00, 7, // 0x50 'P' 0x00,0xf8,0xcc,0xcc,0xcc,0xf8,0xc0,0xc0,0xc0,0x00,0x00, 7, // 0x51 'Q' 0x00,0x78,0xcc,0xcc,0xcc,0xcc,0xdc,0x78,0x18,0x0c,0x00, 7, // 0x52 'R' 0x00,0xf8,0xcc,0xcc,0xcc,0xf8,0xd8,0xcc,0xcc,0x00,0x00, 7, // 0x53 'S' 0x00,0x78,0xcc,0xe0,0x70,0x38,0x1c,0xcc,0x78,0x00,0x00, 7, // 0x54 'T' 0x00,0xfc,0xb4,0x30,0x30,0x30,0x30,0x30,0x30,0x00,0x00, 7, // 0x55 'U' 0x00,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0x78,0x00,0x00, 7, // 0x56 'V' 0x00,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0x78,0x30,0x00,0x00, 7, // 0x57 'W' 0x00,0xcc,0xcc,0xcc,0xcc,0xb4,0xfc,0xcc,0x84,0x00,0x00, 7, // 0x58 'X' 0x00,0xcc,0xcc,0x78,0x30,0x78,0xcc,0xcc,0xcc,0x00,0x00, 7, // 0x59 'Y' 0x00,0xcc,0xcc,0xcc,0x78,0x30,0x30,0x30,0x78,0x00,0x00, 7, // 0x5a 'Z' 0x00,0xfc,0x8c,0x18,0x30,0x60,0xc0,0xc4,0xfc,0x00,0x00, 7, // 0x5b '[' 0x00,0x78,0x60,0x60,0x60,0x60,0x60,0x60,0x78,0x00,0x00, 7, // 0x5c '\' 0x00,0x60,0x60,0x30,0x30,0x18,0x18,0x0c,0x0c,0x00,0x00, 7, // 0x5d ']' 0x00,0x78,0x18,0x18,0x18,0x18,0x18,0x18,0x78,0x00,0x00, 7, // 0x5e '^' 0x00,0x10,0x38,0x6c,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 7, // 0x5f '_' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00, 7, // 0x60 '`' 0x00,0x30,0x30,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 7, // 0x61 'a' 0x00,0x00,0x00,0x70,0x18,0x78,0xd8,0xd8,0x6c,0x00,0x00, 7, // 0x62 'b' 0x00,0x60,0x60,0x60,0x78,0x6c,0x6c,0x6c,0x78,0x00,0x00, 7, // 0x63 'c' 0x00,0x00,0x00,0x78,0xcc,0xc0,0xc0,0xcc,0x78,0x00,0x00, 7, // 0x64 'd' 0x00,0x18,0x18,0x18,0x78,0xd8,0xd8,0xd8,0x6c,0x00,0x00, 7, // 0x65 'e' 0x00,0x00,0x00,0x78,0xcc,0xfc,0xc0,0xcc,0x78,0x00,0x00, 7, // 0x66 'f' 0x00,0x18,0x34,0x30,0x78,0x30,0x30,0x30,0x78,0x00,0x00, 7, // 0x67 'g' 0x00,0x00,0x00,0x6c,0xd8,0xd8,0xd8,0x78,0x18,0xd8,0x70, 7, // 0x68 'h' 0x00,0xc0,0xc0,0xd8,0xec,0xcc,0xcc,0xcc,0xcc,0x00,0x00, 7, // 0x69 'i' 0x00,0x30,0x00,0x70,0x30,0x30,0x30,0x30,0x78,0x00,0x00, 7, // 0x6a 'j' 0x00,0x0c,0x00,0x1c,0x0c,0x0c,0x0c,0x0c,0x6c,0x6c,0x38, 7, // 0x6b 'k' 0x00,0xc0,0xc0,0xcc,0xcc,0xd8,0xf0,0xd8,0xcc,0x00,0x00, 7, // 0x6c 'l' 0x00,0x70,0x30,0x30,0x30,0x30,0x30,0x30,0x78,0x00,0x00, 7, // 0x6d 'm' 0x00,0x00,0x00,0xe8,0xfc,0xd4,0xd4,0xc4,0xc4,0x00,0x00, 7, // 0x6e 'n' 0x00,0x00,0x00,0xd8,0x6c,0x6c,0x6c,0x6c,0x6c,0x00,0x00, 7, // 0x6f 'o' 0x00,0x00,0x00,0x78,0xcc,0xcc,0xcc,0xcc,0x78,0x00,0x00, 7, // 0x70 'p' 0x00,0x00,0x00,0xf8,0xcc,0xcc,0xcc,0xf8,0xc0,0xc0,0xc0, 7, // 0x71 'q' 0x00,0x00,0x00,0x7c,0xcc,0xcc,0xcc,0x7c,0x0c,0x0c,0x0c, 7, // 0x72 'r' 0x00,0x00,0x00,0xd8,0xec,0xcc,0xc0,0xc0,0xc0,0x00,0x00, 7, // 0x73 's' 0x00,0x00,0x00,0x78,0xcc,0x60,0x18,0xcc,0x78,0x00,0x00, 7, // 0x74 't' 0x00,0x20,0x60,0x60,0xf0,0x60,0x60,0x68,0x30,0x00,0x00, 7, // 0x75 'u' 0x00,0x00,0x00,0xd8,0xd8,0xd8,0xd8,0xd8,0x6c,0x00,0x00, 7, // 0x76 'v' 0x00,0x00,0x00,0xcc,0xcc,0xcc,0xcc,0x78,0x30,0x00,0x00, 7, // 0x77 'w' 0x00,0x00,0x00,0xcc,0xcc,0xb4,0xfc,0xcc,0x84,0x00,0x00, 7, // 0x78 'x' 0x00,0x00,0x00,0xcc,0x78,0x30,0x78,0xcc,0xcc,0x00,0x00, 7, // 0x79 'y' 0x00,0x00,0x00,0xcc,0xcc,0xcc,0xcc,0x7c,0x0c,0x18,0xf0, 7, // 0x7a 'z' 0x00,0x00,0x00,0xfc,0x98,0x30,0x60,0xc4,0xfc,0x00,0x00, 7, // 0x7b '{' 0x1c,0x30,0x30,0x30,0xe0,0x30,0x30,0x30,0x1c,0x00,0x00, 7, // 0x7c '|' 0x30,0x30,0x30,0x30,0x00,0x30,0x30,0x30,0x30,0x00,0x00, 7, // 0x7d '}' 0xe0,0x30,0x30,0x30,0x1c,0x30,0x30,0x30,0xe0,0x00,0x00, 7, // 0x7e '~' 0x00,0x34,0x58,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 7, // 0x7f '' 0x00,0x00,0x00,0x30,0x78,0xcc,0xcc,0xfc,0x00,0x00,0x00, 0 }; const int8u gse7x15[] = { 15, 0, 32, 128-32, 0x00,0x00,0x10,0x00,0x20,0x00,0x30,0x00,0x40,0x00,0x50,0x00,0x60,0x00,0x70,0x00,0x80,0x00, 0x90,0x00,0xa0,0x00,0xb0,0x00,0xc0,0x00,0xd0,0x00,0xe0,0x00,0xf0,0x00,0x00,0x01,0x10,0x01, 0x20,0x01,0x30,0x01,0x40,0x01,0x50,0x01,0x60,0x01,0x70,0x01,0x80,0x01,0x90,0x01,0xa0,0x01, 0xb0,0x01,0xc0,0x01,0xd0,0x01,0xe0,0x01,0xf0,0x01,0x00,0x02,0x10,0x02,0x20,0x02,0x30,0x02, 0x40,0x02,0x50,0x02,0x60,0x02,0x70,0x02,0x80,0x02,0x90,0x02,0xa0,0x02,0xb0,0x02,0xc0,0x02, 0xd0,0x02,0xe0,0x02,0xf0,0x02,0x00,0x03,0x10,0x03,0x20,0x03,0x30,0x03,0x40,0x03,0x50,0x03, 0x60,0x03,0x70,0x03,0x80,0x03,0x90,0x03,0xa0,0x03,0xb0,0x03,0xc0,0x03,0xd0,0x03,0xe0,0x03, 0xf0,0x03,0x00,0x04,0x10,0x04,0x20,0x04,0x30,0x04,0x40,0x04,0x50,0x04,0x60,0x04,0x70,0x04, 0x80,0x04,0x90,0x04,0xa0,0x04,0xb0,0x04,0xc0,0x04,0xd0,0x04,0xe0,0x04,0xf0,0x04,0x00,0x05, 0x10,0x05,0x20,0x05,0x30,0x05,0x40,0x05,0x50,0x05,0x60,0x05,0x70,0x05,0x80,0x05,0x90,0x05, 0xa0,0x05,0xb0,0x05,0xc0,0x05,0xd0,0x05,0xe0,0x05,0xf0,0x05, 7, // 0x20 ' ' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 7, // 0x21 '!' 0x00,0x00,0x10,0x38,0x38,0x38,0x38,0x10,0x10,0x00,0x10,0x10,0x00,0x00,0x00, 7, // 0x22 '"' 0x00,0x00,0x24,0x24,0x24,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 7, // 0x23 '#' 0x00,0x00,0x48,0x48,0x48,0xfc,0x48,0x48,0xfc,0x48,0x48,0x48,0x00,0x00,0x00, 7, // 0x24 '$' 0x00,0x00,0x10,0x38,0x54,0x50,0x38,0x14,0x54,0x54,0x38,0x10,0x00,0x00,0x00, 7, // 0x25 '%' 0x00,0x00,0x44,0x44,0x08,0x08,0x10,0x10,0x20,0x20,0x44,0x44,0x00,0x00,0x00, 7, // 0x26 '&' 0x00,0x00,0x00,0x30,0x48,0x48,0x30,0x60,0x94,0x98,0x90,0x6c,0x00,0x00,0x00, 7, // 0x27 ''' 0x00,0x00,0x20,0x20,0x20,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 7, // 0x28 '(' 0x00,0x04,0x08,0x10,0x20,0x20,0x20,0x20,0x20,0x10,0x08,0x04,0x00,0x00,0x00, 7, // 0x29 ')' 0x00,0x40,0x20,0x10,0x08,0x08,0x08,0x08,0x08,0x10,0x20,0x40,0x00,0x00,0x00, 7, // 0x2a '*' 0x00,0x00,0x00,0x00,0x00,0x20,0xa8,0x70,0xa8,0x20,0x00,0x00,0x00,0x00,0x00, 7, // 0x2b '+' 0x00,0x00,0x00,0x00,0x10,0x10,0x10,0x7c,0x10,0x10,0x10,0x00,0x00,0x00,0x00, 7, // 0x2c ',' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x30,0x60,0x00, 7, // 0x2d '-' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 7, // 0x2e '.' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x00, 7, // 0x2f '/' 0x00,0x00,0x04,0x04,0x08,0x08,0x10,0x10,0x20,0x20,0x40,0x40,0x00,0x00,0x00, 7, // 0x30 '0' 0x00,0x00,0x38,0x44,0x44,0x4c,0x54,0x64,0x44,0x44,0x44,0x38,0x00,0x00,0x00, 7, // 0x31 '1' 0x00,0x00,0x10,0x10,0x30,0x10,0x10,0x10,0x10,0x10,0x10,0x7c,0x00,0x00,0x00, 7, // 0x32 '2' 0x00,0x00,0x38,0x44,0x44,0x04,0x08,0x10,0x20,0x40,0x44,0x7c,0x00,0x00,0x00, 7, // 0x33 '3' 0x00,0x00,0x7c,0x44,0x08,0x10,0x38,0x04,0x04,0x04,0x44,0x38,0x00,0x00,0x00, 7, // 0x34 '4' 0x00,0x00,0x08,0x10,0x20,0x40,0x48,0x48,0x7c,0x08,0x08,0x1c,0x00,0x00,0x00, 7, // 0x35 '5' 0x00,0x00,0x7c,0x40,0x40,0x40,0x78,0x04,0x04,0x04,0x44,0x38,0x00,0x00,0x00, 7, // 0x36 '6' 0x00,0x00,0x18,0x20,0x40,0x40,0x78,0x44,0x44,0x44,0x44,0x38,0x00,0x00,0x00, 7, // 0x37 '7' 0x00,0x00,0x7c,0x44,0x04,0x04,0x08,0x08,0x10,0x10,0x10,0x10,0x00,0x00,0x00, 7, // 0x38 '8' 0x00,0x00,0x38,0x44,0x44,0x44,0x38,0x44,0x44,0x44,0x44,0x38,0x00,0x00,0x00, 7, // 0x39 '9' 0x00,0x00,0x38,0x44,0x44,0x44,0x44,0x3c,0x04,0x04,0x08,0x30,0x00,0x00,0x00, 7, // 0x3a ':' 0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x00, 7, // 0x3b ';' 0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x00,0x30,0x30,0x60,0x00,0x00, 7, // 0x3c '<' 0x00,0x00,0x00,0x04,0x08,0x10,0x20,0x40,0x20,0x10,0x08,0x04,0x00,0x00,0x00, 7, // 0x3d '=' 0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 7, // 0x3e '>' 0x00,0x00,0x00,0x40,0x20,0x10,0x08,0x04,0x08,0x10,0x20,0x40,0x00,0x00,0x00, 7, // 0x3f '?' 0x00,0x00,0x78,0x84,0x84,0x84,0x08,0x10,0x20,0x20,0x00,0x20,0x00,0x00,0x00, 7, // 0x40 '@' 0x00,0x00,0x00,0x30,0x48,0x04,0x34,0x54,0x54,0x54,0x54,0x28,0x00,0x00,0x00, 7, // 0x41 'A' 0x00,0x00,0x10,0x28,0x44,0x44,0x44,0x7c,0x44,0x44,0x44,0x44,0x00,0x00,0x00, 7, // 0x42 'B' 0x00,0x00,0x78,0x44,0x44,0x44,0x78,0x44,0x44,0x44,0x44,0x78,0x00,0x00,0x00, 7, // 0x43 'C' 0x00,0x00,0x38,0x44,0x44,0x40,0x40,0x40,0x40,0x44,0x44,0x38,0x00,0x00,0x00, 7, // 0x44 'D' 0x00,0x00,0x70,0x48,0x44,0x44,0x44,0x44,0x44,0x44,0x48,0x70,0x00,0x00,0x00, 7, // 0x45 'E' 0x00,0x00,0x7c,0x40,0x40,0x40,0x70,0x40,0x40,0x40,0x40,0x7c,0x00,0x00,0x00, 7, // 0x46 'F' 0x00,0x00,0x7c,0x40,0x40,0x40,0x70,0x40,0x40,0x40,0x40,0x40,0x00,0x00,0x00, 7, // 0x47 'G' 0x00,0x00,0x38,0x44,0x40,0x40,0x40,0x5c,0x44,0x44,0x44,0x38,0x00,0x00,0x00, 7, // 0x48 'H' 0x00,0x00,0x44,0x44,0x44,0x44,0x7c,0x44,0x44,0x44,0x44,0x44,0x00,0x00,0x00, 7, // 0x49 'I' 0x00,0x00,0x38,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x38,0x00,0x00,0x00, 7, // 0x4a 'J' 0x00,0x00,0x1c,0x08,0x08,0x08,0x08,0x08,0x08,0x48,0x48,0x30,0x00,0x00,0x00, 7, // 0x4b 'K' 0x00,0x00,0x44,0x44,0x48,0x50,0x60,0x50,0x48,0x44,0x44,0x44,0x00,0x00,0x00, 7, // 0x4c 'L' 0x00,0x00,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x7c,0x00,0x00,0x00, 7, // 0x4d 'M' 0x00,0x00,0x44,0x6c,0x54,0x54,0x44,0x44,0x44,0x44,0x44,0x44,0x00,0x00,0x00, 7, // 0x4e 'N' 0x00,0x00,0x44,0x44,0x44,0x64,0x54,0x4c,0x44,0x44,0x44,0x44,0x00,0x00,0x00, 7, // 0x4f 'O' 0x00,0x00,0x38,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x38,0x00,0x00,0x00, 7, // 0x50 'P' 0x00,0x00,0x78,0x44,0x44,0x44,0x44,0x78,0x40,0x40,0x40,0x40,0x00,0x00,0x00, 7, // 0x51 'Q' 0x00,0x00,0x38,0x44,0x44,0x44,0x44,0x44,0x44,0x54,0x48,0x34,0x00,0x00,0x00, 7, // 0x52 'R' 0x00,0x00,0x78,0x44,0x44,0x44,0x44,0x78,0x50,0x48,0x44,0x44,0x00,0x00,0x00, 7, // 0x53 'S' 0x00,0x00,0x38,0x44,0x44,0x40,0x38,0x04,0x04,0x44,0x44,0x38,0x00,0x00,0x00, 7, // 0x54 'T' 0x00,0x00,0x7c,0x54,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x00,0x00,0x00, 7, // 0x55 'U' 0x00,0x00,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x38,0x00,0x00,0x00, 7, // 0x56 'V' 0x00,0x00,0x44,0x44,0x44,0x44,0x44,0x44,0x28,0x28,0x10,0x10,0x00,0x00,0x00, 7, // 0x57 'W' 0x00,0x00,0x44,0x44,0x44,0x44,0x44,0x44,0x54,0x54,0x6c,0x44,0x00,0x00,0x00, 7, // 0x58 'X' 0x00,0x00,0x44,0x44,0x44,0x28,0x10,0x28,0x44,0x44,0x44,0x44,0x00,0x00,0x00, 7, // 0x59 'Y' 0x00,0x00,0x44,0x44,0x44,0x44,0x28,0x10,0x10,0x10,0x10,0x38,0x00,0x00,0x00, 7, // 0x5a 'Z' 0x00,0x00,0x7c,0x04,0x04,0x08,0x10,0x20,0x40,0x40,0x40,0x7c,0x00,0x00,0x00, 7, // 0x5b '[' 0x00,0x38,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x38,0x00,0x00, 7, // 0x5c '\' 0x00,0x00,0x40,0x40,0x20,0x20,0x10,0x10,0x08,0x08,0x04,0x04,0x00,0x00,0x00, 7, // 0x5d ']' 0x00,0x38,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x38,0x00,0x00, 7, // 0x5e '^' 0x00,0x10,0x28,0x44,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 7, // 0x5f '_' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00, 7, // 0x60 '`' 0x00,0x20,0x20,0x20,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 7, // 0x61 'a' 0x00,0x00,0x00,0x00,0x38,0x44,0x04,0x3c,0x44,0x44,0x44,0x3a,0x00,0x00,0x00, 7, // 0x62 'b' 0x00,0x00,0x40,0x40,0x40,0x78,0x44,0x44,0x44,0x44,0x44,0x78,0x00,0x00,0x00, 7, // 0x63 'c' 0x00,0x00,0x00,0x00,0x38,0x44,0x40,0x40,0x40,0x40,0x44,0x38,0x00,0x00,0x00, 7, // 0x64 'd' 0x00,0x00,0x04,0x04,0x04,0x3c,0x44,0x44,0x44,0x44,0x44,0x3a,0x00,0x00,0x00, 7, // 0x65 'e' 0x00,0x00,0x00,0x00,0x38,0x44,0x44,0x7c,0x40,0x40,0x44,0x38,0x00,0x00,0x00, 7, // 0x66 'f' 0x00,0x00,0x18,0x24,0x20,0x70,0x20,0x20,0x20,0x20,0x20,0x70,0x00,0x00,0x00, 7, // 0x67 'g' 0x00,0x00,0x00,0x00,0x3a,0x44,0x44,0x44,0x44,0x44,0x3c,0x04,0x44,0x38,0x00, 7, // 0x68 'h' 0x00,0x00,0x40,0x40,0x40,0x58,0x64,0x44,0x44,0x44,0x44,0x44,0x00,0x00,0x00, 7, // 0x69 'i' 0x00,0x00,0x10,0x10,0x00,0x30,0x10,0x10,0x10,0x10,0x10,0x38,0x00,0x00,0x00, 7, // 0x6a 'j' 0x00,0x00,0x08,0x08,0x00,0x18,0x08,0x08,0x08,0x08,0x08,0x48,0x48,0x30,0x00, 7, // 0x6b 'k' 0x00,0x00,0x40,0x40,0x44,0x44,0x48,0x50,0x60,0x50,0x48,0x44,0x00,0x00,0x00, 7, // 0x6c 'l' 0x00,0x00,0x30,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x38,0x00,0x00,0x00, 7, // 0x6d 'm' 0x00,0x00,0x00,0x00,0xa8,0x54,0x54,0x54,0x54,0x54,0x54,0x54,0x00,0x00,0x00, 7, // 0x6e 'n' 0x00,0x00,0x00,0x00,0xb8,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x00,0x00,0x00, 7, // 0x6f 'o' 0x00,0x00,0x00,0x00,0x38,0x44,0x44,0x44,0x44,0x44,0x44,0x38,0x00,0x00,0x00, 7, // 0x70 'p' 0x00,0x00,0x00,0x00,0x78,0x44,0x44,0x44,0x44,0x44,0x78,0x40,0x40,0x40,0x00, 7, // 0x71 'q' 0x00,0x00,0x00,0x00,0x3c,0x44,0x44,0x44,0x44,0x44,0x3c,0x04,0x04,0x04,0x00, 7, // 0x72 'r' 0x00,0x00,0x00,0x00,0x58,0x64,0x44,0x40,0x40,0x40,0x40,0x40,0x00,0x00,0x00, 7, // 0x73 's' 0x00,0x00,0x00,0x00,0x38,0x44,0x40,0x38,0x04,0x44,0x44,0x38,0x00,0x00,0x00, 7, // 0x74 't' 0x00,0x00,0x20,0x20,0x20,0x70,0x20,0x20,0x20,0x20,0x24,0x18,0x00,0x00,0x00, 7, // 0x75 'u' 0x00,0x00,0x00,0x00,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x3a,0x00,0x00,0x00, 7, // 0x76 'v' 0x00,0x00,0x00,0x00,0x44,0x44,0x44,0x44,0x28,0x28,0x10,0x10,0x00,0x00,0x00, 7, // 0x77 'w' 0x00,0x00,0x00,0x00,0x44,0x44,0x44,0x44,0x54,0x54,0x6c,0x44,0x00,0x00,0x00, 7, // 0x78 'x' 0x00,0x00,0x00,0x00,0x44,0x44,0x28,0x10,0x28,0x44,0x44,0x44,0x00,0x00,0x00, 7, // 0x79 'y' 0x00,0x00,0x00,0x00,0x44,0x44,0x44,0x44,0x44,0x44,0x3c,0x04,0x08,0x70,0x00, 7, // 0x7a 'z' 0x00,0x00,0x00,0x00,0x7c,0x04,0x08,0x10,0x20,0x40,0x40,0x7c,0x00,0x00,0x00, 7, // 0x7b '{' 0x00,0x0c,0x10,0x10,0x10,0x10,0x10,0x60,0x10,0x10,0x10,0x10,0x0c,0x00,0x00, 7, // 0x7c '|' 0x00,0x20,0x20,0x20,0x20,0x20,0x00,0x00,0x20,0x20,0x20,0x20,0x20,0x00,0x00, 7, // 0x7d '}' 0x00,0x60,0x10,0x10,0x10,0x10,0x10,0x0c,0x10,0x10,0x10,0x10,0x60,0x00,0x00, 7, // 0x7e '~' 0x00,0x00,0x64,0x98,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 7, // 0x7f '' 0x00,0x00,0x00,0x00,0x00,0x10,0x28,0x44,0x44,0x7c,0x00,0x00,0x00,0x00,0x00, 0 }; const int8u gse7x15_bold[] = { 15, 0, 32, 128-32, 0x00,0x00,0x10,0x00,0x20,0x00,0x30,0x00,0x40,0x00,0x50,0x00,0x60,0x00,0x70,0x00,0x80,0x00, 0x90,0x00,0xa0,0x00,0xb0,0x00,0xc0,0x00,0xd0,0x00,0xe0,0x00,0xf0,0x00,0x00,0x01,0x10,0x01, 0x20,0x01,0x30,0x01,0x40,0x01,0x50,0x01,0x60,0x01,0x70,0x01,0x80,0x01,0x90,0x01,0xa0,0x01, 0xb0,0x01,0xc0,0x01,0xd0,0x01,0xe0,0x01,0xf0,0x01,0x00,0x02,0x10,0x02,0x20,0x02,0x30,0x02, 0x40,0x02,0x50,0x02,0x60,0x02,0x70,0x02,0x80,0x02,0x90,0x02,0xa0,0x02,0xb0,0x02,0xc0,0x02, 0xd0,0x02,0xe0,0x02,0xf0,0x02,0x00,0x03,0x10,0x03,0x20,0x03,0x30,0x03,0x40,0x03,0x50,0x03, 0x60,0x03,0x70,0x03,0x80,0x03,0x90,0x03,0xa0,0x03,0xb0,0x03,0xc0,0x03,0xd0,0x03,0xe0,0x03, 0xf0,0x03,0x00,0x04,0x10,0x04,0x20,0x04,0x30,0x04,0x40,0x04,0x50,0x04,0x60,0x04,0x70,0x04, 0x80,0x04,0x90,0x04,0xa0,0x04,0xb0,0x04,0xc0,0x04,0xd0,0x04,0xe0,0x04,0xf0,0x04,0x00,0x05, 0x10,0x05,0x20,0x05,0x30,0x05,0x40,0x05,0x50,0x05,0x60,0x05,0x70,0x05,0x80,0x05,0x90,0x05, 0xa0,0x05,0xb0,0x05,0xc0,0x05,0xd0,0x05,0xe0,0x05,0xf0,0x05, 7, // 0x20 ' ' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 7, // 0x21 '!' 0x00,0x00,0x00,0x30,0x78,0x78,0x78,0x30,0x30,0x00,0x30,0x30,0x00,0x00,0x00, 7, // 0x22 '"' 0x00,0x00,0x6c,0x6c,0x6c,0x28,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 7, // 0x23 '#' 0x00,0x00,0x48,0x48,0x48,0xfc,0x48,0x48,0xfc,0x48,0x48,0x48,0x00,0x00,0x00, 7, // 0x24 '$' 0x00,0x30,0x30,0x78,0xcc,0xe0,0x70,0x38,0x1c,0xcc,0x78,0x30,0x30,0x00,0x00, 7, // 0x25 '%' 0x00,0x00,0x00,0x64,0x6c,0x08,0x18,0x10,0x30,0x20,0x6c,0x4c,0x00,0x00,0x00, 7, // 0x26 '&' 0x00,0x00,0x00,0x30,0x58,0x58,0x30,0x74,0xdc,0xd8,0xd8,0x6c,0x00,0x00,0x00, 7, // 0x27 ''' 0x00,0x00,0x30,0x30,0x30,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 7, // 0x28 '(' 0x00,0x0c,0x18,0x30,0x60,0x60,0x60,0x60,0x60,0x30,0x18,0x0c,0x00,0x00,0x00, 7, // 0x29 ')' 0x00,0xc0,0x60,0x30,0x18,0x18,0x18,0x18,0x18,0x30,0x60,0xc0,0x00,0x00,0x00, 7, // 0x2a '*' 0x00,0x00,0x00,0x00,0x00,0x20,0xa8,0x70,0xa8,0x20,0x00,0x00,0x00,0x00,0x00, 7, // 0x2b '+' 0x00,0x00,0x00,0x00,0x00,0x30,0x30,0xfc,0x30,0x30,0x00,0x00,0x00,0x00,0x00, 7, // 0x2c ',' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x30,0x60,0x00, 7, // 0x2d '-' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 7, // 0x2e '.' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x00, 7, // 0x2f '/' 0x00,0x00,0x0c,0x0c,0x18,0x18,0x30,0x30,0x60,0x60,0xc0,0xc0,0x00,0x00,0x00, 7, // 0x30 '0' 0x00,0x00,0x78,0xcc,0xcc,0xcc,0xdc,0xec,0xcc,0xcc,0xcc,0x78,0x00,0x00,0x00, 7, // 0x31 '1' 0x00,0x00,0x30,0x30,0x70,0xf0,0x30,0x30,0x30,0x30,0x30,0xfc,0x00,0x00,0x00, 7, // 0x32 '2' 0x00,0x00,0x78,0xcc,0xcc,0x0c,0x18,0x30,0x60,0xc0,0xcc,0xfc,0x00,0x00,0x00, 7, // 0x33 '3' 0x00,0x00,0xfc,0x8c,0x18,0x30,0x78,0x0c,0x0c,0x0c,0xcc,0x78,0x00,0x00,0x00, 7, // 0x34 '4' 0x00,0x00,0x18,0x30,0x60,0xc8,0xd8,0xd8,0xfc,0x18,0x18,0x3c,0x00,0x00,0x00, 7, // 0x35 '5' 0x00,0x00,0xfc,0xc0,0xc0,0xc0,0xf8,0x0c,0x0c,0x0c,0xcc,0x78,0x00,0x00,0x00, 7, // 0x36 '6' 0x00,0x00,0x38,0x60,0xc0,0xc0,0xf8,0xcc,0xcc,0xcc,0xcc,0x78,0x00,0x00,0x00, 7, // 0x37 '7' 0x00,0x00,0xfc,0x8c,0x0c,0x0c,0x18,0x18,0x30,0x30,0x30,0x30,0x00,0x00,0x00, 7, // 0x38 '8' 0x00,0x00,0x78,0xcc,0xcc,0xcc,0x78,0xcc,0xcc,0xcc,0xcc,0x78,0x00,0x00,0x00, 7, // 0x39 '9' 0x00,0x00,0x78,0xcc,0xcc,0xcc,0xcc,0x7c,0x0c,0x0c,0x18,0x70,0x00,0x00,0x00, 7, // 0x3a ':' 0x00,0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x00,0x00, 7, // 0x3b ';' 0x00,0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x00,0x00,0x30,0x30,0x30,0x60,0x00, 7, // 0x3c '<' 0x00,0x00,0x00,0x0c,0x18,0x30,0x60,0xc0,0x60,0x30,0x18,0x0c,0x00,0x00,0x00, 7, // 0x3d '=' 0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00, 7, // 0x3e '>' 0x00,0x00,0x00,0xc0,0x60,0x30,0x18,0x0c,0x18,0x30,0x60,0xc0,0x00,0x00,0x00, 7, // 0x3f '?' 0x00,0x00,0x78,0xcc,0xcc,0x18,0x30,0x30,0x30,0x00,0x30,0x30,0x00,0x00,0x00, 7, // 0x40 '@' 0x00,0x00,0x00,0x70,0x88,0x04,0x74,0xb4,0xb4,0xb4,0xb4,0x68,0x00,0x00,0x00, 7, // 0x41 'A' 0x00,0x00,0x30,0x78,0xcc,0xcc,0xcc,0xfc,0xcc,0xcc,0xcc,0xcc,0x00,0x00,0x00, 7, // 0x42 'B' 0x00,0x00,0xf8,0xcc,0xcc,0xcc,0xf8,0xcc,0xcc,0xcc,0xcc,0xf8,0x00,0x00,0x00, 7, // 0x43 'C' 0x00,0x00,0x78,0xcc,0xc4,0xc0,0xc0,0xc0,0xc0,0xc4,0xcc,0x78,0x00,0x00,0x00, 7, // 0x44 'D' 0x00,0x00,0xf0,0xd8,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0xd8,0xf0,0x00,0x00,0x00, 7, // 0x45 'E' 0x00,0x00,0xfc,0xc4,0xc0,0xd0,0xf0,0xd0,0xc0,0xc0,0xc4,0xfc,0x00,0x00,0x00, 7, // 0x46 'F' 0x00,0x00,0xfc,0xc4,0xc0,0xd0,0xf0,0xd0,0xc0,0xc0,0xc0,0xc0,0x00,0x00,0x00, 7, // 0x47 'G' 0x00,0x00,0x78,0xcc,0xc0,0xc0,0xc0,0xdc,0xcc,0xcc,0xcc,0x78,0x00,0x00,0x00, 7, // 0x48 'H' 0x00,0x00,0xcc,0xcc,0xcc,0xcc,0xfc,0xcc,0xcc,0xcc,0xcc,0xcc,0x00,0x00,0x00, 7, // 0x49 'I' 0x00,0x00,0x78,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x78,0x00,0x00,0x00, 7, // 0x4a 'J' 0x00,0x00,0x3c,0x18,0x18,0x18,0x18,0x18,0x18,0xd8,0xd8,0x70,0x00,0x00,0x00, 7, // 0x4b 'K' 0x00,0x00,0xcc,0xcc,0xd8,0xd8,0xf0,0xd8,0xd8,0xcc,0xcc,0xcc,0x00,0x00,0x00, 7, // 0x4c 'L' 0x00,0x00,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc4,0xfc,0x00,0x00,0x00, 7, // 0x4d 'M' 0x00,0x00,0x84,0xcc,0xfc,0xb4,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0x00,0x00,0x00, 7, // 0x4e 'N' 0x00,0x00,0xcc,0xcc,0xcc,0xec,0xfc,0xdc,0xcc,0xcc,0xcc,0xcc,0x00,0x00,0x00, 7, // 0x4f 'O' 0x00,0x00,0x78,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0x78,0x00,0x00,0x00, 7, // 0x50 'P' 0x00,0x00,0xf8,0xcc,0xcc,0xcc,0xcc,0xf8,0xc0,0xc0,0xc0,0xc0,0x00,0x00,0x00, 7, // 0x51 'Q' 0x00,0x00,0x78,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0xdc,0x78,0x18,0x0c,0x00,0x00, 7, // 0x52 'R' 0x00,0x00,0xf8,0xcc,0xcc,0xcc,0xcc,0xf8,0xd8,0xcc,0xcc,0xcc,0x00,0x00,0x00, 7, // 0x53 'S' 0x00,0x00,0x78,0xcc,0xcc,0xe0,0x70,0x38,0x1c,0xcc,0xcc,0x78,0x00,0x00,0x00, 7, // 0x54 'T' 0x00,0x00,0xfc,0xb4,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x00,0x00,0x00, 7, // 0x55 'U' 0x00,0x00,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0x78,0x00,0x00,0x00, 7, // 0x56 'V' 0x00,0x00,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0x78,0x30,0x00,0x00,0x00, 7, // 0x57 'W' 0x00,0x00,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0xb4,0xfc,0xcc,0x84,0x00,0x00,0x00, 7, // 0x58 'X' 0x00,0x00,0xcc,0xcc,0xcc,0x78,0x30,0x78,0xcc,0xcc,0xcc,0xcc,0x00,0x00,0x00, 7, // 0x59 'Y' 0x00,0x00,0xcc,0xcc,0xcc,0xcc,0x78,0x30,0x30,0x30,0x30,0x78,0x00,0x00,0x00, 7, // 0x5a 'Z' 0x00,0x00,0xfc,0x8c,0x0c,0x18,0x30,0x60,0xc0,0xc0,0xc4,0xfc,0x00,0x00,0x00, 7, // 0x5b '[' 0x00,0x78,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x78,0x00,0x00, 7, // 0x5c '\' 0x00,0x00,0xc0,0xc0,0x60,0x60,0x30,0x30,0x18,0x18,0x0c,0x0c,0x00,0x00,0x00, 7, // 0x5d ']' 0x00,0x78,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x78,0x00,0x00, 7, // 0x5e '^' 0x00,0x10,0x38,0x6c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 7, // 0x5f '_' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00, 7, // 0x60 '`' 0x00,0x30,0x30,0x30,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 7, // 0x61 'a' 0x00,0x00,0x00,0x00,0x70,0xd8,0x18,0x78,0xd8,0xd8,0xd8,0x6c,0x00,0x00,0x00, 7, // 0x62 'b' 0x00,0x00,0x60,0x60,0x60,0x78,0x6c,0x6c,0x6c,0x6c,0x6c,0x78,0x00,0x00,0x00, 7, // 0x63 'c' 0x00,0x00,0x00,0x00,0x78,0xcc,0xc0,0xc0,0xc0,0xc0,0xcc,0x78,0x00,0x00,0x00, 7, // 0x64 'd' 0x00,0x00,0x18,0x18,0x18,0x78,0xd8,0xd8,0xd8,0xd8,0xd8,0x6c,0x00,0x00,0x00, 7, // 0x65 'e' 0x00,0x00,0x00,0x00,0x78,0xcc,0xcc,0xfc,0xc0,0xc0,0xcc,0x78,0x00,0x00,0x00, 7, // 0x66 'f' 0x00,0x00,0x30,0x68,0x60,0x60,0xf0,0x60,0x60,0x60,0x60,0xf0,0x00,0x00,0x00, 7, // 0x67 'g' 0x00,0x00,0x00,0x00,0x6c,0xd8,0xd8,0xd8,0xd8,0xd8,0x78,0x18,0xd8,0x70,0x00, 7, // 0x68 'h' 0x00,0x00,0xc0,0xc0,0xc0,0xd8,0xec,0xcc,0xcc,0xcc,0xcc,0xcc,0x00,0x00,0x00, 7, // 0x69 'i' 0x00,0x00,0x30,0x30,0x00,0x70,0x30,0x30,0x30,0x30,0x30,0x78,0x00,0x00,0x00, 7, // 0x6a 'j' 0x00,0x00,0x18,0x18,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0xd8,0xd8,0x70,0x00, 7, // 0x6b 'k' 0x00,0x00,0xc0,0xc0,0xcc,0xcc,0xcc,0xd8,0xf0,0xd8,0xcc,0xcc,0x00,0x00,0x00, 7, // 0x6c 'l' 0x00,0x00,0x70,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x78,0x00,0x00,0x00, 7, // 0x6d 'm' 0x00,0x00,0x00,0x00,0xe8,0xfc,0xd4,0xd4,0xd4,0xc4,0xc4,0xc4,0x00,0x00,0x00, 7, // 0x6e 'n' 0x00,0x00,0x00,0x00,0xd8,0x6c,0x6c,0x6c,0x6c,0x6c,0x6c,0x6c,0x00,0x00,0x00, 7, // 0x6f 'o' 0x00,0x00,0x00,0x00,0x78,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0x78,0x00,0x00,0x00, 7, // 0x70 'p' 0x00,0x00,0x00,0x00,0xf8,0xcc,0xcc,0xcc,0xcc,0xcc,0xf8,0xc0,0xc0,0xc0,0x00, 7, // 0x71 'q' 0x00,0x00,0x00,0x00,0x7c,0xcc,0xcc,0xcc,0xcc,0xcc,0x7c,0x0c,0x0c,0x0c,0x00, 7, // 0x72 'r' 0x00,0x00,0x00,0x00,0xd8,0xec,0xcc,0xc0,0xc0,0xc0,0xc0,0xc0,0x00,0x00,0x00, 7, // 0x73 's' 0x00,0x00,0x00,0x00,0x78,0xcc,0xe0,0x70,0x38,0x1c,0xcc,0x78,0x00,0x00,0x00, 7, // 0x74 't' 0x00,0x00,0x20,0x60,0x60,0xf0,0x60,0x60,0x60,0x60,0x6c,0x38,0x00,0x00,0x00, 7, // 0x75 'u' 0x00,0x00,0x00,0x00,0xd8,0xd8,0xd8,0xd8,0xd8,0xd8,0xd8,0x6c,0x00,0x00,0x00, 7, // 0x76 'v' 0x00,0x00,0x00,0x00,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0x78,0x30,0x00,0x00,0x00, 7, // 0x77 'w' 0x00,0x00,0x00,0x00,0xcc,0xcc,0xcc,0xcc,0xb4,0xfc,0xcc,0x84,0x00,0x00,0x00, 7, // 0x78 'x' 0x00,0x00,0x00,0x00,0xcc,0xcc,0x78,0x30,0x78,0xcc,0xcc,0xcc,0x00,0x00,0x00, 7, // 0x79 'y' 0x00,0x00,0x00,0x00,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0x7c,0x0c,0x18,0xf0,0x00, 7, // 0x7a 'z' 0x00,0x00,0x00,0x00,0xfc,0x8c,0x18,0x30,0x60,0xc0,0xc4,0xfc,0x00,0x00,0x00, 7, // 0x7b '{' 0x00,0x1c,0x30,0x30,0x30,0x30,0x30,0xe0,0x30,0x30,0x30,0x30,0x1c,0x00,0x00, 7, // 0x7c '|' 0x00,0x30,0x30,0x30,0x30,0x30,0x00,0x00,0x30,0x30,0x30,0x30,0x30,0x00,0x00, 7, // 0x7d '}' 0x00,0xe0,0x30,0x30,0x30,0x30,0x30,0x1c,0x30,0x30,0x30,0x30,0xe0,0x00,0x00, 7, // 0x7e '~' 0x00,0x00,0x34,0x58,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 7, // 0x7f '' 0x00,0x00,0x00,0x00,0x00,0x30,0x78,0xcc,0xcc,0xfc,0x00,0x00,0x00,0x00,0x00, 0 }; const int8u gse8x16[] = { 16, 0, 32, 128-32, 0x00,0x00,0x11,0x00,0x22,0x00,0x33,0x00,0x44,0x00,0x55,0x00,0x66,0x00,0x77,0x00,0x88,0x00, 0x99,0x00,0xaa,0x00,0xbb,0x00,0xcc,0x00,0xdd,0x00,0xee,0x00,0xff,0x00,0x10,0x01,0x21,0x01, 0x32,0x01,0x43,0x01,0x54,0x01,0x65,0x01,0x76,0x01,0x87,0x01,0x98,0x01,0xa9,0x01,0xba,0x01, 0xcb,0x01,0xdc,0x01,0xed,0x01,0xfe,0x01,0x0f,0x02,0x20,0x02,0x31,0x02,0x42,0x02,0x53,0x02, 0x64,0x02,0x75,0x02,0x86,0x02,0x97,0x02,0xa8,0x02,0xb9,0x02,0xca,0x02,0xdb,0x02,0xec,0x02, 0xfd,0x02,0x0e,0x03,0x1f,0x03,0x30,0x03,0x41,0x03,0x52,0x03,0x63,0x03,0x74,0x03,0x85,0x03, 0x96,0x03,0xa7,0x03,0xb8,0x03,0xc9,0x03,0xda,0x03,0xeb,0x03,0xfc,0x03,0x0d,0x04,0x1e,0x04, 0x2f,0x04,0x40,0x04,0x51,0x04,0x62,0x04,0x73,0x04,0x84,0x04,0x95,0x04,0xa6,0x04,0xb7,0x04, 0xc8,0x04,0xd9,0x04,0xea,0x04,0xfb,0x04,0x0c,0x05,0x1d,0x05,0x2e,0x05,0x3f,0x05,0x50,0x05, 0x61,0x05,0x72,0x05,0x83,0x05,0x94,0x05,0xa5,0x05,0xb6,0x05,0xc7,0x05,0xd8,0x05,0xe9,0x05, 0xfa,0x05,0x0b,0x06,0x1c,0x06,0x2d,0x06,0x3e,0x06,0x4f,0x06, 8, // 0x20 ' ' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 8, // 0x21 '!' 0x00,0x00,0x10,0x38,0x38,0x38,0x38,0x10,0x10,0x00,0x10,0x10,0x00,0x00,0x00,0x00, 8, // 0x22 '"' 0x00,0x24,0x24,0x24,0x24,0x48,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 8, // 0x23 '#' 0x00,0x00,0x24,0x24,0x24,0x7e,0x24,0x24,0x7e,0x24,0x24,0x24,0x00,0x00,0x00,0x00, 8, // 0x24 '$' 0x00,0x14,0x14,0x3e,0x55,0x54,0x54,0x3e,0x15,0x15,0x55,0x3e,0x14,0x14,0x00,0x00, 8, // 0x25 '%' 0x00,0x00,0x32,0x56,0x6c,0x04,0x08,0x08,0x10,0x13,0x25,0x26,0x00,0x00,0x00,0x00, 8, // 0x26 '&' 0x00,0x00,0x18,0x24,0x24,0x24,0x18,0x28,0x45,0x46,0x44,0x3b,0x00,0x00,0x00,0x00, 8, // 0x27 ''' 0x00,0x00,0x08,0x08,0x08,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 8, // 0x28 '(' 0x00,0x04,0x08,0x10,0x10,0x20,0x20,0x20,0x20,0x10,0x10,0x08,0x04,0x00,0x00,0x00, 8, // 0x29 ')' 0x00,0x10,0x08,0x04,0x04,0x02,0x02,0x02,0x02,0x04,0x04,0x08,0x10,0x00,0x00,0x00, 8, // 0x2a '*' 0x00,0x00,0x00,0x00,0x66,0x24,0x18,0xff,0x18,0x24,0x66,0x00,0x00,0x00,0x00,0x00, 8, // 0x2b '+' 0x00,0x00,0x00,0x00,0x08,0x08,0x08,0x7f,0x08,0x08,0x08,0x00,0x00,0x00,0x00,0x00, 8, // 0x2c ',' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x18,0x30,0x20,0x00, 8, // 0x2d '-' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 8, // 0x2e '.' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00, 8, // 0x2f '/' 0x00,0x02,0x02,0x04,0x04,0x08,0x08,0x10,0x10,0x20,0x20,0x40,0x40,0x00,0x00,0x00, 8, // 0x30 '0' 0x00,0x00,0x3c,0x42,0x42,0x46,0x4a,0x52,0x62,0x42,0x42,0x3c,0x00,0x00,0x00,0x00, 8, // 0x31 '1' 0x00,0x00,0x08,0x08,0x18,0x38,0x08,0x08,0x08,0x08,0x08,0x3e,0x00,0x00,0x00,0x00, 8, // 0x32 '2' 0x00,0x00,0x3c,0x42,0x42,0x02,0x04,0x08,0x10,0x20,0x42,0x7e,0x00,0x00,0x00,0x00, 8, // 0x33 '3' 0x00,0x00,0x7e,0x42,0x04,0x08,0x1c,0x02,0x02,0x02,0x42,0x3c,0x00,0x00,0x00,0x00, 8, // 0x34 '4' 0x00,0x00,0x04,0x08,0x10,0x24,0x44,0x44,0x7e,0x04,0x04,0x0e,0x00,0x00,0x00,0x00, 8, // 0x35 '5' 0x00,0x00,0x7e,0x42,0x40,0x40,0x7c,0x02,0x02,0x02,0x42,0x3c,0x00,0x00,0x00,0x00, 8, // 0x36 '6' 0x00,0x00,0x1c,0x20,0x40,0x40,0x7c,0x42,0x42,0x42,0x42,0x3c,0x00,0x00,0x00,0x00, 8, // 0x37 '7' 0x00,0x00,0x7e,0x42,0x42,0x02,0x04,0x08,0x10,0x10,0x10,0x10,0x00,0x00,0x00,0x00, 8, // 0x38 '8' 0x00,0x00,0x3c,0x42,0x42,0x42,0x3c,0x42,0x42,0x42,0x42,0x3c,0x00,0x00,0x00,0x00, 8, // 0x39 '9' 0x00,0x00,0x3c,0x42,0x42,0x42,0x42,0x3e,0x02,0x02,0x04,0x38,0x00,0x00,0x00,0x00, 8, // 0x3a ':' 0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00, 8, // 0x3b ';' 0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x30,0x60,0x40,0x00, 8, // 0x3c '<' 0x00,0x00,0x00,0x02,0x04,0x08,0x10,0x20,0x10,0x08,0x04,0x02,0x00,0x00,0x00,0x00, 8, // 0x3d '=' 0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0x00,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 8, // 0x3e '>' 0x00,0x00,0x00,0x20,0x10,0x08,0x04,0x02,0x04,0x08,0x10,0x20,0x00,0x00,0x00,0x00, 8, // 0x3f '?' 0x00,0x00,0x3c,0x42,0x42,0x42,0x04,0x08,0x08,0x00,0x08,0x08,0x00,0x00,0x00,0x00, 8, // 0x40 '@' 0x00,0x00,0x3c,0x42,0x01,0x39,0x49,0x49,0x49,0x49,0x49,0x36,0x00,0x00,0x00,0x00, 8, // 0x41 'A' 0x00,0x00,0x18,0x24,0x42,0x42,0x42,0x7e,0x42,0x42,0x42,0x42,0x00,0x00,0x00,0x00, 8, // 0x42 'B' 0x00,0x00,0x7c,0x22,0x22,0x22,0x3c,0x22,0x22,0x22,0x22,0x7c,0x00,0x00,0x00,0x00, 8, // 0x43 'C' 0x00,0x00,0x3c,0x42,0x42,0x40,0x40,0x40,0x40,0x42,0x42,0x3c,0x00,0x00,0x00,0x00, 8, // 0x44 'D' 0x00,0x00,0x7c,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x7c,0x00,0x00,0x00,0x00, 8, // 0x45 'E' 0x00,0x00,0x7e,0x22,0x20,0x28,0x38,0x28,0x20,0x20,0x22,0x7e,0x00,0x00,0x00,0x00, 8, // 0x46 'F' 0x00,0x00,0x7e,0x22,0x20,0x28,0x38,0x28,0x20,0x20,0x20,0x70,0x00,0x00,0x00,0x00, 8, // 0x47 'G' 0x00,0x00,0x3c,0x42,0x42,0x40,0x40,0x4e,0x42,0x42,0x42,0x3c,0x00,0x00,0x00,0x00, 8, // 0x48 'H' 0x00,0x00,0x42,0x42,0x42,0x42,0x7e,0x42,0x42,0x42,0x42,0x42,0x00,0x00,0x00,0x00, 8, // 0x49 'I' 0x00,0x00,0x1c,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x1c,0x00,0x00,0x00,0x00, 8, // 0x4a 'J' 0x00,0x00,0x0e,0x04,0x04,0x04,0x04,0x04,0x04,0x44,0x44,0x38,0x00,0x00,0x00,0x00, 8, // 0x4b 'K' 0x00,0x00,0x62,0x22,0x24,0x28,0x30,0x28,0x24,0x22,0x22,0x62,0x00,0x00,0x00,0x00, 8, // 0x4c 'L' 0x00,0x00,0x70,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x22,0x7e,0x00,0x00,0x00,0x00, 8, // 0x4d 'M' 0x00,0x00,0x41,0x63,0x55,0x49,0x41,0x41,0x41,0x41,0x41,0x41,0x00,0x00,0x00,0x00, 8, // 0x4e 'N' 0x00,0x00,0x42,0x42,0x62,0x52,0x4a,0x46,0x42,0x42,0x42,0x42,0x00,0x00,0x00,0x00, 8, // 0x4f 'O' 0x00,0x00,0x3c,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x3c,0x00,0x00,0x00,0x00, 8, // 0x50 'P' 0x00,0x00,0x7c,0x22,0x22,0x22,0x22,0x3c,0x20,0x20,0x20,0x70,0x00,0x00,0x00,0x00, 8, // 0x51 'Q' 0x00,0x00,0x3c,0x42,0x42,0x42,0x42,0x42,0x42,0x4a,0x44,0x3a,0x02,0x00,0x00,0x00, 8, // 0x52 'R' 0x00,0x00,0x7c,0x22,0x22,0x22,0x22,0x3c,0x28,0x24,0x22,0x62,0x00,0x00,0x00,0x00, 8, // 0x53 'S' 0x00,0x00,0x3c,0x42,0x42,0x40,0x30,0x0c,0x02,0x42,0x42,0x3c,0x00,0x00,0x00,0x00, 8, // 0x54 'T' 0x00,0x00,0x7f,0x49,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x1c,0x00,0x00,0x00,0x00, 8, // 0x55 'U' 0x00,0x00,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x3c,0x00,0x00,0x00,0x00, 8, // 0x56 'V' 0x00,0x00,0x41,0x41,0x41,0x41,0x22,0x22,0x14,0x14,0x08,0x08,0x00,0x00,0x00,0x00, 8, // 0x57 'W' 0x00,0x00,0x41,0x41,0x41,0x41,0x41,0x49,0x49,0x55,0x63,0x41,0x00,0x00,0x00,0x00, 8, // 0x58 'X' 0x00,0x00,0x42,0x42,0x42,0x24,0x18,0x18,0x24,0x42,0x42,0x42,0x00,0x00,0x00,0x00, 8, // 0x59 'Y' 0x00,0x00,0x22,0x22,0x22,0x22,0x14,0x08,0x08,0x08,0x08,0x1c,0x00,0x00,0x00,0x00, 8, // 0x5a 'Z' 0x00,0x00,0x7e,0x42,0x02,0x04,0x08,0x10,0x20,0x40,0x42,0x7e,0x00,0x00,0x00,0x00, 8, // 0x5b '[' 0x00,0x1e,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x1e,0x00,0x00,0x00, 8, // 0x5c '\' 0x00,0x40,0x40,0x20,0x20,0x10,0x10,0x08,0x08,0x04,0x04,0x02,0x02,0x00,0x00,0x00, 8, // 0x5d ']' 0x00,0x3c,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x3c,0x00,0x00,0x00, 8, // 0x5e '^' 0x00,0x00,0x08,0x14,0x22,0x41,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 8, // 0x5f '_' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0x00, 8, // 0x60 '`' 0x00,0x00,0x08,0x08,0x08,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 8, // 0x61 'a' 0x00,0x00,0x00,0x00,0x00,0x38,0x44,0x04,0x3c,0x44,0x44,0x3e,0x00,0x00,0x00,0x00, 8, // 0x62 'b' 0x00,0x00,0x60,0x20,0x20,0x38,0x24,0x22,0x22,0x22,0x22,0x3c,0x00,0x00,0x00,0x00, 8, // 0x63 'c' 0x00,0x00,0x00,0x00,0x00,0x3c,0x42,0x40,0x40,0x40,0x42,0x3c,0x00,0x00,0x00,0x00, 8, // 0x64 'd' 0x00,0x00,0x0c,0x04,0x04,0x1c,0x24,0x44,0x44,0x44,0x44,0x3e,0x00,0x00,0x00,0x00, 8, // 0x65 'e' 0x00,0x00,0x00,0x00,0x00,0x3c,0x42,0x42,0x7e,0x40,0x42,0x3c,0x00,0x00,0x00,0x00, 8, // 0x66 'f' 0x00,0x00,0x0c,0x12,0x10,0x10,0x38,0x10,0x10,0x10,0x10,0x38,0x00,0x00,0x00,0x00, 8, // 0x67 'g' 0x00,0x00,0x00,0x00,0x00,0x3e,0x44,0x44,0x44,0x44,0x44,0x3c,0x04,0x44,0x38,0x00, 8, // 0x68 'h' 0x00,0x00,0x60,0x20,0x20,0x2c,0x32,0x22,0x22,0x22,0x22,0x62,0x00,0x00,0x00,0x00, 8, // 0x69 'i' 0x00,0x00,0x08,0x08,0x00,0x18,0x08,0x08,0x08,0x08,0x08,0x1c,0x00,0x00,0x00,0x00, 8, // 0x6a 'j' 0x00,0x00,0x04,0x04,0x00,0x0c,0x04,0x04,0x04,0x04,0x04,0x44,0x44,0x38,0x00,0x00, 8, // 0x6b 'k' 0x00,0x00,0x60,0x20,0x20,0x22,0x24,0x28,0x38,0x24,0x22,0x62,0x00,0x00,0x00,0x00, 8, // 0x6c 'l' 0x00,0x00,0x18,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x1c,0x00,0x00,0x00,0x00, 8, // 0x6d 'm' 0x00,0x00,0x00,0x00,0x00,0x76,0x49,0x49,0x49,0x49,0x41,0x41,0x00,0x00,0x00,0x00, 8, // 0x6e 'n' 0x00,0x00,0x00,0x00,0x00,0x5c,0x22,0x22,0x22,0x22,0x22,0x22,0x00,0x00,0x00,0x00, 8, // 0x6f 'o' 0x00,0x00,0x00,0x00,0x00,0x3c,0x42,0x42,0x42,0x42,0x42,0x3c,0x00,0x00,0x00,0x00, 8, // 0x70 'p' 0x00,0x00,0x00,0x00,0x00,0x7c,0x22,0x22,0x22,0x22,0x22,0x3c,0x20,0x20,0x70,0x00, 8, // 0x71 'q' 0x00,0x00,0x00,0x00,0x00,0x3e,0x44,0x44,0x44,0x44,0x44,0x3c,0x04,0x04,0x0e,0x00, 8, // 0x72 'r' 0x00,0x00,0x00,0x00,0x00,0x7c,0x22,0x22,0x20,0x20,0x20,0x70,0x00,0x00,0x00,0x00, 8, // 0x73 's' 0x00,0x00,0x00,0x00,0x00,0x3c,0x42,0x40,0x3c,0x02,0x42,0x3c,0x00,0x00,0x00,0x00, 8, // 0x74 't' 0x00,0x00,0x10,0x10,0x10,0x7c,0x10,0x10,0x10,0x10,0x12,0x0c,0x00,0x00,0x00,0x00, 8, // 0x75 'u' 0x00,0x00,0x00,0x00,0x00,0x44,0x44,0x44,0x44,0x44,0x44,0x3e,0x00,0x00,0x00,0x00, 8, // 0x76 'v' 0x00,0x00,0x00,0x00,0x00,0x41,0x41,0x41,0x41,0x22,0x14,0x08,0x00,0x00,0x00,0x00, 8, // 0x77 'w' 0x00,0x00,0x00,0x00,0x00,0x41,0x41,0x41,0x49,0x49,0x55,0x22,0x00,0x00,0x00,0x00, 8, // 0x78 'x' 0x00,0x00,0x00,0x00,0x00,0x42,0x42,0x24,0x18,0x24,0x42,0x42,0x00,0x00,0x00,0x00, 8, // 0x79 'y' 0x00,0x00,0x00,0x00,0x00,0x42,0x42,0x42,0x42,0x42,0x42,0x3e,0x02,0x04,0x78,0x00, 8, // 0x7a 'z' 0x00,0x00,0x00,0x00,0x00,0x7e,0x44,0x08,0x10,0x20,0x42,0x7e,0x00,0x00,0x00,0x00, 8, // 0x7b '{' 0x00,0x06,0x08,0x08,0x08,0x08,0x08,0x30,0x08,0x08,0x08,0x08,0x08,0x06,0x00,0x00, 8, // 0x7c '|' 0x00,0x00,0x08,0x08,0x08,0x08,0x08,0x00,0x08,0x08,0x08,0x08,0x08,0x00,0x00,0x00, 8, // 0x7d '}' 0x00,0x30,0x08,0x08,0x08,0x08,0x08,0x06,0x08,0x08,0x08,0x08,0x08,0x30,0x00,0x00, 8, // 0x7e '~' 0x00,0x00,0x39,0x4e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 8, // 0x7f '' 0x00,0x00,0x00,0x00,0x00,0x08,0x14,0x22,0x41,0x41,0x7f,0x00,0x00,0x00,0x00,0x00, 0 }; const int8u gse8x16_bold[] = { 16, 0, 32, 128-32, 0x00,0x00,0x11,0x00,0x22,0x00,0x33,0x00,0x44,0x00,0x55,0x00,0x66,0x00,0x77,0x00,0x88,0x00, 0x99,0x00,0xaa,0x00,0xbb,0x00,0xcc,0x00,0xdd,0x00,0xee,0x00,0xff,0x00,0x10,0x01,0x21,0x01, 0x32,0x01,0x43,0x01,0x54,0x01,0x65,0x01,0x76,0x01,0x87,0x01,0x98,0x01,0xa9,0x01,0xba,0x01, 0xcb,0x01,0xdc,0x01,0xed,0x01,0xfe,0x01,0x0f,0x02,0x20,0x02,0x31,0x02,0x42,0x02,0x53,0x02, 0x64,0x02,0x75,0x02,0x86,0x02,0x97,0x02,0xa8,0x02,0xb9,0x02,0xca,0x02,0xdb,0x02,0xec,0x02, 0xfd,0x02,0x0e,0x03,0x1f,0x03,0x30,0x03,0x41,0x03,0x52,0x03,0x63,0x03,0x74,0x03,0x85,0x03, 0x96,0x03,0xa7,0x03,0xb8,0x03,0xc9,0x03,0xda,0x03,0xeb,0x03,0xfc,0x03,0x0d,0x04,0x1e,0x04, 0x2f,0x04,0x40,0x04,0x51,0x04,0x62,0x04,0x73,0x04,0x84,0x04,0x95,0x04,0xa6,0x04,0xb7,0x04, 0xc8,0x04,0xd9,0x04,0xea,0x04,0xfb,0x04,0x0c,0x05,0x1d,0x05,0x2e,0x05,0x3f,0x05,0x50,0x05, 0x61,0x05,0x72,0x05,0x83,0x05,0x94,0x05,0xa5,0x05,0xb6,0x05,0xc7,0x05,0xd8,0x05,0xe9,0x05, 0xfa,0x05,0x0b,0x06,0x1c,0x06,0x2d,0x06,0x3e,0x06,0x4f,0x06, 8, // 0x20 ' ' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 8, // 0x21 '!' 0x00,0x00,0x18,0x3c,0x3c,0x3c,0x3c,0x18,0x18,0x00,0x18,0x18,0x00,0x00,0x00,0x00, 8, // 0x22 '"' 0x00,0x66,0x66,0x66,0x66,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 8, // 0x23 '#' 0x00,0x00,0x66,0x66,0x66,0xff,0x66,0x66,0xff,0x66,0x66,0x66,0x00,0x00,0x00,0x00, 8, // 0x24 '$' 0x00,0x08,0x08,0x3e,0x6b,0x6b,0x68,0x3e,0x0b,0x6b,0x6b,0x3e,0x08,0x08,0x00,0x00, 8, // 0x25 '%' 0x00,0x00,0x66,0xbe,0xcc,0x0c,0x18,0x18,0x30,0x33,0x65,0x66,0x00,0x00,0x00,0x00, 8, // 0x26 '&' 0x00,0x00,0x1c,0x36,0x36,0x36,0x1c,0x3b,0x6e,0x66,0x66,0x3b,0x00,0x00,0x00,0x00, 8, // 0x27 ''' 0x00,0x00,0x18,0x18,0x18,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 8, // 0x28 '(' 0x00,0x06,0x0c,0x18,0x18,0x30,0x30,0x30,0x30,0x18,0x18,0x0c,0x06,0x00,0x00,0x00, 8, // 0x29 ')' 0x00,0x30,0x18,0x0c,0x0c,0x06,0x06,0x06,0x06,0x0c,0x0c,0x18,0x30,0x00,0x00,0x00, 8, // 0x2a '*' 0x00,0x00,0x00,0x00,0x66,0x24,0x18,0xff,0x18,0x24,0x66,0x00,0x00,0x00,0x00,0x00, 8, // 0x2b '+' 0x00,0x00,0x00,0x00,0x18,0x18,0x18,0xff,0x18,0x18,0x18,0x00,0x00,0x00,0x00,0x00, 8, // 0x2c ',' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x18,0x30,0x20,0x00, 8, // 0x2d '-' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 8, // 0x2e '.' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00, 8, // 0x2f '/' 0x00,0x03,0x03,0x06,0x06,0x0c,0x0c,0x18,0x18,0x30,0x30,0x60,0x60,0x00,0x00,0x00, 8, // 0x30 '0' 0x00,0x00,0x3e,0x63,0x63,0x67,0x6b,0x73,0x63,0x63,0x63,0x3e,0x00,0x00,0x00,0x00, 8, // 0x31 '1' 0x00,0x00,0x0c,0x0c,0x1c,0x3c,0x0c,0x0c,0x0c,0x0c,0x0c,0x3f,0x00,0x00,0x00,0x00, 8, // 0x32 '2' 0x00,0x00,0x3e,0x63,0x63,0x03,0x06,0x0c,0x18,0x30,0x61,0x7f,0x00,0x00,0x00,0x00, 8, // 0x33 '3' 0x00,0x00,0x7f,0x43,0x06,0x0c,0x1e,0x03,0x03,0x03,0x63,0x3e,0x00,0x00,0x00,0x00, 8, // 0x34 '4' 0x00,0x00,0x06,0x0c,0x18,0x32,0x66,0x66,0x7f,0x06,0x06,0x0f,0x00,0x00,0x00,0x00, 8, // 0x35 '5' 0x00,0x00,0x7f,0x61,0x60,0x60,0x7e,0x03,0x03,0x03,0x63,0x3e,0x00,0x00,0x00,0x00, 8, // 0x36 '6' 0x00,0x00,0x1e,0x30,0x60,0x60,0x7e,0x63,0x63,0x63,0x63,0x3e,0x00,0x00,0x00,0x00, 8, // 0x37 '7' 0x00,0x00,0x7f,0x63,0x63,0x03,0x06,0x0c,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00, 8, // 0x38 '8' 0x00,0x00,0x3e,0x63,0x63,0x63,0x3e,0x63,0x63,0x63,0x63,0x3e,0x00,0x00,0x00,0x00, 8, // 0x39 '9' 0x00,0x00,0x3e,0x63,0x63,0x63,0x63,0x3f,0x03,0x03,0x06,0x3c,0x00,0x00,0x00,0x00, 8, // 0x3a ':' 0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00, 8, // 0x3b ';' 0x00,0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x00,0x00,0x30,0x30,0x30,0x60,0x40,0x00, 8, // 0x3c '<' 0x00,0x00,0x00,0x06,0x0c,0x18,0x30,0x60,0x30,0x18,0x0c,0x06,0x00,0x00,0x00,0x00, 8, // 0x3d '=' 0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0x00,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 8, // 0x3e '>' 0x00,0x00,0x00,0x30,0x18,0x0c,0x06,0x03,0x06,0x0c,0x18,0x30,0x00,0x00,0x00,0x00, 8, // 0x3f '?' 0x00,0x00,0x3e,0x63,0x63,0x63,0x06,0x0c,0x0c,0x00,0x0c,0x0c,0x00,0x00,0x00,0x00, 8, // 0x40 '@' 0x00,0x00,0x7c,0x86,0x03,0x73,0xdb,0xdb,0xdb,0xdb,0xdb,0x6e,0x00,0x00,0x00,0x00, 8, // 0x41 'A' 0x00,0x00,0x08,0x1c,0x36,0x63,0x63,0x63,0x7f,0x63,0x63,0x63,0x00,0x00,0x00,0x00, 8, // 0x42 'B' 0x00,0x00,0x7e,0x33,0x33,0x33,0x3e,0x33,0x33,0x33,0x33,0x7e,0x00,0x00,0x00,0x00, 8, // 0x43 'C' 0x00,0x00,0x1e,0x33,0x61,0x60,0x60,0x60,0x60,0x61,0x33,0x1e,0x00,0x00,0x00,0x00, 8, // 0x44 'D' 0x00,0x00,0x7c,0x36,0x33,0x33,0x33,0x33,0x33,0x33,0x36,0x7c,0x00,0x00,0x00,0x00, 8, // 0x45 'E' 0x00,0x00,0x7f,0x33,0x31,0x34,0x3c,0x34,0x30,0x31,0x33,0x7f,0x00,0x00,0x00,0x00, 8, // 0x46 'F' 0x00,0x00,0x7f,0x33,0x31,0x34,0x3c,0x34,0x30,0x30,0x30,0x78,0x00,0x00,0x00,0x00, 8, // 0x47 'G' 0x00,0x00,0x1f,0x33,0x61,0x60,0x60,0x6f,0x63,0x63,0x33,0x1e,0x00,0x00,0x00,0x00, 8, // 0x48 'H' 0x00,0x00,0x63,0x63,0x63,0x63,0x7f,0x63,0x63,0x63,0x63,0x63,0x00,0x00,0x00,0x00, 8, // 0x49 'I' 0x00,0x00,0x1e,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x1e,0x00,0x00,0x00,0x00, 8, // 0x4a 'J' 0x00,0x00,0x0f,0x06,0x06,0x06,0x06,0x06,0x06,0x66,0x66,0x3c,0x00,0x00,0x00,0x00, 8, // 0x4b 'K' 0x00,0x00,0x73,0x33,0x36,0x36,0x3c,0x36,0x36,0x33,0x33,0x73,0x00,0x00,0x00,0x00, 8, // 0x4c 'L' 0x00,0x00,0x78,0x30,0x30,0x30,0x30,0x30,0x30,0x31,0x33,0x7f,0x00,0x00,0x00,0x00, 8, // 0x4d 'M' 0x00,0x00,0x63,0x63,0x77,0x77,0x7f,0x6b,0x6b,0x63,0x63,0x63,0x00,0x00,0x00,0x00, 8, // 0x4e 'N' 0x00,0x00,0x63,0x63,0x73,0x7b,0x6f,0x67,0x63,0x63,0x63,0x63,0x00,0x00,0x00,0x00, 8, // 0x4f 'O' 0x00,0x00,0x1c,0x36,0x63,0x63,0x63,0x63,0x63,0x63,0x36,0x1c,0x00,0x00,0x00,0x00, 8, // 0x50 'P' 0x00,0x00,0x7e,0x33,0x33,0x33,0x33,0x3e,0x30,0x30,0x30,0x78,0x00,0x00,0x00,0x00, 8, // 0x51 'Q' 0x00,0x00,0x1c,0x36,0x63,0x63,0x63,0x63,0x63,0x6f,0x36,0x1e,0x03,0x00,0x00,0x00, 8, // 0x52 'R' 0x00,0x00,0x7e,0x33,0x33,0x33,0x33,0x3e,0x36,0x33,0x33,0x73,0x00,0x00,0x00,0x00, 8, // 0x53 'S' 0x00,0x00,0x3e,0x63,0x63,0x30,0x18,0x0c,0x06,0x63,0x63,0x3e,0x00,0x00,0x00,0x00, 8, // 0x54 'T' 0x00,0x00,0x3f,0x3f,0x2d,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x1e,0x00,0x00,0x00,0x00, 8, // 0x55 'U' 0x00,0x00,0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x3e,0x00,0x00,0x00,0x00, 8, // 0x56 'V' 0x00,0x00,0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x36,0x1c,0x08,0x00,0x00,0x00,0x00, 8, // 0x57 'W' 0x00,0x00,0x63,0x63,0x63,0x6b,0x6b,0x7f,0x77,0x77,0x63,0x63,0x00,0x00,0x00,0x00, 8, // 0x58 'X' 0x00,0x00,0x63,0x63,0x63,0x36,0x1c,0x1c,0x36,0x63,0x63,0x63,0x00,0x00,0x00,0x00, 8, // 0x59 'Y' 0x00,0x00,0x33,0x33,0x33,0x33,0x1e,0x0c,0x0c,0x0c,0x0c,0x1e,0x00,0x00,0x00,0x00, 8, // 0x5a 'Z' 0x00,0x00,0x7f,0x63,0x43,0x06,0x0c,0x18,0x30,0x61,0x63,0x7f,0x00,0x00,0x00,0x00, 8, // 0x5b '[' 0x00,0x1f,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1f,0x00,0x00,0x00, 8, // 0x5c '\' 0x00,0x60,0x60,0x30,0x30,0x18,0x18,0x0c,0x0c,0x06,0x06,0x03,0x03,0x00,0x00,0x00, 8, // 0x5d ']' 0x00,0x7c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x7c,0x00,0x00,0x00, 8, // 0x5e '^' 0x00,0x00,0x08,0x1c,0x36,0x63,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 8, // 0x5f '_' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0x00, 8, // 0x60 '`' 0x00,0x00,0x18,0x18,0x18,0x0c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 8, // 0x61 'a' 0x00,0x00,0x00,0x00,0x00,0x3c,0x66,0x06,0x3e,0x66,0x66,0x3b,0x00,0x00,0x00,0x00, 8, // 0x62 'b' 0x00,0x00,0x70,0x30,0x30,0x3c,0x36,0x33,0x33,0x33,0x33,0x3e,0x00,0x00,0x00,0x00, 8, // 0x63 'c' 0x00,0x00,0x00,0x00,0x00,0x3e,0x63,0x63,0x60,0x60,0x63,0x3e,0x00,0x00,0x00,0x00, 8, // 0x64 'd' 0x00,0x00,0x0e,0x06,0x06,0x1e,0x36,0x66,0x66,0x66,0x66,0x3b,0x00,0x00,0x00,0x00, 8, // 0x65 'e' 0x00,0x00,0x00,0x00,0x00,0x3e,0x63,0x63,0x7f,0x60,0x63,0x3e,0x00,0x00,0x00,0x00, 8, // 0x66 'f' 0x00,0x00,0x0e,0x1b,0x1b,0x18,0x3c,0x18,0x18,0x18,0x18,0x3c,0x00,0x00,0x00,0x00, 8, // 0x67 'g' 0x00,0x00,0x00,0x00,0x00,0x3b,0x66,0x66,0x66,0x66,0x66,0x3e,0x06,0x66,0x3c,0x00, 8, // 0x68 'h' 0x00,0x00,0x70,0x30,0x30,0x36,0x3b,0x33,0x33,0x33,0x33,0x73,0x00,0x00,0x00,0x00, 8, // 0x69 'i' 0x00,0x00,0x0c,0x0c,0x00,0x1c,0x0c,0x0c,0x0c,0x0c,0x0c,0x1e,0x00,0x00,0x00,0x00, 8, // 0x6a 'j' 0x00,0x00,0x06,0x06,0x00,0x0e,0x06,0x06,0x06,0x06,0x06,0x66,0x66,0x3c,0x00,0x00, 8, // 0x6b 'k' 0x00,0x00,0x70,0x30,0x30,0x33,0x33,0x36,0x3c,0x36,0x33,0x73,0x00,0x00,0x00,0x00, 8, // 0x6c 'l' 0x00,0x00,0x1c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x1e,0x00,0x00,0x00,0x00, 8, // 0x6d 'm' 0x00,0x00,0x00,0x00,0x00,0x76,0x7f,0x6b,0x6b,0x6b,0x63,0x63,0x00,0x00,0x00,0x00, 8, // 0x6e 'n' 0x00,0x00,0x00,0x00,0x00,0x6e,0x33,0x33,0x33,0x33,0x33,0x33,0x00,0x00,0x00,0x00, 8, // 0x6f 'o' 0x00,0x00,0x00,0x00,0x00,0x3e,0x63,0x63,0x63,0x63,0x63,0x3e,0x00,0x00,0x00,0x00, 8, // 0x70 'p' 0x00,0x00,0x00,0x00,0x00,0x6e,0x33,0x33,0x33,0x33,0x33,0x3e,0x30,0x30,0x78,0x00, 8, // 0x71 'q' 0x00,0x00,0x00,0x00,0x00,0x3b,0x66,0x66,0x66,0x66,0x66,0x3e,0x06,0x06,0x0f,0x00, 8, // 0x72 'r' 0x00,0x00,0x00,0x00,0x00,0x6e,0x3b,0x33,0x30,0x30,0x30,0x78,0x00,0x00,0x00,0x00, 8, // 0x73 's' 0x00,0x00,0x00,0x00,0x00,0x3e,0x63,0x60,0x3e,0x03,0x63,0x3e,0x00,0x00,0x00,0x00, 8, // 0x74 't' 0x00,0x00,0x08,0x18,0x18,0x7e,0x18,0x18,0x18,0x18,0x1b,0x0e,0x00,0x00,0x00,0x00, 8, // 0x75 'u' 0x00,0x00,0x00,0x00,0x00,0x66,0x66,0x66,0x66,0x66,0x66,0x3b,0x00,0x00,0x00,0x00, 8, // 0x76 'v' 0x00,0x00,0x00,0x00,0x00,0x63,0x63,0x63,0x63,0x36,0x1c,0x08,0x00,0x00,0x00,0x00, 8, // 0x77 'w' 0x00,0x00,0x00,0x00,0x00,0x63,0x63,0x6b,0x6b,0x7f,0x36,0x36,0x00,0x00,0x00,0x00, 8, // 0x78 'x' 0x00,0x00,0x00,0x00,0x00,0x63,0x63,0x36,0x1c,0x36,0x63,0x63,0x00,0x00,0x00,0x00, 8, // 0x79 'y' 0x00,0x00,0x00,0x00,0x00,0x63,0x63,0x63,0x63,0x63,0x63,0x3f,0x03,0x06,0x7c,0x00, 8, // 0x7a 'z' 0x00,0x00,0x00,0x00,0x00,0x7f,0x63,0x06,0x0c,0x18,0x31,0x7f,0x00,0x00,0x00,0x00, 8, // 0x7b '{' 0x00,0x03,0x04,0x0c,0x0c,0x0c,0x08,0x30,0x08,0x0c,0x0c,0x0c,0x04,0x03,0x00,0x00, 8, // 0x7c '|' 0x00,0x00,0x0c,0x0c,0x0c,0x0c,0x0c,0x00,0x0c,0x0c,0x0c,0x0c,0x0c,0x00,0x00,0x00, 8, // 0x7d '}' 0x00,0x60,0x10,0x18,0x18,0x18,0x08,0x06,0x08,0x18,0x18,0x18,0x10,0x60,0x00,0x00, 8, // 0x7e '~' 0x00,0x00,0x3b,0x6e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 8, // 0x7f '' 0x00,0x00,0x00,0x00,0x00,0x08,0x1c,0x36,0x63,0x63,0x7f,0x00,0x00,0x00,0x00,0x00, 0 }; 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, 0x6C,0x00,0x78,0x00,0x84,0x00,0x90,0x00,0x9C,0x00,0xA8,0x00,0xB4,0x00,0xC0,0x00,0xCC,0x00, 0xD8,0x00,0xE4,0x00,0xF0,0x00,0xFC,0x00,0x08,0x01,0x14,0x01,0x20,0x01,0x2C,0x01,0x38,0x01, 0x44,0x01,0x50,0x01,0x5C,0x01,0x68,0x01,0x74,0x01,0x80,0x01,0x8C,0x01,0x98,0x01,0xA4,0x01, 0xB0,0x01,0xBC,0x01,0xC8,0x01,0xD4,0x01,0xE0,0x01,0xEC,0x01,0xF8,0x01,0x04,0x02,0x10,0x02, 0x1C,0x02,0x28,0x02,0x34,0x02,0x40,0x02,0x4C,0x02,0x58,0x02,0x64,0x02,0x70,0x02,0x7C,0x02, 0x88,0x02,0x94,0x02,0xA0,0x02,0xAC,0x02,0xB8,0x02,0xC4,0x02,0xD0,0x02,0xDC,0x02,0xE8,0x02, 0xF4,0x02,0x00,0x03,0x0C,0x03,0x18,0x03,0x24,0x03,0x30,0x03,0x3C,0x03,0x48,0x03,0x54,0x03, 0x60,0x03,0x6C,0x03,0x78,0x03,0x84,0x03,0x90,0x03,0x9C,0x03,0xA8,0x03,0xB4,0x03,0xC0,0x03, 0xCC,0x03,0xD8,0x03,0xE4,0x03,0xF0,0x03,0xFC,0x03,0x08,0x04,0x14,0x04,0x20,0x04,0x2C,0x04, 0x38,0x04,0x44,0x04,0x50,0x04,0x5C,0x04,0x68,0x04,0x74,0x04, 5, // 0x20 ' ' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 4, // 0x21 '!' 0x00,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x00,0x20,0x00, 4, // 0x22 '"' 0x50,0x50,0xA0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 6, // 0x23 '#' 0x00,0x28,0x28,0x7C,0x28,0x28,0x28,0x7C,0x28,0x28,0x00, 6, // 0x24 '$' 0x10,0x10,0x38,0x54,0x50,0x38,0x14,0x54,0x38,0x10,0x10, 6, // 0x25 '%' 0x00,0x00,0x68,0xA8,0xD0,0x10,0x20,0x2C,0x54,0x58,0x00, 6, // 0x26 '&' 0x00,0x20,0x50,0x50,0x50,0x20,0x54,0x54,0x48,0x34,0x00, 3, // 0x27 ''' 0x40,0x40,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 4, // 0x28 '(' 0x10,0x20,0x20,0x40,0x40,0x40,0x40,0x40,0x20,0x20,0x10, 5, // 0x29 ')' 0x40,0x20,0x20,0x10,0x10,0x10,0x10,0x10,0x20,0x20,0x40, 6, // 0x2A '*' 0x00,0x00,0x28,0x7C,0x38,0x7C,0x28,0x00,0x00,0x00,0x00, 6, // 0x2B '+' 0x00,0x00,0x00,0x10,0x10,0x7C,0x10,0x10,0x00,0x00,0x00, 4, // 0x2C ',' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x60,0xC0, 6, // 0x2D '-' 0x00,0x00,0x00,0x00,0x00,0x7C,0x00,0x00,0x00,0x00,0x00, 4, // 0x2E '.' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x60,0x00, 7, // 0x2F '/' 0x00,0x04,0x04,0x08,0x08,0x10,0x10,0x20,0x20,0x40,0x40, 6, // 0x30 '0' 0x00,0x38,0x44,0x44,0x54,0x54,0x54,0x44,0x44,0x38,0x00, 4, // 0x31 '1' 0x00,0x20,0x60,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x00, 6, // 0x32 '2' 0x00,0x38,0x44,0x44,0x04,0x08,0x10,0x20,0x40,0x7C,0x00, 6, // 0x33 '3' 0x00,0x38,0x44,0x04,0x04,0x38,0x04,0x04,0x44,0x38,0x00, 6, // 0x34 '4' 0x00,0x08,0x18,0x18,0x28,0x28,0x48,0x7C,0x08,0x08,0x00, 6, // 0x35 '5' 0x00,0x7C,0x40,0x40,0x78,0x44,0x04,0x04,0x44,0x38,0x00, 6, // 0x36 '6' 0x00,0x38,0x44,0x40,0x40,0x78,0x44,0x44,0x44,0x38,0x00, 6, // 0x37 '7' 0x00,0x7C,0x04,0x08,0x08,0x10,0x10,0x20,0x20,0x20,0x00, 6, // 0x38 '8' 0x00,0x38,0x44,0x44,0x44,0x38,0x44,0x44,0x44,0x38,0x00, 6, // 0x39 '9' 0x00,0x38,0x44,0x44,0x44,0x3C,0x04,0x04,0x44,0x38,0x00, 4, // 0x3A ':' 0x00,0x00,0x00,0x60,0x60,0x00,0x00,0x00,0x60,0x60,0x00, 4, // 0x3B ';' 0x00,0x00,0x00,0x60,0x60,0x00,0x00,0x00,0x60,0x60,0xC0, 6, // 0x3C '<' 0x00,0x04,0x08,0x10,0x20,0x40,0x20,0x10,0x08,0x04,0x00, 6, // 0x3D '=' 0x00,0x00,0x00,0x00,0x7C,0x00,0x00,0x7C,0x00,0x00,0x00, 6, // 0x3E '>' 0x00,0x40,0x20,0x10,0x08,0x04,0x08,0x10,0x20,0x40,0x00, 6, // 0x3F '?' 0x00,0x38,0x44,0x04,0x04,0x08,0x10,0x10,0x00,0x10,0x00, 6, // 0x40 '@' 0x00,0x38,0x44,0x44,0x5C,0x54,0x54,0x4C,0x40,0x38,0x00, 6, // 0x41 'A' 0x00,0x38,0x44,0x44,0x44,0x44,0x7C,0x44,0x44,0x44,0x00, 6, // 0x42 'B' 0x00,0x78,0x44,0x44,0x44,0x78,0x44,0x44,0x44,0x78,0x00, 6, // 0x43 'C' 0x00,0x38,0x44,0x40,0x40,0x40,0x40,0x40,0x44,0x38,0x00, 6, // 0x44 'D' 0x00,0x70,0x48,0x44,0x44,0x44,0x44,0x44,0x48,0x70,0x00, 6, // 0x45 'E' 0x00,0x7C,0x40,0x40,0x40,0x78,0x40,0x40,0x40,0x7C,0x00, 6, // 0x46 'F' 0x00,0x7C,0x40,0x40,0x40,0x78,0x40,0x40,0x40,0x40,0x00, 6, // 0x47 'G' 0x00,0x38,0x44,0x40,0x40,0x5C,0x44,0x44,0x4C,0x34,0x00, 6, // 0x48 'H' 0x00,0x44,0x44,0x44,0x44,0x7C,0x44,0x44,0x44,0x44,0x00, 4, // 0x49 'I' 0x00,0x70,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x70,0x00, 6, // 0x4A 'J' 0x00,0x1C,0x08,0x08,0x08,0x08,0x08,0x08,0x48,0x30,0x00, 6, // 0x4B 'K' 0x00,0x44,0x48,0x50,0x60,0x60,0x50,0x48,0x44,0x44,0x00, 6, // 0x4C 'L' 0x00,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x7C,0x00, 8, // 0x4D 'M' 0x00,0x41,0x63,0x55,0x49,0x49,0x41,0x41,0x41,0x41,0x00, 7, // 0x4E 'N' 0x00,0x42,0x42,0x62,0x52,0x4A,0x46,0x42,0x42,0x42,0x00, 6, // 0x4F 'O' 0x00,0x38,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x38,0x00, 6, // 0x50 'P' 0x00,0x78,0x44,0x44,0x44,0x78,0x40,0x40,0x40,0x40,0x00, 6, // 0x51 'Q' 0x00,0x38,0x44,0x44,0x44,0x44,0x44,0x54,0x48,0x34,0x00, 6, // 0x52 'R' 0x00,0x78,0x44,0x44,0x44,0x78,0x44,0x44,0x44,0x44,0x00, 6, // 0x53 'S' 0x00,0x38,0x44,0x40,0x40,0x38,0x04,0x04,0x44,0x38,0x00, 6, // 0x54 'T' 0x00,0x7C,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x00, 6, // 0x55 'U' 0x00,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x38,0x00, 6, // 0x56 'V' 0x00,0x44,0x44,0x44,0x44,0x28,0x28,0x28,0x10,0x10,0x00, 8, // 0x57 'W' 0x00,0x41,0x41,0x41,0x41,0x49,0x49,0x49,0x55,0x22,0x00, 6, // 0x58 'X' 0x00,0x44,0x44,0x44,0x28,0x10,0x28,0x44,0x44,0x44,0x00, 6, // 0x59 'Y' 0x00,0x44,0x44,0x44,0x28,0x10,0x10,0x10,0x10,0x10,0x00, 6, // 0x5A 'Z' 0x00,0x7C,0x04,0x04,0x08,0x10,0x20,0x40,0x40,0x7C,0x00, 5, // 0x5B '[' 0x30,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x30, 7, // 0x5C '\' 0x40,0x40,0x20,0x20,0x10,0x10,0x08,0x08,0x04,0x04,0x00, 4, // 0x5D ']' 0x60,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x60, 6, // 0x5E '^' 0x00,0x10,0x28,0x44,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 6, // 0x5F '_' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x00, 4, // 0x60 '`' 0x00,0x40,0x40,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 6, // 0x61 'a' 0x00,0x00,0x00,0x38,0x04,0x3C,0x44,0x44,0x44,0x3C,0x00, 6, // 0x62 'b' 0x00,0x40,0x40,0x78,0x44,0x44,0x44,0x44,0x44,0x78,0x00, 6, // 0x63 'c' 0x00,0x00,0x00,0x38,0x44,0x40,0x40,0x40,0x44,0x38,0x00, 6, // 0x64 'd' 0x00,0x04,0x04,0x3C,0x44,0x44,0x44,0x44,0x44,0x3C,0x00, 6, // 0x65 'e' 0x00,0x00,0x00,0x38,0x44,0x44,0x7C,0x40,0x44,0x38,0x00, 4, // 0x66 'f' 0x00,0x10,0x20,0x70,0x20,0x20,0x20,0x20,0x20,0x20,0x00, 6, // 0x67 'g' 0x00,0x00,0x00,0x3C,0x44,0x44,0x44,0x3C,0x04,0x44,0x38, 6, // 0x68 'h' 0x00,0x40,0x40,0x78,0x44,0x44,0x44,0x44,0x44,0x44,0x00, 2, // 0x69 'i' 0x00,0x40,0x00,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x00, 3, // 0x6A 'j' 0x00,0x20,0x00,0x20,0x20,0x20,0x20,0x20,0x20,0xA0,0x40, 5, // 0x6B 'k' 0x00,0x40,0x40,0x48,0x50,0x60,0x60,0x50,0x48,0x48,0x00, 2, // 0x6C 'l' 0x00,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x00, 8, // 0x6D 'm' 0x00,0x00,0x00,0x76,0x49,0x49,0x49,0x49,0x41,0x41,0x00, 6, // 0x6E 'n' 0x00,0x00,0x00,0x78,0x44,0x44,0x44,0x44,0x44,0x44,0x00, 6, // 0x6F 'o' 0x00,0x00,0x00,0x38,0x44,0x44,0x44,0x44,0x44,0x38,0x00, 6, // 0x70 'p' 0x00,0x00,0x00,0x78,0x44,0x44,0x44,0x44,0x78,0x40,0x40, 6, // 0x71 'q' 0x00,0x00,0x00,0x3C,0x44,0x44,0x44,0x44,0x3C,0x04,0x04, 6, // 0x72 'r' 0x00,0x00,0x00,0x58,0x24,0x20,0x20,0x20,0x20,0x20,0x00, 6, // 0x73 's' 0x00,0x00,0x00,0x38,0x44,0x40,0x38,0x04,0x44,0x38,0x00, 5, // 0x74 't' 0x00,0x20,0x20,0x70,0x20,0x20,0x20,0x20,0x28,0x10,0x00, 6, // 0x75 'u' 0x00,0x00,0x00,0x44,0x44,0x44,0x44,0x44,0x4C,0x34,0x00, 6, // 0x76 'v' 0x00,0x00,0x00,0x44,0x44,0x44,0x28,0x28,0x10,0x10,0x00, 8, // 0x77 'w' 0x00,0x00,0x00,0x41,0x41,0x41,0x41,0x49,0x49,0x36,0x00, 6, // 0x78 'x' 0x00,0x00,0x00,0x44,0x44,0x28,0x10,0x28,0x44,0x44,0x00, 6, // 0x79 'y' 0x00,0x00,0x00,0x44,0x44,0x44,0x44,0x3C,0x04,0x08,0x70, 6, // 0x7A 'z' 0x00,0x00,0x00,0x7C,0x04,0x08,0x10,0x20,0x40,0x7C,0x00, 5, // 0x7B '{' 0x18,0x20,0x20,0x20,0x20,0xC0,0x20,0x20,0x20,0x20,0x18, 3, // 0x7C '|' 0x00,0x40,0x40,0x40,0x40,0x00,0x40,0x40,0x40,0x40,0x00, 5, // 0x7D '}' 0xC0,0x20,0x20,0x20,0x20,0x18,0x20,0x20,0x20,0x20,0xC0, 6, // 0x7E '~' 0x00,0x24,0x54,0x48,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 6, // 0x7F '' 0x00,0x10,0x38,0x6C,0x44,0x44,0x7C,0x00,0x00,0x00,0x00, 0 }; 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, 0x6C,0x00,0x78,0x00,0x84,0x00,0x90,0x00,0x9C,0x00,0xA8,0x00,0xB4,0x00,0xC0,0x00,0xCC,0x00, 0xD8,0x00,0xE4,0x00,0xF0,0x00,0xFC,0x00,0x08,0x01,0x14,0x01,0x20,0x01,0x2C,0x01,0x38,0x01, 0x44,0x01,0x50,0x01,0x5C,0x01,0x68,0x01,0x74,0x01,0x80,0x01,0x8C,0x01,0x98,0x01,0xA4,0x01, 0xB0,0x01,0xBC,0x01,0xC8,0x01,0xD4,0x01,0xE0,0x01,0xEC,0x01,0xF8,0x01,0x04,0x02,0x10,0x02, 0x1C,0x02,0x28,0x02,0x34,0x02,0x40,0x02,0x4C,0x02,0x58,0x02,0x64,0x02,0x70,0x02,0x7C,0x02, 0x88,0x02,0x94,0x02,0xA0,0x02,0xAC,0x02,0xB8,0x02,0xC4,0x02,0xD0,0x02,0xDC,0x02,0xE8,0x02, 0xF4,0x02,0x00,0x03,0x0C,0x03,0x18,0x03,0x24,0x03,0x30,0x03,0x3C,0x03,0x48,0x03,0x54,0x03, 0x60,0x03,0x6C,0x03,0x78,0x03,0x84,0x03,0x90,0x03,0x9C,0x03,0xA8,0x03,0xB4,0x03,0xC0,0x03, 0xCC,0x03,0xD8,0x03,0xE4,0x03,0xF0,0x03,0xFC,0x03,0x08,0x04,0x14,0x04,0x20,0x04,0x2C,0x04, 0x38,0x04,0x44,0x04,0x50,0x04,0x5C,0x04,0x68,0x04,0x74,0x04, 3, // 0x20 ' ' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 3, // 0x21 '!' 0x00,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x00,0x40,0x00, 4, // 0x22 '"' 0x50,0x50,0xA0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 5, // 0x23 '#' 0x00,0x50,0x50,0xF8,0x50,0x50,0x50,0xF8,0x50,0x50,0x00, 5, // 0x24 '$' 0x00,0x40,0x60,0x90,0x80,0x60,0x10,0x90,0x60,0x20,0x00, 5, // 0x25 '%' 0x00,0x00,0x90,0x90,0x20,0x20,0x40,0x40,0x90,0x90,0x00, 5, // 0x26 '&' 0x00,0x40,0xA0,0xA0,0xA0,0x40,0xA8,0x90,0x90,0x68,0x00, 5, // 0x27 ''' 0x00,0x00,0x20,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 5, // 0x28 '(' 0x10,0x20,0x20,0x40,0x40,0x40,0x40,0x40,0x20,0x20,0x10, 4, // 0x29 ')' 0x80,0x40,0x40,0x20,0x20,0x20,0x20,0x20,0x40,0x40,0x80, 5, // 0x2A '*' 0x00,0x00,0x90,0x60,0xF0,0x60,0x90,0x00,0x00,0x00,0x00, 5, // 0x2B '+' 0x00,0x00,0x00,0x20,0x20,0xF8,0x20,0x20,0x00,0x00,0x00, 4, // 0x2C ',' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x60,0xC0, 5, // 0x2D '-' 0x00,0x00,0x00,0x00,0x00,0xF0,0x00,0x00,0x00,0x00,0x00, 4, // 0x2E '.' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xC0,0x00, 6, // 0x2F '/' 0x08,0x08,0x10,0x10,0x20,0x20,0x40,0x40,0x80,0x80,0x00, 5, // 0x30 '0' 0x00,0x70,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0xE0,0x00, 3, // 0x31 '1' 0x00,0x40,0xC0,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x00, 5, // 0x32 '2' 0x00,0x60,0x90,0x90,0x10,0x10,0x20,0x40,0x80,0xF0,0x00, 5, // 0x33 '3' 0x00,0x60,0x90,0x10,0x10,0x60,0x10,0x10,0x90,0x60,0x00, 5, // 0x34 '4' 0x00,0x10,0x30,0x30,0x50,0x50,0x90,0xF0,0x10,0x10,0x00, 5, // 0x35 '5' 0x00,0xF0,0x80,0x80,0xE0,0x90,0x10,0x10,0x90,0x60,0x00, 5, // 0x36 '6' 0x00,0x60,0x90,0x80,0x80,0xE0,0x90,0x90,0x90,0x60,0x00, 5, // 0x37 '7' 0x00,0xF0,0x10,0x10,0x10,0x20,0x20,0x40,0x40,0x40,0x00, 5, // 0x38 '8' 0x00,0x60,0x90,0x90,0x90,0x60,0x90,0x90,0x90,0x60,0x00, 5, // 0x39 '9' 0x00,0x60,0x90,0x90,0x90,0x70,0x10,0x10,0x90,0x60,0x00, 4, // 0x3A ':' 0x00,0x00,0x00,0x60,0x60,0x00,0x00,0x00,0x60,0x60,0x00, 4, // 0x3B ';' 0x00,0x00,0x00,0x60,0x60,0x00,0x00,0x00,0x60,0x60,0xC0, 6, // 0x3C '<' 0x00,0x08,0x10,0x20,0x40,0x80,0x40,0x20,0x10,0x08,0x00, 5, // 0x3D '=' 0x00,0x00,0x00,0x00,0xF0,0x00,0x00,0xF0,0x00,0x00,0x00, 6, // 0x3E '>' 0x00,0x80,0x40,0x20,0x10,0x08,0x10,0x20,0x40,0x80,0x00, 5, // 0x3F '?' 0x00,0x60,0x90,0x10,0x10,0x20,0x40,0x00,0x40,0x00,0x00, 5, // 0x40 '@' 0x00,0x60,0x90,0x90,0xB0,0xB0,0xB0,0x80,0x80,0x70,0x00, 5, // 0x41 'A' 0x00,0x60,0x90,0x90,0x90,0xF0,0x90,0x90,0x90,0x90,0x00, 5, // 0x42 'B' 0x00,0xE0,0x90,0x90,0x90,0xE0,0x90,0x90,0x90,0xE0,0x00, 5, // 0x43 'C' 0x00,0x60,0x90,0x80,0x80,0x80,0x80,0x80,0x90,0x60,0x00, 5, // 0x44 'D' 0x00,0xE0,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0xE0,0x00, 5, // 0x45 'E' 0x00,0xF0,0x80,0x80,0x80,0xF0,0x80,0x80,0x80,0xF0,0x00, 5, // 0x46 'F' 0x00,0xF0,0x80,0x80,0x80,0xF0,0x80,0x80,0x80,0x80,0x00, 5, // 0x47 'G' 0x00,0x70,0x80,0x80,0x80,0xB0,0x90,0x90,0x90,0x60,0x00, 5, // 0x48 'H' 0x00,0x90,0x90,0x90,0x90,0xF0,0x90,0x90,0x90,0x90,0x00, 4, // 0x49 'I' 0x00,0xE0,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0xE0,0x00, 5, // 0x4A 'J' 0x00,0x70,0x20,0x20,0x20,0x20,0x20,0xA0,0xA0,0x40,0x00, 5, // 0x4B 'K' 0x00,0x90,0x90,0xA0,0xA0,0xC0,0xA0,0xA0,0x90,0x90,0x00, 5, // 0x4C 'L' 0x00,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0xF0,0x00, 6, // 0x4D 'M' 0x00,0x88,0xD8,0xA8,0xA8,0xA8,0x88,0x88,0x88,0x88,0x00, 5, // 0x4E 'N' 0x00,0x90,0x90,0xD0,0xD0,0xB0,0xB0,0x90,0x90,0x90,0x00, 5, // 0x4F 'O' 0x00,0x60,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x60,0x00, 5, // 0x50 'P' 0x00,0xE0,0x90,0x90,0x90,0x90,0xE0,0x80,0x80,0x80,0x00, 5, // 0x51 'Q' 0x00,0x60,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x60,0x30, 5, // 0x52 'R' 0x00,0xE0,0x90,0x90,0x90,0x90,0xE0,0xA0,0x90,0x90,0x00, 5, // 0x53 'S' 0x00,0x60,0x90,0x80,0x80,0x60,0x10,0x10,0x90,0x60,0x00, 6, // 0x54 'T' 0x00,0xF8,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x00, 5, // 0x55 'U' 0x00,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x60,0x00, 6, // 0x56 'V' 0x00,0x88,0x88,0x88,0x88,0x50,0x50,0x50,0x20,0x20,0x00, 6, // 0x57 'W' 0x00,0x88,0x88,0x88,0xA8,0xA8,0xA8,0xA8,0xA8,0x50,0x00, 5, // 0x58 'X' 0x00,0x90,0x90,0x90,0x60,0x60,0x90,0x90,0x90,0x90,0x00, 6, // 0x59 'Y' 0x00,0x88,0x88,0x88,0x50,0x20,0x20,0x20,0x20,0x20,0x00, 5, // 0x5A 'Z' 0x00,0xF0,0x10,0x20,0x20,0x40,0x40,0x80,0x80,0xF0,0x00, 4, // 0x5B '[' 0x60,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x60,0x00, 6, // 0x5C '\' 0x80,0x80,0x40,0x40,0x20,0x20,0x10,0x10,0x08,0x08,0x00, 4, // 0x5D ']' 0x60,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x60,0x00, 5, // 0x5E '^' 0x00,0x20,0x50,0x88,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 5, // 0x5F '_' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF0,0x00, 5, // 0x60 '`' 0x00,0x40,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 5, // 0x61 'a' 0x00,0x00,0x00,0x60,0x90,0x10,0x70,0x90,0x90,0x70,0x00, 5, // 0x62 'b' 0x00,0x80,0x80,0x80,0xE0,0x90,0x90,0x90,0x90,0xE0,0x00, 5, // 0x63 'c' 0x00,0x00,0x00,0x60,0x90,0x80,0x80,0x80,0x90,0x60,0x00, 5, // 0x64 'd' 0x00,0x10,0x10,0x10,0x70,0x90,0x90,0x90,0x90,0x70,0x00, 5, // 0x65 'e' 0x00,0x00,0x00,0x60,0x90,0x90,0xF0,0x80,0x90,0x60,0x00, 4, // 0x66 'f' 0x00,0x20,0x40,0x40,0xE0,0x40,0x40,0x40,0x40,0x40,0x00, 5, // 0x67 'g' 0x00,0x00,0x00,0x70,0x90,0x90,0x90,0x70,0x10,0x90,0x60, 5, // 0x68 'h' 0x00,0x80,0x80,0x80,0xE0,0x90,0x90,0x90,0x90,0x90,0x00, 2, // 0x69 'i' 0x00,0x80,0x00,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x00, 4, // 0x6A 'j' 0x00,0x20,0x00,0x20,0x20,0x20,0x20,0x20,0x20,0xA0,0x40, 5, // 0x6B 'k' 0x00,0x80,0x80,0x90,0x90,0xA0,0xC0,0xA0,0x90,0x90,0x00, 2, // 0x6C 'l' 0x00,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x00, 6, // 0x6D 'm' 0x00,0x00,0x00,0xD0,0xA8,0xA8,0xA8,0x88,0x88,0x88,0x00, 5, // 0x6E 'n' 0x00,0x00,0x00,0xA0,0xD0,0x90,0x90,0x90,0x90,0x90,0x00, 5, // 0x6F 'o' 0x00,0x00,0x00,0x60,0x90,0x90,0x90,0x90,0x90,0x60,0x00, 5, // 0x70 'p' 0x00,0x00,0x00,0xE0,0x90,0x90,0x90,0x90,0xE0,0x80,0x80, 5, // 0x71 'q' 0x00,0x00,0x00,0x70,0x90,0x90,0x90,0x90,0x70,0x10,0x10, 6, // 0x72 'r' 0x00,0x00,0x00,0xB8,0x48,0x40,0x40,0x40,0x40,0x40,0x00, 5, // 0x73 's' 0x00,0x00,0x00,0x60,0x90,0x40,0x20,0x10,0x90,0x60,0x00, 4, // 0x74 't' 0x00,0x40,0x40,0xE0,0x40,0x40,0x40,0x40,0x40,0x20,0x00, 5, // 0x75 'u' 0x00,0x00,0x00,0x90,0x90,0x90,0x90,0x90,0x90,0x70,0x00, 6, // 0x76 'v' 0x00,0x00,0x00,0x88,0x88,0x88,0x50,0x50,0x20,0x20,0x00, 6, // 0x77 'w' 0x00,0x00,0x00,0x88,0x88,0x88,0xA8,0xA8,0xA8,0x50,0x00, 5, // 0x78 'x' 0x00,0x00,0x00,0x90,0x90,0x60,0x60,0x90,0x90,0x90,0x00, 5, // 0x79 'y' 0x00,0x00,0x00,0x90,0x90,0x90,0x90,0x70,0x10,0x20,0xC0, 5, // 0x7A 'z' 0x00,0x00,0x00,0xF0,0x10,0x20,0x40,0x80,0x80,0xF0,0x00, 5, // 0x7B '{' 0x30,0x40,0x40,0x40,0x40,0x80,0x40,0x40,0x40,0x40,0x30, 3, // 0x7C '|' 0x00,0x40,0x40,0x40,0x40,0x00,0x40,0x40,0x40,0x40,0x00, 5, // 0x7D '}' 0xC0,0x20,0x20,0x20,0x20,0x10,0x20,0x20,0x20,0x20,0xC0, 5, // 0x7E '~' 0x00,0x40,0xA8,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 5, // 0x7F '' 0x00,0x20,0x70,0xD8,0x88,0x88,0xF8,0x00,0x00,0x00,0x00, 0 }; 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, 0x75,0x00,0x82,0x00,0x8F,0x00,0x9C,0x00,0xA9,0x00,0xB6,0x00,0xC3,0x00,0xD0,0x00,0xDD,0x00, 0xEA,0x00,0xF7,0x00,0x04,0x01,0x11,0x01,0x1E,0x01,0x2B,0x01,0x38,0x01,0x45,0x01,0x52,0x01, 0x5F,0x01,0x6C,0x01,0x79,0x01,0x86,0x01,0x93,0x01,0xA0,0x01,0xAD,0x01,0xBA,0x01,0xC7,0x01, 0xD4,0x01,0xE1,0x01,0xEE,0x01,0xFB,0x01,0x08,0x02,0x15,0x02,0x22,0x02,0x2F,0x02,0x3C,0x02, 0x49,0x02,0x62,0x02,0x6F,0x02,0x7C,0x02,0x89,0x02,0x96,0x02,0xA3,0x02,0xB0,0x02,0xBD,0x02, 0xCA,0x02,0xD7,0x02,0xF0,0x02,0xFD,0x02,0x0A,0x03,0x17,0x03,0x24,0x03,0x31,0x03,0x3E,0x03, 0x4B,0x03,0x58,0x03,0x65,0x03,0x72,0x03,0x7F,0x03,0x8C,0x03,0x99,0x03,0xA6,0x03,0xB3,0x03, 0xC0,0x03,0xCD,0x03,0xDA,0x03,0xE7,0x03,0xF4,0x03,0x01,0x04,0x1A,0x04,0x27,0x04,0x34,0x04, 0x41,0x04,0x4E,0x04,0x5B,0x04,0x68,0x04,0x75,0x04,0x82,0x04,0x8F,0x04,0xA8,0x04,0xB5,0x04, 0xC2,0x04,0xCF,0x04,0xDC,0x04,0xE9,0x04,0xF6,0x04,0x03,0x05, 5, // 0x20 ' ' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 4, // 0x21 '!' 0x00,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x00,0x20,0x00,0x00, 4, // 0x22 '"' 0x50,0x50,0xA0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 6, // 0x23 '#' 0x28,0x28,0x28,0x7C,0x28,0x28,0x28,0x7C,0x28,0x28,0x28,0x00, 6, // 0x24 '$' 0x10,0x10,0x38,0x54,0x50,0x38,0x14,0x54,0x38,0x10,0x10,0x00, 7, // 0x25 '%' 0x32,0x54,0x64,0x08,0x08,0x10,0x10,0x26,0x2A,0x4C,0x00,0x00, 7, // 0x26 '&' 0x00,0x30,0x48,0x48,0x48,0x30,0x4A,0x4A,0x44,0x3A,0x00,0x00, 3, // 0x27 ''' 0x40,0x40,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 5, // 0x28 '(' 0x10,0x20,0x20,0x40,0x40,0x40,0x40,0x40,0x20,0x20,0x10,0x00, 5, // 0x29 ')' 0x40,0x20,0x20,0x10,0x10,0x10,0x10,0x10,0x20,0x20,0x40,0x00, 6, // 0x2A '*' 0x00,0x00,0x10,0x54,0x38,0x7C,0x38,0x54,0x10,0x00,0x00,0x00, 6, // 0x2B '+' 0x00,0x00,0x00,0x00,0x10,0x10,0x7C,0x10,0x10,0x00,0x00,0x00, 4, // 0x2C ',' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x60,0x40,0x80, 6, // 0x2D '-' 0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x00,0x00,0x00,0x00,0x00, 4, // 0x2E '.' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x60,0x00,0x00, 7, // 0x2F '/' 0x00,0x04,0x04,0x08,0x08,0x10,0x10,0x20,0x20,0x40,0x40,0x00, 7, // 0x30 '0' 0x00,0x38,0x44,0x44,0x54,0x54,0x54,0x44,0x44,0x38,0x00,0x00, 4, // 0x31 '1' 0x00,0x20,0x60,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x00,0x00, 7, // 0x32 '2' 0x00,0x38,0x44,0x04,0x04,0x08,0x10,0x20,0x40,0x7C,0x00,0x00, 7, // 0x33 '3' 0x00,0x38,0x44,0x04,0x04,0x38,0x04,0x04,0x44,0x38,0x00,0x00, 6, // 0x34 '4' 0x00,0x08,0x18,0x28,0x28,0x48,0x48,0x7C,0x08,0x08,0x00,0x00, 7, // 0x35 '5' 0x00,0x7C,0x40,0x40,0x78,0x44,0x04,0x04,0x44,0x38,0x00,0x00, 7, // 0x36 '6' 0x00,0x38,0x44,0x40,0x78,0x44,0x44,0x44,0x44,0x38,0x00,0x00, 6, // 0x37 '7' 0x00,0x7C,0x04,0x08,0x08,0x10,0x10,0x20,0x20,0x20,0x00,0x00, 7, // 0x38 '8' 0x00,0x38,0x44,0x44,0x44,0x38,0x44,0x44,0x44,0x38,0x00,0x00, 7, // 0x39 '9' 0x00,0x38,0x44,0x44,0x44,0x3C,0x04,0x04,0x44,0x38,0x00,0x00, 4, // 0x3A ':' 0x00,0x00,0x00,0x60,0x60,0x00,0x00,0x00,0x60,0x60,0x00,0x00, 4, // 0x3B ';' 0x00,0x00,0x00,0x60,0x60,0x00,0x00,0x00,0x60,0x60,0x40,0x80, 6, // 0x3C '<' 0x00,0x00,0x04,0x08,0x10,0x20,0x40,0x20,0x10,0x08,0x04,0x00, 6, // 0x3D '=' 0x00,0x00,0x00,0x00,0x7C,0x00,0x00,0x7C,0x00,0x00,0x00,0x00, 6, // 0x3E '>' 0x00,0x00,0x40,0x20,0x10,0x08,0x04,0x08,0x10,0x20,0x40,0x00, 6, // 0x3F '?' 0x00,0x38,0x44,0x04,0x04,0x08,0x10,0x10,0x00,0x10,0x00,0x00, 7, // 0x40 '@' 0x00,0x38,0x44,0x44,0x5C,0x54,0x54,0x4C,0x40,0x38,0x00,0x00, 7, // 0x41 'A' 0x00,0x38,0x44,0x44,0x44,0x7C,0x44,0x44,0x44,0x44,0x00,0x00, 7, // 0x42 'B' 0x00,0x78,0x44,0x44,0x44,0x78,0x44,0x44,0x44,0x78,0x00,0x00, 6, // 0x43 'C' 0x00,0x38,0x44,0x40,0x40,0x40,0x40,0x40,0x44,0x38,0x00,0x00, 7, // 0x44 'D' 0x00,0x70,0x48,0x44,0x44,0x44,0x44,0x44,0x48,0x70,0x00,0x00, 6, // 0x45 'E' 0x00,0x7C,0x40,0x40,0x40,0x78,0x40,0x40,0x40,0x7C,0x00,0x00, 6, // 0x46 'F' 0x00,0x7C,0x40,0x40,0x40,0x78,0x40,0x40,0x40,0x40,0x00,0x00, 7, // 0x47 'G' 0x00,0x38,0x44,0x40,0x40,0x5C,0x44,0x44,0x4C,0x34,0x00,0x00, 7, // 0x48 'H' 0x00,0x44,0x44,0x44,0x44,0x7C,0x44,0x44,0x44,0x44,0x00,0x00, 5, // 0x49 'I' 0x00,0x70,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x70,0x00,0x00, 6, // 0x4A 'J' 0x00,0x1C,0x08,0x08,0x08,0x08,0x08,0x48,0x48,0x30,0x00,0x00, 6, // 0x4B 'K' 0x00,0x44,0x48,0x50,0x60,0x60,0x50,0x48,0x44,0x44,0x00,0x00, 6, // 0x4C 'L' 0x00,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x7C,0x00,0x00, 9, // 0x4D 'M' 0x00,0x00,0x41,0x00,0x63,0x00,0x55,0x00,0x49,0x00,0x49,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x00,0x00,0x00,0x00, 7, // 0x4E 'N' 0x00,0x44,0x64,0x64,0x54,0x54,0x4C,0x4C,0x44,0x44,0x00,0x00, 7, // 0x4F 'O' 0x00,0x38,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x38,0x00,0x00, 7, // 0x50 'P' 0x00,0x78,0x44,0x44,0x44,0x44,0x78,0x40,0x40,0x40,0x00,0x00, 7, // 0x51 'Q' 0x00,0x38,0x44,0x44,0x44,0x44,0x44,0x54,0x48,0x34,0x00,0x00, 7, // 0x52 'R' 0x00,0x78,0x44,0x44,0x44,0x44,0x78,0x48,0x44,0x44,0x00,0x00, 7, // 0x53 'S' 0x00,0x38,0x44,0x40,0x40,0x38,0x04,0x04,0x44,0x38,0x00,0x00, 6, // 0x54 'T' 0x00,0x7C,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x00,0x00, 7, // 0x55 'U' 0x00,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x38,0x00,0x00, 6, // 0x56 'V' 0x00,0x44,0x44,0x44,0x44,0x28,0x28,0x28,0x10,0x10,0x00,0x00, 9, // 0x57 'W' 0x00,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x49,0x00,0x49,0x00,0x55,0x00,0x22,0x00,0x00,0x00,0x00,0x00, 7, // 0x58 'X' 0x00,0x44,0x44,0x44,0x28,0x10,0x28,0x44,0x44,0x44,0x00,0x00, 7, // 0x59 'Y' 0x00,0x44,0x44,0x44,0x44,0x28,0x10,0x10,0x10,0x10,0x00,0x00, 6, // 0x5A 'Z' 0x00,0x7C,0x04,0x04,0x08,0x10,0x20,0x40,0x40,0x7C,0x00,0x00, 4, // 0x5B '[' 0x70,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x70,0x00, 7, // 0x5C '\' 0x00,0x40,0x40,0x20,0x20,0x10,0x10,0x08,0x08,0x04,0x04,0x00, 4, // 0x5D ']' 0xE0,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0xE0,0x00, 6, // 0x5E '^' 0x00,0x10,0x28,0x44,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 6, // 0x5F '_' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x00,0x00, 4, // 0x60 '`' 0x00,0x40,0x40,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 7, // 0x61 'a' 0x00,0x00,0x00,0x38,0x04,0x3C,0x44,0x44,0x44,0x3C,0x00,0x00, 7, // 0x62 'b' 0x00,0x40,0x40,0x78,0x44,0x44,0x44,0x44,0x44,0x78,0x00,0x00, 6, // 0x63 'c' 0x00,0x00,0x00,0x38,0x44,0x40,0x40,0x40,0x44,0x38,0x00,0x00, 7, // 0x64 'd' 0x00,0x04,0x04,0x3C,0x44,0x44,0x44,0x44,0x44,0x3C,0x00,0x00, 7, // 0x65 'e' 0x00,0x00,0x00,0x38,0x44,0x44,0x7C,0x40,0x44,0x38,0x00,0x00, 4, // 0x66 'f' 0x00,0x30,0x40,0xE0,0x40,0x40,0x40,0x40,0x40,0x40,0x00,0x00, 7, // 0x67 'g' 0x00,0x00,0x00,0x3C,0x44,0x44,0x44,0x44,0x44,0x3C,0x04,0x78, 7, // 0x68 'h' 0x00,0x40,0x40,0x78,0x44,0x44,0x44,0x44,0x44,0x44,0x00,0x00, 3, // 0x69 'i' 0x00,0x40,0x00,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x00,0x00, 5, // 0x6A 'j' 0x00,0x10,0x00,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x90,0x60, 6, // 0x6B 'k' 0x00,0x40,0x40,0x44,0x48,0x50,0x60,0x50,0x48,0x44,0x00,0x00, 3, // 0x6C 'l' 0x00,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x00,0x00, 9, // 0x6D 'm' 0x00,0x00,0x00,0x00,0x00,0x00,0x76,0x00,0x49,0x00,0x49,0x00,0x49,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x00,0x00,0x00,0x00, 7, // 0x6E 'n' 0x00,0x00,0x00,0x58,0x64,0x44,0x44,0x44,0x44,0x44,0x00,0x00, 7, // 0x6F 'o' 0x00,0x00,0x00,0x38,0x44,0x44,0x44,0x44,0x44,0x38,0x00,0x00, 7, // 0x70 'p' 0x00,0x00,0x00,0x78,0x44,0x44,0x44,0x44,0x44,0x78,0x40,0x40, 7, // 0x71 'q' 0x00,0x00,0x00,0x3C,0x44,0x44,0x44,0x44,0x44,0x3C,0x04,0x04, 6, // 0x72 'r' 0x00,0x00,0x00,0x58,0x24,0x20,0x20,0x20,0x20,0x70,0x00,0x00, 7, // 0x73 's' 0x00,0x00,0x00,0x38,0x44,0x40,0x38,0x04,0x44,0x38,0x00,0x00, 5, // 0x74 't' 0x00,0x20,0x20,0x70,0x20,0x20,0x20,0x20,0x20,0x18,0x00,0x00, 7, // 0x75 'u' 0x00,0x00,0x00,0x44,0x44,0x44,0x44,0x44,0x4C,0x34,0x00,0x00, 6, // 0x76 'v' 0x00,0x00,0x00,0x44,0x44,0x44,0x28,0x28,0x10,0x10,0x00,0x00, 9, // 0x77 'w' 0x00,0x00,0x00,0x00,0x00,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x49,0x00,0x49,0x00,0x49,0x00,0x36,0x00,0x00,0x00,0x00,0x00, 7, // 0x78 'x' 0x00,0x00,0x00,0x44,0x44,0x28,0x10,0x28,0x44,0x44,0x00,0x00, 7, // 0x79 'y' 0x00,0x00,0x00,0x44,0x44,0x44,0x44,0x44,0x44,0x3C,0x08,0x70, 6, // 0x7A 'z' 0x00,0x00,0x00,0x7C,0x04,0x08,0x10,0x20,0x40,0x7C,0x00,0x00, 5, // 0x7B '{' 0x18,0x20,0x20,0x20,0x20,0xC0,0x20,0x20,0x20,0x20,0x18,0x00, 3, // 0x7C '|' 0x00,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x00, 5, // 0x7D '}' 0xC0,0x20,0x20,0x20,0x20,0x18,0x20,0x20,0x20,0x20,0xC0,0x00, 7, // 0x7E '~' 0x00,0x60,0x92,0x92,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 7, // 0x7F '' 0x00,0x10,0x38,0x6C,0x44,0x44,0x7C,0x00,0x00,0x00,0x00,0x00, 0 }; 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, 0x7E,0x00,0x8C,0x00,0x9A,0x00,0xA8,0x00,0xB6,0x00,0xC4,0x00,0xD2,0x00,0xE0,0x00,0xEE,0x00, 0xFC,0x00,0x0A,0x01,0x18,0x01,0x26,0x01,0x34,0x01,0x42,0x01,0x50,0x01,0x5E,0x01,0x6C,0x01, 0x7A,0x01,0x88,0x01,0x96,0x01,0xA4,0x01,0xB2,0x01,0xC0,0x01,0xCE,0x01,0xDC,0x01,0xEA,0x01, 0xF8,0x01,0x06,0x02,0x14,0x02,0x22,0x02,0x30,0x02,0x3E,0x02,0x4C,0x02,0x5A,0x02,0x68,0x02, 0x76,0x02,0x91,0x02,0x9F,0x02,0xAD,0x02,0xBB,0x02,0xC9,0x02,0xD7,0x02,0xE5,0x02,0xF3,0x02, 0x01,0x03,0x0F,0x03,0x2A,0x03,0x38,0x03,0x46,0x03,0x54,0x03,0x62,0x03,0x70,0x03,0x7E,0x03, 0x8C,0x03,0x9A,0x03,0xA8,0x03,0xB6,0x03,0xC4,0x03,0xD2,0x03,0xE0,0x03,0xEE,0x03,0xFC,0x03, 0x0A,0x04,0x18,0x04,0x26,0x04,0x34,0x04,0x42,0x04,0x50,0x04,0x6B,0x04,0x79,0x04,0x87,0x04, 0x95,0x04,0xA3,0x04,0xB1,0x04,0xBF,0x04,0xCD,0x04,0xDB,0x04,0xE9,0x04,0x04,0x05,0x12,0x05, 0x20,0x05,0x2E,0x05,0x3C,0x05,0x4A,0x05,0x58,0x05,0x66,0x05, 5, // 0x20 ' ' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 4, // 0x21 '!' 0x00,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x00,0x20,0x00,0x00, 4, // 0x22 '"' 0x00,0x50,0x50,0xA0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 6, // 0x23 '#' 0x00,0x28,0x28,0x28,0x7C,0x28,0x28,0x28,0x7C,0x28,0x28,0x28,0x00, 6, // 0x24 '$' 0x00,0x10,0x10,0x38,0x54,0x50,0x38,0x14,0x54,0x38,0x10,0x10,0x00, 7, // 0x25 '%' 0x00,0x32,0x54,0x64,0x08,0x08,0x10,0x10,0x26,0x2A,0x4C,0x00,0x00, 7, // 0x26 '&' 0x00,0x30,0x48,0x48,0x48,0x30,0x4A,0x4A,0x44,0x3A,0x00,0x00,0x00, 3, // 0x27 ''' 0x00,0x40,0x40,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 5, // 0x28 '(' 0x10,0x20,0x20,0x40,0x40,0x40,0x40,0x40,0x20,0x20,0x10,0x00,0x00, 5, // 0x29 ')' 0x40,0x20,0x20,0x10,0x10,0x10,0x10,0x10,0x20,0x20,0x40,0x00,0x00, 6, // 0x2A '*' 0x00,0x00,0x10,0x54,0x38,0x7C,0x38,0x54,0x10,0x00,0x00,0x00,0x00, 6, // 0x2B '+' 0x00,0x00,0x00,0x00,0x10,0x10,0x7C,0x10,0x10,0x00,0x00,0x00,0x00, 4, // 0x2C ',' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x60,0x20,0x40,0x80, 6, // 0x2D '-' 0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x00,0x00,0x00,0x00,0x00,0x00, 4, // 0x2E '.' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x60,0x00,0x00,0x00, 7, // 0x2F '/' 0x00,0x04,0x04,0x08,0x08,0x10,0x10,0x20,0x20,0x40,0x40,0x00,0x00, 7, // 0x30 '0' 0x00,0x38,0x44,0x44,0x54,0x54,0x54,0x44,0x44,0x38,0x00,0x00,0x00, 4, // 0x31 '1' 0x00,0x20,0x60,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x00,0x00,0x00, 7, // 0x32 '2' 0x00,0x38,0x44,0x04,0x04,0x08,0x10,0x20,0x40,0x7C,0x00,0x00,0x00, 7, // 0x33 '3' 0x00,0x38,0x44,0x04,0x04,0x38,0x04,0x04,0x44,0x38,0x00,0x00,0x00, 6, // 0x34 '4' 0x00,0x08,0x18,0x28,0x28,0x48,0x48,0x7C,0x08,0x08,0x00,0x00,0x00, 7, // 0x35 '5' 0x00,0x7C,0x40,0x40,0x78,0x44,0x04,0x04,0x44,0x38,0x00,0x00,0x00, 7, // 0x36 '6' 0x00,0x38,0x44,0x40,0x78,0x44,0x44,0x44,0x44,0x38,0x00,0x00,0x00, 6, // 0x37 '7' 0x00,0x7C,0x04,0x08,0x08,0x10,0x10,0x20,0x20,0x20,0x00,0x00,0x00, 7, // 0x38 '8' 0x00,0x38,0x44,0x44,0x44,0x38,0x44,0x44,0x44,0x38,0x00,0x00,0x00, 7, // 0x39 '9' 0x00,0x38,0x44,0x44,0x44,0x3C,0x04,0x04,0x44,0x38,0x00,0x00,0x00, 4, // 0x3A ':' 0x00,0x00,0x00,0x60,0x60,0x00,0x00,0x00,0x60,0x60,0x00,0x00,0x00, 4, // 0x3B ';' 0x00,0x00,0x00,0x60,0x60,0x00,0x00,0x00,0x60,0x60,0x20,0x40,0x80, 6, // 0x3C '<' 0x00,0x00,0x04,0x08,0x10,0x20,0x40,0x20,0x10,0x08,0x04,0x00,0x00, 6, // 0x3D '=' 0x00,0x00,0x00,0x00,0x7C,0x00,0x00,0x7C,0x00,0x00,0x00,0x00,0x00, 6, // 0x3E '>' 0x00,0x00,0x40,0x20,0x10,0x08,0x04,0x08,0x10,0x20,0x40,0x00,0x00, 6, // 0x3F '?' 0x00,0x38,0x44,0x04,0x04,0x08,0x10,0x10,0x00,0x10,0x00,0x00,0x00, 7, // 0x40 '@' 0x00,0x38,0x44,0x44,0x5C,0x54,0x54,0x4C,0x40,0x38,0x00,0x00,0x00, 7, // 0x41 'A' 0x00,0x38,0x44,0x44,0x44,0x7C,0x44,0x44,0x44,0x44,0x00,0x00,0x00, 7, // 0x42 'B' 0x00,0x78,0x44,0x44,0x44,0x78,0x44,0x44,0x44,0x78,0x00,0x00,0x00, 6, // 0x43 'C' 0x00,0x38,0x44,0x40,0x40,0x40,0x40,0x40,0x44,0x38,0x00,0x00,0x00, 7, // 0x44 'D' 0x00,0x70,0x48,0x44,0x44,0x44,0x44,0x44,0x48,0x70,0x00,0x00,0x00, 6, // 0x45 'E' 0x00,0x7C,0x40,0x40,0x40,0x78,0x40,0x40,0x40,0x7C,0x00,0x00,0x00, 6, // 0x46 'F' 0x00,0x7C,0x40,0x40,0x40,0x78,0x40,0x40,0x40,0x40,0x00,0x00,0x00, 7, // 0x47 'G' 0x00,0x38,0x44,0x40,0x40,0x5C,0x44,0x44,0x4C,0x34,0x00,0x00,0x00, 7, // 0x48 'H' 0x00,0x44,0x44,0x44,0x44,0x7C,0x44,0x44,0x44,0x44,0x00,0x00,0x00, 5, // 0x49 'I' 0x00,0x70,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x70,0x00,0x00,0x00, 6, // 0x4A 'J' 0x00,0x1C,0x08,0x08,0x08,0x08,0x08,0x48,0x48,0x30,0x00,0x00,0x00, 6, // 0x4B 'K' 0x00,0x44,0x48,0x50,0x60,0x60,0x50,0x48,0x44,0x44,0x00,0x00,0x00, 6, // 0x4C 'L' 0x00,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x7C,0x00,0x00,0x00, 9, // 0x4D 'M' 0x00,0x00,0x41,0x00,0x63,0x00,0x55,0x00,0x49,0x00,0x49,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 7, // 0x4E 'N' 0x00,0x44,0x64,0x64,0x54,0x54,0x4C,0x4C,0x44,0x44,0x00,0x00,0x00, 7, // 0x4F 'O' 0x00,0x38,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x38,0x00,0x00,0x00, 7, // 0x50 'P' 0x00,0x78,0x44,0x44,0x44,0x44,0x78,0x40,0x40,0x40,0x00,0x00,0x00, 7, // 0x51 'Q' 0x00,0x38,0x44,0x44,0x44,0x44,0x44,0x54,0x48,0x34,0x00,0x00,0x00, 7, // 0x52 'R' 0x00,0x78,0x44,0x44,0x44,0x44,0x78,0x48,0x44,0x44,0x00,0x00,0x00, 7, // 0x53 'S' 0x00,0x38,0x44,0x40,0x40,0x38,0x04,0x04,0x44,0x38,0x00,0x00,0x00, 6, // 0x54 'T' 0x00,0x7C,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x00,0x00,0x00, 7, // 0x55 'U' 0x00,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x38,0x00,0x00,0x00, 6, // 0x56 'V' 0x00,0x44,0x44,0x44,0x44,0x28,0x28,0x28,0x10,0x10,0x00,0x00,0x00, 9, // 0x57 'W' 0x00,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x49,0x00,0x49,0x00,0x55,0x00,0x22,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 7, // 0x58 'X' 0x00,0x44,0x44,0x44,0x28,0x10,0x28,0x44,0x44,0x44,0x00,0x00,0x00, 7, // 0x59 'Y' 0x00,0x44,0x44,0x44,0x44,0x28,0x10,0x10,0x10,0x10,0x00,0x00,0x00, 6, // 0x5A 'Z' 0x00,0x7C,0x04,0x04,0x08,0x10,0x20,0x40,0x40,0x7C,0x00,0x00,0x00, 4, // 0x5B '[' 0x70,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x70,0x00,0x00, 7, // 0x5C '\' 0x00,0x40,0x40,0x20,0x20,0x10,0x10,0x08,0x08,0x04,0x04,0x00,0x00, 4, // 0x5D ']' 0xE0,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0xE0,0x00,0x00, 6, // 0x5E '^' 0x00,0x10,0x28,0x44,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 6, // 0x5F '_' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x00,0x00,0x00, 4, // 0x60 '`' 0x00,0x40,0x40,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 7, // 0x61 'a' 0x00,0x00,0x00,0x38,0x04,0x3C,0x44,0x44,0x44,0x3C,0x00,0x00,0x00, 7, // 0x62 'b' 0x00,0x40,0x40,0x78,0x44,0x44,0x44,0x44,0x44,0x78,0x00,0x00,0x00, 6, // 0x63 'c' 0x00,0x00,0x00,0x38,0x44,0x40,0x40,0x40,0x44,0x38,0x00,0x00,0x00, 7, // 0x64 'd' 0x00,0x04,0x04,0x3C,0x44,0x44,0x44,0x44,0x44,0x3C,0x00,0x00,0x00, 7, // 0x65 'e' 0x00,0x00,0x00,0x38,0x44,0x44,0x7C,0x40,0x44,0x38,0x00,0x00,0x00, 4, // 0x66 'f' 0x00,0x30,0x40,0xE0,0x40,0x40,0x40,0x40,0x40,0x40,0x00,0x00,0x00, 7, // 0x67 'g' 0x00,0x00,0x00,0x3C,0x44,0x44,0x44,0x44,0x44,0x3C,0x04,0x44,0x38, 7, // 0x68 'h' 0x00,0x40,0x40,0x78,0x44,0x44,0x44,0x44,0x44,0x44,0x00,0x00,0x00, 3, // 0x69 'i' 0x00,0x40,0x00,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x00,0x00,0x00, 5, // 0x6A 'j' 0x00,0x10,0x00,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x90,0x60,0x00, 6, // 0x6B 'k' 0x00,0x40,0x40,0x44,0x48,0x50,0x60,0x50,0x48,0x44,0x00,0x00,0x00, 3, // 0x6C 'l' 0x00,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x00,0x00,0x00, 9, // 0x6D 'm' 0x00,0x00,0x00,0x00,0x00,0x00,0x76,0x00,0x49,0x00,0x49,0x00,0x49,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 7, // 0x6E 'n' 0x00,0x00,0x00,0x58,0x64,0x44,0x44,0x44,0x44,0x44,0x00,0x00,0x00, 7, // 0x6F 'o' 0x00,0x00,0x00,0x38,0x44,0x44,0x44,0x44,0x44,0x38,0x00,0x00,0x00, 7, // 0x70 'p' 0x00,0x00,0x00,0x78,0x44,0x44,0x44,0x44,0x44,0x78,0x40,0x40,0x40, 7, // 0x71 'q' 0x00,0x00,0x00,0x3C,0x44,0x44,0x44,0x44,0x44,0x3C,0x04,0x04,0x04, 6, // 0x72 'r' 0x00,0x00,0x00,0x58,0x24,0x20,0x20,0x20,0x20,0x70,0x00,0x00,0x00, 7, // 0x73 's' 0x00,0x00,0x00,0x38,0x44,0x40,0x38,0x04,0x44,0x38,0x00,0x00,0x00, 5, // 0x74 't' 0x00,0x20,0x20,0x70,0x20,0x20,0x20,0x20,0x20,0x18,0x00,0x00,0x00, 7, // 0x75 'u' 0x00,0x00,0x00,0x44,0x44,0x44,0x44,0x44,0x4C,0x34,0x00,0x00,0x00, 6, // 0x76 'v' 0x00,0x00,0x00,0x44,0x44,0x44,0x28,0x28,0x10,0x10,0x00,0x00,0x00, 9, // 0x77 'w' 0x00,0x00,0x00,0x00,0x00,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x49,0x00,0x49,0x00,0x49,0x00,0x36,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 7, // 0x78 'x' 0x00,0x00,0x00,0x44,0x44,0x28,0x10,0x28,0x44,0x44,0x00,0x00,0x00, 7, // 0x79 'y' 0x00,0x00,0x00,0x44,0x44,0x44,0x44,0x44,0x44,0x3C,0x04,0x08,0x70, 6, // 0x7A 'z' 0x00,0x00,0x00,0x7C,0x04,0x08,0x10,0x20,0x40,0x7C,0x00,0x00,0x00, 5, // 0x7B '{' 0x18,0x20,0x20,0x20,0x20,0xC0,0x20,0x20,0x20,0x20,0x18,0x00,0x00, 3, // 0x7C '|' 0x00,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x00,0x00, 5, // 0x7D '}' 0xC0,0x20,0x20,0x20,0x20,0x18,0x20,0x20,0x20,0x20,0xC0,0x00,0x00, 7, // 0x7E '~' 0x00,0x60,0x92,0x92,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 7, // 0x7F '' 0x00,0x10,0x38,0x6C,0x44,0x44,0x7C,0x00,0x00,0x00,0x00,0x00,0x00, 0 }; 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, 0x63,0x00,0x6E,0x00,0x79,0x00,0x84,0x00,0x8F,0x00,0x9A,0x00,0xA5,0x00,0xB0,0x00,0xBB,0x00, 0xC6,0x00,0xD1,0x00,0xDC,0x00,0xE7,0x00,0xF2,0x00,0xFD,0x00,0x08,0x01,0x13,0x01,0x1E,0x01, 0x29,0x01,0x34,0x01,0x3F,0x01,0x4A,0x01,0x55,0x01,0x60,0x01,0x6B,0x01,0x76,0x01,0x81,0x01, 0x8C,0x01,0x97,0x01,0xA2,0x01,0xAD,0x01,0xB8,0x01,0xC3,0x01,0xCE,0x01,0xD9,0x01,0xE4,0x01, 0xEF,0x01,0xFA,0x01,0x05,0x02,0x10,0x02,0x1B,0x02,0x26,0x02,0x31,0x02,0x3C,0x02,0x47,0x02, 0x52,0x02,0x5D,0x02,0x68,0x02,0x73,0x02,0x7E,0x02,0x89,0x02,0x94,0x02,0x9F,0x02,0xAA,0x02, 0xB5,0x02,0xC0,0x02,0xCB,0x02,0xD6,0x02,0xE1,0x02,0xEC,0x02,0xF7,0x02,0x02,0x03,0x0D,0x03, 0x18,0x03,0x23,0x03,0x2E,0x03,0x39,0x03,0x44,0x03,0x4F,0x03,0x5A,0x03,0x65,0x03,0x70,0x03, 0x7B,0x03,0x86,0x03,0x91,0x03,0x9C,0x03,0xA7,0x03,0xB2,0x03,0xBD,0x03,0xC8,0x03,0xD3,0x03, 0xDE,0x03,0xE9,0x03,0xF4,0x03,0xFF,0x03,0x0A,0x04,0x15,0x04, 5, // 0x20 ' ' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 5, // 0x21 '!' 0x00,0x20,0x20,0x20,0x20,0x20,0x20,0x00,0x20,0x00, 5, // 0x22 '"' 0x00,0x50,0x50,0xA0,0x00,0x00,0x00,0x00,0x00,0x00, 5, // 0x23 '#' 0x00,0x50,0x50,0xF8,0x50,0x50,0x50,0xF8,0x50,0x50, 5, // 0x24 '$' 0x00,0x40,0x60,0x90,0x80,0x60,0x10,0x90,0x60,0x20, 5, // 0x25 '%' 0x00,0x00,0x90,0x90,0x20,0x20,0x40,0x40,0x90,0x90, 5, // 0x26 '&' 0x00,0x40,0xA0,0xA0,0xA0,0x40,0xA8,0x90,0x90,0x68, 5, // 0x27 ''' 0x00,0x20,0x20,0x40,0x00,0x00,0x00,0x00,0x00,0x00, 5, // 0x28 '(' 0x10,0x20,0x20,0x40,0x40,0x40,0x40,0x20,0x20,0x10, 5, // 0x29 ')' 0x40,0x20,0x20,0x10,0x10,0x10,0x10,0x20,0x20,0x40, 5, // 0x2A '*' 0x00,0x00,0x90,0x60,0xF0,0x60,0x90,0x00,0x00,0x00, 5, // 0x2B '+' 0x00,0x00,0x00,0x20,0x20,0xF8,0x20,0x20,0x00,0x00, 5, // 0x2C ',' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x60,0xC0, 5, // 0x2D '-' 0x00,0x00,0x00,0x00,0x00,0xF0,0x00,0x00,0x00,0x00, 5, // 0x2E '.' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x60,0x00, 5, // 0x2F '/' 0x00,0x08,0x10,0x10,0x20,0x20,0x40,0x40,0x80,0x00, 5, // 0x30 '0' 0x00,0x70,0x90,0x90,0x90,0x90,0x90,0x90,0xE0,0x00, 5, // 0x31 '1' 0x00,0x20,0x60,0x20,0x20,0x20,0x20,0x20,0x70,0x00, 5, // 0x32 '2' 0x00,0x60,0x90,0x90,0x10,0x20,0x40,0x80,0xF0,0x00, 5, // 0x33 '3' 0x00,0x60,0x90,0x10,0x60,0x10,0x10,0x90,0x60,0x00, 5, // 0x34 '4' 0x00,0x10,0x30,0x50,0x50,0x90,0xF0,0x10,0x10,0x00, 5, // 0x35 '5' 0x00,0xF0,0x80,0x80,0xE0,0x10,0x10,0x90,0x60,0x00, 5, // 0x36 '6' 0x00,0x60,0x80,0x80,0xE0,0x90,0x90,0x90,0x60,0x00, 5, // 0x37 '7' 0x00,0xF0,0x10,0x10,0x20,0x20,0x40,0x40,0x40,0x00, 5, // 0x38 '8' 0x00,0x60,0x90,0x90,0x60,0x90,0x90,0x90,0x60,0x00, 5, // 0x39 '9' 0x00,0x60,0x90,0x90,0x90,0x70,0x10,0x10,0x60,0x00, 5, // 0x3A ':' 0x00,0x00,0x00,0x60,0x60,0x00,0x00,0x60,0x60,0x00, 5, // 0x3B ';' 0x00,0x00,0x00,0x60,0x60,0x00,0x00,0x60,0x60,0xC0, 5, // 0x3C '<' 0x00,0x08,0x10,0x20,0x40,0x80,0x40,0x20,0x10,0x08, 5, // 0x3D '=' 0x00,0x00,0x00,0x00,0xF0,0x00,0xF0,0x00,0x00,0x00, 5, // 0x3E '>' 0x00,0x80,0x40,0x20,0x10,0x08,0x10,0x20,0x40,0x80, 5, // 0x3F '?' 0x00,0x60,0x90,0x10,0x10,0x20,0x40,0x00,0x40,0x00, 5, // 0x40 '@' 0x00,0x60,0x90,0x90,0xB0,0xB0,0x80,0x80,0x70,0x00, 5, // 0x41 'A' 0x00,0x60,0x90,0x90,0x90,0xF0,0x90,0x90,0x90,0x00, 5, // 0x42 'B' 0x00,0xE0,0x90,0x90,0xE0,0x90,0x90,0x90,0xE0,0x00, 5, // 0x43 'C' 0x00,0x60,0x90,0x80,0x80,0x80,0x80,0x90,0x60,0x00, 5, // 0x44 'D' 0x00,0xE0,0x90,0x90,0x90,0x90,0x90,0x90,0xE0,0x00, 5, // 0x45 'E' 0x00,0xF0,0x80,0x80,0xF0,0x80,0x80,0x80,0xF0,0x00, 5, // 0x46 'F' 0x00,0xF0,0x80,0x80,0xF0,0x80,0x80,0x80,0x80,0x00, 5, // 0x47 'G' 0x00,0x60,0x90,0x80,0x80,0xB0,0x90,0x90,0x60,0x00, 5, // 0x48 'H' 0x00,0x90,0x90,0x90,0x90,0xF0,0x90,0x90,0x90,0x00, 5, // 0x49 'I' 0x00,0x70,0x20,0x20,0x20,0x20,0x20,0x20,0x70,0x00, 5, // 0x4A 'J' 0x00,0x70,0x20,0x20,0x20,0x20,0x20,0xA0,0x40,0x00, 5, // 0x4B 'K' 0x00,0x90,0xA0,0xA0,0xC0,0xC0,0xA0,0xA0,0x90,0x00, 5, // 0x4C 'L' 0x00,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0xF0,0x00, 5, // 0x4D 'M' 0x00,0x90,0x90,0xF0,0xF0,0x90,0x90,0x90,0x90,0x00, 5, // 0x4E 'N' 0x00,0x90,0x90,0xD0,0xD0,0xB0,0xB0,0x90,0x90,0x00, 5, // 0x4F 'O' 0x00,0x60,0x90,0x90,0x90,0x90,0x90,0x90,0x60,0x00, 5, // 0x50 'P' 0x00,0xE0,0x90,0x90,0x90,0xE0,0x80,0x80,0x80,0x00, 5, // 0x51 'Q' 0x00,0x60,0x90,0x90,0x90,0x90,0x90,0x90,0x60,0x30, 5, // 0x52 'R' 0x00,0xE0,0x90,0x90,0x90,0xE0,0xA0,0x90,0x90,0x00, 5, // 0x53 'S' 0x00,0x60,0x90,0x80,0x60,0x10,0x90,0x90,0x60,0x00, 5, // 0x54 'T' 0x00,0xF8,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x00, 5, // 0x55 'U' 0x00,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x60,0x00, 5, // 0x56 'V' 0x00,0x90,0x90,0x90,0x50,0x50,0x50,0x20,0x20,0x00, 5, // 0x57 'W' 0x00,0x90,0x90,0x90,0x90,0x90,0xF0,0xF0,0x90,0x00, 5, // 0x58 'X' 0x00,0x90,0x90,0x90,0x60,0x60,0x90,0x90,0x90,0x00, 5, // 0x59 'Y' 0x00,0x88,0x88,0x88,0x50,0x20,0x20,0x20,0x20,0x00, 5, // 0x5A 'Z' 0x00,0xF0,0x10,0x20,0x20,0x40,0x40,0x80,0xF0,0x00, 5, // 0x5B '[' 0x60,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x60, 5, // 0x5C '\' 0x80,0x80,0x40,0x40,0x20,0x20,0x10,0x10,0x08,0x08, 5, // 0x5D ']' 0x60,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x60, 5, // 0x5E '^' 0x00,0x20,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 5, // 0x5F '_' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF0,0x00, 5, // 0x60 '`' 0x00,0x40,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 5, // 0x61 'a' 0x00,0x00,0x00,0x60,0x10,0x70,0x90,0x90,0x70,0x00, 5, // 0x62 'b' 0x00,0x80,0x80,0xE0,0x90,0x90,0x90,0x90,0xE0,0x00, 5, // 0x63 'c' 0x00,0x00,0x00,0x60,0x90,0x80,0x80,0x90,0x60,0x00, 5, // 0x64 'd' 0x00,0x10,0x10,0x70,0x90,0x90,0x90,0x90,0x70,0x00, 5, // 0x65 'e' 0x00,0x00,0x00,0x60,0x90,0x90,0xF0,0x80,0x70,0x00, 5, // 0x66 'f' 0x00,0x30,0x40,0xE0,0x40,0x40,0x40,0x40,0x40,0x00, 5, // 0x67 'g' 0x00,0x00,0x00,0x70,0x90,0x90,0x90,0x70,0x10,0xE0, 5, // 0x68 'h' 0x00,0x80,0x80,0xE0,0x90,0x90,0x90,0x90,0x90,0x00, 5, // 0x69 'i' 0x00,0x20,0x00,0x60,0x20,0x20,0x20,0x20,0x70,0x00, 5, // 0x6A 'j' 0x00,0x20,0x00,0x60,0x20,0x20,0x20,0x20,0x20,0xC0, 5, // 0x6B 'k' 0x00,0x80,0x80,0x90,0xA0,0xC0,0xA0,0x90,0x90,0x00, 5, // 0x6C 'l' 0x00,0x60,0x20,0x20,0x20,0x20,0x20,0x20,0x70,0x00, 5, // 0x6D 'm' 0x00,0x00,0x00,0x90,0xF0,0x90,0x90,0x90,0x90,0x00, 5, // 0x6E 'n' 0x00,0x00,0x00,0xE0,0x90,0x90,0x90,0x90,0x90,0x00, 5, // 0x6F 'o' 0x00,0x00,0x00,0x60,0x90,0x90,0x90,0x90,0x60,0x00, 5, // 0x70 'p' 0x00,0x00,0x00,0xE0,0x90,0x90,0x90,0xE0,0x80,0x80, 5, // 0x71 'q' 0x00,0x00,0x00,0x70,0x90,0x90,0x90,0x70,0x10,0x10, 5, // 0x72 'r' 0x00,0x00,0x00,0xB0,0x50,0x40,0x40,0x40,0xE0,0x00, 5, // 0x73 's' 0x00,0x00,0x00,0x60,0x90,0x40,0x20,0x90,0x60,0x00, 5, // 0x74 't' 0x00,0x40,0x40,0xE0,0x40,0x40,0x40,0x50,0x20,0x00, 5, // 0x75 'u' 0x00,0x00,0x00,0x90,0x90,0x90,0x90,0x90,0x70,0x00, 5, // 0x76 'v' 0x00,0x00,0x00,0x90,0x90,0x50,0x50,0x20,0x20,0x00, 5, // 0x77 'w' 0x00,0x00,0x00,0x90,0x90,0x90,0x90,0xF0,0x90,0x00, 5, // 0x78 'x' 0x00,0x00,0x00,0x90,0x90,0x60,0x60,0x90,0x90,0x00, 5, // 0x79 'y' 0x00,0x00,0x00,0x90,0x90,0x90,0x90,0x70,0x10,0xE0, 5, // 0x7A 'z' 0x00,0x00,0x00,0xF0,0x10,0x20,0x40,0x80,0xF0,0x00, 5, // 0x7B '{' 0x30,0x40,0x40,0x40,0x80,0x40,0x40,0x40,0x40,0x30, 5, // 0x7C '|' 0x00,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, 5, // 0x7D '}' 0xC0,0x20,0x20,0x20,0x10,0x20,0x20,0x20,0x20,0xC0, 5, // 0x7E '~' 0x00,0x40,0xA8,0x10,0x00,0x00,0x00,0x00,0x00,0x00, 5, // 0x7F '' 0x00,0x20,0x70,0xD8,0x88,0x88,0xF8,0x00,0x00,0x00, 0 }; 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, 0x6C,0x00,0x78,0x00,0x84,0x00,0x90,0x00,0x9C,0x00,0xA8,0x00,0xB4,0x00,0xC0,0x00,0xCC,0x00, 0xD8,0x00,0xE4,0x00,0xF0,0x00,0xFC,0x00,0x08,0x01,0x14,0x01,0x20,0x01,0x2C,0x01,0x38,0x01, 0x44,0x01,0x50,0x01,0x5C,0x01,0x68,0x01,0x74,0x01,0x80,0x01,0x8C,0x01,0x98,0x01,0xA4,0x01, 0xB0,0x01,0xBC,0x01,0xC8,0x01,0xD4,0x01,0xE0,0x01,0xEC,0x01,0xF8,0x01,0x04,0x02,0x10,0x02, 0x1C,0x02,0x28,0x02,0x34,0x02,0x40,0x02,0x4C,0x02,0x58,0x02,0x64,0x02,0x70,0x02,0x7C,0x02, 0x88,0x02,0x94,0x02,0xA0,0x02,0xAC,0x02,0xB8,0x02,0xC4,0x02,0xD0,0x02,0xDC,0x02,0xE8,0x02, 0xF4,0x02,0x00,0x03,0x0C,0x03,0x18,0x03,0x24,0x03,0x30,0x03,0x3C,0x03,0x48,0x03,0x54,0x03, 0x60,0x03,0x6C,0x03,0x78,0x03,0x84,0x03,0x90,0x03,0x9C,0x03,0xA8,0x03,0xB4,0x03,0xC0,0x03, 0xCC,0x03,0xD8,0x03,0xE4,0x03,0xF0,0x03,0xFC,0x03,0x08,0x04,0x14,0x04,0x20,0x04,0x2C,0x04, 0x38,0x04,0x44,0x04,0x50,0x04,0x5C,0x04,0x68,0x04,0x74,0x04, 5, // 0x20 ' ' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 5, // 0x21 '!' 0x00,0x20,0x20,0x20,0x20,0x20,0x20,0x00,0x20,0x00,0x00, 5, // 0x22 '"' 0x00,0x50,0x50,0xA0,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 5, // 0x23 '#' 0x00,0x50,0x50,0xF8,0x50,0x50,0x50,0xF8,0x50,0x50,0x00, 5, // 0x24 '$' 0x00,0x40,0x60,0x90,0x80,0x60,0x10,0x90,0x60,0x20,0x00, 5, // 0x25 '%' 0x00,0x00,0x90,0x90,0x20,0x20,0x40,0x40,0x90,0x90,0x00, 5, // 0x26 '&' 0x00,0x40,0xA0,0xA0,0x40,0xA8,0x90,0x90,0x68,0x00,0x00, 5, // 0x27 ''' 0x00,0x20,0x20,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 5, // 0x28 '(' 0x00,0x10,0x20,0x20,0x40,0x40,0x40,0x40,0x20,0x20,0x10, 5, // 0x29 ')' 0x00,0x40,0x20,0x20,0x10,0x10,0x10,0x10,0x20,0x20,0x40, 5, // 0x2A '*' 0x00,0x00,0x90,0x60,0xF0,0x60,0x90,0x00,0x00,0x00,0x00, 5, // 0x2B '+' 0x00,0x00,0x00,0x20,0x20,0xF8,0x20,0x20,0x00,0x00,0x00, 5, // 0x2C ',' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x60,0x40,0x80, 5, // 0x2D '-' 0x00,0x00,0x00,0x00,0x00,0xF0,0x00,0x00,0x00,0x00,0x00, 5, // 0x2E '.' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x60,0x00,0x00, 5, // 0x2F '/' 0x08,0x08,0x10,0x10,0x20,0x20,0x40,0x40,0x80,0x80,0x00, 5, // 0x30 '0' 0x00,0x70,0x90,0x90,0x90,0x90,0x90,0x90,0xE0,0x00,0x00, 5, // 0x31 '1' 0x00,0x20,0x60,0x20,0x20,0x20,0x20,0x20,0x70,0x00,0x00, 5, // 0x32 '2' 0x00,0x60,0x90,0x90,0x10,0x20,0x40,0x80,0xF0,0x00,0x00, 5, // 0x33 '3' 0x00,0x60,0x90,0x10,0x60,0x10,0x10,0x90,0x60,0x00,0x00, 5, // 0x34 '4' 0x00,0x10,0x30,0x50,0x50,0x90,0xF8,0x10,0x10,0x00,0x00, 5, // 0x35 '5' 0x00,0xF0,0x80,0xE0,0x90,0x10,0x10,0x90,0x60,0x00,0x00, 5, // 0x36 '6' 0x00,0x60,0x90,0x80,0xE0,0x90,0x90,0x90,0x60,0x00,0x00, 5, // 0x37 '7' 0x00,0xF0,0x10,0x10,0x20,0x20,0x40,0x40,0x40,0x00,0x00, 5, // 0x38 '8' 0x00,0x60,0x90,0x90,0x60,0x90,0x90,0x90,0x60,0x00,0x00, 5, // 0x39 '9' 0x00,0x60,0x90,0x90,0x90,0x70,0x10,0x90,0x60,0x00,0x00, 5, // 0x3A ':' 0x00,0x00,0x00,0x60,0x60,0x00,0x00,0x60,0x60,0x00,0x00, 5, // 0x3B ';' 0x00,0x00,0x00,0x60,0x60,0x00,0x00,0x60,0x60,0x40,0x80, 5, // 0x3C '<' 0x00,0x08,0x10,0x20,0x40,0x80,0x40,0x20,0x10,0x08,0x00, 5, // 0x3D '=' 0x00,0x00,0x00,0x00,0xF0,0x00,0x00,0xF0,0x00,0x00,0x00, 5, // 0x3E '>' 0x00,0x80,0x40,0x20,0x10,0x08,0x10,0x20,0x40,0x80,0x00, 5, // 0x3F '?' 0x00,0x60,0x90,0x10,0x10,0x20,0x40,0x00,0x40,0x00,0x00, 5, // 0x40 '@' 0x00,0x60,0x90,0x90,0xB0,0xB0,0x80,0x80,0x70,0x00,0x00, 5, // 0x41 'A' 0x00,0x60,0x90,0x90,0x90,0xF0,0x90,0x90,0x90,0x00,0x00, 5, // 0x42 'B' 0x00,0xE0,0x90,0x90,0xE0,0x90,0x90,0x90,0xE0,0x00,0x00, 5, // 0x43 'C' 0x00,0x60,0x90,0x80,0x80,0x80,0x80,0x90,0x60,0x00,0x00, 5, // 0x44 'D' 0x00,0xE0,0x90,0x90,0x90,0x90,0x90,0x90,0xE0,0x00,0x00, 5, // 0x45 'E' 0x00,0xF0,0x80,0x80,0xE0,0x80,0x80,0x80,0xF0,0x00,0x00, 5, // 0x46 'F' 0x00,0xF0,0x80,0x80,0xE0,0x80,0x80,0x80,0x80,0x00,0x00, 5, // 0x47 'G' 0x00,0x60,0x90,0x80,0x80,0xB0,0x90,0x90,0x60,0x00,0x00, 5, // 0x48 'H' 0x00,0x90,0x90,0x90,0xF0,0x90,0x90,0x90,0x90,0x00,0x00, 5, // 0x49 'I' 0x00,0x70,0x20,0x20,0x20,0x20,0x20,0x20,0x70,0x00,0x00, 5, // 0x4A 'J' 0x00,0x70,0x20,0x20,0x20,0x20,0xA0,0xA0,0x40,0x00,0x00, 5, // 0x4B 'K' 0x00,0x90,0xA0,0xA0,0xC0,0xA0,0xA0,0x90,0x90,0x00,0x00, 5, // 0x4C 'L' 0x00,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0xF0,0x00,0x00, 5, // 0x4D 'M' 0x00,0x90,0xF0,0xF0,0x90,0x90,0x90,0x90,0x90,0x00,0x00, 5, // 0x4E 'N' 0x00,0x90,0x90,0xD0,0xD0,0xB0,0xB0,0x90,0x90,0x00,0x00, 5, // 0x4F 'O' 0x00,0x60,0x90,0x90,0x90,0x90,0x90,0x90,0x60,0x00,0x00, 5, // 0x50 'P' 0x00,0xE0,0x90,0x90,0x90,0xE0,0x80,0x80,0x80,0x00,0x00, 5, // 0x51 'Q' 0x00,0x60,0x90,0x90,0x90,0x90,0x90,0x90,0x60,0x30,0x00, 5, // 0x52 'R' 0x00,0xE0,0x90,0x90,0x90,0xE0,0xA0,0x90,0x90,0x00,0x00, 5, // 0x53 'S' 0x00,0x60,0x90,0x80,0x60,0x10,0x90,0x90,0x60,0x00,0x00, 5, // 0x54 'T' 0x00,0xF8,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x00,0x00, 5, // 0x55 'U' 0x00,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x60,0x00,0x00, 5, // 0x56 'V' 0x00,0x90,0x90,0x90,0x50,0x50,0x50,0x20,0x20,0x00,0x00, 5, // 0x57 'W' 0x00,0x90,0x90,0x90,0x90,0x90,0xF0,0xF0,0x90,0x00,0x00, 5, // 0x58 'X' 0x00,0x90,0x90,0x90,0x60,0x60,0x90,0x90,0x90,0x00,0x00, 5, // 0x59 'Y' 0x00,0x88,0x88,0x88,0x50,0x20,0x20,0x20,0x20,0x00,0x00, 5, // 0x5A 'Z' 0x00,0xF0,0x10,0x20,0x20,0x40,0x40,0x80,0xF0,0x00,0x00, 5, // 0x5B '[' 0x00,0x60,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x60, 5, // 0x5C '\' 0x80,0x80,0x40,0x40,0x20,0x20,0x10,0x10,0x08,0x08,0x00, 5, // 0x5D ']' 0x00,0x60,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x60, 5, // 0x5E '^' 0x00,0x20,0x50,0x88,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 5, // 0x5F '_' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF0,0x00,0x00, 5, // 0x60 '`' 0x00,0x40,0x40,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 5, // 0x61 'a' 0x00,0x00,0x00,0x60,0x10,0x70,0x90,0x90,0x70,0x00,0x00, 5, // 0x62 'b' 0x00,0x80,0x80,0xE0,0x90,0x90,0x90,0x90,0xE0,0x00,0x00, 5, // 0x63 'c' 0x00,0x00,0x00,0x60,0x90,0x80,0x80,0x90,0x60,0x00,0x00, 5, // 0x64 'd' 0x00,0x10,0x10,0x70,0x90,0x90,0x90,0x90,0x70,0x00,0x00, 5, // 0x65 'e' 0x00,0x00,0x00,0x60,0x90,0x90,0xF0,0x80,0x70,0x00,0x00, 5, // 0x66 'f' 0x00,0x30,0x40,0xE0,0x40,0x40,0x40,0x40,0x40,0x00,0x00, 5, // 0x67 'g' 0x00,0x00,0x00,0x70,0x90,0x90,0x90,0x90,0x70,0x10,0xE0, 5, // 0x68 'h' 0x00,0x80,0x80,0xE0,0x90,0x90,0x90,0x90,0x90,0x00,0x00, 5, // 0x69 'i' 0x00,0x20,0x00,0x60,0x20,0x20,0x20,0x20,0x70,0x00,0x00, 5, // 0x6A 'j' 0x00,0x20,0x00,0x60,0x20,0x20,0x20,0x20,0x20,0xA0,0x40, 5, // 0x6B 'k' 0x00,0x80,0x80,0x90,0xA0,0xC0,0xA0,0x90,0x90,0x00,0x00, 5, // 0x6C 'l' 0x00,0x60,0x20,0x20,0x20,0x20,0x20,0x20,0x70,0x00,0x00, 5, // 0x6D 'm' 0x00,0x00,0x00,0x90,0xF0,0x90,0x90,0x90,0x90,0x00,0x00, 5, // 0x6E 'n' 0x00,0x00,0x00,0xE0,0x90,0x90,0x90,0x90,0x90,0x00,0x00, 5, // 0x6F 'o' 0x00,0x00,0x00,0x60,0x90,0x90,0x90,0x90,0x60,0x00,0x00, 5, // 0x70 'p' 0x00,0x00,0x00,0xE0,0x90,0x90,0x90,0x90,0xE0,0x80,0x80, 5, // 0x71 'q' 0x00,0x00,0x00,0x70,0x90,0x90,0x90,0x90,0x70,0x10,0x10, 5, // 0x72 'r' 0x00,0x00,0x00,0xA0,0x50,0x40,0x40,0x40,0xE0,0x00,0x00, 5, // 0x73 's' 0x00,0x00,0x00,0x60,0x90,0x40,0x20,0x90,0x60,0x00,0x00, 5, // 0x74 't' 0x00,0x40,0x40,0xE0,0x40,0x40,0x40,0x40,0x30,0x00,0x00, 5, // 0x75 'u' 0x00,0x00,0x00,0x90,0x90,0x90,0x90,0x90,0x70,0x00,0x00, 5, // 0x76 'v' 0x00,0x00,0x00,0x90,0x90,0x50,0x50,0x20,0x20,0x00,0x00, 5, // 0x77 'w' 0x00,0x00,0x00,0x90,0x90,0x90,0x90,0xF0,0x90,0x00,0x00, 5, // 0x78 'x' 0x00,0x00,0x00,0x90,0x90,0x60,0x60,0x90,0x90,0x00,0x00, 5, // 0x79 'y' 0x00,0x00,0x00,0x90,0x90,0x90,0x90,0x90,0x70,0x10,0xE0, 5, // 0x7A 'z' 0x00,0x00,0x00,0xF0,0x10,0x20,0x40,0x80,0xF0,0x00,0x00, 5, // 0x7B '{' 0x30,0x40,0x40,0x40,0x40,0x80,0x40,0x40,0x40,0x40,0x30, 5, // 0x7C '|' 0x00,0x20,0x20,0x20,0x20,0x00,0x20,0x20,0x20,0x20,0x00, 5, // 0x7D '}' 0xC0,0x20,0x20,0x20,0x20,0x10,0x20,0x20,0x20,0x20,0xC0, 5, // 0x7E '~' 0x00,0x40,0xA8,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 5, // 0x7F '' 0x00,0x20,0x70,0xD8,0x88,0x88,0xF8,0x00,0x00,0x00,0x00, 0 }; 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, 0x63,0x00,0x6E,0x00,0x79,0x00,0x84,0x00,0x8F,0x00,0x9A,0x00,0xA5,0x00,0xB0,0x00,0xBB,0x00, 0xC6,0x00,0xD1,0x00,0xDC,0x00,0xE7,0x00,0xF2,0x00,0xFD,0x00,0x08,0x01,0x13,0x01,0x1E,0x01, 0x29,0x01,0x34,0x01,0x3F,0x01,0x4A,0x01,0x55,0x01,0x60,0x01,0x6B,0x01,0x76,0x01,0x81,0x01, 0x8C,0x01,0x97,0x01,0xA2,0x01,0xAD,0x01,0xB8,0x01,0xC3,0x01,0xCE,0x01,0xD9,0x01,0xE4,0x01, 0xEF,0x01,0xFA,0x01,0x05,0x02,0x10,0x02,0x1B,0x02,0x26,0x02,0x31,0x02,0x3C,0x02,0x47,0x02, 0x52,0x02,0x5D,0x02,0x68,0x02,0x73,0x02,0x7E,0x02,0x89,0x02,0x94,0x02,0x9F,0x02,0xAA,0x02, 0xB5,0x02,0xC0,0x02,0xCB,0x02,0xD6,0x02,0xE1,0x02,0xEC,0x02,0xF7,0x02,0x02,0x03,0x0D,0x03, 0x18,0x03,0x23,0x03,0x2E,0x03,0x39,0x03,0x44,0x03,0x4F,0x03,0x5A,0x03,0x65,0x03,0x70,0x03, 0x7B,0x03,0x86,0x03,0x91,0x03,0x9C,0x03,0xA7,0x03,0xB2,0x03,0xBD,0x03,0xC8,0x03,0xD3,0x03, 0xDE,0x03,0xE9,0x03,0xF4,0x03,0xFF,0x03,0x0A,0x04,0x15,0x04, 6, // 0x20 ' ' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 6, // 0x21 '!' 0x00,0x10,0x10,0x10,0x10,0x10,0x00,0x10,0x00,0x00, 6, // 0x22 '"' 0x00,0x28,0x28,0x50,0x00,0x00,0x00,0x00,0x00,0x00, 6, // 0x23 '#' 0x00,0x28,0x28,0x7C,0x28,0x28,0x7C,0x28,0x28,0x00, 6, // 0x24 '$' 0x10,0x38,0x54,0x50,0x38,0x14,0x54,0x38,0x10,0x00, 6, // 0x25 '%' 0x00,0x08,0xC8,0xD0,0x10,0x20,0x2C,0x4C,0x40,0x00, 6, // 0x26 '&' 0x00,0x20,0x50,0x50,0x24,0x54,0x48,0x34,0x00,0x00, 6, // 0x27 ''' 0x00,0x10,0x10,0x20,0x00,0x00,0x00,0x00,0x00,0x00, 6, // 0x28 '(' 0x08,0x10,0x10,0x20,0x20,0x20,0x10,0x10,0x08,0x00, 6, // 0x29 ')' 0x20,0x10,0x10,0x08,0x08,0x08,0x10,0x10,0x20,0x00, 6, // 0x2A '*' 0x00,0x00,0x28,0x7C,0x38,0x7C,0x28,0x00,0x00,0x00, 6, // 0x2B '+' 0x00,0x00,0x10,0x10,0x7C,0x10,0x10,0x00,0x00,0x00, 6, // 0x2C ',' 0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x20,0x40, 6, // 0x2D '-' 0x00,0x00,0x00,0x00,0x7C,0x00,0x00,0x00,0x00,0x00, 6, // 0x2E '.' 0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x00,0x00, 6, // 0x2F '/' 0x00,0x08,0x08,0x10,0x10,0x20,0x20,0x40,0x40,0x00, 6, // 0x30 '0' 0x00,0x38,0x44,0x4C,0x54,0x64,0x44,0x38,0x00,0x00, 6, // 0x31 '1' 0x00,0x10,0x30,0x10,0x10,0x10,0x10,0x38,0x00,0x00, 6, // 0x32 '2' 0x00,0x38,0x44,0x04,0x18,0x20,0x40,0x7C,0x00,0x00, 6, // 0x33 '3' 0x00,0x38,0x44,0x04,0x38,0x04,0x44,0x38,0x00,0x00, 6, // 0x34 '4' 0x00,0x08,0x18,0x28,0x48,0x7C,0x08,0x08,0x00,0x00, 6, // 0x35 '5' 0x00,0x7C,0x40,0x40,0x78,0x04,0x44,0x38,0x00,0x00, 6, // 0x36 '6' 0x00,0x38,0x40,0x40,0x78,0x44,0x44,0x38,0x00,0x00, 6, // 0x37 '7' 0x00,0x7C,0x04,0x08,0x10,0x20,0x20,0x20,0x00,0x00, 6, // 0x38 '8' 0x00,0x38,0x44,0x44,0x38,0x44,0x44,0x38,0x00,0x00, 6, // 0x39 '9' 0x00,0x38,0x44,0x44,0x3C,0x04,0x04,0x38,0x00,0x00, 6, // 0x3A ':' 0x00,0x00,0x30,0x30,0x00,0x00,0x30,0x30,0x00,0x00, 6, // 0x3B ';' 0x00,0x00,0x30,0x30,0x00,0x00,0x30,0x30,0x20,0x40, 6, // 0x3C '<' 0x04,0x08,0x10,0x20,0x40,0x20,0x10,0x08,0x04,0x00, 6, // 0x3D '=' 0x00,0x00,0x00,0x7C,0x00,0x00,0x7C,0x00,0x00,0x00, 6, // 0x3E '>' 0x40,0x20,0x10,0x08,0x04,0x08,0x10,0x20,0x40,0x00, 6, // 0x3F '?' 0x00,0x38,0x44,0x04,0x18,0x10,0x00,0x10,0x00,0x00, 6, // 0x40 '@' 0x00,0x38,0x44,0x5C,0x54,0x5C,0x40,0x38,0x00,0x00, 6, // 0x41 'A' 0x00,0x38,0x44,0x44,0x44,0x7C,0x44,0x44,0x00,0x00, 6, // 0x42 'B' 0x00,0x78,0x44,0x44,0x78,0x44,0x44,0x78,0x00,0x00, 6, // 0x43 'C' 0x00,0x38,0x44,0x40,0x40,0x40,0x44,0x38,0x00,0x00, 6, // 0x44 'D' 0x00,0x78,0x44,0x44,0x44,0x44,0x44,0x78,0x00,0x00, 6, // 0x45 'E' 0x00,0x7C,0x40,0x40,0x78,0x40,0x40,0x7C,0x00,0x00, 6, // 0x46 'F' 0x00,0x7C,0x40,0x40,0x78,0x40,0x40,0x40,0x00,0x00, 6, // 0x47 'G' 0x00,0x38,0x44,0x40,0x4C,0x44,0x44,0x3C,0x00,0x00, 6, // 0x48 'H' 0x00,0x44,0x44,0x44,0x7C,0x44,0x44,0x44,0x00,0x00, 6, // 0x49 'I' 0x00,0x38,0x10,0x10,0x10,0x10,0x10,0x38,0x00,0x00, 6, // 0x4A 'J' 0x00,0x1C,0x08,0x08,0x08,0x48,0x48,0x30,0x00,0x00, 6, // 0x4B 'K' 0x00,0x44,0x48,0x50,0x60,0x50,0x48,0x44,0x00,0x00, 6, // 0x4C 'L' 0x00,0x40,0x40,0x40,0x40,0x40,0x40,0x7C,0x00,0x00, 6, // 0x4D 'M' 0x00,0x44,0x6C,0x54,0x54,0x44,0x44,0x44,0x00,0x00, 6, // 0x4E 'N' 0x00,0x44,0x44,0x64,0x54,0x4C,0x44,0x44,0x00,0x00, 6, // 0x4F 'O' 0x00,0x38,0x44,0x44,0x44,0x44,0x44,0x38,0x00,0x00, 6, // 0x50 'P' 0x00,0x78,0x44,0x44,0x78,0x40,0x40,0x40,0x00,0x00, 6, // 0x51 'Q' 0x00,0x38,0x44,0x44,0x44,0x54,0x48,0x34,0x00,0x00, 6, // 0x52 'R' 0x00,0x78,0x44,0x44,0x78,0x48,0x44,0x44,0x00,0x00, 6, // 0x53 'S' 0x00,0x38,0x44,0x40,0x38,0x04,0x44,0x38,0x00,0x00, 6, // 0x54 'T' 0x00,0x7C,0x10,0x10,0x10,0x10,0x10,0x10,0x00,0x00, 6, // 0x55 'U' 0x00,0x44,0x44,0x44,0x44,0x44,0x44,0x38,0x00,0x00, 6, // 0x56 'V' 0x00,0x44,0x44,0x44,0x44,0x28,0x28,0x10,0x00,0x00, 6, // 0x57 'W' 0x00,0x44,0x44,0x54,0x54,0x54,0x54,0x28,0x00,0x00, 6, // 0x58 'X' 0x00,0x44,0x44,0x28,0x10,0x28,0x44,0x44,0x00,0x00, 6, // 0x59 'Y' 0x00,0x44,0x44,0x44,0x28,0x10,0x10,0x10,0x00,0x00, 6, // 0x5A 'Z' 0x00,0x78,0x08,0x10,0x20,0x40,0x40,0x78,0x00,0x00, 6, // 0x5B '[' 0x38,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x38,0x00, 6, // 0x5C '\' 0x00,0x40,0x40,0x20,0x20,0x10,0x10,0x08,0x08,0x00, 6, // 0x5D ']' 0x38,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x38,0x00, 6, // 0x5E '^' 0x10,0x28,0x44,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 6, // 0x5F '_' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x00,0x00, 6, // 0x60 '`' 0x00,0x10,0x10,0x20,0x00,0x00,0x00,0x00,0x00,0x00, 6, // 0x61 'a' 0x00,0x00,0x00,0x38,0x04,0x3C,0x44,0x3C,0x00,0x00, 6, // 0x62 'b' 0x00,0x40,0x40,0x78,0x44,0x44,0x44,0x78,0x00,0x00, 6, // 0x63 'c' 0x00,0x00,0x00,0x38,0x44,0x40,0x40,0x3C,0x00,0x00, 6, // 0x64 'd' 0x00,0x04,0x04,0x3C,0x44,0x44,0x44,0x3C,0x00,0x00, 6, // 0x65 'e' 0x00,0x00,0x00,0x38,0x44,0x78,0x40,0x3C,0x00,0x00, 6, // 0x66 'f' 0x00,0x0C,0x10,0x10,0x38,0x10,0x10,0x10,0x00,0x00, 6, // 0x67 'g' 0x00,0x00,0x00,0x3C,0x44,0x44,0x44,0x3C,0x04,0x38, 6, // 0x68 'h' 0x00,0x40,0x40,0x78,0x44,0x44,0x44,0x44,0x00,0x00, 6, // 0x69 'i' 0x00,0x10,0x00,0x30,0x10,0x10,0x10,0x38,0x00,0x00, 6, // 0x6A 'j' 0x00,0x08,0x00,0x18,0x08,0x08,0x08,0x08,0x48,0x30, 6, // 0x6B 'k' 0x00,0x40,0x40,0x48,0x50,0x60,0x50,0x48,0x00,0x00, 6, // 0x6C 'l' 0x00,0x30,0x10,0x10,0x10,0x10,0x10,0x38,0x00,0x00, 6, // 0x6D 'm' 0x00,0x00,0x00,0x68,0x54,0x54,0x44,0x44,0x00,0x00, 6, // 0x6E 'n' 0x00,0x00,0x00,0x58,0x64,0x44,0x44,0x44,0x00,0x00, 6, // 0x6F 'o' 0x00,0x00,0x00,0x38,0x44,0x44,0x44,0x38,0x00,0x00, 6, // 0x70 'p' 0x00,0x00,0x00,0x78,0x44,0x44,0x44,0x78,0x40,0x40, 6, // 0x71 'q' 0x00,0x00,0x00,0x3C,0x44,0x44,0x44,0x3C,0x04,0x04, 6, // 0x72 'r' 0x00,0x00,0x00,0x58,0x24,0x20,0x20,0x70,0x00,0x00, 6, // 0x73 's' 0x00,0x00,0x00,0x38,0x40,0x38,0x04,0x78,0x00,0x00, 6, // 0x74 't' 0x00,0x10,0x10,0x38,0x10,0x10,0x14,0x08,0x00,0x00, 6, // 0x75 'u' 0x00,0x00,0x00,0x44,0x44,0x44,0x4C,0x34,0x00,0x00, 6, // 0x76 'v' 0x00,0x00,0x00,0x44,0x44,0x44,0x28,0x10,0x00,0x00, 6, // 0x77 'w' 0x00,0x00,0x00,0x44,0x44,0x54,0x7C,0x28,0x00,0x00, 6, // 0x78 'x' 0x00,0x00,0x00,0x48,0x48,0x30,0x48,0x48,0x00,0x00, 6, // 0x79 'y' 0x00,0x00,0x00,0x44,0x44,0x44,0x44,0x3C,0x04,0x38, 6, // 0x7A 'z' 0x00,0x00,0x00,0x78,0x08,0x30,0x40,0x78,0x00,0x00, 6, // 0x7B '{' 0x18,0x20,0x20,0x20,0xC0,0x20,0x20,0x20,0x18,0x00, 6, // 0x7C '|' 0x10,0x10,0x10,0x10,0x00,0x10,0x10,0x10,0x10,0x00, 6, // 0x7D '}' 0x60,0x10,0x10,0x10,0x0C,0x10,0x10,0x10,0x60,0x00, 6, // 0x7E '~' 0x00,0x48,0xA8,0x90,0x00,0x00,0x00,0x00,0x00,0x00, 6, // 0x7F '' 0x00,0x10,0x38,0x6C,0x44,0x44,0x7C,0x00,0x00,0x00, 0 }; 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, 0x6C,0x00,0x78,0x00,0x84,0x00,0x90,0x00,0x9C,0x00,0xA8,0x00,0xB4,0x00,0xC0,0x00,0xCC,0x00, 0xD8,0x00,0xE4,0x00,0xF0,0x00,0xFC,0x00,0x08,0x01,0x14,0x01,0x20,0x01,0x2C,0x01,0x38,0x01, 0x44,0x01,0x50,0x01,0x5C,0x01,0x68,0x01,0x74,0x01,0x80,0x01,0x8C,0x01,0x98,0x01,0xA4,0x01, 0xB0,0x01,0xBC,0x01,0xC8,0x01,0xD4,0x01,0xE0,0x01,0xEC,0x01,0xF8,0x01,0x04,0x02,0x10,0x02, 0x1C,0x02,0x28,0x02,0x34,0x02,0x40,0x02,0x4C,0x02,0x58,0x02,0x64,0x02,0x70,0x02,0x7C,0x02, 0x88,0x02,0x94,0x02,0xA0,0x02,0xAC,0x02,0xB8,0x02,0xC4,0x02,0xD0,0x02,0xDC,0x02,0xE8,0x02, 0xF4,0x02,0x00,0x03,0x0C,0x03,0x18,0x03,0x24,0x03,0x30,0x03,0x3C,0x03,0x48,0x03,0x54,0x03, 0x60,0x03,0x6C,0x03,0x78,0x03,0x84,0x03,0x90,0x03,0x9C,0x03,0xA8,0x03,0xB4,0x03,0xC0,0x03, 0xCC,0x03,0xD8,0x03,0xE4,0x03,0xF0,0x03,0xFC,0x03,0x08,0x04,0x14,0x04,0x20,0x04,0x2C,0x04, 0x38,0x04,0x44,0x04,0x50,0x04,0x5C,0x04,0x68,0x04,0x74,0x04, 6, // 0x20 ' ' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 6, // 0x21 '!' 0x00,0x20,0x20,0x20,0x20,0x20,0x20,0x00,0x20,0x00,0x00, 6, // 0x22 '"' 0x00,0x28,0x28,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 6, // 0x23 '#' 0x00,0x28,0x28,0x7C,0x28,0x28,0x7C,0x28,0x28,0x00,0x00, 6, // 0x24 '$' 0x00,0x10,0x38,0x54,0x50,0x38,0x14,0x54,0x38,0x10,0x00, 6, // 0x25 '%' 0x00,0x68,0xA8,0xD0,0x10,0x20,0x2C,0x54,0x58,0x00,0x00, 6, // 0x26 '&' 0x00,0x20,0x50,0x50,0x20,0x54,0x54,0x48,0x34,0x00,0x00, 6, // 0x27 ''' 0x00,0x10,0x10,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 6, // 0x28 '(' 0x08,0x10,0x10,0x20,0x20,0x20,0x20,0x10,0x10,0x08,0x00, 6, // 0x29 ')' 0x20,0x10,0x10,0x08,0x08,0x08,0x08,0x10,0x10,0x20,0x00, 6, // 0x2A '*' 0x00,0x00,0x28,0x7C,0x38,0x7C,0x28,0x00,0x00,0x00,0x00, 6, // 0x2B '+' 0x00,0x00,0x00,0x10,0x10,0x7C,0x10,0x10,0x00,0x00,0x00, 6, // 0x2C ',' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x20,0x40, 6, // 0x2D '-' 0x00,0x00,0x00,0x00,0x00,0x7C,0x00,0x00,0x00,0x00,0x00, 6, // 0x2E '.' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x00,0x00, 6, // 0x2F '/' 0x04,0x04,0x08,0x08,0x10,0x10,0x20,0x20,0x40,0x40,0x00, 6, // 0x30 '0' 0x00,0x38,0x44,0x44,0x54,0x54,0x44,0x44,0x38,0x00,0x00, 6, // 0x31 '1' 0x00,0x10,0x30,0x10,0x10,0x10,0x10,0x10,0x38,0x00,0x00, 6, // 0x32 '2' 0x00,0x38,0x44,0x44,0x08,0x10,0x20,0x40,0x7C,0x00,0x00, 6, // 0x33 '3' 0x00,0x38,0x44,0x04,0x38,0x04,0x04,0x44,0x38,0x00,0x00, 6, // 0x34 '4' 0x00,0x08,0x18,0x28,0x28,0x48,0x7C,0x08,0x08,0x00,0x00, 6, // 0x35 '5' 0x00,0x7C,0x40,0x78,0x44,0x04,0x04,0x44,0x38,0x00,0x00, 6, // 0x36 '6' 0x00,0x38,0x44,0x40,0x78,0x44,0x44,0x44,0x38,0x00,0x00, 6, // 0x37 '7' 0x00,0x7C,0x04,0x08,0x08,0x10,0x10,0x20,0x20,0x00,0x00, 6, // 0x38 '8' 0x00,0x38,0x44,0x44,0x38,0x44,0x44,0x44,0x38,0x00,0x00, 6, // 0x39 '9' 0x00,0x38,0x44,0x44,0x3C,0x04,0x04,0x44,0x38,0x00,0x00, 6, // 0x3A ':' 0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x30,0x30,0x00,0x00, 6, // 0x3B ';' 0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x30,0x30,0x20,0x40, 6, // 0x3C '<' 0x00,0x04,0x08,0x10,0x20,0x40,0x20,0x10,0x08,0x04,0x00, 6, // 0x3D '=' 0x00,0x00,0x00,0x00,0x7C,0x00,0x00,0x7C,0x00,0x00,0x00, 6, // 0x3E '>' 0x00,0x40,0x20,0x10,0x08,0x04,0x08,0x10,0x20,0x40,0x00, 6, // 0x3F '?' 0x00,0x38,0x44,0x04,0x08,0x10,0x10,0x00,0x10,0x00,0x00, 6, // 0x40 '@' 0x00,0x38,0x44,0x5C,0x54,0x54,0x4C,0x40,0x38,0x00,0x00, 6, // 0x41 'A' 0x00,0x38,0x44,0x44,0x44,0x7C,0x44,0x44,0x44,0x00,0x00, 6, // 0x42 'B' 0x00,0x78,0x44,0x44,0x78,0x44,0x44,0x44,0x78,0x00,0x00, 6, // 0x43 'C' 0x00,0x38,0x44,0x40,0x40,0x40,0x40,0x44,0x38,0x00,0x00, 6, // 0x44 'D' 0x00,0x70,0x48,0x44,0x44,0x44,0x44,0x48,0x70,0x00,0x00, 6, // 0x45 'E' 0x00,0x7C,0x40,0x40,0x78,0x40,0x40,0x40,0x7C,0x00,0x00, 6, // 0x46 'F' 0x00,0x7C,0x40,0x40,0x78,0x40,0x40,0x40,0x40,0x00,0x00, 6, // 0x47 'G' 0x00,0x38,0x44,0x40,0x40,0x5C,0x44,0x4C,0x34,0x00,0x00, 6, // 0x48 'H' 0x00,0x44,0x44,0x44,0x7C,0x44,0x44,0x44,0x44,0x00,0x00, 6, // 0x49 'I' 0x00,0x38,0x10,0x10,0x10,0x10,0x10,0x10,0x38,0x00,0x00, 6, // 0x4A 'J' 0x00,0x1C,0x08,0x08,0x08,0x08,0x48,0x48,0x30,0x00,0x00, 6, // 0x4B 'K' 0x00,0x44,0x48,0x50,0x60,0x50,0x48,0x44,0x44,0x00,0x00, 6, // 0x4C 'L' 0x00,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x7C,0x00,0x00, 6, // 0x4D 'M' 0x00,0x44,0x6C,0x54,0x54,0x54,0x44,0x44,0x44,0x00,0x00, 6, // 0x4E 'N' 0x00,0x44,0x64,0x64,0x54,0x54,0x4C,0x4C,0x44,0x00,0x00, 6, // 0x4F 'O' 0x00,0x38,0x44,0x44,0x44,0x44,0x44,0x44,0x38,0x00,0x00, 6, // 0x50 'P' 0x00,0x78,0x44,0x44,0x44,0x78,0x40,0x40,0x40,0x00,0x00, 6, // 0x51 'Q' 0x00,0x38,0x44,0x44,0x44,0x44,0x54,0x48,0x34,0x00,0x00, 6, // 0x52 'R' 0x00,0x78,0x44,0x44,0x44,0x78,0x48,0x44,0x44,0x00,0x00, 6, // 0x53 'S' 0x00,0x38,0x44,0x40,0x38,0x04,0x04,0x44,0x38,0x00,0x00, 6, // 0x54 'T' 0x00,0x7C,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x00,0x00, 6, // 0x55 'U' 0x00,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x38,0x00,0x00, 6, // 0x56 'V' 0x00,0x44,0x44,0x44,0x28,0x28,0x28,0x10,0x10,0x00,0x00, 6, // 0x57 'W' 0x00,0x44,0x44,0x54,0x54,0x54,0x54,0x54,0x28,0x00,0x00, 6, // 0x58 'X' 0x00,0x44,0x44,0x28,0x10,0x28,0x44,0x44,0x44,0x00,0x00, 6, // 0x59 'Y' 0x00,0x44,0x44,0x44,0x28,0x10,0x10,0x10,0x10,0x00,0x00, 6, // 0x5A 'Z' 0x00,0x7C,0x04,0x08,0x10,0x20,0x40,0x40,0x7C,0x00,0x00, 6, // 0x5B '[' 0x38,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x38,0x00, 6, // 0x5C '\' 0x80,0x80,0x40,0x40,0x20,0x20,0x10,0x10,0x08,0x08,0x00, 6, // 0x5D ']' 0x38,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x38,0x00, 6, // 0x5E '^' 0x00,0x10,0x28,0x44,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 6, // 0x5F '_' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x00,0x00, 6, // 0x60 '`' 0x00,0x20,0x20,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 6, // 0x61 'a' 0x00,0x00,0x00,0x38,0x04,0x3C,0x44,0x44,0x3C,0x00,0x00, 6, // 0x62 'b' 0x00,0x40,0x40,0x78,0x44,0x44,0x44,0x44,0x78,0x00,0x00, 6, // 0x63 'c' 0x00,0x00,0x00,0x38,0x44,0x40,0x40,0x44,0x38,0x00,0x00, 6, // 0x64 'd' 0x00,0x04,0x04,0x3C,0x44,0x44,0x44,0x44,0x3C,0x00,0x00, 6, // 0x65 'e' 0x00,0x00,0x00,0x38,0x44,0x7C,0x40,0x44,0x38,0x00,0x00, 6, // 0x66 'f' 0x00,0x0C,0x10,0x38,0x10,0x10,0x10,0x10,0x10,0x00,0x00, 6, // 0x67 'g' 0x00,0x00,0x00,0x3C,0x44,0x44,0x44,0x44,0x3C,0x04,0x78, 6, // 0x68 'h' 0x00,0x40,0x40,0x78,0x44,0x44,0x44,0x44,0x44,0x00,0x00, 6, // 0x69 'i' 0x00,0x10,0x00,0x30,0x10,0x10,0x10,0x10,0x38,0x00,0x00, 6, // 0x6A 'j' 0x00,0x10,0x00,0x30,0x10,0x10,0x10,0x10,0x10,0x50,0x20, 6, // 0x6B 'k' 0x00,0x40,0x40,0x4C,0x50,0x60,0x50,0x48,0x44,0x00,0x00, 6, // 0x6C 'l' 0x00,0x30,0x10,0x10,0x10,0x10,0x10,0x10,0x38,0x00,0x00, 6, // 0x6D 'm' 0x00,0x00,0x00,0x68,0x54,0x54,0x54,0x44,0x44,0x00,0x00, 6, // 0x6E 'n' 0x00,0x00,0x00,0x78,0x44,0x44,0x44,0x44,0x44,0x00,0x00, 6, // 0x6F 'o' 0x00,0x00,0x00,0x38,0x44,0x44,0x44,0x44,0x38,0x00,0x00, 6, // 0x70 'p' 0x00,0x00,0x00,0x78,0x44,0x44,0x44,0x44,0x78,0x40,0x40, 6, // 0x71 'q' 0x00,0x00,0x00,0x3C,0x44,0x44,0x44,0x44,0x3C,0x04,0x04, 6, // 0x72 'r' 0x00,0x00,0x00,0x58,0x24,0x20,0x20,0x20,0x70,0x00,0x00, 6, // 0x73 's' 0x00,0x00,0x00,0x38,0x44,0x30,0x08,0x44,0x38,0x00,0x00, 6, // 0x74 't' 0x00,0x20,0x20,0x70,0x20,0x20,0x20,0x20,0x18,0x00,0x00, 6, // 0x75 'u' 0x00,0x00,0x00,0x44,0x44,0x44,0x44,0x4C,0x34,0x00,0x00, 6, // 0x76 'v' 0x00,0x00,0x00,0x44,0x44,0x28,0x28,0x10,0x10,0x00,0x00, 6, // 0x77 'w' 0x00,0x00,0x00,0x44,0x44,0x44,0x54,0x7C,0x28,0x00,0x00, 6, // 0x78 'x' 0x00,0x00,0x00,0x44,0x28,0x10,0x28,0x44,0x44,0x00,0x00, 6, // 0x79 'y' 0x00,0x00,0x00,0x44,0x44,0x44,0x44,0x44,0x3C,0x08,0x70, 6, // 0x7A 'z' 0x00,0x00,0x00,0x7C,0x08,0x10,0x20,0x40,0x7C,0x00,0x00, 6, // 0x7B '{' 0x18,0x20,0x20,0x20,0xC0,0xC0,0x20,0x20,0x20,0x18,0x00, 6, // 0x7C '|' 0x00,0x10,0x10,0x10,0x10,0x00,0x10,0x10,0x10,0x10,0x00, 6, // 0x7D '}' 0x60,0x10,0x10,0x10,0x0C,0x0C,0x10,0x10,0x10,0x60,0x00, 6, // 0x7E '~' 0x00,0x24,0x54,0x48,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 6, // 0x7F '' 0x00,0x10,0x38,0x6C,0x44,0x44,0x7C,0x00,0x00,0x00,0x00, 0 }; 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, 0x75,0x00,0x82,0x00,0x8F,0x00,0x9C,0x00,0xA9,0x00,0xB6,0x00,0xC3,0x00,0xD0,0x00,0xDD,0x00, 0xEA,0x00,0xF7,0x00,0x04,0x01,0x11,0x01,0x1E,0x01,0x2B,0x01,0x38,0x01,0x45,0x01,0x52,0x01, 0x5F,0x01,0x6C,0x01,0x79,0x01,0x86,0x01,0x93,0x01,0xA0,0x01,0xAD,0x01,0xBA,0x01,0xC7,0x01, 0xD4,0x01,0xE1,0x01,0xEE,0x01,0xFB,0x01,0x08,0x02,0x15,0x02,0x22,0x02,0x2F,0x02,0x3C,0x02, 0x49,0x02,0x56,0x02,0x63,0x02,0x70,0x02,0x7D,0x02,0x8A,0x02,0x97,0x02,0xA4,0x02,0xB1,0x02, 0xBE,0x02,0xCB,0x02,0xD8,0x02,0xE5,0x02,0xF2,0x02,0xFF,0x02,0x0C,0x03,0x19,0x03,0x26,0x03, 0x33,0x03,0x40,0x03,0x4D,0x03,0x5A,0x03,0x67,0x03,0x74,0x03,0x81,0x03,0x8E,0x03,0x9B,0x03, 0xA8,0x03,0xB5,0x03,0xC2,0x03,0xCF,0x03,0xDC,0x03,0xE9,0x03,0xF6,0x03,0x03,0x04,0x10,0x04, 0x1D,0x04,0x2A,0x04,0x37,0x04,0x44,0x04,0x51,0x04,0x5E,0x04,0x6B,0x04,0x78,0x04,0x85,0x04, 0x92,0x04,0x9F,0x04,0xAC,0x04,0xB9,0x04,0xC6,0x04,0xD3,0x04, 7, // 0x20 ' ' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 7, // 0x21 '!' 0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x00,0x10,0x00,0x00, 7, // 0x22 '"' 0x28,0x28,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 7, // 0x23 '#' 0x24,0x24,0x24,0x7E,0x24,0x24,0x24,0x7E,0x24,0x24,0x24,0x00, 7, // 0x24 '$' 0x10,0x10,0x38,0x54,0x50,0x38,0x14,0x54,0x38,0x10,0x10,0x00, 7, // 0x25 '%' 0x32,0x54,0x64,0x08,0x08,0x10,0x10,0x26,0x2A,0x4C,0x00,0x00, 7, // 0x26 '&' 0x00,0x20,0x50,0x50,0x50,0x20,0x54,0x54,0x48,0x34,0x00,0x00, 7, // 0x27 ''' 0x10,0x10,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 7, // 0x28 '(' 0x08,0x10,0x10,0x20,0x20,0x20,0x20,0x20,0x10,0x10,0x08,0x00, 7, // 0x29 ')' 0x20,0x10,0x10,0x08,0x08,0x08,0x08,0x08,0x10,0x10,0x20,0x00, 7, // 0x2A '*' 0x00,0x00,0x10,0x54,0x38,0x7C,0x38,0x54,0x10,0x00,0x00,0x00, 7, // 0x2B '+' 0x00,0x00,0x00,0x00,0x10,0x10,0x7C,0x10,0x10,0x00,0x00,0x00, 7, // 0x2C ',' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x20,0x40, 7, // 0x2D '-' 0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x00,0x00,0x00,0x00,0x00, 7, // 0x2E '.' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x00,0x00, 7, // 0x2F '/' 0x04,0x04,0x08,0x08,0x10,0x10,0x20,0x20,0x40,0x40,0x00,0x00, 7, // 0x30 '0' 0x00,0x38,0x44,0x44,0x54,0x54,0x54,0x44,0x44,0x38,0x00,0x00, 7, // 0x31 '1' 0x00,0x10,0x30,0x10,0x10,0x10,0x10,0x10,0x10,0x38,0x00,0x00, 7, // 0x32 '2' 0x00,0x38,0x44,0x04,0x04,0x08,0x10,0x20,0x40,0x7C,0x00,0x00, 7, // 0x33 '3' 0x00,0x38,0x44,0x04,0x04,0x38,0x04,0x04,0x44,0x38,0x00,0x00, 7, // 0x34 '4' 0x00,0x08,0x18,0x28,0x28,0x48,0x48,0x7C,0x08,0x08,0x00,0x00, 7, // 0x35 '5' 0x00,0x7C,0x40,0x40,0x78,0x44,0x04,0x04,0x44,0x38,0x00,0x00, 7, // 0x36 '6' 0x00,0x38,0x44,0x40,0x78,0x44,0x44,0x44,0x44,0x38,0x00,0x00, 7, // 0x37 '7' 0x00,0x7C,0x04,0x08,0x08,0x10,0x10,0x20,0x20,0x20,0x00,0x00, 7, // 0x38 '8' 0x00,0x38,0x44,0x44,0x44,0x38,0x44,0x44,0x44,0x38,0x00,0x00, 7, // 0x39 '9' 0x00,0x38,0x44,0x44,0x44,0x3C,0x04,0x04,0x44,0x38,0x00,0x00, 7, // 0x3A ':' 0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x00,0x30,0x30,0x00,0x00, 7, // 0x3B ';' 0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x00,0x30,0x30,0x20,0x40, 7, // 0x3C '<' 0x00,0x04,0x08,0x10,0x20,0x40,0x20,0x10,0x08,0x04,0x00,0x00, 7, // 0x3D '=' 0x00,0x00,0x00,0x00,0x7C,0x00,0x00,0x7C,0x00,0x00,0x00,0x00, 7, // 0x3E '>' 0x00,0x40,0x20,0x10,0x08,0x04,0x08,0x10,0x20,0x40,0x00,0x00, 7, // 0x3F '?' 0x00,0x38,0x44,0x04,0x04,0x08,0x10,0x10,0x00,0x10,0x00,0x00, 7, // 0x40 '@' 0x00,0x38,0x44,0x44,0x5C,0x54,0x54,0x4C,0x40,0x38,0x00,0x00, 7, // 0x41 'A' 0x00,0x38,0x44,0x44,0x44,0x7C,0x44,0x44,0x44,0x44,0x00,0x00, 7, // 0x42 'B' 0x00,0x78,0x44,0x44,0x44,0x78,0x44,0x44,0x44,0x78,0x00,0x00, 7, // 0x43 'C' 0x00,0x38,0x44,0x40,0x40,0x40,0x40,0x40,0x44,0x38,0x00,0x00, 7, // 0x44 'D' 0x00,0x70,0x48,0x44,0x44,0x44,0x44,0x44,0x48,0x70,0x00,0x00, 7, // 0x45 'E' 0x00,0x7C,0x40,0x40,0x40,0x78,0x40,0x40,0x40,0x7C,0x00,0x00, 7, // 0x46 'F' 0x00,0x7C,0x40,0x40,0x40,0x78,0x40,0x40,0x40,0x40,0x00,0x00, 7, // 0x47 'G' 0x00,0x38,0x44,0x40,0x40,0x5C,0x44,0x44,0x4C,0x34,0x00,0x00, 7, // 0x48 'H' 0x00,0x44,0x44,0x44,0x44,0x7C,0x44,0x44,0x44,0x44,0x00,0x00, 7, // 0x49 'I' 0x00,0x38,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x38,0x00,0x00, 7, // 0x4A 'J' 0x00,0x1C,0x08,0x08,0x08,0x08,0x08,0x48,0x48,0x30,0x00,0x00, 7, // 0x4B 'K' 0x00,0x44,0x48,0x50,0x60,0x60,0x50,0x48,0x44,0x44,0x00,0x00, 7, // 0x4C 'L' 0x00,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x7C,0x00,0x00, 7, // 0x4D 'M' 0x00,0x44,0x6C,0x6C,0x54,0x54,0x44,0x44,0x44,0x44,0x00,0x00, 7, // 0x4E 'N' 0x00,0x44,0x64,0x64,0x54,0x54,0x4C,0x4C,0x44,0x44,0x00,0x00, 7, // 0x4F 'O' 0x00,0x38,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x38,0x00,0x00, 7, // 0x50 'P' 0x00,0x78,0x44,0x44,0x44,0x44,0x78,0x40,0x40,0x40,0x00,0x00, 7, // 0x51 'Q' 0x00,0x38,0x44,0x44,0x44,0x44,0x44,0x54,0x48,0x34,0x00,0x00, 7, // 0x52 'R' 0x00,0x78,0x44,0x44,0x44,0x44,0x78,0x48,0x44,0x44,0x00,0x00, 7, // 0x53 'S' 0x00,0x38,0x44,0x40,0x40,0x38,0x04,0x04,0x44,0x38,0x00,0x00, 7, // 0x54 'T' 0x00,0x7C,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x00,0x00, 7, // 0x55 'U' 0x00,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x38,0x00,0x00, 7, // 0x56 'V' 0x00,0x44,0x44,0x44,0x44,0x28,0x28,0x28,0x10,0x10,0x00,0x00, 7, // 0x57 'W' 0x00,0x44,0x44,0x44,0x44,0x44,0x44,0x54,0x54,0x28,0x00,0x00, 7, // 0x58 'X' 0x00,0x44,0x44,0x44,0x28,0x10,0x28,0x44,0x44,0x44,0x00,0x00, 7, // 0x59 'Y' 0x00,0x44,0x44,0x44,0x44,0x28,0x10,0x10,0x10,0x10,0x00,0x00, 7, // 0x5A 'Z' 0x00,0x7C,0x04,0x04,0x08,0x10,0x20,0x40,0x40,0x7C,0x00,0x00, 7, // 0x5B '[' 0x38,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x38,0x00, 7, // 0x5C '\' 0x00,0x40,0x40,0x20,0x20,0x10,0x10,0x08,0x08,0x04,0x04,0x00, 7, // 0x5D ']' 0x38,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x38,0x00, 7, // 0x5E '^' 0x00,0x10,0x28,0x44,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 7, // 0x5F '_' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x00,0x00, 7, // 0x60 '`' 0x00,0x20,0x20,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 7, // 0x61 'a' 0x00,0x00,0x00,0x38,0x04,0x3C,0x44,0x44,0x44,0x3C,0x00,0x00, 7, // 0x62 'b' 0x00,0x40,0x40,0x78,0x44,0x44,0x44,0x44,0x44,0x78,0x00,0x00, 7, // 0x63 'c' 0x00,0x00,0x00,0x38,0x44,0x40,0x40,0x40,0x44,0x38,0x00,0x00, 7, // 0x64 'd' 0x00,0x04,0x04,0x3C,0x44,0x44,0x44,0x44,0x44,0x3C,0x00,0x00, 7, // 0x65 'e' 0x00,0x00,0x00,0x38,0x44,0x44,0x7C,0x40,0x44,0x38,0x00,0x00, 7, // 0x66 'f' 0x00,0x0C,0x10,0x38,0x10,0x10,0x10,0x10,0x10,0x10,0x00,0x00, 7, // 0x67 'g' 0x00,0x00,0x00,0x3C,0x44,0x44,0x44,0x44,0x44,0x3C,0x04,0x78, 7, // 0x68 'h' 0x00,0x40,0x40,0x78,0x44,0x44,0x44,0x44,0x44,0x44,0x00,0x00, 7, // 0x69 'i' 0x00,0x10,0x00,0x30,0x10,0x10,0x10,0x10,0x10,0x38,0x00,0x00, 7, // 0x6A 'j' 0x00,0x08,0x00,0x18,0x08,0x08,0x08,0x08,0x08,0x08,0x48,0x30, 7, // 0x6B 'k' 0x00,0x40,0x40,0x44,0x48,0x50,0x60,0x50,0x48,0x44,0x00,0x00, 7, // 0x6C 'l' 0x00,0x30,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x38,0x00,0x00, 7, // 0x6D 'm' 0x00,0x00,0x00,0x68,0x54,0x54,0x44,0x44,0x44,0x44,0x00,0x00, 7, // 0x6E 'n' 0x00,0x00,0x00,0x58,0x64,0x44,0x44,0x44,0x44,0x44,0x00,0x00, 7, // 0x6F 'o' 0x00,0x00,0x00,0x38,0x44,0x44,0x44,0x44,0x44,0x38,0x00,0x00, 7, // 0x70 'p' 0x00,0x00,0x00,0x78,0x44,0x44,0x44,0x44,0x44,0x78,0x40,0x40, 7, // 0x71 'q' 0x00,0x00,0x00,0x3C,0x44,0x44,0x44,0x44,0x44,0x3C,0x04,0x04, 7, // 0x72 'r' 0x00,0x00,0x00,0x58,0x24,0x20,0x20,0x20,0x20,0x70,0x00,0x00, 7, // 0x73 's' 0x00,0x00,0x00,0x38,0x44,0x40,0x38,0x04,0x44,0x38,0x00,0x00, 7, // 0x74 't' 0x00,0x20,0x20,0x70,0x20,0x20,0x20,0x20,0x24,0x18,0x00,0x00, 7, // 0x75 'u' 0x00,0x00,0x00,0x44,0x44,0x44,0x44,0x44,0x4C,0x34,0x00,0x00, 7, // 0x76 'v' 0x00,0x00,0x00,0x44,0x44,0x44,0x28,0x28,0x10,0x10,0x00,0x00, 7, // 0x77 'w' 0x00,0x00,0x00,0x44,0x44,0x44,0x44,0x54,0x54,0x28,0x00,0x00, 7, // 0x78 'x' 0x00,0x00,0x00,0x44,0x44,0x28,0x10,0x28,0x44,0x44,0x00,0x00, 7, // 0x79 'y' 0x00,0x00,0x00,0x44,0x44,0x44,0x44,0x44,0x44,0x3C,0x08,0x70, 7, // 0x7A 'z' 0x00,0x00,0x00,0x7C,0x04,0x08,0x10,0x20,0x40,0x7C,0x00,0x00, 7, // 0x7B '{' 0x18,0x20,0x20,0x20,0x20,0xC0,0x20,0x20,0x20,0x20,0x18,0x00, 7, // 0x7C '|' 0x00,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x00, 7, // 0x7D '}' 0x60,0x10,0x10,0x10,0x10,0x0C,0x10,0x10,0x10,0x10,0x60,0x00, 7, // 0x7E '~' 0x00,0x60,0x92,0x92,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 7, // 0x7F '' 0x00,0x10,0x38,0x6C,0x44,0x44,0x7C,0x00,0x00,0x00,0x00,0x00, 0 }; 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, 0x75,0x00,0x82,0x00,0x8F,0x00,0x9C,0x00,0xA9,0x00,0xB6,0x00,0xC3,0x00,0xD0,0x00,0xDD,0x00, 0xEA,0x00,0xF7,0x00,0x04,0x01,0x11,0x01,0x1E,0x01,0x2B,0x01,0x38,0x01,0x45,0x01,0x52,0x01, 0x5F,0x01,0x6C,0x01,0x79,0x01,0x86,0x01,0x93,0x01,0xA0,0x01,0xAD,0x01,0xBA,0x01,0xC7,0x01, 0xD4,0x01,0xE1,0x01,0xEE,0x01,0xFB,0x01,0x08,0x02,0x15,0x02,0x22,0x02,0x2F,0x02,0x3C,0x02, 0x49,0x02,0x56,0x02,0x63,0x02,0x70,0x02,0x7D,0x02,0x8A,0x02,0x97,0x02,0xA4,0x02,0xB1,0x02, 0xBE,0x02,0xCB,0x02,0xD8,0x02,0xE5,0x02,0xF2,0x02,0xFF,0x02,0x0C,0x03,0x19,0x03,0x26,0x03, 0x33,0x03,0x40,0x03,0x4D,0x03,0x5A,0x03,0x67,0x03,0x74,0x03,0x81,0x03,0x8E,0x03,0x9B,0x03, 0xA8,0x03,0xB5,0x03,0xC2,0x03,0xCF,0x03,0xDC,0x03,0xE9,0x03,0xF6,0x03,0x03,0x04,0x10,0x04, 0x1D,0x04,0x2A,0x04,0x37,0x04,0x44,0x04,0x51,0x04,0x5E,0x04,0x6B,0x04,0x78,0x04,0x85,0x04, 0x92,0x04,0x9F,0x04,0xAC,0x04,0xB9,0x04,0xC6,0x04,0xD3,0x04, 7, // 0x20 ' ' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 7, // 0x21 '!' 0x00,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x00,0x10,0x00,0x00, 7, // 0x22 '"' 0x28,0x28,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 7, // 0x23 '#' 0x00,0x28,0x28,0x7C,0x28,0x28,0x28,0x7C,0x28,0x28,0x00,0x00, 7, // 0x24 '$' 0x00,0x10,0x38,0x54,0x50,0x38,0x14,0x54,0x38,0x10,0x00,0x00, 7, // 0x25 '%' 0x34,0x54,0x68,0x08,0x10,0x10,0x20,0x2C,0x54,0x58,0x00,0x00, 7, // 0x26 '&' 0x00,0x20,0x50,0x50,0x20,0x54,0x54,0x48,0x34,0x00,0x00,0x00, 7, // 0x27 ''' 0x00,0x10,0x10,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 7, // 0x28 '(' 0x08,0x10,0x10,0x20,0x20,0x20,0x20,0x20,0x10,0x10,0x08,0x00, 7, // 0x29 ')' 0x20,0x10,0x10,0x08,0x08,0x08,0x08,0x08,0x10,0x10,0x20,0x00, 7, // 0x2A '*' 0x00,0x00,0x10,0x54,0x38,0x7C,0x38,0x54,0x10,0x00,0x00,0x00, 7, // 0x2B '+' 0x00,0x00,0x00,0x10,0x10,0x7C,0x10,0x10,0x00,0x00,0x00,0x00, 7, // 0x2C ',' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x20,0x40,0x00, 7, // 0x2D '-' 0x00,0x00,0x00,0x00,0x00,0x7C,0x00,0x00,0x00,0x00,0x00,0x00, 7, // 0x2E '.' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x00, 7, // 0x2F '/' 0x04,0x04,0x08,0x08,0x10,0x10,0x20,0x20,0x40,0x40,0x00,0x00, 7, // 0x30 '0' 0x00,0x38,0x44,0x44,0x54,0x54,0x44,0x44,0x38,0x00,0x00,0x00, 7, // 0x31 '1' 0x00,0x10,0x30,0x10,0x10,0x10,0x10,0x10,0x38,0x00,0x00,0x00, 7, // 0x32 '2' 0x00,0x38,0x44,0x44,0x08,0x10,0x20,0x40,0x7C,0x00,0x00,0x00, 7, // 0x33 '3' 0x00,0x38,0x44,0x04,0x38,0x04,0x04,0x44,0x38,0x00,0x00,0x00, 7, // 0x34 '4' 0x00,0x08,0x18,0x28,0x28,0x48,0x7C,0x08,0x08,0x00,0x00,0x00, 7, // 0x35 '5' 0x00,0x7C,0x40,0x78,0x44,0x04,0x04,0x44,0x38,0x00,0x00,0x00, 7, // 0x36 '6' 0x00,0x38,0x44,0x40,0x78,0x44,0x44,0x44,0x38,0x00,0x00,0x00, 7, // 0x37 '7' 0x00,0x7C,0x04,0x08,0x08,0x10,0x10,0x20,0x20,0x00,0x00,0x00, 7, // 0x38 '8' 0x00,0x38,0x44,0x44,0x38,0x44,0x44,0x44,0x38,0x00,0x00,0x00, 7, // 0x39 '9' 0x00,0x38,0x44,0x44,0x44,0x3C,0x04,0x44,0x38,0x00,0x00,0x00, 7, // 0x3A ':' 0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x30,0x30,0x00,0x00,0x00, 7, // 0x3B ';' 0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x30,0x30,0x20,0x40,0x00, 7, // 0x3C '<' 0x00,0x04,0x08,0x10,0x20,0x40,0x20,0x10,0x08,0x04,0x00,0x00, 7, // 0x3D '=' 0x00,0x00,0x00,0x00,0x7C,0x00,0x00,0x7C,0x00,0x00,0x00,0x00, 7, // 0x3E '>' 0x00,0x40,0x20,0x10,0x08,0x04,0x08,0x10,0x20,0x40,0x00,0x00, 7, // 0x3F '?' 0x00,0x38,0x44,0x04,0x04,0x08,0x10,0x10,0x00,0x10,0x00,0x00, 7, // 0x40 '@' 0x00,0x38,0x44,0x44,0x5C,0x54,0x4C,0x40,0x38,0x00,0x00,0x00, 7, // 0x41 'A' 0x00,0x38,0x44,0x44,0x44,0x7C,0x44,0x44,0x44,0x00,0x00,0x00, 7, // 0x42 'B' 0x00,0x78,0x44,0x44,0x78,0x44,0x44,0x44,0x78,0x00,0x00,0x00, 7, // 0x43 'C' 0x00,0x38,0x44,0x40,0x40,0x40,0x40,0x44,0x38,0x00,0x00,0x00, 7, // 0x44 'D' 0x00,0x70,0x48,0x44,0x44,0x44,0x44,0x48,0x70,0x00,0x00,0x00, 7, // 0x45 'E' 0x00,0x7C,0x40,0x40,0x78,0x40,0x40,0x40,0x7C,0x00,0x00,0x00, 7, // 0x46 'F' 0x00,0x7C,0x40,0x40,0x78,0x40,0x40,0x40,0x40,0x00,0x00,0x00, 7, // 0x47 'G' 0x00,0x38,0x44,0x40,0x40,0x4C,0x44,0x4C,0x34,0x00,0x00,0x00, 7, // 0x48 'H' 0x00,0x44,0x44,0x44,0x7C,0x44,0x44,0x44,0x44,0x00,0x00,0x00, 7, // 0x49 'I' 0x00,0x38,0x10,0x10,0x10,0x10,0x10,0x10,0x38,0x00,0x00,0x00, 7, // 0x4A 'J' 0x00,0x1C,0x08,0x08,0x08,0x08,0x48,0x48,0x30,0x00,0x00,0x00, 7, // 0x4B 'K' 0x00,0x44,0x48,0x50,0x60,0x60,0x50,0x48,0x44,0x00,0x00,0x00, 7, // 0x4C 'L' 0x00,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x7C,0x00,0x00,0x00, 7, // 0x4D 'M' 0x00,0x44,0x6C,0x54,0x54,0x44,0x44,0x44,0x44,0x00,0x00,0x00, 7, // 0x4E 'N' 0x00,0x44,0x64,0x64,0x54,0x54,0x4C,0x4C,0x44,0x00,0x00,0x00, 7, // 0x4F 'O' 0x00,0x38,0x44,0x44,0x44,0x44,0x44,0x44,0x38,0x00,0x00,0x00, 7, // 0x50 'P' 0x00,0x78,0x44,0x44,0x44,0x78,0x40,0x40,0x40,0x00,0x00,0x00, 7, // 0x51 'Q' 0x00,0x38,0x44,0x44,0x44,0x44,0x54,0x48,0x34,0x00,0x00,0x00, 7, // 0x52 'R' 0x00,0x78,0x44,0x44,0x44,0x78,0x48,0x44,0x44,0x00,0x00,0x00, 7, // 0x53 'S' 0x00,0x38,0x44,0x40,0x38,0x04,0x44,0x44,0x38,0x00,0x00,0x00, 7, // 0x54 'T' 0x00,0x7C,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x00,0x00,0x00, 7, // 0x55 'U' 0x00,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x38,0x00,0x00,0x00, 7, // 0x56 'V' 0x00,0x44,0x44,0x44,0x28,0x28,0x28,0x10,0x10,0x00,0x00,0x00, 7, // 0x57 'W' 0x00,0x44,0x44,0x44,0x44,0x44,0x54,0x54,0x28,0x00,0x00,0x00, 7, // 0x58 'X' 0x00,0x44,0x44,0x28,0x10,0x28,0x44,0x44,0x44,0x00,0x00,0x00, 7, // 0x59 'Y' 0x00,0x44,0x44,0x44,0x28,0x10,0x10,0x10,0x10,0x00,0x00,0x00, 7, // 0x5A 'Z' 0x00,0x7C,0x04,0x08,0x10,0x20,0x40,0x40,0x7C,0x00,0x00,0x00, 7, // 0x5B '[' 0x38,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x38,0x00, 7, // 0x5C '\' 0x00,0x40,0x40,0x20,0x20,0x10,0x10,0x08,0x08,0x04,0x04,0x00, 7, // 0x5D ']' 0x38,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x38,0x00, 7, // 0x5E '^' 0x00,0x10,0x28,0x44,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 7, // 0x5F '_' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x00,0x00,0x00, 7, // 0x60 '`' 0x00,0x20,0x20,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 7, // 0x61 'a' 0x00,0x00,0x00,0x38,0x04,0x3C,0x44,0x44,0x3C,0x00,0x00,0x00, 7, // 0x62 'b' 0x00,0x40,0x40,0x78,0x44,0x44,0x44,0x44,0x78,0x00,0x00,0x00, 7, // 0x63 'c' 0x00,0x00,0x00,0x38,0x44,0x40,0x40,0x44,0x38,0x00,0x00,0x00, 7, // 0x64 'd' 0x00,0x04,0x04,0x3C,0x44,0x44,0x44,0x44,0x3C,0x00,0x00,0x00, 7, // 0x65 'e' 0x00,0x00,0x00,0x38,0x44,0x7C,0x40,0x44,0x38,0x00,0x00,0x00, 7, // 0x66 'f' 0x00,0x0C,0x10,0x38,0x10,0x10,0x10,0x10,0x10,0x00,0x00,0x00, 7, // 0x67 'g' 0x00,0x00,0x00,0x3C,0x44,0x44,0x44,0x44,0x3C,0x04,0x44,0x38, 7, // 0x68 'h' 0x00,0x40,0x40,0x78,0x44,0x44,0x44,0x44,0x44,0x00,0x00,0x00, 7, // 0x69 'i' 0x00,0x10,0x00,0x30,0x10,0x10,0x10,0x10,0x38,0x00,0x00,0x00, 7, // 0x6A 'j' 0x00,0x08,0x00,0x18,0x08,0x08,0x08,0x08,0x08,0x48,0x48,0x30, 7, // 0x6B 'k' 0x00,0x40,0x40,0x4C,0x50,0x60,0x50,0x48,0x44,0x00,0x00,0x00, 7, // 0x6C 'l' 0x00,0x30,0x10,0x10,0x10,0x10,0x10,0x10,0x38,0x00,0x00,0x00, 7, // 0x6D 'm' 0x00,0x00,0x00,0x68,0x54,0x54,0x44,0x44,0x44,0x00,0x00,0x00, 7, // 0x6E 'n' 0x00,0x00,0x00,0x58,0x64,0x44,0x44,0x44,0x44,0x00,0x00,0x00, 7, // 0x6F 'o' 0x00,0x00,0x00,0x38,0x44,0x44,0x44,0x44,0x38,0x00,0x00,0x00, 7, // 0x70 'p' 0x00,0x00,0x00,0x78,0x44,0x44,0x44,0x44,0x78,0x40,0x40,0x40, 7, // 0x71 'q' 0x00,0x00,0x00,0x3C,0x44,0x44,0x44,0x44,0x3C,0x04,0x04,0x04, 7, // 0x72 'r' 0x00,0x00,0x00,0x58,0x24,0x20,0x20,0x20,0x70,0x00,0x00,0x00, 7, // 0x73 's' 0x00,0x00,0x00,0x38,0x44,0x30,0x08,0x44,0x38,0x00,0x00,0x00, 7, // 0x74 't' 0x00,0x20,0x20,0x70,0x20,0x20,0x20,0x24,0x18,0x00,0x00,0x00, 7, // 0x75 'u' 0x00,0x00,0x00,0x44,0x44,0x44,0x44,0x4C,0x34,0x00,0x00,0x00, 7, // 0x76 'v' 0x00,0x00,0x00,0x44,0x44,0x28,0x28,0x10,0x10,0x00,0x00,0x00, 7, // 0x77 'w' 0x00,0x00,0x00,0x44,0x44,0x44,0x54,0x54,0x28,0x00,0x00,0x00, 7, // 0x78 'x' 0x00,0x00,0x00,0x44,0x28,0x10,0x28,0x44,0x44,0x00,0x00,0x00, 7, // 0x79 'y' 0x00,0x00,0x00,0x44,0x44,0x44,0x44,0x44,0x3C,0x04,0x08,0x70, 7, // 0x7A 'z' 0x00,0x00,0x00,0x7C,0x08,0x10,0x20,0x40,0x7C,0x00,0x00,0x00, 7, // 0x7B '{' 0x18,0x20,0x20,0x20,0x20,0xC0,0x20,0x20,0x20,0x20,0x18,0x00, 7, // 0x7C '|' 0x00,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x00, 7, // 0x7D '}' 0x60,0x10,0x10,0x10,0x10,0x0C,0x10,0x10,0x10,0x10,0x60,0x00, 7, // 0x7E '~' 0x00,0x24,0x54,0x48,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 7, // 0x7F '' 0x00,0x10,0x38,0x6C,0x44,0x44,0x7C,0x00,0x00,0x00,0x00,0x00, 0 }; 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, 0x81,0x00,0x8E,0x00,0x9B,0x00,0xA8,0x00,0xB5,0x00,0xC2,0x00,0xCF,0x00,0xDC,0x00,0xE9,0x00, 0xF6,0x00,0x03,0x01,0x10,0x01,0x1D,0x01,0x2A,0x01,0x37,0x01,0x44,0x01,0x51,0x01,0x5E,0x01, 0x6B,0x01,0x78,0x01,0x85,0x01,0x92,0x01,0x9F,0x01,0xAC,0x01,0xC5,0x01,0xD2,0x01,0xDF,0x01, 0xEC,0x01,0xF9,0x01,0x06,0x02,0x13,0x02,0x20,0x02,0x2D,0x02,0x3A,0x02,0x47,0x02,0x54,0x02, 0x61,0x02,0x7A,0x02,0x87,0x02,0xA0,0x02,0xAD,0x02,0xC6,0x02,0xD3,0x02,0xE0,0x02,0xED,0x02, 0xFA,0x02,0x07,0x03,0x20,0x03,0x2D,0x03,0x3A,0x03,0x47,0x03,0x54,0x03,0x61,0x03,0x6E,0x03, 0x7B,0x03,0x88,0x03,0x95,0x03,0xA2,0x03,0xAF,0x03,0xBC,0x03,0xC9,0x03,0xD6,0x03,0xE3,0x03, 0xF0,0x03,0xFD,0x03,0x0A,0x04,0x17,0x04,0x24,0x04,0x31,0x04,0x4A,0x04,0x57,0x04,0x64,0x04, 0x71,0x04,0x7E,0x04,0x8B,0x04,0x98,0x04,0xA5,0x04,0xB2,0x04,0xBF,0x04,0xCC,0x04,0xD9,0x04, 0xE6,0x04,0xF3,0x04,0x00,0x05,0x0D,0x05,0x1A,0x05,0x27,0x05, 3, // 0x20 ' ' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 5, // 0x21 '!' 0x00,0x00,0x00,0x20,0x20,0x20,0x20,0x20,0x00,0x20,0x00,0x00, 5, // 0x22 '"' 0x00,0x00,0x50,0x50,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 7, // 0x23 '#' 0x00,0x00,0x00,0x00,0x28,0x7C,0x28,0x7C,0x28,0x00,0x00,0x00, 7, // 0x24 '$' 0x00,0x00,0x10,0x10,0x3C,0x50,0x30,0x18,0x14,0x78,0x10,0x10, 11, // 0x25 '%' 0x00,0x00,0x00,0x00,0x00,0x00,0x31,0x00,0x4A,0x00,0x4A,0x00,0x35,0x80,0x0A,0x40,0x0A,0x40,0x11,0x80,0x00,0x00,0x00,0x00, 7, // 0x26 '&' 0x00,0x00,0x00,0x30,0x48,0x48,0x32,0x4A,0x44,0x3A,0x00,0x00, 3, // 0x27 ''' 0x00,0x00,0x40,0x40,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 4, // 0x28 '(' 0x00,0x00,0x10,0x20,0x40,0x40,0x40,0x40,0x40,0x40,0x20,0x10, 4, // 0x29 ')' 0x00,0x00,0x80,0x40,0x20,0x20,0x20,0x20,0x20,0x20,0x40,0x80, 7, // 0x2A '*' 0x00,0x10,0x54,0x38,0x54,0x10,0x00,0x00,0x00,0x00,0x00,0x00, 7, // 0x2B '+' 0x00,0x00,0x00,0x00,0x10,0x10,0x7C,0x10,0x10,0x00,0x00,0x00, 3, // 0x2C ',' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x40,0x80,0x00, 5, // 0x2D '-' 0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x00,0x00,0x00,0x00,0x00, 3, // 0x2E '.' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x40,0x00,0x00, 4, // 0x2F '/' 0x00,0x00,0x10,0x10,0x20,0x20,0x40,0x40,0x40,0x80,0x80,0x00, 7, // 0x30 '0' 0x00,0x00,0x00,0x38,0x44,0x44,0x44,0x44,0x44,0x38,0x00,0x00, 7, // 0x31 '1' 0x00,0x00,0x00,0x10,0x30,0x10,0x10,0x10,0x10,0x38,0x00,0x00, 7, // 0x32 '2' 0x00,0x00,0x00,0x38,0x44,0x04,0x08,0x10,0x20,0x7C,0x00,0x00, 7, // 0x33 '3' 0x00,0x00,0x00,0x38,0x44,0x04,0x18,0x04,0x44,0x38,0x00,0x00, 7, // 0x34 '4' 0x00,0x00,0x00,0x08,0x18,0x28,0x48,0x7C,0x08,0x08,0x00,0x00, 7, // 0x35 '5' 0x00,0x00,0x00,0x7C,0x40,0x78,0x04,0x04,0x44,0x38,0x00,0x00, 7, // 0x36 '6' 0x00,0x00,0x00,0x18,0x20,0x40,0x78,0x44,0x44,0x38,0x00,0x00, 7, // 0x37 '7' 0x00,0x00,0x00,0x7C,0x04,0x08,0x08,0x10,0x10,0x10,0x00,0x00, 7, // 0x38 '8' 0x00,0x00,0x00,0x38,0x44,0x44,0x38,0x44,0x44,0x38,0x00,0x00, 7, // 0x39 '9' 0x00,0x00,0x00,0x38,0x44,0x44,0x3C,0x04,0x08,0x30,0x00,0x00, 4, // 0x3A ':' 0x00,0x00,0x00,0x00,0x00,0x40,0x40,0x00,0x40,0x40,0x00,0x00, 4, // 0x3B ';' 0x00,0x00,0x00,0x00,0x00,0x40,0x40,0x00,0x40,0x40,0x80,0x00, 7, // 0x3C '<' 0x00,0x00,0x00,0x00,0x04,0x18,0x60,0x18,0x04,0x00,0x00,0x00, 7, // 0x3D '=' 0x00,0x00,0x00,0x00,0x00,0x7C,0x00,0x7C,0x00,0x00,0x00,0x00, 7, // 0x3E '>' 0x00,0x00,0x00,0x00,0x40,0x30,0x0C,0x30,0x40,0x00,0x00,0x00, 6, // 0x3F '?' 0x00,0x00,0x00,0x70,0x08,0x08,0x10,0x20,0x00,0x20,0x00,0x00, 10, // 0x40 '@' 0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x00,0x20,0x80,0x4E,0x80,0x52,0x80,0x52,0x80,0x4D,0x00,0x20,0x00,0x1F,0x00,0x00,0x00, 8, // 0x41 'A' 0x00,0x00,0x00,0x18,0x18,0x24,0x24,0x7E,0x42,0x42,0x00,0x00, 7, // 0x42 'B' 0x00,0x00,0x00,0x70,0x48,0x48,0x78,0x44,0x44,0x78,0x00,0x00, 8, // 0x43 'C' 0x00,0x00,0x00,0x1C,0x22,0x40,0x40,0x40,0x22,0x1C,0x00,0x00, 8, // 0x44 'D' 0x00,0x00,0x00,0x78,0x44,0x42,0x42,0x42,0x44,0x78,0x00,0x00, 7, // 0x45 'E' 0x00,0x00,0x00,0x7C,0x40,0x40,0x78,0x40,0x40,0x7C,0x00,0x00, 6, // 0x46 'F' 0x00,0x00,0x00,0x7C,0x40,0x40,0x78,0x40,0x40,0x40,0x00,0x00, 8, // 0x47 'G' 0x00,0x00,0x00,0x1C,0x22,0x40,0x4E,0x42,0x22,0x1C,0x00,0x00, 8, // 0x48 'H' 0x00,0x00,0x00,0x42,0x42,0x42,0x7E,0x42,0x42,0x42,0x00,0x00, 5, // 0x49 'I' 0x00,0x00,0x00,0x70,0x20,0x20,0x20,0x20,0x20,0x70,0x00,0x00, 5, // 0x4A 'J' 0x00,0x00,0x00,0x30,0x10,0x10,0x10,0x10,0x10,0xE0,0x00,0x00, 7, // 0x4B 'K' 0x00,0x00,0x00,0x44,0x48,0x50,0x60,0x50,0x48,0x44,0x00,0x00, 6, // 0x4C 'L' 0x00,0x00,0x00,0x40,0x40,0x40,0x40,0x40,0x40,0x7C,0x00,0x00, 9, // 0x4D 'M' 0x00,0x00,0x00,0x00,0x00,0x00,0x63,0x00,0x63,0x00,0x55,0x00,0x55,0x00,0x49,0x00,0x49,0x00,0x41,0x00,0x00,0x00,0x00,0x00, 8, // 0x4E 'N' 0x00,0x00,0x00,0x42,0x62,0x52,0x4A,0x46,0x42,0x42,0x00,0x00, 9, // 0x4F 'O' 0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0x00,0x22,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x22,0x00,0x1C,0x00,0x00,0x00,0x00,0x00, 7, // 0x50 'P' 0x00,0x00,0x00,0x78,0x44,0x44,0x44,0x78,0x40,0x40,0x00,0x00, 9, // 0x51 'Q' 0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0x00,0x22,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x22,0x00,0x1C,0x00,0x04,0x00,0x03,0x00, 7, // 0x52 'R' 0x00,0x00,0x00,0x78,0x44,0x44,0x78,0x50,0x48,0x44,0x00,0x00, 7, // 0x53 'S' 0x00,0x00,0x00,0x38,0x44,0x40,0x38,0x04,0x44,0x38,0x00,0x00, 7, // 0x54 'T' 0x00,0x00,0x00,0xFE,0x10,0x10,0x10,0x10,0x10,0x10,0x00,0x00, 8, // 0x55 'U' 0x00,0x00,0x00,0x42,0x42,0x42,0x42,0x42,0x42,0x3C,0x00,0x00, 8, // 0x56 'V' 0x00,0x00,0x00,0x42,0x42,0x42,0x24,0x24,0x18,0x18,0x00,0x00, 9, // 0x57 'W' 0x00,0x00,0x00,0x00,0x00,0x00,0x41,0x00,0x49,0x00,0x49,0x00,0x55,0x00,0x55,0x00,0x22,0x00,0x22,0x00,0x00,0x00,0x00,0x00, 7, // 0x58 'X' 0x00,0x00,0x00,0x44,0x44,0x28,0x10,0x28,0x44,0x44,0x00,0x00, 7, // 0x59 'Y' 0x00,0x00,0x00,0x44,0x44,0x28,0x28,0x10,0x10,0x10,0x00,0x00, 7, // 0x5A 'Z' 0x00,0x00,0x00,0x7C,0x04,0x08,0x10,0x20,0x40,0x7C,0x00,0x00, 4, // 0x5B '[' 0x00,0x00,0x60,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x60, 4, // 0x5C '\' 0x00,0x00,0x80,0x80,0x40,0x40,0x40,0x20,0x20,0x10,0x10,0x00, 4, // 0x5D ']' 0x00,0x00,0x60,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x60, 7, // 0x5E '^' 0x00,0x00,0x00,0x10,0x28,0x44,0x00,0x00,0x00,0x00,0x00,0x00, 6, // 0x5F '_' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFC, 6, // 0x60 '`' 0x00,0x00,0x20,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 6, // 0x61 'a' 0x00,0x00,0x00,0x00,0x00,0x30,0x08,0x38,0x48,0x38,0x00,0x00, 6, // 0x62 'b' 0x00,0x00,0x40,0x40,0x40,0x70,0x48,0x48,0x48,0x70,0x00,0x00, 6, // 0x63 'c' 0x00,0x00,0x00,0x00,0x00,0x38,0x40,0x40,0x40,0x38,0x00,0x00, 6, // 0x64 'd' 0x00,0x00,0x08,0x08,0x08,0x38,0x48,0x48,0x48,0x38,0x00,0x00, 6, // 0x65 'e' 0x00,0x00,0x00,0x00,0x00,0x30,0x48,0x78,0x40,0x38,0x00,0x00, 4, // 0x66 'f' 0x00,0x00,0x30,0x40,0x40,0xE0,0x40,0x40,0x40,0x40,0x00,0x00, 6, // 0x67 'g' 0x00,0x00,0x00,0x00,0x00,0x38,0x48,0x48,0x48,0x38,0x08,0x30, 6, // 0x68 'h' 0x00,0x00,0x40,0x40,0x40,0x70,0x48,0x48,0x48,0x48,0x00,0x00, 3, // 0x69 'i' 0x00,0x00,0x00,0x40,0x00,0x40,0x40,0x40,0x40,0x40,0x00,0x00, 3, // 0x6A 'j' 0x00,0x00,0x00,0x40,0x00,0xC0,0x40,0x40,0x40,0x40,0x40,0x80, 6, // 0x6B 'k' 0x00,0x00,0x40,0x40,0x40,0x48,0x50,0x60,0x50,0x48,0x00,0x00, 3, // 0x6C 'l' 0x00,0x00,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x00,0x00, 9, // 0x6D 'm' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x76,0x00,0x49,0x00,0x49,0x00,0x49,0x00,0x49,0x00,0x00,0x00,0x00,0x00, 6, // 0x6E 'n' 0x00,0x00,0x00,0x00,0x00,0x70,0x48,0x48,0x48,0x48,0x00,0x00, 6, // 0x6F 'o' 0x00,0x00,0x00,0x00,0x00,0x30,0x48,0x48,0x48,0x30,0x00,0x00, 6, // 0x70 'p' 0x00,0x00,0x00,0x00,0x00,0x70,0x48,0x48,0x48,0x70,0x40,0x40, 6, // 0x71 'q' 0x00,0x00,0x00,0x00,0x00,0x38,0x48,0x48,0x48,0x38,0x08,0x08, 4, // 0x72 'r' 0x00,0x00,0x00,0x00,0x00,0x50,0x60,0x40,0x40,0x40,0x00,0x00, 6, // 0x73 's' 0x00,0x00,0x00,0x00,0x00,0x38,0x40,0x30,0x08,0x70,0x00,0x00, 4, // 0x74 't' 0x00,0x00,0x00,0x00,0x40,0xF0,0x40,0x40,0x40,0x30,0x00,0x00, 6, // 0x75 'u' 0x00,0x00,0x00,0x00,0x00,0x48,0x48,0x48,0x48,0x38,0x00,0x00, 6, // 0x76 'v' 0x00,0x00,0x00,0x00,0x00,0x48,0x48,0x48,0x30,0x30,0x00,0x00, 7, // 0x77 'w' 0x00,0x00,0x00,0x00,0x00,0x44,0x54,0x54,0x28,0x28,0x00,0x00, 6, // 0x78 'x' 0x00,0x00,0x00,0x00,0x00,0x48,0x48,0x30,0x48,0x48,0x00,0x00, 6, // 0x79 'y' 0x00,0x00,0x00,0x00,0x00,0x48,0x48,0x48,0x30,0x10,0x20,0x20, 5, // 0x7A 'z' 0x00,0x00,0x00,0x00,0x00,0x70,0x10,0x20,0x40,0x70,0x00,0x00, 6, // 0x7B '{' 0x00,0x00,0x18,0x20,0x20,0x20,0x20,0xC0,0x20,0x20,0x20,0x18, 5, // 0x7C '|' 0x00,0x00,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, 6, // 0x7D '}' 0x00,0x00,0x60,0x10,0x10,0x10,0x10,0x0C,0x10,0x10,0x10,0x60, 7, // 0x7E '~' 0x00,0x00,0x00,0x00,0x00,0x00,0x34,0x58,0x00,0x00,0x00,0x00, 9, // 0x7F '' 0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x7F,0x00,0x00,0x00,0x00,0x00, 0 }; 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, 0x81,0x00,0x8E,0x00,0x9B,0x00,0xA8,0x00,0xB5,0x00,0xC2,0x00,0xCF,0x00,0xDC,0x00,0xE9,0x00, 0xF6,0x00,0x03,0x01,0x10,0x01,0x1D,0x01,0x2A,0x01,0x37,0x01,0x44,0x01,0x51,0x01,0x5E,0x01, 0x6B,0x01,0x78,0x01,0x85,0x01,0x92,0x01,0x9F,0x01,0xAC,0x01,0xC5,0x01,0xD2,0x01,0xDF,0x01, 0xEC,0x01,0xF9,0x01,0x06,0x02,0x13,0x02,0x20,0x02,0x2D,0x02,0x3A,0x02,0x47,0x02,0x54,0x02, 0x61,0x02,0x6E,0x02,0x7B,0x02,0x88,0x02,0x95,0x02,0xA2,0x02,0xAF,0x02,0xBC,0x02,0xC9,0x02, 0xD6,0x02,0xE3,0x02,0xFC,0x02,0x09,0x03,0x16,0x03,0x23,0x03,0x30,0x03,0x3D,0x03,0x4A,0x03, 0x57,0x03,0x64,0x03,0x71,0x03,0x7E,0x03,0x8B,0x03,0x98,0x03,0xA5,0x03,0xB2,0x03,0xBF,0x03, 0xCC,0x03,0xD9,0x03,0xE6,0x03,0xF3,0x03,0x00,0x04,0x0D,0x04,0x26,0x04,0x33,0x04,0x40,0x04, 0x4D,0x04,0x5A,0x04,0x67,0x04,0x74,0x04,0x81,0x04,0x8E,0x04,0x9B,0x04,0xB4,0x04,0xC1,0x04, 0xCE,0x04,0xDB,0x04,0xE8,0x04,0xF5,0x04,0x02,0x05,0x0F,0x05, 3, // 0x20 ' ' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 4, // 0x21 '!' 0x00,0x00,0x00,0x60,0x60,0x60,0x60,0x60,0x00,0x60,0x00,0x00, 5, // 0x22 '"' 0x00,0x00,0xD8,0xD8,0xD8,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 8, // 0x23 '#' 0x00,0x00,0x00,0x14,0x14,0x7E,0x28,0xFC,0x50,0x50,0x00,0x00, 6, // 0x24 '$' 0x00,0x00,0x20,0x20,0x70,0xE8,0xE0,0x38,0xB8,0x70,0x20,0x20, 11, // 0x25 '%' 0x00,0x00,0x00,0x00,0x00,0x00,0x62,0x00,0x94,0x00,0x94,0x00,0x69,0x80,0x0A,0x40,0x0A,0x40,0x11,0x80,0x00,0x00,0x00,0x00, 8, // 0x26 '&' 0x00,0x00,0x00,0x70,0xD8,0xD8,0x76,0xDC,0xCC,0x76,0x00,0x00, 3, // 0x27 ''' 0x00,0x00,0xC0,0xC0,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 5, // 0x28 '(' 0x00,0x00,0x30,0x60,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0x60,0x30, 5, // 0x29 ')' 0x00,0x00,0xC0,0x60,0x30,0x30,0x30,0x30,0x30,0x30,0x60,0xC0, 6, // 0x2A '*' 0x00,0x00,0x20,0xA8,0x70,0xA8,0x20,0x00,0x00,0x00,0x00,0x00, 8, // 0x2B '+' 0x00,0x00,0x00,0x00,0x10,0x10,0x7C,0x10,0x10,0x00,0x00,0x00, 3, // 0x2C ',' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xC0,0x80,0x00, 4, // 0x2D '-' 0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0x00,0x00,0x00,0x00,0x00, 3, // 0x2E '.' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xC0,0x00,0x00, 6, // 0x2F '/' 0x00,0x00,0x08,0x08,0x10,0x10,0x20,0x40,0x40,0x80,0x80,0x00, 6, // 0x30 '0' 0x00,0x00,0x00,0x70,0xD8,0xD8,0xD8,0xD8,0xD8,0x70,0x00,0x00, 6, // 0x31 '1' 0x00,0x00,0x00,0x30,0x70,0x30,0x30,0x30,0x30,0x78,0x00,0x00, 6, // 0x32 '2' 0x00,0x00,0x00,0x70,0x98,0x18,0x30,0x60,0xC0,0xF8,0x00,0x00, 6, // 0x33 '3' 0x00,0x00,0x00,0x70,0x98,0x18,0x70,0x18,0x98,0x70,0x00,0x00, 6, // 0x34 '4' 0x00,0x00,0x00,0x18,0x38,0x58,0x98,0xFC,0x18,0x18,0x00,0x00, 6, // 0x35 '5' 0x00,0x00,0x00,0xF8,0xC0,0xF0,0x18,0x18,0x98,0x70,0x00,0x00, 6, // 0x36 '6' 0x00,0x00,0x00,0x70,0xC0,0xF0,0xD8,0xD8,0xD8,0x70,0x00,0x00, 6, // 0x37 '7' 0x00,0x00,0x00,0xF8,0x18,0x30,0x30,0x60,0x60,0xC0,0x00,0x00, 6, // 0x38 '8' 0x00,0x00,0x00,0x70,0xD8,0xD8,0x70,0xD8,0xD8,0x70,0x00,0x00, 6, // 0x39 '9' 0x00,0x00,0x00,0x70,0xD8,0xD8,0xD8,0x78,0x18,0x70,0x00,0x00, 4, // 0x3A ':' 0x00,0x00,0x00,0x00,0x00,0x60,0x60,0x00,0x60,0x60,0x00,0x00, 4, // 0x3B ';' 0x00,0x00,0x00,0x00,0x00,0x60,0x60,0x00,0x60,0x60,0x40,0x00, 8, // 0x3C '<' 0x00,0x00,0x00,0x00,0x04,0x18,0x60,0x60,0x18,0x04,0x00,0x00, 8, // 0x3D '=' 0x00,0x00,0x00,0x00,0x00,0x7C,0x00,0x7C,0x00,0x00,0x00,0x00, 8, // 0x3E '>' 0x00,0x00,0x00,0x00,0x40,0x30,0x0C,0x0C,0x30,0x40,0x00,0x00, 6, // 0x3F '?' 0x00,0x00,0x00,0xF0,0x18,0x18,0x30,0x60,0x00,0x60,0x00,0x00, 9, // 0x40 '@' 0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x00,0x42,0x00,0x9D,0x00,0xA5,0x00,0xA5,0x00,0x9E,0x00,0x40,0x00,0x3C,0x00,0x00,0x00, 8, // 0x41 'A' 0x00,0x00,0x00,0x38,0x38,0x6C,0x6C,0x7C,0xC6,0xC6,0x00,0x00, 7, // 0x42 'B' 0x00,0x00,0x00,0xF8,0xCC,0xCC,0xF8,0xCC,0xCC,0xF8,0x00,0x00, 6, // 0x43 'C' 0x00,0x00,0x00,0x70,0xC8,0xC0,0xC0,0xC0,0xC8,0x70,0x00,0x00, 7, // 0x44 'D' 0x00,0x00,0x00,0xF8,0xCC,0xCC,0xCC,0xCC,0xCC,0xF8,0x00,0x00, 6, // 0x45 'E' 0x00,0x00,0x00,0xF8,0xC0,0xC0,0xF8,0xC0,0xC0,0xF8,0x00,0x00, 6, // 0x46 'F' 0x00,0x00,0x00,0xF8,0xC0,0xC0,0xF8,0xC0,0xC0,0xC0,0x00,0x00, 7, // 0x47 'G' 0x00,0x00,0x00,0x78,0xC4,0xC0,0xC0,0xDC,0xCC,0x7C,0x00,0x00, 7, // 0x48 'H' 0x00,0x00,0x00,0xCC,0xCC,0xCC,0xFC,0xCC,0xCC,0xCC,0x00,0x00, 5, // 0x49 'I' 0x00,0x00,0x00,0xF0,0x60,0x60,0x60,0x60,0x60,0xF0,0x00,0x00, 5, // 0x4A 'J' 0x00,0x00,0x00,0x70,0x30,0x30,0x30,0x30,0x30,0xE0,0x00,0x00, 7, // 0x4B 'K' 0x00,0x00,0x00,0xCC,0xD8,0xF0,0xE0,0xF0,0xD8,0xCC,0x00,0x00, 6, // 0x4C 'L' 0x00,0x00,0x00,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xF8,0x00,0x00, 8, // 0x4D 'M' 0x00,0x00,0x00,0x82,0xC6,0xEE,0xB6,0xB6,0x86,0x86,0x00,0x00, 7, // 0x4E 'N' 0x00,0x00,0x00,0x84,0xC4,0xE4,0xB4,0x9C,0x8C,0x84,0x00,0x00, 8, // 0x4F 'O' 0x00,0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, 7, // 0x50 'P' 0x00,0x00,0x00,0xF8,0xCC,0xCC,0xCC,0xF8,0xC0,0xC0,0x00,0x00, 8, // 0x51 'Q' 0x00,0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x18,0x0E, 7, // 0x52 'R' 0x00,0x00,0x00,0xF8,0xCC,0xCC,0xF8,0xD8,0xCC,0xC6,0x00,0x00, 6, // 0x53 'S' 0x00,0x00,0x00,0x70,0xC8,0xC0,0x70,0x18,0x98,0x70,0x00,0x00, 6, // 0x54 'T' 0x00,0x00,0x00,0xFC,0x30,0x30,0x30,0x30,0x30,0x30,0x00,0x00, 7, // 0x55 'U' 0x00,0x00,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x78,0x00,0x00, 7, // 0x56 'V' 0x00,0x00,0x00,0xCC,0xCC,0x78,0x78,0x78,0x30,0x30,0x00,0x00, 11, // 0x57 'W' 0x00,0x00,0x00,0x00,0x00,0x00,0xCC,0xC0,0xCC,0xC0,0x6D,0x80,0x6D,0x80,0x73,0x80,0x33,0x00,0x33,0x00,0x00,0x00,0x00,0x00, 7, // 0x58 'X' 0x00,0x00,0x00,0xCC,0xCC,0x78,0x30,0x78,0xCC,0xCC,0x00,0x00, 7, // 0x59 'Y' 0x00,0x00,0x00,0xCC,0xCC,0x78,0x30,0x30,0x30,0x30,0x00,0x00, 6, // 0x5A 'Z' 0x00,0x00,0x00,0xF8,0x18,0x30,0x60,0xC0,0xC0,0xF8,0x00,0x00, 5, // 0x5B '[' 0x00,0x00,0x70,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x70, 6, // 0x5C '\' 0x00,0x00,0x80,0x80,0x40,0x40,0x20,0x10,0x10,0x08,0x08,0x00, 5, // 0x5D ']' 0x00,0x00,0x70,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x70, 8, // 0x5E '^' 0x00,0x00,0x00,0x18,0x3C,0x66,0x00,0x00,0x00,0x00,0x00,0x00, 6, // 0x5F '_' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFC, 6, // 0x60 '`' 0x00,0x00,0x30,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 6, // 0x61 'a' 0x00,0x00,0x00,0x00,0x00,0x70,0x18,0x78,0xD8,0x78,0x00,0x00, 6, // 0x62 'b' 0x00,0x00,0xC0,0xC0,0xC0,0xF0,0xD8,0xD8,0xD8,0xF0,0x00,0x00, 5, // 0x63 'c' 0x00,0x00,0x00,0x00,0x00,0x70,0xC0,0xC0,0xC0,0x70,0x00,0x00, 6, // 0x64 'd' 0x00,0x00,0x18,0x18,0x18,0x78,0xD8,0xD8,0xD8,0x78,0x00,0x00, 6, // 0x65 'e' 0x00,0x00,0x00,0x00,0x00,0x70,0xD8,0xF8,0xC0,0x78,0x00,0x00, 5, // 0x66 'f' 0x00,0x00,0x38,0x60,0x60,0xF8,0x60,0x60,0x60,0x60,0x00,0x00, 6, // 0x67 'g' 0x00,0x00,0x00,0x00,0x00,0x78,0xD8,0xD8,0xD8,0x78,0x18,0x70, 6, // 0x68 'h' 0x00,0x00,0xC0,0xC0,0xC0,0xF0,0xD8,0xD8,0xD8,0xD8,0x00,0x00, 3, // 0x69 'i' 0x00,0x00,0x00,0xC0,0x00,0xC0,0xC0,0xC0,0xC0,0xC0,0x00,0x00, 4, // 0x6A 'j' 0x00,0x00,0x00,0x60,0x00,0xE0,0x60,0x60,0x60,0x60,0x60,0xC0, 6, // 0x6B 'k' 0x00,0x00,0xC0,0xC0,0xC0,0xD8,0xD8,0xF0,0xD8,0xD8,0x00,0x00, 3, // 0x6C 'l' 0x00,0x00,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0x00,0x00, 9, // 0x6D 'm' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF6,0x00,0xDB,0x00,0xDB,0x00,0xDB,0x00,0xDB,0x00,0x00,0x00,0x00,0x00, 6, // 0x6E 'n' 0x00,0x00,0x00,0x00,0x00,0xF0,0xD8,0xD8,0xD8,0xD8,0x00,0x00, 6, // 0x6F 'o' 0x00,0x00,0x00,0x00,0x00,0x70,0xD8,0xD8,0xD8,0x70,0x00,0x00, 6, // 0x70 'p' 0x00,0x00,0x00,0x00,0x00,0xF0,0xD8,0xD8,0xD8,0xF0,0xC0,0xC0, 6, // 0x71 'q' 0x00,0x00,0x00,0x00,0x00,0x78,0xD8,0xD8,0xD8,0x78,0x18,0x18, 4, // 0x72 'r' 0x00,0x00,0x00,0x00,0x00,0xD0,0xE0,0xC0,0xC0,0xC0,0x00,0x00, 5, // 0x73 's' 0x00,0x00,0x00,0x00,0x00,0x70,0xC0,0xF0,0x30,0xE0,0x00,0x00, 5, // 0x74 't' 0x00,0x00,0x00,0x60,0x60,0xF8,0x60,0x60,0x60,0x38,0x00,0x00, 6, // 0x75 'u' 0x00,0x00,0x00,0x00,0x00,0xD8,0xD8,0xD8,0xD8,0x78,0x00,0x00, 6, // 0x76 'v' 0x00,0x00,0x00,0x00,0x00,0xD8,0xD8,0xD8,0x70,0x70,0x00,0x00, 9, // 0x77 'w' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xDB,0x00,0xDB,0x00,0xDB,0x00,0x66,0x00,0x66,0x00,0x00,0x00,0x00,0x00, 6, // 0x78 'x' 0x00,0x00,0x00,0x00,0x00,0xD8,0xD8,0x70,0xD8,0xD8,0x00,0x00, 6, // 0x79 'y' 0x00,0x00,0x00,0x00,0x00,0xD8,0xD8,0xD8,0x70,0x70,0x30,0x60, 5, // 0x7A 'z' 0x00,0x00,0x00,0x00,0x00,0xF0,0x30,0x60,0xC0,0xF0,0x00,0x00, 6, // 0x7B '{' 0x00,0x00,0x18,0x30,0x30,0x30,0xE0,0x30,0x30,0x30,0x30,0x18, 5, // 0x7C '|' 0x00,0x00,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, 6, // 0x7D '}' 0x00,0x00,0xC0,0x60,0x60,0x60,0x38,0x60,0x60,0x60,0x60,0xC0, 8, // 0x7E '~' 0x00,0x00,0x00,0x00,0x00,0x00,0x62,0x92,0x8C,0x00,0x00,0x00, 9, // 0x7F '' 0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x7F,0x00,0x00,0x00,0x00,0x00, 0 }; 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, 0x98,0x00,0xA6,0x00,0xB4,0x00,0xCF,0x00,0xDD,0x00,0xEB,0x00,0xF9,0x00,0x07,0x01,0x15,0x01, 0x23,0x01,0x31,0x01,0x3F,0x01,0x4D,0x01,0x5B,0x01,0x69,0x01,0x77,0x01,0x85,0x01,0x93,0x01, 0xA1,0x01,0xAF,0x01,0xCA,0x01,0xE5,0x01,0x00,0x02,0x0E,0x02,0x29,0x02,0x37,0x02,0x45,0x02, 0x60,0x02,0x7B,0x02,0x89,0x02,0x97,0x02,0xB2,0x02,0xC0,0x02,0xCE,0x02,0xDC,0x02,0xEA,0x02, 0xF8,0x02,0x13,0x03,0x21,0x03,0x3C,0x03,0x4A,0x03,0x65,0x03,0x73,0x03,0x81,0x03,0x8F,0x03, 0x9D,0x03,0xAB,0x03,0xC6,0x03,0xD4,0x03,0xE2,0x03,0xF0,0x03,0xFE,0x03,0x0C,0x04,0x1A,0x04, 0x35,0x04,0x43,0x04,0x51,0x04,0x5F,0x04,0x6D,0x04,0x7B,0x04,0x89,0x04,0x97,0x04,0xA5,0x04, 0xB3,0x04,0xC1,0x04,0xCF,0x04,0xDD,0x04,0xEB,0x04,0xF9,0x04,0x14,0x05,0x22,0x05,0x30,0x05, 0x3E,0x05,0x4C,0x05,0x5A,0x05,0x68,0x05,0x76,0x05,0x84,0x05,0x92,0x05,0xAD,0x05,0xBB,0x05, 0xC9,0x05,0xD7,0x05,0xE5,0x05,0xF3,0x05,0x01,0x06,0x1C,0x06, 4, // 0x20 ' ' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 4, // 0x21 '!' 0x00,0x00,0x00,0x20,0x20,0x20,0x20,0x20,0x20,0x00,0x20,0x00,0x00, 5, // 0x22 '"' 0x00,0x00,0x50,0x50,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x23 '#' 0x00,0x00,0x00,0x00,0x00,0x00,0x0A,0x00,0x0A,0x00,0x3F,0x00,0x14,0x00,0x14,0x00,0x7E,0x00,0x28,0x00,0x28,0x00,0x00,0x00,0x00,0x00, 7, // 0x24 '$' 0x00,0x00,0x10,0x10,0x3C,0x50,0x50,0x38,0x14,0x14,0x78,0x10,0x10, 12, // 0x25 '%' 0x00,0x00,0x00,0x00,0x00,0x00,0x31,0x00,0x49,0x00,0x4A,0x00,0x32,0x00,0x04,0xC0,0x05,0x20,0x09,0x20,0x08,0xC0,0x00,0x00,0x00,0x00, 8, // 0x26 '&' 0x00,0x00,0x00,0x30,0x48,0x48,0x32,0x4A,0x44,0x46,0x39,0x00,0x00, 3, // 0x27 ''' 0x00,0x00,0x40,0x40,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 5, // 0x28 '(' 0x00,0x00,0x10,0x20,0x20,0x40,0x40,0x40,0x40,0x40,0x20,0x20,0x10, 5, // 0x29 ')' 0x00,0x00,0x40,0x20,0x20,0x10,0x10,0x10,0x10,0x10,0x20,0x20,0x40, 7, // 0x2A '*' 0x00,0x00,0x10,0x54,0x38,0x54,0x10,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x2B '+' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x7F,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x00,0x00,0x00,0x00, 4, // 0x2C ',' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x20,0x40, 5, // 0x2D '-' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x00,0x00,0x00,0x00,0x00, 4, // 0x2E '.' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x00,0x00, 5, // 0x2F '/' 0x00,0x00,0x08,0x08,0x10,0x10,0x20,0x20,0x40,0x40,0x80,0x80,0x00, 7, // 0x30 '0' 0x00,0x00,0x00,0x38,0x44,0x44,0x44,0x44,0x44,0x44,0x38,0x00,0x00, 7, // 0x31 '1' 0x00,0x00,0x00,0x10,0x70,0x10,0x10,0x10,0x10,0x10,0x7C,0x00,0x00, 7, // 0x32 '2' 0x00,0x00,0x00,0x38,0x44,0x04,0x08,0x10,0x20,0x40,0x7C,0x00,0x00, 7, // 0x33 '3' 0x00,0x00,0x00,0x38,0x44,0x04,0x18,0x04,0x04,0x44,0x38,0x00,0x00, 7, // 0x34 '4' 0x00,0x00,0x00,0x08,0x18,0x28,0x48,0x88,0xFC,0x08,0x08,0x00,0x00, 7, // 0x35 '5' 0x00,0x00,0x00,0x7C,0x40,0x40,0x78,0x04,0x04,0x44,0x38,0x00,0x00, 7, // 0x36 '6' 0x00,0x00,0x00,0x18,0x20,0x40,0x78,0x44,0x44,0x44,0x38,0x00,0x00, 7, // 0x37 '7' 0x00,0x00,0x00,0x7C,0x04,0x08,0x08,0x10,0x10,0x20,0x20,0x00,0x00, 7, // 0x38 '8' 0x00,0x00,0x00,0x38,0x44,0x44,0x38,0x44,0x44,0x44,0x38,0x00,0x00, 7, // 0x39 '9' 0x00,0x00,0x00,0x38,0x44,0x44,0x44,0x3C,0x04,0x08,0x30,0x00,0x00, 5, // 0x3A ':' 0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x00,0x00,0x20,0x20,0x00,0x00, 5, // 0x3B ';' 0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x00,0x00,0x20,0x20,0x20,0x40, 9, // 0x3C '<' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x18,0x00,0x60,0x00,0x18,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x3D '=' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x00,0x00,0x00,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x3E '>' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x0C,0x00,0x03,0x00,0x0C,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 6, // 0x3F '?' 0x00,0x00,0x00,0x70,0x08,0x08,0x10,0x20,0x20,0x00,0x20,0x00,0x00, 10, // 0x40 '@' 0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x00,0x20,0x80,0x4E,0x80,0x52,0x80,0x52,0x80,0x52,0x80,0x4D,0x00,0x20,0x00,0x1E,0x00,0x00,0x00, 8, // 0x41 'A' 0x00,0x00,0x00,0x18,0x18,0x24,0x24,0x24,0x7E,0x42,0x42,0x00,0x00, 8, // 0x42 'B' 0x00,0x00,0x00,0x78,0x44,0x44,0x7C,0x42,0x42,0x42,0x7C,0x00,0x00, 9, // 0x43 'C' 0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x21,0x00,0x40,0x00,0x40,0x00,0x40,0x00,0x40,0x00,0x21,0x00,0x1E,0x00,0x00,0x00,0x00,0x00, 9, // 0x44 'D' 0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x00,0x42,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x42,0x00,0x7C,0x00,0x00,0x00,0x00,0x00, 7, // 0x45 'E' 0x00,0x00,0x00,0x7C,0x40,0x40,0x7C,0x40,0x40,0x40,0x7C,0x00,0x00, 6, // 0x46 'F' 0x00,0x00,0x00,0x7C,0x40,0x40,0x78,0x40,0x40,0x40,0x40,0x00,0x00, 9, // 0x47 'G' 0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x21,0x00,0x40,0x00,0x40,0x00,0x47,0x00,0x41,0x00,0x21,0x00,0x1E,0x00,0x00,0x00,0x00,0x00, 8, // 0x48 'H' 0x00,0x00,0x00,0x42,0x42,0x42,0x7E,0x42,0x42,0x42,0x42,0x00,0x00, 5, // 0x49 'I' 0x00,0x00,0x00,0x70,0x20,0x20,0x20,0x20,0x20,0x20,0x70,0x00,0x00, 5, // 0x4A 'J' 0x00,0x00,0x00,0x70,0x10,0x10,0x10,0x10,0x10,0x10,0xE0,0x00,0x00, 8, // 0x4B 'K' 0x00,0x00,0x00,0x42,0x44,0x48,0x50,0x70,0x48,0x44,0x42,0x00,0x00, 6, // 0x4C 'L' 0x00,0x00,0x00,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x7C,0x00,0x00, 9, // 0x4D 'M' 0x00,0x00,0x00,0x00,0x00,0x00,0x63,0x00,0x63,0x00,0x55,0x00,0x55,0x00,0x49,0x00,0x49,0x00,0x41,0x00,0x41,0x00,0x00,0x00,0x00,0x00, 8, // 0x4E 'N' 0x00,0x00,0x00,0x62,0x62,0x52,0x52,0x4A,0x4A,0x46,0x46,0x00,0x00, 9, // 0x4F 'O' 0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0x00,0x22,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x22,0x00,0x1C,0x00,0x00,0x00,0x00,0x00, 7, // 0x50 'P' 0x00,0x00,0x00,0x78,0x44,0x44,0x44,0x78,0x40,0x40,0x40,0x00,0x00, 9, // 0x51 'Q' 0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0x00,0x22,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x22,0x00,0x1C,0x00,0x04,0x00,0x03,0x00, 8, // 0x52 'R' 0x00,0x00,0x00,0x78,0x44,0x44,0x44,0x78,0x48,0x44,0x42,0x00,0x00, 8, // 0x53 'S' 0x00,0x00,0x00,0x3C,0x42,0x40,0x30,0x0C,0x02,0x42,0x3C,0x00,0x00, 7, // 0x54 'T' 0x00,0x00,0x00,0xFE,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x00,0x00, 8, // 0x55 'U' 0x00,0x00,0x00,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x3C,0x00,0x00, 8, // 0x56 'V' 0x00,0x00,0x00,0x42,0x42,0x42,0x24,0x24,0x24,0x18,0x18,0x00,0x00, 11, // 0x57 'W' 0x00,0x00,0x00,0x00,0x00,0x00,0x44,0x40,0x44,0x40,0x2A,0x80,0x2A,0x80,0x2A,0x80,0x2A,0x80,0x11,0x00,0x11,0x00,0x00,0x00,0x00,0x00, 8, // 0x58 'X' 0x00,0x00,0x00,0x42,0x42,0x24,0x18,0x18,0x24,0x42,0x42,0x00,0x00, 7, // 0x59 'Y' 0x00,0x00,0x00,0x82,0x44,0x28,0x10,0x10,0x10,0x10,0x10,0x00,0x00, 8, // 0x5A 'Z' 0x00,0x00,0x00,0x7E,0x02,0x04,0x08,0x10,0x20,0x40,0x7E,0x00,0x00, 5, // 0x5B '[' 0x00,0x00,0x70,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x70, 5, // 0x5C '\' 0x00,0x00,0x80,0x80,0x40,0x40,0x20,0x20,0x10,0x10,0x08,0x08,0x00, 5, // 0x5D ']' 0x00,0x00,0x70,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x70, 9, // 0x5E '^' 0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x14,0x00,0x22,0x00,0x41,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 7, // 0x5F '_' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE, 7, // 0x60 '`' 0x00,0x00,0x20,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 7, // 0x61 'a' 0x00,0x00,0x00,0x00,0x00,0x38,0x04,0x3C,0x44,0x44,0x3C,0x00,0x00, 7, // 0x62 'b' 0x00,0x00,0x40,0x40,0x40,0x78,0x44,0x44,0x44,0x44,0x78,0x00,0x00, 6, // 0x63 'c' 0x00,0x00,0x00,0x00,0x00,0x38,0x44,0x40,0x40,0x44,0x38,0x00,0x00, 7, // 0x64 'd' 0x00,0x00,0x04,0x04,0x04,0x3C,0x44,0x44,0x44,0x44,0x3C,0x00,0x00, 7, // 0x65 'e' 0x00,0x00,0x00,0x00,0x00,0x38,0x44,0x7C,0x40,0x44,0x38,0x00,0x00, 4, // 0x66 'f' 0x00,0x00,0x30,0x40,0x40,0xF0,0x40,0x40,0x40,0x40,0x40,0x00,0x00, 7, // 0x67 'g' 0x00,0x00,0x00,0x00,0x00,0x3C,0x44,0x44,0x44,0x44,0x3C,0x04,0x38, 7, // 0x68 'h' 0x00,0x00,0x40,0x40,0x40,0x78,0x44,0x44,0x44,0x44,0x44,0x00,0x00, 3, // 0x69 'i' 0x00,0x00,0x40,0x00,0x00,0x40,0x40,0x40,0x40,0x40,0x40,0x00,0x00, 4, // 0x6A 'j' 0x00,0x00,0x20,0x00,0x00,0x60,0x20,0x20,0x20,0x20,0x20,0x20,0xC0, 7, // 0x6B 'k' 0x00,0x00,0x40,0x40,0x40,0x44,0x48,0x50,0x70,0x48,0x44,0x00,0x00, 3, // 0x6C 'l' 0x00,0x00,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x00,0x00, 11, // 0x6D 'm' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7B,0x80,0x44,0x40,0x44,0x40,0x44,0x40,0x44,0x40,0x44,0x40,0x00,0x00,0x00,0x00, 7, // 0x6E 'n' 0x00,0x00,0x00,0x00,0x00,0x78,0x44,0x44,0x44,0x44,0x44,0x00,0x00, 7, // 0x6F 'o' 0x00,0x00,0x00,0x00,0x00,0x38,0x44,0x44,0x44,0x44,0x38,0x00,0x00, 7, // 0x70 'p' 0x00,0x00,0x00,0x00,0x00,0x78,0x44,0x44,0x44,0x44,0x78,0x40,0x40, 7, // 0x71 'q' 0x00,0x00,0x00,0x00,0x00,0x3C,0x44,0x44,0x44,0x44,0x3C,0x04,0x04, 5, // 0x72 'r' 0x00,0x00,0x00,0x00,0x00,0x58,0x60,0x40,0x40,0x40,0x40,0x00,0x00, 6, // 0x73 's' 0x00,0x00,0x00,0x00,0x00,0x38,0x40,0x60,0x18,0x08,0x70,0x00,0x00, 4, // 0x74 't' 0x00,0x00,0x00,0x40,0x40,0xF0,0x40,0x40,0x40,0x40,0x30,0x00,0x00, 7, // 0x75 'u' 0x00,0x00,0x00,0x00,0x00,0x44,0x44,0x44,0x44,0x44,0x3C,0x00,0x00, 7, // 0x76 'v' 0x00,0x00,0x00,0x00,0x00,0x44,0x44,0x28,0x28,0x10,0x10,0x00,0x00, 9, // 0x77 'w' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x49,0x00,0x49,0x00,0x55,0x00,0x55,0x00,0x22,0x00,0x22,0x00,0x00,0x00,0x00,0x00, 7, // 0x78 'x' 0x00,0x00,0x00,0x00,0x00,0x44,0x28,0x10,0x10,0x28,0x44,0x00,0x00, 7, // 0x79 'y' 0x00,0x00,0x00,0x00,0x00,0x44,0x28,0x28,0x28,0x10,0x10,0x10,0x20, 6, // 0x7A 'z' 0x00,0x00,0x00,0x00,0x00,0x78,0x08,0x10,0x20,0x40,0x78,0x00,0x00, 7, // 0x7B '{' 0x00,0x00,0x0C,0x10,0x10,0x10,0x10,0x60,0x10,0x10,0x10,0x10,0x0C, 5, // 0x7C '|' 0x00,0x00,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, 7, // 0x7D '}' 0x00,0x00,0x60,0x10,0x10,0x10,0x10,0x0C,0x10,0x10,0x10,0x10,0x60, 9, // 0x7E '~' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x31,0x00,0x49,0x00,0x46,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 11, // 0x7F '' 0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x80,0x40,0x80,0x40,0x80,0x40,0x80,0x40,0x80,0x40,0x80,0x40,0x80,0x7F,0x80,0x00,0x00,0x00,0x00, 0 }; 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, 0xA5,0x00,0xB3,0x00,0xC1,0x00,0xDC,0x00,0xEA,0x00,0xF8,0x00,0x06,0x01,0x14,0x01,0x22,0x01, 0x30,0x01,0x3E,0x01,0x4C,0x01,0x5A,0x01,0x68,0x01,0x76,0x01,0x84,0x01,0x92,0x01,0xA0,0x01, 0xAE,0x01,0xBC,0x01,0xD7,0x01,0xF2,0x01,0x0D,0x02,0x1B,0x02,0x36,0x02,0x51,0x02,0x5F,0x02, 0x6D,0x02,0x88,0x02,0x96,0x02,0xA4,0x02,0xBF,0x02,0xDA,0x02,0xE8,0x02,0xF6,0x02,0x04,0x03, 0x12,0x03,0x2D,0x03,0x48,0x03,0x63,0x03,0x71,0x03,0x8C,0x03,0x9A,0x03,0xA8,0x03,0xB6,0x03, 0xD1,0x03,0xDF,0x03,0xFA,0x03,0x08,0x04,0x16,0x04,0x24,0x04,0x32,0x04,0x40,0x04,0x4E,0x04, 0x69,0x04,0x77,0x04,0x85,0x04,0x93,0x04,0xA1,0x04,0xAF,0x04,0xBD,0x04,0xCB,0x04,0xD9,0x04, 0xE7,0x04,0xF5,0x04,0x03,0x05,0x11,0x05,0x1F,0x05,0x2D,0x05,0x48,0x05,0x56,0x05,0x64,0x05, 0x72,0x05,0x80,0x05,0x8E,0x05,0x9C,0x05,0xAA,0x05,0xB8,0x05,0xC6,0x05,0xE1,0x05,0xEF,0x05, 0xFD,0x05,0x0B,0x06,0x19,0x06,0x27,0x06,0x35,0x06,0x50,0x06, 4, // 0x20 ' ' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 4, // 0x21 '!' 0x00,0x00,0x00,0x60,0x60,0x60,0x60,0x60,0x60,0x00,0x60,0x00,0x00, 7, // 0x22 '"' 0x00,0x00,0x6C,0x6C,0x6C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x23 '#' 0x00,0x00,0x00,0x00,0x00,0x00,0x0A,0x00,0x0A,0x00,0x3F,0x00,0x14,0x00,0x14,0x00,0x7E,0x00,0x28,0x00,0x28,0x00,0x00,0x00,0x00,0x00, 8, // 0x24 '$' 0x00,0x00,0x08,0x08,0x3C,0x6A,0x68,0x3C,0x16,0x56,0x3C,0x10,0x10, 14, // 0x25 '%' 0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x80,0x6C,0x80,0x6D,0x00,0x6D,0x70,0x3A,0xD8,0x02,0xD8,0x04,0xD8,0x04,0x70,0x00,0x00,0x00,0x00, 10, // 0x26 '&' 0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x6C,0x00,0x6C,0x00,0x39,0x80,0x6D,0x00,0x66,0x00,0x63,0x00,0x3D,0x80,0x00,0x00,0x00,0x00, 4, // 0x27 ''' 0x00,0x00,0x60,0x60,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 6, // 0x28 '(' 0x00,0x00,0x18,0x30,0x30,0x60,0x60,0x60,0x60,0x60,0x30,0x30,0x18, 6, // 0x29 ')' 0x00,0x00,0x60,0x30,0x30,0x18,0x18,0x18,0x18,0x18,0x30,0x30,0x60, 8, // 0x2A '*' 0x00,0x00,0x10,0x54,0x38,0x54,0x10,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x2B '+' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x7F,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x00,0x00,0x00,0x00, 4, // 0x2C ',' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x60,0x60,0x40, 6, // 0x2D '-' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x00,0x00, 4, // 0x2E '.' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x60,0x00,0x00, 8, // 0x2F '/' 0x00,0x00,0x06,0x06,0x0C,0x0C,0x18,0x18,0x18,0x30,0x30,0x60,0x60, 8, // 0x30 '0' 0x00,0x00,0x00,0x3C,0x66,0x66,0x66,0x66,0x66,0x66,0x3C,0x00,0x00, 8, // 0x31 '1' 0x00,0x00,0x00,0x18,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00, 8, // 0x32 '2' 0x00,0x00,0x00,0x3C,0x66,0x06,0x0C,0x18,0x30,0x60,0x7E,0x00,0x00, 8, // 0x33 '3' 0x00,0x00,0x00,0x3C,0x66,0x06,0x1C,0x06,0x06,0x66,0x3C,0x00,0x00, 8, // 0x34 '4' 0x00,0x00,0x00,0x04,0x0C,0x1C,0x2C,0x4C,0x7E,0x0C,0x0C,0x00,0x00, 8, // 0x35 '5' 0x00,0x00,0x00,0x3E,0x30,0x30,0x3C,0x06,0x06,0x66,0x3C,0x00,0x00, 8, // 0x36 '6' 0x00,0x00,0x00,0x1C,0x30,0x60,0x7C,0x66,0x66,0x66,0x3C,0x00,0x00, 8, // 0x37 '7' 0x00,0x00,0x00,0x7E,0x06,0x0C,0x0C,0x18,0x18,0x30,0x30,0x00,0x00, 8, // 0x38 '8' 0x00,0x00,0x00,0x3C,0x66,0x66,0x3C,0x66,0x66,0x66,0x3C,0x00,0x00, 8, // 0x39 '9' 0x00,0x00,0x00,0x3C,0x66,0x66,0x66,0x3E,0x06,0x0C,0x38,0x00,0x00, 4, // 0x3A ':' 0x00,0x00,0x00,0x00,0x00,0x60,0x60,0x00,0x00,0x60,0x60,0x00,0x00, 4, // 0x3B ';' 0x00,0x00,0x00,0x00,0x00,0x60,0x60,0x00,0x00,0x60,0x60,0x60,0x40, 9, // 0x3C '<' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x0C,0x00,0x30,0x00,0x40,0x00,0x30,0x00,0x0C,0x00,0x03,0x00,0x00,0x00,0x00,0x00, 9, // 0x3D '=' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x00,0x00,0x00,0x00,0x00,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x3E '>' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x18,0x00,0x06,0x00,0x01,0x00,0x06,0x00,0x18,0x00,0x60,0x00,0x00,0x00,0x00,0x00, 7, // 0x3F '?' 0x00,0x00,0x00,0x38,0x4C,0x0C,0x18,0x30,0x30,0x00,0x30,0x00,0x00, 11, // 0x40 '@' 0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x80,0x20,0x40,0x4F,0x40,0x5B,0x40,0x5B,0x40,0x5B,0x40,0x4F,0x80,0x20,0x00,0x1F,0x00,0x00,0x00, 9, // 0x41 'A' 0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0x00,0x1C,0x00,0x36,0x00,0x36,0x00,0x36,0x00,0x7F,0x00,0x63,0x00,0x63,0x00,0x00,0x00,0x00,0x00, 8, // 0x42 'B' 0x00,0x00,0x00,0x7C,0x66,0x66,0x7C,0x66,0x66,0x66,0x7C,0x00,0x00, 8, // 0x43 'C' 0x00,0x00,0x00,0x3C,0x62,0x60,0x60,0x60,0x60,0x62,0x3C,0x00,0x00, 9, // 0x44 'D' 0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x00,0x66,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x66,0x00,0x7C,0x00,0x00,0x00,0x00,0x00, 8, // 0x45 'E' 0x00,0x00,0x00,0x7E,0x60,0x60,0x7E,0x60,0x60,0x60,0x7E,0x00,0x00, 8, // 0x46 'F' 0x00,0x00,0x00,0x7E,0x60,0x60,0x7E,0x60,0x60,0x60,0x60,0x00,0x00, 9, // 0x47 'G' 0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x00,0x61,0x00,0x60,0x00,0x60,0x00,0x67,0x00,0x63,0x00,0x63,0x00,0x3F,0x00,0x00,0x00,0x00,0x00, 9, // 0x48 'H' 0x00,0x00,0x00,0x00,0x00,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x7F,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x00,0x00,0x00,0x00, 6, // 0x49 'I' 0x00,0x00,0x00,0x78,0x30,0x30,0x30,0x30,0x30,0x30,0x78,0x00,0x00, 6, // 0x4A 'J' 0x00,0x00,0x00,0x78,0x18,0x18,0x18,0x18,0x18,0x18,0xF0,0x00,0x00, 8, // 0x4B 'K' 0x00,0x00,0x00,0x66,0x6C,0x78,0x70,0x70,0x78,0x6C,0x66,0x00,0x00, 7, // 0x4C 'L' 0x00,0x00,0x00,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x7E,0x00,0x00, 10, // 0x4D 'M' 0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x80,0x71,0x80,0x7B,0x80,0x5D,0x80,0x49,0x80,0x41,0x80,0x41,0x80,0x41,0x80,0x00,0x00,0x00,0x00, 9, // 0x4E 'N' 0x00,0x00,0x00,0x00,0x00,0x00,0x41,0x00,0x61,0x00,0x71,0x00,0x59,0x00,0x4D,0x00,0x47,0x00,0x43,0x00,0x41,0x00,0x00,0x00,0x00,0x00, 9, // 0x4F 'O' 0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x3E,0x00,0x00,0x00,0x00,0x00, 8, // 0x50 'P' 0x00,0x00,0x00,0x7C,0x66,0x66,0x66,0x7C,0x60,0x60,0x60,0x00,0x00, 9, // 0x51 'Q' 0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x3E,0x00,0x0C,0x00,0x07,0x00, 8, // 0x52 'R' 0x00,0x00,0x00,0x7C,0x66,0x66,0x66,0x7C,0x6C,0x66,0x63,0x00,0x00, 8, // 0x53 'S' 0x00,0x00,0x00,0x3C,0x62,0x60,0x7C,0x3E,0x06,0x46,0x3C,0x00,0x00, 8, // 0x54 'T' 0x00,0x00,0x00,0xFF,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00, 9, // 0x55 'U' 0x00,0x00,0x00,0x00,0x00,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x3E,0x00,0x00,0x00,0x00,0x00, 8, // 0x56 'V' 0x00,0x00,0x00,0x66,0x66,0x66,0x3C,0x3C,0x3C,0x18,0x18,0x00,0x00, 12, // 0x57 'W' 0x00,0x00,0x00,0x00,0x00,0x00,0x66,0x60,0x66,0x60,0x66,0x60,0x36,0xC0,0x3F,0xC0,0x39,0xC0,0x19,0x80,0x19,0x80,0x00,0x00,0x00,0x00, 8, // 0x58 'X' 0x00,0x00,0x00,0x66,0x66,0x3C,0x18,0x18,0x3C,0x66,0x66,0x00,0x00, 8, // 0x59 'Y' 0x00,0x00,0x00,0x66,0x66,0x3C,0x3C,0x18,0x18,0x18,0x18,0x00,0x00, 8, // 0x5A 'Z' 0x00,0x00,0x00,0x7E,0x06,0x0E,0x1C,0x38,0x70,0x60,0x7E,0x00,0x00, 6, // 0x5B '[' 0x00,0x00,0x78,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x78, 8, // 0x5C '\' 0x00,0x00,0x60,0x60,0x30,0x30,0x18,0x18,0x18,0x0C,0x0C,0x06,0x06, 6, // 0x5D ']' 0x00,0x00,0x78,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x78, 10, // 0x5E '^' 0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 8, // 0x5F '_' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF, 8, // 0x60 '`' 0x00,0x00,0x30,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 8, // 0x61 'a' 0x00,0x00,0x00,0x00,0x00,0x3C,0x06,0x3E,0x66,0x66,0x3E,0x00,0x00, 8, // 0x62 'b' 0x00,0x00,0x60,0x60,0x60,0x7C,0x66,0x66,0x66,0x66,0x7C,0x00,0x00, 7, // 0x63 'c' 0x00,0x00,0x00,0x00,0x00,0x3C,0x60,0x60,0x60,0x60,0x3C,0x00,0x00, 8, // 0x64 'd' 0x00,0x00,0x06,0x06,0x06,0x3E,0x66,0x66,0x66,0x66,0x3E,0x00,0x00, 8, // 0x65 'e' 0x00,0x00,0x00,0x00,0x00,0x3C,0x66,0x7E,0x60,0x62,0x3C,0x00,0x00, 5, // 0x66 'f' 0x00,0x00,0x38,0x60,0x60,0xF8,0x60,0x60,0x60,0x60,0x60,0x00,0x00, 8, // 0x67 'g' 0x00,0x00,0x00,0x00,0x00,0x3E,0x66,0x66,0x66,0x66,0x3E,0x06,0x3C, 8, // 0x68 'h' 0x00,0x00,0x60,0x60,0x60,0x7C,0x66,0x66,0x66,0x66,0x66,0x00,0x00, 4, // 0x69 'i' 0x00,0x00,0x00,0x60,0x00,0x60,0x60,0x60,0x60,0x60,0x60,0x00,0x00, 5, // 0x6A 'j' 0x00,0x00,0x00,0x30,0x00,0x70,0x30,0x30,0x30,0x30,0x30,0x30,0xE0, 8, // 0x6B 'k' 0x00,0x00,0x60,0x60,0x60,0x66,0x6C,0x78,0x78,0x6C,0x66,0x00,0x00, 4, // 0x6C 'l' 0x00,0x00,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x00,0x00, 12, // 0x6D 'm' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7D,0xC0,0x66,0x60,0x66,0x60,0x66,0x60,0x66,0x60,0x66,0x60,0x00,0x00,0x00,0x00, 8, // 0x6E 'n' 0x00,0x00,0x00,0x00,0x00,0x7C,0x66,0x66,0x66,0x66,0x66,0x00,0x00, 8, // 0x6F 'o' 0x00,0x00,0x00,0x00,0x00,0x3C,0x66,0x66,0x66,0x66,0x3C,0x00,0x00, 8, // 0x70 'p' 0x00,0x00,0x00,0x00,0x00,0x7C,0x66,0x66,0x66,0x66,0x7C,0x60,0x60, 8, // 0x71 'q' 0x00,0x00,0x00,0x00,0x00,0x3E,0x66,0x66,0x66,0x66,0x3E,0x06,0x06, 6, // 0x72 'r' 0x00,0x00,0x00,0x00,0x00,0x6C,0x7C,0x60,0x60,0x60,0x60,0x00,0x00, 7, // 0x73 's' 0x00,0x00,0x00,0x00,0x00,0x3C,0x60,0x78,0x3C,0x0C,0x78,0x00,0x00, 5, // 0x74 't' 0x00,0x00,0x00,0x60,0x60,0xF8,0x60,0x60,0x60,0x60,0x38,0x00,0x00, 8, // 0x75 'u' 0x00,0x00,0x00,0x00,0x00,0x66,0x66,0x66,0x66,0x66,0x3E,0x00,0x00, 8, // 0x76 'v' 0x00,0x00,0x00,0x00,0x00,0x66,0x66,0x66,0x3C,0x3C,0x18,0x00,0x00, 10, // 0x77 'w' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6D,0x80,0x6D,0x80,0x6D,0x80,0x6D,0x80,0x33,0x00,0x33,0x00,0x00,0x00,0x00,0x00, 8, // 0x78 'x' 0x00,0x00,0x00,0x00,0x00,0x66,0x66,0x3C,0x3C,0x66,0x66,0x00,0x00, 8, // 0x79 'y' 0x00,0x00,0x00,0x00,0x00,0x66,0x66,0x3C,0x3C,0x18,0x18,0x30,0x30, 7, // 0x7A 'z' 0x00,0x00,0x00,0x00,0x00,0x7C,0x0C,0x18,0x30,0x60,0x7C,0x00,0x00, 8, // 0x7B '{' 0x00,0x00,0x0E,0x18,0x18,0x18,0x18,0x70,0x18,0x18,0x18,0x18,0x0E, 6, // 0x7C '|' 0x00,0x00,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30, 8, // 0x7D '}' 0x00,0x00,0x70,0x18,0x18,0x18,0x18,0x0E,0x18,0x18,0x18,0x18,0x70, 9, // 0x7E '~' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x31,0x00,0x49,0x00,0x49,0x00,0x46,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 11, // 0x7F '' 0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x80,0x40,0x80,0x40,0x80,0x40,0x80,0x40,0x80,0x40,0x80,0x40,0x80,0x7F,0x80,0x00,0x00,0x00,0x00, 0 }; 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, 0xB1,0x00,0xC0,0x00,0xCF,0x00,0xEC,0x00,0xFB,0x00,0x0A,0x01,0x19,0x01,0x28,0x01,0x37,0x01, 0x46,0x01,0x55,0x01,0x64,0x01,0x73,0x01,0x82,0x01,0x91,0x01,0xA0,0x01,0xAF,0x01,0xBE,0x01, 0xCD,0x01,0xDC,0x01,0xF9,0x01,0x16,0x02,0x33,0x02,0x42,0x02,0x5F,0x02,0x6E,0x02,0x7D,0x02, 0x9A,0x02,0xB7,0x02,0xC6,0x02,0xD5,0x02,0xF2,0x02,0x0F,0x03,0x1E,0x03,0x2D,0x03,0x3C,0x03, 0x4B,0x03,0x68,0x03,0x85,0x03,0xA2,0x03,0xB1,0x03,0xCE,0x03,0xDD,0x03,0xEC,0x03,0xFB,0x03, 0x18,0x04,0x27,0x04,0x44,0x04,0x53,0x04,0x62,0x04,0x71,0x04,0x80,0x04,0x8F,0x04,0x9E,0x04, 0xBB,0x04,0xCA,0x04,0xD9,0x04,0xE8,0x04,0xF7,0x04,0x06,0x05,0x15,0x05,0x24,0x05,0x33,0x05, 0x42,0x05,0x51,0x05,0x60,0x05,0x6F,0x05,0x7E,0x05,0x8D,0x05,0xAA,0x05,0xB9,0x05,0xC8,0x05, 0xD7,0x05,0xE6,0x05,0xF5,0x05,0x04,0x06,0x13,0x06,0x22,0x06,0x31,0x06,0x4E,0x06,0x5D,0x06, 0x6C,0x06,0x7B,0x06,0x8A,0x06,0x99,0x06,0xA8,0x06,0xC5,0x06, 4, // 0x20 ' ' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 5, // 0x21 '!' 0x00,0x00,0x00,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x00,0x20,0x00,0x00, 6, // 0x22 '"' 0x00,0x00,0x48,0x48,0x48,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 10, // 0x23 '#' 0x00,0x00,0x00,0x00,0x00,0x00,0x09,0x00,0x09,0x00,0x12,0x00,0x3F,0x80,0x12,0x00,0x12,0x00,0x7F,0x00,0x24,0x00,0x24,0x00,0x00,0x00,0x00,0x00, 8, // 0x24 '$' 0x00,0x00,0x10,0x10,0x3E,0x50,0x50,0x30,0x1C,0x12,0x12,0x7C,0x10,0x10, 13, // 0x25 '%' 0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x80,0x49,0x00,0x49,0x00,0x4A,0x00,0x32,0x60,0x02,0x90,0x04,0x90,0x04,0x90,0x08,0x60,0x00,0x00,0x00,0x00, 10, // 0x26 '&' 0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x44,0x00,0x44,0x00,0x44,0x00,0x39,0x00,0x45,0x00,0x42,0x00,0x43,0x00,0x3C,0x80,0x00,0x00,0x00,0x00, 3, // 0x27 ''' 0x00,0x00,0x40,0x40,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 5, // 0x28 '(' 0x00,0x00,0x10,0x20,0x20,0x40,0x40,0x40,0x40,0x40,0x40,0x20,0x20,0x10, 5, // 0x29 ')' 0x00,0x00,0x40,0x20,0x20,0x10,0x10,0x10,0x10,0x10,0x10,0x20,0x20,0x40, 8, // 0x2A '*' 0x00,0x00,0x10,0x54,0x38,0x54,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x2B '+' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x7F,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x00,0x00,0x00,0x00, 4, // 0x2C ',' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x20,0x40, 5, // 0x2D '-' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x00,0x00, 4, // 0x2E '.' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x00,0x00, 5, // 0x2F '/' 0x00,0x00,0x08,0x08,0x10,0x10,0x10,0x20,0x20,0x20,0x40,0x40,0x40,0x80, 8, // 0x30 '0' 0x00,0x00,0x00,0x3C,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x3C,0x00,0x00, 8, // 0x31 '1' 0x00,0x00,0x00,0x08,0x38,0x08,0x08,0x08,0x08,0x08,0x08,0x3E,0x00,0x00, 8, // 0x32 '2' 0x00,0x00,0x00,0x3C,0x42,0x42,0x02,0x04,0x18,0x20,0x40,0x7E,0x00,0x00, 8, // 0x33 '3' 0x00,0x00,0x00,0x3C,0x42,0x02,0x02,0x1C,0x02,0x02,0x42,0x3C,0x00,0x00, 8, // 0x34 '4' 0x00,0x00,0x00,0x04,0x0C,0x14,0x24,0x44,0x7F,0x04,0x04,0x04,0x00,0x00, 8, // 0x35 '5' 0x00,0x00,0x00,0x7E,0x40,0x40,0x7C,0x02,0x02,0x02,0x42,0x3C,0x00,0x00, 8, // 0x36 '6' 0x00,0x00,0x00,0x1C,0x20,0x40,0x7C,0x42,0x42,0x42,0x42,0x3C,0x00,0x00, 8, // 0x37 '7' 0x00,0x00,0x00,0x7E,0x02,0x04,0x04,0x08,0x08,0x10,0x10,0x20,0x00,0x00, 8, // 0x38 '8' 0x00,0x00,0x00,0x3C,0x42,0x42,0x42,0x3C,0x42,0x42,0x42,0x3C,0x00,0x00, 8, // 0x39 '9' 0x00,0x00,0x00,0x3C,0x42,0x42,0x42,0x42,0x3E,0x02,0x04,0x38,0x00,0x00, 5, // 0x3A ':' 0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x00,0x00,0x00,0x20,0x20,0x00,0x00, 5, // 0x3B ';' 0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x00,0x00,0x00,0x20,0x20,0x20,0x40, 9, // 0x3C '<' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x0C,0x00,0x30,0x00,0x40,0x00,0x30,0x00,0x0C,0x00,0x03,0x00,0x00,0x00,0x00,0x00, 9, // 0x3D '=' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x00,0x00,0x00,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x3E '>' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x18,0x00,0x06,0x00,0x01,0x00,0x06,0x00,0x18,0x00,0x60,0x00,0x00,0x00,0x00,0x00, 7, // 0x3F '?' 0x00,0x00,0x00,0x38,0x44,0x04,0x04,0x08,0x10,0x10,0x00,0x10,0x00,0x00, 12, // 0x40 '@' 0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x00,0x30,0xC0,0x27,0x40,0x49,0x20,0x49,0x20,0x49,0x20,0x49,0x20,0x27,0xC0,0x30,0x00,0x0F,0x00,0x00,0x00, 8, // 0x41 'A' 0x00,0x00,0x00,0x18,0x18,0x24,0x24,0x42,0x42,0x7E,0x81,0x81,0x00,0x00, 8, // 0x42 'B' 0x00,0x00,0x00,0x78,0x44,0x44,0x44,0x7C,0x42,0x42,0x42,0x7C,0x00,0x00, 9, // 0x43 'C' 0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x21,0x00,0x40,0x00,0x40,0x00,0x40,0x00,0x40,0x00,0x40,0x00,0x21,0x00,0x1E,0x00,0x00,0x00,0x00,0x00, 9, // 0x44 'D' 0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x00,0x42,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x42,0x00,0x7C,0x00,0x00,0x00,0x00,0x00, 8, // 0x45 'E' 0x00,0x00,0x00,0x7E,0x40,0x40,0x40,0x7E,0x40,0x40,0x40,0x7E,0x00,0x00, 7, // 0x46 'F' 0x00,0x00,0x00,0x7E,0x40,0x40,0x40,0x7C,0x40,0x40,0x40,0x40,0x00,0x00, 9, // 0x47 'G' 0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x21,0x00,0x40,0x00,0x40,0x00,0x47,0x00,0x41,0x00,0x41,0x00,0x21,0x00,0x1E,0x00,0x00,0x00,0x00,0x00, 9, // 0x48 'H' 0x00,0x00,0x00,0x00,0x00,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x7F,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x00,0x00,0x00,0x00, 5, // 0x49 'I' 0x00,0x00,0x00,0x70,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x70,0x00,0x00, 5, // 0x4A 'J' 0x00,0x00,0x00,0x70,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0xE0,0x00,0x00, 8, // 0x4B 'K' 0x00,0x00,0x00,0x42,0x44,0x48,0x50,0x60,0x50,0x48,0x44,0x42,0x00,0x00, 7, // 0x4C 'L' 0x00,0x00,0x00,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x7E,0x00,0x00, 10, // 0x4D 'M' 0x00,0x00,0x00,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x52,0x80,0x52,0x80,0x52,0x80,0x4C,0x80,0x4C,0x80,0x40,0x80,0x40,0x80,0x00,0x00,0x00,0x00, 9, // 0x4E 'N' 0x00,0x00,0x00,0x00,0x00,0x00,0x61,0x00,0x61,0x00,0x51,0x00,0x51,0x00,0x49,0x00,0x45,0x00,0x45,0x00,0x43,0x00,0x43,0x00,0x00,0x00,0x00,0x00, 10, // 0x4F 'O' 0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x21,0x00,0x40,0x80,0x40,0x80,0x40,0x80,0x40,0x80,0x40,0x80,0x21,0x00,0x1E,0x00,0x00,0x00,0x00,0x00, 8, // 0x50 'P' 0x00,0x00,0x00,0x7C,0x42,0x42,0x42,0x42,0x7C,0x40,0x40,0x40,0x00,0x00, 10, // 0x51 'Q' 0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x21,0x00,0x40,0x80,0x40,0x80,0x40,0x80,0x40,0x80,0x40,0x80,0x21,0x00,0x1E,0x00,0x02,0x00,0x01,0x80, 8, // 0x52 'R' 0x00,0x00,0x00,0x7C,0x42,0x42,0x42,0x7C,0x48,0x44,0x42,0x41,0x00,0x00, 8, // 0x53 'S' 0x00,0x00,0x00,0x3C,0x42,0x40,0x40,0x3C,0x02,0x02,0x42,0x3C,0x00,0x00, 7, // 0x54 'T' 0x00,0x00,0x00,0xFE,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x00,0x00, 9, // 0x55 'U' 0x00,0x00,0x00,0x00,0x00,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x22,0x00,0x1C,0x00,0x00,0x00,0x00,0x00, 8, // 0x56 'V' 0x00,0x00,0x00,0x81,0x81,0x42,0x42,0x42,0x24,0x24,0x18,0x18,0x00,0x00, 13, // 0x57 'W' 0x00,0x00,0x00,0x00,0x00,0x00,0x42,0x10,0x42,0x10,0x45,0x10,0x45,0x10,0x25,0x20,0x28,0xA0,0x28,0xA0,0x10,0x40,0x10,0x40,0x00,0x00,0x00,0x00, 8, // 0x58 'X' 0x00,0x00,0x00,0x42,0x42,0x24,0x18,0x18,0x18,0x24,0x42,0x42,0x00,0x00, 7, // 0x59 'Y' 0x00,0x00,0x00,0x82,0x44,0x44,0x28,0x10,0x10,0x10,0x10,0x10,0x00,0x00, 8, // 0x5A 'Z' 0x00,0x00,0x00,0x7E,0x02,0x04,0x08,0x10,0x10,0x20,0x40,0x7E,0x00,0x00, 5, // 0x5B '[' 0x00,0x00,0x70,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x70, 5, // 0x5C '\' 0x00,0x00,0x80,0x80,0x40,0x40,0x40,0x20,0x20,0x10,0x10,0x10,0x08,0x08, 5, // 0x5D ']' 0x00,0x00,0x70,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x70, 10, // 0x5E '^' 0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x12,0x00,0x21,0x00,0x40,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 8, // 0x5F '_' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF, 8, // 0x60 '`' 0x00,0x00,0x20,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 8, // 0x61 'a' 0x00,0x00,0x00,0x00,0x00,0x3C,0x02,0x02,0x3E,0x42,0x42,0x3E,0x00,0x00, 8, // 0x62 'b' 0x00,0x00,0x40,0x40,0x40,0x5C,0x62,0x42,0x42,0x42,0x42,0x7C,0x00,0x00, 6, // 0x63 'c' 0x00,0x00,0x00,0x00,0x00,0x38,0x44,0x40,0x40,0x40,0x44,0x38,0x00,0x00, 8, // 0x64 'd' 0x00,0x00,0x02,0x02,0x02,0x3E,0x42,0x42,0x42,0x42,0x46,0x3A,0x00,0x00, 8, // 0x65 'e' 0x00,0x00,0x00,0x00,0x00,0x3C,0x42,0x42,0x7E,0x40,0x42,0x3C,0x00,0x00, 4, // 0x66 'f' 0x00,0x00,0x30,0x40,0x40,0xF0,0x40,0x40,0x40,0x40,0x40,0x40,0x00,0x00, 8, // 0x67 'g' 0x00,0x00,0x00,0x00,0x00,0x3E,0x42,0x42,0x42,0x42,0x46,0x3A,0x02,0x3C, 8, // 0x68 'h' 0x00,0x00,0x40,0x40,0x40,0x5C,0x62,0x42,0x42,0x42,0x42,0x42,0x00,0x00, 3, // 0x69 'i' 0x00,0x00,0x40,0x00,0x00,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x00,0x00, 4, // 0x6A 'j' 0x00,0x00,0x20,0x00,0x00,0x60,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0xC0, 7, // 0x6B 'k' 0x00,0x00,0x40,0x40,0x40,0x44,0x48,0x50,0x60,0x50,0x48,0x44,0x00,0x00, 3, // 0x6C 'l' 0x00,0x00,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x00,0x00, 11, // 0x6D 'm' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7B,0x80,0x44,0x40,0x44,0x40,0x44,0x40,0x44,0x40,0x44,0x40,0x44,0x40,0x00,0x00,0x00,0x00, 8, // 0x6E 'n' 0x00,0x00,0x00,0x00,0x00,0x5C,0x62,0x42,0x42,0x42,0x42,0x42,0x00,0x00, 8, // 0x6F 'o' 0x00,0x00,0x00,0x00,0x00,0x3C,0x42,0x42,0x42,0x42,0x42,0x3C,0x00,0x00, 8, // 0x70 'p' 0x00,0x00,0x00,0x00,0x00,0x5C,0x62,0x42,0x42,0x42,0x42,0x7C,0x40,0x40, 8, // 0x71 'q' 0x00,0x00,0x00,0x00,0x00,0x3E,0x42,0x42,0x42,0x42,0x46,0x3A,0x02,0x02, 5, // 0x72 'r' 0x00,0x00,0x00,0x00,0x00,0x58,0x60,0x40,0x40,0x40,0x40,0x40,0x00,0x00, 7, // 0x73 's' 0x00,0x00,0x00,0x00,0x00,0x3C,0x40,0x40,0x38,0x04,0x04,0x78,0x00,0x00, 5, // 0x74 't' 0x00,0x00,0x00,0x40,0x40,0xF8,0x40,0x40,0x40,0x40,0x40,0x38,0x00,0x00, 8, // 0x75 'u' 0x00,0x00,0x00,0x00,0x00,0x42,0x42,0x42,0x42,0x42,0x46,0x3A,0x00,0x00, 7, // 0x76 'v' 0x00,0x00,0x00,0x00,0x00,0x44,0x44,0x28,0x28,0x28,0x10,0x10,0x00,0x00, 11, // 0x77 'w' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x44,0x40,0x44,0x40,0x2A,0x80,0x2A,0x80,0x2A,0x80,0x11,0x00,0x11,0x00,0x00,0x00,0x00,0x00, 7, // 0x78 'x' 0x00,0x00,0x00,0x00,0x00,0x44,0x44,0x28,0x10,0x28,0x44,0x44,0x00,0x00, 7, // 0x79 'y' 0x00,0x00,0x00,0x00,0x00,0x44,0x44,0x28,0x28,0x28,0x10,0x10,0x10,0x20, 7, // 0x7A 'z' 0x00,0x00,0x00,0x00,0x00,0x7C,0x04,0x08,0x10,0x20,0x40,0x7C,0x00,0x00, 8, // 0x7B '{' 0x00,0x00,0x0C,0x10,0x10,0x10,0x10,0x60,0x10,0x10,0x10,0x10,0x10,0x0C, 5, // 0x7C '|' 0x00,0x00,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, 8, // 0x7D '}' 0x00,0x00,0x30,0x08,0x08,0x08,0x08,0x06,0x08,0x08,0x08,0x08,0x08,0x30, 10, // 0x7E '~' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x80,0x4C,0x80,0x43,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 12, // 0x7F '' 0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xE0,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x3F,0xE0,0x00,0x00,0x00,0x00, 0 }; 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, 0xBF,0x00,0xCE,0x00,0xEB,0x00,0x08,0x01,0x17,0x01,0x26,0x01,0x35,0x01,0x44,0x01,0x61,0x01, 0x7E,0x01,0x9B,0x01,0xB8,0x01,0xD5,0x01,0xF2,0x01,0x0F,0x02,0x2C,0x02,0x49,0x02,0x66,0x02, 0x75,0x02,0x84,0x02,0xA1,0x02,0xBE,0x02,0xDB,0x02,0xEA,0x02,0x07,0x03,0x24,0x03,0x41,0x03, 0x5E,0x03,0x7B,0x03,0x8A,0x03,0x99,0x03,0xB6,0x03,0xD3,0x03,0xE2,0x03,0xF1,0x03,0x0E,0x04, 0x1D,0x04,0x3A,0x04,0x57,0x04,0x74,0x04,0x91,0x04,0xAE,0x04,0xCB,0x04,0xE8,0x04,0xF7,0x04, 0x14,0x05,0x31,0x05,0x4E,0x05,0x6B,0x05,0x88,0x05,0x97,0x05,0xA6,0x05,0xB5,0x05,0xC4,0x05, 0xE1,0x05,0xFE,0x05,0x1B,0x06,0x2A,0x06,0x39,0x06,0x48,0x06,0x57,0x06,0x66,0x06,0x75,0x06, 0x84,0x06,0x93,0x06,0xA2,0x06,0xB1,0x06,0xC0,0x06,0xCF,0x06,0xEC,0x06,0xFB,0x06,0x0A,0x07, 0x19,0x07,0x28,0x07,0x37,0x07,0x46,0x07,0x55,0x07,0x64,0x07,0x73,0x07,0x90,0x07,0x9F,0x07, 0xAE,0x07,0xBD,0x07,0xDA,0x07,0xE9,0x07,0x06,0x08,0x23,0x08, 4, // 0x20 ' ' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 5, // 0x21 '!' 0x00,0x00,0x00,0x60,0x60,0x60,0x60,0x60,0x60,0x00,0x60,0x60,0x00,0x00, 7, // 0x22 '"' 0x00,0x00,0x6C,0x6C,0x6C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 10, // 0x23 '#' 0x00,0x00,0x00,0x00,0x00,0x00,0x09,0x00,0x09,0x00,0x3F,0x80,0x3F,0x80,0x12,0x00,0x7F,0x00,0x7F,0x00,0x24,0x00,0x24,0x00,0x00,0x00,0x00,0x00, 9, // 0x24 '$' 0x00,0x00,0x00,0x00,0x08,0x00,0x08,0x00,0x3E,0x00,0x69,0x00,0x68,0x00,0x7E,0x00,0x3F,0x00,0x0B,0x00,0x4B,0x00,0x3E,0x00,0x08,0x00,0x08,0x00, 15, // 0x25 '%' 0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x40,0x6C,0x40,0x6C,0x80,0x6C,0xB8,0x6D,0x6C,0x3A,0x6C,0x02,0x6C,0x04,0x6C,0x04,0x38,0x00,0x00,0x00,0x00, 10, // 0x26 '&' 0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x6C,0x00,0x6C,0x00,0x6C,0x00,0x39,0x80,0x6D,0x00,0x66,0x00,0x63,0x00,0x3D,0x80,0x00,0x00,0x00,0x00, 4, // 0x27 ''' 0x00,0x00,0x60,0x60,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 7, // 0x28 '(' 0x00,0x00,0x18,0x30,0x30,0x60,0x60,0x60,0x60,0x60,0x60,0x30,0x30,0x18, 7, // 0x29 ')' 0x00,0x00,0x30,0x18,0x18,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x18,0x18,0x30, 9, // 0x2A '*' 0x00,0x00,0x00,0x00,0x08,0x00,0x2A,0x00,0x1C,0x00,0x1C,0x00,0x2A,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 10, // 0x2B '+' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x7F,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 4, // 0x2C ',' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x60,0x60,0x40, 6, // 0x2D '-' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x00,0x00,0x00, 4, // 0x2E '.' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x60,0x00,0x00, 8, // 0x2F '/' 0x00,0x00,0x06,0x06,0x0C,0x0C,0x0C,0x18,0x18,0x30,0x30,0x30,0x60,0x60, 9, // 0x30 '0' 0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x3E,0x00,0x00,0x00,0x00,0x00, 9, // 0x31 '1' 0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x3C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x3F,0x00,0x00,0x00,0x00,0x00, 9, // 0x32 '2' 0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x00,0x63,0x00,0x03,0x00,0x03,0x00,0x06,0x00,0x0C,0x00,0x18,0x00,0x30,0x00,0x7F,0x00,0x00,0x00,0x00,0x00, 9, // 0x33 '3' 0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x00,0x63,0x00,0x03,0x00,0x03,0x00,0x1E,0x00,0x03,0x00,0x03,0x00,0x63,0x00,0x3E,0x00,0x00,0x00,0x00,0x00, 9, // 0x34 '4' 0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x0E,0x00,0x16,0x00,0x16,0x00,0x26,0x00,0x46,0x00,0x7F,0x00,0x06,0x00,0x06,0x00,0x00,0x00,0x00,0x00, 9, // 0x35 '5' 0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x00,0x30,0x00,0x30,0x00,0x3E,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x63,0x00,0x3E,0x00,0x00,0x00,0x00,0x00, 9, // 0x36 '6' 0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x30,0x00,0x60,0x00,0x7E,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x3E,0x00,0x00,0x00,0x00,0x00, 9, // 0x37 '7' 0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x00,0x03,0x00,0x06,0x00,0x06,0x00,0x0C,0x00,0x0C,0x00,0x18,0x00,0x18,0x00,0x30,0x00,0x00,0x00,0x00,0x00, 9, // 0x38 '8' 0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x3E,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x3E,0x00,0x00,0x00,0x00,0x00, 9, // 0x39 '9' 0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x3F,0x00,0x03,0x00,0x06,0x00,0x3C,0x00,0x00,0x00,0x00,0x00, 5, // 0x3A ':' 0x00,0x00,0x00,0x00,0x00,0x60,0x60,0x00,0x00,0x00,0x60,0x60,0x00,0x00, 5, // 0x3B ';' 0x00,0x00,0x00,0x00,0x00,0x60,0x60,0x00,0x00,0x00,0x60,0x60,0x60,0x40, 10, // 0x3C '<' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x06,0x00,0x18,0x00,0x60,0x00,0x60,0x00,0x18,0x00,0x06,0x00,0x01,0x00,0x00,0x00,0x00,0x00, 10, // 0x3D '=' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x00,0x00,0x00,0x00,0x00,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 10, // 0x3E '>' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x30,0x00,0x0C,0x00,0x03,0x00,0x03,0x00,0x0C,0x00,0x30,0x00,0x40,0x00,0x00,0x00,0x00,0x00, 7, // 0x3F '?' 0x00,0x00,0x00,0x38,0x4C,0x0C,0x18,0x30,0x30,0x00,0x30,0x30,0x00,0x00, 12, // 0x40 '@' 0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x00,0x30,0xC0,0x2F,0x40,0x5B,0x20,0x5B,0x20,0x5B,0x20,0x5B,0x20,0x2F,0xC0,0x30,0x00,0x0F,0x00,0x00,0x00, 9, // 0x41 'A' 0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0x00,0x1C,0x00,0x36,0x00,0x36,0x00,0x36,0x00,0x36,0x00,0x7F,0x00,0x63,0x00,0x63,0x00,0x00,0x00,0x00,0x00, 9, // 0x42 'B' 0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x00,0x66,0x00,0x66,0x00,0x66,0x00,0x7E,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x7E,0x00,0x00,0x00,0x00,0x00, 9, // 0x43 'C' 0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x31,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x31,0x00,0x1E,0x00,0x00,0x00,0x00,0x00, 10, // 0x44 'D' 0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0x00,0x63,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x63,0x00,0x7E,0x00,0x00,0x00,0x00,0x00, 8, // 0x45 'E' 0x00,0x00,0x00,0x7E,0x60,0x60,0x60,0x7E,0x60,0x60,0x60,0x7E,0x00,0x00, 8, // 0x46 'F' 0x00,0x00,0x00,0x7E,0x60,0x60,0x60,0x7E,0x60,0x60,0x60,0x60,0x00,0x00, 10, // 0x47 'G' 0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x00,0x30,0x80,0x60,0x00,0x60,0x00,0x60,0x00,0x67,0x80,0x61,0x80,0x31,0x80,0x1F,0x80,0x00,0x00,0x00,0x00, 10, // 0x48 'H' 0x00,0x00,0x00,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x7F,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x00,0x00,0x00,0x00, 6, // 0x49 'I' 0x00,0x00,0x00,0x78,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x78,0x00,0x00, 7, // 0x4A 'J' 0x00,0x00,0x00,0x7C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0xF8,0x00,0x00, 9, // 0x4B 'K' 0x00,0x00,0x00,0x00,0x00,0x00,0x63,0x00,0x66,0x00,0x6C,0x00,0x78,0x00,0x70,0x00,0x78,0x00,0x6C,0x00,0x66,0x00,0x63,0x00,0x00,0x00,0x00,0x00, 8, // 0x4C 'L' 0x00,0x00,0x00,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x7F,0x00,0x00, 11, // 0x4D 'M' 0x00,0x00,0x00,0x00,0x00,0x00,0x60,0xC0,0x71,0xC0,0x71,0xC0,0x5A,0xC0,0x5A,0xC0,0x4C,0xC0,0x4C,0xC0,0x40,0xC0,0x40,0xC0,0x00,0x00,0x00,0x00, 10, // 0x4E 'N' 0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x80,0x70,0x80,0x58,0x80,0x58,0x80,0x4C,0x80,0x46,0x80,0x46,0x80,0x43,0x80,0x41,0x80,0x00,0x00,0x00,0x00, 11, // 0x4F 'O' 0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x00,0x31,0x80,0x60,0xC0,0x60,0xC0,0x60,0xC0,0x60,0xC0,0x60,0xC0,0x31,0x80,0x1F,0x00,0x00,0x00,0x00,0x00, 9, // 0x50 'P' 0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x7E,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x00,0x00,0x00,0x00, 11, // 0x51 'Q' 0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x00,0x31,0x80,0x60,0xC0,0x60,0xC0,0x60,0xC0,0x60,0xC0,0x60,0xC0,0x31,0x80,0x1F,0x00,0x06,0x00,0x03,0xC0, 9, // 0x52 'R' 0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x7E,0x00,0x6C,0x00,0x66,0x00,0x63,0x00,0x61,0x80,0x00,0x00,0x00,0x00, 9, // 0x53 'S' 0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x00,0x61,0x00,0x60,0x00,0x70,0x00,0x3E,0x00,0x07,0x00,0x03,0x00,0x43,0x00,0x3E,0x00,0x00,0x00,0x00,0x00, 8, // 0x54 'T' 0x00,0x00,0x00,0xFF,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00, 10, // 0x55 'U' 0x00,0x00,0x00,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x3F,0x00,0x00,0x00,0x00,0x00, 9, // 0x56 'V' 0x00,0x00,0x00,0x00,0x00,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x36,0x00,0x36,0x00,0x36,0x00,0x1C,0x00,0x1C,0x00,0x1C,0x00,0x00,0x00,0x00,0x00, 14, // 0x57 'W' 0x00,0x00,0x00,0x00,0x00,0x00,0x63,0x18,0x63,0x18,0x63,0x18,0x33,0x30,0x37,0xB0,0x34,0xB0,0x1C,0xE0,0x18,0x60,0x18,0x60,0x00,0x00,0x00,0x00, 9, // 0x58 'X' 0x00,0x00,0x00,0x00,0x00,0x00,0x63,0x00,0x63,0x00,0x36,0x00,0x1C,0x00,0x1C,0x00,0x1C,0x00,0x36,0x00,0x63,0x00,0x63,0x00,0x00,0x00,0x00,0x00, 10, // 0x59 'Y' 0x00,0x00,0x00,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x00,0x00, 8, // 0x5A 'Z' 0x00,0x00,0x00,0x7E,0x0C,0x0C,0x18,0x18,0x30,0x30,0x60,0x7E,0x00,0x00, 6, // 0x5B '[' 0x00,0x00,0x78,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x78, 8, // 0x5C '\' 0x00,0x00,0x60,0x60,0x30,0x30,0x30,0x18,0x18,0x0C,0x0C,0x0C,0x06,0x06, 6, // 0x5D ']' 0x00,0x00,0x78,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x78, 10, // 0x5E '^' 0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x5F '_' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x80, 9, // 0x60 '`' 0x00,0x00,0x00,0x00,0x30,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 8, // 0x61 'a' 0x00,0x00,0x00,0x00,0x00,0x3C,0x06,0x3E,0x66,0x66,0x66,0x3E,0x00,0x00, 8, // 0x62 'b' 0x00,0x00,0x60,0x60,0x60,0x7C,0x66,0x66,0x66,0x66,0x66,0x7C,0x00,0x00, 7, // 0x63 'c' 0x00,0x00,0x00,0x00,0x00,0x3C,0x62,0x60,0x60,0x60,0x62,0x3C,0x00,0x00, 8, // 0x64 'd' 0x00,0x00,0x06,0x06,0x06,0x3E,0x66,0x66,0x66,0x66,0x66,0x3E,0x00,0x00, 8, // 0x65 'e' 0x00,0x00,0x00,0x00,0x00,0x3C,0x66,0x66,0x7E,0x60,0x62,0x3C,0x00,0x00, 5, // 0x66 'f' 0x00,0x00,0x38,0x60,0x60,0xF8,0x60,0x60,0x60,0x60,0x60,0x60,0x00,0x00, 8, // 0x67 'g' 0x00,0x00,0x00,0x00,0x00,0x3E,0x66,0x66,0x66,0x66,0x66,0x3E,0x06,0x3C, 8, // 0x68 'h' 0x00,0x00,0x60,0x60,0x60,0x7C,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x00, 4, // 0x69 'i' 0x00,0x00,0x60,0x60,0x00,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x00,0x00, 5, // 0x6A 'j' 0x00,0x00,0x30,0x30,0x00,0x70,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0xE0, 8, // 0x6B 'k' 0x00,0x00,0x60,0x60,0x60,0x66,0x6C,0x78,0x78,0x6C,0x66,0x63,0x00,0x00, 4, // 0x6C 'l' 0x00,0x00,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x00,0x00, 12, // 0x6D 'm' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6C,0xC0,0x77,0x60,0x66,0x60,0x66,0x60,0x66,0x60,0x66,0x60,0x66,0x60,0x00,0x00,0x00,0x00, 8, // 0x6E 'n' 0x00,0x00,0x00,0x00,0x00,0x7C,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x00, 8, // 0x6F 'o' 0x00,0x00,0x00,0x00,0x00,0x3C,0x66,0x66,0x66,0x66,0x66,0x3C,0x00,0x00, 8, // 0x70 'p' 0x00,0x00,0x00,0x00,0x00,0x7C,0x66,0x66,0x66,0x66,0x66,0x7C,0x60,0x60, 8, // 0x71 'q' 0x00,0x00,0x00,0x00,0x00,0x3E,0x66,0x66,0x66,0x66,0x66,0x3E,0x06,0x06, 6, // 0x72 'r' 0x00,0x00,0x00,0x00,0x00,0x6C,0x7C,0x60,0x60,0x60,0x60,0x60,0x00,0x00, 7, // 0x73 's' 0x00,0x00,0x00,0x00,0x00,0x3C,0x60,0x60,0x38,0x0C,0x0C,0x78,0x00,0x00, 5, // 0x74 't' 0x00,0x00,0x00,0x60,0x60,0xF8,0x60,0x60,0x60,0x60,0x60,0x38,0x00,0x00, 8, // 0x75 'u' 0x00,0x00,0x00,0x00,0x00,0x66,0x66,0x66,0x66,0x66,0x66,0x3E,0x00,0x00, 8, // 0x76 'v' 0x00,0x00,0x00,0x00,0x00,0x66,0x66,0x66,0x3C,0x3C,0x3C,0x18,0x00,0x00, 12, // 0x77 'w' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x66,0x60,0x66,0x60,0x66,0x60,0x69,0x60,0x39,0xC0,0x30,0xC0,0x30,0xC0,0x00,0x00,0x00,0x00, 8, // 0x78 'x' 0x00,0x00,0x00,0x00,0x00,0x66,0x66,0x3C,0x18,0x3C,0x66,0x66,0x00,0x00, 8, // 0x79 'y' 0x00,0x00,0x00,0x00,0x00,0x66,0x66,0x66,0x3C,0x3C,0x3C,0x18,0x18,0x30, 7, // 0x7A 'z' 0x00,0x00,0x00,0x00,0x00,0x7C,0x0C,0x18,0x38,0x30,0x60,0x7C,0x00,0x00, 9, // 0x7B '{' 0x00,0x00,0x00,0x00,0x0E,0x00,0x18,0x00,0x18,0x00,0x18,0x00,0x18,0x00,0x70,0x00,0x18,0x00,0x18,0x00,0x18,0x00,0x18,0x00,0x18,0x00,0x0E,0x00, 6, // 0x7C '|' 0x00,0x00,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30, 9, // 0x7D '}' 0x00,0x00,0x00,0x00,0x38,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x07,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x38,0x00, 10, // 0x7E '~' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x80,0x48,0x80,0x44,0x80,0x43,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 12, // 0x7F '' 0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xE0,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x3F,0xE0,0x00,0x00,0x00,0x00, 0 }; 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, 0xC9,0x00,0xDA,0x00,0xFB,0x00,0x1C,0x01,0x2D,0x01,0x3E,0x01,0x4F,0x01,0x60,0x01,0x71,0x01, 0x82,0x01,0x93,0x01,0xA4,0x01,0xB5,0x01,0xC6,0x01,0xD7,0x01,0xE8,0x01,0xF9,0x01,0x0A,0x02, 0x1B,0x02,0x2C,0x02,0x4D,0x02,0x6E,0x02,0x8F,0x02,0xA0,0x02,0xC1,0x02,0xE2,0x02,0xF3,0x02, 0x14,0x03,0x35,0x03,0x46,0x03,0x57,0x03,0x78,0x03,0x99,0x03,0xAA,0x03,0xBB,0x03,0xCC,0x03, 0xDD,0x03,0xFE,0x03,0x1F,0x04,0x40,0x04,0x51,0x04,0x72,0x04,0x93,0x04,0xB4,0x04,0xD5,0x04, 0xF6,0x04,0x17,0x05,0x38,0x05,0x59,0x05,0x7A,0x05,0x9B,0x05,0xAC,0x05,0xBD,0x05,0xCE,0x05, 0xEF,0x05,0x00,0x06,0x11,0x06,0x22,0x06,0x33,0x06,0x44,0x06,0x55,0x06,0x66,0x06,0x77,0x06, 0x88,0x06,0x99,0x06,0xAA,0x06,0xBB,0x06,0xCC,0x06,0xDD,0x06,0xFE,0x06,0x0F,0x07,0x20,0x07, 0x31,0x07,0x42,0x07,0x53,0x07,0x64,0x07,0x75,0x07,0x86,0x07,0x97,0x07,0xB8,0x07,0xC9,0x07, 0xDA,0x07,0xEB,0x07,0xFC,0x07,0x0D,0x08,0x1E,0x08,0x3F,0x08, 5, // 0x20 ' ' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 5, // 0x21 '!' 0x00,0x00,0x00,0x00,0x20,0x20,0x20,0x20,0x20,0x20,0x00,0x20,0x20,0x00,0x00,0x00, 5, // 0x22 '"' 0x00,0x00,0x00,0x50,0x50,0x50,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 10, // 0x23 '#' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x09,0x00,0x09,0x00,0x3F,0x80,0x12,0x00,0x12,0x00,0x7F,0x00,0x24,0x00,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 8, // 0x24 '$' 0x00,0x00,0x00,0x10,0x10,0x3E,0x50,0x50,0x30,0x1C,0x12,0x12,0x7C,0x10,0x10,0x00, 13, // 0x25 '%' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x40,0x44,0x80,0x45,0x00,0x45,0x00,0x3A,0xE0,0x05,0x10,0x05,0x10,0x09,0x10,0x10,0xE0,0x00,0x00,0x00,0x00,0x00,0x00, 10, // 0x26 '&' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x44,0x00,0x44,0x00,0x44,0x00,0x38,0x80,0x45,0x00,0x42,0x00,0x46,0x00,0x39,0x80,0x00,0x00,0x00,0x00,0x00,0x00, 3, // 0x27 ''' 0x00,0x00,0x00,0x40,0x40,0x40,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 6, // 0x28 '(' 0x00,0x00,0x00,0x08,0x10,0x20,0x20,0x40,0x40,0x40,0x40,0x40,0x20,0x20,0x10,0x08, 6, // 0x29 ')' 0x00,0x00,0x00,0x40,0x20,0x10,0x10,0x08,0x08,0x08,0x08,0x08,0x10,0x10,0x20,0x40, 9, // 0x2A '*' 0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x2A,0x00,0x1C,0x00,0x2A,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x2B '+' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x7F,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 5, // 0x2C ',' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x20,0x40,0x00, 7, // 0x2D '-' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 5, // 0x2E '.' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x00,0x00,0x00, 6, // 0x2F '/' 0x00,0x00,0x00,0x04,0x04,0x08,0x08,0x10,0x10,0x20,0x20,0x40,0x40,0x80,0x80,0x00, 8, // 0x30 '0' 0x00,0x00,0x00,0x00,0x3C,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,0x00, 8, // 0x31 '1' 0x00,0x00,0x00,0x00,0x08,0x38,0x08,0x08,0x08,0x08,0x08,0x08,0x3E,0x00,0x00,0x00, 8, // 0x32 '2' 0x00,0x00,0x00,0x00,0x3C,0x42,0x42,0x02,0x04,0x18,0x20,0x40,0x7E,0x00,0x00,0x00, 8, // 0x33 '3' 0x00,0x00,0x00,0x00,0x3C,0x42,0x02,0x02,0x1C,0x02,0x02,0x42,0x3C,0x00,0x00,0x00, 8, // 0x34 '4' 0x00,0x00,0x00,0x00,0x04,0x0C,0x14,0x24,0x44,0x7F,0x04,0x04,0x04,0x00,0x00,0x00, 8, // 0x35 '5' 0x00,0x00,0x00,0x00,0x3E,0x20,0x20,0x20,0x3C,0x02,0x02,0x42,0x3C,0x00,0x00,0x00, 8, // 0x36 '6' 0x00,0x00,0x00,0x00,0x1C,0x20,0x40,0x7C,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,0x00, 8, // 0x37 '7' 0x00,0x00,0x00,0x00,0x7E,0x02,0x04,0x04,0x08,0x08,0x10,0x10,0x10,0x00,0x00,0x00, 8, // 0x38 '8' 0x00,0x00,0x00,0x00,0x3C,0x42,0x42,0x42,0x3C,0x42,0x42,0x42,0x3C,0x00,0x00,0x00, 8, // 0x39 '9' 0x00,0x00,0x00,0x00,0x3C,0x42,0x42,0x42,0x42,0x3E,0x02,0x04,0x38,0x00,0x00,0x00, 6, // 0x3A ':' 0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x00,0x00,0x00,0x20,0x20,0x00,0x00,0x00, 6, // 0x3B ';' 0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x00,0x00,0x00,0x20,0x20,0x20,0x40,0x00, 9, // 0x3C '<' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x0C,0x00,0x30,0x00,0x40,0x00,0x30,0x00,0x0C,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x3D '=' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x00,0x00,0x00,0x00,0x00,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x3E '>' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x18,0x00,0x06,0x00,0x01,0x00,0x06,0x00,0x18,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 7, // 0x3F '?' 0x00,0x00,0x00,0x00,0x38,0x44,0x04,0x08,0x10,0x10,0x00,0x10,0x10,0x00,0x00,0x00, 13, // 0x40 '@' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x80,0x10,0x40,0x27,0xA0,0x48,0x90,0x48,0x90,0x48,0x90,0x48,0x90,0x48,0x90,0x27,0xE0,0x10,0x00,0x0F,0x80,0x00,0x00, 9, // 0x41 'A' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x08,0x00,0x14,0x00,0x14,0x00,0x22,0x00,0x22,0x00,0x3E,0x00,0x41,0x00,0x41,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 8, // 0x42 'B' 0x00,0x00,0x00,0x00,0x78,0x44,0x44,0x44,0x7C,0x42,0x42,0x42,0x7C,0x00,0x00,0x00, 9, // 0x43 'C' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x21,0x00,0x40,0x00,0x40,0x00,0x40,0x00,0x40,0x00,0x40,0x00,0x21,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x44 'D' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x00,0x42,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x42,0x00,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 8, // 0x45 'E' 0x00,0x00,0x00,0x00,0x7E,0x40,0x40,0x40,0x7E,0x40,0x40,0x40,0x7E,0x00,0x00,0x00, 8, // 0x46 'F' 0x00,0x00,0x00,0x00,0x7E,0x40,0x40,0x40,0x7C,0x40,0x40,0x40,0x40,0x00,0x00,0x00, 9, // 0x47 'G' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x21,0x00,0x40,0x00,0x40,0x00,0x40,0x00,0x47,0x00,0x41,0x00,0x21,0x00,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x48 'H' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x7F,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 5, // 0x49 'I' 0x00,0x00,0x00,0x00,0x70,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x70,0x00,0x00,0x00, 6, // 0x4A 'J' 0x00,0x00,0x00,0x00,0x38,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0xF0,0x00,0x00,0x00, 8, // 0x4B 'K' 0x00,0x00,0x00,0x00,0x42,0x44,0x48,0x50,0x60,0x50,0x48,0x44,0x42,0x00,0x00,0x00, 7, // 0x4C 'L' 0x00,0x00,0x00,0x00,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x7E,0x00,0x00,0x00, 11, // 0x4D 'M' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0xC0,0x60,0xC0,0x51,0x40,0x51,0x40,0x4A,0x40,0x4A,0x40,0x44,0x40,0x44,0x40,0x40,0x40,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x4E 'N' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x61,0x00,0x61,0x00,0x51,0x00,0x51,0x00,0x49,0x00,0x45,0x00,0x45,0x00,0x43,0x00,0x43,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 10, // 0x4F 'O' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x21,0x00,0x40,0x80,0x40,0x80,0x40,0x80,0x40,0x80,0x40,0x80,0x21,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 8, // 0x50 'P' 0x00,0x00,0x00,0x00,0x7C,0x42,0x42,0x42,0x42,0x7C,0x40,0x40,0x40,0x00,0x00,0x00, 10, // 0x51 'Q' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x21,0x00,0x40,0x80,0x40,0x80,0x40,0x80,0x40,0x80,0x40,0x80,0x21,0x00,0x1E,0x00,0x02,0x00,0x01,0x80,0x00,0x00, 9, // 0x52 'R' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x00,0x42,0x00,0x42,0x00,0x42,0x00,0x44,0x00,0x78,0x00,0x44,0x00,0x42,0x00,0x41,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x53 'S' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x00,0x41,0x00,0x40,0x00,0x40,0x00,0x3E,0x00,0x01,0x00,0x01,0x00,0x41,0x00,0x3E,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x54 'T' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x55 'U' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x22,0x00,0x1C,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x56 'V' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x22,0x00,0x22,0x00,0x14,0x00,0x14,0x00,0x08,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 13, // 0x57 'W' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x42,0x10,0x42,0x10,0x45,0x10,0x45,0x10,0x25,0x20,0x28,0xA0,0x28,0xA0,0x10,0x40,0x10,0x40,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x58 'X' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x41,0x00,0x41,0x00,0x22,0x00,0x14,0x00,0x08,0x00,0x14,0x00,0x22,0x00,0x41,0x00,0x41,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x59 'Y' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x41,0x00,0x22,0x00,0x22,0x00,0x14,0x00,0x14,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x5A 'Z' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x00,0x01,0x00,0x02,0x00,0x04,0x00,0x08,0x00,0x10,0x00,0x20,0x00,0x40,0x00,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 6, // 0x5B '[' 0x00,0x00,0x00,0x38,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x38,0x00, 6, // 0x5C '\' 0x00,0x00,0x00,0x80,0x80,0x40,0x40,0x20,0x20,0x10,0x10,0x08,0x08,0x04,0x04,0x00, 6, // 0x5D ']' 0x00,0x00,0x00,0x70,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x70,0x00, 11, // 0x5E '^' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x0A,0x00,0x11,0x00,0x20,0x80,0x40,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 8, // 0x5F '_' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00, 8, // 0x60 '`' 0x00,0x00,0x00,0x10,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 8, // 0x61 'a' 0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x02,0x02,0x3E,0x42,0x42,0x3E,0x00,0x00,0x00, 8, // 0x62 'b' 0x00,0x00,0x00,0x40,0x40,0x40,0x5C,0x62,0x42,0x42,0x42,0x42,0x7C,0x00,0x00,0x00, 8, // 0x63 'c' 0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x42,0x40,0x40,0x40,0x42,0x3C,0x00,0x00,0x00, 8, // 0x64 'd' 0x00,0x00,0x00,0x02,0x02,0x02,0x3E,0x42,0x42,0x42,0x42,0x46,0x3A,0x00,0x00,0x00, 8, // 0x65 'e' 0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x42,0x42,0x7E,0x40,0x42,0x3C,0x00,0x00,0x00, 6, // 0x66 'f' 0x00,0x00,0x00,0x1C,0x20,0x20,0x78,0x20,0x20,0x20,0x20,0x20,0x20,0x00,0x00,0x00, 8, // 0x67 'g' 0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x42,0x42,0x42,0x42,0x46,0x3A,0x02,0x02,0x3C, 8, // 0x68 'h' 0x00,0x00,0x00,0x40,0x40,0x40,0x5C,0x62,0x42,0x42,0x42,0x42,0x42,0x00,0x00,0x00, 3, // 0x69 'i' 0x00,0x00,0x00,0x40,0x00,0x00,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x00,0x00,0x00, 4, // 0x6A 'j' 0x00,0x00,0x00,0x20,0x00,0x00,0x60,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0xC0, 7, // 0x6B 'k' 0x00,0x00,0x00,0x40,0x40,0x40,0x44,0x48,0x50,0x60,0x50,0x48,0x44,0x00,0x00,0x00, 3, // 0x6C 'l' 0x00,0x00,0x00,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x00,0x00,0x00, 11, // 0x6D 'm' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x59,0x80,0x66,0x40,0x44,0x40,0x44,0x40,0x44,0x40,0x44,0x40,0x44,0x40,0x00,0x00,0x00,0x00,0x00,0x00, 8, // 0x6E 'n' 0x00,0x00,0x00,0x00,0x00,0x00,0x5C,0x62,0x42,0x42,0x42,0x42,0x42,0x00,0x00,0x00, 8, // 0x6F 'o' 0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x42,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,0x00, 8, // 0x70 'p' 0x00,0x00,0x00,0x00,0x00,0x00,0x5C,0x62,0x42,0x42,0x42,0x42,0x7C,0x40,0x40,0x40, 8, // 0x71 'q' 0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x42,0x42,0x42,0x42,0x46,0x3A,0x02,0x02,0x02, 5, // 0x72 'r' 0x00,0x00,0x00,0x00,0x00,0x00,0x58,0x60,0x40,0x40,0x40,0x40,0x40,0x00,0x00,0x00, 7, // 0x73 's' 0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x40,0x40,0x38,0x04,0x04,0x78,0x00,0x00,0x00, 6, // 0x74 't' 0x00,0x00,0x00,0x00,0x20,0x20,0x78,0x20,0x20,0x20,0x20,0x20,0x18,0x00,0x00,0x00, 8, // 0x75 'u' 0x00,0x00,0x00,0x00,0x00,0x00,0x42,0x42,0x42,0x42,0x42,0x46,0x3A,0x00,0x00,0x00, 8, // 0x76 'v' 0x00,0x00,0x00,0x00,0x00,0x00,0x42,0x42,0x24,0x24,0x24,0x18,0x18,0x00,0x00,0x00, 11, // 0x77 'w' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x44,0x40,0x44,0x40,0x2A,0x80,0x2A,0x80,0x2A,0x80,0x11,0x00,0x11,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 7, // 0x78 'x' 0x00,0x00,0x00,0x00,0x00,0x00,0x44,0x44,0x28,0x10,0x28,0x44,0x44,0x00,0x00,0x00, 8, // 0x79 'y' 0x00,0x00,0x00,0x00,0x00,0x00,0x42,0x42,0x24,0x24,0x24,0x18,0x18,0x10,0x10,0x20, 7, // 0x7A 'z' 0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x04,0x08,0x10,0x20,0x40,0x7C,0x00,0x00,0x00, 8, // 0x7B '{' 0x00,0x00,0x00,0x0C,0x10,0x10,0x10,0x10,0x60,0x10,0x10,0x10,0x10,0x10,0x0C,0x00, 7, // 0x7C '|' 0x00,0x00,0x00,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x00, 8, // 0x7D '}' 0x00,0x00,0x00,0x30,0x08,0x08,0x08,0x08,0x06,0x08,0x08,0x08,0x08,0x08,0x30,0x00, 11, // 0x7E '~' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x80,0x4C,0x80,0x43,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 13, // 0x7F '' 0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xF0,0x20,0x10,0x20,0x10,0x20,0x10,0x20,0x10,0x20,0x10,0x20,0x10,0x20,0x10,0x20,0x10,0x3F,0xF0,0x00,0x00,0x00,0x00,0x00,0x00, 0 }; 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, 0xE9,0x00,0xFA,0x00,0x1B,0x01,0x3C,0x01,0x4D,0x01,0x5E,0x01,0x6F,0x01,0x90,0x01,0xB1,0x01, 0xD2,0x01,0xF3,0x01,0x14,0x02,0x35,0x02,0x56,0x02,0x77,0x02,0x98,0x02,0xB9,0x02,0xDA,0x02, 0xEB,0x02,0xFC,0x02,0x1D,0x03,0x3E,0x03,0x5F,0x03,0x70,0x03,0x91,0x03,0xB2,0x03,0xD3,0x03, 0xF4,0x03,0x15,0x04,0x36,0x04,0x57,0x04,0x78,0x04,0x99,0x04,0xAA,0x04,0xBB,0x04,0xDC,0x04, 0xED,0x04,0x0E,0x05,0x2F,0x05,0x50,0x05,0x71,0x05,0x92,0x05,0xB3,0x05,0xD4,0x05,0xE5,0x05, 0x06,0x06,0x27,0x06,0x48,0x06,0x69,0x06,0x8A,0x06,0xAB,0x06,0xBC,0x06,0xDD,0x06,0xEE,0x06, 0x0F,0x07,0x30,0x07,0x51,0x07,0x72,0x07,0x93,0x07,0xA4,0x07,0xC5,0x07,0xE6,0x07,0xF7,0x07, 0x18,0x08,0x39,0x08,0x4A,0x08,0x5B,0x08,0x6C,0x08,0x7D,0x08,0x9E,0x08,0xBF,0x08,0xE0,0x08, 0x01,0x09,0x22,0x09,0x33,0x09,0x44,0x09,0x55,0x09,0x76,0x09,0x97,0x09,0xB8,0x09,0xD9,0x09, 0xFA,0x09,0x0B,0x0A,0x2C,0x0A,0x3D,0x0A,0x5E,0x0A,0x7F,0x0A, 4, // 0x20 ' ' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 6, // 0x21 '!' 0x00,0x00,0x00,0x00,0x30,0x30,0x30,0x30,0x30,0x30,0x00,0x30,0x30,0x00,0x00,0x00, 7, // 0x22 '"' 0x00,0x00,0x00,0x6C,0x6C,0x6C,0x6C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 11, // 0x23 '#' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x09,0x00,0x09,0x00,0x3F,0x80,0x3F,0x80,0x12,0x00,0x7F,0x00,0x7F,0x00,0x24,0x00,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x24 '$' 0x00,0x00,0x00,0x00,0x08,0x00,0x08,0x00,0x3E,0x00,0x69,0x00,0x68,0x00,0x78,0x00,0x3E,0x00,0x0F,0x00,0x0B,0x00,0x4B,0x00,0x3E,0x00,0x08,0x00,0x08,0x00,0x00,0x00, 17, // 0x25 '%' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x20,0x00,0x66,0x20,0x00,0x66,0x40,0x00,0x66,0x5E,0x00,0x66,0xB3,0x00,0x3D,0x33,0x00,0x01,0x33,0x00,0x02,0x33,0x00,0x02,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 11, // 0x26 '&' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x00,0x66,0x00,0x66,0x00,0x66,0xC0,0x3C,0xC0,0x66,0x80,0x63,0x00,0x63,0x80,0x3C,0xC0,0x00,0x00,0x00,0x00,0x00,0x00, 4, // 0x27 ''' 0x00,0x00,0x00,0x60,0x60,0x60,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 7, // 0x28 '(' 0x00,0x00,0x00,0x0C,0x18,0x30,0x30,0x60,0x60,0x60,0x60,0x60,0x30,0x30,0x18,0x0C, 7, // 0x29 ')' 0x00,0x00,0x00,0x60,0x30,0x18,0x18,0x0C,0x0C,0x0C,0x0C,0x0C,0x18,0x18,0x30,0x60, 9, // 0x2A '*' 0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x49,0x00,0x2A,0x00,0x1C,0x00,0x2A,0x00,0x49,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 11, // 0x2B '+' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x04,0x00,0x04,0x00,0x3F,0x80,0x04,0x00,0x04,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 5, // 0x2C ',' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x60,0x60,0xC0,0xC0, 7, // 0x2D '-' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 5, // 0x2E '.' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x00, 9, // 0x2F '/' 0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x03,0x00,0x06,0x00,0x06,0x00,0x0C,0x00,0x0C,0x00,0x18,0x00,0x18,0x00,0x30,0x00,0x30,0x00,0x60,0x00,0x60,0x00,0x00,0x00, 9, // 0x30 '0' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x3E,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x31 '1' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x3C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x32 '2' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x00,0x63,0x00,0x63,0x00,0x03,0x00,0x06,0x00,0x0C,0x00,0x18,0x00,0x30,0x00,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x33 '3' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x00,0x63,0x00,0x63,0x00,0x03,0x00,0x0E,0x00,0x03,0x00,0x63,0x00,0x63,0x00,0x3E,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x34 '4' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x0E,0x00,0x16,0x00,0x26,0x00,0x46,0x00,0x7F,0x80,0x06,0x00,0x06,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x35 '5' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x00,0x30,0x00,0x30,0x00,0x3E,0x00,0x03,0x00,0x03,0x00,0x63,0x00,0x63,0x00,0x3E,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x36 '6' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x30,0x00,0x60,0x00,0x7E,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x3E,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x37 '7' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x00,0x03,0x00,0x03,0x00,0x06,0x00,0x06,0x00,0x0C,0x00,0x0C,0x00,0x18,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x38 '8' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x3E,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x3E,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x39 '9' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x3F,0x00,0x03,0x00,0x06,0x00,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 5, // 0x3A ':' 0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x00, 5, // 0x3B ';' 0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x00,0x38,0x30,0x30,0x60,0x60, 11, // 0x3C '<' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x03,0x00,0x0C,0x00,0x30,0x00,0x40,0x00,0x30,0x00,0x0C,0x00,0x03,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00, 11, // 0x3D '=' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x80,0x00,0x00,0x00,0x00,0x3F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 11, // 0x3E '>' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x18,0x00,0x06,0x00,0x01,0x80,0x00,0x40,0x01,0x80,0x06,0x00,0x18,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 8, // 0x3F '?' 0x00,0x00,0x00,0x00,0x3C,0x66,0x06,0x0C,0x18,0x18,0x00,0x18,0x18,0x00,0x00,0x00, 13, // 0x40 '@' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x80,0x30,0x60,0x27,0xA0,0x4D,0x90,0x4D,0x90,0x4D,0x90,0x4D,0x90,0x27,0xE0,0x30,0x00,0x0F,0x80,0x00,0x00,0x00,0x00, 10, // 0x41 'A' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x0C,0x00,0x1E,0x00,0x1E,0x00,0x33,0x00,0x33,0x00,0x7F,0x80,0x61,0x80,0x61,0x80,0x00,0x00,0x00,0x00,0x00,0x00, 10, // 0x42 'B' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x7F,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 10, // 0x43 'C' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x00,0x31,0x80,0x61,0x80,0x60,0x00,0x60,0x00,0x60,0x00,0x61,0x80,0x31,0x80,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 10, // 0x44 'D' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0x00,0x63,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x63,0x00,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x45 'E' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x7F,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x46 'F' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x7F,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 10, // 0x47 'G' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x00,0x31,0x80,0x61,0x80,0x60,0x00,0x60,0x00,0x63,0x80,0x61,0x80,0x31,0x80,0x1F,0x80,0x00,0x00,0x00,0x00,0x00,0x00, 11, // 0x48 'H' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0xC0,0x60,0xC0,0x60,0xC0,0x60,0xC0,0x7F,0xC0,0x60,0xC0,0x60,0xC0,0x60,0xC0,0x60,0xC0,0x00,0x00,0x00,0x00,0x00,0x00, 6, // 0x49 'I' 0x00,0x00,0x00,0x00,0x78,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x78,0x00,0x00,0x00, 7, // 0x4A 'J' 0x00,0x00,0x00,0x00,0x7C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0xF8,0x00,0x00,0x00, 9, // 0x4B 'K' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x63,0x00,0x66,0x00,0x6C,0x00,0x78,0x00,0x78,0x00,0x6C,0x00,0x66,0x00,0x63,0x00,0x61,0x80,0x00,0x00,0x00,0x00,0x00,0x00, 8, // 0x4C 'L' 0x00,0x00,0x00,0x00,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x7F,0x00,0x00,0x00, 12, // 0x4D 'M' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0xE0,0x70,0xE0,0x59,0x60,0x59,0x60,0x4E,0x60,0x4E,0x60,0x44,0x60,0x44,0x60,0x40,0x60,0x00,0x00,0x00,0x00,0x00,0x00, 10, // 0x4E 'N' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x80,0x70,0x80,0x58,0x80,0x58,0x80,0x4C,0x80,0x46,0x80,0x46,0x80,0x43,0x80,0x43,0x80,0x00,0x00,0x00,0x00,0x00,0x00, 11, // 0x4F 'O' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x00,0x31,0x80,0x60,0xC0,0x60,0xC0,0x60,0xC0,0x60,0xC0,0x60,0xC0,0x31,0x80,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x50 'P' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x7E,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 11, // 0x51 'Q' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x00,0x31,0x80,0x60,0xC0,0x60,0xC0,0x60,0xC0,0x60,0xC0,0x60,0xC0,0x31,0x80,0x1F,0x00,0x03,0x00,0x01,0xC0,0x00,0x00, 9, // 0x52 'R' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x7E,0x00,0x6C,0x00,0x66,0x00,0x63,0x00,0x61,0x80,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x53 'S' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x00,0x63,0x00,0x63,0x00,0x70,0x00,0x3E,0x00,0x07,0x00,0x63,0x00,0x63,0x00,0x3E,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 8, // 0x54 'T' 0x00,0x00,0x00,0x00,0xFF,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00, 10, // 0x55 'U' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 10, // 0x56 'V' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x00,0x33,0x00,0x1E,0x00,0x1E,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 14, // 0x57 'W' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x63,0x18,0x63,0x18,0x63,0x18,0x33,0x30,0x37,0xB0,0x34,0xB0,0x1C,0xE0,0x18,0x60,0x18,0x60,0x00,0x00,0x00,0x00,0x00,0x00, 10, // 0x58 'X' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x61,0x80,0x33,0x00,0x33,0x00,0x1E,0x00,0x0C,0x00,0x1E,0x00,0x33,0x00,0x33,0x00,0x61,0x80,0x00,0x00,0x00,0x00,0x00,0x00, 10, // 0x59 'Y' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x5A 'Z' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x00,0x06,0x00,0x0C,0x00,0x0C,0x00,0x18,0x00,0x18,0x00,0x30,0x00,0x30,0x00,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 6, // 0x5B '[' 0x00,0x00,0x00,0x78,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x78,0x00, 9, // 0x5C '\' 0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x60,0x00,0x30,0x00,0x30,0x00,0x18,0x00,0x18,0x00,0x0C,0x00,0x0C,0x00,0x06,0x00,0x06,0x00,0x03,0x00,0x03,0x00,0x00,0x00, 6, // 0x5D ']' 0x00,0x00,0x00,0x78,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x78,0x00, 10, // 0x5E '^' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x5F '_' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x80,0x00,0x00, 9, // 0x60 '`' 0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x61 'a' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x00,0x03,0x00,0x3F,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x62 'b' 0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x6E,0x00,0x73,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 8, // 0x63 'c' 0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x63,0x60,0x60,0x60,0x63,0x3E,0x00,0x00,0x00, 9, // 0x64 'd' 0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x3F,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x67,0x00,0x3B,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x65 'e' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x00,0x63,0x00,0x63,0x00,0x7F,0x00,0x60,0x00,0x63,0x00,0x3E,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 5, // 0x66 'f' 0x00,0x00,0x00,0x38,0x60,0x60,0xF8,0x60,0x60,0x60,0x60,0x60,0x60,0x00,0x00,0x00, 9, // 0x67 'g' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x67,0x00,0x3B,0x00,0x03,0x00,0x03,0x00,0x3E,0x00, 9, // 0x68 'h' 0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x6E,0x00,0x73,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 4, // 0x69 'i' 0x00,0x00,0x00,0x60,0x60,0x00,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x00,0x00,0x00, 5, // 0x6A 'j' 0x00,0x00,0x00,0x30,0x30,0x00,0x70,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0xE0, 8, // 0x6B 'k' 0x00,0x00,0x00,0x60,0x60,0x60,0x66,0x6C,0x78,0x78,0x6C,0x66,0x63,0x00,0x00,0x00, 4, // 0x6C 'l' 0x00,0x00,0x00,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x00,0x00,0x00, 14, // 0x6D 'm' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6E,0x70,0x73,0x98,0x63,0x18,0x63,0x18,0x63,0x18,0x63,0x18,0x63,0x18,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x6E 'n' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6E,0x00,0x73,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x6F 'o' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x3E,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x70 'p' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6E,0x00,0x73,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x7E,0x00,0x60,0x00,0x60,0x00,0x60,0x00, 9, // 0x71 'q' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x67,0x00,0x3B,0x00,0x03,0x00,0x03,0x00,0x03,0x00, 6, // 0x72 'r' 0x00,0x00,0x00,0x00,0x00,0x00,0x6C,0x7C,0x60,0x60,0x60,0x60,0x60,0x00,0x00,0x00, 8, // 0x73 's' 0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x60,0x70,0x3C,0x0E,0x06,0x7C,0x00,0x00,0x00, 6, // 0x74 't' 0x00,0x00,0x00,0x00,0x60,0x60,0xF8,0x60,0x60,0x60,0x60,0x60,0x38,0x00,0x00,0x00, 9, // 0x75 'u' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x67,0x00,0x3B,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x76 'v' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x36,0x00,0x36,0x00,0x1C,0x00,0x1C,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 12, // 0x77 'w' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x66,0x60,0x66,0x60,0x66,0x60,0x69,0x60,0x39,0xC0,0x30,0xC0,0x30,0xC0,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x78 'x' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x63,0x00,0x63,0x00,0x36,0x00,0x1C,0x00,0x36,0x00,0x63,0x00,0x63,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x79 'y' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x36,0x00,0x36,0x00,0x1C,0x00,0x1C,0x00,0x0C,0x00,0x18,0x00,0x18,0x00, 8, // 0x7A 'z' 0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0x06,0x0C,0x18,0x30,0x60,0x7E,0x00,0x00,0x00, 9, // 0x7B '{' 0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x18,0x00,0x70,0x00,0x18,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x07,0x00,0x00,0x00, 8, // 0x7C '|' 0x00,0x00,0x00,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x00, 9, // 0x7D '}' 0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x00,0x18,0x00,0x18,0x00,0x18,0x00,0x0C,0x00,0x07,0x00,0x0C,0x00,0x18,0x00,0x18,0x00,0x18,0x00,0x18,0x00,0x70,0x00,0x00,0x00, 11, // 0x7E '~' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x40,0x44,0x40,0x44,0x40,0x43,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 13, // 0x7F '' 0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xF0,0x20,0x10,0x20,0x10,0x20,0x10,0x20,0x10,0x20,0x10,0x20,0x10,0x20,0x10,0x20,0x10,0x3F,0xF0,0x00,0x00,0x00,0x00,0x00,0x00, 0 }; 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, 0xE6,0x00,0xF8,0x00,0x1B,0x01,0x3E,0x01,0x50,0x01,0x62,0x01,0x74,0x01,0x86,0x01,0xA9,0x01, 0xCC,0x01,0xEF,0x01,0x12,0x02,0x35,0x02,0x58,0x02,0x7B,0x02,0x9E,0x02,0xC1,0x02,0xE4,0x02, 0xF6,0x02,0x08,0x03,0x2B,0x03,0x4E,0x03,0x71,0x03,0x83,0x03,0xA6,0x03,0xC9,0x03,0xEC,0x03, 0x0F,0x04,0x32,0x04,0x55,0x04,0x67,0x04,0x8A,0x04,0xAD,0x04,0xBF,0x04,0xD1,0x04,0xF4,0x04, 0x06,0x05,0x29,0x05,0x4C,0x05,0x6F,0x05,0x81,0x05,0xA4,0x05,0xC7,0x05,0xEA,0x05,0x0D,0x06, 0x30,0x06,0x53,0x06,0x76,0x06,0x99,0x06,0xBC,0x06,0xDF,0x06,0xF1,0x06,0x03,0x07,0x15,0x07, 0x38,0x07,0x5B,0x07,0x7E,0x07,0x90,0x07,0xB3,0x07,0xC5,0x07,0xE8,0x07,0xFA,0x07,0x0C,0x08, 0x2F,0x08,0x52,0x08,0x64,0x08,0x76,0x08,0x88,0x08,0x9A,0x08,0xBD,0x08,0xE0,0x08,0x03,0x09, 0x26,0x09,0x49,0x09,0x5B,0x09,0x6D,0x09,0x7F,0x09,0xA2,0x09,0xB4,0x09,0xD7,0x09,0xFA,0x09, 0x0C,0x0A,0x1E,0x0A,0x41,0x0A,0x53,0x0A,0x76,0x0A,0x99,0x0A, 5, // 0x20 ' ' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 6, // 0x21 '!' 0x00,0x00,0x00,0x00,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x00,0x20,0x20,0x00,0x00,0x00, 6, // 0x22 '"' 0x00,0x00,0x00,0x48,0x48,0x48,0x48,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 11, // 0x23 '#' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x80,0x04,0x80,0x09,0x00,0x3F,0xC0,0x09,0x00,0x12,0x00,0x7F,0x80,0x12,0x00,0x24,0x00,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x24 '$' 0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x08,0x00,0x3E,0x00,0x49,0x00,0x48,0x00,0x48,0x00,0x3E,0x00,0x09,0x00,0x09,0x00,0x49,0x00,0x3E,0x00,0x08,0x00,0x08,0x00,0x00,0x00, 15, // 0x25 '%' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x20,0x44,0x40,0x44,0x80,0x44,0x80,0x45,0x38,0x39,0x44,0x02,0x44,0x04,0x44,0x04,0x44,0x08,0x38,0x00,0x00,0x00,0x00,0x00,0x00, 11, // 0x26 '&' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x00,0x42,0x00,0x42,0x00,0x44,0x00,0x38,0x80,0x44,0x80,0x42,0x80,0x41,0x00,0x22,0x80,0x1C,0x40,0x00,0x00,0x00,0x00,0x00,0x00, 4, // 0x27 ''' 0x00,0x00,0x00,0x40,0x40,0x40,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 6, // 0x28 '(' 0x00,0x00,0x00,0x08,0x10,0x20,0x20,0x40,0x40,0x40,0x40,0x40,0x40,0x20,0x20,0x10,0x08, 6, // 0x29 ')' 0x00,0x00,0x00,0x40,0x20,0x10,0x10,0x08,0x08,0x08,0x08,0x08,0x08,0x10,0x10,0x20,0x40, 9, // 0x2A '*' 0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x49,0x00,0x2A,0x00,0x1C,0x00,0x2A,0x00,0x49,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 11, // 0x2B '+' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x04,0x00,0x04,0x00,0x04,0x00,0x7F,0xC0,0x04,0x00,0x04,0x00,0x04,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 5, // 0x2C ',' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x20,0x40,0x00, 7, // 0x2D '-' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 5, // 0x2E '.' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x00,0x00,0x00, 6, // 0x2F '/' 0x00,0x00,0x00,0x04,0x08,0x08,0x08,0x10,0x10,0x20,0x20,0x20,0x40,0x40,0x80,0x80,0x00, 9, // 0x30 '0' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0x00,0x22,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x22,0x00,0x1C,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x31 '1' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x38,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x3E,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x32 '2' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x00,0x41,0x00,0x01,0x00,0x01,0x00,0x02,0x00,0x0C,0x00,0x10,0x00,0x20,0x00,0x40,0x00,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x33 '3' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x00,0x41,0x00,0x01,0x00,0x02,0x00,0x1C,0x00,0x02,0x00,0x01,0x00,0x01,0x00,0x42,0x00,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x34 '4' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x06,0x00,0x0A,0x00,0x12,0x00,0x22,0x00,0x42,0x00,0x7F,0x80,0x02,0x00,0x02,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x35 '5' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x00,0x40,0x00,0x40,0x00,0x40,0x00,0x7C,0x00,0x02,0x00,0x01,0x00,0x01,0x00,0x42,0x00,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x36 '6' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0E,0x00,0x30,0x00,0x20,0x00,0x40,0x00,0x7C,0x00,0x42,0x00,0x41,0x00,0x41,0x00,0x22,0x00,0x1C,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x37 '7' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x00,0x01,0x00,0x02,0x00,0x02,0x00,0x04,0x00,0x04,0x00,0x08,0x00,0x10,0x00,0x10,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x38 '8' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x3E,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x3E,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x39 '9' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0x00,0x22,0x00,0x41,0x00,0x41,0x00,0x21,0x00,0x1F,0x00,0x01,0x00,0x02,0x00,0x06,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 6, // 0x3A ':' 0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x00,0x00,0x00,0x00,0x20,0x20,0x00,0x00,0x00, 6, // 0x3B ';' 0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x00,0x00,0x00,0x00,0x20,0x20,0x20,0x40,0x00, 11, // 0x3C '<' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x80,0x06,0x00,0x18,0x00,0x60,0x00,0x60,0x00,0x18,0x00,0x06,0x00,0x01,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 11, // 0x3D '=' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xC0,0x00,0x00,0x00,0x00,0x3F,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 11, // 0x3E '>' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x0C,0x00,0x03,0x00,0x00,0xC0,0x00,0xC0,0x03,0x00,0x0C,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 8, // 0x3F '?' 0x00,0x00,0x00,0x00,0x3C,0x42,0x02,0x02,0x0C,0x10,0x10,0x00,0x10,0x10,0x00,0x00,0x00, 14, // 0x40 '@' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xC0,0x18,0x20,0x20,0x10,0x27,0xC8,0x48,0x48,0x48,0x48,0x48,0x48,0x48,0x48,0x27,0xF0,0x20,0x00,0x18,0x00,0x07,0xC0,0x00,0x00, 10, // 0x41 'A' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x12,0x00,0x12,0x00,0x21,0x00,0x21,0x00,0x21,0x00,0x7F,0x80,0x40,0x80,0x80,0x40,0x80,0x40,0x00,0x00,0x00,0x00,0x00,0x00, 10, // 0x42 'B' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x7E,0x00,0x41,0x00,0x40,0x80,0x40,0x80,0x41,0x00,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 10, // 0x43 'C' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x00,0x30,0x80,0x20,0x00,0x40,0x00,0x40,0x00,0x40,0x00,0x40,0x00,0x20,0x00,0x30,0x80,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 11, // 0x44 'D' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0x00,0x41,0x80,0x40,0x80,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x80,0x41,0x80,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x45 'E' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x00,0x40,0x00,0x40,0x00,0x40,0x00,0x7F,0x00,0x40,0x00,0x40,0x00,0x40,0x00,0x40,0x00,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 8, // 0x46 'F' 0x00,0x00,0x00,0x00,0x7F,0x40,0x40,0x40,0x7E,0x40,0x40,0x40,0x40,0x40,0x00,0x00,0x00, 11, // 0x47 'G' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x00,0x30,0xC0,0x20,0x40,0x40,0x00,0x40,0x00,0x43,0xC0,0x40,0x40,0x20,0x40,0x30,0x40,0x0F,0x80,0x00,0x00,0x00,0x00,0x00,0x00, 10, // 0x48 'H' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x80,0x40,0x80,0x40,0x80,0x40,0x80,0x7F,0x80,0x40,0x80,0x40,0x80,0x40,0x80,0x40,0x80,0x40,0x80,0x00,0x00,0x00,0x00,0x00,0x00, 5, // 0x49 'I' 0x00,0x00,0x00,0x00,0x70,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x70,0x00,0x00,0x00, 6, // 0x4A 'J' 0x00,0x00,0x00,0x00,0x38,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0xF0,0x00,0x00,0x00, 10, // 0x4B 'K' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x41,0x00,0x42,0x00,0x44,0x00,0x48,0x00,0x50,0x00,0x68,0x00,0x44,0x00,0x42,0x00,0x41,0x00,0x40,0x80,0x00,0x00,0x00,0x00,0x00,0x00, 8, // 0x4C 'L' 0x00,0x00,0x00,0x00,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x7F,0x00,0x00,0x00, 11, // 0x4D 'M' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0xC0,0x60,0xC0,0x51,0x40,0x51,0x40,0x4A,0x40,0x4A,0x40,0x44,0x40,0x44,0x40,0x40,0x40,0x40,0x40,0x00,0x00,0x00,0x00,0x00,0x00, 10, // 0x4E 'N' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x80,0x60,0x80,0x50,0x80,0x48,0x80,0x48,0x80,0x44,0x80,0x44,0x80,0x42,0x80,0x41,0x80,0x41,0x80,0x00,0x00,0x00,0x00,0x00,0x00, 11, // 0x4F 'O' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0E,0x00,0x31,0x80,0x20,0x80,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x20,0x80,0x31,0x80,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 8, // 0x50 'P' 0x00,0x00,0x00,0x00,0x7C,0x42,0x41,0x41,0x42,0x7C,0x40,0x40,0x40,0x40,0x00,0x00,0x00, 11, // 0x51 'Q' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0E,0x00,0x31,0x80,0x20,0x80,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x20,0x80,0x31,0x80,0x0E,0x00,0x02,0x00,0x02,0x00,0x01,0xC0, 10, // 0x52 'R' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x00,0x42,0x00,0x42,0x00,0x42,0x00,0x44,0x00,0x78,0x00,0x44,0x00,0x42,0x00,0x41,0x00,0x40,0x80,0x00,0x00,0x00,0x00,0x00,0x00, 10, // 0x53 'S' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x00,0x20,0x80,0x40,0x00,0x40,0x00,0x38,0x00,0x07,0x00,0x00,0x80,0x40,0x80,0x21,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x54 'T' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x80,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 10, // 0x55 'U' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x80,0x40,0x80,0x40,0x80,0x40,0x80,0x40,0x80,0x40,0x80,0x40,0x80,0x40,0x80,0x21,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 10, // 0x56 'V' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x40,0x80,0x40,0x40,0x80,0x40,0x80,0x21,0x00,0x21,0x00,0x21,0x00,0x12,0x00,0x12,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 15, // 0x57 'W' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x41,0x04,0x41,0x04,0x22,0x88,0x22,0x88,0x22,0x88,0x14,0x50,0x14,0x50,0x14,0x50,0x08,0x20,0x08,0x20,0x00,0x00,0x00,0x00,0x00,0x00, 10, // 0x58 'X' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x80,0x21,0x00,0x12,0x00,0x12,0x00,0x0C,0x00,0x0C,0x00,0x12,0x00,0x12,0x00,0x21,0x00,0x40,0x80,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x59 'Y' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0x41,0x00,0x22,0x00,0x22,0x00,0x14,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 10, // 0x5A 'Z' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x80,0x00,0x80,0x01,0x00,0x02,0x00,0x04,0x00,0x08,0x00,0x10,0x00,0x20,0x00,0x40,0x00,0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00, 6, // 0x5B '[' 0x00,0x00,0x00,0x3C,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x3C, 6, // 0x5C '\' 0x00,0x00,0x00,0x80,0x40,0x40,0x40,0x20,0x20,0x10,0x10,0x10,0x08,0x08,0x08,0x04,0x00, 6, // 0x5D ']' 0x00,0x00,0x00,0x78,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x78, 11, // 0x5E '^' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x0A,0x00,0x11,0x00,0x20,0x80,0x40,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x5F '_' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x80,0x00,0x00, 9, // 0x60 '`' 0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 8, // 0x61 'a' 0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0x22,0x02,0x3E,0x42,0x42,0x46,0x3A,0x00,0x00,0x00, 9, // 0x62 'b' 0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x40,0x00,0x40,0x00,0x5C,0x00,0x62,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x42,0x00,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 7, // 0x63 'c' 0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0x22,0x40,0x40,0x40,0x40,0x22,0x1C,0x00,0x00,0x00, 9, // 0x64 'd' 0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x1F,0x00,0x21,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x23,0x00,0x1D,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 8, // 0x65 'e' 0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x24,0x42,0x7E,0x40,0x40,0x22,0x1C,0x00,0x00,0x00, 6, // 0x66 'f' 0x00,0x00,0x00,0x1C,0x20,0x20,0x7C,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x00,0x00,0x00, 9, // 0x67 'g' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x00,0x21,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x23,0x00,0x1D,0x00,0x01,0x00,0x22,0x00,0x1C,0x00, 9, // 0x68 'h' 0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x40,0x00,0x40,0x00,0x5E,0x00,0x61,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 3, // 0x69 'i' 0x00,0x00,0x00,0x00,0x40,0x00,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x00,0x00,0x00, 5, // 0x6A 'j' 0x00,0x00,0x00,0x00,0x10,0x00,0x70,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0xE0, 8, // 0x6B 'k' 0x00,0x00,0x00,0x40,0x40,0x40,0x42,0x44,0x48,0x50,0x70,0x48,0x44,0x42,0x00,0x00,0x00, 3, // 0x6C 'l' 0x00,0x00,0x00,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x00,0x00,0x00, 13, // 0x6D 'm' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x5C,0xE0,0x63,0x10,0x42,0x10,0x42,0x10,0x42,0x10,0x42,0x10,0x42,0x10,0x42,0x10,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x6E 'n' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x5E,0x00,0x61,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x6F 'o' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0x00,0x22,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x22,0x00,0x1C,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x70 'p' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x5C,0x00,0x62,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x42,0x00,0x7C,0x00,0x40,0x00,0x40,0x00,0x40,0x00, 9, // 0x71 'q' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x00,0x21,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x23,0x00,0x1D,0x00,0x01,0x00,0x01,0x00,0x01,0x00, 6, // 0x72 'r' 0x00,0x00,0x00,0x00,0x00,0x00,0x5C,0x60,0x40,0x40,0x40,0x40,0x40,0x40,0x00,0x00,0x00, 8, // 0x73 's' 0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x42,0x40,0x30,0x0C,0x02,0x42,0x3C,0x00,0x00,0x00, 6, // 0x74 't' 0x00,0x00,0x00,0x00,0x20,0x20,0x7C,0x20,0x20,0x20,0x20,0x20,0x20,0x1C,0x00,0x00,0x00, 9, // 0x75 'u' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x43,0x00,0x3D,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 8, // 0x76 'v' 0x00,0x00,0x00,0x00,0x00,0x00,0x42,0x42,0x24,0x24,0x24,0x18,0x18,0x18,0x00,0x00,0x00, 11, // 0x77 'w' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x44,0x40,0x44,0x40,0x2A,0x80,0x2A,0x80,0x2A,0x80,0x2A,0x80,0x11,0x00,0x11,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x78 'x' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x41,0x00,0x22,0x00,0x14,0x00,0x08,0x00,0x08,0x00,0x14,0x00,0x22,0x00,0x41,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 8, // 0x79 'y' 0x00,0x00,0x00,0x00,0x00,0x00,0x42,0x42,0x24,0x24,0x24,0x18,0x18,0x18,0x10,0x10,0x20, 8, // 0x7A 'z' 0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0x02,0x04,0x08,0x10,0x20,0x40,0x7E,0x00,0x00,0x00, 9, // 0x7B '{' 0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x10,0x00,0x60,0x00,0x10,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x07,0x00, 6, // 0x7C '|' 0x00,0x00,0x00,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, 9, // 0x7D '}' 0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x04,0x00,0x03,0x00,0x04,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x70,0x00, 11, // 0x7E '~' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x40,0x44,0x40,0x44,0x40,0x43,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 14, // 0x7F '' 0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xF8,0x20,0x08,0x20,0x08,0x20,0x08,0x20,0x08,0x20,0x08,0x20,0x08,0x20,0x08,0x20,0x08,0x20,0x08,0x3F,0xF8,0x00,0x00,0x00,0x00,0x00,0x00, 0 }; 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, 0xF7,0x00,0x09,0x01,0x2C,0x01,0x4F,0x01,0x61,0x01,0x73,0x01,0x85,0x01,0xA8,0x01,0xCB,0x01, 0xEE,0x01,0x11,0x02,0x34,0x02,0x57,0x02,0x7A,0x02,0x9D,0x02,0xC0,0x02,0xE3,0x02,0x06,0x03, 0x18,0x03,0x2A,0x03,0x4D,0x03,0x70,0x03,0x93,0x03,0xB6,0x03,0xD9,0x03,0xFC,0x03,0x1F,0x04, 0x42,0x04,0x65,0x04,0x88,0x04,0xAB,0x04,0xCE,0x04,0xF1,0x04,0x03,0x05,0x15,0x05,0x38,0x05, 0x5B,0x05,0x7E,0x05,0xA1,0x05,0xC4,0x05,0xE7,0x05,0x0A,0x06,0x2D,0x06,0x50,0x06,0x73,0x06, 0x96,0x06,0xB9,0x06,0xDC,0x06,0xFF,0x06,0x22,0x07,0x45,0x07,0x57,0x07,0x7A,0x07,0x8C,0x07, 0xAF,0x07,0xD2,0x07,0xF5,0x07,0x18,0x08,0x3B,0x08,0x4D,0x08,0x70,0x08,0x93,0x08,0xA5,0x08, 0xC8,0x08,0xEB,0x08,0xFD,0x08,0x0F,0x09,0x32,0x09,0x44,0x09,0x67,0x09,0x8A,0x09,0xAD,0x09, 0xD0,0x09,0xF3,0x09,0x05,0x0A,0x17,0x0A,0x29,0x0A,0x4C,0x0A,0x6F,0x0A,0x92,0x0A,0xB5,0x0A, 0xD8,0x0A,0xEA,0x0A,0x0D,0x0B,0x1F,0x0B,0x42,0x0B,0x65,0x0B, 5, // 0x20 ' ' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 6, // 0x21 '!' 0x00,0x00,0x00,0x00,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x00,0x30,0x30,0x00,0x00,0x00, 8, // 0x22 '"' 0x00,0x00,0x00,0x66,0x66,0x66,0x66,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 12, // 0x23 '#' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x40,0x04,0x40,0x3F,0xE0,0x3F,0xE0,0x08,0x80,0x11,0x00,0x7F,0xC0,0x7F,0xC0,0x22,0x00,0x22,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 10, // 0x24 '$' 0x00,0x00,0x00,0x00,0x04,0x00,0x04,0x00,0x1F,0x00,0x34,0x80,0x64,0x00,0x74,0x00,0x3C,0x00,0x0F,0x00,0x0B,0x80,0x09,0x80,0x4B,0x00,0x3E,0x00,0x08,0x00,0x08,0x00,0x00,0x00, 18, // 0x25 '%' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x08,0x00,0x66,0x10,0x00,0x66,0x20,0x00,0x66,0x2F,0x00,0x66,0x59,0x80,0x66,0x99,0x80,0x3D,0x19,0x80,0x01,0x19,0x80,0x02,0x19,0x80,0x04,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 12, // 0x26 '&' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x33,0x00,0x36,0x00,0x1C,0x60,0x36,0x60,0x63,0x60,0x61,0xC0,0x31,0xC0,0x1F,0x60,0x00,0x00,0x00,0x00,0x00,0x00, 5, // 0x27 ''' 0x00,0x00,0x00,0x60,0x60,0x60,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 8, // 0x28 '(' 0x00,0x00,0x00,0x0C,0x18,0x30,0x30,0x60,0x60,0x60,0x60,0x60,0x60,0x30,0x30,0x18,0x0C, 8, // 0x29 ')' 0x00,0x00,0x00,0x30,0x18,0x0C,0x0C,0x06,0x06,0x06,0x06,0x06,0x06,0x0C,0x0C,0x18,0x30, 10, // 0x2A '*' 0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x49,0x00,0x2A,0x00,0x1C,0x00,0x2A,0x00,0x49,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 12, // 0x2B '+' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x04,0x00,0x04,0x00,0x04,0x00,0x7F,0xC0,0x04,0x00,0x04,0x00,0x04,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 5, // 0x2C ',' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x60,0x60,0xC0,0xC0,0x00, 7, // 0x2D '-' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 5, // 0x2E '.' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x30,0x00,0x00,0x00, 10, // 0x2F '/' 0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x80,0x01,0x80,0x03,0x00,0x03,0x00,0x06,0x00,0x06,0x00,0x0C,0x00,0x18,0x00,0x18,0x00,0x30,0x00,0x30,0x00,0x60,0x00,0x60,0x00,0x00,0x00, 10, // 0x30 '0' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 10, // 0x31 '1' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x3C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 10, // 0x32 '2' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x00,0x61,0x80,0x61,0x80,0x01,0x80,0x03,0x00,0x06,0x00,0x0C,0x00,0x18,0x00,0x30,0x00,0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00, 10, // 0x33 '3' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x00,0x61,0x80,0x61,0x80,0x01,0x80,0x0F,0x00,0x03,0x00,0x01,0x80,0x61,0x80,0x63,0x00,0x3E,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 10, // 0x34 '4' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x07,0x00,0x0B,0x00,0x13,0x00,0x23,0x00,0x43,0x00,0x7F,0xC0,0x03,0x00,0x03,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 10, // 0x35 '5' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x80,0x30,0x00,0x30,0x00,0x3E,0x00,0x03,0x00,0x01,0x80,0x01,0x80,0x61,0x80,0x63,0x00,0x3E,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 10, // 0x36 '6' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x00,0x38,0x00,0x30,0x00,0x6E,0x00,0x73,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 10, // 0x37 '7' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x80,0x01,0x80,0x03,0x00,0x03,0x00,0x06,0x00,0x06,0x00,0x0C,0x00,0x0C,0x00,0x18,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 10, // 0x38 '8' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x3F,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 10, // 0x39 '9' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x80,0x1D,0x80,0x03,0x00,0x07,0x00,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 6, // 0x3A ':' 0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x30,0x00,0x00,0x30,0x30,0x30,0x00,0x00,0x00, 6, // 0x3B ';' 0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x30,0x00,0x00,0x38,0x30,0x30,0x60,0x60,0x00, 12, // 0x3C '<' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x03,0x00,0x0C,0x00,0x30,0x00,0x40,0x00,0x30,0x00,0x0C,0x00,0x03,0x00,0x00,0xC0,0x00,0x00,0x00,0x00,0x00,0x00, 12, // 0x3D '=' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 12, // 0x3E '>' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x18,0x00,0x06,0x00,0x01,0x80,0x00,0x40,0x01,0x80,0x06,0x00,0x18,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x3F '?' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x00,0x63,0x00,0x03,0x00,0x06,0x00,0x0C,0x00,0x18,0x00,0x18,0x00,0x00,0x00,0x18,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 14, // 0x40 '@' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xC0,0x18,0x20,0x20,0x10,0x27,0xC8,0x4C,0xC8,0x4C,0xC8,0x4C,0xC8,0x4C,0xC8,0x27,0xF0,0x20,0x00,0x18,0x00,0x07,0xC0,0x00,0x00, 11, // 0x41 'A' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0E,0x00,0x0E,0x00,0x0E,0x00,0x1B,0x00,0x1B,0x00,0x31,0x80,0x3F,0x80,0x31,0x80,0x60,0xC0,0x60,0xC0,0x00,0x00,0x00,0x00,0x00,0x00, 11, // 0x42 'B' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x7F,0x00,0x61,0x80,0x60,0xC0,0x60,0xC0,0x61,0x80,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 11, // 0x43 'C' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x80,0x30,0xC0,0x30,0xC0,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x30,0xC0,0x30,0xC0,0x0F,0x80,0x00,0x00,0x00,0x00,0x00,0x00, 11, // 0x44 'D' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0x00,0x61,0x80,0x61,0x80,0x60,0xC0,0x60,0xC0,0x60,0xC0,0x60,0xC0,0x61,0x80,0x61,0x80,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 10, // 0x45 'E' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x80,0x60,0x00,0x60,0x00,0x60,0x00,0x7F,0x80,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x46 'F' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x7F,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 11, // 0x47 'G' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x80,0x30,0xC0,0x30,0xC0,0x60,0x00,0x60,0x00,0x63,0xC0,0x60,0xC0,0x30,0xC0,0x30,0xC0,0x0F,0x80,0x00,0x00,0x00,0x00,0x00,0x00, 11, // 0x48 'H' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0xC0,0x60,0xC0,0x60,0xC0,0x60,0xC0,0x7F,0xC0,0x60,0xC0,0x60,0xC0,0x60,0xC0,0x60,0xC0,0x60,0xC0,0x00,0x00,0x00,0x00,0x00,0x00, 8, // 0x49 'I' 0x00,0x00,0x00,0x00,0x7E,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x7E,0x00,0x00,0x00, 8, // 0x4A 'J' 0x00,0x00,0x00,0x00,0x3E,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x0C,0xF8,0x00,0x00,0x00, 11, // 0x4B 'K' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0xC0,0x61,0x80,0x63,0x00,0x66,0x00,0x6C,0x00,0x7C,0x00,0x76,0x00,0x63,0x00,0x61,0x80,0x60,0xC0,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x4C 'L' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00, 13, // 0x4D 'M' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x70,0x70,0x70,0x70,0xF0,0x58,0xB0,0x59,0xB0,0x4D,0x30,0x4F,0x30,0x46,0x30,0x46,0x30,0x40,0x30,0x00,0x00,0x00,0x00,0x00,0x00, 11, // 0x4E 'N' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x40,0x70,0x40,0x58,0x40,0x4C,0x40,0x4C,0x40,0x46,0x40,0x43,0x40,0x43,0x40,0x41,0xC0,0x40,0xC0,0x00,0x00,0x00,0x00,0x00,0x00, 12, // 0x4F 'O' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x00,0x30,0xC0,0x30,0xC0,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x30,0xC0,0x30,0xC0,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 10, // 0x50 'P' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0x00,0x63,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x63,0x00,0x7E,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 12, // 0x51 'Q' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x00,0x30,0xC0,0x30,0xC0,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x30,0xC0,0x30,0xC0,0x0F,0x80,0x03,0x00,0x03,0x00,0x01,0xE0, 11, // 0x52 'R' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x00,0x61,0x80,0x60,0xC0,0x60,0xC0,0x61,0x80,0x7F,0x00,0x63,0x00,0x61,0x80,0x60,0xC0,0x60,0x60,0x00,0x00,0x00,0x00,0x00,0x00, 10, // 0x53 'S' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x00,0x31,0x80,0x61,0x80,0x60,0x00,0x3E,0x00,0x1F,0x00,0x01,0x80,0x61,0x80,0x63,0x00,0x3E,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 10, // 0x54 'T' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x80,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 11, // 0x55 'U' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0xC0,0x60,0xC0,0x60,0xC0,0x60,0xC0,0x60,0xC0,0x60,0xC0,0x60,0xC0,0x60,0xC0,0x31,0x80,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 11, // 0x56 'V' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0xC0,0x60,0xC0,0x60,0xC0,0x31,0x80,0x31,0x80,0x31,0x80,0x1B,0x00,0x1B,0x00,0x0E,0x00,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 16, // 0x57 'W' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x61,0x86,0x61,0x86,0x63,0xC6,0x32,0x4C,0x36,0x6C,0x36,0x6C,0x34,0x2C,0x1C,0x38,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00, 11, // 0x58 'X' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0xC0,0x31,0x80,0x31,0x80,0x1B,0x00,0x0E,0x00,0x0E,0x00,0x1B,0x00,0x31,0x80,0x31,0x80,0x60,0xC0,0x00,0x00,0x00,0x00,0x00,0x00, 10, // 0x59 'Y' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xC0,0x61,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 10, // 0x5A 'Z' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x80,0x01,0x80,0x03,0x00,0x06,0x00,0x0C,0x00,0x0C,0x00,0x18,0x00,0x30,0x00,0x60,0x00,0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00, 8, // 0x5B '[' 0x00,0x00,0x00,0x3E,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x3E, 10, // 0x5C '\' 0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x60,0x00,0x30,0x00,0x30,0x00,0x18,0x00,0x18,0x00,0x0C,0x00,0x06,0x00,0x06,0x00,0x03,0x00,0x03,0x00,0x01,0x80,0x01,0x80,0x00,0x00, 8, // 0x5D ']' 0x00,0x00,0x00,0x7C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x7C, 12, // 0x5E '^' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x0E,0x00,0x1B,0x00,0x31,0x80,0x60,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 10, // 0x5F '_' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xC0,0x00,0x00, 10, // 0x60 '`' 0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x61 'a' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x00,0x03,0x00,0x03,0x00,0x3F,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 10, // 0x62 'b' 0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x6E,0x00,0x73,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x63,0x00,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 8, // 0x63 'c' 0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x33,0x60,0x60,0x60,0x60,0x33,0x1E,0x00,0x00,0x00, 10, // 0x64 'd' 0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x80,0x01,0x80,0x01,0x80,0x1F,0x80,0x31,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x80,0x1D,0x80,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x65 'e' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x63,0x00,0x7F,0x00,0x60,0x00,0x60,0x00,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 6, // 0x66 'f' 0x00,0x00,0x00,0x1C,0x30,0x30,0x7C,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x00,0x00,0x00, 10, // 0x67 'g' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x80,0x31,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x80,0x1D,0x80,0x01,0x80,0x03,0x00,0x3E,0x00, 10, // 0x68 'h' 0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x6F,0x00,0x71,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x00,0x00,0x00,0x00,0x00,0x00, 4, // 0x69 'i' 0x00,0x00,0x00,0x60,0x60,0x00,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x00,0x00,0x00, 6, // 0x6A 'j' 0x00,0x00,0x00,0x18,0x18,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xF0, 9, // 0x6B 'k' 0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x63,0x00,0x66,0x00,0x6C,0x00,0x78,0x00,0x7C,0x00,0x66,0x00,0x63,0x00,0x61,0x80,0x00,0x00,0x00,0x00,0x00,0x00, 4, // 0x6C 'l' 0x00,0x00,0x00,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x00,0x00,0x00, 14, // 0x6D 'm' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6E,0x70,0x73,0x98,0x63,0x18,0x63,0x18,0x63,0x18,0x63,0x18,0x63,0x18,0x63,0x18,0x00,0x00,0x00,0x00,0x00,0x00, 10, // 0x6E 'n' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6F,0x00,0x71,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x00,0x00,0x00,0x00,0x00,0x00, 10, // 0x6F 'o' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 10, // 0x70 'p' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6E,0x00,0x73,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x63,0x00,0x7E,0x00,0x60,0x00,0x60,0x00,0x60,0x00, 10, // 0x71 'q' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x80,0x31,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x80,0x1D,0x80,0x01,0x80,0x01,0x80,0x01,0x80, 7, // 0x72 'r' 0x00,0x00,0x00,0x00,0x00,0x00,0x6E,0x7E,0x60,0x60,0x60,0x60,0x60,0x60,0x00,0x00,0x00, 8, // 0x73 's' 0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x62,0x60,0x7C,0x3E,0x06,0x46,0x3C,0x00,0x00,0x00, 6, // 0x74 't' 0x00,0x00,0x00,0x00,0x60,0x60,0xFC,0x60,0x60,0x60,0x60,0x60,0x60,0x3C,0x00,0x00,0x00, 10, // 0x75 'u' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x63,0x80,0x3D,0x80,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x76 'v' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x36,0x00,0x36,0x00,0x36,0x00,0x1C,0x00,0x1C,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 14, // 0x77 'w' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x63,0x18,0x63,0x18,0x33,0x30,0x37,0xB0,0x34,0xB0,0x1C,0xE0,0x1C,0xE0,0x0C,0xC0,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x78 'x' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x63,0x00,0x63,0x00,0x36,0x00,0x1C,0x00,0x1C,0x00,0x36,0x00,0x63,0x00,0x63,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x79 'y' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x36,0x00,0x36,0x00,0x36,0x00,0x1C,0x00,0x1C,0x00,0x0C,0x00,0x18,0x00,0x18,0x00, 8, // 0x7A 'z' 0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0x06,0x0C,0x18,0x18,0x30,0x60,0x7E,0x00,0x00,0x00, 10, // 0x7B '{' 0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x80,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x18,0x00,0x70,0x00,0x18,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x07,0x80, 8, // 0x7C '|' 0x00,0x00,0x00,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, 10, // 0x7D '}' 0x00,0x00,0x00,0x00,0x00,0x00,0x78,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x06,0x00,0x03,0x80,0x06,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x78,0x00, 12, // 0x7E '~' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x20,0x24,0x20,0x46,0x20,0x42,0x40,0x41,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 14, // 0x7F '' 0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xF8,0x20,0x08,0x20,0x08,0x20,0x08,0x20,0x08,0x20,0x08,0x20,0x08,0x20,0x08,0x20,0x08,0x20,0x08,0x3F,0xF8,0x00,0x00,0x00,0x00,0x00,0x00, 0 }; 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, 0xF3,0x00,0x06,0x01,0x2B,0x01,0x50,0x01,0x63,0x01,0x76,0x01,0x89,0x01,0x9C,0x01,0xC1,0x01, 0xE6,0x01,0x0B,0x02,0x30,0x02,0x55,0x02,0x7A,0x02,0x9F,0x02,0xC4,0x02,0xE9,0x02,0x0E,0x03, 0x21,0x03,0x34,0x03,0x59,0x03,0x7E,0x03,0xA3,0x03,0xB6,0x03,0xDB,0x03,0x00,0x04,0x25,0x04, 0x4A,0x04,0x6F,0x04,0x94,0x04,0xB9,0x04,0xDE,0x04,0x03,0x05,0x16,0x05,0x29,0x05,0x4E,0x05, 0x61,0x05,0x86,0x05,0xAB,0x05,0xD0,0x05,0xF5,0x05,0x1A,0x06,0x3F,0x06,0x64,0x06,0x89,0x06, 0xAE,0x06,0xD3,0x06,0xF8,0x06,0x1D,0x07,0x42,0x07,0x67,0x07,0x7A,0x07,0x8D,0x07,0xA0,0x07, 0xC5,0x07,0xEA,0x07,0x0F,0x08,0x34,0x08,0x59,0x08,0x6C,0x08,0x91,0x08,0xB6,0x08,0xC9,0x08, 0xEE,0x08,0x13,0x09,0x26,0x09,0x39,0x09,0x5E,0x09,0x71,0x09,0x96,0x09,0xBB,0x09,0xE0,0x09, 0x05,0x0A,0x2A,0x0A,0x3D,0x0A,0x50,0x0A,0x63,0x0A,0x88,0x0A,0xAD,0x0A,0xD2,0x0A,0xF7,0x0A, 0x1C,0x0B,0x41,0x0B,0x66,0x0B,0x79,0x0B,0x9E,0x0B,0xC3,0x0B, 5, // 0x20 ' ' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 6, // 0x21 '!' 0x00,0x00,0x00,0x00,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x00,0x20,0x20,0x00,0x00,0x00, 7, // 0x22 '"' 0x00,0x00,0x00,0x48,0x48,0x48,0x48,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 12, // 0x23 '#' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x80,0x04,0x80,0x09,0x00,0x3F,0xC0,0x09,0x00,0x11,0x00,0x12,0x00,0x7F,0x80,0x12,0x00,0x24,0x00,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 10, // 0x24 '$' 0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x08,0x00,0x3E,0x00,0x49,0x00,0x48,0x00,0x48,0x00,0x38,0x00,0x0E,0x00,0x09,0x00,0x09,0x00,0x49,0x00,0x3E,0x00,0x08,0x00,0x08,0x00,0x08,0x00, 16, // 0x25 '%' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x20,0x44,0x40,0x44,0x40,0x44,0x80,0x44,0x80,0x38,0x9C,0x01,0x22,0x01,0x22,0x02,0x22,0x02,0x22,0x04,0x1C,0x00,0x00,0x00,0x00,0x00,0x00, 12, // 0x26 '&' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x21,0x00,0x21,0x00,0x21,0x00,0x1E,0x40,0x24,0x40,0x42,0x40,0x41,0x40,0x40,0x80,0x21,0x40,0x1E,0x20,0x00,0x00,0x00,0x00,0x00,0x00, 4, // 0x27 ''' 0x00,0x00,0x00,0x40,0x40,0x40,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 7, // 0x28 '(' 0x00,0x00,0x00,0x08,0x10,0x20,0x20,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x20,0x20,0x10,0x08, 7, // 0x29 ')' 0x00,0x00,0x00,0x20,0x10,0x08,0x08,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x08,0x08,0x10,0x20, 10, // 0x2A '*' 0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x49,0x00,0x2A,0x00,0x1C,0x00,0x2A,0x00,0x49,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 12, // 0x2B '+' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x02,0x00,0x02,0x00,0x02,0x00,0x3F,0xE0,0x02,0x00,0x02,0x00,0x02,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 5, // 0x2C ',' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x20,0x40,0x40, 7, // 0x2D '-' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 5, // 0x2E '.' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x00,0x00,0x00, 7, // 0x2F '/' 0x00,0x00,0x00,0x02,0x04,0x04,0x04,0x08,0x08,0x10,0x10,0x20,0x20,0x40,0x40,0x40,0x80,0x00, 10, // 0x30 '0' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x21,0x00,0x40,0x80,0x40,0x80,0x40,0x80,0x40,0x80,0x40,0x80,0x40,0x80,0x40,0x80,0x21,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 10, // 0x31 '1' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x04,0x00,0x1C,0x00,0x04,0x00,0x04,0x00,0x04,0x00,0x04,0x00,0x04,0x00,0x04,0x00,0x04,0x00,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 10, // 0x32 '2' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x00,0x41,0x00,0x00,0x80,0x00,0x80,0x00,0x80,0x01,0x00,0x02,0x00,0x0C,0x00,0x30,0x00,0x40,0x00,0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00, 10, // 0x33 '3' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x00,0x40,0x80,0x00,0x80,0x01,0x00,0x0E,0x00,0x01,0x00,0x00,0x80,0x00,0x80,0x00,0x80,0x41,0x00,0x3E,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 10, // 0x34 '4' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x03,0x00,0x05,0x00,0x09,0x00,0x11,0x00,0x21,0x00,0x41,0x00,0x7F,0xC0,0x01,0x00,0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 10, // 0x35 '5' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x80,0x20,0x00,0x20,0x00,0x20,0x00,0x3E,0x00,0x01,0x00,0x00,0x80,0x00,0x80,0x00,0x80,0x41,0x00,0x3E,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 10, // 0x36 '6' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x00,0x10,0x00,0x20,0x00,0x40,0x00,0x5E,0x00,0x61,0x00,0x40,0x80,0x40,0x80,0x40,0x80,0x21,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 10, // 0x37 '7' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x00,0x01,0x00,0x02,0x00,0x02,0x00,0x04,0x00,0x04,0x00,0x08,0x00,0x08,0x00,0x10,0x00,0x10,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 10, // 0x38 '8' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x21,0x00,0x40,0x80,0x40,0x80,0x21,0x00,0x1E,0x00,0x21,0x00,0x40,0x80,0x40,0x80,0x21,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 10, // 0x39 '9' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x21,0x00,0x40,0x80,0x40,0x80,0x40,0x80,0x20,0x80,0x1F,0x80,0x00,0x80,0x01,0x00,0x02,0x00,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 7, // 0x3A ':' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x10,0x00,0x00,0x00,0x00,0x10,0x10,0x00,0x00,0x00, 7, // 0x3B ';' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x10,0x00,0x00,0x00,0x00,0x10,0x10,0x10,0x20,0x20, 12, // 0x3C '<' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x03,0x00,0x0C,0x00,0x30,0x00,0x30,0x00,0x0C,0x00,0x03,0x00,0x00,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 12, // 0x3D '=' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xE0,0x00,0x00,0x00,0x00,0x3F,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 12, // 0x3E '>' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x0C,0x00,0x03,0x00,0x00,0xC0,0x00,0xC0,0x03,0x00,0x0C,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 8, // 0x3F '?' 0x00,0x00,0x00,0x00,0x3C,0x42,0x02,0x02,0x04,0x08,0x10,0x10,0x00,0x10,0x10,0x00,0x00,0x00, 15, // 0x40 '@' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x80,0x18,0x60,0x20,0x10,0x23,0xD0,0x44,0x48,0x48,0x48,0x48,0x48,0x48,0x48,0x44,0x48,0x23,0xF0,0x20,0x00,0x18,0x00,0x07,0xC0,0x00,0x00, 10, // 0x41 'A' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x21,0x00,0x21,0x00,0x40,0x80,0x7F,0x80,0x40,0x80,0x80,0x40,0x80,0x40,0x00,0x00,0x00,0x00,0x00,0x00, 10, // 0x42 'B' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x7E,0x00,0x41,0x00,0x40,0x80,0x40,0x80,0x40,0x80,0x41,0x00,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 11, // 0x43 'C' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x00,0x30,0xC0,0x20,0x40,0x40,0x00,0x40,0x00,0x40,0x00,0x40,0x00,0x40,0x00,0x20,0x40,0x30,0xC0,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 11, // 0x44 'D' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0x00,0x41,0x80,0x40,0x80,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x80,0x41,0x80,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x45 'E' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x00,0x40,0x00,0x40,0x00,0x40,0x00,0x7F,0x00,0x40,0x00,0x40,0x00,0x40,0x00,0x40,0x00,0x40,0x00,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x46 'F' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x80,0x40,0x00,0x40,0x00,0x40,0x00,0x7F,0x00,0x40,0x00,0x40,0x00,0x40,0x00,0x40,0x00,0x40,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 12, // 0x47 'G' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x80,0x30,0x60,0x20,0x20,0x40,0x00,0x40,0x00,0x41,0xE0,0x40,0x20,0x40,0x20,0x20,0x20,0x30,0x20,0x0F,0xC0,0x00,0x00,0x00,0x00,0x00,0x00, 11, // 0x48 'H' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x7F,0xC0,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x00,0x00,0x00,0x00,0x00,0x00, 5, // 0x49 'I' 0x00,0x00,0x00,0x00,0x70,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x70,0x00,0x00,0x00, 7, // 0x4A 'J' 0x00,0x00,0x00,0x00,0x3C,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x08,0xF0,0x00,0x00,0x00, 10, // 0x4B 'K' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x80,0x41,0x00,0x42,0x00,0x44,0x00,0x48,0x00,0x50,0x00,0x68,0x00,0x44,0x00,0x42,0x00,0x41,0x00,0x40,0x80,0x00,0x00,0x00,0x00,0x00,0x00, 8, // 0x4C 'L' 0x00,0x00,0x00,0x00,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x7F,0x00,0x00,0x00, 13, // 0x4D 'M' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x30,0x50,0x50,0x50,0x50,0x48,0x90,0x48,0x90,0x45,0x10,0x45,0x10,0x42,0x10,0x42,0x10,0x40,0x10,0x40,0x10,0x00,0x00,0x00,0x00,0x00,0x00, 11, // 0x4E 'N' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x40,0x60,0x40,0x50,0x40,0x48,0x40,0x48,0x40,0x44,0x40,0x42,0x40,0x42,0x40,0x41,0x40,0x40,0xC0,0x40,0x40,0x00,0x00,0x00,0x00,0x00,0x00, 12, // 0x4F 'O' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x00,0x30,0xC0,0x20,0x40,0x40,0x20,0x40,0x20,0x40,0x20,0x40,0x20,0x40,0x20,0x20,0x40,0x30,0xC0,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x50 'P' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0x00,0x41,0x00,0x40,0x80,0x40,0x80,0x40,0x80,0x41,0x00,0x7E,0x00,0x40,0x00,0x40,0x00,0x40,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 12, // 0x51 'Q' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x00,0x30,0xC0,0x20,0x40,0x40,0x20,0x40,0x20,0x40,0x20,0x40,0x20,0x40,0x20,0x20,0x40,0x30,0xC0,0x0F,0x00,0x01,0x00,0x01,0x00,0x00,0xE0, 10, // 0x52 'R' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x00,0x42,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x42,0x00,0x7C,0x00,0x42,0x00,0x41,0x00,0x40,0x80,0x40,0x40,0x00,0x00,0x00,0x00,0x00,0x00, 10, // 0x53 'S' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x00,0x20,0x80,0x40,0x00,0x40,0x00,0x20,0x00,0x1E,0x00,0x01,0x00,0x00,0x80,0x40,0x80,0x21,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x54 'T' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x80,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 11, // 0x55 'U' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x20,0x80,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 10, // 0x56 'V' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x40,0x80,0x40,0x40,0x80,0x40,0x80,0x40,0x80,0x21,0x00,0x21,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 15, // 0x57 'W' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x41,0x04,0x41,0x04,0x22,0x88,0x22,0x88,0x22,0x88,0x12,0x90,0x14,0x50,0x14,0x50,0x14,0x50,0x08,0x20,0x08,0x20,0x00,0x00,0x00,0x00,0x00,0x00, 10, // 0x58 'X' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x80,0x21,0x00,0x21,0x00,0x12,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x12,0x00,0x21,0x00,0x21,0x00,0x40,0x80,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x59 'Y' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0x41,0x00,0x22,0x00,0x22,0x00,0x14,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 10, // 0x5A 'Z' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x80,0x00,0x80,0x01,0x00,0x02,0x00,0x04,0x00,0x08,0x00,0x08,0x00,0x10,0x00,0x20,0x00,0x40,0x00,0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00, 7, // 0x5B '[' 0x00,0x00,0x00,0x3C,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x3C, 7, // 0x5C '\' 0x00,0x00,0x00,0x80,0x40,0x40,0x40,0x20,0x20,0x10,0x10,0x08,0x08,0x04,0x04,0x04,0x02,0x00, 7, // 0x5D ']' 0x00,0x00,0x00,0x78,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x78, 12, // 0x5E '^' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x09,0x00,0x10,0x80,0x20,0x40,0x40,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 10, // 0x5F '_' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xC0,0x00,0x00, 10, // 0x60 '`' 0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x61 'a' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x21,0x00,0x01,0x00,0x3F,0x00,0x41,0x00,0x41,0x00,0x43,0x00,0x3D,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x62 'b' 0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x40,0x00,0x40,0x00,0x40,0x00,0x5C,0x00,0x62,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x42,0x00,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 8, // 0x63 'c' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x21,0x40,0x40,0x40,0x40,0x21,0x1E,0x00,0x00,0x00, 9, // 0x64 'd' 0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x1F,0x00,0x21,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x23,0x00,0x1D,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x65 'e' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0x00,0x22,0x00,0x41,0x00,0x7F,0x00,0x40,0x00,0x40,0x00,0x21,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 6, // 0x66 'f' 0x00,0x00,0x00,0x1C,0x20,0x20,0x20,0x7C,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x00,0x00,0x00, 9, // 0x67 'g' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x00,0x21,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x23,0x00,0x1D,0x00,0x01,0x00,0x22,0x00,0x1C,0x00, 9, // 0x68 'h' 0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x40,0x00,0x40,0x00,0x40,0x00,0x5E,0x00,0x61,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 3, // 0x69 'i' 0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x00,0x00,0x00, 5, // 0x6A 'j' 0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x70,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0xE0, 9, // 0x6B 'k' 0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x40,0x00,0x40,0x00,0x40,0x00,0x42,0x00,0x44,0x00,0x48,0x00,0x50,0x00,0x68,0x00,0x44,0x00,0x42,0x00,0x41,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 3, // 0x6C 'l' 0x00,0x00,0x00,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x00,0x00,0x00, 15, // 0x6D 'm' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2E,0x70,0x31,0x88,0x21,0x08,0x21,0x08,0x21,0x08,0x21,0x08,0x21,0x08,0x21,0x08,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x6E 'n' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x5E,0x00,0x61,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 10, // 0x6F 'o' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x21,0x00,0x40,0x80,0x40,0x80,0x40,0x80,0x40,0x80,0x21,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x70 'p' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x5C,0x00,0x62,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x42,0x00,0x7C,0x00,0x40,0x00,0x40,0x00,0x40,0x00, 9, // 0x71 'q' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x00,0x21,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x23,0x00,0x1D,0x00,0x01,0x00,0x01,0x00,0x01,0x00, 6, // 0x72 'r' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x5C,0x60,0x40,0x40,0x40,0x40,0x40,0x40,0x00,0x00,0x00, 8, // 0x73 's' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x42,0x40,0x30,0x0C,0x02,0x42,0x3C,0x00,0x00,0x00, 6, // 0x74 't' 0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x7C,0x20,0x20,0x20,0x20,0x20,0x20,0x1C,0x00,0x00,0x00, 9, // 0x75 'u' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x41,0x00,0x43,0x00,0x3D,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x76 'v' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x41,0x00,0x41,0x00,0x22,0x00,0x22,0x00,0x22,0x00,0x14,0x00,0x14,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 13, // 0x77 'w' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x42,0x10,0x42,0x10,0x25,0x20,0x25,0x20,0x28,0xA0,0x28,0xA0,0x10,0x40,0x10,0x40,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x78 'x' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x41,0x00,0x22,0x00,0x14,0x00,0x08,0x00,0x08,0x00,0x14,0x00,0x22,0x00,0x41,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x79 'y' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x41,0x00,0x41,0x00,0x22,0x00,0x22,0x00,0x22,0x00,0x14,0x00,0x14,0x00,0x08,0x00,0x08,0x00,0x10,0x00,0x10,0x00, 9, // 0x7A 'z' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x00,0x02,0x00,0x04,0x00,0x08,0x00,0x10,0x00,0x20,0x00,0x40,0x00,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 10, // 0x7B '{' 0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x10,0x00,0x60,0x00,0x10,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x07,0x00, 7, // 0x7C '|' 0x00,0x00,0x00,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, 10, // 0x7D '}' 0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x04,0x00,0x04,0x00,0x04,0x00,0x04,0x00,0x04,0x00,0x02,0x00,0x01,0x80,0x02,0x00,0x04,0x00,0x04,0x00,0x04,0x00,0x04,0x00,0x04,0x00,0x38,0x00, 12, // 0x7E '~' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x20,0x24,0x20,0x42,0x40,0x41,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 15, // 0x7F '' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xF8,0x20,0x08,0x20,0x08,0x20,0x08,0x20,0x08,0x20,0x08,0x20,0x08,0x20,0x08,0x20,0x08,0x20,0x08,0x3F,0xF8,0x00,0x00,0x00,0x00,0x00,0x00, 0 }; 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, 0x17,0x01,0x2A,0x01,0x4F,0x01,0x74,0x01,0x87,0x01,0x9A,0x01,0xAD,0x01,0xD2,0x01,0xF7,0x01, 0x1C,0x02,0x41,0x02,0x66,0x02,0x8B,0x02,0xB0,0x02,0xD5,0x02,0xFA,0x02,0x1F,0x03,0x44,0x03, 0x57,0x03,0x6A,0x03,0x8F,0x03,0xB4,0x03,0xD9,0x03,0xFE,0x03,0x23,0x04,0x48,0x04,0x6D,0x04, 0x92,0x04,0xB7,0x04,0xDC,0x04,0x01,0x05,0x26,0x05,0x4B,0x05,0x5E,0x05,0x71,0x05,0x96,0x05, 0xBB,0x05,0xE0,0x05,0x05,0x06,0x2A,0x06,0x4F,0x06,0x74,0x06,0x99,0x06,0xBE,0x06,0xE3,0x06, 0x08,0x07,0x2D,0x07,0x52,0x07,0x77,0x07,0x9C,0x07,0xC1,0x07,0xD4,0x07,0xF9,0x07,0x0C,0x08, 0x31,0x08,0x56,0x08,0x7B,0x08,0xA0,0x08,0xC5,0x08,0xD8,0x08,0xFD,0x08,0x22,0x09,0x35,0x09, 0x5A,0x09,0x7F,0x09,0x92,0x09,0xA5,0x09,0xCA,0x09,0xDD,0x09,0x02,0x0A,0x27,0x0A,0x4C,0x0A, 0x71,0x0A,0x96,0x0A,0xA9,0x0A,0xCE,0x0A,0xE1,0x0A,0x06,0x0B,0x2B,0x0B,0x50,0x0B,0x75,0x0B, 0x9A,0x0B,0xBF,0x0B,0xE4,0x0B,0xF7,0x0B,0x1C,0x0C,0x41,0x0C, 5, // 0x20 ' ' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 6, // 0x21 '!' 0x00,0x00,0x00,0x00,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x00,0x30,0x30,0x00,0x00,0x00, 9, // 0x22 '"' 0x00,0x00,0x00,0x00,0x00,0x00,0x36,0x00,0x36,0x00,0x36,0x00,0x36,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 13, // 0x23 '#' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x20,0x04,0x20,0x08,0x40,0x3F,0xF0,0x3F,0xF0,0x08,0x40,0x10,0x80,0x7F,0xE0,0x7F,0xE0,0x21,0x00,0x21,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 11, // 0x24 '$' 0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x04,0x00,0x1F,0x80,0x34,0xC0,0x64,0xC0,0x64,0x00,0x3C,0x00,0x07,0x80,0x04,0xC0,0x64,0xC0,0x65,0x80,0x3F,0x00,0x04,0x00,0x04,0x00,0x00,0x00, 19, // 0x25 '%' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x08,0x00,0x63,0x10,0x00,0x63,0x10,0x00,0x63,0x20,0x00,0x63,0x2F,0x80,0x63,0x58,0xC0,0x3E,0x98,0xC0,0x00,0x98,0xC0,0x01,0x18,0xC0,0x01,0x18,0xC0,0x02,0x0F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 13, // 0x26 '&' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x33,0x00,0x33,0x00,0x1E,0x60,0x36,0x60,0x63,0x60,0x61,0xC0,0x60,0xC0,0x30,0xE0,0x1F,0x30,0x00,0x00,0x00,0x00,0x00,0x00, 5, // 0x27 ''' 0x00,0x00,0x00,0x60,0x60,0x60,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 8, // 0x28 '(' 0x00,0x00,0x00,0x06,0x0C,0x18,0x30,0x30,0x60,0x60,0x60,0x60,0x60,0x30,0x30,0x18,0x0C,0x06, 8, // 0x29 ')' 0x00,0x00,0x00,0x60,0x30,0x18,0x0C,0x0C,0x06,0x06,0x06,0x06,0x06,0x0C,0x0C,0x18,0x30,0x60, 11, // 0x2A '*' 0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x24,0x80,0x15,0x00,0x0E,0x00,0x15,0x00,0x24,0x80,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 13, // 0x2B '+' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x02,0x00,0x02,0x00,0x02,0x00,0x3F,0xE0,0x02,0x00,0x02,0x00,0x02,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 5, // 0x2C ',' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x60,0x60,0x60,0xC0,0xC0, 7, // 0x2D '-' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 5, // 0x2E '.' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x30,0x00,0x00,0x00, 10, // 0x2F '/' 0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x80,0x01,0x80,0x03,0x00,0x03,0x00,0x06,0x00,0x06,0x00,0x0C,0x00,0x0C,0x00,0x18,0x00,0x18,0x00,0x30,0x00,0x30,0x00,0x60,0x00,0x60,0x00,0x00,0x00, 11, // 0x30 '0' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x00,0x31,0x80,0x60,0xC0,0x60,0xC0,0x60,0xC0,0x60,0xC0,0x60,0xC0,0x60,0xC0,0x60,0xC0,0x31,0x80,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 11, // 0x31 '1' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x1E,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x1F,0x80,0x00,0x00,0x00,0x00,0x00,0x00, 11, // 0x32 '2' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x00,0x61,0x80,0x60,0xC0,0x00,0xC0,0x01,0x80,0x03,0x00,0x06,0x00,0x0C,0x00,0x18,0x00,0x30,0x00,0x7F,0xC0,0x00,0x00,0x00,0x00,0x00,0x00, 11, // 0x33 '3' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x00,0x61,0x80,0x60,0xC0,0x00,0xC0,0x01,0x80,0x0F,0x00,0x01,0x80,0x00,0xC0,0x60,0xC0,0x61,0x80,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 11, // 0x34 '4' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x80,0x03,0x80,0x05,0x80,0x09,0x80,0x11,0x80,0x21,0x80,0x41,0x80,0x7F,0xE0,0x01,0x80,0x01,0x80,0x01,0x80,0x00,0x00,0x00,0x00,0x00,0x00, 11, // 0x35 '5' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xC0,0x30,0x00,0x30,0x00,0x30,0x00,0x3F,0x00,0x01,0x80,0x00,0xC0,0x00,0xC0,0x60,0xC0,0x61,0x80,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 11, // 0x36 '6' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x80,0x18,0x00,0x30,0x00,0x60,0x00,0x6F,0x00,0x71,0x80,0x60,0xC0,0x60,0xC0,0x60,0xC0,0x31,0x80,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 11, // 0x37 '7' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xC0,0x00,0xC0,0x01,0x80,0x01,0x80,0x03,0x00,0x03,0x00,0x06,0x00,0x06,0x00,0x0C,0x00,0x0C,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 11, // 0x38 '8' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x00,0x31,0x80,0x60,0xC0,0x60,0xC0,0x31,0x80,0x1F,0x00,0x31,0x80,0x60,0xC0,0x60,0xC0,0x31,0x80,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 11, // 0x39 '9' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x00,0x31,0x80,0x60,0xC0,0x60,0xC0,0x60,0xC0,0x31,0xC0,0x1E,0xC0,0x00,0xC0,0x01,0x80,0x03,0x00,0x3E,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 6, // 0x3A ':' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x30,0x00,0x00,0x30,0x30,0x30,0x00,0x00,0x00, 6, // 0x3B ';' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x30,0x00,0x00,0x38,0x30,0x30,0x30,0x60,0x60, 13, // 0x3C '<' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0xC0,0x03,0x00,0x0C,0x00,0x30,0x00,0x30,0x00,0x0C,0x00,0x03,0x00,0x00,0xC0,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00, 13, // 0x3D '=' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 13, // 0x3E '>' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x18,0x00,0x06,0x00,0x01,0x80,0x00,0x60,0x00,0x60,0x01,0x80,0x06,0x00,0x18,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 9, // 0x3F '?' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x00,0x63,0x00,0x03,0x00,0x03,0x00,0x06,0x00,0x0C,0x00,0x18,0x00,0x18,0x00,0x00,0x00,0x18,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 14, // 0x40 '@' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x80,0x18,0x60,0x20,0x10,0x27,0xD0,0x4C,0xC8,0x4C,0xC8,0x4C,0xC8,0x4C,0xC8,0x4C,0xC8,0x27,0xF0,0x20,0x00,0x18,0x00,0x07,0xC0,0x00,0x00, 12, // 0x41 'A' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x06,0x00,0x0F,0x00,0x0F,0x00,0x19,0x80,0x19,0x80,0x30,0xC0,0x3F,0xC0,0x30,0xC0,0x60,0x60,0x60,0x60,0x00,0x00,0x00,0x00,0x00,0x00, 11, // 0x42 'B' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x63,0x00,0x7F,0x00,0x61,0x80,0x60,0xC0,0x60,0xC0,0x61,0x80,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 11, // 0x43 'C' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x80,0x38,0xC0,0x30,0xC0,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x30,0xC0,0x38,0xC0,0x0F,0x80,0x00,0x00,0x00,0x00,0x00,0x00, 12, // 0x44 'D' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x00,0x61,0xC0,0x60,0xC0,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0xC0,0x61,0xC0,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 10, // 0x45 'E' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x80,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x7F,0x80,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00, 10, // 0x46 'F' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x80,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x7F,0x80,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 12, // 0x47 'G' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xC0,0x38,0x60,0x30,0x60,0x60,0x00,0x60,0x00,0x63,0xE0,0x60,0x60,0x60,0x60,0x30,0x60,0x38,0x60,0x0F,0xC0,0x00,0x00,0x00,0x00,0x00,0x00, 12, // 0x48 'H' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x7F,0xE0,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x00,0x00,0x00,0x00,0x00,0x00, 8, // 0x49 'I' 0x00,0x00,0x00,0x00,0x7E,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x7E,0x00,0x00,0x00, 8, // 0x4A 'J' 0x00,0x00,0x00,0x00,0x3E,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x0C,0xF8,0x00,0x00,0x00, 12, // 0x4B 'K' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x60,0x60,0xC0,0x61,0x80,0x63,0x00,0x66,0x00,0x6C,0x00,0x7E,0x00,0x73,0x00,0x61,0x80,0x60,0xC0,0x60,0x60,0x00,0x00,0x00,0x00,0x00,0x00, 10, // 0x4C 'L' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00, 14, // 0x4D 'M' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x38,0x70,0x38,0x70,0x78,0x58,0x58,0x58,0xD8,0x4C,0x98,0x4D,0x98,0x47,0x18,0x47,0x18,0x42,0x18,0x40,0x18,0x00,0x00,0x00,0x00,0x00,0x00, 12, // 0x4E 'N' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x20,0x70,0x20,0x58,0x20,0x4C,0x20,0x4C,0x20,0x46,0x20,0x43,0x20,0x43,0x20,0x41,0xA0,0x40,0xE0,0x40,0xE0,0x00,0x00,0x00,0x00,0x00,0x00, 13, // 0x4F 'O' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x80,0x38,0xE0,0x30,0x60,0x60,0x30,0x60,0x30,0x60,0x30,0x60,0x30,0x60,0x30,0x30,0x60,0x38,0xE0,0x0F,0x80,0x00,0x00,0x00,0x00,0x00,0x00, 11, // 0x50 'P' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x00,0x61,0x80,0x60,0xC0,0x60,0xC0,0x60,0xC0,0x61,0x80,0x7F,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 13, // 0x51 'Q' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x80,0x38,0xE0,0x30,0x60,0x60,0x30,0x60,0x30,0x60,0x30,0x60,0x30,0x60,0x30,0x30,0x60,0x38,0xE0,0x0F,0x80,0x03,0x00,0x03,0x80,0x01,0xF0, 12, // 0x52 'R' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x00,0x61,0x80,0x60,0xC0,0x60,0xC0,0x60,0xC0,0x61,0x80,0x7F,0x00,0x61,0x80,0x60,0xC0,0x60,0x60,0x60,0x30,0x00,0x00,0x00,0x00,0x00,0x00, 11, // 0x53 'S' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x80,0x30,0xC0,0x60,0xC0,0x60,0x00,0x7C,0x00,0x3F,0x80,0x03,0xC0,0x00,0xC0,0x60,0xC0,0x61,0x80,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 10, // 0x54 'T' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x80,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 12, // 0x55 'U' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x30,0xC0,0x1F,0x80,0x00,0x00,0x00,0x00,0x00,0x00, 11, // 0x56 'V' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0xC0,0x60,0xC0,0x60,0xC0,0x31,0x80,0x31,0x80,0x31,0x80,0x1B,0x00,0x1B,0x00,0x1B,0x00,0x0E,0x00,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 16, // 0x57 'W' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x61,0x86,0x61,0x86,0x63,0xC6,0x33,0xCC,0x32,0x4C,0x32,0x4C,0x1E,0x78,0x1C,0x38,0x1C,0x38,0x0C,0x30,0x0C,0x30,0x00,0x00,0x00,0x00,0x00,0x00, 11, // 0x58 'X' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0xC0,0x31,0x80,0x31,0x80,0x1B,0x00,0x0E,0x00,0x0E,0x00,0x0E,0x00,0x1B,0x00,0x31,0x80,0x31,0x80,0x60,0xC0,0x00,0x00,0x00,0x00,0x00,0x00, 11, // 0x59 'Y' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xC0,0x61,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x1E,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 10, // 0x5A 'Z' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x80,0x01,0x80,0x03,0x00,0x06,0x00,0x06,0x00,0x0C,0x00,0x18,0x00,0x18,0x00,0x30,0x00,0x60,0x00,0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00, 8, // 0x5B '[' 0x00,0x00,0x00,0x3E,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x3E, 10, // 0x5C '\' 0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x60,0x00,0x30,0x00,0x30,0x00,0x18,0x00,0x18,0x00,0x0C,0x00,0x0C,0x00,0x06,0x00,0x06,0x00,0x03,0x00,0x03,0x00,0x01,0x80,0x01,0x80,0x00,0x00, 8, // 0x5D ']' 0x00,0x00,0x00,0x7C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x7C, 13, // 0x5E '^' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x0F,0x00,0x19,0x80,0x30,0xC0,0x60,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 11, // 0x5F '_' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xE0,0x00,0x00, 11, // 0x60 '`' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 10, // 0x61 'a' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x00,0x01,0x80,0x01,0x80,0x3F,0x80,0x61,0x80,0x61,0x80,0x63,0x80,0x3D,0x80,0x00,0x00,0x00,0x00,0x00,0x00, 10, // 0x62 'b' 0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x6E,0x00,0x73,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x63,0x00,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 8, // 0x63 'c' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x33,0x60,0x60,0x60,0x60,0x33,0x1E,0x00,0x00,0x00, 10, // 0x64 'd' 0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x1F,0x80,0x31,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x80,0x1D,0x80,0x00,0x00,0x00,0x00,0x00,0x00, 10, // 0x65 'e' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x7F,0x80,0x60,0x00,0x60,0x00,0x31,0x80,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 6, // 0x66 'f' 0x00,0x00,0x00,0x1C,0x30,0x30,0x30,0x7C,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x00,0x00,0x00, 10, // 0x67 'g' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x80,0x31,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x80,0x1D,0x80,0x01,0x80,0x03,0x00,0x3E,0x00, 10, // 0x68 'h' 0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x6F,0x00,0x71,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x00,0x00,0x00,0x00,0x00,0x00, 4, // 0x69 'i' 0x00,0x00,0x00,0x60,0x60,0x00,0x00,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x00,0x00,0x00, 6, // 0x6A 'j' 0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x78,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xF0, 10, // 0x6B 'k' 0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x61,0x80,0x63,0x00,0x66,0x00,0x6C,0x00,0x7E,0x00,0x73,0x00,0x61,0x80,0x60,0xC0,0x00,0x00,0x00,0x00,0x00,0x00, 4, // 0x6C 'l' 0x00,0x00,0x00,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x00,0x00,0x00, 16, // 0x6D 'm' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6F,0x3C,0x71,0xC6,0x61,0x86,0x61,0x86,0x61,0x86,0x61,0x86,0x61,0x86,0x61,0x86,0x00,0x00,0x00,0x00,0x00,0x00, 10, // 0x6E 'n' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6F,0x00,0x71,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x00,0x00,0x00,0x00,0x00,0x00, 10, // 0x6F 'o' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x33,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 10, // 0x70 'p' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6E,0x00,0x73,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x63,0x00,0x7E,0x00,0x60,0x00,0x60,0x00,0x60,0x00, 10, // 0x71 'q' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x80,0x31,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x80,0x1D,0x80,0x01,0x80,0x01,0x80,0x01,0x80, 7, // 0x72 'r' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6E,0x7E,0x60,0x60,0x60,0x60,0x60,0x60,0x00,0x00,0x00, 9, // 0x73 's' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x00,0x61,0x00,0x60,0x00,0x7E,0x00,0x3F,0x00,0x03,0x00,0x43,0x00,0x3E,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 7, // 0x74 't' 0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x7E,0x30,0x30,0x30,0x30,0x30,0x30,0x1E,0x00,0x00,0x00, 10, // 0x75 'u' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x63,0x80,0x3D,0x80,0x00,0x00,0x00,0x00,0x00,0x00, 10, // 0x76 'v' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x33,0x00,0x33,0x00,0x33,0x00,0x1E,0x00,0x1E,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 14, // 0x77 'w' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x63,0x18,0x63,0x18,0x63,0x18,0x37,0xB0,0x34,0xB0,0x3C,0xF0,0x18,0x60,0x18,0x60,0x00,0x00,0x00,0x00,0x00,0x00, 10, // 0x78 'x' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x61,0x80,0x33,0x00,0x33,0x00,0x1E,0x00,0x1E,0x00,0x33,0x00,0x33,0x00,0x61,0x80,0x00,0x00,0x00,0x00,0x00,0x00, 10, // 0x79 'y' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x61,0x80,0x61,0x80,0x33,0x00,0x33,0x00,0x33,0x00,0x1E,0x00,0x1E,0x00,0x0C,0x00,0x0C,0x00,0x18,0x00,0x18,0x00, 9, // 0x7A 'z' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x00,0x03,0x00,0x06,0x00,0x0C,0x00,0x18,0x00,0x30,0x00,0x60,0x00,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 11, // 0x7B '{' 0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x80,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x18,0x00,0x70,0x00,0x18,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x07,0x80, 8, // 0x7C '|' 0x00,0x00,0x00,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, 11, // 0x7D '}' 0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x03,0x00,0x01,0xC0,0x03,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x3C,0x00, 13, // 0x7E '~' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x10,0x24,0x10,0x42,0x10,0x41,0x20,0x40,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 15, // 0x7F '' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xF8,0x20,0x08,0x20,0x08,0x20,0x08,0x20,0x08,0x20,0x08,0x20,0x08,0x20,0x08,0x20,0x08,0x20,0x08,0x3F,0xF8,0x00,0x00,0x00,0x00,0x00,0x00, 0 }; } ����������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/src/agg_gsv_text.cpp������������������������������������������������������������������0000644�0000000�0000000�00000100743�10703246330�017237� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #include <string.h> #include <stdio.h> #include "agg_gsv_text.h" #include "agg_bounding_rect.h" namespace agg { int8u gsv_default_font[] = { 0x40,0x00,0x6c,0x0f,0x15,0x00,0x0e,0x00,0xf9,0xff, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x0d,0x0a,0x0d,0x0a,0x46,0x6f,0x6e,0x74,0x20,0x28, 0x63,0x29,0x20,0x4d,0x69,0x63,0x72,0x6f,0x50,0x72, 0x6f,0x66,0x20,0x32,0x37,0x20,0x53,0x65,0x70,0x74, 0x65,0x6d,0x62,0x2e,0x31,0x39,0x38,0x39,0x00,0x0d, 0x0a,0x0d,0x0a,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x02,0x00,0x12,0x00,0x34,0x00,0x46,0x00,0x94,0x00, 0xd0,0x00,0x2e,0x01,0x3e,0x01,0x64,0x01,0x8a,0x01, 0x98,0x01,0xa2,0x01,0xb4,0x01,0xba,0x01,0xc6,0x01, 0xcc,0x01,0xf0,0x01,0xfa,0x01,0x18,0x02,0x38,0x02, 0x44,0x02,0x68,0x02,0x98,0x02,0xa2,0x02,0xde,0x02, 0x0e,0x03,0x24,0x03,0x40,0x03,0x48,0x03,0x52,0x03, 0x5a,0x03,0x82,0x03,0xec,0x03,0xfa,0x03,0x26,0x04, 0x4c,0x04,0x6a,0x04,0x7c,0x04,0x8a,0x04,0xb6,0x04, 0xc4,0x04,0xca,0x04,0xe0,0x04,0xee,0x04,0xf8,0x04, 0x0a,0x05,0x18,0x05,0x44,0x05,0x5e,0x05,0x8e,0x05, 0xac,0x05,0xd6,0x05,0xe0,0x05,0xf6,0x05,0x00,0x06, 0x12,0x06,0x1c,0x06,0x28,0x06,0x36,0x06,0x48,0x06, 0x4e,0x06,0x60,0x06,0x6e,0x06,0x74,0x06,0x84,0x06, 0xa6,0x06,0xc8,0x06,0xe6,0x06,0x08,0x07,0x2c,0x07, 0x3c,0x07,0x68,0x07,0x7c,0x07,0x8c,0x07,0xa2,0x07, 0xb0,0x07,0xb6,0x07,0xd8,0x07,0xec,0x07,0x10,0x08, 0x32,0x08,0x54,0x08,0x64,0x08,0x88,0x08,0x98,0x08, 0xac,0x08,0xb6,0x08,0xc8,0x08,0xd2,0x08,0xe4,0x08, 0xf2,0x08,0x3e,0x09,0x48,0x09,0x94,0x09,0xc2,0x09, 0xc4,0x09,0xd0,0x09,0xe2,0x09,0x04,0x0a,0x0e,0x0a, 0x26,0x0a,0x34,0x0a,0x4a,0x0a,0x66,0x0a,0x70,0x0a, 0x7e,0x0a,0x8e,0x0a,0x9a,0x0a,0xa6,0x0a,0xb4,0x0a, 0xd8,0x0a,0xe2,0x0a,0xf6,0x0a,0x18,0x0b,0x22,0x0b, 0x32,0x0b,0x56,0x0b,0x60,0x0b,0x6e,0x0b,0x7c,0x0b, 0x8a,0x0b,0x9c,0x0b,0x9e,0x0b,0xb2,0x0b,0xc2,0x0b, 0xd8,0x0b,0xf4,0x0b,0x08,0x0c,0x30,0x0c,0x56,0x0c, 0x72,0x0c,0x90,0x0c,0xb2,0x0c,0xce,0x0c,0xe2,0x0c, 0xfe,0x0c,0x10,0x0d,0x26,0x0d,0x36,0x0d,0x42,0x0d, 0x4e,0x0d,0x5c,0x0d,0x78,0x0d,0x8c,0x0d,0x8e,0x0d, 0x90,0x0d,0x92,0x0d,0x94,0x0d,0x96,0x0d,0x98,0x0d, 0x9a,0x0d,0x9c,0x0d,0x9e,0x0d,0xa0,0x0d,0xa2,0x0d, 0xa4,0x0d,0xa6,0x0d,0xa8,0x0d,0xaa,0x0d,0xac,0x0d, 0xae,0x0d,0xb0,0x0d,0xb2,0x0d,0xb4,0x0d,0xb6,0x0d, 0xb8,0x0d,0xba,0x0d,0xbc,0x0d,0xbe,0x0d,0xc0,0x0d, 0xc2,0x0d,0xc4,0x0d,0xc6,0x0d,0xc8,0x0d,0xca,0x0d, 0xcc,0x0d,0xce,0x0d,0xd0,0x0d,0xd2,0x0d,0xd4,0x0d, 0xd6,0x0d,0xd8,0x0d,0xda,0x0d,0xdc,0x0d,0xde,0x0d, 0xe0,0x0d,0xe2,0x0d,0xe4,0x0d,0xe6,0x0d,0xe8,0x0d, 0xea,0x0d,0xec,0x0d,0x0c,0x0e,0x26,0x0e,0x48,0x0e, 0x64,0x0e,0x88,0x0e,0x92,0x0e,0xa6,0x0e,0xb4,0x0e, 0xd0,0x0e,0xee,0x0e,0x02,0x0f,0x16,0x0f,0x26,0x0f, 0x3c,0x0f,0x58,0x0f,0x6c,0x0f,0x6c,0x0f,0x6c,0x0f, 0x6c,0x0f,0x6c,0x0f,0x6c,0x0f,0x6c,0x0f,0x6c,0x0f, 0x6c,0x0f,0x6c,0x0f,0x6c,0x0f,0x6c,0x0f,0x6c,0x0f, 0x6c,0x0f,0x6c,0x0f,0x6c,0x0f,0x6c,0x0f,0x10,0x80, 0x05,0x95,0x00,0x72,0x00,0xfb,0xff,0x7f,0x01,0x7f, 0x01,0x01,0xff,0x01,0x05,0xfe,0x05,0x95,0xff,0x7f, 0x00,0x7a,0x01,0x86,0xff,0x7a,0x01,0x87,0x01,0x7f, 0xfe,0x7a,0x0a,0x87,0xff,0x7f,0x00,0x7a,0x01,0x86, 0xff,0x7a,0x01,0x87,0x01,0x7f,0xfe,0x7a,0x05,0xf2, 0x0b,0x95,0xf9,0x64,0x0d,0x9c,0xf9,0x64,0xfa,0x91, 0x0e,0x00,0xf1,0xfa,0x0e,0x00,0x04,0xfc,0x08,0x99, 0x00,0x63,0x04,0x9d,0x00,0x63,0x04,0x96,0xff,0x7f, 0x01,0x7f,0x01,0x01,0x00,0x01,0xfe,0x02,0xfd,0x01, 0xfc,0x00,0xfd,0x7f,0xfe,0x7e,0x00,0x7e,0x01,0x7e, 0x01,0x7f,0x02,0x7f,0x06,0x7e,0x02,0x7f,0x02,0x7e, 0xf2,0x89,0x02,0x7e,0x02,0x7f,0x06,0x7e,0x02,0x7f, 0x01,0x7f,0x01,0x7e,0x00,0x7c,0xfe,0x7e,0xfd,0x7f, 0xfc,0x00,0xfd,0x01,0xfe,0x02,0x00,0x01,0x01,0x01, 0x01,0x7f,0xff,0x7f,0x10,0xfd,0x15,0x95,0xee,0x6b, 0x05,0x95,0x02,0x7e,0x00,0x7e,0xff,0x7e,0xfe,0x7f, 0xfe,0x00,0xfe,0x02,0x00,0x02,0x01,0x02,0x02,0x01, 0x02,0x00,0x02,0x7f,0x03,0x7f,0x03,0x00,0x03,0x01, 0x02,0x01,0xfc,0xf2,0xfe,0x7f,0xff,0x7e,0x00,0x7e, 0x02,0x7e,0x02,0x00,0x02,0x01,0x01,0x02,0x00,0x02, 0xfe,0x02,0xfe,0x00,0x07,0xf9,0x15,0x8d,0xff,0x7f, 0x01,0x7f,0x01,0x01,0x00,0x01,0xff,0x01,0xff,0x00, 0xff,0x7f,0xff,0x7e,0xfe,0x7b,0xfe,0x7d,0xfe,0x7e, 0xfe,0x7f,0xfd,0x00,0xfd,0x01,0xff,0x02,0x00,0x03, 0x01,0x02,0x06,0x04,0x02,0x02,0x01,0x02,0x00,0x02, 0xff,0x02,0xfe,0x01,0xfe,0x7f,0xff,0x7e,0x00,0x7e, 0x01,0x7d,0x02,0x7d,0x05,0x79,0x02,0x7e,0x03,0x7f, 0x01,0x00,0x01,0x01,0x00,0x01,0xf1,0xfe,0xfe,0x01, 0xff,0x02,0x00,0x03,0x01,0x02,0x02,0x02,0x00,0x86, 0x01,0x7e,0x08,0x75,0x02,0x7e,0x02,0x7f,0x05,0x80, 0x05,0x93,0xff,0x01,0x01,0x01,0x01,0x7f,0x00,0x7e, 0xff,0x7e,0xff,0x7f,0x06,0xf1,0x0b,0x99,0xfe,0x7e, 0xfe,0x7d,0xfe,0x7c,0xff,0x7b,0x00,0x7c,0x01,0x7b, 0x02,0x7c,0x02,0x7d,0x02,0x7e,0xfe,0x9e,0xfe,0x7c, 0xff,0x7d,0xff,0x7b,0x00,0x7c,0x01,0x7b,0x01,0x7d, 0x02,0x7c,0x05,0x85,0x03,0x99,0x02,0x7e,0x02,0x7d, 0x02,0x7c,0x01,0x7b,0x00,0x7c,0xff,0x7b,0xfe,0x7c, 0xfe,0x7d,0xfe,0x7e,0x02,0x9e,0x02,0x7c,0x01,0x7d, 0x01,0x7b,0x00,0x7c,0xff,0x7b,0xff,0x7d,0xfe,0x7c, 0x09,0x85,0x08,0x95,0x00,0x74,0xfb,0x89,0x0a,0x7a, 0x00,0x86,0xf6,0x7a,0x0d,0xf4,0x0d,0x92,0x00,0x6e, 0xf7,0x89,0x12,0x00,0x04,0xf7,0x06,0x81,0xff,0x7f, 0xff,0x01,0x01,0x01,0x01,0x7f,0x00,0x7e,0xff,0x7e, 0xff,0x7f,0x06,0x84,0x04,0x89,0x12,0x00,0x04,0xf7, 0x05,0x82,0xff,0x7f,0x01,0x7f,0x01,0x01,0xff,0x01, 0x05,0xfe,0x00,0xfd,0x0e,0x18,0x00,0xeb,0x09,0x95, 0xfd,0x7f,0xfe,0x7d,0xff,0x7b,0x00,0x7d,0x01,0x7b, 0x02,0x7d,0x03,0x7f,0x02,0x00,0x03,0x01,0x02,0x03, 0x01,0x05,0x00,0x03,0xff,0x05,0xfe,0x03,0xfd,0x01, 0xfe,0x00,0x0b,0xeb,0x06,0x91,0x02,0x01,0x03,0x03, 0x00,0x6b,0x09,0x80,0x04,0x90,0x00,0x01,0x01,0x02, 0x01,0x01,0x02,0x01,0x04,0x00,0x02,0x7f,0x01,0x7f, 0x01,0x7e,0x00,0x7e,0xff,0x7e,0xfe,0x7d,0xf6,0x76, 0x0e,0x00,0x03,0x80,0x05,0x95,0x0b,0x00,0xfa,0x78, 0x03,0x00,0x02,0x7f,0x01,0x7f,0x01,0x7d,0x00,0x7e, 0xff,0x7d,0xfe,0x7e,0xfd,0x7f,0xfd,0x00,0xfd,0x01, 0xff,0x01,0xff,0x02,0x11,0xfc,0x0d,0x95,0xf6,0x72, 0x0f,0x00,0xfb,0x8e,0x00,0x6b,0x07,0x80,0x0f,0x95, 0xf6,0x00,0xff,0x77,0x01,0x01,0x03,0x01,0x03,0x00, 0x03,0x7f,0x02,0x7e,0x01,0x7d,0x00,0x7e,0xff,0x7d, 0xfe,0x7e,0xfd,0x7f,0xfd,0x00,0xfd,0x01,0xff,0x01, 0xff,0x02,0x11,0xfc,0x10,0x92,0xff,0x02,0xfd,0x01, 0xfe,0x00,0xfd,0x7f,0xfe,0x7d,0xff,0x7b,0x00,0x7b, 0x01,0x7c,0x02,0x7e,0x03,0x7f,0x01,0x00,0x03,0x01, 0x02,0x02,0x01,0x03,0x00,0x01,0xff,0x03,0xfe,0x02, 0xfd,0x01,0xff,0x00,0xfd,0x7f,0xfe,0x7e,0xff,0x7d, 0x10,0xf9,0x11,0x95,0xf6,0x6b,0xfc,0x95,0x0e,0x00, 0x03,0xeb,0x08,0x95,0xfd,0x7f,0xff,0x7e,0x00,0x7e, 0x01,0x7e,0x02,0x7f,0x04,0x7f,0x03,0x7f,0x02,0x7e, 0x01,0x7e,0x00,0x7d,0xff,0x7e,0xff,0x7f,0xfd,0x7f, 0xfc,0x00,0xfd,0x01,0xff,0x01,0xff,0x02,0x00,0x03, 0x01,0x02,0x02,0x02,0x03,0x01,0x04,0x01,0x02,0x01, 0x01,0x02,0x00,0x02,0xff,0x02,0xfd,0x01,0xfc,0x00, 0x0c,0xeb,0x10,0x8e,0xff,0x7d,0xfe,0x7e,0xfd,0x7f, 0xff,0x00,0xfd,0x01,0xfe,0x02,0xff,0x03,0x00,0x01, 0x01,0x03,0x02,0x02,0x03,0x01,0x01,0x00,0x03,0x7f, 0x02,0x7e,0x01,0x7c,0x00,0x7b,0xff,0x7b,0xfe,0x7d, 0xfd,0x7f,0xfe,0x00,0xfd,0x01,0xff,0x02,0x10,0xfd, 0x05,0x8e,0xff,0x7f,0x01,0x7f,0x01,0x01,0xff,0x01, 0x00,0xf4,0xff,0x7f,0x01,0x7f,0x01,0x01,0xff,0x01, 0x05,0xfe,0x05,0x8e,0xff,0x7f,0x01,0x7f,0x01,0x01, 0xff,0x01,0x01,0xf3,0xff,0x7f,0xff,0x01,0x01,0x01, 0x01,0x7f,0x00,0x7e,0xff,0x7e,0xff,0x7f,0x06,0x84, 0x14,0x92,0xf0,0x77,0x10,0x77,0x04,0x80,0x04,0x8c, 0x12,0x00,0xee,0xfa,0x12,0x00,0x04,0xfa,0x04,0x92, 0x10,0x77,0xf0,0x77,0x14,0x80,0x03,0x90,0x00,0x01, 0x01,0x02,0x01,0x01,0x02,0x01,0x04,0x00,0x02,0x7f, 0x01,0x7f,0x01,0x7e,0x00,0x7e,0xff,0x7e,0xff,0x7f, 0xfc,0x7e,0x00,0x7d,0x00,0xfb,0xff,0x7f,0x01,0x7f, 0x01,0x01,0xff,0x01,0x09,0xfe,0x12,0x8d,0xff,0x02, 0xfe,0x01,0xfd,0x00,0xfe,0x7f,0xff,0x7f,0xff,0x7d, 0x00,0x7d,0x01,0x7e,0x02,0x7f,0x03,0x00,0x02,0x01, 0x01,0x02,0xfb,0x88,0xfe,0x7e,0xff,0x7d,0x00,0x7d, 0x01,0x7e,0x01,0x7f,0x07,0x8b,0xff,0x78,0x00,0x7e, 0x02,0x7f,0x02,0x00,0x02,0x02,0x01,0x03,0x00,0x02, 0xff,0x03,0xff,0x02,0xfe,0x02,0xfe,0x01,0xfd,0x01, 0xfd,0x00,0xfd,0x7f,0xfe,0x7f,0xfe,0x7e,0xff,0x7e, 0xff,0x7d,0x00,0x7d,0x01,0x7d,0x01,0x7e,0x02,0x7e, 0x02,0x7f,0x03,0x7f,0x03,0x00,0x03,0x01,0x02,0x01, 0x01,0x01,0xfe,0x8d,0xff,0x78,0x00,0x7e,0x01,0x7f, 0x08,0xfb,0x09,0x95,0xf8,0x6b,0x08,0x95,0x08,0x6b, 0xf3,0x87,0x0a,0x00,0x04,0xf9,0x04,0x95,0x00,0x6b, 0x00,0x95,0x09,0x00,0x03,0x7f,0x01,0x7f,0x01,0x7e, 0x00,0x7e,0xff,0x7e,0xff,0x7f,0xfd,0x7f,0xf7,0x80, 0x09,0x00,0x03,0x7f,0x01,0x7f,0x01,0x7e,0x00,0x7d, 0xff,0x7e,0xff,0x7f,0xfd,0x7f,0xf7,0x00,0x11,0x80, 0x12,0x90,0xff,0x02,0xfe,0x02,0xfe,0x01,0xfc,0x00, 0xfe,0x7f,0xfe,0x7e,0xff,0x7e,0xff,0x7d,0x00,0x7b, 0x01,0x7d,0x01,0x7e,0x02,0x7e,0x02,0x7f,0x04,0x00, 0x02,0x01,0x02,0x02,0x01,0x02,0x03,0xfb,0x04,0x95, 0x00,0x6b,0x00,0x95,0x07,0x00,0x03,0x7f,0x02,0x7e, 0x01,0x7e,0x01,0x7d,0x00,0x7b,0xff,0x7d,0xff,0x7e, 0xfe,0x7e,0xfd,0x7f,0xf9,0x00,0x11,0x80,0x04,0x95, 0x00,0x6b,0x00,0x95,0x0d,0x00,0xf3,0xf6,0x08,0x00, 0xf8,0xf5,0x0d,0x00,0x02,0x80,0x04,0x95,0x00,0x6b, 0x00,0x95,0x0d,0x00,0xf3,0xf6,0x08,0x00,0x06,0xf5, 0x12,0x90,0xff,0x02,0xfe,0x02,0xfe,0x01,0xfc,0x00, 0xfe,0x7f,0xfe,0x7e,0xff,0x7e,0xff,0x7d,0x00,0x7b, 0x01,0x7d,0x01,0x7e,0x02,0x7e,0x02,0x7f,0x04,0x00, 0x02,0x01,0x02,0x02,0x01,0x02,0x00,0x03,0xfb,0x80, 0x05,0x00,0x03,0xf8,0x04,0x95,0x00,0x6b,0x0e,0x95, 0x00,0x6b,0xf2,0x8b,0x0e,0x00,0x04,0xf5,0x04,0x95, 0x00,0x6b,0x04,0x80,0x0c,0x95,0x00,0x70,0xff,0x7d, 0xff,0x7f,0xfe,0x7f,0xfe,0x00,0xfe,0x01,0xff,0x01, 0xff,0x03,0x00,0x02,0x0e,0xf9,0x04,0x95,0x00,0x6b, 0x0e,0x95,0xf2,0x72,0x05,0x85,0x09,0x74,0x03,0x80, 0x04,0x95,0x00,0x6b,0x00,0x80,0x0c,0x00,0x01,0x80, 0x04,0x95,0x00,0x6b,0x00,0x95,0x08,0x6b,0x08,0x95, 0xf8,0x6b,0x08,0x95,0x00,0x6b,0x04,0x80,0x04,0x95, 0x00,0x6b,0x00,0x95,0x0e,0x6b,0x00,0x95,0x00,0x6b, 0x04,0x80,0x09,0x95,0xfe,0x7f,0xfe,0x7e,0xff,0x7e, 0xff,0x7d,0x00,0x7b,0x01,0x7d,0x01,0x7e,0x02,0x7e, 0x02,0x7f,0x04,0x00,0x02,0x01,0x02,0x02,0x01,0x02, 0x01,0x03,0x00,0x05,0xff,0x03,0xff,0x02,0xfe,0x02, 0xfe,0x01,0xfc,0x00,0x0d,0xeb,0x04,0x95,0x00,0x6b, 0x00,0x95,0x09,0x00,0x03,0x7f,0x01,0x7f,0x01,0x7e, 0x00,0x7d,0xff,0x7e,0xff,0x7f,0xfd,0x7f,0xf7,0x00, 0x11,0xf6,0x09,0x95,0xfe,0x7f,0xfe,0x7e,0xff,0x7e, 0xff,0x7d,0x00,0x7b,0x01,0x7d,0x01,0x7e,0x02,0x7e, 0x02,0x7f,0x04,0x00,0x02,0x01,0x02,0x02,0x01,0x02, 0x01,0x03,0x00,0x05,0xff,0x03,0xff,0x02,0xfe,0x02, 0xfe,0x01,0xfc,0x00,0x03,0xef,0x06,0x7a,0x04,0x82, 0x04,0x95,0x00,0x6b,0x00,0x95,0x09,0x00,0x03,0x7f, 0x01,0x7f,0x01,0x7e,0x00,0x7e,0xff,0x7e,0xff,0x7f, 0xfd,0x7f,0xf7,0x00,0x07,0x80,0x07,0x75,0x03,0x80, 0x11,0x92,0xfe,0x02,0xfd,0x01,0xfc,0x00,0xfd,0x7f, 0xfe,0x7e,0x00,0x7e,0x01,0x7e,0x01,0x7f,0x02,0x7f, 0x06,0x7e,0x02,0x7f,0x01,0x7f,0x01,0x7e,0x00,0x7d, 0xfe,0x7e,0xfd,0x7f,0xfc,0x00,0xfd,0x01,0xfe,0x02, 0x11,0xfd,0x08,0x95,0x00,0x6b,0xf9,0x95,0x0e,0x00, 0x01,0xeb,0x04,0x95,0x00,0x71,0x01,0x7d,0x02,0x7e, 0x03,0x7f,0x02,0x00,0x03,0x01,0x02,0x02,0x01,0x03, 0x00,0x0f,0x04,0xeb,0x01,0x95,0x08,0x6b,0x08,0x95, 0xf8,0x6b,0x09,0x80,0x02,0x95,0x05,0x6b,0x05,0x95, 0xfb,0x6b,0x05,0x95,0x05,0x6b,0x05,0x95,0xfb,0x6b, 0x07,0x80,0x03,0x95,0x0e,0x6b,0x00,0x95,0xf2,0x6b, 0x11,0x80,0x01,0x95,0x08,0x76,0x00,0x75,0x08,0x95, 0xf8,0x76,0x09,0xf5,0x11,0x95,0xf2,0x6b,0x00,0x95, 0x0e,0x00,0xf2,0xeb,0x0e,0x00,0x03,0x80,0x03,0x93, 0x00,0x6c,0x01,0x94,0x00,0x6c,0xff,0x94,0x05,0x00, 0xfb,0xec,0x05,0x00,0x02,0x81,0x00,0x95,0x0e,0x68, 0x00,0x83,0x06,0x93,0x00,0x6c,0x01,0x94,0x00,0x6c, 0xfb,0x94,0x05,0x00,0xfb,0xec,0x05,0x00,0x03,0x81, 0x03,0x87,0x08,0x05,0x08,0x7b,0xf0,0x80,0x08,0x04, 0x08,0x7c,0x03,0xf9,0x01,0x80,0x10,0x00,0x01,0x80, 0x06,0x95,0xff,0x7f,0xff,0x7e,0x00,0x7e,0x01,0x7f, 0x01,0x01,0xff,0x01,0x05,0xef,0x0f,0x8e,0x00,0x72, 0x00,0x8b,0xfe,0x02,0xfe,0x01,0xfd,0x00,0xfe,0x7f, 0xfe,0x7e,0xff,0x7d,0x00,0x7e,0x01,0x7d,0x02,0x7e, 0x02,0x7f,0x03,0x00,0x02,0x01,0x02,0x02,0x04,0xfd, 0x04,0x95,0x00,0x6b,0x00,0x8b,0x02,0x02,0x02,0x01, 0x03,0x00,0x02,0x7f,0x02,0x7e,0x01,0x7d,0x00,0x7e, 0xff,0x7d,0xfe,0x7e,0xfe,0x7f,0xfd,0x00,0xfe,0x01, 0xfe,0x02,0x0f,0xfd,0x0f,0x8b,0xfe,0x02,0xfe,0x01, 0xfd,0x00,0xfe,0x7f,0xfe,0x7e,0xff,0x7d,0x00,0x7e, 0x01,0x7d,0x02,0x7e,0x02,0x7f,0x03,0x00,0x02,0x01, 0x02,0x02,0x03,0xfd,0x0f,0x95,0x00,0x6b,0x00,0x8b, 0xfe,0x02,0xfe,0x01,0xfd,0x00,0xfe,0x7f,0xfe,0x7e, 0xff,0x7d,0x00,0x7e,0x01,0x7d,0x02,0x7e,0x02,0x7f, 0x03,0x00,0x02,0x01,0x02,0x02,0x04,0xfd,0x03,0x88, 0x0c,0x00,0x00,0x02,0xff,0x02,0xff,0x01,0xfe,0x01, 0xfd,0x00,0xfe,0x7f,0xfe,0x7e,0xff,0x7d,0x00,0x7e, 0x01,0x7d,0x02,0x7e,0x02,0x7f,0x03,0x00,0x02,0x01, 0x02,0x02,0x03,0xfd,0x0a,0x95,0xfe,0x00,0xfe,0x7f, 0xff,0x7d,0x00,0x6f,0xfd,0x8e,0x07,0x00,0x03,0xf2, 0x0f,0x8e,0x00,0x70,0xff,0x7d,0xff,0x7f,0xfe,0x7f, 0xfd,0x00,0xfe,0x01,0x09,0x91,0xfe,0x02,0xfe,0x01, 0xfd,0x00,0xfe,0x7f,0xfe,0x7e,0xff,0x7d,0x00,0x7e, 0x01,0x7d,0x02,0x7e,0x02,0x7f,0x03,0x00,0x02,0x01, 0x02,0x02,0x04,0xfd,0x04,0x95,0x00,0x6b,0x00,0x8a, 0x03,0x03,0x02,0x01,0x03,0x00,0x02,0x7f,0x01,0x7d, 0x00,0x76,0x04,0x80,0x03,0x95,0x01,0x7f,0x01,0x01, 0xff,0x01,0xff,0x7f,0x01,0xf9,0x00,0x72,0x04,0x80, 0x05,0x95,0x01,0x7f,0x01,0x01,0xff,0x01,0xff,0x7f, 0x01,0xf9,0x00,0x6f,0xff,0x7d,0xfe,0x7f,0xfe,0x00, 0x09,0x87,0x04,0x95,0x00,0x6b,0x0a,0x8e,0xf6,0x76, 0x04,0x84,0x07,0x78,0x02,0x80,0x04,0x95,0x00,0x6b, 0x04,0x80,0x04,0x8e,0x00,0x72,0x00,0x8a,0x03,0x03, 0x02,0x01,0x03,0x00,0x02,0x7f,0x01,0x7d,0x00,0x76, 0x00,0x8a,0x03,0x03,0x02,0x01,0x03,0x00,0x02,0x7f, 0x01,0x7d,0x00,0x76,0x04,0x80,0x04,0x8e,0x00,0x72, 0x00,0x8a,0x03,0x03,0x02,0x01,0x03,0x00,0x02,0x7f, 0x01,0x7d,0x00,0x76,0x04,0x80,0x08,0x8e,0xfe,0x7f, 0xfe,0x7e,0xff,0x7d,0x00,0x7e,0x01,0x7d,0x02,0x7e, 0x02,0x7f,0x03,0x00,0x02,0x01,0x02,0x02,0x01,0x03, 0x00,0x02,0xff,0x03,0xfe,0x02,0xfe,0x01,0xfd,0x00, 0x0b,0xf2,0x04,0x8e,0x00,0x6b,0x00,0x92,0x02,0x02, 0x02,0x01,0x03,0x00,0x02,0x7f,0x02,0x7e,0x01,0x7d, 0x00,0x7e,0xff,0x7d,0xfe,0x7e,0xfe,0x7f,0xfd,0x00, 0xfe,0x01,0xfe,0x02,0x0f,0xfd,0x0f,0x8e,0x00,0x6b, 0x00,0x92,0xfe,0x02,0xfe,0x01,0xfd,0x00,0xfe,0x7f, 0xfe,0x7e,0xff,0x7d,0x00,0x7e,0x01,0x7d,0x02,0x7e, 0x02,0x7f,0x03,0x00,0x02,0x01,0x02,0x02,0x04,0xfd, 0x04,0x8e,0x00,0x72,0x00,0x88,0x01,0x03,0x02,0x02, 0x02,0x01,0x03,0x00,0x01,0xf2,0x0e,0x8b,0xff,0x02, 0xfd,0x01,0xfd,0x00,0xfd,0x7f,0xff,0x7e,0x01,0x7e, 0x02,0x7f,0x05,0x7f,0x02,0x7f,0x01,0x7e,0x00,0x7f, 0xff,0x7e,0xfd,0x7f,0xfd,0x00,0xfd,0x01,0xff,0x02, 0x0e,0xfd,0x05,0x95,0x00,0x6f,0x01,0x7d,0x02,0x7f, 0x02,0x00,0xf8,0x8e,0x07,0x00,0x03,0xf2,0x04,0x8e, 0x00,0x76,0x01,0x7d,0x02,0x7f,0x03,0x00,0x02,0x01, 0x03,0x03,0x00,0x8a,0x00,0x72,0x04,0x80,0x02,0x8e, 0x06,0x72,0x06,0x8e,0xfa,0x72,0x08,0x80,0x03,0x8e, 0x04,0x72,0x04,0x8e,0xfc,0x72,0x04,0x8e,0x04,0x72, 0x04,0x8e,0xfc,0x72,0x07,0x80,0x03,0x8e,0x0b,0x72, 0x00,0x8e,0xf5,0x72,0x0e,0x80,0x02,0x8e,0x06,0x72, 0x06,0x8e,0xfa,0x72,0xfe,0x7c,0xfe,0x7e,0xfe,0x7f, 0xff,0x00,0x0f,0x87,0x0e,0x8e,0xf5,0x72,0x00,0x8e, 0x0b,0x00,0xf5,0xf2,0x0b,0x00,0x03,0x80,0x09,0x99, 0xfe,0x7f,0xff,0x7f,0xff,0x7e,0x00,0x7e,0x01,0x7e, 0x01,0x7f,0x01,0x7e,0x00,0x7e,0xfe,0x7e,0x01,0x8e, 0xff,0x7e,0x00,0x7e,0x01,0x7e,0x01,0x7f,0x01,0x7e, 0x00,0x7e,0xff,0x7e,0xfc,0x7e,0x04,0x7e,0x01,0x7e, 0x00,0x7e,0xff,0x7e,0xff,0x7f,0xff,0x7e,0x00,0x7e, 0x01,0x7e,0xff,0x8e,0x02,0x7e,0x00,0x7e,0xff,0x7e, 0xff,0x7f,0xff,0x7e,0x00,0x7e,0x01,0x7e,0x01,0x7f, 0x02,0x7f,0x05,0x87,0x04,0x95,0x00,0x77,0x00,0xfd, 0x00,0x77,0x04,0x80,0x05,0x99,0x02,0x7f,0x01,0x7f, 0x01,0x7e,0x00,0x7e,0xff,0x7e,0xff,0x7f,0xff,0x7e, 0x00,0x7e,0x02,0x7e,0xff,0x8e,0x01,0x7e,0x00,0x7e, 0xff,0x7e,0xff,0x7f,0xff,0x7e,0x00,0x7e,0x01,0x7e, 0x04,0x7e,0xfc,0x7e,0xff,0x7e,0x00,0x7e,0x01,0x7e, 0x01,0x7f,0x01,0x7e,0x00,0x7e,0xff,0x7e,0x01,0x8e, 0xfe,0x7e,0x00,0x7e,0x01,0x7e,0x01,0x7f,0x01,0x7e, 0x00,0x7e,0xff,0x7e,0xff,0x7f,0xfe,0x7f,0x09,0x87, 0x03,0x86,0x00,0x02,0x01,0x03,0x02,0x01,0x02,0x00, 0x02,0x7f,0x04,0x7d,0x02,0x7f,0x02,0x00,0x02,0x01, 0x01,0x02,0xee,0xfe,0x01,0x02,0x02,0x01,0x02,0x00, 0x02,0x7f,0x04,0x7d,0x02,0x7f,0x02,0x00,0x02,0x01, 0x01,0x03,0x00,0x02,0x03,0xf4,0x10,0x80,0x03,0x80, 0x07,0x15,0x08,0x6b,0xfe,0x85,0xf5,0x00,0x10,0xfb, 0x0d,0x95,0xf6,0x00,0x00,0x6b,0x0a,0x00,0x02,0x02, 0x00,0x08,0xfe,0x02,0xf6,0x00,0x0e,0xf4,0x03,0x80, 0x00,0x15,0x0a,0x00,0x02,0x7e,0x00,0x7e,0x00,0x7d, 0x00,0x7e,0xfe,0x7f,0xf6,0x00,0x0a,0x80,0x02,0x7e, 0x01,0x7e,0x00,0x7d,0xff,0x7d,0xfe,0x7f,0xf6,0x00, 0x10,0x80,0x03,0x80,0x00,0x15,0x0c,0x00,0xff,0x7e, 0x03,0xed,0x03,0xfd,0x00,0x03,0x02,0x00,0x00,0x12, 0x02,0x03,0x0a,0x00,0x00,0x6b,0x02,0x00,0x00,0x7d, 0xfe,0x83,0xf4,0x00,0x11,0x80,0x0f,0x80,0xf4,0x00, 0x00,0x15,0x0c,0x00,0xff,0xf6,0xf5,0x00,0x0f,0xf5, 0x04,0x95,0x07,0x76,0x00,0x0a,0x07,0x80,0xf9,0x76, 0x00,0x75,0xf8,0x80,0x07,0x0c,0x09,0xf4,0xf9,0x0c, 0x09,0xf4,0x03,0x92,0x02,0x03,0x07,0x00,0x03,0x7d, 0x00,0x7b,0xfc,0x7e,0x04,0x7d,0x00,0x7a,0xfd,0x7e, 0xf9,0x00,0xfe,0x02,0x06,0x89,0x02,0x00,0x06,0xf5, 0x03,0x95,0x00,0x6b,0x0c,0x15,0x00,0x6b,0x02,0x80, 0x03,0x95,0x00,0x6b,0x0c,0x15,0x00,0x6b,0xf8,0x96, 0x03,0x00,0x07,0xea,0x03,0x80,0x00,0x15,0x0c,0x80, 0xf7,0x76,0xfd,0x00,0x03,0x80,0x0a,0x75,0x03,0x80, 0x03,0x80,0x07,0x13,0x02,0x02,0x03,0x00,0x00,0x6b, 0x02,0x80,0x03,0x80,0x00,0x15,0x09,0x6b,0x09,0x15, 0x00,0x6b,0x03,0x80,0x03,0x80,0x00,0x15,0x00,0xf6, 0x0d,0x00,0x00,0x8a,0x00,0x6b,0x03,0x80,0x07,0x80, 0xfd,0x00,0xff,0x03,0x00,0x04,0x00,0x07,0x00,0x04, 0x01,0x02,0x03,0x01,0x06,0x00,0x03,0x7f,0x01,0x7e, 0x01,0x7c,0x00,0x79,0xff,0x7c,0xff,0x7d,0xfd,0x00, 0xfa,0x00,0x0e,0x80,0x03,0x80,0x00,0x15,0x0c,0x00, 0x00,0x6b,0x02,0x80,0x03,0x80,0x00,0x15,0x0a,0x00, 0x02,0x7f,0x01,0x7d,0x00,0x7b,0xff,0x7e,0xfe,0x7f, 0xf6,0x00,0x10,0xf7,0x11,0x8f,0xff,0x03,0xff,0x02, 0xfe,0x01,0xfa,0x00,0xfd,0x7f,0xff,0x7e,0x00,0x7c, 0x00,0x79,0x00,0x7b,0x01,0x7e,0x03,0x00,0x06,0x00, 0x02,0x00,0x01,0x03,0x01,0x02,0x03,0xfb,0x03,0x95, 0x0c,0x00,0xfa,0x80,0x00,0x6b,0x09,0x80,0x03,0x95, 0x00,0x77,0x06,0x7a,0x06,0x06,0x00,0x09,0xfa,0xf1, 0xfa,0x7a,0x0e,0x80,0x03,0x87,0x00,0x0b,0x02,0x02, 0x03,0x00,0x02,0x7e,0x01,0x02,0x04,0x00,0x02,0x7e, 0x00,0x75,0xfe,0x7e,0xfc,0x00,0xff,0x01,0xfe,0x7f, 0xfd,0x00,0xfe,0x02,0x07,0x8e,0x00,0x6b,0x09,0x80, 0x03,0x80,0x0e,0x15,0xf2,0x80,0x0e,0x6b,0x03,0x80, 0x03,0x95,0x00,0x6b,0x0e,0x00,0x00,0x7d,0xfe,0x98, 0x00,0x6b,0x05,0x80,0x03,0x95,0x00,0x75,0x02,0x7d, 0x0a,0x00,0x00,0x8e,0x00,0x6b,0x02,0x80,0x03,0x95, 0x00,0x6b,0x10,0x00,0x00,0x15,0xf8,0x80,0x00,0x6b, 0x0a,0x80,0x03,0x95,0x00,0x6b,0x10,0x00,0x00,0x15, 0xf8,0x80,0x00,0x6b,0x0a,0x00,0x00,0x7d,0x02,0x83, 0x10,0x80,0x03,0x95,0x00,0x6b,0x09,0x00,0x03,0x02, 0x00,0x08,0xfd,0x02,0xf7,0x00,0x0e,0x89,0x00,0x6b, 0x03,0x80,0x03,0x95,0x00,0x6b,0x09,0x00,0x03,0x02, 0x00,0x08,0xfd,0x02,0xf7,0x00,0x0e,0xf4,0x03,0x92, 0x02,0x03,0x07,0x00,0x03,0x7d,0x00,0x70,0xfd,0x7e, 0xf9,0x00,0xfe,0x02,0x03,0x89,0x09,0x00,0x02,0xf5, 0x03,0x80,0x00,0x15,0x00,0xf5,0x07,0x00,0x00,0x08, 0x02,0x03,0x06,0x00,0x02,0x7d,0x00,0x70,0xfe,0x7e, 0xfa,0x00,0xfe,0x02,0x00,0x08,0x0c,0xf6,0x0f,0x80, 0x00,0x15,0xf6,0x00,0xfe,0x7d,0x00,0x79,0x02,0x7e, 0x0a,0x00,0xf4,0xf7,0x07,0x09,0x07,0xf7,0x03,0x8c, 0x01,0x02,0x01,0x01,0x05,0x00,0x02,0x7f,0x01,0x7e, 0x00,0x74,0x00,0x86,0xff,0x01,0xfe,0x01,0xfb,0x00, 0xff,0x7f,0xff,0x7f,0x00,0x7c,0x01,0x7e,0x01,0x00, 0x05,0x00,0x02,0x00,0x01,0x02,0x03,0xfe,0x04,0x8e, 0x02,0x01,0x04,0x00,0x02,0x7f,0x01,0x7e,0x00,0x77, 0xff,0x7e,0xfe,0x7f,0xfc,0x00,0xfe,0x01,0xff,0x02, 0x00,0x09,0x01,0x02,0x02,0x02,0x03,0x01,0x02,0x01, 0x01,0x01,0x01,0x02,0x02,0xeb,0x03,0x80,0x00,0x15, 0x03,0x00,0x02,0x7e,0x00,0x7b,0xfe,0x7e,0xfd,0x00, 0x03,0x80,0x04,0x00,0x03,0x7e,0x00,0x78,0xfd,0x7e, 0xf9,0x00,0x0c,0x80,0x03,0x8c,0x02,0x02,0x02,0x01, 0x03,0x00,0x02,0x7f,0x01,0x7d,0xfe,0x7e,0xf9,0x7d, 0xff,0x7e,0x00,0x7d,0x03,0x7f,0x02,0x00,0x03,0x01, 0x02,0x01,0x02,0xfe,0x0d,0x8c,0xff,0x02,0xfe,0x01, 0xfc,0x00,0xfe,0x7f,0xff,0x7e,0x00,0x77,0x01,0x7e, 0x02,0x7f,0x04,0x00,0x02,0x01,0x01,0x02,0x00,0x0f, 0xff,0x02,0xfe,0x01,0xf9,0x00,0x0c,0xeb,0x03,0x88, 0x0a,0x00,0x00,0x02,0x00,0x03,0xfe,0x02,0xfa,0x00, 0xff,0x7e,0xff,0x7d,0x00,0x7b,0x01,0x7c,0x01,0x7f, 0x06,0x00,0x02,0x02,0x03,0xfe,0x03,0x8f,0x06,0x77, 0x06,0x09,0xfa,0x80,0x00,0x71,0xff,0x87,0xfb,0x79, 0x07,0x87,0x05,0x79,0x02,0x80,0x03,0x8d,0x02,0x02, 0x06,0x00,0x02,0x7e,0x00,0x7d,0xfc,0x7d,0x04,0x7e, 0x00,0x7d,0xfe,0x7e,0xfa,0x00,0xfe,0x02,0x04,0x85, 0x02,0x00,0x06,0xf9,0x03,0x8f,0x00,0x73,0x01,0x7e, 0x07,0x00,0x02,0x02,0x00,0x0d,0x00,0xf3,0x01,0x7e, 0x03,0x80,0x03,0x8f,0x00,0x73,0x01,0x7e,0x07,0x00, 0x02,0x02,0x00,0x0d,0x00,0xf3,0x01,0x7e,0xf8,0x90, 0x03,0x00,0x08,0xf0,0x03,0x80,0x00,0x15,0x00,0xf3, 0x02,0x00,0x06,0x07,0xfa,0xf9,0x07,0x78,0x03,0x80, 0x03,0x80,0x04,0x0c,0x02,0x03,0x04,0x00,0x00,0x71, 0x02,0x80,0x03,0x80,0x00,0x0f,0x06,0x77,0x06,0x09, 0x00,0x71,0x02,0x80,0x03,0x80,0x00,0x0f,0x0a,0xf1, 0x00,0x0f,0xf6,0xf8,0x0a,0x00,0x02,0xf9,0x05,0x80, 0xff,0x01,0xff,0x04,0x00,0x05,0x01,0x03,0x01,0x02, 0x06,0x00,0x02,0x7e,0x00,0x7d,0x00,0x7b,0x00,0x7c, 0xfe,0x7f,0xfa,0x00,0x0b,0x80,0x03,0x80,0x00,0x0f, 0x00,0xfb,0x01,0x03,0x01,0x02,0x05,0x00,0x02,0x7e, 0x01,0x7d,0x00,0x76,0x03,0x80,0x10,0x80,0x10,0x80, 0x10,0x80,0x10,0x80,0x10,0x80,0x10,0x80,0x10,0x80, 0x10,0x80,0x10,0x80,0x10,0x80,0x10,0x80,0x10,0x80, 0x10,0x80,0x10,0x80,0x10,0x80,0x10,0x80,0x10,0x80, 0x10,0x80,0x10,0x80,0x10,0x80,0x10,0x80,0x10,0x80, 0x10,0x80,0x10,0x80,0x10,0x80,0x10,0x80,0x10,0x80, 0x10,0x80,0x10,0x80,0x10,0x80,0x10,0x80,0x10,0x80, 0x10,0x80,0x10,0x80,0x10,0x80,0x10,0x80,0x10,0x80, 0x10,0x80,0x10,0x80,0x10,0x80,0x10,0x80,0x10,0x80, 0x10,0x80,0x10,0x80,0x10,0x80,0x10,0x80,0x10,0x80, 0x10,0x80,0x0a,0x8f,0x02,0x7f,0x01,0x7e,0x00,0x76, 0xff,0x7f,0xfe,0x7f,0xfb,0x00,0xff,0x01,0xff,0x01, 0x00,0x0a,0x01,0x02,0x01,0x01,0x05,0x00,0xf9,0x80, 0x00,0x6b,0x0c,0x86,0x0d,0x8a,0xff,0x03,0xfe,0x02, 0xfb,0x00,0xff,0x7e,0xff,0x7d,0x00,0x7b,0x01,0x7c, 0x01,0x7f,0x05,0x00,0x02,0x01,0x01,0x03,0x03,0xfc, 0x03,0x80,0x00,0x0f,0x00,0xfb,0x01,0x03,0x01,0x02, 0x04,0x00,0x01,0x7e,0x01,0x7d,0x00,0x76,0x00,0x8a, 0x01,0x03,0x02,0x02,0x03,0x00,0x02,0x7e,0x01,0x7d, 0x00,0x76,0x03,0x80,0x03,0x8f,0x00,0x74,0x01,0x7e, 0x02,0x7f,0x04,0x00,0x02,0x01,0x01,0x01,0x00,0x8d, 0x00,0x6e,0xff,0x7e,0xfe,0x7f,0xfb,0x00,0xfe,0x01, 0x0c,0x85,0x03,0x8d,0x01,0x02,0x03,0x00,0x02,0x7e, 0x01,0x02,0x03,0x00,0x02,0x7e,0x00,0x74,0xfe,0x7f, 0xfd,0x00,0xff,0x01,0xfe,0x7f,0xfd,0x00,0xff,0x01, 0x00,0x0c,0x06,0x82,0x00,0x6b,0x08,0x86,0x03,0x80, 0x0a,0x0f,0xf6,0x80,0x0a,0x71,0x03,0x80,0x03,0x8f, 0x00,0x73,0x01,0x7e,0x07,0x00,0x02,0x02,0x00,0x0d, 0x00,0xf3,0x01,0x7e,0x00,0x7e,0x03,0x82,0x03,0x8f, 0x00,0x79,0x02,0x7e,0x08,0x00,0x00,0x89,0x00,0x71, 0x02,0x80,0x03,0x8f,0x00,0x73,0x01,0x7e,0x03,0x00, 0x02,0x02,0x00,0x0d,0x00,0xf3,0x01,0x7e,0x03,0x00, 0x02,0x02,0x00,0x0d,0x00,0xf3,0x01,0x7e,0x03,0x80, 0x03,0x8f,0x00,0x73,0x01,0x7e,0x03,0x00,0x02,0x02, 0x00,0x0d,0x00,0xf3,0x01,0x7e,0x03,0x00,0x02,0x02, 0x00,0x0d,0x00,0xf3,0x01,0x7e,0x00,0x7e,0x03,0x82, 0x03,0x8d,0x00,0x02,0x02,0x00,0x00,0x71,0x08,0x00, 0x02,0x02,0x00,0x06,0xfe,0x02,0xf8,0x00,0x0c,0xf6, 0x03,0x8f,0x00,0x71,0x07,0x00,0x02,0x02,0x00,0x06, 0xfe,0x02,0xf9,0x00,0x0c,0x85,0x00,0x71,0x02,0x80, 0x03,0x8f,0x00,0x71,0x07,0x00,0x03,0x02,0x00,0x06, 0xfd,0x02,0xf9,0x00,0x0c,0xf6,0x03,0x8d,0x02,0x02, 0x06,0x00,0x02,0x7e,0x00,0x75,0xfe,0x7e,0xfa,0x00, 0xfe,0x02,0x04,0x85,0x06,0x00,0x02,0xf9,0x03,0x80, 0x00,0x0f,0x00,0xf8,0x04,0x00,0x00,0x06,0x02,0x02, 0x04,0x00,0x02,0x7e,0x00,0x75,0xfe,0x7e,0xfc,0x00, 0xfe,0x02,0x00,0x05,0x0a,0xf9,0x0d,0x80,0x00,0x0f, 0xf7,0x00,0xff,0x7e,0x00,0x7b,0x01,0x7e,0x09,0x00, 0xf6,0xfa,0x04,0x06,0x08,0xfa }; //------------------------------------------------------------------------- gsv_text::gsv_text() : m_x(0.0), m_y(0.0), m_start_x(0.0), m_width(10.0), m_height(0.0), m_space(0.0), m_line_space(0.0), m_text(m_chr), m_text_buf(), m_cur_chr(m_chr), m_font(gsv_default_font), m_loaded_font(), m_status(initial), m_big_endian(false), m_flip(false) { m_chr[0] = m_chr[1] = 0; int t = 1; if(*(char*)&t == 0) m_big_endian = true; } //------------------------------------------------------------------------- void gsv_text::font(const void* font) { m_font = font; if(m_font == 0) m_font = &m_loaded_font[0]; } //------------------------------------------------------------------------- void gsv_text::size(double height, double width) { m_height = height; m_width = width; } //------------------------------------------------------------------------- void gsv_text::space(double space) { m_space = space; } //------------------------------------------------------------------------- void gsv_text::line_space(double line_space) { m_line_space = line_space; } //------------------------------------------------------------------------- void gsv_text::start_point(double x, double y) { m_x = m_start_x = x; m_y = y; //if(m_flip) m_y += m_height; } //------------------------------------------------------------------------- void gsv_text::load_font(const char* file) { m_loaded_font.resize(0); FILE* fd = fopen(file, "rb"); if(fd) { unsigned len; fseek(fd, 0l, SEEK_END); len = ftell(fd); fseek(fd, 0l, SEEK_SET); if(len > 0) { m_loaded_font.resize(len); fread(&m_loaded_font[0], 1, len, fd); m_font = &m_loaded_font[0]; } fclose(fd); } } //------------------------------------------------------------------------- void gsv_text::text(const char* text) { if(text == 0) { m_chr[0] = 0; m_text = m_chr; return; } unsigned new_size = strlen(text) + 1; if(new_size > m_text_buf.size()) { m_text_buf.resize(new_size); } memcpy(&m_text_buf[0], text, new_size); m_text = &m_text_buf[0]; } //------------------------------------------------------------------------- void gsv_text::rewind(unsigned) { 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); m_glyphs = (int8*)(m_indices + 257*2); m_h = m_height / base_height; m_w = (m_width == 0.0) ? m_h : m_width / base_height; if(m_flip) m_h = -m_h; m_cur_chr = m_text; } //------------------------------------------------------------------------- unsigned gsv_text::vertex(double* x, double* y) { unsigned idx; int8 yc, yf; int dx, dy; bool quit = false; while(!quit) { switch(m_status) { case initial: if(m_font == 0) { quit = true; break; } m_status = next_char; case next_char: if(*m_cur_chr == 0) { quit = true; break; } idx = (*m_cur_chr++) & 0xFF; if(idx == '\n') { m_x = m_start_x; m_y -= m_flip ? -m_height - m_line_space : m_height + m_line_space; break; } idx <<= 1; m_bglyph = m_glyphs + value(m_indices + idx); m_eglyph = m_glyphs + value(m_indices + idx + 2); m_status = start_glyph; case start_glyph: *x = m_x; *y = m_y; m_status = glyph; return path_cmd_move_to; case glyph: if(m_bglyph >= m_eglyph) { m_status = next_char; m_x += m_space; break; } dx = int(*m_bglyph++); yf = (yc = *m_bglyph++) & 0x80; yc <<= 1; yc >>= 1; dy = int(yc); m_x += double(dx) * m_w; m_y += double(dy) * m_h; *x = m_x; *y = m_y; return yf ? path_cmd_move_to : path_cmd_line_to; } } return path_cmd_stop; } //------------------------------------------------------------------------- double gsv_text::text_width() { double x1, y1, x2, y2; bounding_rect_single(*this, 0, &x1, &y1, &x2, &y2); return x2 - x1; } } �����������������������������agg-2.5+dfsg1/src/agg_image_filters.cpp�������������������������������������������������������������0000644�0000000�0000000�00000007317�10703246330�020211� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #include "agg_image_filters.h" namespace agg { //-------------------------------------------------------------------- void image_filter_lut::realloc_lut(double radius) { m_radius = radius; m_diameter = uceil(radius) * 2; m_start = -int(m_diameter / 2 - 1); unsigned size = m_diameter << image_subpixel_shift; if(size > m_weight_array.size()) { m_weight_array.resize(size); } } //-------------------------------------------------------------------- // 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 // 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. //-------------------------------------------------------------------- void image_filter_lut::normalize() { unsigned i; int flip = 1; for(i = 0; i < image_subpixel_scale; i++) { for(;;) { int sum = 0; unsigned j; for(j = 0; j < m_diameter; j++) { sum += m_weight_array[j * image_subpixel_scale + i]; } if(sum == image_filter_scale) break; double k = double(image_filter_scale) / double(sum); sum = 0; for(j = 0; j < m_diameter; j++) { sum += m_weight_array[j * image_subpixel_scale + i] = iround(m_weight_array[j * image_subpixel_scale + i] * k); } sum -= image_filter_scale; int inc = (sum > 0) ? -1 : 1; for(j = 0; j < m_diameter && sum; j++) { flip ^= 1; unsigned idx = flip ? m_diameter/2 + j/2 : m_diameter/2 - j/2; int v = m_weight_array[idx * image_subpixel_scale + i]; if(v < image_filter_scale) { m_weight_array[idx * image_subpixel_scale + i] += inc; sum += inc; } } } } unsigned pivot = m_diameter << (image_subpixel_shift - 1); for(i = 0; i < pivot; i++) { m_weight_array[pivot + i] = m_weight_array[pivot - i]; } unsigned end = (diameter() << image_subpixel_shift) - 1; m_weight_array[0] = m_weight_array[end]; } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/src/agg_line_aa_basics.cpp������������������������������������������������������������0000644�0000000�0000000�00000006526�10703246330�020314� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #include <math.h> #include "agg_line_aa_basics.h" namespace agg { //------------------------------------------------------------------------- // The number of the octant is determined as a 3-bit value as follows: // bit 0 = vertical flag // bit 1 = sx < 0 // bit 2 = sy < 0 // // [N] shows the number of the orthogonal quadrant // <M> shows the number of the diagonal quadrant // <1> // [1] | [0] // . (3)011 | 001(1) . // . | . // . | . // . | . // (2)010 .|. 000(0) // <2> ----------.+.----------- <0> // (6)110 . | . 100(4) // . | . // . | . // . | . // (7)111 | 101(5) // [2] | [3] // <3> // 0,1,2,3,4,5,6,7 const int8u line_parameters::s_orthogonal_quadrant[8] = { 0,0,1,1,3,3,2,2 }; const 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, int* x, int* y) { double k = double(l2.len) / double(l1.len); double tx = l2.x2 - (l2.x1 - l1.x1) * k; double ty = l2.y2 - (l2.y1 - l1.y1) * k; //All bisectrices must be on the right of the line //If the next point is on the left (l1 => l2.2) //then the bisectix should be rotated by 180 degrees. if(double(l2.x2 - l2.x1) * double(l2.y1 - l1.y1) < double(l2.y2 - l2.y1) * double(l2.x1 - l1.x1) + 100.0) { tx -= (tx - l2.x1) * 2.0; ty -= (ty - l2.y1) * 2.0; } // Check if the bisectrix is too short double dx = tx - l2.x1; double dy = ty - l2.y1; if((int)sqrt(dx * dx + dy * dy) < line_subpixel_scale) { *x = (l2.x1 + l2.x1 + (l2.y1 - l1.y1) + (l2.y2 - l2.y1)) >> 1; *y = (l2.y1 + l2.y1 - (l2.x1 - l1.x1) - (l2.x2 - l2.x1)) >> 1; return; } *x = iround(tx); *y = iround(ty); } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/src/agg_line_profile_aa.cpp�����������������������������������������������������������0000644�0000000�0000000�00000007474�10703246330�020513� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #include "agg_renderer_outline_aa.h" namespace agg { //--------------------------------------------------------------------- void line_profile_aa::width(double w) { if(w < 0.0) w = 0.0; if(w < m_smoother_width) w += w; else w += m_smoother_width; w *= 0.5; w -= m_smoother_width; double s = m_smoother_width; if(w < 0.0) { s += w; w = 0.0; } set(w, s); } //--------------------------------------------------------------------- line_profile_aa::value_type* line_profile_aa::profile(double w) { m_subpixel_width = uround(w * subpixel_scale); unsigned size = m_subpixel_width + subpixel_scale * 6; if(size > m_profile.size()) { m_profile.resize(size); } return &m_profile[0]; } //--------------------------------------------------------------------- void line_profile_aa::set(double center_width, double smoother_width) { double base_val = 1.0; if(center_width == 0.0) center_width = 1.0 / subpixel_scale; if(smoother_width == 0.0) smoother_width = 1.0 / subpixel_scale; double width = center_width + smoother_width; if(width < m_min_width) { double k = width / m_min_width; base_val *= k; center_width /= k; smoother_width /= k; } value_type* ch = profile(center_width + smoother_width); unsigned subpixel_center_width = unsigned(center_width * subpixel_scale); unsigned subpixel_smoother_width = unsigned(smoother_width * subpixel_scale); value_type* ch_center = ch + subpixel_scale*2; value_type* ch_smoother = ch_center + subpixel_center_width; unsigned i; unsigned val = m_gamma[unsigned(base_val * aa_mask)]; ch = ch_center; for(i = 0; i < subpixel_center_width; i++) { *ch++ = (value_type)val; } for(i = 0; i < subpixel_smoother_width; i++) { *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 - subpixel_scale*2; val = m_gamma[0]; for(i = 0; i < n_smoother; i++) { *ch_smoother++ = (value_type)val; } ch = ch_center; for(i = 0; i < subpixel_scale*2; i++) { *--ch = *ch_center++; } } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/src/agg_rounded_rect.cpp��������������������������������������������������������������0000644�0000000�0000000�00000012475�10703246330�020055� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #include <math.h> #include "agg_rounded_rect.h" 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_rx3(r), m_ry3(r), m_rx4(r), m_ry4(r) { if(x1 > x2) { m_x1 = x2; m_x2 = x1; } if(y1 > y2) { m_y1 = y2; m_y2 = y1; } } //-------------------------------------------------------------------- void rounded_rect::rect(double x1, double y1, double x2, double y2) { m_x1 = x1; m_y1 = y1; m_x2 = x2; m_y2 = y2; if(x1 > x2) { m_x1 = x2; m_x2 = x1; } if(y1 > y2) { m_y1 = y2; m_y2 = y1; } } //-------------------------------------------------------------------- void rounded_rect::radius(double 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; } //-------------------------------------------------------------------- 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; } //-------------------------------------------------------------------- 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_rx3 = rx3; m_ry3 = ry3; m_rx4 = rx4; m_ry4 = ry4; } //-------------------------------------------------------------------- void rounded_rect::normalize_radius() { double dx = fabs(m_y2 - m_y1); double dy = fabs(m_x2 - m_x1); 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; if(k < 1.0) { m_rx1 *= k; m_ry1 *= k; m_rx2 *= k; m_ry2 *= k; m_rx3 *= k; m_ry3 *= k; m_rx4 *= k; m_ry4 *= k; } } //-------------------------------------------------------------------- void rounded_rect::rewind(unsigned) { m_status = 0; } //-------------------------------------------------------------------- unsigned rounded_rect::vertex(double* x, double* y) { unsigned cmd = path_cmd_stop; switch(m_status) { case 0: m_arc.init(m_x1 + m_rx1, m_y1 + m_ry1, m_rx1, m_ry1, pi, pi+pi*0.5); m_arc.rewind(0); m_status++; case 1: cmd = m_arc.vertex(x, y); if(is_stop(cmd)) m_status++; else return cmd; case 2: m_arc.init(m_x2 - m_rx2, m_y1 + m_ry2, m_rx2, m_ry2, pi+pi*0.5, 0.0); m_arc.rewind(0); m_status++; case 3: cmd = m_arc.vertex(x, y); if(is_stop(cmd)) m_status++; else return path_cmd_line_to; case 4: m_arc.init(m_x2 - m_rx3, m_y2 - m_ry3, m_rx3, m_ry3, 0.0, pi*0.5); m_arc.rewind(0); m_status++; case 5: cmd = m_arc.vertex(x, y); if(is_stop(cmd)) m_status++; else return path_cmd_line_to; case 6: m_arc.init(m_x1 + m_rx4, m_y2 - m_ry4, m_rx4, m_ry4, pi*0.5, pi); m_arc.rewind(0); m_status++; case 7: cmd = m_arc.vertex(x, y); if(is_stop(cmd)) m_status++; else return path_cmd_line_to; case 8: cmd = path_cmd_end_poly | path_flags_close | path_flags_ccw; m_status++; break; } return cmd; } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/src/agg_sqrt_tables.cpp���������������������������������������������������������������0000644�0000000�0000000�00000020745�10703246330�017722� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #include "agg_basics.h" namespace agg { int16u g_sqrt_table[1024] = //----------g_sqrt_table { 0, 2048,2896,3547,4096,4579,5017,5418,5793,6144,6476,6792,7094,7384,7663,7932,8192,8444, 8689,8927,9159,9385,9606,9822,10033,10240,10443,10642,10837,11029,11217,11403,11585, 11765,11942,12116,12288,12457,12625,12790,12953,13114,13273,13430,13585,13738,13890, 14040,14189,14336,14482,14626,14768,14910,15050,15188,15326,15462,15597,15731,15864, 15995,16126,16255,16384,16512,16638,16764,16888,17012,17135,17257,17378,17498,17618, 17736,17854,17971,18087,18203,18318,18432,18545,18658,18770,18882,18992,19102,19212, 19321,19429,19537,19644,19750,19856,19961,20066,20170,20274,20377,20480,20582,20684, 20785,20886,20986,21085,21185,21283,21382,21480,21577,21674,21771,21867,21962,22058, 22153,22247,22341,22435,22528,22621,22713,22806,22897,22989,23080,23170,23261,23351, 23440,23530,23619,23707,23796,23884,23971,24059,24146,24232,24319,24405,24491,24576, 24661,24746,24831,24915,24999,25083,25166,25249,25332,25415,25497,25580,25661,25743, 25824,25905,25986,26067,26147,26227,26307,26387,26466,26545,26624,26703,26781,26859, 26937,27015,27092,27170,27247,27324,27400,27477,27553,27629,27705,27780,27856,27931, 28006,28081,28155,28230,28304,28378,28452,28525,28599,28672,28745,28818,28891,28963, 29035,29108,29180,29251,29323,29394,29466,29537,29608,29678,29749,29819,29890,29960, 30030,30099,30169,30238,30308,30377,30446,30515,30583,30652,30720,30788,30856,30924, 30992,31059,31127,31194,31261,31328,31395,31462,31529,31595,31661,31727,31794,31859, 31925,31991,32056,32122,32187,32252,32317,32382,32446,32511,32575,32640,32704,32768, 32832,32896,32959,33023,33086,33150,33213,33276,33339,33402,33465,33527,33590,33652, 33714,33776,33839,33900,33962,34024,34086,34147,34208,34270,34331,34392,34453,34514, 34574,34635,34695,34756,34816,34876,34936,34996,35056,35116,35176,35235,35295,35354, 35413,35472,35531,35590,35649,35708,35767,35825,35884,35942,36001,36059,36117,36175, 36233,36291,36348,36406,36464,36521,36578,36636,36693,36750,36807,36864,36921,36978, 37034,37091,37147,37204,37260,37316,37372,37429,37485,37540,37596,37652,37708,37763, 37819,37874,37929,37985,38040,38095,38150,38205,38260,38315,38369,38424,38478,38533, 38587,38642,38696,38750,38804,38858,38912,38966,39020,39073,39127,39181,39234,39287, 39341,39394,39447,39500,39553,39606,39659,39712,39765,39818,39870,39923,39975,40028, 40080,40132,40185,40237,40289,40341,40393,40445,40497,40548,40600,40652,40703,40755, 40806,40857,40909,40960,41011,41062,41113,41164,41215,41266,41317,41368,41418,41469, 41519,41570,41620,41671,41721,41771,41821,41871,41922,41972,42021,42071,42121,42171, 42221,42270,42320,42369,42419,42468,42518,42567,42616,42665,42714,42763,42813,42861, 42910,42959,43008,43057,43105,43154,43203,43251,43300,43348,43396,43445,43493,43541, 43589,43637,43685,43733,43781,43829,43877,43925,43972,44020,44068,44115,44163,44210, 44258,44305,44352,44400,44447,44494,44541,44588,44635,44682,44729,44776,44823,44869, 44916,44963,45009,45056,45103,45149,45195,45242,45288,45334,45381,45427,45473,45519, 45565,45611,45657,45703,45749,45795,45840,45886,45932,45977,46023,46069,46114,46160, 46205,46250,46296,46341,46386,46431,46477,46522,46567,46612,46657,46702,46746,46791, 46836,46881,46926,46970,47015,47059,47104,47149,47193,47237,47282,47326,47370,47415, 47459,47503,47547,47591,47635,47679,47723,47767,47811,47855,47899,47942,47986,48030, 48074,48117,48161,48204,48248,48291,48335,48378,48421,48465,48508,48551,48594,48637, 48680,48723,48766,48809,48852,48895,48938,48981,49024,49067,49109,49152,49195,49237, 49280,49322,49365,49407,49450,49492,49535,49577,49619,49661,49704,49746,49788,49830, 49872,49914,49956,49998,50040,50082,50124,50166,50207,50249,50291,50332,50374,50416, 50457,50499,50540,50582,50623,50665,50706,50747,50789,50830,50871,50912,50954,50995, 51036,51077,51118,51159,51200,51241,51282,51323,51364,51404,51445,51486,51527,51567, 51608,51649,51689,51730,51770,51811,51851,51892,51932,51972,52013,52053,52093,52134, 52174,52214,52254,52294,52334,52374,52414,52454,52494,52534,52574,52614,52654,52694, 52734,52773,52813,52853,52892,52932,52972,53011,53051,53090,53130,53169,53209,53248, 53287,53327,53366,53405,53445,53484,53523,53562,53601,53640,53679,53719,53758,53797, 53836,53874,53913,53952,53991,54030,54069,54108,54146,54185,54224,54262,54301,54340, 54378,54417,54455,54494,54532,54571,54609,54647,54686,54724,54762,54801,54839,54877, 54915,54954,54992,55030,55068,55106,55144,55182,55220,55258,55296,55334,55372,55410, 55447,55485,55523,55561,55599,55636,55674,55712,55749,55787,55824,55862,55900,55937, 55975,56012,56049,56087,56124,56162,56199,56236,56273,56311,56348,56385,56422,56459, 56497,56534,56571,56608,56645,56682,56719,56756,56793,56830,56867,56903,56940,56977, 57014,57051,57087,57124,57161,57198,57234,57271,57307,57344,57381,57417,57454,57490, 57527,57563,57599,57636,57672,57709,57745,57781,57817,57854,57890,57926,57962,57999, 58035,58071,58107,58143,58179,58215,58251,58287,58323,58359,58395,58431,58467,58503, 58538,58574,58610,58646,58682,58717,58753,58789,58824,58860,58896,58931,58967,59002, 59038,59073,59109,59144,59180,59215,59251,59286,59321,59357,59392,59427,59463,59498, 59533,59568,59603,59639,59674,59709,59744,59779,59814,59849,59884,59919,59954,59989, 60024,60059,60094,60129,60164,60199,60233,60268,60303,60338,60373,60407,60442,60477, 60511,60546,60581,60615,60650,60684,60719,60753,60788,60822,60857,60891,60926,60960, 60995,61029,61063,61098,61132,61166,61201,61235,61269,61303,61338,61372,61406,61440, 61474,61508,61542,61576,61610,61644,61678,61712,61746,61780,61814,61848,61882,61916, 61950,61984,62018,62051,62085,62119,62153,62186,62220,62254,62287,62321,62355,62388, 62422,62456,62489,62523,62556,62590,62623,62657,62690,62724,62757,62790,62824,62857, 62891,62924,62957,62991,63024,63057,63090,63124,63157,63190,63223,63256,63289,63323, 63356,63389,63422,63455,63488,63521,63554,63587,63620,63653,63686,63719,63752,63785, 63817,63850,63883,63916,63949,63982,64014,64047,64080,64113,64145,64178,64211,64243, 64276,64309,64341,64374,64406,64439,64471,64504,64536,64569,64601,64634,64666,64699, 64731,64763,64796,64828,64861,64893,64925,64957,64990,65022,65054,65086,65119,65151, 65183,65215,65247,65279,65312,65344,65376,65408,65440,65472,65504 }; int8 g_elder_bit_table[256] = //---------g_elder_bit_table { 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, 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6, 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6, 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, 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 }; } ���������������������������agg-2.5+dfsg1/src/agg_trans_affine.cpp��������������������������������������������������������������0000644�0000000�0000000�00000014464�10703246330�020037� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #include "agg_trans_affine.h" namespace agg { //------------------------------------------------------------------------ const trans_affine& trans_affine::parl_to_parl(const double* src, const double* dst) { sx = src[2] - src[0]; shy = src[3] - src[1]; shx = src[4] - src[0]; sy = src[5] - src[1]; tx = src[0]; ty = src[1]; invert(); 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 double* parl) { double src[6]; src[0] = x1; src[1] = y1; src[2] = x2; src[3] = y1; src[4] = x2; src[5] = y2; parl_to_parl(src, parl); return *this; } //------------------------------------------------------------------------ const trans_affine& trans_affine::parl_to_rect(const double* parl, double x1, double y1, double x2, double y2) { double dst[6]; dst[0] = x1; dst[1] = y1; dst[2] = x2; dst[3] = y1; dst[4] = x2; dst[5] = y2; parl_to_parl(parl, dst); return *this; } //------------------------------------------------------------------------ const trans_affine& trans_affine::multiply(const trans_affine& m) { double t0 = sx * m.sx + shy * m.shx; double t2 = shx * m.sx + sy * m.shx; double t4 = tx * m.sx + ty * m.shx + m.tx; shy = sx * m.shy + shy * m.sy; sy = shx * m.shy + sy * m.sy; ty = tx * m.shy + ty * m.sy + m.ty; sx = t0; shx = t2; tx = t4; return *this; } //------------------------------------------------------------------------ const trans_affine& trans_affine::invert() { double d = determinant_reciprocal(); double t0 = sy * d; sy = sx * d; shy = -shy * d; shx = -shx * d; double t4 = -tx * t0 - ty * shx; ty = -tx * shy - ty * sy; sx = t0; tx = t4; return *this; } //------------------------------------------------------------------------ const trans_affine& trans_affine::flip_x() { sx = -sx; shy = -shy; tx = -tx; return *this; } //------------------------------------------------------------------------ const trans_affine& trans_affine::flip_y() { shx = -shx; sy = -sy; ty = -ty; return *this; } //------------------------------------------------------------------------ const trans_affine& trans_affine::reset() { sx = sy = 1.0; shy = shx = tx = ty = 0.0; return *this; } //------------------------------------------------------------------------ bool trans_affine::is_identity(double epsilon) const { return is_equal_eps(sx, 1.0, epsilon) && is_equal_eps(shy, 0.0, epsilon) && is_equal_eps(shx, 0.0, epsilon) && is_equal_eps(sy, 1.0, epsilon) && is_equal_eps(tx, 0.0, epsilon) && is_equal_eps(ty, 0.0, epsilon); } //------------------------------------------------------------------------ bool trans_affine::is_valid(double epsilon) const { return fabs(sx) > epsilon && fabs(sy) > epsilon; } //------------------------------------------------------------------------ bool trans_affine::is_equal(const trans_affine& m, double epsilon) const { return is_equal_eps(sx, m.sx, epsilon) && is_equal_eps(shy, m.shy, epsilon) && is_equal_eps(shx, m.shx, epsilon) && is_equal_eps(sy, m.sy, epsilon) && is_equal_eps(tx, m.tx, epsilon) && is_equal_eps(ty, m.ty, epsilon); } //------------------------------------------------------------------------ double trans_affine::rotation() const { double x1 = 0.0; double y1 = 0.0; double x2 = 1.0; double y2 = 0.0; transform(&x1, &y1); transform(&x2, &y2); return atan2(y2-y1, x2-x1); } //------------------------------------------------------------------------ void trans_affine::translation(double* dx, double* dy) const { *dx = tx; *dy = ty; } //------------------------------------------------------------------------ void trans_affine::scaling(double* x, double* y) const { double x1 = 0.0; double y1 = 0.0; double x2 = 1.0; double y2 = 1.0; trans_affine t(*this); t *= trans_affine_rotation(-rotation()); t.transform(&x1, &y1); t.transform(&x2, &y2); *x = x2 - x1; *y = y2 - y1; } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/src/agg_trans_double_path.cpp���������������������������������������������������������0000644�0000000�0000000�00000020453�10703246330�021070� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #include "agg_math.h" #include "agg_trans_double_path.h" namespace agg { //------------------------------------------------------------------------ trans_double_path::trans_double_path() : m_kindex1(0.0), m_kindex2(0.0), m_base_length(0.0), m_base_height(1.0), m_status1(initial), m_status2(initial), m_preserve_x_scale(true) { } //------------------------------------------------------------------------ void trans_double_path::reset() { m_src_vertices1.remove_all(); m_src_vertices2.remove_all(); m_kindex1 = 0.0; m_kindex1 = 0.0; m_status1 = initial; m_status2 = initial; } //------------------------------------------------------------------------ void trans_double_path::move_to1(double x, double y) { if(m_status1 == initial) { m_src_vertices1.modify_last(vertex_dist(x, y)); m_status1 = making_path; } else { line_to1(x, y); } } //------------------------------------------------------------------------ void trans_double_path::line_to1(double x, double y) { if(m_status1 == making_path) { m_src_vertices1.add(vertex_dist(x, y)); } } //------------------------------------------------------------------------ void trans_double_path::move_to2(double x, double y) { if(m_status2 == initial) { m_src_vertices2.modify_last(vertex_dist(x, y)); m_status2 = making_path; } else { line_to2(x, y); } } //------------------------------------------------------------------------ void trans_double_path::line_to2(double x, double y) { if(m_status2 == making_path) { m_src_vertices2.add(vertex_dist(x, y)); } } //------------------------------------------------------------------------ double trans_double_path::finalize_path(vertex_storage& vertices) { unsigned i; double dist; double d; vertices.close(false); if(vertices.size() > 2) { if(vertices[vertices.size() - 2].dist * 10.0 < vertices[vertices.size() - 3].dist) { d = vertices[vertices.size() - 3].dist + vertices[vertices.size() - 2].dist; vertices[vertices.size() - 2] = vertices[vertices.size() - 1]; vertices.remove_last(); vertices[vertices.size() - 2].dist = d; } } dist = 0; for(i = 0; i < vertices.size(); i++) { vertex_dist& v = vertices[i]; d = v.dist; v.dist = dist; dist += d; } return (vertices.size() - 1) / dist; } //------------------------------------------------------------------------ void trans_double_path::finalize_paths() { if(m_status1 == making_path && m_src_vertices1.size() > 1 && m_status2 == making_path && m_src_vertices2.size() > 1) { m_kindex1 = finalize_path(m_src_vertices1); m_kindex2 = finalize_path(m_src_vertices2); m_status1 = ready; m_status2 = ready; } } //------------------------------------------------------------------------ double trans_double_path::total_length1() const { if(m_base_length >= 1e-10) return m_base_length; return (m_status1 == ready) ? m_src_vertices1[m_src_vertices1.size() - 1].dist : 0.0; } //------------------------------------------------------------------------ double trans_double_path::total_length2() const { if(m_base_length >= 1e-10) return m_base_length; 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, double *x, double* y) const { double x1 = 0.0; double y1 = 0.0; double dx = 1.0; double dy = 1.0; double d = 0.0; double dd = 1.0; *x *= kx; if(*x < 0.0) { // Extrapolation on the left //-------------------------- x1 = vertices[0].x; y1 = vertices[0].y; dx = vertices[1].x - x1; dy = vertices[1].y - y1; dd = vertices[1].dist - vertices[0].dist; d = *x; } else if(*x > vertices[vertices.size() - 1].dist) { // Extrapolation on the right //-------------------------- unsigned i = vertices.size() - 2; unsigned j = vertices.size() - 1; x1 = vertices[j].x; y1 = vertices[j].y; dx = x1 - vertices[i].x; dy = y1 - vertices[i].y; dd = vertices[j].dist - vertices[i].dist; d = *x - vertices[j].dist; } else { // Interpolation //-------------------------- unsigned i = 0; unsigned j = vertices.size() - 1; if(m_preserve_x_scale) { unsigned k; for(i = 0; (j - i) > 1; ) { if(*x < vertices[k = (i + j) >> 1].dist) { j = k; } else { i = k; } } d = vertices[i].dist; dd = vertices[j].dist - d; d = *x - d; } else { i = unsigned(*x * kindex); j = i + 1; dd = vertices[j].dist - vertices[i].dist; d = ((*x * kindex) - i) * dd; } x1 = vertices[i].x; y1 = vertices[i].y; dx = vertices[j].x - x1; dy = vertices[j].y - y1; } *x = x1 + dx * d / dd; *y = y1 + dy * d / dd; } //------------------------------------------------------------------------ void trans_double_path::transform(double *x, double *y) const { if(m_status1 == ready && m_status2 == ready) { if(m_base_length > 1e-10) { *x *= m_src_vertices1[m_src_vertices1.size() - 1].dist / m_base_length; } double x1 = *x; double y1 = *y; double x2 = *x; double y2 = *y; double dd = m_src_vertices2[m_src_vertices2.size() - 1].dist / m_src_vertices1[m_src_vertices1.size() - 1].dist; transform1(m_src_vertices1, m_kindex1, 1.0, &x1, &y1); transform1(m_src_vertices2, m_kindex2, dd, &x2, &y2); *x = x1 + *y * (x2 - x1) / m_base_height; *y = y1 + *y * (y2 - y1) / m_base_height; } } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/src/agg_trans_single_path.cpp���������������������������������������������������������0000644�0000000�0000000�00000015420�10703246330�021075� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #include "agg_math.h" #include "agg_vertex_sequence.h" #include "agg_trans_single_path.h" namespace agg { //------------------------------------------------------------------------ trans_single_path::trans_single_path() : m_base_length(0.0), m_kindex(0.0), m_status(initial), m_preserve_x_scale(true) { } //------------------------------------------------------------------------ void trans_single_path::reset() { m_src_vertices.remove_all(); m_kindex = 0.0; m_status = initial; } //------------------------------------------------------------------------ void trans_single_path::move_to(double x, double y) { if(m_status == initial) { m_src_vertices.modify_last(vertex_dist(x, y)); m_status = making_path; } else { line_to(x, y); } } //------------------------------------------------------------------------ void trans_single_path::line_to(double x, double y) { if(m_status == making_path) { m_src_vertices.add(vertex_dist(x, y)); } } //------------------------------------------------------------------------ void trans_single_path::finalize_path() { if(m_status == making_path && m_src_vertices.size() > 1) { unsigned i; double dist; double d; m_src_vertices.close(false); if(m_src_vertices.size() > 2) { 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 + m_src_vertices[m_src_vertices.size() - 2].dist; m_src_vertices[m_src_vertices.size() - 2] = m_src_vertices[m_src_vertices.size() - 1]; m_src_vertices.remove_last(); m_src_vertices[m_src_vertices.size() - 2].dist = d; } } dist = 0.0; for(i = 0; i < m_src_vertices.size(); i++) { vertex_dist& v = m_src_vertices[i]; double d = v.dist; v.dist = dist; dist += d; } m_kindex = (m_src_vertices.size() - 1) / dist; m_status = ready; } } //------------------------------------------------------------------------ double trans_single_path::total_length() const { if(m_base_length >= 1e-10) return m_base_length; return (m_status == ready) ? m_src_vertices[m_src_vertices.size() - 1].dist : 0.0; } //------------------------------------------------------------------------ void trans_single_path::transform(double *x, double *y) const { if(m_status == ready) { if(m_base_length > 1e-10) { *x *= m_src_vertices[m_src_vertices.size() - 1].dist / m_base_length; } double x1 = 0.0; double y1 = 0.0; double dx = 1.0; double dy = 1.0; double d = 0.0; double dd = 1.0; if(*x < 0.0) { // Extrapolation on the left //-------------------------- x1 = m_src_vertices[0].x; y1 = m_src_vertices[0].y; dx = m_src_vertices[1].x - x1; dy = m_src_vertices[1].y - y1; dd = m_src_vertices[1].dist - m_src_vertices[0].dist; d = *x; } else if(*x > m_src_vertices[m_src_vertices.size() - 1].dist) { // Extrapolation on the right //-------------------------- unsigned i = m_src_vertices.size() - 2; unsigned j = m_src_vertices.size() - 1; x1 = m_src_vertices[j].x; y1 = m_src_vertices[j].y; dx = x1 - m_src_vertices[i].x; dy = y1 - m_src_vertices[i].y; dd = m_src_vertices[j].dist - m_src_vertices[i].dist; d = *x - m_src_vertices[j].dist; } else { // Interpolation //-------------------------- unsigned i = 0; unsigned j = m_src_vertices.size() - 1; if(m_preserve_x_scale) { unsigned k; for(i = 0; (j - i) > 1; ) { if(*x < m_src_vertices[k = (i + j) >> 1].dist) { j = k; } else { i = k; } } d = m_src_vertices[i].dist; dd = m_src_vertices[j].dist - d; d = *x - d; } else { i = unsigned(*x * m_kindex); j = i + 1; dd = m_src_vertices[j].dist - m_src_vertices[i].dist; d = ((*x * m_kindex) - i) * dd; } x1 = m_src_vertices[i].x; y1 = m_src_vertices[i].y; dx = m_src_vertices[j].x - x1; dy = m_src_vertices[j].y - y1; } double x2 = x1 + dx * d / dd; double y2 = y1 + dy * d / dd; *x = x2 - *y * dy / dd; *y = y2 + *y * dx / dd; } } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/src/agg_trans_warp_magnifier.cpp������������������������������������������������������0000644�0000000�0000000�00000004741�10703246330�021576� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #include <math.h> #include "agg_trans_warp_magnifier.h" namespace agg { //------------------------------------------------------------------------ void trans_warp_magnifier::transform(double* x, double* y) const { double dx = *x - m_xc; double dy = *y - m_yc; double r = sqrt(dx * dx + dy * dy); if(r < m_radius) { *x = m_xc + dx * m_magn; *y = m_yc + dy * m_magn; return; } double m = (r + m_radius * (m_magn - 1.0)) / r; *x = m_xc + dx * m; *y = m_yc + dy * m; } //------------------------------------------------------------------------ void trans_warp_magnifier::inverse_transform(double* x, double* y) const { // New version by Andrew Skalkin //----------------- double dx = *x - m_xc; double dy = *y - m_yc; double r = sqrt(dx * dx + dy * dy); if(r < m_radius * m_magn) { *x = m_xc + dx / m_magn; *y = m_yc + dy / m_magn; } else { double rnew = r - m_radius * (m_magn - 1.0); *x = m_xc + rnew * dx / r; *y = m_yc + rnew * dy / r; } // Old version //----------------- //trans_warp_magnifier t(*this); //t.magnification(1.0 / m_magn); //t.radius(m_radius * m_magn); //t.transform(x, y); } } �������������������������������agg-2.5+dfsg1/src/agg_vcgen_bspline.cpp�������������������������������������������������������������0000644�0000000�0000000�00000015540�10703246330�020212� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #include "agg_vcgen_bspline.h" namespace agg { //------------------------------------------------------------------------ vcgen_bspline::vcgen_bspline() : m_src_vertices(), m_spline_x(), m_spline_y(), m_interpolation_step(1.0/50.0), m_closed(0), m_status(initial), m_src_vertex(0) { } //------------------------------------------------------------------------ void vcgen_bspline::remove_all() { m_src_vertices.remove_all(); m_closed = 0; m_status = initial; m_src_vertex = 0; } //------------------------------------------------------------------------ void vcgen_bspline::add_vertex(double x, double y, unsigned cmd) { m_status = initial; if(is_move_to(cmd)) { m_src_vertices.modify_last(point_d(x, y)); } else { if(is_vertex(cmd)) { m_src_vertices.add(point_d(x, y)); } else { m_closed = get_close_flag(cmd); } } } //------------------------------------------------------------------------ void vcgen_bspline::rewind(unsigned) { m_cur_abscissa = 0.0; m_max_abscissa = 0.0; m_src_vertex = 0; if(m_status == initial && m_src_vertices.size() > 2) { if(m_closed) { m_spline_x.init(m_src_vertices.size() + 8); m_spline_y.init(m_src_vertices.size() + 8); m_spline_x.add_point(0.0, m_src_vertices.prev(m_src_vertices.size() - 3).x); m_spline_y.add_point(0.0, m_src_vertices.prev(m_src_vertices.size() - 3).y); m_spline_x.add_point(1.0, m_src_vertices[m_src_vertices.size() - 3].x); m_spline_y.add_point(1.0, m_src_vertices[m_src_vertices.size() - 3].y); m_spline_x.add_point(2.0, m_src_vertices[m_src_vertices.size() - 2].x); m_spline_y.add_point(2.0, m_src_vertices[m_src_vertices.size() - 2].y); m_spline_x.add_point(3.0, m_src_vertices[m_src_vertices.size() - 1].x); m_spline_y.add_point(3.0, m_src_vertices[m_src_vertices.size() - 1].y); } else { m_spline_x.init(m_src_vertices.size()); m_spline_y.init(m_src_vertices.size()); } unsigned i; for(i = 0; i < m_src_vertices.size(); i++) { double x = m_closed ? i + 4 : i; m_spline_x.add_point(x, m_src_vertices[i].x); m_spline_y.add_point(x, m_src_vertices[i].y); } m_cur_abscissa = 0.0; m_max_abscissa = m_src_vertices.size() - 1; if(m_closed) { m_cur_abscissa = 4.0; m_max_abscissa += 5.0; m_spline_x.add_point(m_src_vertices.size() + 4, m_src_vertices[0].x); m_spline_y.add_point(m_src_vertices.size() + 4, m_src_vertices[0].y); m_spline_x.add_point(m_src_vertices.size() + 5, m_src_vertices[1].x); m_spline_y.add_point(m_src_vertices.size() + 5, m_src_vertices[1].y); m_spline_x.add_point(m_src_vertices.size() + 6, m_src_vertices[2].x); m_spline_y.add_point(m_src_vertices.size() + 6, m_src_vertices[2].y); m_spline_x.add_point(m_src_vertices.size() + 7, m_src_vertices.next(2).x); m_spline_y.add_point(m_src_vertices.size() + 7, m_src_vertices.next(2).y); } m_spline_x.prepare(); m_spline_y.prepare(); } m_status = ready; } //------------------------------------------------------------------------ unsigned vcgen_bspline::vertex(double* x, double* y) { unsigned cmd = path_cmd_line_to; while(!is_stop(cmd)) { switch(m_status) { case initial: rewind(0); case ready: if(m_src_vertices.size() < 2) { cmd = path_cmd_stop; break; } if(m_src_vertices.size() == 2) { *x = m_src_vertices[m_src_vertex].x; *y = m_src_vertices[m_src_vertex].y; m_src_vertex++; if(m_src_vertex == 1) return path_cmd_move_to; if(m_src_vertex == 2) return path_cmd_line_to; cmd = path_cmd_stop; break; } cmd = path_cmd_move_to; m_status = polygon; m_src_vertex = 0; case polygon: if(m_cur_abscissa >= m_max_abscissa) { if(m_closed) { m_status = end_poly; break; } else { *x = m_src_vertices[m_src_vertices.size() - 1].x; *y = m_src_vertices[m_src_vertices.size() - 1].y; m_status = end_poly; return path_cmd_line_to; } } *x = m_spline_x.get_stateful(m_cur_abscissa); *y = m_spline_y.get_stateful(m_cur_abscissa); m_src_vertex++; m_cur_abscissa += m_interpolation_step; return (m_src_vertex == 1) ? path_cmd_move_to : path_cmd_line_to; case end_poly: m_status = stop; return path_cmd_end_poly | m_closed; case stop: return path_cmd_stop; } } return cmd; } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/src/agg_vcgen_contour.cpp�������������������������������������������������������������0000644�0000000�0000000�00000012376�10703246330�020253� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #include <math.h> #include "agg_vcgen_contour.h" namespace agg { //------------------------------------------------------------------------ vcgen_contour::vcgen_contour() : m_stroker(), m_width(1), m_src_vertices(), m_out_vertices(), m_status(initial), m_src_vertex(0), m_closed(0), m_orientation(0), m_auto_detect(false) { } //------------------------------------------------------------------------ void vcgen_contour::remove_all() { m_src_vertices.remove_all(); m_closed = 0; m_orientation = 0; m_status = initial; } //------------------------------------------------------------------------ void vcgen_contour::add_vertex(double x, double y, unsigned cmd) { m_status = initial; if(is_move_to(cmd)) { m_src_vertices.modify_last(vertex_dist(x, y)); } else { if(is_vertex(cmd)) { m_src_vertices.add(vertex_dist(x, y)); } else { if(is_end_poly(cmd)) { m_closed = get_close_flag(cmd); if(m_orientation == path_flags_none) { m_orientation = get_orientation(cmd); } } } } } //------------------------------------------------------------------------ void vcgen_contour::rewind(unsigned) { if(m_status == initial) { m_src_vertices.close(true); if(m_auto_detect) { if(!is_oriented(m_orientation)) { m_orientation = (calc_polygon_area(m_src_vertices) > 0.0) ? path_flags_ccw : path_flags_cw; } } if(is_oriented(m_orientation)) { m_stroker.width(is_ccw(m_orientation) ? m_width : -m_width); } } m_status = ready; m_src_vertex = 0; } //------------------------------------------------------------------------ unsigned vcgen_contour::vertex(double* x, double* y) { unsigned cmd = path_cmd_line_to; while(!is_stop(cmd)) { switch(m_status) { case initial: rewind(0); case ready: if(m_src_vertices.size() < 2 + unsigned(m_closed != 0)) { cmd = path_cmd_stop; break; } m_status = outline; cmd = path_cmd_move_to; m_src_vertex = 0; m_out_vertex = 0; case outline: if(m_src_vertex >= m_src_vertices.size()) { m_status = end_poly; break; } m_stroker.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_src_vertex; m_status = out_vertices; m_out_vertex = 0; case out_vertices: if(m_out_vertex >= m_out_vertices.size()) { m_status = outline; } else { const point_d& c = m_out_vertices[m_out_vertex++]; *x = c.x; *y = c.y; return cmd; } break; case end_poly: if(!m_closed) return path_cmd_stop; m_status = stop; return path_cmd_end_poly | path_flags_close | path_flags_ccw; case stop: return path_cmd_stop; } } return cmd; } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/src/agg_vcgen_dash.cpp����������������������������������������������������������������0000644�0000000�0000000�00000016235�10703246330�017477� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #include <math.h> #include "agg_vcgen_dash.h" #include "agg_shorten_path.h" namespace agg { //------------------------------------------------------------------------ vcgen_dash::vcgen_dash() : m_total_dash_len(0.0), m_num_dashes(0), m_dash_start(0.0), m_shorten(0.0), m_curr_dash_start(0.0), m_curr_dash(0), m_src_vertices(), m_closed(0), m_status(initial), m_src_vertex(0) { } //------------------------------------------------------------------------ void vcgen_dash::remove_all_dashes() { m_total_dash_len = 0.0; m_num_dashes = 0; m_curr_dash_start = 0.0; m_curr_dash = 0; } //------------------------------------------------------------------------ void vcgen_dash::add_dash(double dash_len, double gap_len) { if(m_num_dashes < max_dashes) { m_total_dash_len += dash_len + gap_len; m_dashes[m_num_dashes++] = dash_len; m_dashes[m_num_dashes++] = gap_len; } } //------------------------------------------------------------------------ void vcgen_dash::dash_start(double ds) { m_dash_start = ds; calc_dash_start(fabs(ds)); } //------------------------------------------------------------------------ void vcgen_dash::calc_dash_start(double ds) { m_curr_dash = 0; m_curr_dash_start = 0.0; while(ds > 0.0) { if(ds > m_dashes[m_curr_dash]) { ds -= m_dashes[m_curr_dash]; ++m_curr_dash; m_curr_dash_start = 0.0; if(m_curr_dash >= m_num_dashes) m_curr_dash = 0; } else { m_curr_dash_start = ds; ds = 0.0; } } } //------------------------------------------------------------------------ void vcgen_dash::remove_all() { m_status = initial; m_src_vertices.remove_all(); m_closed = 0; } //------------------------------------------------------------------------ void vcgen_dash::add_vertex(double x, double y, unsigned cmd) { m_status = initial; if(is_move_to(cmd)) { m_src_vertices.modify_last(vertex_dist(x, y)); } else { if(is_vertex(cmd)) { m_src_vertices.add(vertex_dist(x, y)); } else { m_closed = get_close_flag(cmd); } } } //------------------------------------------------------------------------ void vcgen_dash::rewind(unsigned) { if(m_status == initial) { m_src_vertices.close(m_closed != 0); shorten_path(m_src_vertices, m_shorten, m_closed); } m_status = ready; m_src_vertex = 0; } //------------------------------------------------------------------------ unsigned vcgen_dash::vertex(double* x, double* y) { unsigned cmd = path_cmd_move_to; while(!is_stop(cmd)) { switch(m_status) { case initial: rewind(0); case ready: if(m_num_dashes < 2 || m_src_vertices.size() < 2) { cmd = path_cmd_stop; break; } m_status = polyline; m_src_vertex = 1; m_v1 = &m_src_vertices[0]; m_v2 = &m_src_vertices[1]; m_curr_rest = m_v1->dist; *x = m_v1->x; *y = m_v1->y; if(m_dash_start >= 0.0) calc_dash_start(m_dash_start); return path_cmd_move_to; case polyline: { double dash_rest = m_dashes[m_curr_dash] - m_curr_dash_start; unsigned cmd = (m_curr_dash & 1) ? path_cmd_move_to : path_cmd_line_to; if(m_curr_rest > dash_rest) { m_curr_rest -= dash_rest; ++m_curr_dash; if(m_curr_dash >= m_num_dashes) m_curr_dash = 0; m_curr_dash_start = 0.0; *x = m_v2->x - (m_v2->x - m_v1->x) * m_curr_rest / m_v1->dist; *y = m_v2->y - (m_v2->y - m_v1->y) * m_curr_rest / m_v1->dist; } else { m_curr_dash_start += m_curr_rest; *x = m_v2->x; *y = m_v2->y; ++m_src_vertex; m_v1 = m_v2; m_curr_rest = m_v1->dist; if(m_closed) { if(m_src_vertex > m_src_vertices.size()) { m_status = stop; } else { m_v2 = &m_src_vertices [ (m_src_vertex >= m_src_vertices.size()) ? 0 : m_src_vertex ]; } } else { if(m_src_vertex >= m_src_vertices.size()) { m_status = stop; } else { m_v2 = &m_src_vertices[m_src_vertex]; } } } return cmd; } break; case stop: cmd = path_cmd_stop; break; } } return path_cmd_stop; } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/src/agg_vcgen_markers_term.cpp��������������������������������������������������������0000644�0000000�0000000�00000006703�10703246330�021252� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #include "agg_vcgen_markers_term.h" namespace agg { //------------------------------------------------------------------------ void vcgen_markers_term::remove_all() { m_markers.remove_all(); } //------------------------------------------------------------------------ void vcgen_markers_term::add_vertex(double x, double y, unsigned cmd) { if(is_move_to(cmd)) { if(m_markers.size() & 1) { // Initial state, the first coordinate was added. // If two of more calls of start_vertex() occures // we just modify the last one. m_markers.modify_last(coord_type(x, y)); } else { m_markers.add(coord_type(x, y)); } } else { if(is_vertex(cmd)) { if(m_markers.size() & 1) { // Initial state, the first coordinate was added. // Add three more points, 0,1,1,0 m_markers.add(coord_type(x, y)); m_markers.add(m_markers[m_markers.size() - 1]); m_markers.add(m_markers[m_markers.size() - 3]); } else { if(m_markers.size()) { // Replace two last points: 0,1,1,0 -> 0,1,2,1 m_markers[m_markers.size() - 1] = m_markers[m_markers.size() - 2]; m_markers[m_markers.size() - 2] = coord_type(x, y); } } } } } //------------------------------------------------------------------------ void vcgen_markers_term::rewind(unsigned path_id) { m_curr_id = path_id * 2; m_curr_idx = m_curr_id; } //------------------------------------------------------------------------ unsigned vcgen_markers_term::vertex(double* x, double* y) { if(m_curr_id > 2 || m_curr_idx >= m_markers.size()) { return path_cmd_stop; } const coord_type& c = m_markers[m_curr_idx]; *x = c.x; *y = c.y; if(m_curr_idx & 1) { m_curr_idx += 3; return path_cmd_line_to; } ++m_curr_idx; return path_cmd_move_to; } } �������������������������������������������������������������agg-2.5+dfsg1/src/agg_vcgen_smooth_poly1.cpp��������������������������������������������������������0000644�0000000�0000000�00000016127�10703246330�021215� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #include "agg_vcgen_smooth_poly1.h" namespace agg { //------------------------------------------------------------------------ vcgen_smooth_poly1::vcgen_smooth_poly1() : m_src_vertices(), m_smooth_value(0.5), m_closed(0), m_status(initial), m_src_vertex(0) { } //------------------------------------------------------------------------ void vcgen_smooth_poly1::remove_all() { m_src_vertices.remove_all(); m_closed = 0; m_status = initial; } //------------------------------------------------------------------------ void vcgen_smooth_poly1::add_vertex(double x, double y, unsigned cmd) { m_status = initial; if(is_move_to(cmd)) { m_src_vertices.modify_last(vertex_dist(x, y)); } else { if(is_vertex(cmd)) { m_src_vertices.add(vertex_dist(x, y)); } else { m_closed = get_close_flag(cmd); } } } //------------------------------------------------------------------------ void vcgen_smooth_poly1::rewind(unsigned) { if(m_status == initial) { m_src_vertices.close(m_closed != 0); } m_status = ready; m_src_vertex = 0; } //------------------------------------------------------------------------ void vcgen_smooth_poly1::calculate(const vertex_dist& v0, const vertex_dist& v1, const vertex_dist& v2, const vertex_dist& v3) { double k1 = v0.dist / (v0.dist + v1.dist); double k2 = v1.dist / (v1.dist + v2.dist); double xm1 = v0.x + (v2.x - v0.x) * k1; double ym1 = v0.y + (v2.y - v0.y) * k1; double xm2 = v1.x + (v3.x - v1.x) * k2; double ym2 = v1.y + (v3.y - v1.y) * k2; m_ctrl1_x = v1.x + m_smooth_value * (v2.x - xm1); m_ctrl1_y = v1.y + m_smooth_value * (v2.y - ym1); m_ctrl2_x = v2.x + m_smooth_value * (v1.x - xm2); m_ctrl2_y = v2.y + m_smooth_value * (v1.y - ym2); } //------------------------------------------------------------------------ unsigned vcgen_smooth_poly1::vertex(double* x, double* y) { unsigned cmd = path_cmd_line_to; while(!is_stop(cmd)) { switch(m_status) { case initial: rewind(0); case ready: if(m_src_vertices.size() < 2) { cmd = path_cmd_stop; break; } if(m_src_vertices.size() == 2) { *x = m_src_vertices[m_src_vertex].x; *y = m_src_vertices[m_src_vertex].y; m_src_vertex++; if(m_src_vertex == 1) return path_cmd_move_to; if(m_src_vertex == 2) return path_cmd_line_to; cmd = path_cmd_stop; break; } cmd = path_cmd_move_to; m_status = polygon; m_src_vertex = 0; case polygon: if(m_closed) { if(m_src_vertex >= m_src_vertices.size()) { *x = m_src_vertices[0].x; *y = m_src_vertices[0].y; m_status = end_poly; return path_cmd_curve4; } } else { if(m_src_vertex >= m_src_vertices.size() - 1) { *x = m_src_vertices[m_src_vertices.size() - 1].x; *y = m_src_vertices[m_src_vertices.size() - 1].y; m_status = end_poly; return path_cmd_curve3; } } 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)); *x = m_src_vertices[m_src_vertex].x; *y = m_src_vertices[m_src_vertex].y; m_src_vertex++; if(m_closed) { m_status = ctrl1; return ((m_src_vertex == 1) ? path_cmd_move_to : path_cmd_curve4); } else { if(m_src_vertex == 1) { m_status = ctrl_b; return path_cmd_move_to; } if(m_src_vertex >= m_src_vertices.size() - 1) { m_status = ctrl_e; return path_cmd_curve3; } m_status = ctrl1; return path_cmd_curve4; } break; case ctrl_b: *x = m_ctrl2_x; *y = m_ctrl2_y; m_status = polygon; return path_cmd_curve3; case ctrl_e: *x = m_ctrl1_x; *y = m_ctrl1_y; m_status = polygon; return path_cmd_curve3; case ctrl1: *x = m_ctrl1_x; *y = m_ctrl1_y; m_status = ctrl2; return path_cmd_curve4; case ctrl2: *x = m_ctrl2_x; *y = m_ctrl2_y; m_status = polygon; return path_cmd_curve4; case end_poly: m_status = stop; return path_cmd_end_poly | m_closed; case stop: return path_cmd_stop; } } return cmd; } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/src/agg_vcgen_stroke.cpp��������������������������������������������������������������0000644�0000000�0000000�00000016061�10703246330�020064� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #include <math.h> #include "agg_vcgen_stroke.h" #include "agg_shorten_path.h" namespace agg { //------------------------------------------------------------------------ vcgen_stroke::vcgen_stroke() : m_stroker(), m_src_vertices(), m_out_vertices(), m_shorten(0.0), m_closed(0), m_status(initial), m_src_vertex(0), m_out_vertex(0) { } //------------------------------------------------------------------------ void vcgen_stroke::remove_all() { m_src_vertices.remove_all(); m_closed = 0; m_status = initial; } //------------------------------------------------------------------------ void vcgen_stroke::add_vertex(double x, double y, unsigned cmd) { m_status = initial; if(is_move_to(cmd)) { m_src_vertices.modify_last(vertex_dist(x, y)); } else { if(is_vertex(cmd)) { m_src_vertices.add(vertex_dist(x, y)); } else { m_closed = get_close_flag(cmd); } } } //------------------------------------------------------------------------ void vcgen_stroke::rewind(unsigned) { if(m_status == initial) { m_src_vertices.close(m_closed != 0); shorten_path(m_src_vertices, m_shorten, m_closed); if(m_src_vertices.size() < 3) m_closed = 0; } m_status = ready; m_src_vertex = 0; m_out_vertex = 0; } //------------------------------------------------------------------------ unsigned vcgen_stroke::vertex(double* x, double* y) { unsigned cmd = path_cmd_line_to; while(!is_stop(cmd)) { switch(m_status) { case initial: rewind(0); case ready: if(m_src_vertices.size() < 2 + unsigned(m_closed != 0)) { cmd = path_cmd_stop; break; } m_status = m_closed ? outline1 : cap1; cmd = path_cmd_move_to; m_src_vertex = 0; m_out_vertex = 0; break; case cap1: m_stroker.calc_cap(m_out_vertices, m_src_vertices[0], m_src_vertices[1], m_src_vertices[0].dist); m_src_vertex = 1; m_prev_status = outline1; m_status = out_vertices; m_out_vertex = 0; break; case cap2: m_stroker.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() - 2].dist); m_prev_status = outline2; m_status = out_vertices; m_out_vertex = 0; break; case outline1: if(m_closed) { if(m_src_vertex >= m_src_vertices.size()) { m_prev_status = close_first; m_status = end_poly1; break; } } else { if(m_src_vertex >= m_src_vertices.size() - 1) { m_status = cap2; break; } } m_stroker.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_src_vertex; m_prev_status = m_status; m_status = out_vertices; m_out_vertex = 0; break; case close_first: m_status = outline2; cmd = path_cmd_move_to; case outline2: if(m_src_vertex <= unsigned(m_closed == 0)) { m_status = end_poly2; m_prev_status = stop; break; } --m_src_vertex; m_stroker.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.prev(m_src_vertex).dist); m_prev_status = m_status; m_status = out_vertices; m_out_vertex = 0; break; case out_vertices: if(m_out_vertex >= m_out_vertices.size()) { m_status = m_prev_status; } else { const point_d& c = m_out_vertices[m_out_vertex++]; *x = c.x; *y = c.y; return cmd; } break; case end_poly1: m_status = m_prev_status; return path_cmd_end_poly | path_flags_close | path_flags_ccw; case end_poly2: m_status = m_prev_status; return path_cmd_end_poly | path_flags_close | path_flags_cw; case stop: cmd = path_cmd_stop; break; } } return cmd; } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/src/agg_vpgen_clip_polygon.cpp��������������������������������������������������������0000644�0000000�0000000�00000010013�10703246330�021257� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #include "agg_vpgen_clip_polygon.h" #include "agg_clip_liang_barsky.h" namespace agg { //------------------------------------------------------------------------ // Determine the clipping code of the vertex according to the // Cyrus-Beck line clipping algorithm // // | | // 0110 | 0010 | 0011 // | | // -------+--------+-------- clip_box.y2 // | | // 0100 | 0000 | 0001 // | | // -------+--------+-------- clip_box.y1 // | | // 1100 | 1000 | 1001 // | | // clip_box.x1 clip_box.x2 // // unsigned vpgen_clip_polygon::clipping_flags(double x, double y) { 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(y > m_clip_box.y2) return 3; if(y < m_clip_box.y1) return 9; return 1; } if(y > m_clip_box.y2) return 2; if(y < m_clip_box.y1) return 8; return 0; } //---------------------------------------------------------------------------- void vpgen_clip_polygon::reset() { m_vertex = 0; m_num_vertices = 0; } //---------------------------------------------------------------------------- void vpgen_clip_polygon::move_to(double x, double y) { m_vertex = 0; m_num_vertices = 0; m_clip_flags = clipping_flags(x, y); if(m_clip_flags == 0) { m_x[0] = x; m_y[0] = y; m_num_vertices = 1; } m_x1 = x; m_y1 = y; m_cmd = path_cmd_move_to; } //---------------------------------------------------------------------------- void vpgen_clip_polygon::line_to(double x, double y) { m_vertex = 0; m_num_vertices = 0; unsigned flags = clipping_flags(x, y); if(m_clip_flags == flags) { if(flags == 0) { m_x[0] = x; m_y[0] = y; m_num_vertices = 1; } } else { m_num_vertices = clip_liang_barsky(m_x1, m_y1, x, y, m_clip_box, m_x, m_y); } m_clip_flags = flags; m_x1 = x; m_y1 = y; } //---------------------------------------------------------------------------- unsigned vpgen_clip_polygon::vertex(double* x, double* y) { if(m_vertex < m_num_vertices) { *x = m_x[m_vertex]; *y = m_y[m_vertex]; ++m_vertex; unsigned cmd = m_cmd; m_cmd = path_cmd_line_to; return cmd; } return path_cmd_stop; } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/src/agg_vpgen_clip_polyline.cpp�������������������������������������������������������0000644�0000000�0000000�00000005373�10703246330�021440� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #include "agg_vpgen_clip_polyline.h" #include "agg_clip_liang_barsky.h" namespace agg { //---------------------------------------------------------------------------- void vpgen_clip_polyline::reset() { m_vertex = 0; m_num_vertices = 0; m_move_to = false; } //---------------------------------------------------------------------------- void vpgen_clip_polyline::move_to(double x, double y) { m_vertex = 0; m_num_vertices = 0; m_x1 = x; m_y1 = y; m_move_to = true; } //---------------------------------------------------------------------------- void vpgen_clip_polyline::line_to(double x, double y) { double x2 = x; double y2 = y; unsigned flags = clip_line_segment(&m_x1, &m_y1, &x2, &y2, m_clip_box); m_vertex = 0; m_num_vertices = 0; if((flags & 4) == 0) { if((flags & 1) != 0 || m_move_to) { m_x[0] = m_x1; m_y[0] = m_y1; m_cmd[0] = path_cmd_move_to; m_num_vertices = 1; } m_x[m_num_vertices] = x2; m_y[m_num_vertices] = y2; m_cmd[m_num_vertices++] = path_cmd_line_to; m_move_to = (flags & 2) != 0; } m_x1 = x; m_y1 = y; } //---------------------------------------------------------------------------- unsigned vpgen_clip_polyline::vertex(double* x, double* y) { if(m_vertex < m_num_vertices) { *x = m_x[m_vertex]; *y = m_y[m_vertex]; return m_cmd[m_vertex++]; } return path_cmd_stop; } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/src/agg_vpgen_segmentator.cpp���������������������������������������������������������0000644�0000000�0000000�00000004405�10703246330�021121� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #include <math.h> #include "agg_vpgen_segmentator.h" namespace agg { void vpgen_segmentator::move_to(double x, double y) { m_x1 = x; m_y1 = y; m_dx = 0.0; m_dy = 0.0; m_dl = 2.0; m_ddl = 2.0; m_cmd = path_cmd_move_to; } void vpgen_segmentator::line_to(double x, double y) { m_x1 += m_dx; m_y1 += m_dy; m_dx = x - m_x1; m_dy = y - m_y1; double len = sqrt(m_dx * m_dx + m_dy * m_dy) * m_approximation_scale; if(len < 1e-30) len = 1e-30; m_ddl = 1.0 / len; m_dl = (m_cmd == path_cmd_move_to) ? 0.0 : m_ddl; if(m_cmd == path_cmd_stop) m_cmd = path_cmd_line_to; } unsigned vpgen_segmentator::vertex(double* x, double* y) { if(m_cmd == path_cmd_stop) return path_cmd_stop; unsigned cmd = m_cmd; m_cmd = path_cmd_line_to; if(m_dl >= 1.0 - m_ddl) { m_dl = 1.0; m_cmd = path_cmd_stop; *x = m_x1 + m_dx; *y = m_y1 + m_dy; return cmd; } *x = m_x1 + m_dx * m_dl; *y = m_y1 + m_dy * m_dl; m_dl += m_ddl; return cmd; } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/src/authors���������������������������������������������������������������������������0000644�0000000�0000000�00000000000�10703246330�015443� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/src/autogen.sh������������������������������������������������������������������������0000644�0000000�0000000�00000000446�10703246330�016047� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# autogen.sh # # invoke the auto* tools to create the configureation system # build aclocal.m4 aclocal # build the configure script autoconf # set up libtool libtoolize --force # invoke automake automake --foreign --add-missing # and finally invoke our new configure ./configure $* # end ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/src/configure.in����������������������������������������������������������������������0000644�0000000�0000000�00000000364�10703246330�016361� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������AC_INIT(src/agg_arc.cpp) # give me a source file, any source file... AM_INIT_AUTOMAKE(agg, 2.0.0) AC_PROG_LN_S AC_PROG_CC AC_PROG_CPP AC_PROG_CXX AC_PROG_LIBTOOL AC_OUTPUT( Makefile gpc/Makefile src/Makefile src/ctrl/Makefile ) ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/src/copying���������������������������������������������������������������������������0000644�0000000�0000000�00000001542�10703246330�015442� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Anti-Grain Geometry (AGG) - Version 2.5 A high quality rendering engine for C++ Copyright (C) 2002-2006 Maxim Shemanarev Contact: mcseem@antigrain.com mcseemagg@yahoo.com http://antigrain.com AGG is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. AGG is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with AGG; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ��������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/src/ctrl/�����������������������������������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�015011� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/src/ctrl/Makefile.am������������������������������������������������������������������0000644�0000000�0000000�00000000575�10703246330�017054� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������if ENABLE_CTRL INCLUDES = -I$(top_srcdir)/include noinst_LTLIBRARIES = libaggctrl.la libaggctrl_la_LDFLAGS = -no-undefined -version-info @AGG_LIB_VERSION@ libaggctrl_la_SOURCES = agg_cbox_ctrl.cpp agg_gamma_ctrl.cpp agg_gamma_spline.cpp agg_rbox_ctrl.cpp \ agg_slider_ctrl.cpp agg_spline_ctrl.cpp agg_scale_ctrl.cpp \ agg_bezier_ctrl.cpp agg_polygon_ctrl.cpp endif �����������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/src/ctrl/agg_bezier_ctrl.cpp����������������������������������������������������������0000644�0000000�0000000�00000025645�10703246330�020653� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #include <string.h> #include <stdio.h> #include "ctrl/agg_bezier_ctrl.h" namespace agg { //------------------------------------------------------------------------ bezier_ctrl_impl::bezier_ctrl_impl() : ctrl(0,0,1,1,false), m_stroke(m_curve), m_poly(4, 5.0), m_idx(0) { m_poly.in_polygon_check(false); m_poly.xn(0) = 100.0; m_poly.yn(0) = 0.0; m_poly.xn(1) = 100.0; m_poly.yn(1) = 50.0; m_poly.xn(2) = 50.0; m_poly.yn(2) = 100.0; m_poly.xn(3) = 0.0; m_poly.yn(3) = 100.0; } //------------------------------------------------------------------------ void bezier_ctrl_impl::curve(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4) { m_poly.xn(0) = x1; m_poly.yn(0) = y1; m_poly.xn(1) = x2; m_poly.yn(1) = y2; m_poly.xn(2) = x3; m_poly.yn(2) = y3; m_poly.xn(3) = x4; m_poly.yn(3) = y4; curve(); } //------------------------------------------------------------------------ curve4& bezier_ctrl_impl::curve() { m_curve.init(m_poly.xn(0), m_poly.yn(0), m_poly.xn(1), m_poly.yn(1), m_poly.xn(2), m_poly.yn(2), m_poly.xn(3), m_poly.yn(3)); return m_curve; } //------------------------------------------------------------------------ void bezier_ctrl_impl::rewind(unsigned idx) { m_idx = idx; m_curve.approximation_scale(scale()); switch(idx) { default: case 0: // Control line 1 m_curve.init(m_poly.xn(0), m_poly.yn(0), (m_poly.xn(0) + m_poly.xn(1)) * 0.5, (m_poly.yn(0) + m_poly.yn(1)) * 0.5, (m_poly.xn(0) + m_poly.xn(1)) * 0.5, (m_poly.yn(0) + m_poly.yn(1)) * 0.5, m_poly.xn(1), m_poly.yn(1)); m_stroke.rewind(0); break; case 1: // Control line 2 m_curve.init(m_poly.xn(2), m_poly.yn(2), (m_poly.xn(2) + m_poly.xn(3)) * 0.5, (m_poly.yn(2) + m_poly.yn(3)) * 0.5, (m_poly.xn(2) + m_poly.xn(3)) * 0.5, (m_poly.yn(2) + m_poly.yn(3)) * 0.5, m_poly.xn(3), m_poly.yn(3)); m_stroke.rewind(0); break; case 2: // Curve itself m_curve.init(m_poly.xn(0), m_poly.yn(0), m_poly.xn(1), m_poly.yn(1), m_poly.xn(2), m_poly.yn(2), m_poly.xn(3), m_poly.yn(3)); m_stroke.rewind(0); break; case 3: // Point 1 m_ellipse.init(m_poly.xn(0), m_poly.yn(0), point_radius(), point_radius(), 20); m_ellipse.rewind(0); break; case 4: // Point 2 m_ellipse.init(m_poly.xn(1), m_poly.yn(1), point_radius(), point_radius(), 20); m_ellipse.rewind(0); break; case 5: // Point 3 m_ellipse.init(m_poly.xn(2), m_poly.yn(2), point_radius(), point_radius(), 20); m_ellipse.rewind(0); break; case 6: // Point 4 m_ellipse.init(m_poly.xn(3), m_poly.yn(3), point_radius(), point_radius(), 20); m_ellipse.rewind(0); break; } } //------------------------------------------------------------------------ unsigned bezier_ctrl_impl::vertex(double* x, double* y) { unsigned cmd = path_cmd_stop; switch(m_idx) { case 0: case 1: case 2: cmd = m_stroke.vertex(x, y); break; case 3: case 4: case 5: case 6: case 7: cmd = m_ellipse.vertex(x, y); break; } if(!is_stop(cmd)) { transform_xy(x, y); } return cmd; } //------------------------------------------------------------------------ bool bezier_ctrl_impl::in_rect(double x, double y) const { return false; } //------------------------------------------------------------------------ bool bezier_ctrl_impl::on_mouse_button_down(double x, double y) { inverse_transform_xy(&x, &y); return m_poly.on_mouse_button_down(x, y); } //------------------------------------------------------------------------ bool bezier_ctrl_impl::on_mouse_move(double x, double y, bool button_flag) { inverse_transform_xy(&x, &y); return m_poly.on_mouse_move(x, y, button_flag); } //------------------------------------------------------------------------ bool bezier_ctrl_impl::on_mouse_button_up(double x, double y) { return m_poly.on_mouse_button_up(x, y); } //------------------------------------------------------------------------ bool bezier_ctrl_impl::on_arrow_keys(bool left, bool right, bool down, bool up) { return m_poly.on_arrow_keys(left, right, down, up); } //------------------------------------------------------------------------ curve3_ctrl_impl::curve3_ctrl_impl() : ctrl(0,0,1,1,false), m_stroke(m_curve), m_poly(3, 5.0), m_idx(0) { m_poly.in_polygon_check(false); m_poly.xn(0) = 100.0; m_poly.yn(0) = 0.0; m_poly.xn(1) = 100.0; m_poly.yn(1) = 50.0; m_poly.xn(2) = 50.0; m_poly.yn(2) = 100.0; } //------------------------------------------------------------------------ void curve3_ctrl_impl::curve(double x1, double y1, double x2, double y2, double x3, double y3) { m_poly.xn(0) = x1; m_poly.yn(0) = y1; m_poly.xn(1) = x2; m_poly.yn(1) = y2; m_poly.xn(2) = x3; m_poly.yn(2) = y3; curve(); } //------------------------------------------------------------------------ curve3& curve3_ctrl_impl::curve() { m_curve.init(m_poly.xn(0), m_poly.yn(0), m_poly.xn(1), m_poly.yn(1), m_poly.xn(2), m_poly.yn(2)); return m_curve; } //------------------------------------------------------------------------ void curve3_ctrl_impl::rewind(unsigned idx) { m_idx = idx; switch(idx) { default: case 0: // Control line m_curve.init(m_poly.xn(0), m_poly.yn(0), (m_poly.xn(0) + m_poly.xn(1)) * 0.5, (m_poly.yn(0) + m_poly.yn(1)) * 0.5, m_poly.xn(1), m_poly.yn(1)); m_stroke.rewind(0); break; case 1: // Control line 2 m_curve.init(m_poly.xn(1), m_poly.yn(1), (m_poly.xn(1) + m_poly.xn(2)) * 0.5, (m_poly.yn(1) + m_poly.yn(2)) * 0.5, m_poly.xn(2), m_poly.yn(2)); m_stroke.rewind(0); break; case 2: // Curve itself m_curve.init(m_poly.xn(0), m_poly.yn(0), m_poly.xn(1), m_poly.yn(1), m_poly.xn(2), m_poly.yn(2)); m_stroke.rewind(0); break; case 3: // Point 1 m_ellipse.init(m_poly.xn(0), m_poly.yn(0), point_radius(), point_radius(), 20); m_ellipse.rewind(0); break; case 4: // Point 2 m_ellipse.init(m_poly.xn(1), m_poly.yn(1), point_radius(), point_radius(), 20); m_ellipse.rewind(0); break; case 5: // Point 3 m_ellipse.init(m_poly.xn(2), m_poly.yn(2), point_radius(), point_radius(), 20); m_ellipse.rewind(0); break; } } //------------------------------------------------------------------------ unsigned curve3_ctrl_impl::vertex(double* x, double* y) { unsigned cmd = path_cmd_stop; switch(m_idx) { case 0: case 1: case 2: cmd = m_stroke.vertex(x, y); break; case 3: case 4: case 5: case 6: cmd = m_ellipse.vertex(x, y); break; } if(!is_stop(cmd)) { transform_xy(x, y); } return cmd; } //------------------------------------------------------------------------ bool curve3_ctrl_impl::in_rect(double x, double y) const { return false; } //------------------------------------------------------------------------ bool curve3_ctrl_impl::on_mouse_button_down(double x, double y) { inverse_transform_xy(&x, &y); return m_poly.on_mouse_button_down(x, y); } //------------------------------------------------------------------------ bool curve3_ctrl_impl::on_mouse_move(double x, double y, bool button_flag) { inverse_transform_xy(&x, &y); return m_poly.on_mouse_move(x, y, button_flag); } //------------------------------------------------------------------------ bool curve3_ctrl_impl::on_mouse_button_up(double x, double y) { return m_poly.on_mouse_button_up(x, y); } //------------------------------------------------------------------------ bool curve3_ctrl_impl::on_arrow_keys(bool left, bool right, bool down, bool up) { return m_poly.on_arrow_keys(left, right, down, up); } } �������������������������������������������������������������������������������������������agg-2.5+dfsg1/src/ctrl/agg_cbox_ctrl.cpp������������������������������������������������������������0000644�0000000�0000000�00000014615�10703246330�020321� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #include <string.h> #include "ctrl/agg_cbox_ctrl.h" namespace agg { //------------------------------------------------------------------------ cbox_ctrl_impl::cbox_ctrl_impl(double x, double y, const char* l, bool flip_y) : ctrl(x, y, x + 9.0 * 1.5, y + 9.0 * 1.5, flip_y), m_text_thickness(1.5), m_text_height(9.0), m_text_width(0.0), m_status(false), m_text_poly(m_text) { label(l); } //------------------------------------------------------------------------ void cbox_ctrl_impl::text_size(double h, double w) { m_text_width = w; m_text_height = h; } //------------------------------------------------------------------------ void cbox_ctrl_impl::label(const char* l) { unsigned len = strlen(l); if(len > 127) len = 127; memcpy(m_label, l, len); m_label[len] = 0; } //------------------------------------------------------------------------ bool cbox_ctrl_impl::on_mouse_button_down(double x, double y) { inverse_transform_xy(&x, &y); if(x >= m_x1 && y >= m_y1 && x <= m_x2 && y <= m_y2) { m_status = !m_status; return true; } return false; } //------------------------------------------------------------------------ bool cbox_ctrl_impl::on_mouse_move(double, double, bool) { return false; } //------------------------------------------------------------------------ bool cbox_ctrl_impl::in_rect(double x, double y) const { inverse_transform_xy(&x, &y); return x >= m_x1 && y >= m_y1 && x <= m_x2 && y <= m_y2; } //------------------------------------------------------------------------ bool cbox_ctrl_impl::on_mouse_button_up(double, double) { return false; } //------------------------------------------------------------------------ bool cbox_ctrl_impl::on_arrow_keys(bool, bool, bool, bool) { return false; } //------------------------------------------------------------------------ void cbox_ctrl_impl::rewind(unsigned idx) { m_idx = idx; double d2; double t; switch(idx) { default: case 0: // Border m_vertex = 0; m_vx[0] = m_x1; m_vy[0] = m_y1; m_vx[1] = m_x2; m_vy[1] = m_y1; m_vx[2] = m_x2; m_vy[2] = m_y2; m_vx[3] = m_x1; m_vy[3] = m_y2; m_vx[4] = m_x1 + m_text_thickness; m_vy[4] = m_y1 + m_text_thickness; m_vx[5] = m_x1 + m_text_thickness; m_vy[5] = m_y2 - m_text_thickness; m_vx[6] = m_x2 - m_text_thickness; m_vy[6] = m_y2 - m_text_thickness; m_vx[7] = m_x2 - m_text_thickness; m_vy[7] = m_y1 + m_text_thickness; break; case 1: // Text m_text.text(m_label); m_text.start_point(m_x1 + m_text_height * 2.0, m_y1 + m_text_height / 5.0); m_text.size(m_text_height, m_text_width); m_text_poly.width(m_text_thickness); m_text_poly.line_join(round_join); m_text_poly.line_cap(round_cap); m_text_poly.rewind(0); break; case 2: // Active item m_vertex = 0; d2 = (m_y2 - m_y1) / 2.0; t = m_text_thickness * 1.5; m_vx[0] = m_x1 + m_text_thickness; m_vy[0] = m_y1 + m_text_thickness; m_vx[1] = m_x1 + d2; m_vy[1] = m_y1 + d2 - t; m_vx[2] = m_x2 - m_text_thickness; m_vy[2] = m_y1 + m_text_thickness; m_vx[3] = m_x1 + d2 + t; m_vy[3] = m_y1 + d2; m_vx[4] = m_x2 - m_text_thickness; m_vy[4] = m_y2 - m_text_thickness; m_vx[5] = m_x1 + d2; m_vy[5] = m_y1 + d2 + t; m_vx[6] = m_x1 + m_text_thickness; m_vy[6] = m_y2 - m_text_thickness; m_vx[7] = m_x1 + d2 - t; m_vy[7] = m_y1 + d2; break; } } //------------------------------------------------------------------------ unsigned cbox_ctrl_impl::vertex(double* x, double* y) { unsigned cmd = path_cmd_line_to; switch(m_idx) { case 0: if(m_vertex == 0 || m_vertex == 4) cmd = path_cmd_move_to; if(m_vertex >= 8) cmd = path_cmd_stop; *x = m_vx[m_vertex]; *y = m_vy[m_vertex]; m_vertex++; break; case 1: cmd = m_text_poly.vertex(x, y); break; case 2: if(m_status) { if(m_vertex == 0) cmd = path_cmd_move_to; if(m_vertex >= 8) cmd = path_cmd_stop; *x = m_vx[m_vertex]; *y = m_vy[m_vertex]; m_vertex++; } else { cmd = path_cmd_stop; } break; default: cmd = path_cmd_stop; break; } if(!is_stop(cmd)) { transform_xy(x, y); } return cmd; } } �������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/src/ctrl/agg_gamma_ctrl.cpp�����������������������������������������������������������0000644�0000000�0000000�00000033033�10703246330�020443� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #include <stdio.h> #include "agg_math.h" #include "ctrl/agg_gamma_ctrl.h" namespace agg { //------------------------------------------------------------------------ gamma_ctrl_impl::gamma_ctrl_impl(double x1, double y1, double x2, double y2, bool flip_y) : ctrl(x1, y1, x2, y2, flip_y), m_border_width(2.0), m_border_extra(0.0), m_curve_width(2.0), m_grid_width(0.2), m_text_thickness(1.5), m_point_size(5.0), m_text_height(9.0), m_text_width(0.0), m_xc1(x1), m_yc1(y1), m_xc2(x2), m_yc2(y2 - m_text_height * 2.0), m_xt1(x1), m_yt1(y2 - m_text_height * 2.0), m_xt2(x2), m_yt2(y2), m_curve_poly(m_gamma_spline), m_text_poly(m_text), m_idx(0), m_vertex(0), m_p1_active(true), m_mouse_point(0), m_pdx(0.0), m_pdy(0.0) { calc_spline_box(); } //------------------------------------------------------------------------ void gamma_ctrl_impl::calc_spline_box() { m_xs1 = m_xc1 + m_border_width; m_ys1 = m_yc1 + m_border_width; m_xs2 = m_xc2 - m_border_width; m_ys2 = m_yc2 - m_border_width * 0.5; } //------------------------------------------------------------------------ void gamma_ctrl_impl::calc_points() { double kx1, ky1, kx2, ky2; m_gamma_spline.values(&kx1, &ky1, &kx2, &ky2); m_xp1 = m_xs1 + (m_xs2 - m_xs1) * kx1 * 0.25; m_yp1 = m_ys1 + (m_ys2 - m_ys1) * ky1 * 0.25; m_xp2 = m_xs2 - (m_xs2 - m_xs1) * kx2 * 0.25; m_yp2 = m_ys2 - (m_ys2 - m_ys1) * ky2 * 0.25; } //------------------------------------------------------------------------ void gamma_ctrl_impl::calc_values() { double kx1, ky1, kx2, ky2; kx1 = (m_xp1 - m_xs1) * 4.0 / (m_xs2 - m_xs1); ky1 = (m_yp1 - m_ys1) * 4.0 / (m_ys2 - m_ys1); kx2 = (m_xs2 - m_xp2) * 4.0 / (m_xs2 - m_xs1); ky2 = (m_ys2 - m_yp2) * 4.0 / (m_ys2 - m_ys1); m_gamma_spline.values(kx1, ky1, kx2, ky2); } //------------------------------------------------------------------------ void gamma_ctrl_impl::text_size(double h, double w) { m_text_width = w; m_text_height = h; m_yc2 = m_y2 - m_text_height * 2.0; m_yt1 = m_y2 - m_text_height * 2.0; calc_spline_box(); } //------------------------------------------------------------------------ void gamma_ctrl_impl::border_width(double t, double extra) { m_border_width = t; m_border_extra = extra; calc_spline_box(); } //------------------------------------------------------------------------ void gamma_ctrl_impl::values(double kx1, double ky1, double kx2, double ky2) { m_gamma_spline.values(kx1, ky1, kx2, ky2); } //------------------------------------------------------------------------ void gamma_ctrl_impl::values(double* kx1, double* ky1, double* kx2, double* ky2) const { m_gamma_spline.values(kx1, ky1, kx2, ky2); } //------------------------------------------------------------------------ void gamma_ctrl_impl::rewind(unsigned idx) { double kx1, ky1, kx2, ky2; char tbuf[32]; m_idx = idx; switch(idx) { default: case 0: // Background m_vertex = 0; m_vx[0] = m_x1 - m_border_extra; m_vy[0] = m_y1 - m_border_extra; m_vx[1] = m_x2 + m_border_extra; m_vy[1] = m_y1 - m_border_extra; m_vx[2] = m_x2 + m_border_extra; m_vy[2] = m_y2 + m_border_extra; m_vx[3] = m_x1 - m_border_extra; m_vy[3] = m_y2 + m_border_extra; break; case 1: // Border m_vertex = 0; m_vx[0] = m_x1; m_vy[0] = m_y1; m_vx[1] = m_x2; m_vy[1] = m_y1; m_vx[2] = m_x2; m_vy[2] = m_y2; m_vx[3] = m_x1; m_vy[3] = m_y2; m_vx[4] = m_x1 + m_border_width; m_vy[4] = m_y1 + m_border_width; m_vx[5] = m_x1 + m_border_width; m_vy[5] = m_y2 - m_border_width; m_vx[6] = m_x2 - m_border_width; m_vy[6] = m_y2 - m_border_width; m_vx[7] = m_x2 - m_border_width; m_vy[7] = m_y1 + m_border_width; m_vx[8] = m_xc1 + m_border_width; m_vy[8] = m_yc2 - m_border_width * 0.5; m_vx[9] = m_xc2 - m_border_width; m_vy[9] = m_yc2 - m_border_width * 0.5; m_vx[10] = m_xc2 - m_border_width; m_vy[10] = m_yc2 + m_border_width * 0.5; m_vx[11] = m_xc1 + m_border_width; m_vy[11] = m_yc2 + m_border_width * 0.5; break; case 2: // Curve m_gamma_spline.box(m_xs1, m_ys1, m_xs2, m_ys2); m_curve_poly.width(m_curve_width); m_curve_poly.rewind(0); break; case 3: // Grid m_vertex = 0; m_vx[0] = m_xs1; m_vy[0] = (m_ys1 + m_ys2) * 0.5 - m_grid_width * 0.5; m_vx[1] = m_xs2; m_vy[1] = (m_ys1 + m_ys2) * 0.5 - m_grid_width * 0.5; m_vx[2] = m_xs2; m_vy[2] = (m_ys1 + m_ys2) * 0.5 + m_grid_width * 0.5; m_vx[3] = m_xs1; m_vy[3] = (m_ys1 + m_ys2) * 0.5 + m_grid_width * 0.5; m_vx[4] = (m_xs1 + m_xs2) * 0.5 - m_grid_width * 0.5; m_vy[4] = m_ys1; m_vx[5] = (m_xs1 + m_xs2) * 0.5 - m_grid_width * 0.5; m_vy[5] = m_ys2; m_vx[6] = (m_xs1 + m_xs2) * 0.5 + m_grid_width * 0.5; m_vy[6] = m_ys2; m_vx[7] = (m_xs1 + m_xs2) * 0.5 + m_grid_width * 0.5; m_vy[7] = m_ys1; calc_points(); m_vx[8] = m_xs1; m_vy[8] = m_yp1 - m_grid_width * 0.5; m_vx[9] = m_xp1 - m_grid_width * 0.5; m_vy[9] = m_yp1 - m_grid_width * 0.5; m_vx[10] = m_xp1 - m_grid_width * 0.5; m_vy[10] = m_ys1; m_vx[11] = m_xp1 + m_grid_width * 0.5; m_vy[11] = m_ys1; m_vx[12] = m_xp1 + m_grid_width * 0.5; m_vy[12] = m_yp1 + m_grid_width * 0.5; m_vx[13] = m_xs1; m_vy[13] = m_yp1 + m_grid_width * 0.5; m_vx[14] = m_xs2; m_vy[14] = m_yp2 + m_grid_width * 0.5; m_vx[15] = m_xp2 + m_grid_width * 0.5; m_vy[15] = m_yp2 + m_grid_width * 0.5; m_vx[16] = m_xp2 + m_grid_width * 0.5; m_vy[16] = m_ys2; m_vx[17] = m_xp2 - m_grid_width * 0.5; m_vy[17] = m_ys2; m_vx[18] = m_xp2 - m_grid_width * 0.5; m_vy[18] = m_yp2 - m_grid_width * 0.5; m_vx[19] = m_xs2; m_vy[19] = m_yp2 - m_grid_width * 0.5; break; case 4: // Point1 calc_points(); if(m_p1_active) m_ellipse.init(m_xp2, m_yp2, m_point_size, m_point_size, 32); else m_ellipse.init(m_xp1, m_yp1, m_point_size, m_point_size, 32); break; case 5: // Point2 calc_points(); if(m_p1_active) m_ellipse.init(m_xp1, m_yp1, m_point_size, m_point_size, 32); else m_ellipse.init(m_xp2, m_yp2, m_point_size, m_point_size, 32); break; case 6: // Text m_gamma_spline.values(&kx1, &ky1, &kx2, &ky2); sprintf(tbuf, "%5.3f %5.3f %5.3f %5.3f", kx1, ky1, kx2, ky2); m_text.text(tbuf); m_text.size(m_text_height, m_text_width); m_text.start_point(m_xt1 + m_border_width * 2.0, (m_yt1 + m_yt2) * 0.5 - m_text_height * 0.5); m_text_poly.width(m_text_thickness); m_text_poly.line_join(round_join); m_text_poly.line_cap(round_cap); m_text_poly.rewind(0); break; } } //------------------------------------------------------------------------ unsigned gamma_ctrl_impl::vertex(double* x, double* y) { unsigned cmd = path_cmd_line_to; switch(m_idx) { case 0: if(m_vertex == 0) cmd = path_cmd_move_to; if(m_vertex >= 4) cmd = path_cmd_stop; *x = m_vx[m_vertex]; *y = m_vy[m_vertex]; m_vertex++; break; case 1: if(m_vertex == 0 || m_vertex == 4 || m_vertex == 8) cmd = path_cmd_move_to; if(m_vertex >= 12) cmd = path_cmd_stop; *x = m_vx[m_vertex]; *y = m_vy[m_vertex]; m_vertex++; break; case 2: cmd = m_curve_poly.vertex(x, y); break; case 3: if(m_vertex == 0 || m_vertex == 4 || m_vertex == 8 || m_vertex == 14) cmd = path_cmd_move_to; if(m_vertex >= 20) cmd = path_cmd_stop; *x = m_vx[m_vertex]; *y = m_vy[m_vertex]; m_vertex++; break; case 4: // Point1 case 5: // Point2 cmd = m_ellipse.vertex(x, y); break; case 6: cmd = m_text_poly.vertex(x, y); break; default: cmd = path_cmd_stop; break; } if(!is_stop(cmd)) { transform_xy(x, y); } return cmd; } //------------------------------------------------------------------------ bool gamma_ctrl_impl::on_arrow_keys(bool left, bool right, bool down, bool up) { double kx1, ky1, kx2, ky2; bool ret = false; m_gamma_spline.values(&kx1, &ky1, &kx2, &ky2); if(m_p1_active) { if(left) { kx1 -= 0.005; ret = true; } if(right) { kx1 += 0.005; ret = true; } if(down) { ky1 -= 0.005; ret = true; } if(up) { ky1 += 0.005; ret = true; } } else { if(left) { kx2 += 0.005; ret = true; } if(right) { kx2 -= 0.005; ret = true; } if(down) { ky2 += 0.005; ret = true; } if(up) { ky2 -= 0.005; ret = true; } } if(ret) { m_gamma_spline.values(kx1, ky1, kx2, ky2); } return ret; } //------------------------------------------------------------------------ void gamma_ctrl_impl::change_active_point() { m_p1_active = m_p1_active ? false : true; } //------------------------------------------------------------------------ bool gamma_ctrl_impl::in_rect(double x, double y) const { inverse_transform_xy(&x, &y); return x >= m_x1 && x <= m_x2 && y >= m_y1 && y <= m_y2; } //------------------------------------------------------------------------ bool gamma_ctrl_impl::on_mouse_button_down(double x, double y) { inverse_transform_xy(&x, &y); calc_points(); if(calc_distance(x, y, m_xp1, m_yp1) <= m_point_size + 1) { m_mouse_point = 1; m_pdx = m_xp1 - x; m_pdy = m_yp1 - y; m_p1_active = true; return true; } if(calc_distance(x, y, m_xp2, m_yp2) <= m_point_size + 1) { m_mouse_point = 2; m_pdx = m_xp2 - x; m_pdy = m_yp2 - y; m_p1_active = false; return true; } return false; } //------------------------------------------------------------------------ bool gamma_ctrl_impl::on_mouse_button_up(double, double) { if(m_mouse_point) { m_mouse_point = 0; return true; } return false; } //------------------------------------------------------------------------ bool gamma_ctrl_impl::on_mouse_move(double x, double y, bool button_flag) { inverse_transform_xy(&x, &y); if(!button_flag) { return on_mouse_button_up(x, y); } if(m_mouse_point == 1) { m_xp1 = x + m_pdx; m_yp1 = y + m_pdy; calc_values(); return true; } if(m_mouse_point == 2) { m_xp2 = x + m_pdx; m_yp2 = y + m_pdy; calc_values(); return true; } return false; } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/src/ctrl/agg_gamma_spline.cpp���������������������������������������������������������0000644�0000000�0000000�00000007413�10703246330�020774� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #include "ctrl/agg_gamma_spline.h" namespace agg { //------------------------------------------------------------------------ gamma_spline::gamma_spline() : m_x1(0), m_y1(0), m_x2(10), m_y2(10), m_cur_x(0.0) { values(1.0, 1.0, 1.0, 1.0); } //------------------------------------------------------------------------ double gamma_spline::y(double x) const { if(x < 0.0) x = 0.0; if(x > 1.0) x = 1.0; double val = m_spline.get(x); if(val < 0.0) val = 0.0; if(val > 1.0) val = 1.0; return val; } //------------------------------------------------------------------------ void gamma_spline::values(double kx1, double ky1, double kx2, double ky2) { if(kx1 < 0.001) kx1 = 0.001; if(kx1 > 1.999) kx1 = 1.999; if(ky1 < 0.001) ky1 = 0.001; if(ky1 > 1.999) ky1 = 1.999; if(kx2 < 0.001) kx2 = 0.001; if(kx2 > 1.999) kx2 = 1.999; if(ky2 < 0.001) ky2 = 0.001; if(ky2 > 1.999) ky2 = 1.999; m_x[0] = 0.0; m_y[0] = 0.0; m_x[1] = kx1 * 0.25; m_y[1] = ky1 * 0.25; m_x[2] = 1.0 - kx2 * 0.25; m_y[2] = 1.0 - ky2 * 0.25; m_x[3] = 1.0; m_y[3] = 1.0; m_spline.init(4, m_x, m_y); int i; for(i = 0; i < 256; i++) { m_gamma[i] = (unsigned char)(y(double(i) / 255.0) * 255.0); } } //------------------------------------------------------------------------ void gamma_spline::values(double* kx1, double* ky1, double* kx2, double* ky2) const { *kx1 = m_x[1] * 4.0; *ky1 = m_y[1] * 4.0; *kx2 = (1.0 - m_x[2]) * 4.0; *ky2 = (1.0 - m_y[2]) * 4.0; } //------------------------------------------------------------------------ void gamma_spline::box(double x1, double y1, double x2, double y2) { m_x1 = x1; m_y1 = y1; m_x2 = x2; m_y2 = y2; } //------------------------------------------------------------------------ void gamma_spline::rewind(unsigned) { m_cur_x = 0.0; } //------------------------------------------------------------------------ unsigned gamma_spline::vertex(double* vx, double* vy) { if(m_cur_x == 0.0) { *vx = m_x1; *vy = m_y1; m_cur_x += 1.0 / (m_x2 - m_x1); return path_cmd_move_to; } if(m_cur_x > 1.0) { return path_cmd_stop; } *vx = m_x1 + m_cur_x * (m_x2 - m_x1); *vy = m_y1 + y(m_cur_x) * (m_y2 - m_y1); m_cur_x += 1.0 / (m_x2 - m_x1); return path_cmd_line_to; } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/src/ctrl/agg_polygon_ctrl.cpp���������������������������������������������������������0000644�0000000�0000000�00000025024�10703246330�021051� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #include "ctrl/agg_polygon_ctrl.h" namespace agg { polygon_ctrl_impl::polygon_ctrl_impl(unsigned np, double point_radius) : ctrl(0, 0, 1, 1, false), m_polygon(np * 2), m_num_points(np), m_node(-1), m_edge(-1), m_vs(&m_polygon[0], m_num_points, false), m_stroke(m_vs), m_point_radius(point_radius), m_status(0), m_dx(0.0), m_dy(0.0), m_in_polygon_check(true) { m_stroke.width(1.0); } void polygon_ctrl_impl::rewind(unsigned) { m_status = 0; m_stroke.rewind(0); } unsigned polygon_ctrl_impl::vertex(double* x, double* y) { unsigned cmd = path_cmd_stop; double r = m_point_radius; if(m_status == 0) { cmd = m_stroke.vertex(x, y); if(!is_stop(cmd)) { transform_xy(x, y); return cmd; } if(m_node >= 0 && m_node == int(m_status)) r *= 1.2; m_ellipse.init(xn(m_status), yn(m_status), r, r, 32); ++m_status; } cmd = m_ellipse.vertex(x, y); if(!is_stop(cmd)) { transform_xy(x, y); return cmd; } if(m_status >= m_num_points) return path_cmd_stop; if(m_node >= 0 && m_node == int(m_status)) r *= 1.2; m_ellipse.init(xn(m_status), yn(m_status), r, r, 32); ++m_status; cmd = m_ellipse.vertex(x, y); if(!is_stop(cmd)) { transform_xy(x, y); } return cmd; } bool polygon_ctrl_impl::check_edge(unsigned i, double x, double y) const { bool ret = false; unsigned n1 = i; unsigned n2 = (i + m_num_points - 1) % m_num_points; double x1 = xn(n1); double y1 = yn(n1); double x2 = xn(n2); double y2 = yn(n2); double dx = x2 - x1; double dy = y2 - y1; if(sqrt(dx*dx + dy*dy) > 0.0000001) { double x3 = x; double y3 = y; double x4 = x3 - dy; double y4 = y3 + dx; double den = (y4-y3) * (x2-x1) - (x4-x3) * (y2-y1); double u1 = ((x4-x3) * (y1-y3) - (y4-y3) * (x1-x3)) / den; double xi = x1 + u1 * (x2 - x1); double yi = y1 + u1 * (y2 - y1); dx = xi - x; dy = yi - y; if (u1 > 0.0 && u1 < 1.0 && sqrt(dx*dx + dy*dy) <= m_point_radius) { ret = true; } } return ret; } bool polygon_ctrl_impl::in_rect(double x, double y) const { return false; } bool polygon_ctrl_impl::on_mouse_button_down(double x, double y) { unsigned i; bool ret = false; m_node = -1; m_edge = -1; inverse_transform_xy(&x, &y); for (i = 0; i < m_num_points; i++) { if(sqrt( (x-xn(i)) * (x-xn(i)) + (y-yn(i)) * (y-yn(i)) ) < m_point_radius) { m_dx = x - xn(i); m_dy = y - yn(i); m_node = int(i); ret = true; break; } } if(!ret) { for (i = 0; i < m_num_points; i++) { if(check_edge(i, x, y)) { m_dx = x; m_dy = y; m_edge = int(i); ret = true; break; } } } if(!ret) { if(point_in_polygon(x, y)) { m_dx = x; m_dy = y; m_node = int(m_num_points); ret = true; } } return ret; } bool polygon_ctrl_impl::on_mouse_move(double x, double y, bool button_flag) { bool ret = false; double dx; double dy; inverse_transform_xy(&x, &y); if(m_node == int(m_num_points)) { dx = x - m_dx; dy = y - m_dy; unsigned i; for(i = 0; i < m_num_points; i++) { xn(i) += dx; yn(i) += dy; } m_dx = x; m_dy = y; ret = true; } else { if(m_edge >= 0) { unsigned n1 = m_edge; unsigned n2 = (n1 + m_num_points - 1) % m_num_points; dx = x - m_dx; dy = y - m_dy; xn(n1) += dx; yn(n1) += dy; xn(n2) += dx; yn(n2) += dy; m_dx = x; m_dy = y; ret = true; } else { if(m_node >= 0) { xn(m_node) = x - m_dx; yn(m_node) = y - m_dy; ret = true; } } } return ret; } bool polygon_ctrl_impl::on_mouse_button_up(double x, double y) { bool ret = (m_node >= 0) || (m_edge >= 0); m_node = -1; m_edge = -1; return ret; } bool polygon_ctrl_impl::on_arrow_keys(bool left, bool right, bool down, bool up) { return false; } //======= Crossings Multiply algorithm of InsideTest ======================== // // By Eric Haines, 3D/Eye Inc, erich@eye.com // // This version is usually somewhat faster than the original published in // Graphics Gems IV; by turning the division for testing the X axis crossing // into a tricky multiplication test this part of the test became faster, // which had the additional effect of making the test for "both to left or // both to right" a bit slower for triangles than simply computing the // intersection each time. The main increase is in triangle testing speed, // which was about 15% faster; all other polygon complexities were pretty much // the same as before. On machines where division is very expensive (not the // case on the HP 9000 series on which I tested) this test should be much // faster overall than the old code. Your mileage may (in fact, will) vary, // depending on the machine and the test data, but in general I believe this // code is both shorter and faster. This test was inspired by unpublished // Graphics Gems submitted by Joseph Samosky and Mark Haigh-Hutchinson. // Related work by Samosky is in: // // Samosky, Joseph, "SectionView: A system for interactively specifying and // visualizing sections through three-dimensional medical image data", // M.S. Thesis, Department of Electrical Engineering and Computer Science, // Massachusetts Institute of Technology, 1993. // // Shoot a test ray along +X axis. The strategy is to compare vertex Y values // to the testing point's Y and quickly discard edges which are entirely to one // side of the test ray. Note that CONVEX and WINDING code can be added as // for the CrossingsTest() code; it is left out here for clarity. // // Input 2D polygon _pgon_ with _numverts_ number of vertices and test point // _point_, returns 1 if inside, 0 if outside. bool polygon_ctrl_impl::point_in_polygon(double tx, double ty) const { if(m_num_points < 3) return false; if(!m_in_polygon_check) return false; unsigned j; int yflag0, yflag1, inside_flag; double vtx0, vty0, vtx1, vty1; vtx0 = xn(m_num_points - 1); vty0 = yn(m_num_points - 1); // get test bit for above/below X axis yflag0 = (vty0 >= ty); vtx1 = xn(0); vty1 = yn(0); inside_flag = 0; for (j = 1; j <= m_num_points; ++j) { yflag1 = (vty1 >= ty); // Check if endpoints straddle (are on opposite sides) of X axis // (i.e. the Y's differ); if so, +X ray could intersect this edge. // The old test also checked whether the endpoints are both to the // right or to the left of the test point. However, given the faster // intersection point computation used below, this test was found to // be a break-even proposition for most polygons and a loser for // triangles (where 50% or more of the edges which survive this test // will cross quadrants and so have to have the X intersection computed // anyway). I credit Joseph Samosky with inspiring me to try dropping // the "both left or both right" part of my code. if (yflag0 != yflag1) { // Check intersection of pgon segment with +X ray. // Note if >= point's X; if so, the ray hits it. // The division operation is avoided for the ">=" test by checking // the sign of the first vertex wrto the test point; idea inspired // by Joseph Samosky's and Mark Haigh-Hutchinson's different // polygon inclusion tests. if ( ((vty1-ty) * (vtx0-vtx1) >= (vtx1-tx) * (vty0-vty1)) == yflag1 ) { inside_flag ^= 1; } } // Move to the next pair of vertices, retaining info as possible. yflag0 = yflag1; vtx0 = vtx1; vty0 = vty1; unsigned k = (j >= m_num_points) ? j - m_num_points : j; vtx1 = xn(k); vty1 = yn(k); } return inside_flag != 0; } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/src/ctrl/agg_rbox_ctrl.cpp������������������������������������������������������������0000644�0000000�0000000�00000022750�10703246330�020337� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #include <string.h> #include "ctrl/agg_rbox_ctrl.h" namespace agg { //------------------------------------------------------------------------ rbox_ctrl_impl::rbox_ctrl_impl(double x1, double y1, double x2, double y2, bool flip_y) : ctrl(x1, y1, x2, y2, flip_y), m_border_width(1.0), m_border_extra(0.0), m_text_thickness(1.5), m_text_height(9.0), m_text_width(0.0), m_num_items(0), m_cur_item(-1), m_ellipse_poly(m_ellipse), m_text_poly(m_text), m_idx(0), m_vertex(0) { calc_rbox(); } //------------------------------------------------------------------------ void rbox_ctrl_impl::calc_rbox() { m_xs1 = m_x1 + m_border_width; m_ys1 = m_y1 + m_border_width; m_xs2 = m_x2 - m_border_width; m_ys2 = m_y2 - m_border_width; } //------------------------------------------------------------------------ void rbox_ctrl_impl::add_item(const char* text) { if(m_num_items < 32) { m_items[m_num_items].resize(strlen(text) + 1); strcpy(&m_items[m_num_items][0], text); m_num_items++; } } //------------------------------------------------------------------------ void rbox_ctrl_impl::border_width(double t, double extra) { m_border_width = t; m_border_extra = extra; calc_rbox(); } //------------------------------------------------------------------------ void rbox_ctrl_impl::text_size(double h, double w) { m_text_width = w; m_text_height = h; } //------------------------------------------------------------------------ void rbox_ctrl_impl::rewind(unsigned idx) { m_idx = idx; m_dy = m_text_height * 2.0; m_draw_item = 0; switch(idx) { default: case 0: // Background m_vertex = 0; m_vx[0] = m_x1 - m_border_extra; m_vy[0] = m_y1 - m_border_extra; m_vx[1] = m_x2 + m_border_extra; m_vy[1] = m_y1 - m_border_extra; m_vx[2] = m_x2 + m_border_extra; m_vy[2] = m_y2 + m_border_extra; m_vx[3] = m_x1 - m_border_extra; m_vy[3] = m_y2 + m_border_extra; break; case 1: // Border m_vertex = 0; m_vx[0] = m_x1; m_vy[0] = m_y1; m_vx[1] = m_x2; m_vy[1] = m_y1; m_vx[2] = m_x2; m_vy[2] = m_y2; m_vx[3] = m_x1; m_vy[3] = m_y2; m_vx[4] = m_x1 + m_border_width; m_vy[4] = m_y1 + m_border_width; m_vx[5] = m_x1 + m_border_width; m_vy[5] = m_y2 - m_border_width; m_vx[6] = m_x2 - m_border_width; m_vy[6] = m_y2 - m_border_width; m_vx[7] = m_x2 - m_border_width; m_vy[7] = m_y1 + m_border_width; break; case 2: // Text m_text.text(&m_items[0][0]); m_text.start_point(m_xs1 + m_dy * 1.5, m_ys1 + m_dy / 2.0); m_text.size(m_text_height, m_text_width); m_text_poly.width(m_text_thickness); m_text_poly.line_join(round_join); m_text_poly.line_cap(round_cap); m_text_poly.rewind(0); break; case 3: // Inactive items m_ellipse.init(m_xs1 + m_dy / 1.3, m_ys1 + m_dy / 1.3, m_text_height / 1.5, m_text_height / 1.5, 32); m_ellipse_poly.width(m_text_thickness); m_ellipse_poly.rewind(0); break; case 4: // Active Item if(m_cur_item >= 0) { m_ellipse.init(m_xs1 + m_dy / 1.3, m_ys1 + m_dy * m_cur_item + m_dy / 1.3, m_text_height / 2.0, m_text_height / 2.0, 32); m_ellipse.rewind(0); } break; } } //------------------------------------------------------------------------ unsigned rbox_ctrl_impl::vertex(double* x, double* y) { unsigned cmd = path_cmd_line_to; switch(m_idx) { case 0: if(m_vertex == 0) cmd = path_cmd_move_to; if(m_vertex >= 4) cmd = path_cmd_stop; *x = m_vx[m_vertex]; *y = m_vy[m_vertex]; m_vertex++; break; case 1: if(m_vertex == 0 || m_vertex == 4) cmd = path_cmd_move_to; if(m_vertex >= 8) cmd = path_cmd_stop; *x = m_vx[m_vertex]; *y = m_vy[m_vertex]; m_vertex++; break; case 2: cmd = m_text_poly.vertex(x, y); if(is_stop(cmd)) { m_draw_item++; if(m_draw_item >= m_num_items) { break; } else { m_text.text(&m_items[m_draw_item][0]); m_text.start_point(m_xs1 + m_dy * 1.5, m_ys1 + m_dy * (m_draw_item + 1) - m_dy / 2.0); m_text_poly.rewind(0); cmd = m_text_poly.vertex(x, y); } } break; case 3: cmd = m_ellipse_poly.vertex(x, y); if(is_stop(cmd)) { m_draw_item++; if(m_draw_item >= m_num_items) { break; } else { m_ellipse.init(m_xs1 + m_dy / 1.3, m_ys1 + m_dy * m_draw_item + m_dy / 1.3, m_text_height / 1.5, m_text_height / 1.5, 32); m_ellipse_poly.rewind(0); cmd = m_ellipse_poly.vertex(x, y); } } break; case 4: if(m_cur_item >= 0) { cmd = m_ellipse.vertex(x, y); } else { cmd = path_cmd_stop; } break; default: cmd = path_cmd_stop; break; } if(!is_stop(cmd)) { transform_xy(x, y); } return cmd; } //------------------------------------------------------------------------ bool rbox_ctrl_impl::in_rect(double x, double y) const { inverse_transform_xy(&x, &y); return x >= m_x1 && x <= m_x2 && y >= m_y1 && y <= m_y2; } //------------------------------------------------------------------------ bool rbox_ctrl_impl::on_mouse_button_down(double x, double y) { inverse_transform_xy(&x, &y); unsigned i; for(i = 0; i < m_num_items; i++) { double xp = m_xs1 + m_dy / 1.3; double yp = m_ys1 + m_dy * i + m_dy / 1.3; if(calc_distance(x, y, xp, yp) <= m_text_height / 1.5) { m_cur_item = int(i); return true; } } return false; } //------------------------------------------------------------------------ bool rbox_ctrl_impl::on_mouse_move(double, double, bool) { return false; } //------------------------------------------------------------------------ bool rbox_ctrl_impl::on_mouse_button_up(double, double) { return false; } //------------------------------------------------------------------------ bool rbox_ctrl_impl::on_arrow_keys(bool left, bool right, bool down, bool up) { if(m_cur_item >= 0) { if(up || right) { m_cur_item++; if(m_cur_item >= int(m_num_items)) { m_cur_item = 0; } return true; } if(down || left) { m_cur_item--; if(m_cur_item < 0) { m_cur_item = m_num_items - 1; } return true; } } return false; } } ������������������������agg-2.5+dfsg1/src/ctrl/agg_scale_ctrl.cpp�����������������������������������������������������������0000644�0000000�0000000�00000033002�10703246330�020444� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #include "ctrl/agg_scale_ctrl.h" namespace agg { //------------------------------------------------------------------------ scale_ctrl_impl::scale_ctrl_impl(double x1, double y1, double x2, double y2, bool flip_y) : ctrl(x1, y1, x2, y2, flip_y), m_border_thickness(1.0), m_border_extra((fabs(x2 - x1) > fabs(y2 - y1)) ? (y2 - y1) / 2 : (x2 - x1) / 2), m_pdx(0.0), m_pdy(0.0), m_move_what(move_nothing), m_value1(0.3), m_value2(0.7), m_min_d(0.01) { calc_box(); } //------------------------------------------------------------------------ void scale_ctrl_impl::calc_box() { m_xs1 = m_x1 + m_border_thickness; m_ys1 = m_y1 + m_border_thickness; m_xs2 = m_x2 - m_border_thickness; m_ys2 = m_y2 - m_border_thickness; } //------------------------------------------------------------------------ void scale_ctrl_impl::border_thickness(double t, double extra) { m_border_thickness = t; m_border_extra = extra; calc_box(); } //------------------------------------------------------------------------ void scale_ctrl_impl::resize(double x1, double y1, double x2, double y2) { m_x1 = x1; m_y1 = y1; m_x2 = x2; m_y2 = y2; calc_box(); m_border_extra = (fabs(x2 - x1) > fabs(y2 - y1)) ? (y2 - y1) / 2 : (x2 - x1) / 2; } //------------------------------------------------------------------------ void scale_ctrl_impl::value1(double value) { if(value < 0.0) value = 0.0; if(value > 1.0) value = 1.0; if(m_value2 - value < m_min_d) value = m_value2 - m_min_d; m_value1 = value; } //------------------------------------------------------------------------ void scale_ctrl_impl::value2(double value) { if(value < 0.0) value = 0.0; if(value > 1.0) value = 1.0; if(m_value1 + value < m_min_d) value = m_value1 + m_min_d; m_value2 = value; } //------------------------------------------------------------------------ void scale_ctrl_impl::move(double d) { m_value1 += d; m_value2 += d; if(m_value1 < 0.0) { m_value2 -= m_value1; m_value1 = 0.0; } if(m_value2 > 1.0) { m_value1 -= m_value2 - 1.0; m_value2 = 1.0; } } //------------------------------------------------------------------------ void scale_ctrl_impl::rewind(unsigned idx) { m_idx = idx; switch(idx) { default: case 0: // Background m_vertex = 0; m_vx[0] = m_x1 - m_border_extra; m_vy[0] = m_y1 - m_border_extra; m_vx[1] = m_x2 + m_border_extra; m_vy[1] = m_y1 - m_border_extra; m_vx[2] = m_x2 + m_border_extra; m_vy[2] = m_y2 + m_border_extra; m_vx[3] = m_x1 - m_border_extra; m_vy[3] = m_y2 + m_border_extra; break; case 1: // Border m_vertex = 0; m_vx[0] = m_x1; m_vy[0] = m_y1; m_vx[1] = m_x2; m_vy[1] = m_y1; m_vx[2] = m_x2; m_vy[2] = m_y2; m_vx[3] = m_x1; m_vy[3] = m_y2; m_vx[4] = m_x1 + m_border_thickness; m_vy[4] = m_y1 + m_border_thickness; m_vx[5] = m_x1 + m_border_thickness; m_vy[5] = m_y2 - m_border_thickness; m_vx[6] = m_x2 - m_border_thickness; m_vy[6] = m_y2 - m_border_thickness; m_vx[7] = m_x2 - m_border_thickness; m_vy[7] = m_y1 + m_border_thickness; break; case 2: // pointer1 if(fabs(m_x2 - m_x1) > fabs(m_y2 - m_y1)) { m_ellipse.init(m_xs1 + (m_xs2 - m_xs1) * m_value1, (m_ys1 + m_ys2) / 2.0, m_y2 - m_y1, m_y2 - m_y1, 32); } else { m_ellipse.init((m_xs1 + m_xs2) / 2.0, m_ys1 + (m_ys2 - m_ys1) * m_value1, m_x2 - m_x1, m_x2 - m_x1, 32); } m_ellipse.rewind(0); break; case 3: // pointer2 if(fabs(m_x2 - m_x1) > fabs(m_y2 - m_y1)) { m_ellipse.init(m_xs1 + (m_xs2 - m_xs1) * m_value2, (m_ys1 + m_ys2) / 2.0, m_y2 - m_y1, m_y2 - m_y1, 32); } else { m_ellipse.init((m_xs1 + m_xs2) / 2.0, m_ys1 + (m_ys2 - m_ys1) * m_value2, m_x2 - m_x1, m_x2 - m_x1, 32); } m_ellipse.rewind(0); break; case 4: // slider m_vertex = 0; if(fabs(m_x2 - m_x1) > fabs(m_y2 - m_y1)) { m_vx[0] = m_xs1 + (m_xs2 - m_xs1) * m_value1; m_vy[0] = m_y1 - m_border_extra / 2.0; m_vx[1] = m_xs1 + (m_xs2 - m_xs1) * m_value2; m_vy[1] = m_vy[0]; m_vx[2] = m_vx[1]; m_vy[2] = m_y2 + m_border_extra / 2.0; m_vx[3] = m_vx[0]; m_vy[3] = m_vy[2]; } else { m_vx[0] = m_x1 - m_border_extra / 2.0; m_vy[0] = m_ys1 + (m_ys2 - m_ys1) * m_value1; m_vx[1] = m_vx[0]; m_vy[1] = m_ys1 + (m_ys2 - m_ys1) * m_value2; m_vx[2] = m_x2 + m_border_extra / 2.0; m_vy[2] = m_vy[1]; m_vx[3] = m_vx[2]; m_vy[3] = m_vy[0]; } break; } } //------------------------------------------------------------------------ unsigned scale_ctrl_impl::vertex(double* x, double* y) { unsigned cmd = path_cmd_line_to; switch(m_idx) { case 0: case 4: if(m_vertex == 0) cmd = path_cmd_move_to; if(m_vertex >= 4) cmd = path_cmd_stop; *x = m_vx[m_vertex]; *y = m_vy[m_vertex]; m_vertex++; break; case 1: if(m_vertex == 0 || m_vertex == 4) cmd = path_cmd_move_to; if(m_vertex >= 8) cmd = path_cmd_stop; *x = m_vx[m_vertex]; *y = m_vy[m_vertex]; m_vertex++; break; case 2: case 3: cmd = m_ellipse.vertex(x, y); break; default: cmd = path_cmd_stop; break; } if(!is_stop(cmd)) { transform_xy(x, y); } return cmd; } //------------------------------------------------------------------------ bool scale_ctrl_impl::in_rect(double x, double y) const { inverse_transform_xy(&x, &y); return x >= m_x1 && x <= m_x2 && y >= m_y1 && y <= m_y2; } //------------------------------------------------------------------------ bool scale_ctrl_impl::on_mouse_button_down(double x, double y) { inverse_transform_xy(&x, &y); double xp1; double xp2; double ys1; double ys2; double xp; double yp; if(fabs(m_x2 - m_x1) > fabs(m_y2 - m_y1)) { xp1 = m_xs1 + (m_xs2 - m_xs1) * m_value1; xp2 = m_xs1 + (m_xs2 - m_xs1) * m_value2; ys1 = m_y1 - m_border_extra / 2.0; ys2 = m_y2 + m_border_extra / 2.0; yp = (m_ys1 + m_ys2) / 2.0; if(x > xp1 && y > ys1 && x < xp2 && y < ys2) { m_pdx = xp1 - x; m_move_what = move_slider; return true; } //if(x < xp1 && calc_distance(x, y, xp1, yp) <= m_y2 - m_y1) if(calc_distance(x, y, xp1, yp) <= m_y2 - m_y1) { m_pdx = xp1 - x; m_move_what = move_value1; return true; } //if(x > xp2 && calc_distance(x, y, xp2, yp) <= m_y2 - m_y1) if(calc_distance(x, y, xp2, yp) <= m_y2 - m_y1) { m_pdx = xp2 - x; m_move_what = move_value2; return true; } } else { xp1 = m_x1 - m_border_extra / 2.0; xp2 = m_x2 + m_border_extra / 2.0; ys1 = m_ys1 + (m_ys2 - m_ys1) * m_value1; ys2 = m_ys1 + (m_ys2 - m_ys1) * m_value2; xp = (m_xs1 + m_xs2) / 2.0; if(x > xp1 && y > ys1 && x < xp2 && y < ys2) { m_pdy = ys1 - y; m_move_what = move_slider; return true; } //if(y < ys1 && calc_distance(x, y, xp, ys1) <= m_x2 - m_x1) if(calc_distance(x, y, xp, ys1) <= m_x2 - m_x1) { m_pdy = ys1 - y; m_move_what = move_value1; return true; } //if(y > ys2 && calc_distance(x, y, xp, ys2) <= m_x2 - m_x1) if(calc_distance(x, y, xp, ys2) <= m_x2 - m_x1) { m_pdy = ys2 - y; m_move_what = move_value2; return true; } } return false; } //------------------------------------------------------------------------ bool scale_ctrl_impl::on_mouse_move(double x, double y, bool button_flag) { inverse_transform_xy(&x, &y); if(!button_flag) { return on_mouse_button_up(x, y); } double xp = x + m_pdx; double yp = y + m_pdy; double dv; switch(m_move_what) { case move_value1: if(fabs(m_x2 - m_x1) > fabs(m_y2 - m_y1)) { m_value1 = (xp - m_xs1) / (m_xs2 - m_xs1); } else { m_value1 = (yp - m_ys1) / (m_ys2 - m_ys1); } if(m_value1 < 0.0) m_value1 = 0.0; if(m_value1 > m_value2 - m_min_d) m_value1 = m_value2 - m_min_d; return true; case move_value2: if(fabs(m_x2 - m_x1) > fabs(m_y2 - m_y1)) { m_value2 = (xp - m_xs1) / (m_xs2 - m_xs1); } else { m_value2 = (yp - m_ys1) / (m_ys2 - m_ys1); } if(m_value2 > 1.0) m_value2 = 1.0; if(m_value2 < m_value1 + m_min_d) m_value2 = m_value1 + m_min_d; return true; case move_slider: dv = m_value2 - m_value1; if(fabs(m_x2 - m_x1) > fabs(m_y2 - m_y1)) { m_value1 = (xp - m_xs1) / (m_xs2 - m_xs1); } else { m_value1 = (yp - m_ys1) / (m_ys2 - m_ys1); } m_value2 = m_value1 + dv; if(m_value1 < 0.0) { dv = m_value2 - m_value1; m_value1 = 0.0; m_value2 = m_value1 + dv; } if(m_value2 > 1.0) { dv = m_value2 - m_value1; m_value2 = 1.0; m_value1 = m_value2 - dv; } return true; } return false; } //------------------------------------------------------------------------ bool scale_ctrl_impl::on_mouse_button_up(double, double) { m_move_what = move_nothing; return false; } //------------------------------------------------------------------------ bool scale_ctrl_impl::on_arrow_keys(bool left, bool right, bool down, bool up) { /* if(right || up) { m_value += 0.005; if(m_value > 1.0) m_value = 1.0; return true; } if(left || down) { m_value -= 0.005; if(m_value < 0.0) m_value = 0.0; return true; } */ return false; } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/src/ctrl/agg_slider_ctrl.cpp����������������������������������������������������������0000644�0000000�0000000�00000024006�10703246330�020643� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #include <string.h> #include <stdio.h> #include "ctrl/agg_slider_ctrl.h" namespace agg { //------------------------------------------------------------------------ slider_ctrl_impl::slider_ctrl_impl(double x1, double y1, double x2, double y2, bool flip_y) : ctrl(x1, y1, x2, y2, flip_y), m_border_width(1.0), m_border_extra((y2 - y1) / 2), m_text_thickness(1.0), m_pdx(0.0), m_mouse_move(false), m_value(0.5), m_preview_value(0.5), m_min(0.0), m_max(1.0), m_num_steps(0), m_descending(false), m_text_poly(m_text) { m_label[0] = 0; calc_box(); } //------------------------------------------------------------------------ void slider_ctrl_impl::calc_box() { m_xs1 = m_x1 + m_border_width; m_ys1 = m_y1 + m_border_width; m_xs2 = m_x2 - m_border_width; m_ys2 = m_y2 - m_border_width; } //------------------------------------------------------------------------ bool slider_ctrl_impl::normalize_value(bool preview_value_flag) { bool ret = true; if(m_num_steps) { int step = int(m_preview_value * m_num_steps + 0.5); ret = m_value != step / double(m_num_steps); m_value = step / double(m_num_steps); } else { m_value = m_preview_value; } if(preview_value_flag) { m_preview_value = m_value; } return ret; } //------------------------------------------------------------------------ void slider_ctrl_impl::border_width(double t, double extra) { m_border_width = t; m_border_extra = extra; calc_box(); } //------------------------------------------------------------------------ void slider_ctrl_impl::value(double value) { m_preview_value = (value - m_min) / (m_max - m_min); if(m_preview_value > 1.0) m_preview_value = 1.0; if(m_preview_value < 0.0) m_preview_value = 0.0; normalize_value(true); } //------------------------------------------------------------------------ void slider_ctrl_impl::label(const char* fmt) { m_label[0] = 0; if(fmt) { unsigned len = strlen(fmt); if(len > 63) len = 63; memcpy(m_label, fmt, len); m_label[len] = 0; } } //------------------------------------------------------------------------ void slider_ctrl_impl::rewind(unsigned idx) { m_idx = idx; switch(idx) { default: case 0: // Background m_vertex = 0; m_vx[0] = m_x1 - m_border_extra; m_vy[0] = m_y1 - m_border_extra; m_vx[1] = m_x2 + m_border_extra; m_vy[1] = m_y1 - m_border_extra; m_vx[2] = m_x2 + m_border_extra; m_vy[2] = m_y2 + m_border_extra; m_vx[3] = m_x1 - m_border_extra; m_vy[3] = m_y2 + m_border_extra; break; case 1: // Triangle m_vertex = 0; if(m_descending) { m_vx[0] = m_x1; m_vy[0] = m_y1; m_vx[1] = m_x2; m_vy[1] = m_y1; m_vx[2] = m_x1; m_vy[2] = m_y2; m_vx[3] = m_x1; m_vy[3] = m_y1; } else { m_vx[0] = m_x1; m_vy[0] = m_y1; m_vx[1] = m_x2; m_vy[1] = m_y1; m_vx[2] = m_x2; m_vy[2] = m_y2; m_vx[3] = m_x1; m_vy[3] = m_y1; } break; case 2: m_text.text(m_label); if(m_label[0]) { char buf[256]; sprintf(buf, m_label, value()); m_text.text(buf); } m_text.start_point(m_x1, m_y1); m_text.size((m_y2 - m_y1) * 1.2, m_y2 - m_y1); m_text_poly.width(m_text_thickness); m_text_poly.line_join(round_join); m_text_poly.line_cap(round_cap); m_text_poly.rewind(0); break; case 3: // pointer preview m_ellipse.init(m_xs1 + (m_xs2 - m_xs1) * m_preview_value, (m_ys1 + m_ys2) / 2.0, m_y2 - m_y1, m_y2 - m_y1, 32); break; case 4: // pointer normalize_value(false); m_ellipse.init(m_xs1 + (m_xs2 - m_xs1) * m_value, (m_ys1 + m_ys2) / 2.0, m_y2 - m_y1, m_y2 - m_y1, 32); m_ellipse.rewind(0); break; case 5: m_storage.remove_all(); if(m_num_steps) { unsigned i; double d = (m_xs2 - m_xs1) / m_num_steps; if(d > 0.004) d = 0.004; for(i = 0; i < m_num_steps + 1; i++) { double x = m_xs1 + (m_xs2 - m_xs1) * i / m_num_steps; m_storage.move_to(x, m_y1); m_storage.line_to(x - d * (m_x2 - m_x1), m_y1 - m_border_extra); m_storage.line_to(x + d * (m_x2 - m_x1), m_y1 - m_border_extra); } } } } //------------------------------------------------------------------------ unsigned slider_ctrl_impl::vertex(double* x, double* y) { unsigned cmd = path_cmd_line_to; switch(m_idx) { case 0: if(m_vertex == 0) cmd = path_cmd_move_to; if(m_vertex >= 4) cmd = path_cmd_stop; *x = m_vx[m_vertex]; *y = m_vy[m_vertex]; m_vertex++; break; case 1: if(m_vertex == 0) cmd = path_cmd_move_to; if(m_vertex >= 4) cmd = path_cmd_stop; *x = m_vx[m_vertex]; *y = m_vy[m_vertex]; m_vertex++; break; case 2: cmd = m_text_poly.vertex(x, y); break; case 3: case 4: cmd = m_ellipse.vertex(x, y); break; case 5: cmd = m_storage.vertex(x, y); break; default: cmd = path_cmd_stop; break; } if(!is_stop(cmd)) { transform_xy(x, y); } return cmd; } //------------------------------------------------------------------------ bool slider_ctrl_impl::in_rect(double x, double y) const { inverse_transform_xy(&x, &y); return x >= m_x1 && x <= m_x2 && y >= m_y1 && y <= m_y2; } //------------------------------------------------------------------------ bool slider_ctrl_impl::on_mouse_button_down(double x, double y) { inverse_transform_xy(&x, &y); double xp = m_xs1 + (m_xs2 - m_xs1) * m_value; double yp = (m_ys1 + m_ys2) / 2.0; if(calc_distance(x, y, xp, yp) <= m_y2 - m_y1) { m_pdx = xp - x; m_mouse_move = true; return true; } return false; } //------------------------------------------------------------------------ bool slider_ctrl_impl::on_mouse_move(double x, double y, bool button_flag) { inverse_transform_xy(&x, &y); if(!button_flag) { on_mouse_button_up(x, y); return false; } if(m_mouse_move) { double xp = x + m_pdx; m_preview_value = (xp - m_xs1) / (m_xs2 - m_xs1); if(m_preview_value < 0.0) m_preview_value = 0.0; if(m_preview_value > 1.0) m_preview_value = 1.0; return true; } return false; } //------------------------------------------------------------------------ bool slider_ctrl_impl::on_mouse_button_up(double, double) { m_mouse_move = false; normalize_value(true); return true; } //------------------------------------------------------------------------ bool slider_ctrl_impl::on_arrow_keys(bool left, bool right, bool down, bool up) { double d = 0.005; if(m_num_steps) { d = 1.0 / m_num_steps; } if(right || up) { m_preview_value += d; if(m_preview_value > 1.0) m_preview_value = 1.0; normalize_value(true); return true; } if(left || down) { m_preview_value -= d; if(m_preview_value < 0.0) m_preview_value = 0.0; normalize_value(true); return true; } return false; } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/src/ctrl/agg_spline_ctrl.cpp����������������������������������������������������������0000644�0000000�0000000�00000026661�10703246330�020664� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #include "ctrl/agg_spline_ctrl.h" namespace agg { //------------------------------------------------------------------------ spline_ctrl_impl::spline_ctrl_impl(double x1, double y1, double x2, double y2, unsigned num_pnt, bool flip_y) : ctrl(x1, y1, x2, y2, flip_y), m_num_pnt(num_pnt), m_border_width(1.0), m_border_extra(0.0), m_curve_width(1.0), m_point_size(3.0), m_curve_poly(m_curve_pnt), m_idx(0), m_vertex(0), m_active_pnt(-1), m_move_pnt(-1), m_pdx(0.0), m_pdy(0.0) { if(m_num_pnt < 4) m_num_pnt = 4; if(m_num_pnt > 32) m_num_pnt = 32; unsigned i; for(i = 0; i < m_num_pnt; i++) { m_xp[i] = double(i) / double(m_num_pnt - 1); m_yp[i] = 0.5; } calc_spline_box(); update_spline(); } //------------------------------------------------------------------------ void spline_ctrl_impl::border_width(double t, double extra) { m_border_width = t; m_border_extra = extra; calc_spline_box(); } //------------------------------------------------------------------------ void spline_ctrl_impl::calc_spline_box() { m_xs1 = m_x1 + m_border_width; m_ys1 = m_y1 + m_border_width; m_xs2 = m_x2 - m_border_width; m_ys2 = m_y2 - m_border_width; } //------------------------------------------------------------------------ void spline_ctrl_impl::update_spline() { int i; m_spline.init(m_num_pnt, m_xp, m_yp); for(i = 0; i < 256; i++) { m_spline_values[i] = m_spline.get(double(i) / 255.0); if(m_spline_values[i] < 0.0) m_spline_values[i] = 0.0; if(m_spline_values[i] > 1.0) m_spline_values[i] = 1.0; m_spline_values8[i] = (int8u)(m_spline_values[i] * 255.0); } } //------------------------------------------------------------------------ void spline_ctrl_impl::calc_curve() { int i; m_curve_pnt.remove_all(); m_curve_pnt.move_to(m_xs1, m_ys1 + (m_ys2 - m_ys1) * m_spline_values[0]); for(i = 1; i < 256; i++) { m_curve_pnt.line_to(m_xs1 + (m_xs2 - m_xs1) * double(i) / 255.0, m_ys1 + (m_ys2 - m_ys1) * m_spline_values[i]); } } //------------------------------------------------------------------------ double spline_ctrl_impl::calc_xp(unsigned idx) { return m_xs1 + (m_xs2 - m_xs1) * m_xp[idx]; } //------------------------------------------------------------------------ double spline_ctrl_impl::calc_yp(unsigned idx) { return m_ys1 + (m_ys2 - m_ys1) * m_yp[idx]; } //------------------------------------------------------------------------ void spline_ctrl_impl::set_xp(unsigned idx, double val) { if(val < 0.0) val = 0.0; if(val > 1.0) val = 1.0; if(idx == 0) { val = 0.0; } else if(idx == m_num_pnt - 1) { val = 1.0; } else { if(val < m_xp[idx - 1] + 0.001) val = m_xp[idx - 1] + 0.001; if(val > m_xp[idx + 1] - 0.001) val = m_xp[idx + 1] - 0.001; } m_xp[idx] = val; } //------------------------------------------------------------------------ void spline_ctrl_impl::set_yp(unsigned idx, double val) { if(val < 0.0) val = 0.0; if(val > 1.0) val = 1.0; m_yp[idx] = val; } //------------------------------------------------------------------------ void spline_ctrl_impl::point(unsigned idx, double x, double y) { if(idx < m_num_pnt) { set_xp(idx, x); set_yp(idx, y); } } //------------------------------------------------------------------------ void spline_ctrl_impl::value(unsigned idx, double y) { if(idx < m_num_pnt) { set_yp(idx, y); } } //------------------------------------------------------------------------ double spline_ctrl_impl::value(double x) const { x = m_spline.get(x); if(x < 0.0) x = 0.0; if(x > 1.0) x = 1.0; return x; } //------------------------------------------------------------------------ void spline_ctrl_impl::rewind(unsigned idx) { unsigned i; m_idx = idx; switch(idx) { default: case 0: // Background m_vertex = 0; m_vx[0] = m_x1 - m_border_extra; m_vy[0] = m_y1 - m_border_extra; m_vx[1] = m_x2 + m_border_extra; m_vy[1] = m_y1 - m_border_extra; m_vx[2] = m_x2 + m_border_extra; m_vy[2] = m_y2 + m_border_extra; m_vx[3] = m_x1 - m_border_extra; m_vy[3] = m_y2 + m_border_extra; break; case 1: // Border m_vertex = 0; m_vx[0] = m_x1; m_vy[0] = m_y1; m_vx[1] = m_x2; m_vy[1] = m_y1; m_vx[2] = m_x2; m_vy[2] = m_y2; m_vx[3] = m_x1; m_vy[3] = m_y2; m_vx[4] = m_x1 + m_border_width; m_vy[4] = m_y1 + m_border_width; m_vx[5] = m_x1 + m_border_width; m_vy[5] = m_y2 - m_border_width; m_vx[6] = m_x2 - m_border_width; m_vy[6] = m_y2 - m_border_width; m_vx[7] = m_x2 - m_border_width; m_vy[7] = m_y1 + m_border_width; break; case 2: // Curve calc_curve(); m_curve_poly.width(m_curve_width); m_curve_poly.rewind(0); break; case 3: // Inactive points m_curve_pnt.remove_all(); for(i = 0; i < m_num_pnt; i++) { if(int(i) != m_active_pnt) { m_ellipse.init(calc_xp(i), calc_yp(i), m_point_size, m_point_size, 32); m_curve_pnt.concat_path(m_ellipse); } } m_curve_poly.rewind(0); break; case 4: // Active point m_curve_pnt.remove_all(); if(m_active_pnt >= 0) { m_ellipse.init(calc_xp(m_active_pnt), calc_yp(m_active_pnt), m_point_size, m_point_size, 32); m_curve_pnt.concat_path(m_ellipse); } m_curve_poly.rewind(0); break; } } //------------------------------------------------------------------------ unsigned spline_ctrl_impl::vertex(double* x, double* y) { unsigned cmd = path_cmd_line_to; switch(m_idx) { case 0: if(m_vertex == 0) cmd = path_cmd_move_to; if(m_vertex >= 4) cmd = path_cmd_stop; *x = m_vx[m_vertex]; *y = m_vy[m_vertex]; m_vertex++; break; case 1: if(m_vertex == 0 || m_vertex == 4) cmd = path_cmd_move_to; if(m_vertex >= 8) cmd = path_cmd_stop; *x = m_vx[m_vertex]; *y = m_vy[m_vertex]; m_vertex++; break; case 2: cmd = m_curve_poly.vertex(x, y); break; case 3: case 4: cmd = m_curve_pnt.vertex(x, y); break; default: cmd = path_cmd_stop; break; } if(!is_stop(cmd)) { transform_xy(x, y); } return cmd; } //------------------------------------------------------------------------ void spline_ctrl_impl::active_point(int i) { m_active_pnt = i; } //------------------------------------------------------------------------ bool spline_ctrl_impl::in_rect(double x, double y) const { inverse_transform_xy(&x, &y); return x >= m_x1 && x <= m_x2 && y >= m_y1 && y <= m_y2; } //------------------------------------------------------------------------ bool spline_ctrl_impl::on_mouse_button_down(double x, double y) { inverse_transform_xy(&x, &y); unsigned i; for(i = 0; i < m_num_pnt; i++) { double xp = calc_xp(i); double yp = calc_yp(i); if(calc_distance(x, y, xp, yp) <= m_point_size + 1) { m_pdx = xp - x; m_pdy = yp - y; m_active_pnt = m_move_pnt = int(i); return true; } } return false; } //------------------------------------------------------------------------ bool spline_ctrl_impl::on_mouse_button_up(double, double) { if(m_move_pnt >= 0) { m_move_pnt = -1; return true; } return false; } //------------------------------------------------------------------------ bool spline_ctrl_impl::on_mouse_move(double x, double y, bool button_flag) { inverse_transform_xy(&x, &y); if(!button_flag) { return on_mouse_button_up(x, y); } if(m_move_pnt >= 0) { double xp = x + m_pdx; double yp = y + m_pdy; set_xp(m_move_pnt, (xp - m_xs1) / (m_xs2 - m_xs1)); set_yp(m_move_pnt, (yp - m_ys1) / (m_ys2 - m_ys1)); update_spline(); return true; } return false; } //------------------------------------------------------------------------ bool spline_ctrl_impl::on_arrow_keys(bool left, bool right, bool down, bool up) { double kx = 0.0; double ky = 0.0; bool ret = false; if(m_active_pnt >= 0) { kx = m_xp[m_active_pnt]; ky = m_yp[m_active_pnt]; if(left) { kx -= 0.001; ret = true; } if(right) { kx += 0.001; ret = true; } if(down) { ky -= 0.001; ret = true; } if(up) { ky += 0.001; ret = true; } } if(ret) { set_xp(m_active_pnt, kx); set_yp(m_active_pnt, ky); update_spline(); } return ret; } } �������������������������������������������������������������������������������agg-2.5+dfsg1/src/install���������������������������������������������������������������������������0000644�0000000�0000000�00000000000�10703246330�015424� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/src/news������������������������������������������������������������������������������0000644�0000000�0000000�00000000000�10703246330�014732� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/src/platform/�������������������������������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�015671� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/src/platform/AmigaOS/�����������������������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�017151� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/src/platform/AmigaOS/Makefile.am������������������������������������������������������0000644�0000000�0000000�00000000044�10703246330�021203� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������EXTRA_DIST=agg_platform_support.cpp ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/src/platform/AmigaOS/agg_platform_support.cpp�����������������������������������������0000644�0000000�0000000�00000060214�10703246330�024116� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Copyright (C) 2004 Steven Solie // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #include "platform/agg_platform_support.h" #include "util/agg_color_conv_rgb8.h" #include <sys/time.h> #include <cstring> #include <classes/requester.h> #include <classes/window.h> #include <datatypes/pictureclass.h> #include <proto/exec.h> #include <proto/datatypes.h> #include <proto/dos.h> #include <proto/graphics.h> #include <proto/intuition.h> #include <proto/keymap.h> #include <proto/Picasso96API.h> #include <proto/utility.h> Library* DataTypesBase = 0; Library* GraphicsBase = 0; Library* IntuitionBase = 0; Library* KeymapBase = 0; Library* P96Base = 0; DataTypesIFace* IDataTypes = 0; GraphicsIFace* IGraphics = 0; IntuitionIFace* IIntuition = 0; KeymapIFace* IKeymap = 0; P96IFace* IP96 = 0; Class* RequesterClass = 0; Class* WindowClass = 0; namespace agg { void handle_idcmp(Hook* hook, APTR win, IntuiMessage* msg); //------------------------------------------------------------------------ class platform_specific { public: platform_specific(platform_support& support, pix_format_e format, bool flip_y); ~platform_specific(); bool handle_input(); bool load_img(const char* file, unsigned idx, rendering_buffer* rbuf); bool create_img(unsigned idx, rendering_buffer* rbuf, unsigned width, unsigned height); bool make_bitmap(); public: platform_support& m_support; RGBFTYPE m_ftype; pix_format_e m_format; unsigned m_bpp; BitMap* m_bitmap; bool m_flip_y; uint16 m_width; uint16 m_height; APTR m_window_obj; Window* m_window; Hook* m_idcmp_hook; unsigned m_input_flags; bool m_dragging; double m_start_time; uint16 m_last_key; BitMap* m_img_bitmaps[platform_support::max_images]; }; //------------------------------------------------------------------------ platform_specific::platform_specific(platform_support& support, pix_format_e format, bool flip_y) : m_support(support), m_ftype(RGBFB_NONE), m_format(format), m_bpp(0), m_bitmap(0), m_flip_y(flip_y), m_width(0), m_height(0), m_window_obj(0), m_window(0), m_idcmp_hook(0), m_input_flags(0), m_dragging(false), m_start_time(0.0), m_last_key(0) { switch ( format ) { case pix_format_gray8: // Not supported. break; case pix_format_rgb555: m_ftype = RGBFB_R5G5B5; m_bpp = 15; break; case pix_format_rgb565: m_ftype = RGBFB_R5G6B5; m_bpp = 16; break; case pix_format_rgb24: m_ftype = RGBFB_R8G8B8; m_bpp = 24; break; case pix_format_bgr24: m_ftype = RGBFB_B8G8R8; m_bpp = 24; break; case pix_format_bgra32: m_ftype = RGBFB_B8G8R8A8; m_bpp = 32; break; case pix_format_abgr32: m_ftype = RGBFB_A8B8G8R8; m_bpp = 32; break; case pix_format_argb32: m_ftype = RGBFB_A8R8G8B8; m_bpp = 32; break; case pix_format_rgba32: m_ftype = RGBFB_R8G8B8A8; m_bpp = 32; break; } for ( unsigned i = 0; i < platform_support::max_images; ++i ) { m_img_bitmaps[i] = 0; } } //------------------------------------------------------------------------ platform_specific::~platform_specific() { IIntuition->DisposeObject(m_window_obj); IP96->p96FreeBitMap(m_bitmap); for ( unsigned i = 0; i < platform_support::max_images; ++i ) { IP96->p96FreeBitMap(m_img_bitmaps[i]); } if ( m_idcmp_hook != 0 ) { IExec->FreeSysObject(ASOT_HOOK, m_idcmp_hook); } } //------------------------------------------------------------------------ bool platform_specific::handle_input() { int16 code = 0; uint32 result = 0; Object* obj = reinterpret_cast<Object*>(m_window_obj); while ( (result = IIntuition->IDoMethod(obj, WM_HANDLEINPUT, &code)) != WMHI_LASTMSG ) { switch ( result & WMHI_CLASSMASK ) { case WMHI_CLOSEWINDOW: return true; break; case WMHI_INTUITICK: if ( !m_support.wait_mode() ) { m_support.on_idle(); } break; case WMHI_NEWSIZE: if ( make_bitmap() ) { m_support.trans_affine_resizing(m_width, m_height); m_support.on_resize(m_width, m_height); m_support.force_redraw(); } break; } } return false; } //------------------------------------------------------------------------ bool platform_specific::load_img(const char* file, unsigned idx, rendering_buffer* rbuf) { if ( m_img_bitmaps[idx] != 0 ) { IP96->p96FreeBitMap(m_img_bitmaps[idx]); m_img_bitmaps[idx] = 0; } bool result = false; Object* picture = IDataTypes->NewDTObject(const_cast<STRPTR>(file), DTA_GroupID, GID_PICTURE, PDTA_DestMode, PMODE_V43, PDTA_Remap, FALSE, TAG_END); if ( picture != 0 ) { gpLayout layout; layout.MethodID = DTM_PROCLAYOUT; layout.gpl_GInfo = 0; layout.gpl_Initial = 1; ULONG loaded = IDataTypes->DoDTMethodA(picture, 0, 0, reinterpret_cast<Msg>(&layout)); if ( loaded != 0 ) { BitMap* src_bitmap = 0; IDataTypes->GetDTAttrs(picture, PDTA_ClassBitMap, &src_bitmap, TAG_END); bool supported = false; RGBFTYPE ftype = static_cast<RGBFTYPE>(IP96->p96GetBitMapAttr( src_bitmap, P96BMA_RGBFORMAT)); switch ( ftype ) { case RGBFB_R8G8B8: supported = true; break; default: m_support.message("File uses unsupported graphics mode."); break; } if ( supported ) { uint16 width = IP96->p96GetBitMapAttr(src_bitmap, P96BMA_WIDTH); uint16 height = IP96->p96GetBitMapAttr(src_bitmap, P96BMA_HEIGHT); m_img_bitmaps[idx] = IP96->p96AllocBitMap(width, height, m_bpp, BMF_USERPRIVATE, 0, m_ftype); if ( m_img_bitmaps[idx] != 0 ) { int8u* buf = reinterpret_cast<int8u*>( IP96->p96GetBitMapAttr(m_img_bitmaps[idx], P96BMA_MEMORY)); int bpr = IP96->p96GetBitMapAttr(m_img_bitmaps[idx], P96BMA_BYTESPERROW); int stride = (m_flip_y) ? -bpr : bpr; rbuf->attach(buf, width, height, stride); // P96 sets the alpha to zero so it can't be used to // color convert true color modes. if ( m_bpp == 32 ) { RenderInfo ri; int32 lock = IP96->p96LockBitMap(src_bitmap, reinterpret_cast<uint8*>(&ri), sizeof(RenderInfo)); rendering_buffer rbuf_src; rbuf_src.attach( reinterpret_cast<int8u*>(ri.Memory), width, height, (m_flip_y) ? -ri.BytesPerRow : ri.BytesPerRow); switch ( m_format ) { case pix_format_bgra32: color_conv(rbuf, &rbuf_src, color_conv_rgb24_to_bgra32()); break; case pix_format_abgr32: color_conv(rbuf, &rbuf_src, color_conv_rgb24_to_abgr32()); break; case pix_format_argb32: color_conv(rbuf, &rbuf_src, color_conv_rgb24_to_argb32()); break; case pix_format_rgba32: color_conv(rbuf, &rbuf_src, color_conv_rgb24_to_rgba32()); break; } IP96->p96UnlockBitMap(src_bitmap, lock); } else { IGraphics->BltBitMap(src_bitmap, 0, 0, m_img_bitmaps[idx], 0, 0, width, height, ABC|ABNC, 0xFF, 0); } result = true; } } } } IGraphics->WaitBlit(); IDataTypes->DisposeDTObject(picture); return result; } //------------------------------------------------------------------------ bool platform_specific::create_img(unsigned idx, rendering_buffer* rbuf, unsigned width, unsigned height) { if ( m_img_bitmaps[idx] != 0 ) { IP96->p96FreeBitMap(m_img_bitmaps[idx]); m_img_bitmaps[idx] = 0; } m_img_bitmaps[idx] = IP96->p96AllocBitMap(width, height, m_bpp, BMF_USERPRIVATE, m_bitmap, m_ftype); if ( m_img_bitmaps[idx] != 0 ) { int8u* buf = reinterpret_cast<int8u*>( IP96->p96GetBitMapAttr(m_img_bitmaps[idx], P96BMA_MEMORY)); int bpr = IP96->p96GetBitMapAttr(m_img_bitmaps[idx], P96BMA_BYTESPERROW); int stride = (m_flip_y) ? -bpr : bpr; rbuf->attach(buf, width, height, stride); return true; } return false; } //------------------------------------------------------------------------ bool platform_specific::make_bitmap() { uint32 width = 0; uint32 height = 0; IIntuition->GetWindowAttrs(m_window, WA_InnerWidth, &width, WA_InnerHeight, &height, TAG_END); BitMap* bm = IP96->p96AllocBitMap(width, height, m_bpp, BMF_USERPRIVATE|BMF_CLEAR, 0, m_ftype); if ( bm == 0 ) { return false; } int8u* buf = reinterpret_cast<int8u*>( IP96->p96GetBitMapAttr(bm, P96BMA_MEMORY)); int bpr = IP96->p96GetBitMapAttr(bm, P96BMA_BYTESPERROW); int stride = (m_flip_y) ? -bpr : bpr; m_support.rbuf_window().attach(buf, width, height, stride); if ( m_bitmap != 0 ) { IP96->p96FreeBitMap(m_bitmap); m_bitmap = 0; } m_bitmap = bm; m_width = width; m_height = height; return true; } //------------------------------------------------------------------------ platform_support::platform_support(pix_format_e format, bool flip_y) : m_specific(new platform_specific(*this, format, flip_y)), m_format(format), m_bpp(m_specific->m_bpp), m_window_flags(0), m_wait_mode(true), m_flip_y(flip_y), m_initial_width(10), m_initial_height(10) { std::strncpy(m_caption, "Anti-Grain Geometry", 256); } //------------------------------------------------------------------------ platform_support::~platform_support() { delete m_specific; } //------------------------------------------------------------------------ void platform_support::caption(const char* cap) { std::strncpy(m_caption, cap, 256); if ( m_specific->m_window != 0 ) { const char* ignore = reinterpret_cast<const char*>(-1); IIntuition->SetWindowAttr(m_specific->m_window, WA_Title, m_caption, sizeof(char*)); } } //------------------------------------------------------------------------ void platform_support::start_timer() { timeval tv; gettimeofday(&tv, 0); m_specific->m_start_time = tv.tv_secs + tv.tv_micro/1e6; } //------------------------------------------------------------------------ double platform_support::elapsed_time() const { timeval tv; gettimeofday(&tv, 0); double end_time = tv.tv_secs + tv.tv_micro/1e6; double elasped_seconds = end_time - m_specific->m_start_time; double elasped_millis = elasped_seconds*1e3; return elasped_millis; } //------------------------------------------------------------------------ void* platform_support::raw_display_handler() { return 0; // Not available. } //------------------------------------------------------------------------ void platform_support::message(const char* msg) { APTR req = IIntuition->NewObject(RequesterClass, 0, REQ_TitleText, "Anti-Grain Geometry", REQ_Image, REQIMAGE_INFO, REQ_BodyText, msg, REQ_GadgetText, "_Ok", TAG_END); if ( req == 0 ) { IDOS->Printf("Message: %s\n", msg); return; } orRequest reqmsg; reqmsg.MethodID = RM_OPENREQ; reqmsg.or_Attrs = 0; reqmsg.or_Window = m_specific->m_window; reqmsg.or_Screen = 0; IIntuition->IDoMethodA(reinterpret_cast<Object*>(req), reinterpret_cast<Msg>(&reqmsg)); IIntuition->DisposeObject(req); } //------------------------------------------------------------------------ bool platform_support::init(unsigned width, unsigned height, unsigned flags) { if( m_specific->m_ftype == RGBFB_NONE ) { message("Unsupported mode requested."); return false; } m_window_flags = flags; m_specific->m_idcmp_hook = reinterpret_cast<Hook*>( IExec->AllocSysObjectTags(ASOT_HOOK, ASOHOOK_Entry, handle_idcmp, ASOHOOK_Data, this, TAG_END)); if ( m_specific->m_idcmp_hook == 0 ) { return false; } m_specific->m_window_obj = IIntuition->NewObject(WindowClass, 0, WA_Title, m_caption, WA_AutoAdjustDClip, TRUE, WA_InnerWidth, width, WA_InnerHeight, height, WA_Activate, TRUE, WA_SmartRefresh, TRUE, WA_NoCareRefresh, TRUE, WA_CloseGadget, TRUE, WA_DepthGadget, TRUE, WA_SizeGadget, (flags & agg::window_resize) ? TRUE : FALSE, WA_DragBar, TRUE, WA_AutoAdjust, TRUE, WA_ReportMouse, TRUE, WA_RMBTrap, TRUE, WA_MouseQueue, 1, WA_IDCMP, IDCMP_NEWSIZE | IDCMP_MOUSEBUTTONS | IDCMP_MOUSEMOVE | IDCMP_RAWKEY | IDCMP_INTUITICKS, WINDOW_IDCMPHook, m_specific->m_idcmp_hook, WINDOW_IDCMPHookBits, IDCMP_MOUSEBUTTONS | IDCMP_MOUSEMOVE | IDCMP_RAWKEY, TAG_END); if ( m_specific->m_window_obj == 0 ) { return false; } Object* obj = reinterpret_cast<Object*>(m_specific->m_window_obj); m_specific->m_window = reinterpret_cast<Window*>(IIntuition->IDoMethod(obj, WM_OPEN)); if ( m_specific->m_window == 0 ) { return false; } RGBFTYPE ftype = static_cast<RGBFTYPE>(IP96->p96GetBitMapAttr( m_specific->m_window->RPort->BitMap, P96BMA_RGBFORMAT)); switch ( ftype ) { case RGBFB_A8R8G8B8: case RGBFB_B8G8R8A8: case RGBFB_R5G6B5PC: break; default: message("Unsupported screen mode.\n"); return false; } if ( !m_specific->make_bitmap() ) { return false; } m_initial_width = width; m_initial_height = height; on_init(); on_resize(width, height); force_redraw(); return true; } //------------------------------------------------------------------------ int platform_support::run() { uint32 window_mask = 0; IIntuition->GetAttr(WINDOW_SigMask, m_specific->m_window_obj, &window_mask); uint32 wait_mask = window_mask | SIGBREAKF_CTRL_C; bool done = false; while ( !done ) { uint32 sig_mask = IExec->Wait(wait_mask); if ( sig_mask & SIGBREAKF_CTRL_C ) { done = true; } else { done = m_specific->handle_input(); } } return 0; } //------------------------------------------------------------------------ const char* platform_support::img_ext() const { return ".bmp"; } //------------------------------------------------------------------------ const char* platform_support::full_file_name(const char* file_name) { return file_name; } //------------------------------------------------------------------------ bool platform_support::load_img(unsigned idx, const char* file) { if ( idx < max_images ) { static char fn[1024]; std::strncpy(fn, file, 1024); int len = std::strlen(fn); if ( len < 4 || std::strcmp(fn + len - 4, ".bmp") != 0 ) { std::strncat(fn, ".bmp", 1024); } return m_specific->load_img(fn, idx, &m_rbuf_img[idx]); } return false; } //------------------------------------------------------------------------ bool platform_support::save_img(unsigned idx, const char* file) { message("Not supported"); return false; } //------------------------------------------------------------------------ bool platform_support::create_img(unsigned idx, unsigned width, unsigned height) { if ( idx < max_images ) { if ( width == 0 ) { width = m_specific->m_width; } if ( height == 0 ) { height = m_specific->m_height; } return m_specific->create_img(idx, &m_rbuf_img[idx], width, height); } return false; } //------------------------------------------------------------------------ void platform_support::force_redraw() { on_draw(); update_window(); } //------------------------------------------------------------------------ void platform_support::update_window() { // Note this function does automatic color conversion. IGraphics->BltBitMapRastPort(m_specific->m_bitmap, 0, 0, m_specific->m_window->RPort, m_specific->m_window->BorderLeft, m_specific->m_window->BorderTop, m_specific->m_width, m_specific->m_height, ABC|ABNC); } //------------------------------------------------------------------------ void platform_support::on_init() {} void platform_support::on_resize(int sx, int sy) {} void platform_support::on_idle() {} void platform_support::on_mouse_move(int x, int y, unsigned flags) {} void platform_support::on_mouse_button_down(int x, int y, unsigned flags) {} void platform_support::on_mouse_button_up(int x, int y, unsigned flags) {} void platform_support::on_key(int x, int y, unsigned key, unsigned flags) {} void platform_support::on_ctrl_change() {} void platform_support::on_draw() {} void platform_support::on_post_draw(void* raw_handler) {} //------------------------------------------------------------------------ void handle_idcmp(Hook* hook, APTR obj, IntuiMessage* msg) { platform_support* app = reinterpret_cast<platform_support*>(hook->h_Data); Window* window = app->m_specific->m_window; int16 x = msg->MouseX - window->BorderLeft; int16 y = 0; if ( app->flip_y() ) { y = window->Height - window->BorderBottom - msg->MouseY; } else { y = msg->MouseY - window->BorderTop; } switch ( msg->Class ) { case IDCMP_MOUSEBUTTONS: if ( msg->Code & IECODE_UP_PREFIX ) { if ( msg->Code == SELECTUP ) { app->m_specific->m_input_flags = mouse_left; app->m_specific->m_dragging = false; } else if ( msg->Code == MENUUP ) { app->m_specific->m_input_flags = mouse_right; app->m_specific->m_dragging = false; } else { return; } if ( app->m_ctrls.on_mouse_button_up(x, y) ) { app->on_ctrl_change(); app->force_redraw(); } app->on_mouse_button_up(x, y, app->m_specific->m_input_flags); } else { if ( msg->Code == SELECTDOWN ) { app->m_specific->m_input_flags = mouse_left; app->m_specific->m_dragging = true; } else if ( msg->Code == MENUDOWN ) { app->m_specific->m_input_flags = mouse_right; app->m_specific->m_dragging = true; } else { return; } app->m_ctrls.set_cur(x, y); if ( app->m_ctrls.on_mouse_button_down(x, y) ) { app->on_ctrl_change(); app->force_redraw(); } else { if ( app->m_ctrls.in_rect(x, y) ) { if ( app->m_ctrls.set_cur(x, y) ) { app->on_ctrl_change(); app->force_redraw(); } } else { app->on_mouse_button_down(x, y, app->m_specific->m_input_flags); } } } break; case IDCMP_MOUSEMOVE: if ( app->m_specific->m_dragging ) { if ( app->m_ctrls.on_mouse_move(x, y, app->m_specific->m_input_flags & mouse_left) != 0 ) { app->on_ctrl_change(); app->force_redraw(); } else { if ( !app->m_ctrls.in_rect(x, y) ) { app->on_mouse_move(x, y, app->m_specific->m_input_flags); } } } break; case IDCMP_RAWKEY: { static InputEvent ie = { 0 }; ie.ie_Class = IECLASS_RAWKEY; ie.ie_Code = msg->Code; ie.ie_Qualifier = msg->Qualifier; static const unsigned BUF_SIZE = 16; static char key_buf[BUF_SIZE]; int16 num_chars = IKeymap->MapRawKey(&ie, key_buf, BUF_SIZE, 0); uint32 code = 0x00000000; switch ( num_chars ) { case 1: code = key_buf[0]; break; case 2: code = key_buf[0]<<8 | key_buf[1]; break; case 3: code = key_buf[0]<<16 | key_buf[1]<<8 | key_buf[2]; break; } uint16 key_code = 0; if ( num_chars == 1 ) { if ( code >= IECODE_ASCII_FIRST && code <= IECODE_ASCII_LAST ) { key_code = code; } } if ( key_code == 0 ) { switch ( code ) { case 0x00000008: key_code = key_backspace; break; case 0x00000009: key_code = key_tab; break; case 0x0000000D: key_code = key_return; break; case 0x0000001B: key_code = key_escape; break; case 0x0000007F: key_code = key_delete; break; case 0x00009B41: case 0x00009B54: key_code = key_up; break; case 0x00009B42: case 0x00009B53: key_code = key_down; break; case 0x00009B43: case 0x009B2040: key_code = key_right; break; case 0x00009B44: case 0x009B2041: key_code = key_left; break; case 0x009B307E: key_code = key_f1; break; case 0x009B317E: key_code = key_f2; break; case 0x009B327E: key_code = key_f3; break; case 0x009B337E: key_code = key_f4; break; case 0x009B347E: key_code = key_f5; break; case 0x009B357E: key_code = key_f6; break; case 0x009B367E: key_code = key_f7; break; case 0x009B377E: key_code = key_f8; break; case 0x009B387E: key_code = key_f9; break; case 0x009B397E: key_code = key_f10; break; case 0x009B3F7E: key_code = key_scrollock; break; } } if ( ie.ie_Code & IECODE_UP_PREFIX ) { if ( app->m_specific->m_last_key != 0 ) { bool left = (key_code == key_left) ? true : false; bool right = (key_code == key_right) ? true : false; bool down = (key_code == key_down) ? true : false; bool up = (key_code == key_up) ? true : false; if ( app->m_ctrls.on_arrow_keys(left, right, down, up) ) { app->on_ctrl_change(); app->force_redraw(); } else { app->on_key(x, y, app->m_specific->m_last_key, 0); } app->m_specific->m_last_key = 0; } } else { app->m_specific->m_last_key = key_code; } break; } default: break; } } } //---------------------------------------------------------------------------- int agg_main(int argc, char* argv[]); bool open_libs(); void close_libs(); //---------------------------------------------------------------------------- bool open_libs() { DataTypesBase = IExec->OpenLibrary("datatypes.library", 51); GraphicsBase = IExec->OpenLibrary("graphics.library", 51); IntuitionBase = IExec->OpenLibrary("intuition.library", 51); KeymapBase = IExec->OpenLibrary("keymap.library", 51); P96Base = IExec->OpenLibrary("Picasso96API.library", 2); IDataTypes = reinterpret_cast<DataTypesIFace*>( IExec->GetInterface(DataTypesBase, "main", 1, 0)); IGraphics = reinterpret_cast<GraphicsIFace*>( IExec->GetInterface(GraphicsBase, "main", 1, 0)); IIntuition = reinterpret_cast<IntuitionIFace*>( IExec->GetInterface(IntuitionBase, "main", 1, 0)); IKeymap = reinterpret_cast<KeymapIFace*>( IExec->GetInterface(KeymapBase, "main", 1, 0)); IP96 = reinterpret_cast<P96IFace*>( IExec->GetInterface(P96Base, "main", 1, 0)); if ( IDataTypes == 0 || IGraphics == 0 || IIntuition == 0 || IKeymap == 0 || IP96 == 0 ) { close_libs(); return false; } else { return true; } } //---------------------------------------------------------------------------- void close_libs() { IExec->DropInterface(reinterpret_cast<Interface*>(IP96)); IExec->DropInterface(reinterpret_cast<Interface*>(IKeymap)); IExec->DropInterface(reinterpret_cast<Interface*>(IIntuition)); IExec->DropInterface(reinterpret_cast<Interface*>(IGraphics)); IExec->DropInterface(reinterpret_cast<Interface*>(IDataTypes)); IExec->CloseLibrary(P96Base); IExec->CloseLibrary(KeymapBase); IExec->CloseLibrary(IntuitionBase); IExec->CloseLibrary(GraphicsBase); IExec->CloseLibrary(DataTypesBase); } //---------------------------------------------------------------------------- int main(int argc, char* argv[]) { if ( !open_libs() ) { IDOS->Printf("Can't open libraries.\n"); return -1; } ClassLibrary* requester = IIntuition->OpenClass("requester.class", 51, &RequesterClass); ClassLibrary* window = IIntuition->OpenClass("window.class", 51, &WindowClass); if ( requester == 0 || window == 0 ) { IDOS->Printf("Can't open classes.\n"); IIntuition->CloseClass(requester); IIntuition->CloseClass(window); close_libs(); return -1; } int rc = agg_main(argc, argv); IIntuition->CloseClass(window); IIntuition->CloseClass(requester); close_libs(); return rc; } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/src/platform/BeOS/��������������������������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�016461� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/src/platform/BeOS/Makefile.am���������������������������������������������������������0000644�0000000�0000000�00000000044�10703246330�020513� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������EXTRA_DIST=agg_platform_support.cpp ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/src/platform/BeOS/agg_platform_support.cpp��������������������������������������������0000644�0000000�0000000�00000072461�10703246330�023435� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Copyright (C) 2004 Stephan Assmus (superstippi@gmx.de) // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #include <new> #include <stdio.h> #include <Alert.h> #include <Application.h> #include <Bitmap.h> #include <Message.h> #include <MessageRunner.h> #include <Messenger.h> #include <Path.h> #include <Roster.h> #include <TranslationUtils.h> #include <View.h> #include <Window.h> #include <string.h> #include "platform/agg_platform_support.h" #include "util/agg_color_conv_rgb8.h" using std::nothrow; static void attach_buffer_to_BBitmap(agg::rendering_buffer& buffer, BBitmap* bitmap, bool flipY) { uint8* bits = (uint8*)bitmap->Bits(); uint32 width = bitmap->Bounds().IntegerWidth() + 1; uint32 height = bitmap->Bounds().IntegerHeight() + 1; int32 bpr = bitmap->BytesPerRow(); if (flipY) { // XXX: why don't I have to do this?!? // bits += bpr * (height - 1); bpr = -bpr; } buffer.attach(bits, width, height, bpr); } static color_space pix_format_to_color_space(agg::pix_format_e format) { color_space bitmapFormat = B_NO_COLOR_SPACE; switch (format) { case agg::pix_format_rgb555: bitmapFormat = B_RGB15; break; case agg::pix_format_rgb565: bitmapFormat = B_RGB16; break; case agg::pix_format_rgb24: case agg::pix_format_bgr24: bitmapFormat = B_RGB24; break; case agg::pix_format_rgba32: case agg::pix_format_argb32: case agg::pix_format_abgr32: case agg::pix_format_bgra32: bitmapFormat = B_RGBA32; break; } return bitmapFormat; } // #pragma mark - class AGGView : public BView { public: AGGView(BRect frame, agg::platform_support* agg, agg::pix_format_e format, bool flipY); virtual ~AGGView(); virtual void AttachedToWindow(); virtual void DetachedFromWindow(); virtual void MessageReceived(BMessage* message); virtual void Draw(BRect updateRect); virtual void FrameResized(float width, float height); virtual void KeyDown(const char* bytes, int32 numBytes); virtual void MouseDown(BPoint where); virtual void MouseMoved(BPoint where, uint32 transit, const BMessage* dragMesage); virtual void MouseUp(BPoint where); BBitmap* Bitmap() const; uint8 LastKeyDown() const; uint32 MouseButtons(); void Update(); void ForceRedraw(); unsigned GetKeyFlags(); private: BBitmap* fBitmap; agg::pix_format_e fFormat; bool fFlipY; agg::platform_support* fAGG; uint32 fMouseButtons; int32 fMouseX; int32 fMouseY; uint8 fLastKeyDown; bool fRedraw; BMessageRunner* fPulse; bigtime_t fLastPulse; bool fEnableTicks; }; AGGView::AGGView(BRect frame, agg::platform_support* agg, agg::pix_format_e format, bool flipY) : BView(frame, "AGG View", B_FOLLOW_ALL, B_FRAME_EVENTS | B_WILL_DRAW), fFormat(format), fFlipY(flipY), fAGG(agg), fMouseButtons(0), fMouseX(-1), fMouseY(-1), fLastKeyDown(0), fRedraw(true), fPulse(NULL), fLastPulse(0), fEnableTicks(true) { SetViewColor(B_TRANSPARENT_32_BIT); frame.OffsetTo(0.0, 0.0); fBitmap = new BBitmap(frame, 0, pix_format_to_color_space(fFormat)); if (fBitmap->IsValid()) { attach_buffer_to_BBitmap(fAGG->rbuf_window(), fBitmap, fFlipY); } else { delete fBitmap; fBitmap = NULL; } } AGGView::~AGGView() { delete fBitmap; delete fPulse; } void AGGView::AttachedToWindow() { BMessage message('tick'); BMessenger target(this, Looper()); delete fPulse; // BScreen screen; // TODO: calc screen retrace fPulse = new BMessageRunner(target, &message, 40000); // make sure we call this once fAGG->on_resize(Bounds().IntegerWidth() + 1, Bounds().IntegerHeight() + 1); MakeFocus(); } void AGGView::DetachedFromWindow() { delete fPulse; fPulse = NULL; } void AGGView::MessageReceived(BMessage* message) { bigtime_t now = system_time(); switch (message->what) { case 'tick': // drop messages that have piled up if (/*now - fLastPulse > 30000*/fEnableTicks) { fLastPulse = now; if (!fAGG->wait_mode()) fAGG->on_idle(); Window()->PostMessage('entk', this); fEnableTicks = false; } else { // printf("dropping tick message (%lld)\n", now - fLastPulse); } break; case 'entk': fEnableTicks = true; if (now - fLastPulse > 30000) { fLastPulse = now; if (!fAGG->wait_mode()) fAGG->on_idle(); } break; default: BView::MessageReceived(message); break; } } void AGGView::Draw(BRect updateRect) { if (fBitmap) { if (fRedraw) { fAGG->on_draw(); fRedraw = false; } if (fFormat == agg::pix_format_bgra32) { DrawBitmap(fBitmap, updateRect, updateRect); } else { BBitmap* bitmap = new BBitmap(fBitmap->Bounds(), 0, B_RGBA32); agg::rendering_buffer rbufSrc; attach_buffer_to_BBitmap(rbufSrc, fBitmap, false); agg::rendering_buffer rbufDst; attach_buffer_to_BBitmap(rbufDst, bitmap, false); switch(fFormat) { case agg::pix_format_rgb555: agg::color_conv(&rbufDst, &rbufSrc, agg::color_conv_rgb555_to_bgra32()); break; case agg::pix_format_rgb565: agg::color_conv(&rbufDst, &rbufSrc, agg::color_conv_rgb565_to_bgra32()); break; case agg::pix_format_rgb24: agg::color_conv(&rbufDst, &rbufSrc, agg::color_conv_rgb24_to_bgra32()); break; case agg::pix_format_bgr24: agg::color_conv(&rbufDst, &rbufSrc, agg::color_conv_bgr24_to_bgra32()); break; case agg::pix_format_rgba32: agg::color_conv(&rbufDst, &rbufSrc, agg::color_conv_rgba32_to_bgra32()); break; case agg::pix_format_argb32: agg::color_conv(&rbufDst, &rbufSrc, agg::color_conv_argb32_to_bgra32()); break; case agg::pix_format_abgr32: agg::color_conv(&rbufDst, &rbufSrc, agg::color_conv_abgr32_to_bgra32()); break; case agg::pix_format_bgra32: agg::color_conv(&rbufDst, &rbufSrc, agg::color_conv_bgra32_to_bgra32()); break; } DrawBitmap(bitmap, updateRect, updateRect); delete bitmap; } } else { FillRect(updateRect); } } void AGGView::FrameResized(float width, float height) { BRect r(0.0, 0.0, width, height); BBitmap* bitmap = new BBitmap(r, 0, pix_format_to_color_space(fFormat)); if (bitmap->IsValid()) { delete fBitmap; fBitmap = bitmap; attach_buffer_to_BBitmap(fAGG->rbuf_window(), fBitmap, fFlipY); fAGG->trans_affine_resizing((int)width + 1, (int)height + 1); // pass the event on to AGG fAGG->on_resize((int)width + 1, (int)height + 1); fRedraw = true; Invalidate(); } else delete bitmap; } void AGGView::KeyDown(const char* bytes, int32 numBytes) { if (bytes && numBytes > 0) { fLastKeyDown = bytes[0]; bool left = false; bool up = false; bool right = false; bool down = false; switch (fLastKeyDown) { case B_LEFT_ARROW: left = true; break; case B_UP_ARROW: up = true; break; case B_RIGHT_ARROW: right = true; break; case B_DOWN_ARROW: down = true; break; } /* case key_f2: fAGG->copy_window_to_img(agg::platform_support::max_images - 1); fAGG->save_img(agg::platform_support::max_images - 1, "screenshot"); break; }*/ if (fAGG->m_ctrls.on_arrow_keys(left, right, down, up)) { fAGG->on_ctrl_change(); fAGG->force_redraw(); } else { fAGG->on_key(fMouseX, fMouseY, fLastKeyDown, GetKeyFlags()); } // fAGG->on_key(fMouseX, fMouseY, fLastKeyDown, GetKeyFlags()); } } void AGGView::MouseDown(BPoint where) { BMessage* currentMessage = Window()->CurrentMessage(); if (currentMessage) { if (currentMessage->FindInt32("buttons", (int32*)&fMouseButtons) < B_OK) fMouseButtons = B_PRIMARY_MOUSE_BUTTON; } else fMouseButtons = B_PRIMARY_MOUSE_BUTTON; fMouseX = (int)where.x; fMouseY = fFlipY ? (int)(Bounds().Height() - where.y) : (int)where.y; // pass the event on to AGG if (fMouseButtons == B_PRIMARY_MOUSE_BUTTON) { // left mouse button -> see if to handle in controls fAGG->m_ctrls.set_cur(fMouseX, fMouseY); if (fAGG->m_ctrls.on_mouse_button_down(fMouseX, fMouseY)) { fAGG->on_ctrl_change(); fAGG->force_redraw(); } else { if (fAGG->m_ctrls.in_rect(fMouseX, fMouseY)) { if (fAGG->m_ctrls.set_cur(fMouseX, fMouseY)) { fAGG->on_ctrl_change(); fAGG->force_redraw(); } } else { fAGG->on_mouse_button_down(fMouseX, fMouseY, GetKeyFlags()); } } } else if (fMouseButtons & B_SECONDARY_MOUSE_BUTTON) { // right mouse button -> simple fAGG->on_mouse_button_down(fMouseX, fMouseY, GetKeyFlags()); } SetMouseEventMask(B_POINTER_EVENTS, B_LOCK_WINDOW_FOCUS); } void AGGView::MouseMoved(BPoint where, uint32 transit, const BMessage* dragMesage) { // workarround missed mouse up events // (if we react too slowly, app_server might have dropped events) BMessage* currentMessage = Window()->CurrentMessage(); int32 buttons = 0; if (currentMessage->FindInt32("buttons", &buttons) < B_OK) { buttons = 0; } if (!buttons) MouseUp(where); fMouseX = (int)where.x; fMouseY = fFlipY ? (int)(Bounds().Height() - where.y) : (int)where.y; // pass the event on to AGG if (fAGG->m_ctrls.on_mouse_move(fMouseX, fMouseY, (GetKeyFlags() & agg::mouse_left) != 0)) { fAGG->on_ctrl_change(); fAGG->force_redraw(); } else { if (!fAGG->m_ctrls.in_rect(fMouseX, fMouseY)) { fAGG->on_mouse_move(fMouseX, fMouseY, GetKeyFlags()); } } } void AGGView::MouseUp(BPoint where) { fMouseX = (int)where.x; fMouseY = fFlipY ? (int)(Bounds().Height() - where.y) : (int)where.y; // pass the event on to AGG if (fMouseButtons == B_PRIMARY_MOUSE_BUTTON) { fMouseButtons = 0; if (fAGG->m_ctrls.on_mouse_button_up(fMouseX, fMouseY)) { fAGG->on_ctrl_change(); fAGG->force_redraw(); } fAGG->on_mouse_button_up(fMouseX, fMouseY, GetKeyFlags()); } else if (fMouseButtons == B_SECONDARY_MOUSE_BUTTON) { fMouseButtons = 0; fAGG->on_mouse_button_up(fMouseX, fMouseY, GetKeyFlags()); } } BBitmap* AGGView::Bitmap() const { return fBitmap; } uint8 AGGView::LastKeyDown() const { return fLastKeyDown; } uint32 AGGView::MouseButtons() { uint32 buttons = 0; if (LockLooper()) { buttons = fMouseButtons; UnlockLooper(); } return buttons; } void AGGView::Update() { // trigger display update if (LockLooper()) { Invalidate(); UnlockLooper(); } } void AGGView::ForceRedraw() { // force a redraw (fRedraw = true;) // and trigger display update if (LockLooper()) { fRedraw = true; Invalidate(); UnlockLooper(); } } unsigned AGGView::GetKeyFlags() { uint32 buttons = fMouseButtons; uint32 mods = modifiers(); unsigned flags = 0; if (buttons & B_PRIMARY_MOUSE_BUTTON) flags |= agg::mouse_left; if (buttons & B_SECONDARY_MOUSE_BUTTON) flags |= agg::mouse_right; if (mods & B_SHIFT_KEY) flags |= agg::kbd_shift; if (mods & B_COMMAND_KEY) flags |= agg::kbd_ctrl; return flags; } // #pragma mark - class AGGWindow : public BWindow { public: AGGWindow() : BWindow(BRect(-50.0, -50.0, -10.0, -10.0), "AGG Application", B_TITLED_WINDOW, B_ASYNCHRONOUS_CONTROLS) { } virtual bool QuitRequested() { be_app->PostMessage(B_QUIT_REQUESTED); return true; } bool Init(BRect frame, agg::platform_support* agg, agg::pix_format_e format, bool flipY, uint32 flags) { MoveTo(frame.LeftTop()); ResizeTo(frame.Width(), frame.Height()); SetFlags(flags); frame.OffsetTo(0.0, 0.0); fView = new AGGView(frame, agg, format, flipY); AddChild(fView); return fView->Bitmap() != NULL; } AGGView* View() const { return fView; } private: AGGView* fView; }; // #pragma mark - class AGGApplication : public BApplication { public: AGGApplication() : BApplication("application/x-vnd.AGG-AGG") { fWindow = new AGGWindow(); } virtual void ReadyToRun() { if (fWindow) { fWindow->Show(); } } virtual bool Init(agg::platform_support* agg, int width, int height, agg::pix_format_e format, bool flipY, uint32 flags) { BRect r(50.0, 50.0, 50.0 + width - 1.0, 50.0 + height - 1.0); uint32 windowFlags = B_ASYNCHRONOUS_CONTROLS; if (!(flags & agg::window_resize)) windowFlags |= B_NOT_RESIZABLE; return fWindow->Init(r, agg, format, flipY, windowFlags);; } AGGWindow* Window() const { return fWindow; } private: AGGWindow* fWindow; }; // #pragma mark - namespace agg { class platform_specific { public: platform_specific(agg::platform_support* agg, agg::pix_format_e format, bool flip_y) : fAGG(agg), fApp(NULL), fFormat(format), fFlipY(flip_y), fTimerStart(system_time()) { memset(fImages, 0, sizeof(fImages)); fApp = new AGGApplication(); fAppPath[0] = 0; // figure out where we're running from app_info info; status_t ret = fApp->GetAppInfo(&info); if (ret >= B_OK) { BPath path(&info.ref); ret = path.InitCheck(); if (ret >= B_OK) { ret = path.GetParent(&path); if (ret >= B_OK) { sprintf(fAppPath, "%s", path.Path()); } else { fprintf(stderr, "getting app parent folder failed: %s\n", strerror(ret)); } } else { fprintf(stderr, "making app path failed: %s\n", strerror(ret)); } } else { fprintf(stderr, "GetAppInfo() failed: %s\n", strerror(ret)); } } ~platform_specific() { for (int32 i = 0; i < agg::platform_support::max_images; i++) delete fImages[i]; delete fApp; } bool Init(int width, int height, unsigned flags) { return fApp->Init(fAGG, width, height, fFormat, fFlipY, flags); } int Run() { status_t ret = B_NO_INIT; if (fApp) { fApp->Run(); ret = B_OK; } return ret; } void SetTitle(const char* title) { if (fApp && fApp->Window() && fApp->Window()->Lock()) { fApp->Window()->SetTitle(title); fApp->Window()->Unlock(); } } void StartTimer() { fTimerStart = system_time(); } double ElapsedTime() const { return (system_time() - fTimerStart) / 1000.0; } void ForceRedraw() { fApp->Window()->View()->ForceRedraw(); } void UpdateWindow() { fApp->Window()->View()->Update(); } agg::platform_support* fAGG; AGGApplication* fApp; agg::pix_format_e fFormat; bool fFlipY; bigtime_t fTimerStart; BBitmap* fImages[agg::platform_support::max_images]; char fAppPath[B_PATH_NAME_LENGTH]; char fFilePath[B_PATH_NAME_LENGTH]; }; //------------------------------------------------------------------------ platform_support::platform_support(pix_format_e format, bool flip_y) : m_specific(new platform_specific(this, format, flip_y)), m_format(format), m_bpp(32/*m_specific->m_bpp*/), m_window_flags(0), m_wait_mode(true), m_flip_y(flip_y), m_initial_width(10), m_initial_height(10) { strcpy(m_caption, "Anti-Grain Geometry Application"); } //------------------------------------------------------------------------ platform_support::~platform_support() { delete m_specific; } //------------------------------------------------------------------------ void platform_support::caption(const char* cap) { strcpy(m_caption, cap); m_specific->SetTitle(cap); } //------------------------------------------------------------------------ void platform_support::start_timer() { m_specific->StartTimer(); } //------------------------------------------------------------------------ double platform_support::elapsed_time() const { return m_specific->ElapsedTime(); } //------------------------------------------------------------------------ void* platform_support::raw_display_handler() { // TODO: if we ever support BDirectWindow here, that would // be the frame buffer pointer with offset to the window top left return NULL; } //------------------------------------------------------------------------ void platform_support::message(const char* msg) { BAlert* alert = new BAlert("AGG Message", msg, "Ok"); alert->Go(/*NULL*/); } //------------------------------------------------------------------------ bool platform_support::init(unsigned width, unsigned height, unsigned flags) { m_initial_width = width; m_initial_height = height; m_window_flags = flags; if (m_specific->Init(width, height, flags)) { on_init(); return true; } return false; } //------------------------------------------------------------------------ int platform_support::run() { return m_specific->Run(); } //------------------------------------------------------------------------ const char* platform_support::img_ext() const { return ".ppm"; } const char* platform_support::full_file_name(const char* file_name) { sprintf(m_specific->fFilePath, "%s/%s", m_specific->fAppPath, file_name); return m_specific->fFilePath; } //------------------------------------------------------------------------ bool platform_support::load_img(unsigned idx, const char* file) { if (idx < max_images) { char path[B_PATH_NAME_LENGTH]; sprintf(path, "%s/%s%s", m_specific->fAppPath, file, img_ext()); BBitmap* transBitmap = BTranslationUtils::GetBitmap(path); if (transBitmap && transBitmap->IsValid()) { if(transBitmap->ColorSpace() != B_RGB32 && transBitmap->ColorSpace() != B_RGBA32) { // ups we got a smart ass Translator making our live harder delete transBitmap; return false; } color_space format = B_RGB24; switch (m_format) { case pix_format_gray8: format = B_GRAY8; break; case pix_format_rgb555: format = B_RGB15; break; case pix_format_rgb565: format = B_RGB16; break; case pix_format_rgb24: format = B_RGB24_BIG; break; case pix_format_bgr24: format = B_RGB24; break; case pix_format_abgr32: case pix_format_argb32: case pix_format_bgra32: format = B_RGB32; break; case pix_format_rgba32: format = B_RGB32_BIG; break; } BBitmap* bitmap = new (nothrow) BBitmap(transBitmap->Bounds(), 0, format); if (!bitmap || !bitmap->IsValid()) { fprintf(stderr, "failed to allocate temporary bitmap!\n"); delete transBitmap; delete bitmap; return false; } delete m_specific->fImages[idx]; rendering_buffer rbuf_tmp; attach_buffer_to_BBitmap(rbuf_tmp, transBitmap, m_flip_y); m_specific->fImages[idx] = bitmap; attach_buffer_to_BBitmap(m_rbuf_img[idx], bitmap, m_flip_y); rendering_buffer* dst = &m_rbuf_img[idx]; switch(m_format) { case pix_format_gray8: return false; // color_conv(dst, &rbuf_tmp, color_conv_bgra32_to_gray8()); break; break; case pix_format_rgb555: color_conv(dst, &rbuf_tmp, color_conv_bgra32_to_rgb555()); break; break; case pix_format_rgb565: color_conv(dst, &rbuf_tmp, color_conv_bgra32_to_rgb565()); break; break; case pix_format_rgb24: color_conv(dst, &rbuf_tmp, color_conv_bgra32_to_rgb24()); break; break; case pix_format_bgr24: color_conv(dst, &rbuf_tmp, color_conv_bgra32_to_bgr24()); break; break; case pix_format_abgr32: color_conv(dst, &rbuf_tmp, color_conv_bgra32_to_abgr32()); break; break; case pix_format_argb32: color_conv(dst, &rbuf_tmp, color_conv_bgra32_to_argb32()); break; break; case pix_format_bgra32: color_conv(dst, &rbuf_tmp, color_conv_bgra32_to_bgra32()); break; break; case pix_format_rgba32: color_conv(dst, &rbuf_tmp, color_conv_bgra32_to_rgba32()); break; break; } delete transBitmap; return true; } else { fprintf(stderr, "failed to load bitmap: '%s'\n", full_file_name(file)); } } return false; } //------------------------------------------------------------------------ bool platform_support::save_img(unsigned idx, const char* file) { // TODO: implement using BTranslatorRoster and friends return false; } //------------------------------------------------------------------------ bool platform_support::create_img(unsigned idx, unsigned width, unsigned height) { if(idx < max_images) { if(width == 0) width = m_specific->fApp->Window()->View()->Bitmap()->Bounds().IntegerWidth() + 1; if(height == 0) height = m_specific->fApp->Window()->View()->Bitmap()->Bounds().IntegerHeight() + 1; BBitmap* bitmap = new BBitmap(BRect(0.0, 0.0, width - 1, height - 1), 0, B_RGBA32);; if (bitmap && bitmap->IsValid()) { delete m_specific->fImages[idx]; m_specific->fImages[idx] = bitmap; attach_buffer_to_BBitmap(m_rbuf_img[idx], bitmap, m_flip_y); return true; } else { delete bitmap; } } return false; } //------------------------------------------------------------------------ void platform_support::force_redraw() { m_specific->ForceRedraw(); } //------------------------------------------------------------------------ void platform_support::update_window() { m_specific->UpdateWindow(); } //------------------------------------------------------------------------ void platform_support::on_init() {} void platform_support::on_resize(int sx, int sy) {} void platform_support::on_idle() {} void platform_support::on_mouse_move(int x, int y, unsigned flags) {} void platform_support::on_mouse_button_down(int x, int y, unsigned flags) {} void platform_support::on_mouse_button_up(int x, int y, unsigned flags) {} void platform_support::on_key(int x, int y, unsigned key, unsigned flags) {} void platform_support::on_ctrl_change() {} void platform_support::on_draw() {} void platform_support::on_post_draw(void* raw_handler) {} } //---------------------------------------------------------------------------- int agg_main(int argc, char* argv[]); int main(int argc, char* argv[]) { return agg_main(argc, argv); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/src/platform/Makefile.am��������������������������������������������������������������0000644�0000000�0000000�00000000051�10703246330�017721� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������SUBDIRS = X11 sdl win32 AmigaOS BeOS mac ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/src/platform/X11/���������������������������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�016242� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/src/platform/X11/Makefile.am����������������������������������������������������������0000644�0000000�0000000�00000000460�10703246330�020276� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������if ENABLE_X11 lib_LTLIBRARIES = libaggplatformX11.la libaggplatformX11_la_LDFLAGS = -version-info @AGG_LIB_VERSION@ -L@x_libraries@ libaggplatformX11_la_SOURCES = agg_platform_support.cpp libaggplatformX11_la_CXXFLAGS = -I$(top_srcdir)/include -I@x_includes@ libaggplatformX11_la_LIBADD = -lX11 endif ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/src/platform/X11/agg_platform_support.cpp���������������������������������������������0000644�0000000�0000000�00000141252�10703246330�023211� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #include <stdio.h> #include <string.h> #include <stdlib.h> #include <ctype.h> #include <time.h> #include <X11/Xlib.h> #include <X11/Xutil.h> #include <X11/Xatom.h> #include <X11/keysym.h> #include "agg_basics.h" #include "util/agg_color_conv_rgb8.h" #include "platform/agg_platform_support.h" namespace agg { //------------------------------------------------------------------------ class platform_specific { public: platform_specific(pix_format_e format, bool flip_y); ~platform_specific(); void caption(const char* capt); void put_image(const rendering_buffer* src); pix_format_e m_format; pix_format_e m_sys_format; int m_byte_order; bool m_flip_y; unsigned m_bpp; unsigned m_sys_bpp; Display* m_display; int m_screen; int m_depth; Visual* m_visual; Window m_window; GC m_gc; XImage* m_ximg_window; XSetWindowAttributes m_window_attributes; Atom m_close_atom; unsigned char* m_buf_window; unsigned char* m_buf_img[platform_support::max_images]; unsigned m_keymap[256]; bool m_update_flag; bool m_resize_flag; bool m_initialized; //bool m_wait_mode; clock_t m_sw_start; }; //------------------------------------------------------------------------ platform_specific::platform_specific(pix_format_e format, bool flip_y) : m_format(format), m_sys_format(pix_format_undefined), m_byte_order(LSBFirst), m_flip_y(flip_y), m_bpp(0), m_sys_bpp(0), m_display(0), m_screen(0), m_depth(0), m_visual(0), m_window(0), m_gc(0), m_ximg_window(0), m_close_atom(0), m_buf_window(0), m_update_flag(true), m_resize_flag(true), m_initialized(false) //m_wait_mode(true) { memset(m_buf_img, 0, sizeof(m_buf_img)); unsigned i; for(i = 0; i < 256; i++) { m_keymap[i] = i; } m_keymap[XK_Pause&0xFF] = key_pause; m_keymap[XK_Clear&0xFF] = key_clear; m_keymap[XK_KP_0&0xFF] = key_kp0; m_keymap[XK_KP_1&0xFF] = key_kp1; m_keymap[XK_KP_2&0xFF] = key_kp2; m_keymap[XK_KP_3&0xFF] = key_kp3; m_keymap[XK_KP_4&0xFF] = key_kp4; m_keymap[XK_KP_5&0xFF] = key_kp5; m_keymap[XK_KP_6&0xFF] = key_kp6; m_keymap[XK_KP_7&0xFF] = key_kp7; m_keymap[XK_KP_8&0xFF] = key_kp8; m_keymap[XK_KP_9&0xFF] = key_kp9; m_keymap[XK_KP_Insert&0xFF] = key_kp0; m_keymap[XK_KP_End&0xFF] = key_kp1; m_keymap[XK_KP_Down&0xFF] = key_kp2; m_keymap[XK_KP_Page_Down&0xFF] = key_kp3; m_keymap[XK_KP_Left&0xFF] = key_kp4; m_keymap[XK_KP_Begin&0xFF] = key_kp5; m_keymap[XK_KP_Right&0xFF] = key_kp6; m_keymap[XK_KP_Home&0xFF] = key_kp7; m_keymap[XK_KP_Up&0xFF] = key_kp8; m_keymap[XK_KP_Page_Up&0xFF] = key_kp9; m_keymap[XK_KP_Delete&0xFF] = key_kp_period; m_keymap[XK_KP_Decimal&0xFF] = key_kp_period; m_keymap[XK_KP_Divide&0xFF] = key_kp_divide; m_keymap[XK_KP_Multiply&0xFF] = key_kp_multiply; m_keymap[XK_KP_Subtract&0xFF] = key_kp_minus; m_keymap[XK_KP_Add&0xFF] = key_kp_plus; m_keymap[XK_KP_Enter&0xFF] = key_kp_enter; m_keymap[XK_KP_Equal&0xFF] = key_kp_equals; m_keymap[XK_Up&0xFF] = key_up; m_keymap[XK_Down&0xFF] = key_down; m_keymap[XK_Right&0xFF] = key_right; m_keymap[XK_Left&0xFF] = key_left; m_keymap[XK_Insert&0xFF] = key_insert; m_keymap[XK_Home&0xFF] = key_delete; m_keymap[XK_End&0xFF] = key_end; m_keymap[XK_Page_Up&0xFF] = key_page_up; m_keymap[XK_Page_Down&0xFF] = key_page_down; m_keymap[XK_F1&0xFF] = key_f1; m_keymap[XK_F2&0xFF] = key_f2; m_keymap[XK_F3&0xFF] = key_f3; m_keymap[XK_F4&0xFF] = key_f4; m_keymap[XK_F5&0xFF] = key_f5; m_keymap[XK_F6&0xFF] = key_f6; m_keymap[XK_F7&0xFF] = key_f7; m_keymap[XK_F8&0xFF] = key_f8; m_keymap[XK_F9&0xFF] = key_f9; m_keymap[XK_F10&0xFF] = key_f10; m_keymap[XK_F11&0xFF] = key_f11; m_keymap[XK_F12&0xFF] = key_f12; m_keymap[XK_F13&0xFF] = key_f13; m_keymap[XK_F14&0xFF] = key_f14; m_keymap[XK_F15&0xFF] = key_f15; m_keymap[XK_Num_Lock&0xFF] = key_numlock; m_keymap[XK_Caps_Lock&0xFF] = key_capslock; m_keymap[XK_Scroll_Lock&0xFF] = key_scrollock; switch(m_format) { default: break; case pix_format_gray8: m_bpp = 8; break; case pix_format_rgb565: case pix_format_rgb555: m_bpp = 16; break; case pix_format_rgb24: case pix_format_bgr24: m_bpp = 24; break; case pix_format_bgra32: case pix_format_abgr32: case pix_format_argb32: case pix_format_rgba32: m_bpp = 32; break; } m_sw_start = clock(); } //------------------------------------------------------------------------ platform_specific::~platform_specific() { } //------------------------------------------------------------------------ void platform_specific::caption(const char* capt) { XTextProperty tp; tp.value = (unsigned char *)capt; tp.encoding = XA_WM_NAME; tp.format = 8; tp.nitems = strlen(capt); XSetWMName(m_display, m_window, &tp); XStoreName(m_display, m_window, capt); XSetIconName(m_display, m_window, capt); XSetWMIconName(m_display, m_window, &tp); } //------------------------------------------------------------------------ void platform_specific::put_image(const rendering_buffer* src) { if(m_ximg_window == 0) return; m_ximg_window->data = (char*)m_buf_window; if(m_format == m_sys_format) { XPutImage(m_display, m_window, m_gc, m_ximg_window, 0, 0, 0, 0, src->width(), src->height()); } else { int row_len = src->width() * m_sys_bpp / 8; unsigned char* buf_tmp = new unsigned char[row_len * src->height()]; rendering_buffer rbuf_tmp; rbuf_tmp.attach(buf_tmp, src->width(), src->height(), m_flip_y ? -row_len : row_len); switch(m_sys_format) { default: break; case pix_format_rgb555: switch(m_format) { default: break; case pix_format_rgb555: color_conv(&rbuf_tmp, src, color_conv_rgb555_to_rgb555()); break; case pix_format_rgb565: color_conv(&rbuf_tmp, src, color_conv_rgb565_to_rgb555()); break; case pix_format_rgb24: color_conv(&rbuf_tmp, src, color_conv_rgb24_to_rgb555()); break; case pix_format_bgr24: color_conv(&rbuf_tmp, src, color_conv_bgr24_to_rgb555()); break; case pix_format_rgba32: color_conv(&rbuf_tmp, src, color_conv_rgba32_to_rgb555()); break; case pix_format_argb32: color_conv(&rbuf_tmp, src, color_conv_argb32_to_rgb555()); break; case pix_format_bgra32: color_conv(&rbuf_tmp, src, color_conv_bgra32_to_rgb555()); break; case pix_format_abgr32: color_conv(&rbuf_tmp, src, color_conv_abgr32_to_rgb555()); break; } break; case pix_format_rgb565: switch(m_format) { default: break; case pix_format_rgb555: color_conv(&rbuf_tmp, src, color_conv_rgb555_to_rgb565()); break; case pix_format_rgb565: color_conv(&rbuf_tmp, src, color_conv_rgb565_to_rgb565()); break; case pix_format_rgb24: color_conv(&rbuf_tmp, src, color_conv_rgb24_to_rgb565()); break; case pix_format_bgr24: color_conv(&rbuf_tmp, src, color_conv_bgr24_to_rgb565()); break; case pix_format_rgba32: color_conv(&rbuf_tmp, src, color_conv_rgba32_to_rgb565()); break; case pix_format_argb32: color_conv(&rbuf_tmp, src, color_conv_argb32_to_rgb565()); break; case pix_format_bgra32: color_conv(&rbuf_tmp, src, color_conv_bgra32_to_rgb565()); break; case pix_format_abgr32: color_conv(&rbuf_tmp, src, color_conv_abgr32_to_rgb565()); break; } break; case pix_format_rgba32: switch(m_format) { default: break; case pix_format_rgb555: color_conv(&rbuf_tmp, src, color_conv_rgb555_to_rgba32()); break; case pix_format_rgb565: color_conv(&rbuf_tmp, src, color_conv_rgb565_to_rgba32()); break; case pix_format_rgb24: color_conv(&rbuf_tmp, src, color_conv_rgb24_to_rgba32()); break; case pix_format_bgr24: color_conv(&rbuf_tmp, src, color_conv_bgr24_to_rgba32()); break; case pix_format_rgba32: color_conv(&rbuf_tmp, src, color_conv_rgba32_to_rgba32()); break; case pix_format_argb32: color_conv(&rbuf_tmp, src, color_conv_argb32_to_rgba32()); break; case pix_format_bgra32: color_conv(&rbuf_tmp, src, color_conv_bgra32_to_rgba32()); break; case pix_format_abgr32: color_conv(&rbuf_tmp, src, color_conv_abgr32_to_rgba32()); break; } break; case pix_format_abgr32: switch(m_format) { default: break; case pix_format_rgb555: color_conv(&rbuf_tmp, src, color_conv_rgb555_to_abgr32()); break; case pix_format_rgb565: color_conv(&rbuf_tmp, src, color_conv_rgb565_to_abgr32()); break; case pix_format_rgb24: color_conv(&rbuf_tmp, src, color_conv_rgb24_to_abgr32()); break; case pix_format_bgr24: color_conv(&rbuf_tmp, src, color_conv_bgr24_to_abgr32()); break; case pix_format_abgr32: color_conv(&rbuf_tmp, src, color_conv_abgr32_to_abgr32()); break; case pix_format_rgba32: color_conv(&rbuf_tmp, src, color_conv_rgba32_to_abgr32()); break; case pix_format_argb32: color_conv(&rbuf_tmp, src, color_conv_argb32_to_abgr32()); break; case pix_format_bgra32: color_conv(&rbuf_tmp, src, color_conv_bgra32_to_abgr32()); break; } break; case pix_format_argb32: switch(m_format) { default: break; case pix_format_rgb555: color_conv(&rbuf_tmp, src, color_conv_rgb555_to_argb32()); break; case pix_format_rgb565: color_conv(&rbuf_tmp, src, color_conv_rgb565_to_argb32()); break; case pix_format_rgb24: color_conv(&rbuf_tmp, src, color_conv_rgb24_to_argb32()); break; case pix_format_bgr24: color_conv(&rbuf_tmp, src, color_conv_bgr24_to_argb32()); break; case pix_format_rgba32: color_conv(&rbuf_tmp, src, color_conv_rgba32_to_argb32()); break; case pix_format_argb32: color_conv(&rbuf_tmp, src, color_conv_argb32_to_argb32()); break; case pix_format_abgr32: color_conv(&rbuf_tmp, src, color_conv_abgr32_to_argb32()); break; case pix_format_bgra32: color_conv(&rbuf_tmp, src, color_conv_bgra32_to_argb32()); break; } break; case pix_format_bgra32: switch(m_format) { default: break; case pix_format_rgb555: color_conv(&rbuf_tmp, src, color_conv_rgb555_to_bgra32()); break; case pix_format_rgb565: color_conv(&rbuf_tmp, src, color_conv_rgb565_to_bgra32()); break; case pix_format_rgb24: color_conv(&rbuf_tmp, src, color_conv_rgb24_to_bgra32()); break; case pix_format_bgr24: color_conv(&rbuf_tmp, src, color_conv_bgr24_to_bgra32()); break; case pix_format_rgba32: color_conv(&rbuf_tmp, src, color_conv_rgba32_to_bgra32()); break; case pix_format_argb32: color_conv(&rbuf_tmp, src, color_conv_argb32_to_bgra32()); break; case pix_format_abgr32: color_conv(&rbuf_tmp, src, color_conv_abgr32_to_bgra32()); break; case pix_format_bgra32: color_conv(&rbuf_tmp, src, color_conv_bgra32_to_bgra32()); break; } break; } m_ximg_window->data = (char*)buf_tmp; XPutImage(m_display, m_window, m_gc, m_ximg_window, 0, 0, 0, 0, src->width(), src->height()); delete [] buf_tmp; } } //------------------------------------------------------------------------ platform_support::platform_support(pix_format_e format, bool flip_y) : m_specific(new platform_specific(format, flip_y)), m_format(format), m_bpp(m_specific->m_bpp), m_window_flags(0), m_wait_mode(true), m_flip_y(flip_y), m_initial_width(10), m_initial_height(10) { strcpy(m_caption, "AGG Application"); } //------------------------------------------------------------------------ platform_support::~platform_support() { delete m_specific; } //------------------------------------------------------------------------ void platform_support::caption(const char* cap) { strcpy(m_caption, cap); if(m_specific->m_initialized) { m_specific->caption(cap); } } //------------------------------------------------------------------------ enum xevent_mask_e { xevent_mask = PointerMotionMask| ButtonPressMask| ButtonReleaseMask| ExposureMask| KeyPressMask| StructureNotifyMask }; //------------------------------------------------------------------------ bool platform_support::init(unsigned width, unsigned height, unsigned flags) { m_window_flags = flags; m_specific->m_display = XOpenDisplay(NULL); if(m_specific->m_display == 0) { fprintf(stderr, "Unable to open DISPLAY!\n"); return false; } m_specific->m_screen = XDefaultScreen(m_specific->m_display); m_specific->m_depth = XDefaultDepth(m_specific->m_display, m_specific->m_screen); m_specific->m_visual = XDefaultVisual(m_specific->m_display, m_specific->m_screen); unsigned long r_mask = m_specific->m_visual->red_mask; unsigned long g_mask = m_specific->m_visual->green_mask; unsigned long b_mask = m_specific->m_visual->blue_mask; //printf("depth=%d, red=%08x, green=%08x, blue=%08x\n", // m_specific->m_depth, // m_specific->m_visual->red_mask, // m_specific->m_visual->green_mask, // m_specific->m_visual->blue_mask); // // NOT COMPLETED YET! // // Try to find an appropriate Visual if the default doesn't fit. // if(m_specific->m_depth < 15 || // r_mask == 0 || g_mask == 0 || b_mask == 0) // { // // // This is an attempt to find an appropriate Visual if // // the default one doesn't match the minumum requirements // static int depth[] = { 32, 24, 16, 15 }; // int i; // for(int i = 0; i < 4; i++) // { // XVisualInfo vi; // if(XMatchVisualInfo(m_specific->m_display, // m_specific->m_screen, // depth[i], // TrueColor, // &vi)) // { // // printf("TrueColor depth=%d, red=%08x, green=%08x, blue=%08x, bits=%d\n", // // vi.depth, // // vi.visual->red_mask, // // vi.visual->green_mask, // // vi.visual->blue_mask, // // vi.bits_per_rgb); // m_specific->m_depth = vi.depth; // m_specific->m_visual = vi.visual; // r_mask = m_specific->m_visual->red_mask; // g_mask = m_specific->m_visual->green_mask; // b_mask = m_specific->m_visual->blue_mask; // break; // } // if(XMatchVisualInfo(m_specific->m_display, // m_specific->m_screen, // depth[i], // DirectColor, // &vi)) // { // // printf("DirectColor depth=%d, red=%08x, green=%08x, blue=%08x, bits=%d\n", // // vi.depth, // // vi.visual->red_mask, // // vi.visual->green_mask, // // vi.visual->blue_mask, // // vi.bits_per_rgb); // m_specific->m_depth = vi.depth; // m_specific->m_visual = vi.visual; // r_mask = m_specific->m_visual->red_mask; // g_mask = m_specific->m_visual->green_mask; // b_mask = m_specific->m_visual->blue_mask; // break; // } // } // } if(m_specific->m_depth < 15 || r_mask == 0 || g_mask == 0 || b_mask == 0) { fprintf(stderr, "There's no Visual compatible with minimal AGG requirements:\n" "At least 15-bit color depth and True- or DirectColor class.\n\n"); XCloseDisplay(m_specific->m_display); return false; } int t = 1; int hw_byte_order = LSBFirst; if(*(char*)&t == 0) hw_byte_order = MSBFirst; // Perceive SYS-format by mask switch(m_specific->m_depth) { case 15: m_specific->m_sys_bpp = 16; if(r_mask == 0x7C00 && g_mask == 0x3E0 && b_mask == 0x1F) { m_specific->m_sys_format = pix_format_rgb555; m_specific->m_byte_order = hw_byte_order; } break; case 16: m_specific->m_sys_bpp = 16; if(r_mask == 0xF800 && g_mask == 0x7E0 && b_mask == 0x1F) { m_specific->m_sys_format = pix_format_rgb565; m_specific->m_byte_order = hw_byte_order; } break; case 24: case 32: m_specific->m_sys_bpp = 32; if(g_mask == 0xFF00) { if(r_mask == 0xFF && b_mask == 0xFF0000) { switch(m_specific->m_format) { case pix_format_rgba32: m_specific->m_sys_format = pix_format_rgba32; m_specific->m_byte_order = LSBFirst; break; case pix_format_abgr32: m_specific->m_sys_format = pix_format_abgr32; m_specific->m_byte_order = MSBFirst; break; default: m_specific->m_byte_order = hw_byte_order; m_specific->m_sys_format = (hw_byte_order == LSBFirst) ? pix_format_rgba32 : pix_format_abgr32; break; } } if(r_mask == 0xFF0000 && b_mask == 0xFF) { switch(m_specific->m_format) { case pix_format_argb32: m_specific->m_sys_format = pix_format_argb32; m_specific->m_byte_order = MSBFirst; break; case pix_format_bgra32: m_specific->m_sys_format = pix_format_bgra32; m_specific->m_byte_order = LSBFirst; break; default: m_specific->m_byte_order = hw_byte_order; m_specific->m_sys_format = (hw_byte_order == MSBFirst) ? pix_format_argb32 : pix_format_bgra32; break; } } } break; } if(m_specific->m_sys_format == pix_format_undefined) { fprintf(stderr, "RGB masks are not compatible with AGG pixel formats:\n" "R=%08x, R=%08x, B=%08x\n", r_mask, g_mask, b_mask); XCloseDisplay(m_specific->m_display); return false; } memset(&m_specific->m_window_attributes, 0, sizeof(m_specific->m_window_attributes)); m_specific->m_window_attributes.border_pixel = XBlackPixel(m_specific->m_display, m_specific->m_screen); m_specific->m_window_attributes.background_pixel = XWhitePixel(m_specific->m_display, m_specific->m_screen); m_specific->m_window_attributes.override_redirect = 0; unsigned long window_mask = CWBackPixel | CWBorderPixel; m_specific->m_window = XCreateWindow(m_specific->m_display, XDefaultRootWindow(m_specific->m_display), 0, 0, width, height, 0, m_specific->m_depth, InputOutput, CopyFromParent, window_mask, &m_specific->m_window_attributes); m_specific->m_gc = XCreateGC(m_specific->m_display, m_specific->m_window, 0, 0); m_specific->m_buf_window = new unsigned char[width * height * (m_bpp / 8)]; memset(m_specific->m_buf_window, 255, width * height * (m_bpp / 8)); m_rbuf_window.attach(m_specific->m_buf_window, width, height, m_flip_y ? -width * (m_bpp / 8) : width * (m_bpp / 8)); m_specific->m_ximg_window = XCreateImage(m_specific->m_display, m_specific->m_visual, //CopyFromParent, m_specific->m_depth, ZPixmap, 0, (char*)m_specific->m_buf_window, width, height, m_specific->m_sys_bpp, width * (m_specific->m_sys_bpp / 8)); m_specific->m_ximg_window->byte_order = m_specific->m_byte_order; m_specific->caption(m_caption); m_initial_width = width; m_initial_height = height; if(!m_specific->m_initialized) { on_init(); m_specific->m_initialized = true; } trans_affine_resizing(width, height); on_resize(width, height); m_specific->m_update_flag = true; XSizeHints *hints = XAllocSizeHints(); if(hints) { if(flags & window_resize) { hints->min_width = 32; hints->min_height = 32; hints->max_width = 4096; hints->max_height = 4096; } else { hints->min_width = width; hints->min_height = height; hints->max_width = width; hints->max_height = height; } hints->flags = PMaxSize | PMinSize; XSetWMNormalHints(m_specific->m_display, m_specific->m_window, hints); XFree(hints); } XMapWindow(m_specific->m_display, m_specific->m_window); XSelectInput(m_specific->m_display, m_specific->m_window, xevent_mask); m_specific->m_close_atom = XInternAtom(m_specific->m_display, "WM_DELETE_WINDOW", false); XSetWMProtocols(m_specific->m_display, m_specific->m_window, &m_specific->m_close_atom, 1); return true; } //------------------------------------------------------------------------ void platform_support::update_window() { m_specific->put_image(&m_rbuf_window); // When m_wait_mode is true we can discard all the events // came while the image is being drawn. In this case // the X server does not accumulate mouse motion events. // When m_wait_mode is false, i.e. we have some idle drawing // we cannot afford to miss any events XSync(m_specific->m_display, m_wait_mode); } //------------------------------------------------------------------------ int platform_support::run() { XFlush(m_specific->m_display); bool quit = false; unsigned flags; int cur_x; int cur_y; while(!quit) { if(m_specific->m_update_flag) { on_draw(); update_window(); m_specific->m_update_flag = false; } if(!m_wait_mode) { if(XPending(m_specific->m_display) == 0) { on_idle(); continue; } } XEvent x_event; XNextEvent(m_specific->m_display, &x_event); // In the Idle mode discard all intermediate MotionNotify events if(!m_wait_mode && x_event.type == MotionNotify) { XEvent te = x_event; for(;;) { if(XPending(m_specific->m_display) == 0) break; XNextEvent(m_specific->m_display, &te); if(te.type != MotionNotify) break; } x_event = te; } switch(x_event.type) { case ConfigureNotify: { if(x_event.xconfigure.width != int(m_rbuf_window.width()) || x_event.xconfigure.height != int(m_rbuf_window.height())) { int width = x_event.xconfigure.width; int height = x_event.xconfigure.height; delete [] m_specific->m_buf_window; m_specific->m_ximg_window->data = 0; XDestroyImage(m_specific->m_ximg_window); m_specific->m_buf_window = new unsigned char[width * height * (m_bpp / 8)]; m_rbuf_window.attach(m_specific->m_buf_window, width, height, m_flip_y ? -width * (m_bpp / 8) : width * (m_bpp / 8)); m_specific->m_ximg_window = XCreateImage(m_specific->m_display, m_specific->m_visual, //CopyFromParent, m_specific->m_depth, ZPixmap, 0, (char*)m_specific->m_buf_window, width, height, m_specific->m_sys_bpp, width * (m_specific->m_sys_bpp / 8)); m_specific->m_ximg_window->byte_order = m_specific->m_byte_order; trans_affine_resizing(width, height); on_resize(width, height); on_draw(); update_window(); } } break; case Expose: m_specific->put_image(&m_rbuf_window); XFlush(m_specific->m_display); XSync(m_specific->m_display, false); break; case KeyPress: { KeySym key = XLookupKeysym(&x_event.xkey, 0); flags = 0; if(x_event.xkey.state & Button1Mask) flags |= mouse_left; if(x_event.xkey.state & Button3Mask) flags |= mouse_right; if(x_event.xkey.state & ShiftMask) flags |= kbd_shift; if(x_event.xkey.state & ControlMask) flags |= kbd_ctrl; bool left = false; bool up = false; bool right = false; bool down = false; switch(m_specific->m_keymap[key & 0xFF]) { case key_left: left = true; break; case key_up: up = true; break; case key_right: right = true; break; case key_down: down = true; break; case key_f2: copy_window_to_img(max_images - 1); save_img(max_images - 1, "screenshot"); break; } if(m_ctrls.on_arrow_keys(left, right, down, up)) { on_ctrl_change(); force_redraw(); } else { on_key(x_event.xkey.x, m_flip_y ? m_rbuf_window.height() - x_event.xkey.y : x_event.xkey.y, m_specific->m_keymap[key & 0xFF], flags); } } break; case ButtonPress: { flags = 0; if(x_event.xbutton.state & ShiftMask) flags |= kbd_shift; if(x_event.xbutton.state & ControlMask) flags |= kbd_ctrl; if(x_event.xbutton.button == Button1) flags |= mouse_left; if(x_event.xbutton.button == Button3) flags |= mouse_right; cur_x = x_event.xbutton.x; cur_y = m_flip_y ? m_rbuf_window.height() - x_event.xbutton.y : x_event.xbutton.y; if(flags & mouse_left) { if(m_ctrls.on_mouse_button_down(cur_x, cur_y)) { m_ctrls.set_cur(cur_x, cur_y); on_ctrl_change(); force_redraw(); } else { if(m_ctrls.in_rect(cur_x, cur_y)) { if(m_ctrls.set_cur(cur_x, cur_y)) { on_ctrl_change(); force_redraw(); } } else { on_mouse_button_down(cur_x, cur_y, flags); } } } if(flags & mouse_right) { on_mouse_button_down(cur_x, cur_y, flags); } //m_specific->m_wait_mode = m_wait_mode; //m_wait_mode = true; } break; case MotionNotify: { flags = 0; if(x_event.xmotion.state & Button1Mask) flags |= mouse_left; if(x_event.xmotion.state & Button3Mask) flags |= mouse_right; if(x_event.xmotion.state & ShiftMask) flags |= kbd_shift; if(x_event.xmotion.state & ControlMask) flags |= kbd_ctrl; cur_x = x_event.xbutton.x; cur_y = m_flip_y ? m_rbuf_window.height() - x_event.xbutton.y : x_event.xbutton.y; if(m_ctrls.on_mouse_move(cur_x, cur_y, (flags & mouse_left) != 0)) { on_ctrl_change(); force_redraw(); } else { if(!m_ctrls.in_rect(cur_x, cur_y)) { on_mouse_move(cur_x, cur_y, flags); } } } break; case ButtonRelease: { flags = 0; if(x_event.xbutton.state & ShiftMask) flags |= kbd_shift; if(x_event.xbutton.state & ControlMask) flags |= kbd_ctrl; if(x_event.xbutton.button == Button1) flags |= mouse_left; if(x_event.xbutton.button == Button3) flags |= mouse_right; cur_x = x_event.xbutton.x; cur_y = m_flip_y ? m_rbuf_window.height() - x_event.xbutton.y : x_event.xbutton.y; if(flags & mouse_left) { if(m_ctrls.on_mouse_button_up(cur_x, cur_y)) { on_ctrl_change(); force_redraw(); } } if(flags & (mouse_left | mouse_right)) { on_mouse_button_up(cur_x, cur_y, flags); } } //m_wait_mode = m_specific->m_wait_mode; break; case ClientMessage: if((x_event.xclient.format == 32) && (x_event.xclient.data.l[0] == int(m_specific->m_close_atom))) { quit = true; } break; } } unsigned i = platform_support::max_images; while(i--) { if(m_specific->m_buf_img[i]) { delete [] m_specific->m_buf_img[i]; } } delete [] m_specific->m_buf_window; m_specific->m_ximg_window->data = 0; XDestroyImage(m_specific->m_ximg_window); XFreeGC(m_specific->m_display, m_specific->m_gc); XDestroyWindow(m_specific->m_display, m_specific->m_window); XCloseDisplay(m_specific->m_display); return 0; } //------------------------------------------------------------------------ const char* platform_support::img_ext() const { return ".ppm"; } //------------------------------------------------------------------------ const char* platform_support::full_file_name(const char* file_name) { return file_name; } //------------------------------------------------------------------------ bool platform_support::load_img(unsigned idx, const char* file) { if(idx < max_images) { char buf[1024]; strcpy(buf, file); int len = strlen(buf); if(len < 4 || strcasecmp(buf + len - 4, ".ppm") != 0) { strcat(buf, ".ppm"); } FILE* fd = fopen(buf, "rb"); if(fd == 0) return false; if((len = fread(buf, 1, 1022, fd)) == 0) { fclose(fd); return false; } buf[len] = 0; if(buf[0] != 'P' && buf[1] != '6') { fclose(fd); return false; } char* ptr = buf + 2; while(*ptr && !isdigit(*ptr)) ptr++; if(*ptr == 0) { fclose(fd); return false; } unsigned width = atoi(ptr); if(width == 0 || width > 4096) { fclose(fd); return false; } while(*ptr && isdigit(*ptr)) ptr++; while(*ptr && !isdigit(*ptr)) ptr++; if(*ptr == 0) { fclose(fd); return false; } unsigned height = atoi(ptr); if(height == 0 || height > 4096) { fclose(fd); return false; } while(*ptr && isdigit(*ptr)) ptr++; while(*ptr && !isdigit(*ptr)) ptr++; if(atoi(ptr) != 255) { fclose(fd); return false; } while(*ptr && isdigit(*ptr)) ptr++; if(*ptr == 0) { fclose(fd); return false; } ptr++; fseek(fd, long(ptr - buf), SEEK_SET); create_img(idx, width, height); bool ret = true; if(m_format == pix_format_rgb24) { fread(m_specific->m_buf_img[idx], 1, width * height * 3, fd); } else { unsigned char* buf_img = new unsigned char [width * height * 3]; rendering_buffer rbuf_img; rbuf_img.attach(buf_img, width, height, m_flip_y ? -width * 3 : width * 3); fread(buf_img, 1, width * height * 3, fd); switch(m_format) { case pix_format_rgb555: color_conv(m_rbuf_img+idx, &rbuf_img, color_conv_rgb24_to_rgb555()); break; case pix_format_rgb565: color_conv(m_rbuf_img+idx, &rbuf_img, color_conv_rgb24_to_rgb565()); break; case pix_format_bgr24: color_conv(m_rbuf_img+idx, &rbuf_img, color_conv_rgb24_to_bgr24()); break; case pix_format_rgba32: color_conv(m_rbuf_img+idx, &rbuf_img, color_conv_rgb24_to_rgba32()); break; case pix_format_argb32: color_conv(m_rbuf_img+idx, &rbuf_img, color_conv_rgb24_to_argb32()); break; case pix_format_bgra32: color_conv(m_rbuf_img+idx, &rbuf_img, color_conv_rgb24_to_bgra32()); break; case pix_format_abgr32: color_conv(m_rbuf_img+idx, &rbuf_img, color_conv_rgb24_to_abgr32()); break; default: ret = false; } delete [] buf_img; } fclose(fd); return ret; } return false; } //------------------------------------------------------------------------ bool platform_support::save_img(unsigned idx, const char* file) { if(idx < max_images && rbuf_img(idx).buf()) { char buf[1024]; strcpy(buf, file); int len = strlen(buf); if(len < 4 || strcasecmp(buf + len - 4, ".ppm") != 0) { strcat(buf, ".ppm"); } FILE* fd = fopen(buf, "wb"); if(fd == 0) return false; unsigned w = rbuf_img(idx).width(); unsigned h = rbuf_img(idx).height(); fprintf(fd, "P6\n%d %d\n255\n", w, h); unsigned y; unsigned char* tmp_buf = new unsigned char [w * 3]; for(y = 0; y < rbuf_img(idx).height(); y++) { const unsigned char* src = rbuf_img(idx).row_ptr(m_flip_y ? h - 1 - y : y); switch(m_format) { default: break; case pix_format_rgb555: color_conv_row(tmp_buf, src, w, color_conv_rgb555_to_rgb24()); break; case pix_format_rgb565: color_conv_row(tmp_buf, src, w, color_conv_rgb565_to_rgb24()); break; case pix_format_bgr24: color_conv_row(tmp_buf, src, w, color_conv_bgr24_to_rgb24()); break; case pix_format_rgb24: color_conv_row(tmp_buf, src, w, color_conv_rgb24_to_rgb24()); break; case pix_format_rgba32: color_conv_row(tmp_buf, src, w, color_conv_rgba32_to_rgb24()); break; case pix_format_argb32: color_conv_row(tmp_buf, src, w, color_conv_argb32_to_rgb24()); break; case pix_format_bgra32: color_conv_row(tmp_buf, src, w, color_conv_bgra32_to_rgb24()); break; case pix_format_abgr32: color_conv_row(tmp_buf, src, w, color_conv_abgr32_to_rgb24()); break; } fwrite(tmp_buf, 1, w * 3, fd); } delete [] tmp_buf; fclose(fd); return true; } return false; } //------------------------------------------------------------------------ bool platform_support::create_img(unsigned idx, unsigned width, unsigned height) { if(idx < max_images) { if(width == 0) width = rbuf_window().width(); if(height == 0) height = rbuf_window().height(); delete [] m_specific->m_buf_img[idx]; m_specific->m_buf_img[idx] = new unsigned char[width * height * (m_bpp / 8)]; m_rbuf_img[idx].attach(m_specific->m_buf_img[idx], width, height, m_flip_y ? -width * (m_bpp / 8) : width * (m_bpp / 8)); return true; } return false; } //------------------------------------------------------------------------ void platform_support::force_redraw() { m_specific->m_update_flag = true; } //------------------------------------------------------------------------ void platform_support::message(const char* msg) { fprintf(stderr, "%s\n", msg); } //------------------------------------------------------------------------ void platform_support::start_timer() { m_specific->m_sw_start = clock(); } //------------------------------------------------------------------------ double platform_support::elapsed_time() const { clock_t stop = clock(); return double(stop - m_specific->m_sw_start) * 1000.0 / CLOCKS_PER_SEC; } //------------------------------------------------------------------------ void platform_support::on_init() {} void platform_support::on_resize(int sx, int sy) {} void platform_support::on_idle() {} void platform_support::on_mouse_move(int x, int y, unsigned flags) {} void platform_support::on_mouse_button_down(int x, int y, unsigned flags) {} void platform_support::on_mouse_button_up(int x, int y, unsigned flags) {} void platform_support::on_key(int x, int y, unsigned key, unsigned flags) {} void platform_support::on_ctrl_change() {} void platform_support::on_draw() {} void platform_support::on_post_draw(void* raw_handler) {} } int agg_main(int argc, char* argv[]); int main(int argc, char* argv[]) { return agg_main(argc, argv); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/src/platform/mac/���������������������������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�016431� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/src/platform/mac/Makefile.am����������������������������������������������������������0000644�0000000�0000000�00000000541�10703246330�020465� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������if ENABLE_OSX lib_LTLIBRARIES = libaggplatformmac.la libaggplatformmac_la_LDFLAGS=-version-info @AGG_LIB_VERSION@ libaggplatformmac_la_SOURCES=agg_mac_pmap.cpp \ agg_platform_support.cpp libaggplatformmac_la_CXXFLAGS = -I$(top_srcdir)/include @OSX_CFLAGS@ libaggplatformmac_la_LIBADD = @OSX_LIBS@ $(top_builddir)/src/libagg.la endif ���������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/src/platform/mac/agg_mac_pmap.cpp�����������������������������������������������������0000644�0000000�0000000�00000020733�10703246330�021535� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // //---------------------------------------------------------------------------- // Contact: mcseemagg@yahoo.com // baer@karto.baug.ethz.ch //---------------------------------------------------------------------------- // // class pixel_map // //---------------------------------------------------------------------------- #include <string.h> #include <Carbon.h> #include <QuickTimeComponents.h> #include <ImageCompression.h> #include "platform/mac/agg_mac_pmap.h" #include "agg_basics.h" namespace agg { //------------------------------------------------------------------------ pixel_map::~pixel_map() { destroy(); } //------------------------------------------------------------------------ pixel_map::pixel_map() : m_pmap(0), m_buf(0), m_bpp(0), m_img_size(0) { } //------------------------------------------------------------------------ void pixel_map::destroy() { delete[] m_buf; m_buf = NULL; if (m_pmap != nil) { DisposeGWorld(m_pmap); m_pmap = nil; } } //------------------------------------------------------------------------ void pixel_map::create(unsigned width, unsigned height, org_e org, unsigned clear_val) { destroy(); if(width == 0) width = 1; if(height == 0) height = 1; m_bpp = org; Rect r; int row_bytes = calc_row_len (width, m_bpp); MacSetRect(&r, 0, 0, width, height); m_buf = new unsigned char[m_img_size = row_bytes * height]; // The Quicktime version for creating GWorlds is more flexible than the classical function. QTNewGWorldFromPtr (&m_pmap, m_bpp, &r, nil, nil, 0, m_buf, row_bytes); // create_gray_scale_palette(m_pmap); I didn't care about gray scale palettes so far. if(clear_val <= 255) { memset(m_buf, clear_val, m_img_size); } } //------------------------------------------------------------------------ void pixel_map::clear(unsigned clear_val) { if(m_buf) memset(m_buf, clear_val, m_img_size); } //static //This function is just copied from the Win32 plattform support. //Is also seems to be appropriate for MacOS as well, but it is not //thouroughly tested so far. //------------------------------------------------------------------------ unsigned pixel_map::calc_row_len(unsigned width, unsigned bits_per_pixel) { unsigned n = width; unsigned k; switch(bits_per_pixel) { case 1: k = n; n = n >> 3; if(k & 7) n++; break; case 4: k = n; n = n >> 1; if(k & 3) n++; break; case 8: break; case 16: n = n << 1; break; case 24: n = (n << 1) + n; break; case 32: n = n << 2; break; default: n = 0; break; } return ((n + 3) >> 2) << 2; } //------------------------------------------------------------------------ void pixel_map::draw(WindowRef window, const Rect *device_rect, const Rect *pmap_rect) const { if(m_pmap == nil || m_buf == NULL) return; PixMapHandle pm = GetGWorldPixMap (m_pmap); CGrafPtr port = GetWindowPort (window); Rect dest_rect; // Again, I used the Quicktime version. // Good old 'CopyBits' does better interpolation when scaling // but does not support all pixel depths. MacSetRect (&dest_rect, 0, 0, this->width(), this->height()); ImageDescriptionHandle image_description; MakeImageDescriptionForPixMap (pm, &image_description); if (image_description != nil) { DecompressImage (GetPixBaseAddr (pm), image_description, GetPortPixMap (port), nil, &dest_rect, ditherCopy, nil); DisposeHandle ((Handle) image_description); } } //------------------------------------------------------------------------ void pixel_map::draw(WindowRef window, int x, int y, double scale) const { if(m_pmap == nil || m_buf == NULL) return; unsigned width = (unsigned)(this->width() * scale); unsigned height = (unsigned)(this->height() * scale); Rect rect; SetRect (&rect, x, y, x + width, y + height); draw(window, &rect); } //------------------------------------------------------------------------ void pixel_map::blend(WindowRef window, const Rect *device_rect, const Rect *bmp_rect) const { draw (window, device_rect, bmp_rect); // currently just mapped to drawing method } //------------------------------------------------------------------------ void pixel_map::blend(WindowRef window, int x, int y, double scale) const { draw(window, x, y, scale); // currently just mapped to drawing method } // I let Quicktime handle image import since it supports most popular // image formats such as: // *.psd, *.bmp, *.tif, *.png, *.jpg, *.gif, *.pct, *.pcx //------------------------------------------------------------------------ bool pixel_map::load_from_qt(const char *filename) { FSSpec fss; OSErr err; // get file specification to application directory err = HGetVol(nil, &fss.vRefNum, &fss.parID); if (err == noErr) { CopyCStringToPascal(filename, fss.name); GraphicsImportComponent gi; err = GetGraphicsImporterForFile (&fss, &gi); if (err == noErr) { ImageDescriptionHandle desc; GraphicsImportGetImageDescription(gi, &desc); // For simplicity, all images are currently converted to 32 bit. // create an empty pixelmap short depth = 32; create ((**desc).width, (**desc).height, (org_e)depth, 0xff); DisposeHandle ((Handle)desc); // let Quicktime draw to pixelmap GraphicsImportSetGWorld(gi, m_pmap, nil); GraphicsImportDraw(gi); // Well, this is a hack. The graphics importer sets the alpha channel of the pixelmap to 0x00 // for imported images without alpha channel but this would cause agg to draw an invisible image. // set alpha channel to 0xff unsigned char * buf = m_buf; for (unsigned int size = 0; size < m_img_size; size += 4) { *buf = 0xff; buf += 4; } } } return err == noErr; } //------------------------------------------------------------------------ bool pixel_map::save_as_qt(const char *filename) const { FSSpec fss; OSErr err; // get file specification to application directory err = HGetVol(nil, &fss.vRefNum, &fss.parID); if (err == noErr) { GraphicsExportComponent ge; CopyCStringToPascal(filename, fss.name); // I decided to use PNG as output image file type. // There are a number of other available formats. // Should I check the file suffix to choose the image file format? err = OpenADefaultComponent(GraphicsExporterComponentType, kQTFileTypePNG, &ge); if (err == noErr) { err = GraphicsExportSetInputGWorld(ge, m_pmap); if (err == noErr) { err = GraphicsExportSetOutputFile (ge, &fss); if (err == noErr) { GraphicsExportDoExport(ge, nil); } } CloseComponent(ge); } } return err == noErr; } //------------------------------------------------------------------------ unsigned char* pixel_map::buf() { return m_buf; } //------------------------------------------------------------------------ unsigned pixel_map::width() const { if(m_pmap == nil) return 0; PixMapHandle pm = GetGWorldPixMap (m_pmap); Rect bounds; GetPixBounds (pm, &bounds); return bounds.right - bounds.left; } //------------------------------------------------------------------------ unsigned pixel_map::height() const { if(m_pmap == nil) return 0; PixMapHandle pm = GetGWorldPixMap (m_pmap); Rect bounds; GetPixBounds (pm, &bounds); return bounds.bottom - bounds.top; } //------------------------------------------------------------------------ int pixel_map::row_bytes() const { if(m_pmap == nil) return 0; PixMapHandle pm = GetGWorldPixMap (m_pmap); return calc_row_len(width(), GetPixDepth(pm)); } } �������������������������������������agg-2.5+dfsg1/src/platform/mac/agg_platform_support.cpp���������������������������������������������0000644�0000000�0000000�00000104764�10703246330�023407� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Copyright (C) 2003 Hansruedi Baer (MacOS support, baer@karto.baug.eth.ch) // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- // // Note from Hansruedi Baer: // I tried to retain the original structure for the Win32 platform as far // as possible. Currently, not all features are implemented but the examples // should work properly. // HB //---------------------------------------------------------------------------- #include <Carbon.h> #if defined(__MWERKS__) #include "console.h" #endif #include <string.h> #include <unistd.h> #include "platform/agg_platform_support.h" #include "platform/mac/agg_mac_pmap.h" #include "util/agg_color_conv_rgb8.h" namespace agg { pascal OSStatus DoWindowClose (EventHandlerCallRef nextHandler, EventRef theEvent, void* userData); pascal OSStatus DoWindowDrawContent (EventHandlerCallRef nextHandler, EventRef theEvent, void* userData); pascal OSStatus DoAppQuit (EventHandlerCallRef nextHandler, EventRef theEvent, void* userData); pascal OSStatus DoMouseDown (EventHandlerCallRef nextHandler, EventRef theEvent, void* userData); pascal OSStatus DoMouseUp (EventHandlerCallRef nextHandler, EventRef theEvent, void* userData); pascal OSStatus DoMouseDragged (EventHandlerCallRef nextHandler, EventRef theEvent, void* userData); pascal OSStatus DoKeyDown (EventHandlerCallRef nextHandler, EventRef theEvent, void* userData); pascal OSStatus DoKeyUp (EventHandlerCallRef nextHandler, EventRef theEvent, void* userData); pascal void DoPeriodicTask (EventLoopTimerRef theTimer, void* userData); //------------------------------------------------------------------------ class platform_specific { public: platform_specific(pix_format_e format, bool flip_y); void create_pmap(unsigned width, unsigned height, rendering_buffer* wnd); void display_pmap(WindowRef window, const rendering_buffer* src); bool load_pmap(const char* fn, unsigned idx, rendering_buffer* dst); bool save_pmap(const char* fn, unsigned idx, const rendering_buffer* src); unsigned translate(unsigned keycode); pix_format_e m_format; pix_format_e m_sys_format; bool m_flip_y; unsigned m_bpp; unsigned m_sys_bpp; WindowRef m_window; pixel_map m_pmap_window; pixel_map m_pmap_img[platform_support::max_images]; unsigned m_keymap[256]; unsigned m_last_translated_key; int m_cur_x; int m_cur_y; unsigned m_input_flags; bool m_redraw_flag; UnsignedWide m_sw_freq; UnsignedWide m_sw_start; }; //------------------------------------------------------------------------ platform_specific::platform_specific(pix_format_e format, bool flip_y) : m_format(format), m_sys_format(pix_format_undefined), m_flip_y(flip_y), m_bpp(0), m_sys_bpp(0), m_window(nil), m_last_translated_key(0), m_cur_x(0), m_cur_y(0), m_input_flags(0), m_redraw_flag(true) { memset(m_keymap, 0, sizeof(m_keymap)); //Keyboard input is not yet fully supported nor tested //m_keymap[VK_PAUSE] = key_pause; m_keymap[kClearCharCode] = key_clear; //m_keymap[VK_NUMPAD0] = key_kp0; //m_keymap[VK_NUMPAD1] = key_kp1; //m_keymap[VK_NUMPAD2] = key_kp2; //m_keymap[VK_NUMPAD3] = key_kp3; //m_keymap[VK_NUMPAD4] = key_kp4; //m_keymap[VK_NUMPAD5] = key_kp5; //m_keymap[VK_NUMPAD6] = key_kp6; //m_keymap[VK_NUMPAD7] = key_kp7; //m_keymap[VK_NUMPAD8] = key_kp8; //m_keymap[VK_NUMPAD9] = key_kp9; //m_keymap[VK_DECIMAL] = key_kp_period; //m_keymap[VK_DIVIDE] = key_kp_divide; //m_keymap[VK_MULTIPLY] = key_kp_multiply; //m_keymap[VK_SUBTRACT] = key_kp_minus; //m_keymap[VK_ADD] = key_kp_plus; m_keymap[kUpArrowCharCode] = key_up; m_keymap[kDownArrowCharCode] = key_down; m_keymap[kRightArrowCharCode] = key_right; m_keymap[kLeftArrowCharCode] = key_left; //m_keymap[VK_INSERT] = key_insert; m_keymap[kDeleteCharCode] = key_delete; m_keymap[kHomeCharCode] = key_home; m_keymap[kEndCharCode] = key_end; m_keymap[kPageUpCharCode] = key_page_up; m_keymap[kPageDownCharCode] = key_page_down; //m_keymap[VK_F1] = key_f1; //m_keymap[VK_F2] = key_f2; //m_keymap[VK_F3] = key_f3; //m_keymap[VK_F4] = key_f4; //m_keymap[VK_F5] = key_f5; //m_keymap[VK_F6] = key_f6; //m_keymap[VK_F7] = key_f7; //m_keymap[VK_F8] = key_f8; //m_keymap[VK_F9] = key_f9; //m_keymap[VK_F10] = key_f10; //m_keymap[VK_F11] = key_f11; //m_keymap[VK_F12] = key_f12; //m_keymap[VK_F13] = key_f13; //m_keymap[VK_F14] = key_f14; //m_keymap[VK_F15] = key_f15; //m_keymap[VK_NUMLOCK] = key_numlock; //m_keymap[VK_CAPITAL] = key_capslock; //m_keymap[VK_SCROLL] = key_scrollock; switch(m_format) { case pix_format_gray8: m_sys_format = pix_format_gray8; m_bpp = 8; m_sys_bpp = 8; break; case pix_format_rgb565: case pix_format_rgb555: m_sys_format = pix_format_rgb555; m_bpp = 16; m_sys_bpp = 16; break; case pix_format_rgb24: case pix_format_bgr24: m_sys_format = pix_format_rgb24; m_bpp = 24; m_sys_bpp = 24; break; case pix_format_bgra32: case pix_format_abgr32: case pix_format_argb32: case pix_format_rgba32: m_sys_format = pix_format_argb32; m_bpp = 32; m_sys_bpp = 32; break; } ::Microseconds(&m_sw_freq); ::Microseconds(&m_sw_start); } //------------------------------------------------------------------------ void platform_specific::create_pmap(unsigned width, unsigned height, rendering_buffer* wnd) { m_pmap_window.create(width, height, org_e(m_bpp)); wnd->attach(m_pmap_window.buf(), m_pmap_window.width(), m_pmap_window.height(), m_flip_y ? -m_pmap_window.row_bytes() : m_pmap_window.row_bytes()); } //------------------------------------------------------------------------ void platform_specific::display_pmap(WindowRef window, const rendering_buffer* src) { if(m_sys_format == m_format) { m_pmap_window.draw(window); } else { pixel_map pmap_tmp; pmap_tmp.create(m_pmap_window.width(), m_pmap_window.height(), org_e(m_sys_bpp)); rendering_buffer rbuf_tmp; rbuf_tmp.attach(pmap_tmp.buf(), pmap_tmp.width(), pmap_tmp.height(), m_flip_y ? -pmap_tmp.row_bytes() : pmap_tmp.row_bytes()); switch(m_format) { case pix_format_gray8: return; case pix_format_rgb565: color_conv(&rbuf_tmp, src, color_conv_rgb565_to_rgb555()); break; case pix_format_bgr24: color_conv(&rbuf_tmp, src, color_conv_bgr24_to_rgb24()); break; case pix_format_abgr32: color_conv(&rbuf_tmp, src, color_conv_abgr32_to_argb32()); break; case pix_format_bgra32: color_conv(&rbuf_tmp, src, color_conv_bgra32_to_argb32()); break; case pix_format_rgba32: color_conv(&rbuf_tmp, src, color_conv_rgba32_to_argb32()); break; } pmap_tmp.draw(window); } } //------------------------------------------------------------------------ bool platform_specific::save_pmap(const char* fn, unsigned idx, const rendering_buffer* src) { if(m_sys_format == m_format) { return m_pmap_img[idx].save_as_qt(fn); } else { pixel_map pmap_tmp; pmap_tmp.create(m_pmap_img[idx].width(), m_pmap_img[idx].height(), org_e(m_sys_bpp)); rendering_buffer rbuf_tmp; rbuf_tmp.attach(pmap_tmp.buf(), pmap_tmp.width(), pmap_tmp.height(), m_flip_y ? -pmap_tmp.row_bytes() : pmap_tmp.row_bytes()); switch(m_format) { case pix_format_gray8: return false; case pix_format_rgb565: color_conv(&rbuf_tmp, src, color_conv_rgb565_to_rgb555()); break; case pix_format_rgb24: color_conv(&rbuf_tmp, src, color_conv_rgb24_to_bgr24()); break; case pix_format_abgr32: color_conv(&rbuf_tmp, src, color_conv_abgr32_to_bgra32()); break; case pix_format_argb32: color_conv(&rbuf_tmp, src, color_conv_argb32_to_bgra32()); break; case pix_format_rgba32: color_conv(&rbuf_tmp, src, color_conv_rgba32_to_bgra32()); break; } return pmap_tmp.save_as_qt(fn); } return true; } //------------------------------------------------------------------------ bool platform_specific::load_pmap(const char* fn, unsigned idx, rendering_buffer* dst) { pixel_map pmap_tmp; if(!pmap_tmp.load_from_qt(fn)) return false; rendering_buffer rbuf_tmp; rbuf_tmp.attach(pmap_tmp.buf(), pmap_tmp.width(), pmap_tmp.height(), m_flip_y ? -pmap_tmp.row_bytes() : pmap_tmp.row_bytes()); m_pmap_img[idx].create(pmap_tmp.width(), pmap_tmp.height(), org_e(m_bpp), 0); dst->attach(m_pmap_img[idx].buf(), m_pmap_img[idx].width(), m_pmap_img[idx].height(), m_flip_y ? -m_pmap_img[idx].row_bytes() : m_pmap_img[idx].row_bytes()); switch(m_format) { case pix_format_gray8: return false; break; case pix_format_rgb555: switch(pmap_tmp.bpp()) { case 16: color_conv(dst, &rbuf_tmp, color_conv_rgb555_to_rgb555()); break; case 24: color_conv(dst, &rbuf_tmp, color_conv_rgb24_to_rgb555()); break; case 32: color_conv(dst, &rbuf_tmp, color_conv_argb32_to_rgb555()); break; } break; case pix_format_rgb565: switch(pmap_tmp.bpp()) { case 16: color_conv(dst, &rbuf_tmp, color_conv_rgb555_to_rgb565()); break; case 24: color_conv(dst, &rbuf_tmp, color_conv_rgb24_to_rgb565()); break; case 32: color_conv(dst, &rbuf_tmp, color_conv_argb32_to_rgb565()); break; } break; case pix_format_rgb24: switch(pmap_tmp.bpp()) { case 16: color_conv(dst, &rbuf_tmp, color_conv_rgb555_to_rgb24()); break; case 24: color_conv(dst, &rbuf_tmp, color_conv_rgb24_to_rgb24()); break; case 32: color_conv(dst, &rbuf_tmp, color_conv_argb32_to_rgb24()); break; } break; case pix_format_bgr24: switch(pmap_tmp.bpp()) { case 16: color_conv(dst, &rbuf_tmp, color_conv_rgb555_to_bgr24()); break; case 24: color_conv(dst, &rbuf_tmp, color_conv_rgb24_to_bgr24()); break; case 32: color_conv(dst, &rbuf_tmp, color_conv_argb32_to_bgr24()); break; } break; case pix_format_abgr32: switch(pmap_tmp.bpp()) { case 16: color_conv(dst, &rbuf_tmp, color_conv_rgb555_to_abgr32()); break; case 24: color_conv(dst, &rbuf_tmp, color_conv_rgb24_to_abgr32()); break; case 32: color_conv(dst, &rbuf_tmp, color_conv_argb32_to_abgr32()); break; } break; case pix_format_argb32: switch(pmap_tmp.bpp()) { case 16: color_conv(dst, &rbuf_tmp, color_conv_rgb555_to_argb32()); break; case 24: color_conv(dst, &rbuf_tmp, color_conv_rgb24_to_argb32()); break; case 32: color_conv(dst, &rbuf_tmp, color_conv_argb32_to_argb32()); break; } break; case pix_format_bgra32: switch(pmap_tmp.bpp()) { case 16: color_conv(dst, &rbuf_tmp, color_conv_rgb555_to_bgra32()); break; case 24: color_conv(dst, &rbuf_tmp, color_conv_rgb24_to_bgra32()); break; case 32: color_conv(dst, &rbuf_tmp, color_conv_argb32_to_bgra32()); break; } break; case pix_format_rgba32: switch(pmap_tmp.bpp()) { case 16: color_conv(dst, &rbuf_tmp, color_conv_rgb555_to_rgba32()); break; case 24: color_conv(dst, &rbuf_tmp, color_conv_rgb24_to_rgba32()); break; case 32: color_conv(dst, &rbuf_tmp, color_conv_argb32_to_rgba32()); break; } break; } return true; } //------------------------------------------------------------------------ unsigned platform_specific::translate(unsigned keycode) { return m_last_translated_key = (keycode > 255) ? 0 : m_keymap[keycode]; } //------------------------------------------------------------------------ platform_support::platform_support(pix_format_e format, bool flip_y) : m_specific(new platform_specific(format, flip_y)), m_format(format), m_bpp(m_specific->m_bpp), m_window_flags(0), m_wait_mode(true), m_flip_y(flip_y), m_initial_width(10), m_initial_height(10) { strcpy(m_caption, "Anti-Grain Geometry Application"); } //------------------------------------------------------------------------ platform_support::~platform_support() { delete m_specific; } //------------------------------------------------------------------------ void platform_support::caption(const char* cap) { strcpy(m_caption, cap); if(m_specific->m_window) { SetWindowTitleWithCFString (m_specific->m_window, CFStringCreateWithCStringNoCopy (nil, cap, kCFStringEncodingASCII, nil)); } } //------------------------------------------------------------------------ static unsigned get_key_flags(UInt32 wflags) { unsigned flags = 0; if(wflags & shiftKey) flags |= kbd_shift; if(wflags & controlKey) flags |= kbd_ctrl; return flags; } //------------------------------------------------------------------------ void platform_support::message(const char* msg) { SInt16 item; Str255 p_msg; ::CopyCStringToPascal (msg, p_msg); ::StandardAlert (kAlertPlainAlert, (const unsigned char*) "\013AGG Message", p_msg, NULL, &item); //::StandardAlert (kAlertPlainAlert, (const unsigned char*) "\pAGG Message", p_msg, NULL, &item); } //------------------------------------------------------------------------ void platform_support::start_timer() { ::Microseconds (&(m_specific->m_sw_start)); } //------------------------------------------------------------------------ double platform_support::elapsed_time() const { UnsignedWide stop; ::Microseconds(&stop); return double(stop.lo - m_specific->m_sw_start.lo) * 1e6 / double(m_specific->m_sw_freq.lo); } //------------------------------------------------------------------------ bool platform_support::init(unsigned width, unsigned height, unsigned flags) { if(m_specific->m_sys_format == pix_format_undefined) { return false; } m_window_flags = flags; // application EventTypeSpec eventType; EventHandlerUPP handlerUPP; eventType.eventClass = kEventClassApplication; eventType.eventKind = kEventAppQuit; handlerUPP = NewEventHandlerUPP(DoAppQuit); InstallApplicationEventHandler (handlerUPP, 1, &eventType, nil, nil); eventType.eventClass = kEventClassMouse; eventType.eventKind = kEventMouseDown; handlerUPP = NewEventHandlerUPP(DoMouseDown); InstallApplicationEventHandler (handlerUPP, 1, &eventType, this, nil); eventType.eventKind = kEventMouseUp; handlerUPP = NewEventHandlerUPP(DoMouseUp); InstallApplicationEventHandler (handlerUPP, 1, &eventType, this, nil); eventType.eventKind = kEventMouseDragged; handlerUPP = NewEventHandlerUPP(DoMouseDragged); InstallApplicationEventHandler (handlerUPP, 1, &eventType, this, nil); eventType.eventClass = kEventClassKeyboard; eventType.eventKind = kEventRawKeyDown; handlerUPP = NewEventHandlerUPP(DoKeyDown); InstallApplicationEventHandler (handlerUPP, 1, &eventType, this, nil); eventType.eventKind = kEventRawKeyUp; handlerUPP = NewEventHandlerUPP(DoKeyUp); InstallApplicationEventHandler (handlerUPP, 1, &eventType, this, nil); eventType.eventKind = kEventRawKeyRepeat; handlerUPP = NewEventHandlerUPP(DoKeyDown); // 'key repeat' is translated to 'key down' InstallApplicationEventHandler (handlerUPP, 1, &eventType, this, nil); WindowAttributes windowAttrs; Rect bounds; // window windowAttrs = kWindowCloseBoxAttribute | kWindowCollapseBoxAttribute | kWindowStandardHandlerAttribute; SetRect (&bounds, 0, 0, width, height); OffsetRect (&bounds, 100, 100); CreateNewWindow (kDocumentWindowClass, windowAttrs, &bounds, &m_specific->m_window); if(m_specific->m_window == nil) { return false; } // I assume the text is ASCII. // Change to kCFStringEncodingMacRoman, kCFStringEncodingISOLatin1, kCFStringEncodingUTF8 or what else you need. SetWindowTitleWithCFString (m_specific->m_window, CFStringCreateWithCStringNoCopy (nil, m_caption, kCFStringEncodingASCII, nil)); eventType.eventClass = kEventClassWindow; eventType.eventKind = kEventWindowClose; handlerUPP = NewEventHandlerUPP(DoWindowClose); InstallWindowEventHandler (m_specific->m_window, handlerUPP, 1, &eventType, this, NULL); eventType.eventKind = kEventWindowDrawContent; handlerUPP = NewEventHandlerUPP(DoWindowDrawContent); InstallWindowEventHandler (m_specific->m_window, handlerUPP, 1, &eventType, this, NULL); // Periodic task // Instead of an idle function I use the Carbon event timer. // You may decide to change the wait value which is currently 50 milliseconds. EventLoopRef mainLoop; EventLoopTimerUPP timerUPP; EventLoopTimerRef theTimer; mainLoop = GetMainEventLoop(); timerUPP = NewEventLoopTimerUPP (DoPeriodicTask); InstallEventLoopTimer (mainLoop, 0, 50 * kEventDurationMillisecond, timerUPP, this, &theTimer); m_specific->create_pmap(width, height, &m_rbuf_window); m_initial_width = width; m_initial_height = height; on_init(); on_resize(width, height); m_specific->m_redraw_flag = true; ShowWindow (m_specific->m_window); SetPortWindowPort (m_specific->m_window); return true; } //------------------------------------------------------------------------ int platform_support::run() { RunApplicationEventLoop (); return true; } //------------------------------------------------------------------------ const char* platform_support::img_ext() const { return ".bmp"; } //------------------------------------------------------------------------ const char* platform_support::full_file_name(const char* file_name) { return file_name; } //------------------------------------------------------------------------ bool platform_support::load_img(unsigned idx, const char* file) { if(idx < max_images) { char fn[1024]; strcpy(fn, file); int len = strlen(fn); #if defined(__MWERKS__) if(len < 4 || stricmp(fn + len - 4, ".BMP") != 0) #else if(len < 4 || strncasecmp(fn + len - 4, ".BMP", 4) != 0) #endif { strcat(fn, ".bmp"); } return m_specific->load_pmap(fn, idx, &m_rbuf_img[idx]); } return true; } //------------------------------------------------------------------------ bool platform_support::save_img(unsigned idx, const char* file) { if(idx < max_images) { char fn[1024]; strcpy(fn, file); int len = strlen(fn); #if defined(__MWERKS__) if(len < 4 || stricmp(fn + len - 4, ".BMP") != 0) #else if(len < 4 || strncasecmp(fn + len - 4, ".BMP", 4) != 0) #endif { strcat(fn, ".bmp"); } return m_specific->save_pmap(fn, idx, &m_rbuf_img[idx]); } return true; } //------------------------------------------------------------------------ bool platform_support::create_img(unsigned idx, unsigned width, unsigned height) { if(idx < max_images) { if(width == 0) width = m_specific->m_pmap_window.width(); if(height == 0) height = m_specific->m_pmap_window.height(); m_specific->m_pmap_img[idx].create(width, height, org_e(m_specific->m_bpp)); m_rbuf_img[idx].attach(m_specific->m_pmap_img[idx].buf(), m_specific->m_pmap_img[idx].width(), m_specific->m_pmap_img[idx].height(), m_flip_y ? -m_specific->m_pmap_img[idx].row_bytes() : m_specific->m_pmap_img[idx].row_bytes()); return true; } return false; } //------------------------------------------------------------------------ void platform_support::force_redraw() { Rect bounds; m_specific->m_redraw_flag = true; // on_ctrl_change (); on_draw(); SetRect(&bounds, 0, 0, m_rbuf_window.width(), m_rbuf_window.height()); InvalWindowRect(m_specific->m_window, &bounds); } //------------------------------------------------------------------------ void platform_support::update_window() { m_specific->display_pmap(m_specific->m_window, &m_rbuf_window); } //------------------------------------------------------------------------ void platform_support::on_init() {} void platform_support::on_resize(int sx, int sy) {} void platform_support::on_idle() {} void platform_support::on_mouse_move(int x, int y, unsigned flags) {} void platform_support::on_mouse_button_down(int x, int y, unsigned flags) {} void platform_support::on_mouse_button_up(int x, int y, unsigned flags) {} void platform_support::on_key(int x, int y, unsigned key, unsigned flags) {} void platform_support::on_ctrl_change() {} void platform_support::on_draw() {} void platform_support::on_post_draw(void* raw_handler) {} //------------------------------------------------------------------------ pascal OSStatus DoWindowClose (EventHandlerCallRef nextHandler, EventRef theEvent, void* userData) { userData; QuitApplicationEventLoop (); return CallNextEventHandler (nextHandler, theEvent); } //------------------------------------------------------------------------ pascal OSStatus DoAppQuit (EventHandlerCallRef nextHandler, EventRef theEvent, void* userData) { userData; return CallNextEventHandler (nextHandler, theEvent); } //------------------------------------------------------------------------ pascal OSStatus DoMouseDown (EventHandlerCallRef nextHandler, EventRef theEvent, void* userData) { Point wheresMyMouse; UInt32 modifier; GetEventParameter (theEvent, kEventParamMouseLocation, typeQDPoint, NULL, sizeof(Point), NULL, &wheresMyMouse); GlobalToLocal (&wheresMyMouse); GetEventParameter (theEvent, kEventParamKeyModifiers, typeUInt32, NULL, sizeof(UInt32), NULL, &modifier); platform_support * app = reinterpret_cast<platform_support*>(userData); app->m_specific->m_cur_x = wheresMyMouse.h; if(app->flip_y()) { app->m_specific->m_cur_y = app->rbuf_window().height() - wheresMyMouse.v; } else { app->m_specific->m_cur_y = wheresMyMouse.v; } app->m_specific->m_input_flags = mouse_left | get_key_flags(modifier); app->m_ctrls.set_cur(app->m_specific->m_cur_x, app->m_specific->m_cur_y); if(app->m_ctrls.on_mouse_button_down(app->m_specific->m_cur_x, app->m_specific->m_cur_y)) { app->on_ctrl_change(); app->force_redraw(); } else { if(app->m_ctrls.in_rect(app->m_specific->m_cur_x, app->m_specific->m_cur_y)) { if(app->m_ctrls.set_cur(app->m_specific->m_cur_x, app->m_specific->m_cur_y)) { app->on_ctrl_change(); app->force_redraw(); } } else { app->on_mouse_button_down(app->m_specific->m_cur_x, app->m_specific->m_cur_y, app->m_specific->m_input_flags); } } return CallNextEventHandler (nextHandler, theEvent); } //------------------------------------------------------------------------ pascal OSStatus DoMouseUp (EventHandlerCallRef nextHandler, EventRef theEvent, void* userData) { Point wheresMyMouse; UInt32 modifier; GetEventParameter (theEvent, kEventParamMouseLocation, typeQDPoint, NULL, sizeof(Point), NULL, &wheresMyMouse); GlobalToLocal (&wheresMyMouse); GetEventParameter (theEvent, kEventParamKeyModifiers, typeUInt32, NULL, sizeof(UInt32), NULL, &modifier); platform_support * app = reinterpret_cast<platform_support*>(userData); app->m_specific->m_cur_x = wheresMyMouse.h; if(app->flip_y()) { app->m_specific->m_cur_y = app->rbuf_window().height() - wheresMyMouse.v; } else { app->m_specific->m_cur_y = wheresMyMouse.v; } app->m_specific->m_input_flags = mouse_left | get_key_flags(modifier); if(app->m_ctrls.on_mouse_button_up(app->m_specific->m_cur_x, app->m_specific->m_cur_y)) { app->on_ctrl_change(); app->force_redraw(); } app->on_mouse_button_up(app->m_specific->m_cur_x, app->m_specific->m_cur_y, app->m_specific->m_input_flags); return CallNextEventHandler (nextHandler, theEvent); } //------------------------------------------------------------------------ pascal OSStatus DoMouseDragged (EventHandlerCallRef nextHandler, EventRef theEvent, void* userData) { Point wheresMyMouse; UInt32 modifier; GetEventParameter (theEvent, kEventParamMouseLocation, typeQDPoint, NULL, sizeof(Point), NULL, &wheresMyMouse); GlobalToLocal (&wheresMyMouse); GetEventParameter (theEvent, kEventParamKeyModifiers, typeUInt32, NULL, sizeof(UInt32), NULL, &modifier); platform_support * app = reinterpret_cast<platform_support*>(userData); app->m_specific->m_cur_x = wheresMyMouse.h; if(app->flip_y()) { app->m_specific->m_cur_y = app->rbuf_window().height() - wheresMyMouse.v; } else { app->m_specific->m_cur_y = wheresMyMouse.v; } app->m_specific->m_input_flags = mouse_left | get_key_flags(modifier); if(app->m_ctrls.on_mouse_move( app->m_specific->m_cur_x, app->m_specific->m_cur_y, (app->m_specific->m_input_flags & mouse_left) != 0)) { app->on_ctrl_change(); app->force_redraw(); } else { app->on_mouse_move(app->m_specific->m_cur_x, app->m_specific->m_cur_y, app->m_specific->m_input_flags); } return CallNextEventHandler (nextHandler, theEvent); } //------------------------------------------------------------------------ pascal OSStatus DoKeyDown (EventHandlerCallRef nextHandler, EventRef theEvent, void* userData) { char key_code; UInt32 modifier; GetEventParameter (theEvent, kEventParamKeyMacCharCodes, typeChar, NULL, sizeof(char), NULL, &key_code); GetEventParameter (theEvent, kEventParamKeyModifiers, typeUInt32, NULL, sizeof(UInt32), NULL, &modifier); platform_support * app = reinterpret_cast<platform_support*>(userData); app->m_specific->m_last_translated_key = 0; switch(modifier) { case controlKey: app->m_specific->m_input_flags |= kbd_ctrl; break; case shiftKey: app->m_specific->m_input_flags |= kbd_shift; break; default: app->m_specific->translate(key_code); break; } if(app->m_specific->m_last_translated_key) { bool left = false; bool up = false; bool right = false; bool down = false; switch(app->m_specific->m_last_translated_key) { case key_left: left = true; break; case key_up: up = true; break; case key_right: right = true; break; case key_down: down = true; break; //On a Mac, screenshots are handled by the system. case key_f2: app->copy_window_to_img(agg::platform_support::max_images - 1); app->save_img(agg::platform_support::max_images - 1, "screenshot"); break; } if(app->m_ctrls.on_arrow_keys(left, right, down, up)) { app->on_ctrl_change(); app->force_redraw(); } else { app->on_key(app->m_specific->m_cur_x, app->m_specific->m_cur_y, app->m_specific->m_last_translated_key, app->m_specific->m_input_flags); } } return CallNextEventHandler (nextHandler, theEvent); } //------------------------------------------------------------------------ pascal OSStatus DoKeyUp (EventHandlerCallRef nextHandler, EventRef theEvent, void* userData) { char key_code; UInt32 modifier; GetEventParameter (theEvent, kEventParamKeyMacCharCodes, typeChar, NULL, sizeof(char), NULL, &key_code); GetEventParameter (theEvent, kEventParamKeyModifiers, typeUInt32, NULL, sizeof(UInt32), NULL, &modifier); platform_support * app = reinterpret_cast<platform_support*>(userData); app->m_specific->m_last_translated_key = 0; switch(modifier) { case controlKey: app->m_specific->m_input_flags &= ~kbd_ctrl; break; case shiftKey: app->m_specific->m_input_flags &= ~kbd_shift; break; } return CallNextEventHandler (nextHandler, theEvent); } //------------------------------------------------------------------------ pascal OSStatus DoWindowDrawContent (EventHandlerCallRef nextHandler, EventRef theEvent, void* userData) { platform_support * app = reinterpret_cast<platform_support*>(userData); if(app) { if(app->m_specific->m_redraw_flag) { app->on_draw(); app->m_specific->m_redraw_flag = false; } app->m_specific->display_pmap(app->m_specific->m_window, &app->rbuf_window()); } return CallNextEventHandler (nextHandler, theEvent); } //------------------------------------------------------------------------ pascal void DoPeriodicTask (EventLoopTimerRef theTimer, void* userData) { platform_support * app = reinterpret_cast<platform_support*>(userData); if(!app->wait_mode()) app->on_idle(); } } //---------------------------------------------------------------------------- int agg_main(int argc, char* argv[]); // Hm. Classic MacOS does not know command line input. // CodeWarrior provides a way to mimic command line input. // The function 'ccommand' can be used to get the command // line arguments. //---------------------------------------------------------------------------- int main(int argc, char* argv[]) { #if defined(__MWERKS__) // argc = ccommand (&argv); #endif // Check if we are launched by double-clicking under OSX // Get rid of extra argument, this will confuse the standard argument parsing // calls used in the examples to get the name of the image file to be used if ( argc >= 2 && strncmp (argv[1], "-psn", 4) == 0 ) { argc = 1; } launch: return agg_main(argc, argv); }������������agg-2.5+dfsg1/src/platform/sdl/���������������������������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�016453� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/src/platform/sdl/Makefile.am����������������������������������������������������������0000644�0000000�0000000�00000000443�10703246330�020510� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������if ENABLE_SDL lib_LTLIBRARIES = libaggplatformsdl.la libaggplatformsdl_la_LDFLAGS = -version-info @AGG_LIB_VERSION@ libaggplatformsdl_la_SOURCES = agg_platform_support.cpp libaggplatformsdl_la_CXXFLAGS = -I$(top_srcdir)/include @SDL_CFLAGS@ libaggplatformsdl_la_LIBADD = @SDL_LIBS@ endif �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/src/platform/sdl/agg_platform_support.cpp���������������������������������������������0000644�0000000�0000000�00000055003�10703246330�023420� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Copyright (C) 2004 Mauricio Piacentini (SDL Support) // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #include <string.h> #include "platform/agg_platform_support.h" #include "SDL.h" #include "SDL_byteorder.h" namespace agg { //------------------------------------------------------------------------ class platform_specific { public: platform_specific(pix_format_e format, bool flip_y); ~platform_specific(); pix_format_e m_format; pix_format_e m_sys_format; bool m_flip_y; unsigned m_bpp; unsigned m_sys_bpp; unsigned m_rmask; unsigned m_gmask; unsigned m_bmask; unsigned m_amask; bool m_update_flag; bool m_resize_flag; bool m_initialized; SDL_Surface* m_surf_screen; SDL_Surface* m_surf_window; SDL_Surface* m_surf_img[platform_support::max_images]; int m_cur_x; int m_cur_y; int m_sw_start; }; //------------------------------------------------------------------------ platform_specific::platform_specific(pix_format_e format, bool flip_y) : m_format(format), m_sys_format(pix_format_undefined), m_flip_y(flip_y), m_bpp(0), m_sys_bpp(0), m_update_flag(true), m_resize_flag(true), m_initialized(false), m_surf_screen(0), m_surf_window(0), m_cur_x(0), m_cur_y(0) { memset(m_surf_img, 0, sizeof(m_surf_img)); switch(m_format) { case pix_format_gray8: m_bpp = 8; break; case pix_format_rgb565: m_rmask = 0xF800; m_gmask = 0x7E0; m_bmask = 0x1F; m_amask = 0; m_bpp = 16; break; case pix_format_rgb555: m_rmask = 0x7C00; m_gmask = 0x3E0; m_bmask = 0x1F; m_amask = 0; m_bpp = 16; break; #if SDL_BYTEORDER == SDL_LIL_ENDIAN case pix_format_rgb24: m_rmask = 0xFF; m_gmask = 0xFF00; m_bmask = 0xFF0000; m_amask = 0; m_bpp = 24; break; case pix_format_bgr24: m_rmask = 0xFF0000; m_gmask = 0xFF00; m_bmask = 0xFF; m_amask = 0; m_bpp = 24; break; case pix_format_bgra32: m_rmask = 0xFF0000; m_gmask = 0xFF00; m_bmask = 0xFF; m_amask = 0xFF000000; m_bpp = 32; break; case pix_format_abgr32: m_rmask = 0xFF000000; m_gmask = 0xFF0000; m_bmask = 0xFF00; m_amask = 0xFF; m_bpp = 32; break; case pix_format_argb32: m_rmask = 0xFF00; m_gmask = 0xFF0000; m_bmask = 0xFF000000; m_amask = 0xFF; m_bpp = 32; break; case pix_format_rgba32: m_rmask = 0xFF; m_gmask = 0xFF00; m_bmask = 0xFF0000; m_amask = 0xFF000000; m_bpp = 32; break; #else //SDL_BIG_ENDIAN (PPC) case pix_format_rgb24: m_rmask = 0xFF0000; m_gmask = 0xFF00; m_bmask = 0xFF; m_amask = 0; m_bpp = 24; break; case pix_format_bgr24: m_rmask = 0xFF; m_gmask = 0xFF00; m_bmask = 0xFF0000; m_amask = 0; m_bpp = 24; break; case pix_format_bgra32: m_rmask = 0xFF00; m_gmask = 0xFF0000; m_bmask = 0xFF000000; m_amask = 0xFF; m_bpp = 32; break; case pix_format_abgr32: m_rmask = 0xFF; m_gmask = 0xFF00; m_bmask = 0xFF0000; m_amask = 0xFF000000; m_bpp = 32; break; case pix_format_argb32: m_rmask = 0xFF0000; m_gmask = 0xFF00; m_bmask = 0xFF; m_amask = 0xFF000000; m_bpp = 32; break; case pix_format_rgba32: m_rmask = 0xFF000000; m_gmask = 0xFF0000; m_bmask = 0xFF00; m_amask = 0xFF; m_bpp = 32; break; #endif } } //------------------------------------------------------------------------ platform_specific::~platform_specific() { int i; for(i = platform_support::max_images - 1; i >= 0; --i) { if(m_surf_img[i]) SDL_FreeSurface(m_surf_img[i]); } if(m_surf_window) SDL_FreeSurface(m_surf_window); if(m_surf_screen) SDL_FreeSurface(m_surf_screen); } //------------------------------------------------------------------------ platform_support::platform_support(pix_format_e format, bool flip_y) : m_specific(new platform_specific(format, flip_y)), m_format(format), m_bpp(m_specific->m_bpp), m_window_flags(0), m_wait_mode(true), m_flip_y(flip_y) { SDL_Init(SDL_INIT_VIDEO); strcpy(m_caption, "Anti-Grain Geometry Application"); } //------------------------------------------------------------------------ platform_support::~platform_support() { delete m_specific; } //------------------------------------------------------------------------ void platform_support::caption(const char* cap) { strcpy(m_caption, cap); if(m_specific->m_initialized) { SDL_WM_SetCaption(cap, 0); } } //------------------------------------------------------------------------ bool platform_support::init(unsigned width, unsigned height, unsigned flags) { m_window_flags = flags; unsigned wflags = SDL_SWSURFACE; if(m_window_flags & window_hw_buffer) { wflags = SDL_HWSURFACE; } if(m_window_flags & window_resize) { wflags |= SDL_RESIZABLE; } if(m_specific->m_surf_screen) SDL_FreeSurface(m_specific->m_surf_screen); m_specific->m_surf_screen = SDL_SetVideoMode(width, height, m_bpp, wflags); if(m_specific->m_surf_screen == 0) { fprintf(stderr, "Unable to set %dx%d %d bpp video: %s\n", width, height, m_bpp, ::SDL_GetError()); return false; } SDL_WM_SetCaption(m_caption, 0); if(m_specific->m_surf_window) SDL_FreeSurface(m_specific->m_surf_window); m_specific->m_surf_window = SDL_CreateRGBSurface(SDL_HWSURFACE, m_specific->m_surf_screen->w, m_specific->m_surf_screen->h, m_specific->m_surf_screen->format->BitsPerPixel, m_specific->m_rmask, m_specific->m_gmask, m_specific->m_bmask, m_specific->m_amask); if(m_specific->m_surf_window == 0) { fprintf(stderr, "Unable to create image buffer %dx%d %d bpp: %s\n", width, height, m_bpp, SDL_GetError()); return false; } m_rbuf_window.attach((unsigned char*)m_specific->m_surf_window->pixels, m_specific->m_surf_window->w, m_specific->m_surf_window->h, m_flip_y ? -m_specific->m_surf_window->pitch : m_specific->m_surf_window->pitch); if(!m_specific->m_initialized) { m_initial_width = width; m_initial_height = height; on_init(); m_specific->m_initialized = true; } on_resize(m_rbuf_window.width(), m_rbuf_window.height()); m_specific->m_update_flag = true; return true; } //------------------------------------------------------------------------ void platform_support::update_window() { SDL_BlitSurface(m_specific->m_surf_window, 0, m_specific->m_surf_screen, 0); SDL_UpdateRect(m_specific->m_surf_screen, 0, 0, 0, 0); } //------------------------------------------------------------------------ int platform_support::run() { SDL_Event event; bool ev_flag = false; for(;;) { if(m_specific->m_update_flag) { on_draw(); update_window(); m_specific->m_update_flag = false; } ev_flag = false; if(m_wait_mode) { SDL_WaitEvent(&event); ev_flag = true; } else { if(SDL_PollEvent(&event)) { ev_flag = true; } else { on_idle(); } } if(ev_flag) { if(event.type == SDL_QUIT) { break; } int y; unsigned flags = 0; switch (event.type) { case SDL_VIDEORESIZE: if(!init(event.resize.w, event.resize.h, m_window_flags)) return false; on_resize(m_rbuf_window.width(), m_rbuf_window.height()); trans_affine_resizing(event.resize.w, event.resize.h); m_specific->m_update_flag = true; break; case SDL_KEYDOWN: { flags = 0; if(event.key.keysym.mod & KMOD_SHIFT) flags |= kbd_shift; if(event.key.keysym.mod & KMOD_CTRL) flags |= kbd_ctrl; bool left = false; bool up = false; bool right = false; bool down = false; switch(event.key.keysym.sym) { case key_left: left = true; break; case key_up: up = true; break; case key_right: right = true; break; case key_down: down = true; break; } if(m_ctrls.on_arrow_keys(left, right, down, up)) { on_ctrl_change(); force_redraw(); } else { on_key(m_specific->m_cur_x, m_specific->m_cur_y, event.key.keysym.sym, flags); } } break; case SDL_MOUSEMOTION: y = m_flip_y ? m_rbuf_window.height() - event.motion.y : event.motion.y; m_specific->m_cur_x = event.motion.x; m_specific->m_cur_y = y; flags = 0; if(event.motion.state & SDL_BUTTON_LMASK) flags |= mouse_left; if(event.motion.state & SDL_BUTTON_RMASK) flags |= mouse_right; if(m_ctrls.on_mouse_move(m_specific->m_cur_x, m_specific->m_cur_y, (flags & mouse_left) != 0)) { on_ctrl_change(); force_redraw(); } else { on_mouse_move(m_specific->m_cur_x, m_specific->m_cur_y, flags); } SDL_Event eventtrash; while (SDL_PeepEvents(&eventtrash, 1, SDL_GETEVENT, SDL_EVENTMASK(SDL_MOUSEMOTION))!=0){;} break; case SDL_MOUSEBUTTONDOWN: y = m_flip_y ? m_rbuf_window.height() - event.button.y : event.button.y; m_specific->m_cur_x = event.button.x; m_specific->m_cur_y = y; flags = 0; switch(event.button.button) { case SDL_BUTTON_LEFT: { flags = mouse_left; if(m_ctrls.on_mouse_button_down(m_specific->m_cur_x, m_specific->m_cur_y)) { m_ctrls.set_cur(m_specific->m_cur_x, m_specific->m_cur_y); on_ctrl_change(); force_redraw(); } else { if(m_ctrls.in_rect(m_specific->m_cur_x, m_specific->m_cur_y)) { if(m_ctrls.set_cur(m_specific->m_cur_x, m_specific->m_cur_y)) { on_ctrl_change(); force_redraw(); } } else { on_mouse_button_down(m_specific->m_cur_x, m_specific->m_cur_y, flags); } } } break; case SDL_BUTTON_RIGHT: flags = mouse_right; on_mouse_button_down(m_specific->m_cur_x, m_specific->m_cur_y, flags); break; } //switch(event.button.button) break; case SDL_MOUSEBUTTONUP: y = m_flip_y ? m_rbuf_window.height() - event.button.y : event.button.y; m_specific->m_cur_x = event.button.x; m_specific->m_cur_y = y; flags = 0; if(m_ctrls.on_mouse_button_up(m_specific->m_cur_x, m_specific->m_cur_y)) { on_ctrl_change(); force_redraw(); } on_mouse_button_up(m_specific->m_cur_x, m_specific->m_cur_y, flags); break; } } } return 0; } //------------------------------------------------------------------------ const char* platform_support::img_ext() const { return ".bmp"; } //------------------------------------------------------------------------ const char* platform_support::full_file_name(const char* file_name) { return file_name; } //------------------------------------------------------------------------ bool platform_support::load_img(unsigned idx, const char* file) { if(idx < max_images) { if(m_specific->m_surf_img[idx]) SDL_FreeSurface(m_specific->m_surf_img[idx]); char fn[1024]; strcpy(fn, file); int len = strlen(fn); if(len < 4 || strcmp(fn + len - 4, ".bmp") != 0) { strcat(fn, ".bmp"); } SDL_Surface* tmp_surf = SDL_LoadBMP(fn); if (tmp_surf == 0) { fprintf(stderr, "Couldn't load %s: %s\n", fn, SDL_GetError()); return false; } SDL_PixelFormat format; format.palette = 0; format.BitsPerPixel = m_bpp; format.BytesPerPixel = m_bpp >> 8; format.Rmask = m_specific->m_rmask; format.Gmask = m_specific->m_gmask; format.Bmask = m_specific->m_bmask; format.Amask = m_specific->m_amask; format.Rshift = 0; format.Gshift = 0; format.Bshift = 0; format.Ashift = 0; format.Rloss = 0; format.Gloss = 0; format.Bloss = 0; format.Aloss = 0; format.colorkey = 0; format.alpha = 0; m_specific->m_surf_img[idx] = SDL_ConvertSurface(tmp_surf, &format, SDL_SWSURFACE); SDL_FreeSurface(tmp_surf); if(m_specific->m_surf_img[idx] == 0) return false; m_rbuf_img[idx].attach((unsigned char*)m_specific->m_surf_img[idx]->pixels, m_specific->m_surf_img[idx]->w, m_specific->m_surf_img[idx]->h, m_flip_y ? -m_specific->m_surf_img[idx]->pitch : m_specific->m_surf_img[idx]->pitch); return true; } return false; } //------------------------------------------------------------------------ bool platform_support::save_img(unsigned idx, const char* file) { if(idx < max_images && m_specific->m_surf_img[idx]) { char fn[1024]; strcpy(fn, file); int len = strlen(fn); if(len < 4 || strcmp(fn + len - 4, ".bmp") != 0) { strcat(fn, ".bmp"); } return SDL_SaveBMP(m_specific->m_surf_img[idx], fn) == 0; } return false; } //------------------------------------------------------------------------ bool platform_support::create_img(unsigned idx, unsigned width, unsigned height) { if(idx < max_images) { if(m_specific->m_surf_img[idx]) SDL_FreeSurface(m_specific->m_surf_img[idx]); m_specific->m_surf_img[idx] = SDL_CreateRGBSurface(SDL_SWSURFACE, width, height, m_specific->m_surf_screen->format->BitsPerPixel, m_specific->m_rmask, m_specific->m_gmask, m_specific->m_bmask, m_specific->m_amask); if(m_specific->m_surf_img[idx] == 0) { fprintf(stderr, "Couldn't create image: %s\n", SDL_GetError()); return false; } m_rbuf_img[idx].attach((unsigned char*)m_specific->m_surf_img[idx]->pixels, m_specific->m_surf_img[idx]->w, m_specific->m_surf_img[idx]->h, m_flip_y ? -m_specific->m_surf_img[idx]->pitch : m_specific->m_surf_img[idx]->pitch); return true; } return false; } //------------------------------------------------------------------------ void platform_support::start_timer() { m_specific->m_sw_start = SDL_GetTicks(); } //------------------------------------------------------------------------ double platform_support::elapsed_time() const { int stop = SDL_GetTicks(); return double(stop - m_specific->m_sw_start); } //------------------------------------------------------------------------ void platform_support::message(const char* msg) { fprintf(stderr, "%s\n", msg); } //------------------------------------------------------------------------ void platform_support::force_redraw() { m_specific->m_update_flag = true; } //------------------------------------------------------------------------ void platform_support::on_init() {} void platform_support::on_resize(int sx, int sy) {} void platform_support::on_idle() {} void platform_support::on_mouse_move(int x, int y, unsigned flags) {} void platform_support::on_mouse_button_down(int x, int y, unsigned flags) {} void platform_support::on_mouse_button_up(int x, int y, unsigned flags) {} void platform_support::on_key(int x, int y, unsigned key, unsigned flags) {} void platform_support::on_ctrl_change() {} void platform_support::on_draw() {} void platform_support::on_post_draw(void* raw_handler) {} } int agg_main(int argc, char* argv[]); int main(int argc, char* argv[]) { return agg_main(argc, argv); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/src/platform/win32/�������������������������������������������������������������������0000755�0000000�0000000�00000000000�10703246330�016633� 5����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/src/platform/win32/Makefile.am��������������������������������������������������������0000644�0000000�0000000�00000000575�10703246330�020676� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ if ENABLE_WIN32 lib_LTLIBRARIES = libaggplatformwin32.la libaggplatformwin32_la_LDFLAGS = -version-info @AGG_LIB_VERSION@ libaggplatformwin32_la_SOURCES = agg_platform_support.cpp \ agg_win32_bmp.cpp libaggplatformwin32_la_CXXFLAGS = -I$(top_srcdir)/include @WINDOWS_CFLAGS@ libaggplatformwin32_la_LIBADD = @WINDOWS_LIBS@ $(top_builddir)/src/libagg.la endif �����������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/src/platform/win32/agg_platform_support.cpp�������������������������������������������0000644�0000000�0000000�00000134564�10703246330�023612� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // AGG is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #include <windows.h> #include <string.h> #include "platform/agg_platform_support.h" #include "platform/win32/agg_win32_bmp.h" #include "util/agg_color_conv_rgb8.h" #include "util/agg_color_conv_rgb16.h" namespace agg { //------------------------------------------------------------------------ HINSTANCE g_windows_instance = 0; int g_windows_cmd_show = 0; //------------------------------------------------------------------------ class platform_specific { public: platform_specific(pix_format_e format, bool flip_y); void create_pmap(unsigned width, unsigned height, rendering_buffer* wnd); void display_pmap(HDC dc, const rendering_buffer* src); bool load_pmap(const char* fn, unsigned idx, rendering_buffer* dst); bool save_pmap(const char* fn, unsigned idx, const rendering_buffer* src); unsigned translate(unsigned keycode); pix_format_e m_format; pix_format_e m_sys_format; bool m_flip_y; unsigned m_bpp; unsigned m_sys_bpp; HWND m_hwnd; pixel_map m_pmap_window; pixel_map m_pmap_img[platform_support::max_images]; unsigned m_keymap[256]; unsigned m_last_translated_key; int m_cur_x; int m_cur_y; unsigned m_input_flags; bool m_redraw_flag; HDC m_current_dc; LARGE_INTEGER m_sw_freq; LARGE_INTEGER m_sw_start; }; //------------------------------------------------------------------------ platform_specific::platform_specific(pix_format_e format, bool flip_y) : m_format(format), m_sys_format(pix_format_undefined), m_flip_y(flip_y), m_bpp(0), m_sys_bpp(0), m_hwnd(0), m_last_translated_key(0), m_cur_x(0), m_cur_y(0), m_input_flags(0), m_redraw_flag(true), m_current_dc(0) { memset(m_keymap, 0, sizeof(m_keymap)); m_keymap[VK_PAUSE] = key_pause; m_keymap[VK_CLEAR] = key_clear; m_keymap[VK_NUMPAD0] = key_kp0; m_keymap[VK_NUMPAD1] = key_kp1; m_keymap[VK_NUMPAD2] = key_kp2; m_keymap[VK_NUMPAD3] = key_kp3; m_keymap[VK_NUMPAD4] = key_kp4; m_keymap[VK_NUMPAD5] = key_kp5; m_keymap[VK_NUMPAD6] = key_kp6; m_keymap[VK_NUMPAD7] = key_kp7; m_keymap[VK_NUMPAD8] = key_kp8; m_keymap[VK_NUMPAD9] = key_kp9; m_keymap[VK_DECIMAL] = key_kp_period; m_keymap[VK_DIVIDE] = key_kp_divide; m_keymap[VK_MULTIPLY] = key_kp_multiply; m_keymap[VK_SUBTRACT] = key_kp_minus; m_keymap[VK_ADD] = key_kp_plus; m_keymap[VK_UP] = key_up; m_keymap[VK_DOWN] = key_down; m_keymap[VK_RIGHT] = key_right; m_keymap[VK_LEFT] = key_left; m_keymap[VK_INSERT] = key_insert; m_keymap[VK_DELETE] = key_delete; m_keymap[VK_HOME] = key_home; m_keymap[VK_END] = key_end; m_keymap[VK_PRIOR] = key_page_up; m_keymap[VK_NEXT] = key_page_down; m_keymap[VK_F1] = key_f1; m_keymap[VK_F2] = key_f2; m_keymap[VK_F3] = key_f3; m_keymap[VK_F4] = key_f4; m_keymap[VK_F5] = key_f5; m_keymap[VK_F6] = key_f6; m_keymap[VK_F7] = key_f7; m_keymap[VK_F8] = key_f8; m_keymap[VK_F9] = key_f9; m_keymap[VK_F10] = key_f10; m_keymap[VK_F11] = key_f11; m_keymap[VK_F12] = key_f12; m_keymap[VK_F13] = key_f13; m_keymap[VK_F14] = key_f14; m_keymap[VK_F15] = key_f15; m_keymap[VK_NUMLOCK] = key_numlock; m_keymap[VK_CAPITAL] = key_capslock; m_keymap[VK_SCROLL] = key_scrollock; switch(m_format) { case pix_format_bw: m_sys_format = pix_format_bw; m_bpp = 1; m_sys_bpp = 1; break; case pix_format_gray8: m_sys_format = pix_format_gray8; m_bpp = 8; m_sys_bpp = 8; break; case pix_format_gray16: m_sys_format = pix_format_gray8; m_bpp = 16; m_sys_bpp = 8; break; case pix_format_rgb565: case pix_format_rgb555: m_sys_format = pix_format_rgb555; m_bpp = 16; m_sys_bpp = 16; break; case pix_format_rgbAAA: case pix_format_bgrAAA: case pix_format_rgbBBA: case pix_format_bgrABB: m_sys_format = pix_format_bgr24; m_bpp = 32; m_sys_bpp = 24; break; case pix_format_rgb24: case pix_format_bgr24: m_sys_format = pix_format_bgr24; m_bpp = 24; m_sys_bpp = 24; break; case pix_format_rgb48: case pix_format_bgr48: m_sys_format = pix_format_bgr24; m_bpp = 48; m_sys_bpp = 24; break; case pix_format_bgra32: case pix_format_abgr32: case pix_format_argb32: case pix_format_rgba32: m_sys_format = pix_format_bgra32; m_bpp = 32; m_sys_bpp = 32; break; case pix_format_bgra64: case pix_format_abgr64: case pix_format_argb64: case pix_format_rgba64: m_sys_format = pix_format_bgra32; m_bpp = 64; m_sys_bpp = 32; break; } ::QueryPerformanceFrequency(&m_sw_freq); ::QueryPerformanceCounter(&m_sw_start); } //------------------------------------------------------------------------ void platform_specific::create_pmap(unsigned width, unsigned height, rendering_buffer* wnd) { m_pmap_window.create(width, height, org_e(m_bpp)); wnd->attach(m_pmap_window.buf(), m_pmap_window.width(), m_pmap_window.height(), m_flip_y ? m_pmap_window.stride() : -m_pmap_window.stride()); } //------------------------------------------------------------------------ static void convert_pmap(rendering_buffer* dst, const rendering_buffer* src, pix_format_e format) { switch(format) { case pix_format_gray8: break; case pix_format_gray16: color_conv(dst, src, color_conv_gray16_to_gray8()); break; case pix_format_rgb565: color_conv(dst, src, color_conv_rgb565_to_rgb555()); break; case pix_format_rgbAAA: color_conv(dst, src, color_conv_rgbAAA_to_bgr24()); break; case pix_format_bgrAAA: color_conv(dst, src, color_conv_bgrAAA_to_bgr24()); break; case pix_format_rgbBBA: color_conv(dst, src, color_conv_rgbBBA_to_bgr24()); break; case pix_format_bgrABB: color_conv(dst, src, color_conv_bgrABB_to_bgr24()); break; case pix_format_rgb24: color_conv(dst, src, color_conv_rgb24_to_bgr24()); break; case pix_format_rgb48: color_conv(dst, src, color_conv_rgb48_to_bgr24()); break; case pix_format_bgr48: color_conv(dst, src, color_conv_bgr48_to_bgr24()); break; case pix_format_abgr32: color_conv(dst, src, color_conv_abgr32_to_bgra32()); break; case pix_format_argb32: color_conv(dst, src, color_conv_argb32_to_bgra32()); break; case pix_format_rgba32: color_conv(dst, src, color_conv_rgba32_to_bgra32()); break; case pix_format_bgra64: color_conv(dst, src, color_conv_bgra64_to_bgra32()); break; case pix_format_abgr64: color_conv(dst, src, color_conv_abgr64_to_bgra32()); break; case pix_format_argb64: color_conv(dst, src, color_conv_argb64_to_bgra32()); break; case pix_format_rgba64: color_conv(dst, src, color_conv_rgba64_to_bgra32()); break; } } //------------------------------------------------------------------------ void platform_specific::display_pmap(HDC dc, const rendering_buffer* src) { if(m_sys_format == m_format) { m_pmap_window.draw(dc); } else { pixel_map pmap_tmp; pmap_tmp.create(m_pmap_window.width(), m_pmap_window.height(), org_e(m_sys_bpp)); rendering_buffer rbuf_tmp; rbuf_tmp.attach(pmap_tmp.buf(), pmap_tmp.width(), pmap_tmp.height(), m_flip_y ? pmap_tmp.stride() : -pmap_tmp.stride()); convert_pmap(&rbuf_tmp, src, m_format); pmap_tmp.draw(dc); } } //------------------------------------------------------------------------ bool platform_specific::save_pmap(const char* fn, unsigned idx, const rendering_buffer* src) { if(m_sys_format == m_format) { return m_pmap_img[idx].save_as_bmp(fn); } pixel_map pmap_tmp; pmap_tmp.create(m_pmap_img[idx].width(), m_pmap_img[idx].height(), org_e(m_sys_bpp)); rendering_buffer rbuf_tmp; rbuf_tmp.attach(pmap_tmp.buf(), pmap_tmp.width(), pmap_tmp.height(), m_flip_y ? pmap_tmp.stride() : -pmap_tmp.stride()); convert_pmap(&rbuf_tmp, src, m_format); return pmap_tmp.save_as_bmp(fn); } //------------------------------------------------------------------------ bool platform_specific::load_pmap(const char* fn, unsigned idx, rendering_buffer* dst) { pixel_map pmap_tmp; if(!pmap_tmp.load_from_bmp(fn)) return false; rendering_buffer rbuf_tmp; rbuf_tmp.attach(pmap_tmp.buf(), pmap_tmp.width(), pmap_tmp.height(), m_flip_y ? pmap_tmp.stride() : -pmap_tmp.stride()); m_pmap_img[idx].create(pmap_tmp.width(), pmap_tmp.height(), org_e(m_bpp), 0); dst->attach(m_pmap_img[idx].buf(), m_pmap_img[idx].width(), m_pmap_img[idx].height(), m_flip_y ? m_pmap_img[idx].stride() : -m_pmap_img[idx].stride()); switch(m_format) { case pix_format_gray8: switch(pmap_tmp.bpp()) { //case 16: color_conv(dst, &rbuf_tmp, color_conv_rgb555_to_gray8()); break; case 24: color_conv(dst, &rbuf_tmp, color_conv_bgr24_to_gray8()); break; //case 32: color_conv(dst, &rbuf_tmp, color_conv_bgra32_to_gray8()); break; } break; case pix_format_gray16: switch(pmap_tmp.bpp()) { //case 16: color_conv(dst, &rbuf_tmp, color_conv_rgb555_to_gray16()); break; case 24: color_conv(dst, &rbuf_tmp, color_conv_bgr24_to_gray16()); break; //case 32: color_conv(dst, &rbuf_tmp, color_conv_bgra32_to_gray16()); break; } break; case pix_format_rgb555: switch(pmap_tmp.bpp()) { case 16: color_conv(dst, &rbuf_tmp, color_conv_rgb555_to_rgb555()); break; case 24: color_conv(dst, &rbuf_tmp, color_conv_bgr24_to_rgb555()); break; case 32: color_conv(dst, &rbuf_tmp, color_conv_bgra32_to_rgb555()); break; } break; case pix_format_rgb565: switch(pmap_tmp.bpp()) { case 16: color_conv(dst, &rbuf_tmp, color_conv_rgb555_to_rgb565()); break; case 24: color_conv(dst, &rbuf_tmp, color_conv_bgr24_to_rgb565()); break; case 32: color_conv(dst, &rbuf_tmp, color_conv_bgra32_to_rgb565()); break; } break; case pix_format_rgb24: switch(pmap_tmp.bpp()) { case 16: color_conv(dst, &rbuf_tmp, color_conv_rgb555_to_rgb24()); break; case 24: color_conv(dst, &rbuf_tmp, color_conv_bgr24_to_rgb24()); break; case 32: color_conv(dst, &rbuf_tmp, color_conv_bgra32_to_rgb24()); break; } break; case pix_format_bgr24: switch(pmap_tmp.bpp()) { case 16: color_conv(dst, &rbuf_tmp, color_conv_rgb555_to_bgr24()); break; case 24: color_conv(dst, &rbuf_tmp, color_conv_bgr24_to_bgr24()); break; case 32: color_conv(dst, &rbuf_tmp, color_conv_bgra32_to_bgr24()); break; } break; case pix_format_rgb48: switch(pmap_tmp.bpp()) { //case 16: color_conv(dst, &rbuf_tmp, color_conv_rgb555_to_rgb48()); break; case 24: color_conv(dst, &rbuf_tmp, color_conv_bgr24_to_rgb48()); break; //case 32: color_conv(dst, &rbuf_tmp, color_conv_bgra32_to_rgb48()); break; } break; case pix_format_bgr48: switch(pmap_tmp.bpp()) { //case 16: color_conv(dst, &rbuf_tmp, color_conv_rgb555_to_bgr48()); break; case 24: color_conv(dst, &rbuf_tmp, color_conv_bgr24_to_bgr48()); break; //case 32: color_conv(dst, &rbuf_tmp, color_conv_bgra32_to_bgr48()); break; } break; case pix_format_abgr32: switch(pmap_tmp.bpp()) { case 16: color_conv(dst, &rbuf_tmp, color_conv_rgb555_to_abgr32()); break; case 24: color_conv(dst, &rbuf_tmp, color_conv_bgr24_to_abgr32()); break; case 32: color_conv(dst, &rbuf_tmp, color_conv_bgra32_to_abgr32()); break; } break; case pix_format_argb32: switch(pmap_tmp.bpp()) { case 16: color_conv(dst, &rbuf_tmp, color_conv_rgb555_to_argb32()); break; case 24: color_conv(dst, &rbuf_tmp, color_conv_bgr24_to_argb32()); break; case 32: color_conv(dst, &rbuf_tmp, color_conv_bgra32_to_argb32()); break; } break; case pix_format_bgra32: switch(pmap_tmp.bpp()) { case 16: color_conv(dst, &rbuf_tmp, color_conv_rgb555_to_bgra32()); break; case 24: color_conv(dst, &rbuf_tmp, color_conv_bgr24_to_bgra32()); break; case 32: color_conv(dst, &rbuf_tmp, color_conv_bgra32_to_bgra32()); break; } break; case pix_format_rgba32: switch(pmap_tmp.bpp()) { case 16: color_conv(dst, &rbuf_tmp, color_conv_rgb555_to_rgba32()); break; case 24: color_conv(dst, &rbuf_tmp, color_conv_bgr24_to_rgba32()); break; case 32: color_conv(dst, &rbuf_tmp, color_conv_bgra32_to_rgba32()); break; } break; case pix_format_abgr64: switch(pmap_tmp.bpp()) { //case 16: color_conv(dst, &rbuf_tmp, color_conv_rgb555_to_abgr64()); break; case 24: color_conv(dst, &rbuf_tmp, color_conv_bgr24_to_abgr64()); break; //case 32: color_conv(dst, &rbuf_tmp, color_conv_bgra32_to_abgr64()); break; } break; case pix_format_argb64: switch(pmap_tmp.bpp()) { //case 16: color_conv(dst, &rbuf_tmp, color_conv_rgb555_to_argb64()); break; case 24: color_conv(dst, &rbuf_tmp, color_conv_bgr24_to_argb64()); break; //case 32: color_conv(dst, &rbuf_tmp, color_conv_bgra32_to_argb64()); break; } break; case pix_format_bgra64: switch(pmap_tmp.bpp()) { //case 16: color_conv(dst, &rbuf_tmp, color_conv_rgb555_to_bgra64()); break; case 24: color_conv(dst, &rbuf_tmp, color_conv_bgr24_to_bgra64()); break; //case 32: color_conv(dst, &rbuf_tmp, color_conv_bgra32_to_bgra64()); break; } break; case pix_format_rgba64: switch(pmap_tmp.bpp()) { //case 16: color_conv(dst, &rbuf_tmp, color_conv_rgb555_to_rgba64()); break; case 24: color_conv(dst, &rbuf_tmp, color_conv_bgr24_to_rgba64()); break; //case 32: color_conv(dst, &rbuf_tmp, color_conv_bgra32_to_rgba64()); break; } break; } return true; } //------------------------------------------------------------------------ unsigned platform_specific::translate(unsigned keycode) { return m_last_translated_key = (keycode > 255) ? 0 : m_keymap[keycode]; } //------------------------------------------------------------------------ platform_support::platform_support(pix_format_e format, bool flip_y) : m_specific(new platform_specific(format, flip_y)), m_format(format), m_bpp(m_specific->m_bpp), m_window_flags(0), m_wait_mode(true), m_flip_y(flip_y), m_initial_width(10), m_initial_height(10) { strcpy(m_caption, "Anti-Grain Geometry Application"); } //------------------------------------------------------------------------ platform_support::~platform_support() { delete m_specific; } //------------------------------------------------------------------------ void platform_support::caption(const char* cap) { strcpy(m_caption, cap); if(m_specific->m_hwnd) { SetWindowText(m_specific->m_hwnd, m_caption); } } //------------------------------------------------------------------------ void platform_support::start_timer() { ::QueryPerformanceCounter(&(m_specific->m_sw_start)); } //------------------------------------------------------------------------ double platform_support::elapsed_time() const { LARGE_INTEGER stop; ::QueryPerformanceCounter(&stop); return double(stop.QuadPart - m_specific->m_sw_start.QuadPart) * 1000.0 / double(m_specific->m_sw_freq.QuadPart); } //------------------------------------------------------------------------ static unsigned get_key_flags(int wflags) { unsigned flags = 0; if(wflags & MK_LBUTTON) flags |= mouse_left; if(wflags & MK_RBUTTON) flags |= mouse_right; if(wflags & MK_SHIFT) flags |= kbd_shift; if(wflags & MK_CONTROL) flags |= kbd_ctrl; return flags; } void* platform_support::raw_display_handler() { return m_specific->m_current_dc; } //------------------------------------------------------------------------ LRESULT CALLBACK window_proc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { PAINTSTRUCT ps; HDC paintDC; void* user_data = reinterpret_cast<void*>(::GetWindowLong(hWnd, GWL_USERDATA)); platform_support* app = 0; if(user_data) { app = reinterpret_cast<platform_support*>(user_data); } if(app == 0) { if(msg == WM_DESTROY) { ::PostQuitMessage(0); return 0; } return ::DefWindowProc(hWnd, msg, wParam, lParam); } HDC dc = ::GetDC(app->m_specific->m_hwnd); app->m_specific->m_current_dc = dc; LRESULT ret = 0; switch(msg) { //-------------------------------------------------------------------- case WM_CREATE: break; //-------------------------------------------------------------------- case WM_SIZE: app->m_specific->create_pmap(LOWORD(lParam), HIWORD(lParam), &app->rbuf_window()); app->trans_affine_resizing(LOWORD(lParam), HIWORD(lParam)); app->on_resize(LOWORD(lParam), HIWORD(lParam)); app->force_redraw(); break; //-------------------------------------------------------------------- case WM_ERASEBKGND: break; //-------------------------------------------------------------------- case WM_LBUTTONDOWN: ::SetCapture(app->m_specific->m_hwnd); app->m_specific->m_cur_x = int16(LOWORD(lParam)); if(app->flip_y()) { app->m_specific->m_cur_y = app->rbuf_window().height() - int16(HIWORD(lParam)); } else { app->m_specific->m_cur_y = int16(HIWORD(lParam)); } app->m_specific->m_input_flags = mouse_left | get_key_flags(wParam); app->m_ctrls.set_cur(app->m_specific->m_cur_x, app->m_specific->m_cur_y); if(app->m_ctrls.on_mouse_button_down(app->m_specific->m_cur_x, app->m_specific->m_cur_y)) { app->on_ctrl_change(); app->force_redraw(); } else { if(app->m_ctrls.in_rect(app->m_specific->m_cur_x, app->m_specific->m_cur_y)) { if(app->m_ctrls.set_cur(app->m_specific->m_cur_x, app->m_specific->m_cur_y)) { app->on_ctrl_change(); app->force_redraw(); } } else { app->on_mouse_button_down(app->m_specific->m_cur_x, app->m_specific->m_cur_y, app->m_specific->m_input_flags); } } /* if(!app->wait_mode()) { app->on_idle(); } */ break; //-------------------------------------------------------------------- case WM_LBUTTONUP: ::ReleaseCapture(); app->m_specific->m_cur_x = int16(LOWORD(lParam)); if(app->flip_y()) { app->m_specific->m_cur_y = app->rbuf_window().height() - int16(HIWORD(lParam)); } else { app->m_specific->m_cur_y = int16(HIWORD(lParam)); } app->m_specific->m_input_flags = mouse_left | get_key_flags(wParam); if(app->m_ctrls.on_mouse_button_up(app->m_specific->m_cur_x, app->m_specific->m_cur_y)) { app->on_ctrl_change(); app->force_redraw(); } app->on_mouse_button_up(app->m_specific->m_cur_x, app->m_specific->m_cur_y, app->m_specific->m_input_flags); /* if(!app->wait_mode()) { app->on_idle(); } */ break; //-------------------------------------------------------------------- case WM_RBUTTONDOWN: ::SetCapture(app->m_specific->m_hwnd); app->m_specific->m_cur_x = int16(LOWORD(lParam)); if(app->flip_y()) { app->m_specific->m_cur_y = app->rbuf_window().height() - int16(HIWORD(lParam)); } else { app->m_specific->m_cur_y = int16(HIWORD(lParam)); } app->m_specific->m_input_flags = mouse_right | get_key_flags(wParam); app->on_mouse_button_down(app->m_specific->m_cur_x, app->m_specific->m_cur_y, app->m_specific->m_input_flags); /* if(!app->wait_mode()) { app->on_idle(); } */ break; //-------------------------------------------------------------------- case WM_RBUTTONUP: ::ReleaseCapture(); app->m_specific->m_cur_x = int16(LOWORD(lParam)); if(app->flip_y()) { app->m_specific->m_cur_y = app->rbuf_window().height() - int16(HIWORD(lParam)); } else { app->m_specific->m_cur_y = int16(HIWORD(lParam)); } app->m_specific->m_input_flags = mouse_right | get_key_flags(wParam); app->on_mouse_button_up(app->m_specific->m_cur_x, app->m_specific->m_cur_y, app->m_specific->m_input_flags); /* if(!app->wait_mode()) { app->on_idle(); } */ break; //-------------------------------------------------------------------- case WM_MOUSEMOVE: app->m_specific->m_cur_x = int16(LOWORD(lParam)); if(app->flip_y()) { app->m_specific->m_cur_y = app->rbuf_window().height() - int16(HIWORD(lParam)); } else { app->m_specific->m_cur_y = int16(HIWORD(lParam)); } app->m_specific->m_input_flags = get_key_flags(wParam); if(app->m_ctrls.on_mouse_move( app->m_specific->m_cur_x, app->m_specific->m_cur_y, (app->m_specific->m_input_flags & mouse_left) != 0)) { app->on_ctrl_change(); app->force_redraw(); } else { if(!app->m_ctrls.in_rect(app->m_specific->m_cur_x, app->m_specific->m_cur_y)) { app->on_mouse_move(app->m_specific->m_cur_x, app->m_specific->m_cur_y, app->m_specific->m_input_flags); } } /* if(!app->wait_mode()) { app->on_idle(); } */ break; //-------------------------------------------------------------------- case WM_SYSKEYDOWN: case WM_KEYDOWN: app->m_specific->m_last_translated_key = 0; switch(wParam) { case VK_CONTROL: app->m_specific->m_input_flags |= kbd_ctrl; break; case VK_SHIFT: app->m_specific->m_input_flags |= kbd_shift; break; default: app->m_specific->translate(wParam); break; } if(app->m_specific->m_last_translated_key) { bool left = false; bool up = false; bool right = false; bool down = false; switch(app->m_specific->m_last_translated_key) { case key_left: left = true; break; case key_up: up = true; break; case key_right: right = true; break; case key_down: down = true; break; case key_f2: app->copy_window_to_img(agg::platform_support::max_images - 1); app->save_img(agg::platform_support::max_images - 1, "screenshot"); break; } if(app->window_flags() & window_process_all_keys) { app->on_key(app->m_specific->m_cur_x, app->m_specific->m_cur_y, app->m_specific->m_last_translated_key, app->m_specific->m_input_flags); } else { if(app->m_ctrls.on_arrow_keys(left, right, down, up)) { app->on_ctrl_change(); app->force_redraw(); } else { app->on_key(app->m_specific->m_cur_x, app->m_specific->m_cur_y, app->m_specific->m_last_translated_key, app->m_specific->m_input_flags); } } } /* if(!app->wait_mode()) { app->on_idle(); } */ break; //-------------------------------------------------------------------- case WM_SYSKEYUP: case WM_KEYUP: app->m_specific->m_last_translated_key = 0; switch(wParam) { case VK_CONTROL: app->m_specific->m_input_flags &= ~kbd_ctrl; break; case VK_SHIFT: app->m_specific->m_input_flags &= ~kbd_shift; break; } break; //-------------------------------------------------------------------- case WM_CHAR: case WM_SYSCHAR: if(app->m_specific->m_last_translated_key == 0) { app->on_key(app->m_specific->m_cur_x, app->m_specific->m_cur_y, wParam, app->m_specific->m_input_flags); } break; //-------------------------------------------------------------------- case WM_PAINT: paintDC = ::BeginPaint(hWnd, &ps); app->m_specific->m_current_dc = paintDC; if(app->m_specific->m_redraw_flag) { app->on_draw(); app->m_specific->m_redraw_flag = false; } app->m_specific->display_pmap(paintDC, &app->rbuf_window()); app->on_post_draw(paintDC); app->m_specific->m_current_dc = 0; ::EndPaint(hWnd, &ps); break; //-------------------------------------------------------------------- case WM_COMMAND: break; //-------------------------------------------------------------------- case WM_DESTROY: ::PostQuitMessage(0); break; //-------------------------------------------------------------------- default: ret = ::DefWindowProc(hWnd, msg, wParam, lParam); break; } app->m_specific->m_current_dc = 0; ::ReleaseDC(app->m_specific->m_hwnd, dc); return ret; } //------------------------------------------------------------------------ void platform_support::message(const char* msg) { ::MessageBox(m_specific->m_hwnd, msg, "AGG Message", MB_OK); } //------------------------------------------------------------------------ bool platform_support::init(unsigned width, unsigned height, unsigned flags) { if(m_specific->m_sys_format == pix_format_undefined) { return false; } m_window_flags = flags; int wflags = CS_OWNDC | CS_VREDRAW | CS_HREDRAW; WNDCLASS wc; wc.lpszClassName = "AGGAppClass"; wc.lpfnWndProc = window_proc; wc.style = wflags; wc.hInstance = g_windows_instance; wc.hIcon = LoadIcon(0, IDI_APPLICATION); wc.hCursor = LoadCursor(0, IDC_ARROW); wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1); wc.lpszMenuName = "AGGAppMenu"; wc.cbClsExtra = 0; wc.cbWndExtra = 0; ::RegisterClass(&wc); wflags = WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX; if(m_window_flags & window_resize) { wflags |= WS_THICKFRAME | WS_MAXIMIZEBOX; } m_specific->m_hwnd = ::CreateWindow("AGGAppClass", m_caption, wflags, 100, 100, width, height, 0, 0, g_windows_instance, 0); if(m_specific->m_hwnd == 0) { return false; } RECT rct; ::GetClientRect(m_specific->m_hwnd, &rct); ::MoveWindow(m_specific->m_hwnd, // handle to window 100, // horizontal position 100, // vertical position width + (width - (rct.right - rct.left)), height + (height - (rct.bottom - rct.top)), FALSE); ::SetWindowLong(m_specific->m_hwnd, GWL_USERDATA, (LONG)this); m_specific->create_pmap(width, height, &m_rbuf_window); m_initial_width = width; m_initial_height = height; on_init(); m_specific->m_redraw_flag = true; ::ShowWindow(m_specific->m_hwnd, g_windows_cmd_show); return true; } //------------------------------------------------------------------------ int platform_support::run() { MSG msg; for(;;) { if(m_wait_mode) { if(!::GetMessage(&msg, 0, 0, 0)) { break; } ::TranslateMessage(&msg); ::DispatchMessage(&msg); } else { if(::PeekMessage(&msg, 0, 0, 0, PM_REMOVE)) { ::TranslateMessage(&msg); if(msg.message == WM_QUIT) { break; } ::DispatchMessage(&msg); } else { on_idle(); } } } return (int)msg.wParam; } //------------------------------------------------------------------------ const char* platform_support::img_ext() const { return ".bmp"; } //------------------------------------------------------------------------ const char* platform_support::full_file_name(const char* file_name) { return file_name; } //------------------------------------------------------------------------ bool platform_support::load_img(unsigned idx, const char* file) { if(idx < max_images) { char fn[1024]; strcpy(fn, file); int len = strlen(fn); if(len < 4 || stricmp(fn + len - 4, ".BMP") != 0) { strcat(fn, ".bmp"); } return m_specific->load_pmap(fn, idx, &m_rbuf_img[idx]); } return true; } //------------------------------------------------------------------------ bool platform_support::save_img(unsigned idx, const char* file) { if(idx < max_images) { char fn[1024]; strcpy(fn, file); int len = strlen(fn); if(len < 4 || stricmp(fn + len - 4, ".BMP") != 0) { strcat(fn, ".bmp"); } return m_specific->save_pmap(fn, idx, &m_rbuf_img[idx]); } return true; } //------------------------------------------------------------------------ bool platform_support::create_img(unsigned idx, unsigned width, unsigned height) { if(idx < max_images) { if(width == 0) width = m_specific->m_pmap_window.width(); if(height == 0) height = m_specific->m_pmap_window.height(); m_specific->m_pmap_img[idx].create(width, height, org_e(m_specific->m_bpp)); m_rbuf_img[idx].attach(m_specific->m_pmap_img[idx].buf(), m_specific->m_pmap_img[idx].width(), m_specific->m_pmap_img[idx].height(), m_flip_y ? m_specific->m_pmap_img[idx].stride() : -m_specific->m_pmap_img[idx].stride()); return true; } return false; } //------------------------------------------------------------------------ void platform_support::force_redraw() { m_specific->m_redraw_flag = true; ::InvalidateRect(m_specific->m_hwnd, 0, FALSE); } //------------------------------------------------------------------------ void platform_support::update_window() { HDC dc = ::GetDC(m_specific->m_hwnd); m_specific->display_pmap(dc, &m_rbuf_window); ::ReleaseDC(m_specific->m_hwnd, dc); } //------------------------------------------------------------------------ void platform_support::on_init() {} void platform_support::on_resize(int sx, int sy) {} void platform_support::on_idle() {} void platform_support::on_mouse_move(int x, int y, unsigned flags) {} void platform_support::on_mouse_button_down(int x, int y, unsigned flags) {} void platform_support::on_mouse_button_up(int x, int y, unsigned flags) {} void platform_support::on_key(int x, int y, unsigned key, unsigned flags) {} void platform_support::on_ctrl_change() {} void platform_support::on_draw() {} void platform_support::on_post_draw(void* raw_handler) {} } namespace agg { // That's ridiculous. I have to parse the command line by myself // because Windows doesn't provide a method of getting the command // line arguments in a form of argc, argv. Of course, there's // CommandLineToArgv() but first, it returns Unicode that I don't // need to deal with, but most of all, it's not compatible with Win98. //----------------------------------------------------------------------- class tokenizer { public: enum sep_flag { single, multiple, whole_str }; struct token { const char* ptr; unsigned len; }; public: tokenizer(const char* sep, const char* trim=0, const char* quote="\"", char mask_chr='\\', sep_flag sf=multiple); void set_str(const char* str); token next_token(); private: int check_chr(const char *str, char chr); private: const char* m_src_string; int m_start; const char* m_sep; const char* m_trim; const char* m_quote; char m_mask_chr; unsigned m_sep_len; sep_flag m_sep_flag; }; //----------------------------------------------------------------------- inline void tokenizer::set_str(const char* str) { m_src_string = str; m_start = 0; } //----------------------------------------------------------------------- inline int tokenizer::check_chr(const char *str, char chr) { return int(strchr(str, chr)); } //----------------------------------------------------------------------- tokenizer::tokenizer(const char* sep, const char* trim, const char* quote, char mask_chr, sep_flag sf) : m_src_string(0), m_start(0), m_sep(sep), m_trim(trim), m_quote(quote), m_mask_chr(mask_chr), m_sep_len(sep ? strlen(sep) : 0), m_sep_flag(sep ? sf : single) { } //----------------------------------------------------------------------- tokenizer::token tokenizer::next_token() { unsigned count = 0; char quote_chr = 0; token tok; tok.ptr = 0; tok.len = 0; if(m_src_string == 0 || m_start == -1) return tok; register const char *pstr = m_src_string + m_start; if(*pstr == 0) { m_start = -1; return tok; } int sep_len = 1; if(m_sep_flag == whole_str) sep_len = m_sep_len; if(m_sep_flag == multiple) { //Pass all the separator symbols at the begin of the string while(*pstr && check_chr(m_sep, *pstr)) { ++pstr; ++m_start; } } if(*pstr == 0) { m_start = -1; return tok; } for(count = 0;; ++count) { char c = *pstr; int found = 0; //We are outside of qotation: find one of separator symbols if(quote_chr == 0) { if(sep_len == 1) { found = check_chr(m_sep, c); } else { found = strncmp(m_sep, pstr, m_sep_len) == 0; } } ++pstr; if(c == 0 || found) { if(m_trim) { while(count && check_chr(m_trim, m_src_string[m_start])) { ++m_start; --count; } while(count && check_chr(m_trim, m_src_string[m_start + count - 1])) { --count; } } tok.ptr = m_src_string + m_start; tok.len = count; //Next time it will be the next separator character //But we must check, whether it is NOT the end of the string. m_start += count; if(c) { m_start += sep_len; if(m_sep_flag == multiple) { //Pass all the separator symbols //after the end of the string while(check_chr(m_sep, m_src_string[m_start])) { ++m_start; } } } break; } //Switch quote. If it is not a quote yet, try to check any of //quote symbols. Otherwise quote must be finished with quote_symb if(quote_chr == 0) { if(check_chr(m_quote, c)) { quote_chr = c; continue; } } else { //We are inside quote: pass all the mask symbols if(m_mask_chr && c == m_mask_chr) { if(*pstr) { ++count; ++pstr; } continue; } if(c == quote_chr) { quote_chr = 0; continue; } } } return tok; } } //---------------------------------------------------------------------------- int agg_main(int argc, char* argv[]); //---------------------------------------------------------------------------- int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdLine, int nCmdShow) { agg::g_windows_instance = hInstance; agg::g_windows_cmd_show = nCmdShow; char* argv_str = new char [strlen(lpszCmdLine) + 3]; char* argv_ptr = argv_str; char* argv[64]; memset(argv, 0, sizeof(argv)); agg::tokenizer cmd_line(" ", "\"' ", "\"'", '\\', agg::tokenizer::multiple); cmd_line.set_str(lpszCmdLine); int argc = 0; argv[argc++] = argv_ptr; *argv_ptr++ = 0; while(argc < 64) { agg::tokenizer::token tok = cmd_line.next_token(); if(tok.ptr == 0) break; if(tok.len) { memcpy(argv_ptr, tok.ptr, tok.len); argv[argc++] = argv_ptr; argv_ptr += tok.len; *argv_ptr++ = 0; } } int ret = agg_main(argc, argv); delete [] argv_str; return ret; } ��������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/src/platform/win32/agg_win32_bmp.cpp��������������������������������������������������0000644�0000000�0000000�00000045036�10703246330�021765� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//---------------------------------------------------------------------------- // //---------------------------------------------------------------------------- // Contact: mcseemagg@yahoo.com //---------------------------------------------------------------------------- // // class pixel_map // //---------------------------------------------------------------------------- #include "platform/win32/agg_win32_bmp.h" #include "agg_basics.h" namespace agg { //------------------------------------------------------------------------ pixel_map::~pixel_map() { destroy(); } //------------------------------------------------------------------------ pixel_map::pixel_map() : m_bmp(0), m_buf(0), m_bpp(0), m_is_internal(false), m_img_size(0), m_full_size(0) { } //------------------------------------------------------------------------ void pixel_map::destroy() { if(m_bmp && m_is_internal) delete [] (unsigned char*)m_bmp; m_bmp = 0; m_is_internal = false; m_buf = 0; } //------------------------------------------------------------------------ void pixel_map::create(unsigned width, unsigned height, org_e org, unsigned clear_val) { destroy(); if(width == 0) width = 1; if(height == 0) height = 1; m_bpp = org; create_from_bmp(create_bitmap_info(width, height, m_bpp)); create_gray_scale_palette(m_bmp); m_is_internal = true; if(clear_val <= 255) { memset(m_buf, clear_val, m_img_size); } } //------------------------------------------------------------------------ HBITMAP pixel_map::create_dib_section(HDC h_dc, unsigned width, unsigned height, org_e org, unsigned clear_val) { destroy(); if(width == 0) width = 1; if(height == 0) height = 1; m_bpp = org; HBITMAP h_bitmap = create_dib_section_from_args(h_dc, width, height, m_bpp); create_gray_scale_palette(m_bmp); m_is_internal = true; if(clear_val <= 255) { memset(m_buf, clear_val, m_img_size); } return h_bitmap; } //------------------------------------------------------------------------ void pixel_map::clear(unsigned clear_val) { if(m_buf) memset(m_buf, clear_val, m_img_size); } //------------------------------------------------------------------------ void pixel_map::attach_to_bmp(BITMAPINFO *bmp) { if(bmp) { destroy(); create_from_bmp(bmp); m_is_internal = false; } } //static //------------------------------------------------------------------------ unsigned pixel_map::calc_full_size(BITMAPINFO *bmp) { if(bmp == 0) return 0; return sizeof(BITMAPINFOHEADER) + sizeof(RGBQUAD) * calc_palette_size(bmp) + bmp->bmiHeader.biSizeImage; } //static //------------------------------------------------------------------------ unsigned pixel_map::calc_header_size(BITMAPINFO *bmp) { if(bmp == 0) return 0; return sizeof(BITMAPINFOHEADER) + sizeof(RGBQUAD) * calc_palette_size(bmp); } //static //------------------------------------------------------------------------ unsigned pixel_map::calc_palette_size(unsigned clr_used, unsigned bits_per_pixel) { int palette_size = 0; if(bits_per_pixel <= 8) { palette_size = clr_used; if(palette_size == 0) { palette_size = 1 << bits_per_pixel; } } return palette_size; } //static //------------------------------------------------------------------------ unsigned pixel_map::calc_palette_size(BITMAPINFO *bmp) { if(bmp == 0) return 0; return calc_palette_size(bmp->bmiHeader.biClrUsed, bmp->bmiHeader.biBitCount); } //static //------------------------------------------------------------------------ unsigned char * pixel_map::calc_img_ptr(BITMAPINFO *bmp) { if(bmp == 0) return 0; return ((unsigned char*)bmp) + calc_header_size(bmp); } //static //------------------------------------------------------------------------ BITMAPINFO* pixel_map::create_bitmap_info(unsigned width, unsigned height, unsigned bits_per_pixel) { unsigned line_len = calc_row_len(width, bits_per_pixel); unsigned img_size = line_len * height; unsigned rgb_size = calc_palette_size(0, bits_per_pixel) * sizeof(RGBQUAD); unsigned full_size = sizeof(BITMAPINFOHEADER) + rgb_size + img_size; BITMAPINFO *bmp = (BITMAPINFO *) new unsigned char[full_size]; bmp->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); bmp->bmiHeader.biWidth = width; bmp->bmiHeader.biHeight = height; bmp->bmiHeader.biPlanes = 1; bmp->bmiHeader.biBitCount = (unsigned short)bits_per_pixel; bmp->bmiHeader.biCompression = 0; bmp->bmiHeader.biSizeImage = img_size; bmp->bmiHeader.biXPelsPerMeter = 0; bmp->bmiHeader.biYPelsPerMeter = 0; bmp->bmiHeader.biClrUsed = 0; bmp->bmiHeader.biClrImportant = 0; return bmp; } //static //------------------------------------------------------------------------ void pixel_map::create_gray_scale_palette(BITMAPINFO *bmp) { if(bmp == 0) return; unsigned rgb_size = calc_palette_size(bmp); RGBQUAD *rgb = (RGBQUAD*)(((unsigned char*)bmp) + sizeof(BITMAPINFOHEADER)); unsigned brightness; unsigned i; for(i = 0; i < rgb_size; i++) { brightness = (255 * i) / (rgb_size - 1); rgb->rgbBlue = rgb->rgbGreen = rgb->rgbRed = (unsigned char)brightness; rgb->rgbReserved = 0; rgb++; } } //static //------------------------------------------------------------------------ unsigned pixel_map::calc_row_len(unsigned width, unsigned bits_per_pixel) { unsigned n = width; unsigned k; switch(bits_per_pixel) { case 1: k = n; n = n >> 3; if(k & 7) n++; break; case 4: k = n; n = n >> 1; if(k & 3) n++; break; case 8: break; case 16: n *= 2; break; case 24: n *= 3; break; case 32: n *= 4; break; case 48: n *= 6; break; case 64: n *= 8; break; default: n = 0; break; } return ((n + 3) >> 2) << 2; } //------------------------------------------------------------------------ void pixel_map::draw(HDC h_dc, const RECT *device_rect, const RECT *bmp_rect) const { if(m_bmp == 0 || m_buf == 0) return; unsigned bmp_x = 0; unsigned bmp_y = 0; unsigned bmp_width = m_bmp->bmiHeader.biWidth; unsigned bmp_height = m_bmp->bmiHeader.biHeight; unsigned dvc_x = 0; unsigned dvc_y = 0; unsigned dvc_width = m_bmp->bmiHeader.biWidth; unsigned dvc_height = m_bmp->bmiHeader.biHeight; if(bmp_rect) { bmp_x = bmp_rect->left; bmp_y = bmp_rect->top; bmp_width = bmp_rect->right - bmp_rect->left; bmp_height = bmp_rect->bottom - bmp_rect->top; } dvc_x = bmp_x; dvc_y = bmp_y; dvc_width = bmp_width; dvc_height = bmp_height; if(device_rect) { dvc_x = device_rect->left; dvc_y = device_rect->top; dvc_width = device_rect->right - device_rect->left; dvc_height = device_rect->bottom - device_rect->top; } if(dvc_width != bmp_width || dvc_height != bmp_height) { ::SetStretchBltMode(h_dc, COLORONCOLOR); ::StretchDIBits( h_dc, // handle of device context dvc_x, // x-coordinate of upper-left corner of source rect. dvc_y, // y-coordinate of upper-left corner of source rect. dvc_width, // width of source rectangle dvc_height, // height of source rectangle bmp_x, bmp_y, // x, y -coordinates of upper-left corner of dest. rect. bmp_width, // width of destination rectangle bmp_height, // height of destination rectangle m_buf, // address of bitmap bits m_bmp, // address of bitmap data DIB_RGB_COLORS, // usage SRCCOPY // raster operation code ); } else { ::SetDIBitsToDevice( h_dc, // handle to device context dvc_x, // x-coordinate of upper-left corner of dvc_y, // y-coordinate of upper-left corner of dvc_width, // source rectangle width dvc_height, // source rectangle height bmp_x, // x-coordinate of lower-left corner of bmp_y, // y-coordinate of lower-left corner of 0, // first scan line in array bmp_height, // number of scan lines m_buf, // address of array with DIB bits m_bmp, // address of structure with bitmap info. DIB_RGB_COLORS // RGB or palette indexes ); } } //------------------------------------------------------------------------ void pixel_map::draw(HDC h_dc, int x, int y, double scale) const { if(m_bmp == 0 || m_buf == 0) return; unsigned width = unsigned(m_bmp->bmiHeader.biWidth * scale); unsigned height = unsigned(m_bmp->bmiHeader.biHeight * scale); RECT rect; rect.left = x; rect.top = y; rect.right = x + width; rect.bottom = y + height; draw(h_dc, &rect); } //------------------------------------------------------------------------ void pixel_map::blend(HDC h_dc, const RECT *device_rect, const RECT *bmp_rect) const { #if !defined(AGG_BMP_ALPHA_BLEND) draw(h_dc, device_rect, bmp_rect); return; #else if(m_bpp != 32) { draw(h_dc, device_rect, bmp_rect); return; } if(m_bmp == 0 || m_buf == 0) return; unsigned bmp_x = 0; unsigned bmp_y = 0; unsigned bmp_width = m_bmp->bmiHeader.biWidth; unsigned bmp_height = m_bmp->bmiHeader.biHeight; unsigned dvc_x = 0; unsigned dvc_y = 0; unsigned dvc_width = m_bmp->bmiHeader.biWidth; unsigned dvc_height = m_bmp->bmiHeader.biHeight; if(bmp_rect) { bmp_x = bmp_rect->left; bmp_y = bmp_rect->top; bmp_width = bmp_rect->right - bmp_rect->left; bmp_height = bmp_rect->bottom - bmp_rect->top; } dvc_x = bmp_x; dvc_y = bmp_y; dvc_width = bmp_width; dvc_height = bmp_height; if(device_rect) { dvc_x = device_rect->left; dvc_y = device_rect->top; dvc_width = device_rect->right - device_rect->left; dvc_height = device_rect->bottom - device_rect->top; } HDC mem_dc = ::CreateCompatibleDC(h_dc); void* buf = 0; HBITMAP bmp = ::CreateDIBSection( mem_dc, m_bmp, DIB_RGB_COLORS, &buf, 0, 0 ); memcpy(buf, m_buf, m_bmp->bmiHeader.biSizeImage); HBITMAP temp = (HBITMAP)::SelectObject(mem_dc, bmp); BLENDFUNCTION blend; blend.BlendOp = AC_SRC_OVER; blend.BlendFlags = 0; #if defined(AC_SRC_ALPHA) blend.AlphaFormat = AC_SRC_ALPHA; //#elif defined(AC_SRC_NO_PREMULT_ALPHA) // blend.AlphaFormat = AC_SRC_NO_PREMULT_ALPHA; #else #error "No appropriate constant for alpha format. Check version of wingdi.h, There must be AC_SRC_ALPHA or AC_SRC_NO_PREMULT_ALPHA" #endif blend.SourceConstantAlpha = 255; ::AlphaBlend( h_dc, dvc_x, dvc_y, dvc_width, dvc_height, mem_dc, bmp_x, bmp_y, bmp_width, bmp_height, blend ); ::SelectObject(mem_dc, temp); ::DeleteObject(bmp); ::DeleteObject(mem_dc); #endif //defined(AGG_BMP_ALPHA_BLEND) } //------------------------------------------------------------------------ void pixel_map::blend(HDC h_dc, int x, int y, double scale) const { if(m_bmp == 0 || m_buf == 0) return; unsigned width = unsigned(m_bmp->bmiHeader.biWidth * scale); unsigned height = unsigned(m_bmp->bmiHeader.biHeight * scale); RECT rect; rect.left = x; rect.top = y; rect.right = x + width; rect.bottom = y + height; blend(h_dc, &rect); } //------------------------------------------------------------------------ bool pixel_map::load_from_bmp(FILE *fd) { BITMAPFILEHEADER bmf; BITMAPINFO *bmi = 0; unsigned bmp_size; fread(&bmf, sizeof(bmf), 1, fd); if(bmf.bfType != 0x4D42) goto bmperr; bmp_size = bmf.bfSize - sizeof(BITMAPFILEHEADER); bmi = (BITMAPINFO*) new unsigned char [bmp_size]; if(fread(bmi, 1, bmp_size, fd) != bmp_size) goto bmperr; destroy(); m_bpp = bmi->bmiHeader.biBitCount; create_from_bmp(bmi); m_is_internal = 1; return true; bmperr: if(bmi) delete [] (unsigned char*) bmi; return false; } //------------------------------------------------------------------------ bool pixel_map::load_from_bmp(const char *filename) { FILE *fd = fopen(filename, "rb"); bool ret = false; if(fd) { ret = load_from_bmp(fd); fclose(fd); } return ret; } //------------------------------------------------------------------------ bool pixel_map::save_as_bmp(FILE *fd) const { if(m_bmp == 0) return 0; BITMAPFILEHEADER bmf; bmf.bfType = 0x4D42; bmf.bfOffBits = calc_header_size(m_bmp) + sizeof(bmf); bmf.bfSize = bmf.bfOffBits + m_img_size; bmf.bfReserved1 = 0; bmf.bfReserved2 = 0; fwrite(&bmf, sizeof(bmf), 1, fd); fwrite(m_bmp, m_full_size, 1, fd); return true; } //------------------------------------------------------------------------ bool pixel_map::save_as_bmp(const char *filename) const { FILE *fd = fopen(filename, "wb"); bool ret = false; if(fd) { ret = save_as_bmp(fd); fclose(fd); } return ret; } //------------------------------------------------------------------------ unsigned char* pixel_map::buf() { return m_buf; } //------------------------------------------------------------------------ unsigned pixel_map::width() const { return m_bmp->bmiHeader.biWidth; } //------------------------------------------------------------------------ unsigned pixel_map::height() const { return m_bmp->bmiHeader.biHeight; } //------------------------------------------------------------------------ int pixel_map::stride() const { return calc_row_len(m_bmp->bmiHeader.biWidth, m_bmp->bmiHeader.biBitCount); } //private //------------------------------------------------------------------------ void pixel_map::create_from_bmp(BITMAPINFO *bmp) { if(bmp) { m_img_size = calc_row_len(bmp->bmiHeader.biWidth, bmp->bmiHeader.biBitCount) * bmp->bmiHeader.biHeight; m_full_size = calc_full_size(bmp); m_bmp = bmp; m_buf = calc_img_ptr(bmp); } } //private //------------------------------------------------------------------------ HBITMAP pixel_map::create_dib_section_from_args(HDC h_dc, unsigned width, unsigned height, unsigned bits_per_pixel) { unsigned line_len = calc_row_len(width, bits_per_pixel); unsigned img_size = line_len * height; unsigned rgb_size = calc_palette_size(0, bits_per_pixel) * sizeof(RGBQUAD); unsigned full_size = sizeof(BITMAPINFOHEADER) + rgb_size; BITMAPINFO *bmp = (BITMAPINFO *) new unsigned char[full_size]; bmp->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); bmp->bmiHeader.biWidth = width; bmp->bmiHeader.biHeight = height; bmp->bmiHeader.biPlanes = 1; bmp->bmiHeader.biBitCount = (unsigned short)bits_per_pixel; bmp->bmiHeader.biCompression = 0; bmp->bmiHeader.biSizeImage = img_size; bmp->bmiHeader.biXPelsPerMeter = 0; bmp->bmiHeader.biYPelsPerMeter = 0; bmp->bmiHeader.biClrUsed = 0; bmp->bmiHeader.biClrImportant = 0; void* img_ptr = 0; HBITMAP h_bitmap = ::CreateDIBSection(h_dc, bmp, DIB_RGB_COLORS, &img_ptr, NULL, 0); if(img_ptr) { m_img_size = calc_row_len(width, bits_per_pixel) * height; m_full_size = 0; m_bmp = bmp; m_buf = (unsigned char *) img_ptr; } return h_bitmap; } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������agg-2.5+dfsg1/src/readme����������������������������������������������������������������������������0000644�0000000�0000000�00000000317�10703246330�015226� 0����������������������������������������������������������������������������������������������������ustar�00user����������������������������group���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Use automake to build the library. If automake is not available you still can use the old make. There is a very simple Makefile that can be used. Note that if you use automake it will overwrite Makefile. �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������