Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

aa_test.cpp File Reference

#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_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"

Go to the source code of this file.

Classes

class  simple_vertex_source
class  dashed_line
class  the_application

Typedefs

typedef agg::gamma_lut< agg::int8u,
agg::int8u, 8, 8 > 
gamma_lut_type
typedef agg::pixfmt_bgr24_gamma<
gamma_lut_type
pixfmt_type
typedef pixfmt_type::color_type color_type
typedef agg::renderer_base<
pixfmt_type
renderer_base_type
typedef agg::renderer_scanline_aa_solid<
renderer_base_type
renderer_scanline_type
typedef agg::scanline_u8 scanline_type
typedef agg::rasterizer_scanline_aa rasterizer_type

Enumerations

enum  flip_y_e { flip_y = false }

Functions

template<class T>
min (T a, T b)
double frand (double x)
void calc_linear_gradient_transform (double x1, double y1, double x2, double y2, agg::trans_affine &mtx, double gradient_d2=100.0)
template<class ColorArrayT>
void fill_color_array (ColorArrayT &array, color_type begin, color_type end)
int agg_main (int argc, char *argv[])


Typedef Documentation

typedef pixfmt_type::color_type color_type
 

Definition at line 26 of file aa_test.cpp.

typedef agg::gamma_lut<agg::int8u, agg::int8u, 8, 8> gamma_lut_type
 

Definition at line 24 of file aa_test.cpp.

typedef agg::pixfmt_bgr24_gamma<gamma_lut_type> pixfmt_type
 

Definition at line 25 of file aa_test.cpp.

typedef agg::rasterizer_scanline_aa rasterizer_type
 

Definition at line 30 of file aa_test.cpp.

typedef agg::renderer_base<pixfmt_type> renderer_base_type
 

Definition at line 27 of file aa_test.cpp.

typedef agg::renderer_scanline_aa_solid<renderer_base_type> renderer_scanline_type
 

Definition at line 28 of file aa_test.cpp.

typedef agg::scanline_u8 scanline_type
 

Definition at line 29 of file aa_test.cpp.


Enumeration Type Documentation

enum flip_y_e
 

Enumerator:
flip_y 

Definition at line 20 of file aa_test.cpp.

00020 { flip_y = false };


Function Documentation

int agg_main int  argc,
char *  argv[]
 

Definition at line 588 of file aa_test.cpp.

References platform_support::caption(), flip_y, platform_support::init(), agg::pix_format_bgr24, platform_support::run(), and agg::window_resize.

00589 {
00590     the_application app(agg::pix_format_bgr24, flip_y);
00591     app.caption("AGG Example. Anti-Aliasing Test");
00592 
00593     if(app.init(480, 350, agg::window_resize))
00594     {
00595         return app.run();
00596     }
00597     return 1;
00598 }

void calc_linear_gradient_transform double  x1,
double  y1,
double  x2,
double  y2,
agg::trans_affine mtx,
double  gradient_d2 = 100.0
 

Definition at line 173 of file aa_test.cpp.

References trans_affine::invert(), and trans_affine::reset().

Referenced by the_application::on_draw(), and the_application::on_mouse_button_down().

00176 {
00177     double dx = x2 - x1;
00178     double dy = y2 - y1;
00179     mtx.reset();
00180     mtx *= agg::trans_affine_scaling(sqrt(dx * dx + dy * dy) / gradient_d2);
00181     mtx *= agg::trans_affine_rotation(atan2(dy, dx));
00182     mtx *= agg::trans_affine_translation(x1 + 0.5, y1 + 0.5);
00183     mtx.invert();
00184 }

void fill_color_array ColorArrayT &  array,
color_type  begin,
color_type  end
 

Definition at line 191 of file aa_test.cpp.

00194 {
00195     unsigned i;
00196     for(i = 0; i < 256; ++i)
00197     {
00198         array[i] = begin.gradient(end, i / 255.0);
00199     }
00200 }

double frand double  x  )  [inline]
 

Definition at line 34 of file aa_test.cpp.

Referenced by the_application::on_mouse_button_down().

00035 { 
00036     return ((((rand() << 15) | rand()) & 0x3FFFFFFF) % 1000000) * x / 1000000.0;
00037 }

T min a,
b
 

Definition at line 32 of file aa_test.cpp.

Referenced by build_lmt(), and the_application::on_draw().

00032 { return (a < b) ? a : b; }


© sourcejam.com 2005-2008