示例#1
0
        public override void OnDraw(Graphics2D graphics2D)
        {
            ImageClippingProxy ren_base = new ImageClippingProxy(graphics2D.DestImage);

            ren_base.clear(new RGBA_Floats(1.0, 1.0, .95));

            ScanlineRasterizer   ras = new ScanlineRasterizer();
            ScanlineCachePacked8 sl  = new ScanlineCachePacked8();

            // Pattern source. Must have an interface:
            // width() const
            // height() const
            // pixel(int x, int y) const
            // Any agg::renderer_base<> or derived
            // is good for the use as a source.
            //-----------------------------------
            pattern_src_brightness_to_alpha_RGBA_Bytes p1 = new pattern_src_brightness_to_alpha_RGBA_Bytes(rbuf_img0);
            pattern_src_brightness_to_alpha_RGBA_Bytes p2 = new pattern_src_brightness_to_alpha_RGBA_Bytes(rbuf_img1);
            pattern_src_brightness_to_alpha_RGBA_Bytes p3 = new pattern_src_brightness_to_alpha_RGBA_Bytes(rbuf_img2);
            pattern_src_brightness_to_alpha_RGBA_Bytes p4 = new pattern_src_brightness_to_alpha_RGBA_Bytes(rbuf_img3);
            pattern_src_brightness_to_alpha_RGBA_Bytes p5 = new pattern_src_brightness_to_alpha_RGBA_Bytes(rbuf_img4);
            pattern_src_brightness_to_alpha_RGBA_Bytes p6 = new pattern_src_brightness_to_alpha_RGBA_Bytes(rbuf_img5);
            pattern_src_brightness_to_alpha_RGBA_Bytes p7 = new pattern_src_brightness_to_alpha_RGBA_Bytes(rbuf_img6);
            pattern_src_brightness_to_alpha_RGBA_Bytes p8 = new pattern_src_brightness_to_alpha_RGBA_Bytes(rbuf_img7);
            pattern_src_brightness_to_alpha_RGBA_Bytes p9 = new pattern_src_brightness_to_alpha_RGBA_Bytes(rbuf_img8);

            //pattern_filter_bilinear_RGBA_Bytes fltr = new pattern_filter_bilinear_RGBA_Bytes();           // Filtering functor

            // agg::line_image_pattern is the main container for the patterns. It creates
            // a copy of the patterns extended according to the needs of the filter.
            // agg::line_image_pattern can operate with arbitrary image width, but if the
            // width of the pattern is power of 2, it's better to use the modified
            // version agg::line_image_pattern_pow2 because it works about 15-25 percent
            // faster than agg::line_image_pattern (because of using simple masking instead
            // of expensive '%' operation).

            //-- Create with specifying the source

            //-- Create uninitialized and set the source

            line_image_pattern patt    = new line_image_pattern(new pattern_filter_bilinear_RGBA_Bytes());
            ImageLineRenderer  ren_img = new ImageLineRenderer(ren_base, patt);

            rasterizer_outline_aa ras_img = new rasterizer_outline_aa(ren_img);

            draw_curve(patt, ras_img, ren_img, p1, m_curve1.curve());

            /*
             * draw_curve(patt, ras_img, ren_img, p2, m_curve2.curve());
             * draw_curve(patt, ras_img, ren_img, p3, m_curve3.curve());
             * draw_curve(patt, ras_img, ren_img, p4, m_curve4.curve());
             * draw_curve(patt, ras_img, ren_img, p5, m_curve5.curve());
             * draw_curve(patt, ras_img, ren_img, p6, m_curve6.curve());
             * draw_curve(patt, ras_img, ren_img, p7, m_curve7.curve());
             * draw_curve(patt, ras_img, ren_img, p8, m_curve8.curve());
             * draw_curve(patt, ras_img, ren_img, p9, m_curve9.curve());
             */

            base.OnDraw(graphics2D);
        }
示例#2
0
 private void draw_curve(line_image_pattern patt, rasterizer_outline_aa ras, ImageLineRenderer ren,
                         pattern_src_brightness_to_alpha_RGBA_Bytes src, IVertexSource vs)
 {
     patt.create(src);
     ren.scale_x(m_scale_x.Value);
     ren.start_x(m_start_x.Value);
     ras.add_path(vs);
 }
