|
Boost : |
Subject: Re: [boost] Half-baked GIL IO extension review
From: Edd Dawson (lists_at_[hidden])
Date: 2010-12-06 19:42:24
On 12/7/2010 12:23 AM, Mateusz Loskot wrote:
> On 06/12/10 23:10, Edd Dawson wrote:
>> 4. Is there support for obtaining the real-world dimensions of a loaded
>> raster in millimetres, say? I work on CAD/graphics applications which
>> need this functionality in order to generate reasonable texture
>> coordinates.
>
> Edd,
>
> I'm curious about this one. How do you expect such physical
> dimension to be calculated? Do you expect a metadata with physical
> resolution provided e.g. written as TIFF tag?
All I know is that libpng and libjpeg provide access to this information in a
crude form. I don't know whether physical dimensions are mandated by the
respective formats or if the libraries are implementing common extensions, but
in each case, the information is there.
In the case of libjpeg, the information is exposed/advertised in the
jpeg_decompress_struct and jpeg_compress_struct structures. You can see how I
use them here:
http://bitbucket.org/edd/jpegxx/src/ea2492a1a4a6/src/read.cpp#cl-62
http://bitbucket.org/edd/jpegxx/src/ea2492a1a4a6/src/write.cpp#cl-75
In libpng, have a look in the docs for e.g. png_get_x_pixels_per_meter.
I'm entirely ignorant in the case of libtiff, I'm afraid.
I do know that most (all?) versions of Adobe CS do not write these dimensions,
as least not by default. I think GIMP can, though.
> Personally, I'm looking for Boost.GIL in geospatial applications,
> but there an extension would need to be provided to manage dedicated
> metadata where coordinate system/reference frame/resolution is provided,
> so it's possible to deduce physical dimensions.
Well I understand that you can cram all kinds of stuff in to PNGs, but I'm
probably not the best person to ask about that.
>
>> I hope this was useful and my lack of general GIL knowledge doesn't
>> invalidate too much of my evaluation.
>
> I'm sure your voice is very helpful here and thank you for participating
> in the review.
>
> BTW, I know your libraries. I've been enjoying your blog for
> quite a while now :-)
Aw shucks :)
Kind regards,
Edd
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk