AGG 坐标转换管道(Coordinate conversion pipeline)
2011-06-10 11:29
246 查看
Coordinate conversion pipeline 坐标转换管道坐标转换管道用于改变顶点源产生的顶点,包括坐标、命令、产生新顶点等。如对顶点进行矩阵变换、插入顶点形成虚线之类的功能。变换矩阵(trans_affine)在认识转换管道之前,先了解一下AGG的变换矩阵。通过顶点坐标与矩阵的运行,我们可以得到新的坐标。关于图像的矩阵运算,MSDN里 有一篇关 于GDI+矩阵运算的文章,很值得一看头文件#include <agg_trans_affine.h>类型trans_affine成员变量
成员方法
实验代码(基于此 处代码)加入头文件 #include "agg_conv_transform.h"把on_draw()方法的里从“// Vertex Source”到“// Scanline Rasterizer”之间的代码改写成: // Vertex Source agg::ellipse ell(0,0,50,50); //圆心在中间 // Coordinate conversion pipeline agg::trans_affine mtx; mtx.scale(0.5,1); // x轴缩小到原来的一半 mtx.rotate(agg::deg2rad(30)); // 旋转30度 mtx.translate(100,100); // 平移100,100 typedef agg::conv_transform<agg::ellipse> ell_ct_type; ell_ct_type ctell(ell, mtx); // 矩阵变换 typedef agg::conv_contour<ell_ct_type> ell_cc_type; ell_cc_type ccell(ctell); // 轮廓变换 typedef agg::conv_stroke<ell_cc_type> ell_cc_cs_type; ell_cc_cs_type csccell(ccell); // 转换成多义线 得到的图形是: 注:trans_affine不 仅仅用于源顶点的变换,在AGG库中有不少地方都能看到它。比如后面会讲到的线段(span)生成器,通过变换矩阵,就能够 自由变换填充于多边形之内的图案。 坐标转换管道头文件#include <agg_conv_stroke.h> // conv_stroke #include <agg_conv_dash.h> // conv_dash #include <agg_conv_marker.h> // conv_marker #include <agg_conv_curve.h> // conv_curve #include <agg_conv_contour.h> // conv_contour #include <agg_conv_smooth_poly1.h> // conv_smooth_poly1.h #include <agg_conv_bspline.h> // conv_bspline #include <agg_conv_transform.h> // conv_transform 类型(演示程序基于基于此处代码)
|
相关文章推荐
- Fix Pipeline Simulate (固定管道模拟)
- laravel管道pipeline用到的地方
- jenkins~管道Pipeline里使用公用类库
- 【Scikit-Learn 中文文档】Pipeline(管道)和 FeatureUnion(特征联合): 合并的评估器 - 数据集转换 - 用户指南 | ApacheCN
- .NET客户端实现Redis中的管道(PipeLine)与事物(Transactions)
- redis 性能优化优化提升之管道(pipeline)
- Tomcat详解(4)---Pipeline-Value 管道
- Android OpenGL ES 开发教程(3):OpenGL ES管道(Pipeline)
- Mongodb 聚合管道(Aggregation Pipeline)
- AGG第三十八课 一些不常用的坐标转换管道
- Scrapy框架学习(二)----Item Pipeline(管道)和Scrapy Shell
- 【Scikit-Learn 中文文档】Pipeline(管道)和 FeatureUnion(特征联合): 合并的评估器 - 数据集转换 - 用户指南 | ApacheCN
- Gstreamer GstPipeline管道
- Android OpenGL ES(二):OpenGL ES管道(Pipeline)
- 浅谈管道模型(Pipeline)
- redis基础简介(六)- jedis使用管道(pipeline)对redis进行读写(使用hmset、hgetall测试)
- Redis中的管道(PipeLine)与事物(Transactions)
- 5.1 Coordinate spaces in the graphics pipeline
- OpenGL 图形管道(graphics pipeline)过程
- 【Scikit-Learn 中文文档】Pipeline(管道)和 FeatureUnion(特征联合): 合并的评估器 - 数据集转换 - 用户指南 | ApacheCN