示例#3
0
		public override void OnDraw(Graphics2D graphics2D)
		{
			ImageClippingProxy ren_base = new ImageClippingProxy(graphics2D.DestImage);

			ren_base.clear(new RGBA_Floats(1.0, 1.0, .95));

			ScanlineRasterizer ras = new ScanlineRasterizer();
			ScanlineCachePacked8 sl = new ScanlineCachePacked8();

			// Pattern source. Must have an interface:
			// width() const
			// height() const
			// pixel(int x, int y) const
			// Any agg::renderer_base<> or derived
			// is good for the use as a source.
			//-----------------------------------
			pattern_src_brightness_to_alpha_RGBA_Bytes p1 = new pattern_src_brightness_to_alpha_RGBA_Bytes(rbuf_img0);
			pattern_src_brightness_to_alpha_RGBA_Bytes p2 = new pattern_src_brightness_to_alpha_RGBA_Bytes(rbuf_img1);
			pattern_src_brightness_to_alpha_RGBA_Bytes p3 = new pattern_src_brightness_to_alpha_RGBA_Bytes(rbuf_img2);
			pattern_src_brightness_to_alpha_RGBA_Bytes p4 = new pattern_src_brightness_to_alpha_RGBA_Bytes(rbuf_img3);
			pattern_src_brightness_to_alpha_RGBA_Bytes p5 = new pattern_src_brightness_to_alpha_RGBA_Bytes(rbuf_img4);
			pattern_src_brightness_to_alpha_RGBA_Bytes p6 = new pattern_src_brightness_to_alpha_RGBA_Bytes(rbuf_img5);
			pattern_src_brightness_to_alpha_RGBA_Bytes p7 = new pattern_src_brightness_to_alpha_RGBA_Bytes(rbuf_img6);
			pattern_src_brightness_to_alpha_RGBA_Bytes p8 = new pattern_src_brightness_to_alpha_RGBA_Bytes(rbuf_img7);
			pattern_src_brightness_to_alpha_RGBA_Bytes p9 = new pattern_src_brightness_to_alpha_RGBA_Bytes(rbuf_img8);

			pattern_filter_bilinear_RGBA_Bytes fltr = new pattern_filter_bilinear_RGBA_Bytes();           // Filtering functor

			// agg::line_image_pattern is the main container for the patterns. It creates
			// a copy of the patterns extended according to the needs of the filter.
			// agg::line_image_pattern can operate with arbitrary image width, but if the
			// width of the pattern is power of 2, it's better to use the modified
			// version agg::line_image_pattern_pow2 because it works about 15-25 percent
			// faster than agg::line_image_pattern (because of using simple masking instead
			// of expensive '%' operation).

			//-- Create with specifying the source

			//-- Create uninitialized and set the source

			line_image_pattern patt = new line_image_pattern(new pattern_filter_bilinear_RGBA_Bytes());
			ImageLineRenderer ren_img = new ImageLineRenderer(ren_base, patt);

			rasterizer_outline_aa ras_img = new rasterizer_outline_aa(ren_img);

			draw_curve(patt, ras_img, ren_img, p1, m_curve1.curve());
			/*
			draw_curve(patt, ras_img, ren_img, p2, m_curve2.curve());
			draw_curve(patt, ras_img, ren_img, p3, m_curve3.curve());
			draw_curve(patt, ras_img, ren_img, p4, m_curve4.curve());
			draw_curve(patt, ras_img, ren_img, p5, m_curve5.curve());
			draw_curve(patt, ras_img, ren_img, p6, m_curve6.curve());
			draw_curve(patt, ras_img, ren_img, p7, m_curve7.curve());
			draw_curve(patt, ras_img, ren_img, p8, m_curve8.curve());
			draw_curve(patt, ras_img, ren_img, p9, m_curve9.curve());
			 */

			base.OnDraw(graphics2D);
		}
示例#4
0
		private void draw_curve(line_image_pattern patt, rasterizer_outline_aa ras, ImageLineRenderer ren,
			pattern_src_brightness_to_alpha_RGBA_Bytes src, IVertexSource vs)
		{
			patt.create(src);
			ren.scale_x(m_scale_x.Value);
			ren.start_x(m_start_x.Value);
			ras.add_path(vs);
		}