#include <stdlib.h>#include <ctype.h>#include <stdio.h>#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"Go to the source code of this file.
Classes | |
| class | the_application |
Enumerations | |
| enum | flip_y_e { flip_y = true } |
Functions | |
| int | agg_main (int argc, char *argv[]) |
Variables | |
| 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 |
|
|
Definition at line 26 of file image_perspective.cpp. 00026 { flip_y = true };
|
|
||||||||||||
|
Definition at line 272 of file image_perspective.cpp. References platform_support::caption(), flip_y, platform_support::img_ext(), platform_support::init(), platform_support::load_img(), platform_support::message(), agg::pix_format_bgra32, platform_support::run(), and agg::window_resize. 00273 { 00274 the_application app(agg::pix_format_bgra32, flip_y); 00275 app.caption("AGG Example. Image Perspective Transformations"); 00276 00277 const char* img_name = "spheres"; 00278 if(argc >= 2) img_name = argv[1]; 00279 if(!app.load_img(0, img_name)) 00280 { 00281 char buf[256]; 00282 if(strcmp(img_name, "spheres") == 0) 00283 { 00284 sprintf(buf, "File not found: %s%s. Download http://www.antigrain.com/%s%s\n" 00285 "or copy it from another directory if available.", 00286 img_name, app.img_ext(), img_name, app.img_ext()); 00287 } 00288 else 00289 { 00290 sprintf(buf, "File not found: %s%s", img_name, app.img_ext()); 00291 } 00292 app.message(buf); 00293 return 1; 00294 } 00295 00296 /* 00297 // Testing the "black border" issue with alpha channel 00298 //---------------------------------------- 00299 the_application::pixfmt pixf(app.rbuf_img(0)); 00300 the_application::renderer_base rbase(pixf); 00301 rbase.clear(agg::rgba8(0,0,0,0)); 00302 unsigned i; 00303 for(i = 0; i < 50; i++) 00304 { 00305 agg::ellipse ell(rand() % rbase.width(), 00306 rand() % rbase.height(), 00307 rand() % 20 + 5, 00308 rand() % 20 + 5, 00309 100); 00310 g_rasterizer.add_path(ell); 00311 agg::render_scanlines_aa_solid(g_rasterizer, g_scanline, rbase, 00312 agg::rgba8((rand() & 0x7F) + 127, 00313 (rand() & 0x7F) + 127, 00314 (rand() & 0x7F) + 127, 00315 255)); 00316 } 00317 */ 00318 00319 if(app.init(600, 600, agg::window_resize)) 00320 { 00321 return app.run(); 00322 } 00323 return 1; 00324 }
|
|
|
Definition at line 28 of file image_perspective.cpp. |
|
|
Definition at line 29 of file image_perspective.cpp. |
|
|
Definition at line 30 of file image_perspective.cpp. |
|
|
Definition at line 32 of file image_perspective.cpp. |
|
|
Definition at line 31 of file image_perspective.cpp. |
|
|
Definition at line 33 of file image_perspective.cpp. |