#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_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"Go to the source code of this file.
Classes | |
| class | the_application |
Enumerations | |
| enum | flip_y_e { flip_y = true } |
Functions | |
| unsigned | parse_lion (agg::path_storage &ps, agg::rgba8 *colors, unsigned *path_idx) |
| agg::alpha_mask_gray8 | g_alpha_mask (g_alpha_mask_rbuf) |
| int | agg_main (int argc, char *argv[]) |
Variables | |
| 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 |
| agg::rendering_buffer | g_alpha_mask_rbuf |
| agg::rasterizer_scanline_aa | g_rasterizer |
|
|
Definition at line 19 of file alpha_mask.cpp. 00019 { flip_y = true };
|
|
||||||||||||
|
Definition at line 182 of file alpha_mask.cpp. References platform_support::caption(), flip_y, platform_support::init(), agg::pix_format_bgr24, platform_support::run(), and agg::window_resize. 00183 { 00184 the_application app(agg::pix_format_bgr24, flip_y); 00185 app.caption("AGG Example. Lion with Alpha-Masking"); 00186 00187 if(app.init(512, 400, agg::window_resize)) 00188 { 00189 return app.run(); 00190 } 00191 return 1; 00192 }
|
|
|
Referenced by the_application::on_draw(). |
|
||||||||||||||||
|
Definition at line 156 of file parse_lion.cpp. Referenced by parse_lion(), and the_application::the_application(). 00157 { 00158 // Parse the lion and then detect its bounding 00159 // box and arrange polygons orientations (make all polygons 00160 // oriented clockwise or counterclockwise) 00161 00162 const char* ptr = g_lion; 00163 unsigned npaths = 0; 00164 00165 while(*ptr) 00166 { 00167 if(*ptr != 'M' && isalnum(*ptr)) 00168 { 00169 unsigned c = 0; 00170 sscanf(ptr, "%x", &c); 00171 00172 // New color. Every new color creates new path in the path object. 00173 path.close_polygon(); 00174 colors[npaths] = agg::rgb8_packed(c); 00175 path_idx[npaths] = path.start_new_path(); 00176 npaths++; 00177 while(*ptr && *ptr != '\n') ptr++; 00178 if(*ptr == '\n') ptr++; 00179 } 00180 else 00181 { 00182 double x = 0.0; 00183 double y = 0.0; 00184 00185 while(*ptr && *ptr != '\n') 00186 { 00187 int c = *ptr; 00188 00189 while(*ptr && !isdigit(*ptr)) ptr++; 00190 x = atof(ptr); 00191 00192 while(*ptr && isdigit(*ptr)) ptr++; 00193 while(*ptr && !isdigit(*ptr)) ptr++; 00194 y = atof(ptr); 00195 00196 if(c == 'M') 00197 { 00198 path.close_polygon(); 00199 path.move_to(x, y); 00200 } 00201 else 00202 { 00203 path.line_to(x, y); 00204 } 00205 00206 while(*ptr && isdigit(*ptr)) ptr++; 00207 while(*ptr && *ptr != '\n' && !isalpha(*ptr)) ptr++; 00208 } 00209 if(*ptr == '\n') ptr++; 00210 } 00211 } 00212 path.arrange_orientations_all_paths(agg::path_flags_cw); 00213 return npaths; 00214 }
|
|
|
Definition at line 49 of file alpha_mask.cpp. |
|
|
Definition at line 31 of file alpha_mask.cpp. Referenced by the_application::on_draw(), the_application::on_idle(), and the_application::transform(). |
|
|
Definition at line 29 of file alpha_mask.cpp. Referenced by the_application::on_draw(), and parse_lion(). |
|
|
Definition at line 30 of file alpha_mask.cpp. Referenced by the_application::on_draw(), and parse_lion(). |
|
|
Definition at line 22 of file alpha_mask.cpp. |
|
|
Definition at line 35 of file alpha_mask.cpp. |
|
|
Definition at line 24 of file alpha_mask.cpp. Referenced by the_application::on_draw(), parse_lion(), and the_application::the_application(). |
|
|
Definition at line 21 of file alpha_mask.cpp. |
|
|
Definition at line 23 of file alpha_mask.cpp. Referenced by the_application::on_draw(), and parse_lion(). |
|
|
Definition at line 51 of file alpha_mask.cpp. |
|
|
Definition at line 32 of file alpha_mask.cpp. Referenced by the_application::on_draw(), and the_application::transform(). |
|
|
Definition at line 33 of file alpha_mask.cpp. Referenced by the_application::on_draw(), and the_application::on_mouse_button_down(). |
|
|
Definition at line 34 of file alpha_mask.cpp. Referenced by the_application::on_draw(), and the_application::on_mouse_button_down(). |
|
|
Definition at line 25 of file alpha_mask.cpp. Referenced by the_application::on_draw(), the_application::on_init(), the_application::on_mouse_button_down(), parse_lion(), and the_application::the_application(). |
|
|
Definition at line 27 of file alpha_mask.cpp. Referenced by the_application::on_draw(), the_application::on_init(), the_application::on_mouse_button_down(), parse_lion(), and the_application::the_application(). |
|
|
Definition at line 26 of file alpha_mask.cpp. Referenced by the_application::on_draw(), the_application::on_init(), the_application::on_mouse_button_down(), parse_lion(), and the_application::the_application(). |
|
|
Definition at line 28 of file alpha_mask.cpp. Referenced by the_application::on_draw(), the_application::on_init(), the_application::on_mouse_button_down(), parse_lion(), and the_application::the_application(). |