Tiles or Strips?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Tiles or Strips?

graphicsRat
Hi -

I'm new to LibTIFF and I've been studying the docs. I've perused a few
sample programs start out with the supposed foreknowledge that the
raster is stored as strips or tiles, and that does not sit well with the
cautious programmer in me i.e., one day such a program will encounter
raster thats written in the *other* format(?).

Whats the best approach to writing a does one write a flexible reader
i.e., determining the beforehand if the data is stored as strips or tiles?

Thanks,

- Olumide
_______________________________________________
Tiff mailing list: [hidden email]
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/
Reply | Threaded
Open this post in threaded view
|

Re: Tiles or Strips?

graphicsRat
Olumide wrote:
> Whats the best approach to writing a does one write a flexible reader
> i.e., determining the beforehand if the data is stored as strips or tiles?

Oops! I meant to say, what is the best approach to writing a flexible
reader ...

_______________________________________________
Tiff mailing list: [hidden email]
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/
Reply | Threaded
Open this post in threaded view
|

Re: Tiles or Strips?

Bob Friesenhahn
In reply to this post by graphicsRat
On Mon, 30 Oct 2006, Olumide wrote:

> I'm new to LibTIFF and I've been studying the docs. I've perused a few sample
> programs start out with the supposed foreknowledge that the raster is stored
> as strips or tiles, and that does not sit well with the cautious programmer
> in me i.e., one day such a program will encounter raster thats written in the
> *other* format(?).
>
> Whats the best approach to writing a does one write a flexible reader i.e.,
> determining the beforehand if the data is stored as strips or tiles?

That is a good question with no easy answer.  There are other issues
to worry abut besides strips and tiles.  It depends on the level of
quality you expect from your implementation and the type of TIFF
images you expect to deal with most often.

Feel free to read the TIFF support code for GraphicsMagick from

http://cvs.graphicsmagick.org/cgi-bin/cvsweb.cgi/GraphicsMagick/coders/tiff.c?only_with_tag=MAIN

Bob
======================================
Bob Friesenhahn
[hidden email], http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/

_______________________________________________
Tiff mailing list: [hidden email]
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/
Reply | Threaded
Open this post in threaded view
|

Re: Tiles or Strips?

Joris Van Damme (AWare Systems)
In reply to this post by graphicsRat
Olumide,

Olumide wrote:
> I'm new to LibTIFF and I've been studying the docs. I've perused a few
> sample programs start out with the supposed foreknowledge that the
> raster is stored as strips or tiles, and that does not sit well with
> the cautious programmer in me i.e., one day such a program will
> encounter raster thats written in the *other* format(?).
>
> Whats the best approach to writing a does one write a flexible reader
> i.e., determining the beforehand if the data is stored as strips or
> tiles?

If you use LibTiff, you can use the function TIFFIsTiled to determine
whether a particular IFD contains strips or tiles, and respond
accordingly.

If you don't use LibTiff, but a writing your own reader, an
investigation of the tag set will determine the format. Either all of
TileWidth, TileLength, TileOffsets and TileByteCounts is present, in
which case it contains tiles, or either all of RowsPerStrip,
StripOffsets, and StripByteCounts is present, in which case it contains
strips.

Does that answer your question? I'm not sure how to interpret your
question... When exactly is 'beforehand'?


Best regards,

Joris Van Damme
[hidden email]
http://www.awaresystems.be/
Download your free TIFF tag viewer for windows here:
http://www.awaresystems.be/imaging/tiff/astifftagviewer.html

_______________________________________________
Tiff mailing list: [hidden email]
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/