<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Mateusz Loskot &#187; stream</title>
	<atom:link href="http://mateusz.loskot.net/tag/stream/feed/" rel="self" type="application/rss+xml" />
	<link>http://mateusz.loskot.net</link>
	<description>mloskot&#039;s life, programming, c++, geo and adventures</description>
	<lastBuildDate>Tue, 10 Jan 2012 22:03:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>libjpeg and libpng go C++</title>
		<link>http://mateusz.loskot.net/2009/09/16/libjpeg-and-libpng-go-c/</link>
		<comments>http://mateusz.loskot.net/2009/09/16/libjpeg-and-libpng-go-c/#comments</comments>
		<pubDate>Tue, 15 Sep 2009 23:15:24 +0000</pubDate>
		<dc:creator>mloskot</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[boost]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[gil]]></category>
		<category><![CDATA[iterator]]></category>
		<category><![CDATA[libjpeg]]></category>
		<category><![CDATA[libpng]]></category>
		<category><![CDATA[library]]></category>
		<category><![CDATA[range]]></category>
		<category><![CDATA[raster]]></category>
		<category><![CDATA[stream]]></category>

		<guid isPermaLink="false">http://mateusz.loskot.net/?p=1006</guid>
		<description><![CDATA[I&#8217;ve just come across an interesting project(s). It is jpegxx and pngxx: two (or three if imagexx adaptors counted) thin libraries wrapping libjpeg and libpng with interface of C++ streams, iterators and ranges. It slowly is getting crowded around raster &#8230; <a href="http://mateusz.loskot.net/2009/09/16/libjpeg-and-libpng-go-c/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just come across an interesting project(s). It is <a href=" http://www.mr-edd.co.uk/?p=117">jpegxx and pngxx</a>: two (or three if <a href="http://bitbucket.org/edd/imagexx/">imagexx</a> adaptors counted) thin libraries wrapping <a href="http://www.ijg.org/">libjpeg</a> and <a href="http://www.libpng.org/">libpng</a> with interface of C++ streams, iterators and ranges.</p>
<p>It slowly is getting crowded around raster libraries in C++. Another alternative is <a href="http://opensource.adobe.com/">GIL</a> developed by Adobe and included in <a href="http://www.boost.org/doc/libs/1_40_0/libs/gil/doc/index.html">Boost C++ Libraries</a> with collection of <a href="http://gil-contributions.googlecode.com/">IO and more extensions</a>.</p>
<p><a href="http://en.wikipedia.org/wiki/Winnie-the-Pooh">Just what tigers like best</a>. Isn&#8217;t it?</p>
]]></content:encoded>
			<wfw:commentRss>http://mateusz.loskot.net/2009/09/16/libjpeg-and-libpng-go-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OSGIS UK 2009 Live</title>
		<link>http://mateusz.loskot.net/2009/06/21/osgis-uk-2009-live/</link>
		<comments>http://mateusz.loskot.net/2009/06/21/osgis-uk-2009-live/#comments</comments>
		<pubDate>Sun, 21 Jun 2009 20:06:36 +0000</pubDate>
		<dc:creator>mloskot</dc:creator>
				<category><![CDATA[open source]]></category>
		<category><![CDATA[conference]]></category>
		<category><![CDATA[event]]></category>
		<category><![CDATA[events]]></category>
		<category><![CDATA[foss4g]]></category>
		<category><![CDATA[live]]></category>
		<category><![CDATA[nottingham]]></category>
		<category><![CDATA[osgis]]></category>
		<category><![CDATA[stream]]></category>
		<category><![CDATA[transmission]]></category>
		<category><![CDATA[uk]]></category>
		<category><![CDATA[university]]></category>
		<category><![CDATA[webcast]]></category>

		<guid isPermaLink="false">http://mateusz.loskot.net/?p=670</guid>
		<description><![CDATA[Tomorrow early morning I&#8217;m leaving to Nottingham to attend the OSGIS UK 2009 conference. It&#8217;s been long time since FOSS4G 2007 and I didn&#8217;t make it to Cape Town last year, so I&#8217;m looking forward to meet FOSS4G and OSGeo &#8230; <a href="http://mateusz.loskot.net/2009/06/21/osgis-uk-2009-live/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Tomorrow early morning I&#8217;m leaving to Nottingham to attend the <a href="http://www.opensourcegis.org.uk/">OSGIS UK 2009</a> conference. It&#8217;s been long time since <a href="http://2007.foss4g.org/">FOSS4G 2007</a> and I didn&#8217;t make it to <a href="http://conference.osgeo.org/index.php/foss4g/2008">Cape Town</a> last year, so I&#8217;m looking forward to meet FOSS4G and OSGeo folks in UK.</p>
<p>A few minutes ago, Suchith Anand <a href="http://lists.osgeo.org/pipermail/discuss/2009-June/005457.html">announced</a> there will be live streaming transmission available from OSGIS sessions. This is cool!</p>
<p>By the way, does anyone remember a kind of pioneer transmission from <a href="http://foss4g2006.org/">FOSS4G 2006</a> in Lausanne? The videos are <a href="http://foss4g2006.org/internalPage.py?pageId=21&#038;confId=1">still linked</a> but seem to be unavailable. Pity. It would be cool to archive them somewhere on <a href="http://conference.osgeo.org/">foss4g.org</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://mateusz.loskot.net/2009/06/21/osgis-uk-2009-live/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WKB hex decoder in C++</title>
		<link>http://mateusz.loskot.net/2008/08/21/wkb-hex-decoder-in-c/</link>
		<comments>http://mateusz.loskot.net/2008/08/21/wkb-hex-decoder-in-c/#comments</comments>
		<pubDate>Thu, 21 Aug 2008 15:53:56 +0000</pubDate>
		<dc:creator>mloskot</dc:creator>
				<category><![CDATA[life]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[binary]]></category>
		<category><![CDATA[bytes]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[decode]]></category>
		<category><![CDATA[fdo]]></category>
		<category><![CDATA[fgf]]></category>
		<category><![CDATA[hex]]></category>
		<category><![CDATA[ogc]]></category>
		<category><![CDATA[postgis]]></category>
		<category><![CDATA[project]]></category>
		<category><![CDATA[stream]]></category>
		<category><![CDATA[wkb]]></category>

		<guid isPermaLink="false">http://mateusz.loskot.net/?p=270</guid>
		<description><![CDATA[In PostGIS world, I often need to construct geometry from Well-Known-Binary (WKB) or PostGIS EWKB stream encoded as hex stream. It&#8217;s easy to do if I have access to PostgreSQL/PostGIS client which accepts SQL queries: SELECT ST_AsText( ST_GeomFromWKB( decode('0101000000e5d022dbf93e2e40dbf97e6abc743540', 'hex'), &#8230; <a href="http://mateusz.loskot.net/2008/08/21/wkb-hex-decoder-in-c/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>In <a href="http://www.postgis.org/">PostGIS</a> world, I often need to construct geometry from Well-Known-Binary (WKB) or <a href="http://www.postgis.org/documentation/manual-1.3/ch04.html">PostGIS EWKB</a> stream encoded as hex stream. It&#8217;s easy to do if I have access to PostgreSQL/PostGIS client which accepts SQL queries:</p>
<pre><code>SELECT
   ST_AsText(
      ST_GeomFromWKB(
         decode('0101000000e5d022dbf93e2e40dbf97e6abc743540', 'hex'),
         4326))</code></pre>
</p>
<p>I often need to do the same directly in C++ code &#8211; parse hex encoded binary stream to raw stream of bytes. Here is simple hex decoder I use:</p>
<pre><code>#include &lt;sstream&gt;
#include &lt;string&gt;
#include &lt;vector&gt;
typedef std::vector&lt;unsigned char&gt; ewkb_t;

// bytes [out] - buffer for binary output
void hex_to_bytes(std::string const&#038; hexstr, ewkb_t&#038; bytes)
{
    bytes.clear();
    for(std::string::size_type i = 0; i < hexstr.size() / 2; ++i)
    {
        std::istringstream iss(hexstr.substr(i * 2, 2));
        unsigned int n;
        iss >> std::hex >> n;
        bytes.push_back(static_cast&lt;unsigned char&gt;(n));
    }
}
</code></pre>
</p>
<p>For example, I use it to build <a href="http://trac.osgeo.org/fdo/browser/trunk/Providers/PostGIS/Src/Provider/PgGeometry.h">FDO geometry objects</a> using another utility <a href="http://trac.osgeo.org/fdo/browser/trunk/Providers/PostGIS/Src/Provider/PgGeometry.cpp?rev=3904#L284">CreateGeometryFromExtendedWkb</a> defined in FDO provider for PostGIS:</p>
<pre><code>// POINT (1.234 5.678)
std::string ewkbhex("01010000005839B4C876BEF33F83C0CAA145B61640");
ewkb_t ewkb;
hex_to_bytes(ewkbhex, ewkb);
if (!ewkb.empty())
{
   FdoPtr&lt;fdoigeometry> g = CreateGeometryFromExtendedWkb(ewkb);
   // ... use geometry
}</code></pre></p>
]]></content:encoded>
			<wfw:commentRss>http://mateusz.loskot.net/2008/08/21/wkb-hex-decoder-in-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

