#include <stdio.h>#include <stdlib.h>#include <math.h>#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"#include "pixel_formats.h"Go to the source code of this file.
Classes | |
| class | the_application |
Defines | |
| #define | AGG_BGR24 |
Enumerations | |
| enum | flip_y_e { flip_y = true } |
Functions | |
| int | agg_main (int argc, char *argv[]) |
|
|
Definition at line 23 of file image1.cpp. |
|
|
Definition at line 21 of file image1.cpp. 00021 { flip_y = true };
|
|
||||||||||||
|
Definition at line 151 of file image1.cpp. References platform_support::caption(), flip_y, platform_support::img_ext(), platform_support::init(), platform_support::load_img(), platform_support::message(), pix_format, platform_support::rbuf_img(), platform_support::run(), and agg::window_resize. 00152 { 00153 the_application app(pix_format, flip_y); 00154 app.caption("Image Affine Transformations with filtering"); 00155 00156 const char* img_name = "spheres"; 00157 if(argc >= 2) img_name = argv[1]; 00158 if(!app.load_img(0, img_name)) 00159 { 00160 char buf[256]; 00161 if(strcmp(img_name, "spheres") == 0) 00162 { 00163 sprintf(buf, "File not found: %s%s. Download http://www.antigrain.com/%s%s\n" 00164 "or copy it from another directory if available.", 00165 img_name, app.img_ext(), img_name, app.img_ext()); 00166 } 00167 else 00168 { 00169 sprintf(buf, "File not found: %s%s", img_name, app.img_ext()); 00170 } 00171 app.message(buf); 00172 return 1; 00173 } 00174 00175 if(app.init(app.rbuf_img(0).width() + 20, app.rbuf_img(0).height() + 40 + 20, agg::window_resize)) 00176 { 00177 00178 // Test the plain/premultiplied issue 00179 //------------------- 00180 //typedef agg::pixfmt_bgra32 pixfmt; 00181 //typedef agg::renderer_base<pixfmt> renderer_base; 00182 //pixfmt pixf(app.rbuf_img(0)); 00183 //renderer_base rb(pixf); 00184 //for(unsigned i = 0; i < app.rbuf_img(0).height(); i += 2) 00185 //{ 00186 // // Fully transparent 00187 // rb.copy_hline(0, i, app.rbuf_img(0).width(), agg::rgba(0, 0, 0, 0)); 00188 // if(i + 1 < app.rbuf_img(0).height()) 00189 // { 00190 // // Fully opaque white 00191 // rb.copy_hline(0, i + 1, app.rbuf_img(0).width(), agg::rgba(1, 1, 1, 1)); 00192 // } 00193 //} 00194 00195 return app.run(); 00196 } 00197 return 0; 00198 }
|