﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-socketref,再见！高德-随笔分类-AGG/GEOS/Cairo/SVG</title><link>http://www.cppblog.com/socketref/category/6986.html</link><description>gis,mouse,luolasi</description><language>zh-cn</language><lastBuildDate>Sat, 31 Aug 2013 08:52:59 GMT</lastBuildDate><pubDate>Sat, 31 Aug 2013 08:52:59 GMT</pubDate><ttl>60</ttl><item><title>移植地图绘制引擎从Qt切换到Cairo</title><link>http://www.cppblog.com/socketref/archive/2013/08/31/202891.html</link><dc:creator>放屁阿狗 </dc:creator><author>放屁阿狗 </author><pubDate>Sat, 31 Aug 2013 07:39:00 GMT</pubDate><guid>http://www.cppblog.com/socketref/archive/2013/08/31/202891.html</guid><wfw:comment>http://www.cppblog.com/socketref/comments/202891.html</wfw:comment><comments>http://www.cppblog.com/socketref/archive/2013/08/31/202891.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/socketref/comments/commentRss/202891.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/socketref/services/trackbacks/202891.html</trackback:ping><description><![CDATA[由于最近也是比较有时间，想着将Windows版本的地图绘制引擎移植到Linux。<br />地图Render部分采用的是Qt，所以过程非常顺利，用Eclipse+CDT重建工程，略微几个小改动便完成了移植。<br />但之后发现了Qt带来的问题了，地图绘制引擎支持并发处理多个绘制请求，不同的绘制请求将在不同的线程Thread中被执行，多线程的情况便出现了问题，提示QPixmap不能在非UI线程被构造，如果强行构造，便出现了内存数据访问违例的异常错误，进程直接coredump，这个问题困扰了一些时间；<br />之后改了改代码，将数据处理和绘制代码隔离开，线程thread中进行数据加载、分析、计算，绘制代码采用Qt的signal/slot机制完成，就是工作线程处理好数据之后通过emit signal将绘制请求发送给ui主线程的slot处理函数。这种实现方法的问题在于绘制工作都将被串行执行，性能下降。<br />几年前在移植libsvg到wince时采用过cairo( cairographices.org) ,有点使用经验，且cairo是gnome的标准图形库，性能应该不错，所以直接改为cairo。<br />cairomm是cairo的c++包装，编译还需sig++，cairo的api还是挺丰富的，字体，反走样，矩阵... 操作也是相当简单&nbsp;<br />很快移植完成，运行效果还是比较满意，现在正考虑地图引擎移植到ios设备，目前需要琢磨cairomm，sig++，pixmap之类的东西如何移植问题(或者直接采用ios的Fundation的绘图api)<br /><br /><img src ="http://www.cppblog.com/socketref/aggbug/202891.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/socketref/" target="_blank">放屁阿狗 </a> 2013-08-31 15:39 <a href="http://www.cppblog.com/socketref/archive/2013/08/31/202891.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>PPM(portable pixel map)</title><link>http://www.cppblog.com/socketref/archive/2008/06/24/54493.html</link><dc:creator>放屁阿狗 </dc:creator><author>放屁阿狗 </author><pubDate>Tue, 24 Jun 2008 13:11:00 GMT</pubDate><guid>http://www.cppblog.com/socketref/archive/2008/06/24/54493.html</guid><wfw:comment>http://www.cppblog.com/socketref/comments/54493.html</wfw:comment><comments>http://www.cppblog.com/socketref/archive/2008/06/24/54493.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/socketref/comments/commentRss/54493.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/socketref/services/trackbacks/54493.html</trackback:ping><description><![CDATA[reference: http://netpbm.sourceforge.net/doc/ppm.html<br><br>
<p>Each PPM image consists of the following:
</p>
<ol>
    <li>A "magic number" for identifying the file type.
    A ppm image's magic number is the two characters "P6".
    </li>
    <li>
    Whitespace (blanks, TABs, CRs, LFs).
    </li>
    <li>
    A width, formatted as ASCII characters in decimal.
    </li>
    <li>
    Whitespace.
    </li>
    <li>
    A height, again in ASCII decimal.
    </li>
    <li>
    Whitespace.
    </li>
    <li>
    The maximum color value (Maxval), again in ASCII decimal.  Must be less
    than 65536 and more than zero.
    </li>
    <li>A single whitespace character (usually a newline).
    </li>
    <li>A raster of Height rows, in order from top to bottom.  Each row
    consists of Width pixels, in order from left to right.  Each pixel is
    a triplet of red, green, and blue samples, in that order.  Each sample
    is represented in pure binary by either 1 or 2 bytes.  If the Maxval
    is less than 256, it is 1 byte.  Otherwise, it is 2 bytes.  The most
    significant byte is first.
    <p>A row of an image is horizontal.  A column is vertical.  The pixels
    in the image are square and contiguous.
    </p>
    </li>
    <li>In the raster, the sample values are "nonlinear." They are
    proportional to the intensity of the ITU-R Recommendation BT.709 red,
    green, and blue in the pixel, adjusted by the BT.709 gamma transfer
    function.  (That transfer function specifies a gamma number of 2.2 and
    has a linear section for small intensities).  A value of Maxval for
    all three samples represents CIE D65 white and the most intense color
    in the color universe of which the image is part (the color universe
    is all the colors in all images to which this image might be
    compared).
    <p>ITU-R Recommendation BT.709 is a renaming of the former CCIR
    Recommendation 709.  When CCIR was absorbed into its parent
    organization, the ITU, ca. 2000, the standard was renamed.  This
    document once referred to the standard as CIE Rec. 709, but it isn't
    clear now that CIE ever sponsored such a standard.
    </p>
    <p>Note that another popular color space is the newer sRGB.  A common
    variation on PPM is to subsitute this color space for the one specified.
    </p>
    </li>
    <li>
    Note that a common variation on the PPM format is to have the sample
    values be "linear," i.e. as specified above except without
    the gamma adjustment.  <strong>pnmgamma</strong> takes such a PPM variant as
    input and produces a true PPM as output.
    </li>
    <li>Strings starting with "#" may be comments, the same as
    with <a  href="http://netpbm.sourceforge.net/doc/pbm.html">PBM</a>.
    </li>
