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

compositing2.cpp File Reference

#include <stdio.h>
#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"

Go to the source code of this file.

Classes

class  the_application

Defines

#define pix_format   agg::pix_format_bgra32

Typedefs

typedef agg::rgba8 color
typedef agg::order_bgra order
typedef agg::pixel32_type pixel_type
typedef agg::blender_rgba<
color, order
prim_blender_type
typedef agg::pixfmt_alpha_blend_rgba<
prim_blender_type, agg::rendering_buffer,
pixel_type
prim_pixfmt_type
typedef agg::renderer_base<
prim_pixfmt_type
prim_ren_base_type

Enumerations

enum  flip_y_e { flip_y = true }

Functions

void force_comp_op_link ()
template<class Container, class ColorT>
void generate_color_ramp (Container &c, ColorT c1, ColorT c2, ColorT c3, ColorT c4)
int agg_main (int argc, char *argv[])


Define Documentation

#define pix_format   agg::pix_format_bgra32
 

Definition at line 22 of file compositing2.cpp.


Typedef Documentation

typedef agg::rgba8 color
 

Definition at line 19 of file compositing2.cpp.

typedef agg::order_bgra order
 

Definition at line 20 of file compositing2.cpp.

typedef agg::pixel32_type pixel_type
 

Definition at line 21 of file compositing2.cpp.

typedef agg::blender_rgba<color, order> prim_blender_type
 

Definition at line 25 of file compositing2.cpp.

typedef agg::pixfmt_alpha_blend_rgba<prim_blender_type, agg::rendering_buffer, pixel_type> prim_pixfmt_type
 

Definition at line 26 of file compositing2.cpp.

typedef agg::renderer_base<prim_pixfmt_type> prim_ren_base_type
 

Definition at line 27 of file compositing2.cpp.


Enumeration Type Documentation

enum flip_y_e
 

Enumerator:
flip_y 

Definition at line 17 of file compositing2.cpp.

00017 { flip_y = true };


Function Documentation

int agg_main int  argc,
char *  argv[]
 

Definition at line 235 of file compositing2.cpp.

References platform_support::caption(), flip_y, force_comp_op_link(), platform_support::init(), pix_format, platform_support::run(), agg::window_keep_aspect_ratio, and agg::window_resize.

00236 {
00237     force_comp_op_link();
00238     the_application app(pix_format, flip_y);
00239     app.caption("AGG Example. Compositing Modes");
00240 
00241     if(app.init(600, 400, agg::window_resize|agg::window_keep_aspect_ratio))
00242     {
00243         return app.run();
00244     }
00245     return 1;
00246 }

void force_comp_op_link  ) 
 

Definition at line 30 of file compositing2.cpp.

References comp_op_rgba_color_dodge::blend_pix().

00031 {
00032     // For unknown reason Digital Mars C++ doesn't want to link these 
00033     // functions if they are not specified explicitly. 
00034     agg::int8u p[4] = {0};
00035     agg::comp_op_rgba_contrast   <color, order>::blend_pix(p,0,0,0,0,0);
00036     agg::comp_op_rgba_darken     <color, order>::blend_pix(p,0,0,0,0,0);
00037     agg::comp_op_rgba_lighten    <color, order>::blend_pix(p,0,0,0,0,0);
00038     agg::comp_op_rgba_color_dodge<color, order>::blend_pix(p,0,0,0,0,0);
00039     agg::comp_op_rgba_color_burn <color, order>::blend_pix(p,0,0,0,0,0);
00040     agg::comp_op_rgba_hard_light <color, order>::blend_pix(p,0,0,0,0,0);
00041     agg::comp_op_rgba_soft_light <color, order>::blend_pix(p,0,0,0,0,0);
00042     agg::comp_op_rgba_difference <color, order>::blend_pix(p,0,0,0,0,0);
00043     agg::comp_op_rgba_exclusion  <color, order>::blend_pix(p,0,0,0,0,0);
00044     agg::comp_op_rgba_src_atop   <color, order>::blend_pix(p,0,0,0,0,0);
00045     agg::comp_op_rgba_dst_atop   <color, order>::blend_pix(p,0,0,0,0,0);
00046     agg::comp_op_rgba_xor        <color, order>::blend_pix(p,0,0,0,0,0);
00047     agg::comp_op_rgba_plus       <color, order>::blend_pix(p,0,0,0,0,0);
00048     agg::comp_op_rgba_minus      <color, order>::blend_pix(p,0,0,0,0,0);
00049     agg::comp_op_rgba_multiply   <color, order>::blend_pix(p,0,0,0,0,0);
00050     agg::comp_op_rgba_screen     <color, order>::blend_pix(p,0,0,0,0,0);
00051     agg::comp_op_rgba_overlay    <color, order>::blend_pix(p,0,0,0,0,0);
00052     agg::comp_op_rgba_src        <color, order>::blend_pix(p,0,0,0,0,0);
00053     agg::comp_op_rgba_dst        <color, order>::blend_pix(p,0,0,0,0,0);
00054     agg::comp_op_rgba_src_over   <color, order>::blend_pix(p,0,0,0,0,0);
00055     agg::comp_op_rgba_dst_over   <color, order>::blend_pix(p,0,0,0,0,0);
00056     agg::comp_op_rgba_src_in     <color, order>::blend_pix(p,0,0,0,0,0);
00057     agg::comp_op_rgba_dst_in     <color, order>::blend_pix(p,0,0,0,0,0);
00058     agg::comp_op_rgba_src_out    <color, order>::blend_pix(p,0,0,0,0,0);
00059     agg::comp_op_rgba_dst_out    <color, order>::blend_pix(p,0,0,0,0,0);
00060     agg::comp_op_rgba_clear      <color, order>::blend_pix(p,0,0,0,0,0);
00061 }

void generate_color_ramp Container &  c,
ColorT  c1,
ColorT  c2,
ColorT  c3,
ColorT  c4
 

Definition at line 65 of file compositing2.cpp.

Referenced by the_application::on_draw().

00067 {
00068     unsigned i;
00069     for(i = 0; i < 85; i++)
00070     {
00071         c[i] = c1.gradient(c2, i/85.0);
00072     }
00073     for(; i < 170; i++)
00074     {
00075         c[i] = c2.gradient(c3, (i - 85)/85.0);
00076     }
00077     for(; i < 256; i++)
00078     {
00079         c[i] = c3.gradient(c4, (i - 170)/85.0);
00080     }
00081 }


© sourcejam.com 2005-2008