</ol>
<br><br><img src ="http://www.cppblog.com/socketref/aggbug/54493.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/socketref/" target="_blank">放屁阿狗 </a> 2008-06-24 21:11 <a href="http://www.cppblog.com/socketref/archive/2008/06/24/54493.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>几个开源2D Image 库比较</title><link>http://www.cppblog.com/socketref/archive/2008/05/08/49240.html</link><dc:creator>放屁阿狗 </dc:creator><author>放屁阿狗 </author><pubDate>Thu, 08 May 2008 12:07:00 GMT</pubDate><guid>http://www.cppblog.com/socketref/archive/2008/05/08/49240.html</guid><wfw:comment>http://www.cppblog.com/socketref/comments/49240.html</wfw:comment><comments>http://www.cppblog.com/socketref/archive/2008/05/08/49240.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/socketref/comments/commentRss/49240.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/socketref/services/trackbacks/49240.html</trackback:ping><description><![CDATA[<br>Image Decoder: <br>&nbsp;&nbsp;&nbsp; libpng,libjpeg,libtiff,<br><br>Image库: <br>&nbsp;&nbsp;&nbsp; cimg, devil,python-pil,agg,cximage,gdk-pixbuf,wxImage(wxWidget)，magic-image<br><br>cimg: 采用template技术，整个库就一个cimg.h，使用起来确实方便其内在功能确实强大,只是简单应用了一下<br>pil: 用python写过4国军旗的游戏,采用的就是这个image库<br>agg: 采用template技术，几乎涵盖了2d image操作的所有功能，也是弱耦合，使用起来非常灵活<br>cximage: 做导航设备的图片浏览软件时采用image 库，基本还是比较好用<br>gdk-pixbuf: gdk/gtk标准的image 库，gnome的大量软件均采用其库。移植 librsvg时使用过<br>wxImage: 依赖 wxWidget库，类似 Qt的 QtImage类<br><img src ="http://www.cppblog.com/socketref/aggbug/49240.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/socketref/" target="_blank">放屁阿狗 </a> 2008-05-08 20:07 <a href="http://www.cppblog.com/socketref/archive/2008/05/08/49240.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>