1 //---
2 // File: ossimInfo.h
3 //
4 // License: MIT
5 //
6 // Author:  David Burken
7 //
8 // Description: ossimInfo class declaration
9 //
10 // See class doxygen descriptions below for more.
11 //
12 //---
13 // $Id$
14 
15 #ifndef ossimInfo_HEADER
16 #define ossimInfo_HEADER 1
17 
18 #include <ossim/base/ossimConstants.h>
19 #include <ossim/base/ossimKeywordlist.h>
20 #include <ossim/base/ossimReferenced.h>
21 #include <ossim/base/ossimRefPtr.h>
22 #include <ossim/imaging/ossimImageHandler.h>
23 #include <ossim/util/ossimTool.h>
24 #include <ostream>
25 
26 class ossimGpt;
27 
28 /**
29  * @brief ossimInfo class.
30  *
31  * This is a utility class for getting information from the ossim library.
32  * This includes information from an image, general library queries, like
33  * loaded plugins, and just general stuff like height for point, conversions
34  * and so on that are easily obtained through the library.
35  */
36 class OSSIM_DLL ossimInfo : public ossimTool
37 {
38 public:
39    /** Used by ossimUtilityFactory */
40    static const char* DESCRIPTION;
41 
42    /** default constructor */
43    ossimInfo();
44 
45    /** virtual destructor */
46    virtual ~ossimInfo();
47 
48    /**
49     * @brief Adds application arguments to the argument parser.
50     * @param ap Parser to add to.
51     */
52    virtual void setUsage(ossimArgumentParser& ap);
53 
54    /**
55     * @brief Initial method.
56     *
57     * Typically called from application prior to execute.  This parses
58     * all options and put in keyword list m_kwl.
59     *
60     * @param ap Arg parser to initialize from.
61     *
62     * @return true, indicating process should continue with execute.
63     */
64    virtual bool initialize(ossimArgumentParser& ap);
65 
66    /**
67     * @brief execute method.
68     *
69     * Performs the actual dump of information.  This executes any options
70     * set including image operations, i.e. -i -p --dno and so on.
71     *
72     * @note Throws ossimException on error.
73     */
74    virtual bool execute();
75 
76    virtual ossimString getClassName() const { return "ossimInfo"; }
77 
78    /**
79     * @brief handles image options.
80     *
81     * Handles image type info opions,  i.e. -i -p --dno and so on.
82     *
83     * @return Number of consumed options.
84     */
85    ossim_uint32 executeImageOptions(const ossimFilename& file);
86 
87    /**
88     * @brief getImageInfo Method to open image "file" and get image info
89     * in the form of a ossimKeywordlist.
90     *
91     * Flags turn on various pieces of info.  These equate to options in
92     * ossim-info for image information.
93     *
94     * @param file Image file to get information for.
95     * @param dumpFlag      ossim-info -d
96     * @param dnoFlag       ossim-info --dno
97     * @param imageGeomFlag ossim-info -p
98     * @param imageInfoFlag ossim-info -i
99     * @param metaDataFlag  ossim-info -m
100     * @param paletteFlag   ossim-info --palette
101     * @param kwl Initialized by this method.
102     */
103    void getImageInfo( const ossimFilename& file,
104                       bool dumpFlag,
105                       bool dnoFlag,
106                       bool imageGeomFlag,
107                       bool imageInfoFlag,
108                       bool metaDataFlag,
109                       bool paletteFlag,
110                       ossimKeywordlist& kwl ) const;
111 
112    /**
113     * @brief getImageInfo Method to open image "file" and get image info
114     * for entry in the form of a ossimKeywordlist.
115     *
116     * Equivalent of ossim-info -i -p <image> for entry.
117     *
118     * Throws ossimException on error if file cannot be opened or entry is
119     * invalid.
120     *
121     * @param file Image file to get information for.
122     * @param entry Entry index to open.
123     * @return true on success, false on error.
124     */
125    bool getImageInfo( const ossimFilename& file,
126                       ossim_uint32 entry,
127                       ossimKeywordlist& kwl ) const;
128 
129    /**
130     * @brief Opens image handler and stores in m_img data member.
131     * @param Image to open.
132     * @note Throws ossimException if image cannot be opened.
133     */
134    void openImage(const ossimFilename& file);
135 
136    /**
137     * @brief Opens image handler and stores in m_img data member.
138     * @param Image to open.
139     * @note Throws ossimException if image cannot be opened.
140     */
141    void openImageFromState(const ossimFilename& file);
142 
143    /** @brief Closes image if open. */
144    void closeImage();
145 
146    /**
147     * @return Ref pointer to the image handler.  Can be null if an image is
148     * not open.
149     */
150    ossimRefPtr<ossimImageHandler> getImageHandler();
151 
152    /** @brief Dumps the image information from ossimInfoFactoryRegistry */
153    void prettyPrint(const ossimFilename& file) const;
154 
155    /**
156     * @brief Dumps the image information from ossimInfoFactoryRegistry to
157     * keyword list.
158     * @param file Image to dump.
159     * @param dnoFlag Dump no overviews. If true do not dump overviews.
160     * @param kwl Initialized by this method.
161     */
162    void dumpImage(const ossimFilename& file,
163                   bool dnoFlag,
164                   ossimKeywordlist& kwl) const;
165 
166    /**
167     * @brief Prints factories.
168     * @param keywordListFlag If true the result of a saveState will be output
169     * for each factory.
170     * */
171    void printFactories(bool keywordListFlag) const;
172 
173    /**
174     * @brief Populates keyword list with metadata.
175     * This requires open image.
176     *
177     * @param kwl Keyword list to populate.
178     */
179    void getImageMetadata(ossimKeywordlist& kwl) const;
180 
181    /**
182     * @brief Populates keyword list with palette data.
183     * This requires open image.
184     *
185     * @param kwl Keyword list to populate.
186     */
187    void getImagePalette(ossimKeywordlist& kwl);
188 
189    /**
190     * @brief Populates keyword list with general image information.
191     *
192     * This requires open image.
193     *
194     * @param kwl Keyword list to populate.
195     * @param dnoFlag If true no entries flaged as overviews will be output.
196     */
197    void getImageInfo(ossimKeywordlist& kwl, bool dnoFlag);
198 
199    /**
200     * @brief Populates keyword list with general image information.
201     *
202     * @param entry Entry number to select.  Note this is the entry number from
203     * the getEntryList call not a simple zero based entry index.
204     *
205     * @param kwl Keyword list to populate.
206     *
207     * @param dnoFlag If true no entries flaged as overviews will be output.
208     *
209     * This requires open image.
210     *
211     * @return true if entry info was saved to keyword list false if not.
212     */
213    bool getImageInfo(ossim_uint32 entry, ossimKeywordlist& kwl, bool dnoFlag);
214 
215    /**
216     * @brief Populates keyword list with image geometry/projection information.
217     *
218     * This requires open image.
219     *
220     * @param kwl Keyword list to populate.
221     * @param dnoFlag If true no entries flaged as overviews will be output.
222     */
223    void getImageGeometryInfo(ossimKeywordlist& kwl, bool dnoFlag);
224 
225    /**
226     * @brief Populates keyword list with image geometry/projection information.
227     *
228     * @param entry Entry number to select.  Note this is the entry number
229     * from the getEntryList call not a simple zero based entry index.
230     *
231     * @param kwl Keyword list to populate.
232     *
233     * @param dnoFlag If true no entries flaged as overviews will be output.
234     *
235     * This requires open image.
236     *
237     * @return true if entry info was saved to keyword list false if not.
238     */
239    bool getImageGeometryInfo( ossim_uint32 entry,
240                               ossimKeywordlist& kwl,
241                               bool dnoFlag );
242 
243    /**
244     * @brief Populates keyword list with image center point..
245     * @param kwl Keyword list to populate.
246     */
247    void getCenterImage(ossimKeywordlist& kwl);
248 
249    /**
250     * @brief Populates keyword list with edge to edge image bounds.
251     * @param kwl Keyword list to populate.
252     */
253    void getImageBounds(ossimKeywordlist& kwl);
254 
255    /**
256     * @brief Populates keyword list with image center ground point..
257     * @param kwl Keyword list to populate.
258     */
259    void getCenterGround(ossimKeywordlist& kwl);
260 
261    /**
262     * @brief Populates keyword list with ground point for image point.
263     *
264     * Associated input key values: "img2grd: <x> <y>"
265     * Output key: image0.ground_point:  (lat,lon,hgt,datum)
266     *
267     * @param kwl Keyword list to populate.
268     */
269    void getImg2grd(ossimKeywordlist& kwl);
270 
271    /**
272     * @brief Populates keyword list with image point for grund point.
273     *
274     * Associated input key values: "grd2img: (lat,lon,hgt,datum)"
275     * Output key: image0.image_point:  (x, y)
276     *
277     * @param kwl Keyword list to populate.
278     */
279    void getGrd2img(ossimKeywordlist& kwl);
280 
281    /**
282     * @brief Populates keyword list with up_is_up_angle.
283     *
284     * @param kwl Keyword list to populate.
285     *
286     * This requires open image.
287     */
288    void getUpIsUpAngle(ossimKeywordlist& kwl);
289 
290    /**
291     * @brief Populates keyword list with up_is_up_angle.
292     *
293     * @param entry Entry number to select.  Note this is the entry number
294     * from the getEntryList call not a simple zero based entry index.
295     *
296     * @param kwl Keyword list to populate.
297     *
298     * @param dnoFlag If true no entries flaged as overviews will be output.
299     *
300     * This requires open image.
301     */
302    void getUpIsUpAngle(ossim_uint32 entry, ossimKeywordlist& kwl);
303 
304    /**
305     * @brief Populates keyword list with image_to_ground. It will outoput image_point and ground_point
306     *
307     * @param kwl Keyword list to populate.
308     *
309     * This requires open image.
310     */
311    void getImageToGround(ossimKeywordlist& kwl);
312 
313    /**
314     * @brief Populates keyword list with image_to_ground. It will outoput image_point and ground_point
315     *
316     * @param entry Entry number to select.  Note this is the entry number
317     * from the getEntryList call not a simple zero based entry index.
318     *
319     * @param kwl Keyword list to populate.
320     *
321     * This requires open image.
322     */
323    void getImageToGround(ossim_uint32 entry, ossimKeywordlist& kwl);
324 
325    /**
326     * @brief Populates keyword list with north_up_angle.
327     *
328     * @param kwl Keyword list to populate.
329     *
330     * This requires open image.
331     */
332    void getNorthUpAngle(ossimKeywordlist& kwl);
333 
334    /**
335     * @brief Populates keyword list with north_up_angle.
336     *
337     * @param entry Entry number to select.  Note this is the entry number
338     * from the getEntryList call not a simple zero based entry index.
339     *
340     * @param kwl Keyword list to populate.
341     *
342     * @param dnoFlag If true no entries flaged as overviews will be output.
343     *
344     * This requires open image.
345     */
346    void getNorthUpAngle(ossim_uint32 entry, ossimKeywordlist& kwl);
347 
348    /**
349     * @brief Populates keyword list with image rectangle.
350     *
351     * This requires open image.
352     *
353     * @param kwl Keyword list to populate.
354     */
355    void getImageRect(ossimKeywordlist& kwl);
356 
357    /**
358     * @brief Populates keyword list with image rectangle.
359     *
360     * @param entry Entry number to select.  Note this is the entry number from
361     * the getEntryList call not a simple zero based entry index.
362     *
363     * @param kwl Keyword list to populate.
364     *
365     * This requires open image.
366     */
367    void getImageRect(ossim_uint32 entry, ossimKeywordlist& kwl);
368 
369    /**
370     * @return true if current open image entry is an overview.
371     */
372    bool isImageEntryOverview() const;
373 
374    /** @brief Dumps ossim preferences/configuration data. */
375    void printConfiguration() const;
376 
377    /**
378     * @brief Dumps ossim preferences/configuration data.
379     * @param out Output to write to.
380     * @return stream
381     */
382    std::ostream& printConfiguration(std::ostream& out) const;
383 
384    /** @brief Dumps datum list to stdout. */
385    void printDatums() const;
386 
387    /** @brief Dumps datum list to stream. */
388    std::ostream& printDatums(std::ostream& out) const;
389 
390    /** @brief Prints fonts list to stdout. */
391    void printFonts() const;
392 
393    /** @brief Prints fonts list to stream. */
394    std::ostream& printFonts(std::ostream& out) const;
395 
396    /** @brief Converts degrees to radians and outputs to stdout. */
397    void deg2rad(const ossim_float64& degrees) const;
398 
399    /**
400     * @brief Converts degrees to radians and outputs to stream.
401     * @param out Output to write to.
402     * @return stream
403     */
404    std::ostream& deg2rad(const ossim_float64& degrees, std::ostream& out) const;
405 
406    /**
407     * @brief Converts ecef point to lat lon height.
408     * @param out Output to write to.
409     * @return stream
410     */
411    std::ostream& ecef2llh(const ossimEcefPoint& ecefPoint, std::ostream& out) const;
412 
413    /** @brief Converts radians to degrees and outputs to stdout. */
414    void rad2deg(const ossim_float64& radians) const;
415 
416    /**
417     * @brief Converts radians to degrees and outputs to stream.
418     * @param out Output to write to.
419     * @return stream
420     */
421    std::ostream& rad2deg(const ossim_float64& radians, std::ostream& out) const;
422 
423    /** @brief Converts feet to meters and outputs to stdout. */
424    void ft2mtrs(const ossim_float64& feet, bool us_survey) const;
425 
426    /**
427     * @brief Converts feet to meters and outputs to stream.
428     * @param out Output to write to out.
429     * @return stream
430     */
431    std::ostream& ft2mtrs(const ossim_float64& feet, bool us_survey, std::ostream& out) const;
432 
433    /** @brief Converts meters to feet and outputs to stdout. */
434    void mtrs2ft(const ossim_float64& meters, bool us_survey) const;
435 
436    /**
437     * @brief Converts meters to feet and outputs to stream.
438     * @param out Output to write to out.
439     * @return stream
440     */
441    std::ostream& mtrs2ft(const ossim_float64& meters, bool us_survey, std::ostream& out) const;
442 
443    /**
444     * @brief Get meters per degree for a given latitude and outputs to stdout.
445     * @param latitude
446     */
447    void mtrsPerDeg(const ossim_float64& latitude) const;
448 
449    /**
450     * @brief Get meters per degree for a given latitude and outputs to stream.
451     * @param latitude
452     * @param out Output to write to out.
453     * @return stream
454     */
455    std::ostream& mtrsPerDeg(const ossim_float64& latitude, std::ostream& out) const;
456 
457    /**
458     * @brief Gets the height for ground point (latitude, longitude). Outputs
459     * to stdout.
460     * @param gpt Ground point.
461     */
462    void outputHeight(const ossimGpt& gpt) const;
463 
464    /**
465     * @brief Gets the height for ground point (latitude, longitude). Outputs
466     * to out.
467     * @param out Output to write to out.
468     * @return stream
469     */
470    std::ostream& outputHeight(const ossimGpt& gpt, std::ostream& out) const;
471 
472    /** @brief Prints supported image file extensions to stdout. */
473    void printExtensions() const;
474 
475    /**
476     * @brief Prints supported image file extensions to stream.
477     * @param out Output to write to out.
478     * @return stream
479     */
480    std::ostream& printExtensions(std::ostream& out) const;
481 
482    /** @brief Prints loaded plugins to stdout. */
483    void printPlugins() const;
484 
485    /**
486     * @brief Prints loaded plugins to stream.
487     * @param out Output to write to out.
488     * @return stream
489     */
490    std::ostream& printPlugins(std::ostream& out) const;
491 
492    /**
493     * @brief Test a plugin load  and outputs to stdout.
494     *
495     * @param plugin Plugin to test.
496     */
497    void testPlugin(const ossimFilename& plugin) const;
498 
499    /**
500     * @brief Test a plugin load outputs to stream.
501     *
502     * @param plugin Plugin to test.
503     * @param out Stream to write to.
504     * @param stream
505     */
506    std::ostream& testPlugin(const ossimFilename& plugin, std::ostream& out) const;
507 
508    /** @brief Prints overview types to stdout. */
509    void printOverviewTypes() const;
510 
511    /** @brief Prints overview types to stream. */
512    std::ostream& printOverviewTypes(std::ostream& out) const;
513 
514    /** @breif Prints projections to stdout. */
515    void printProjections() const;
516 
517    /** @breif Prints projections to stream. */
518    std::ostream& printProjections(std::ostream& out) const;
519 
520    /** @brief Prints reader properties to stdout. */
521    void printReaderProps() const;
522 
523    /** @brief Prints reader properties to stream. */
524    std::ostream& printReaderProps(std::ostream& out) const;
525 
526    /** @brief Prints resampler filters to stdout. */
527    void printResamplerFilters() const;
528 
529    /** @brief Prints resampler filters to stream. */
530    std::ostream& printResamplerFilters(std::ostream& out) const;
531 
532    /** @brief Prints list of available writers to stdout. */
533    void printWriters() const;
534 
535    /** @brief Prints list of available writers to stream. */
536    std::ostream& printWriters(std::ostream& out) const;
537 
538    /** @brief Prints writer properties to stdout. */
539    void printWriterProps() const;
540 
541    /** @brief Prints writer properties to stream. */
542    std::ostream& printWriterProps(std::ostream& out) const;
543 
544    /** @brief Prints zoom levels to stdout. */
545    void printZoomLevelGsds() const;
546 
547    /** @brief Prints zoom levels to stream. */
548    std::ostream& printZoomLevelGsds(std::ostream& out) const;
549 
550    /**
551     * @brief Gets the radiometry string, i.e. "8-bit" and so on, from scalar.
552     * @param scalar Scalar type.
553     * @param s String to initialize.
554     */
555    void getRadiometry(ossimScalarType scalar, std::string& s) const;
556 
557    /**
558     * @brief Gets build date.
559     * @param s String to initialize.
560     */
561    void getBuildDate(std::string& s) const;
562 
563    /**
564     * @brief Gets revision number.
565     * @param s String to initialize.
566     */
567    void getRevisionNumber(std::string& s) const;
568 
569    /**
570     * @brief Gets version.
571     * @param s String to initialize.
572     */
573    void getVersion(std::string& s) const;
574 
575 private:
576 
577    /**
578     * @brief Populates keyword list with metadata.
579     * @param ih Pointer to an image handler.
580     * @param kwl Keyword list to populate.
581     */
582    void getImageMetadata( const ossimImageHandler* ih,
583                           ossimKeywordlist& kwl ) const;
584 
585   /**
586    * @brief Populates keyword list with palette data.
587    * @param ih Pointer to an image handler.
588    * @param kwl Keyword list to populate.
589    */
590    void getImagePalette( ossimImageHandler* ih,
591                          ossimKeywordlist& kwl ) const;
592 
593    /**
594     * @brief Populates keyword list with general image information.
595     * @param ih Pointer to an image handler.
596     * @param kwl Keyword list to populate.
597     * @param dnoFlag If true no entries flaged as overviews will be output.
598     */
599    void getImageInfo( ossimImageHandler* ih,
600                       ossimKeywordlist& kwl,
601                       bool dnoFlag ) const;
602 
603    /**
604     * @brief Populates keyword list with general image information.
605     * @param ih Pointer to an image handler.
606     * @param entry Entry number to select.  Note this is the entry number from
607     * the getEntryList call not a simple zero based entry index.
608     * @param kwl Keyword list to populate.
609     * @param dnoFlag If true no entries flaged as overviews will be output.
610     * @return true if entry info was saved to keyword list false if not.
611     */
612    bool getImageInfo( ossimImageHandler* ih,
613                       ossim_uint32 entry,
614                       ossimKeywordlist& kwl,
615                       bool dnoFlag ) const;
616 
617    /**
618     * @brief Populates keyword list with image geometry/projection information.
619     * @param ih Pointer to an image handler.
620     * @param kwl Keyword list to populate.
621     * @param dnoFlag If true no entries flaged as overviews will be output.
622     */
623    void getImageGeometryInfo( ossimImageHandler* ih,
624                               ossimKeywordlist& kwl,
625                               bool dnoFlag ) const;
626 
627    /**
628     * @brief Populates keyword list with image geometry/projection information.
629     * @param ih Pointer to an image handler.
630     * @param entry Entry number to select.  Note this is the entry number
631     * from the getEntryList call not a simple zero based entry index.
632     * @param kwl Keyword list to populate.
633     * @param dnoFlag If true no entries flaged as overviews will be output.
634     * @return true if entry info was saved to keyword list false if not.
635     */
636    bool getImageGeometryInfo( ossimImageHandler* ih,
637                               ossim_uint32 entry,
638                               ossimKeywordlist& kwl,
639                               bool dnoFlag ) const;
640 
641    void getCenterImage( ossimImageHandler* ih,
642                         ossimKeywordlist& kwl ) const;
643    void getCenterImage( ossimImageHandler* ih,
644                         ossim_uint32 entry,
645                         ossimKeywordlist& kwl ) const;
646 
647    void getImageBounds( ossimImageHandler* ih,
648                         ossimKeywordlist& kwl ) const;
649    void getImageBounds( ossimImageHandler* ih,
650                         ossim_uint32 entry,
651                         ossimKeywordlist& kwl ) const;
652 
653    void getCenterGround( ossimImageHandler* ih,
654                          ossimKeywordlist& kwl ) const;
655    void getCenterGround( ossimImageHandler* ih,
656                          ossim_uint32 entry,
657                          ossimKeywordlist& kwl ) const;
658 
659    /**
660     * @brief Gets gound point from image point.
661     *
662     * Input key:value "img2grd: <x> <y>"
663     *
664     * @param Pointer to an image handler.
665     * @param kwl Keyword list to populate.
666     */
667    void getImg2grd( ossimImageHandler* ih,
668                     ossimKeywordlist& kwl ) const;
669    /**
670     * @brief Gets gound point from image point.
671     *
672     * Input key:value "img2grd: <x> <y>"
673     *
674     * @param Pointer to an image handler.
675     * @param entry Entry number to select. Note this is the entry number
676     * from the getEntryList call not a simple zero based entry index.
677     * @param kwl Keyword list to populate.
678     */
679    void getImg2grd( ossimImageHandler* ih,
680                     ossim_uint32 entry,
681                     ossimKeywordlist& kwl ) const;
682 
683    /**
684     * @brief Gets gound point from image point.
685     *
686     * Input key:value "img2grd: <x> <y>"
687     *
688     * @param Pointer to an image handler.
689     * @param kwl Keyword list to populate.
690     */
691    void getGrd2img( ossimImageHandler* ih,
692                     ossimKeywordlist& kwl ) const;
693    /**
694     * @brief Gets gound point from image point.
695     *
696     * Input key:value "img2grd: <x> <y>"
697     *
698     * @param Pointer to an image handler.
699     * @param entry Entry number to select. Note this is the entry number
700     * from the getEntryList call not a simple zero based entry index.
701     * @param kwl Keyword list to populate.
702     */
703    void getGrd2img( ossimImageHandler* ih,
704                     ossim_uint32 entry,
705                     ossimKeywordlist& kwl ) const;
706 
707    /**
708     * @brief Populates keyword list with up_is_up_angle.
709     * @param kwl Keyword list to populate.
710     */
711    void getUpIsUpAngle( ossimImageHandler* ih,
712                         ossimKeywordlist& kwl ) const;
713 
714    /**
715     * @brief Populates keyword list with up_is_up_angle.
716     * @param entry Entry number to select.  Note this is the entry number from
717     * the getEntryList call not a simple zero based entry index.
718     * @param kwl Keyword list to populate.
719     */
720    void getUpIsUpAngle( ossimImageHandler* ih,
721                         ossim_uint32 entry,
722                         ossimKeywordlist& kwl ) const;
723 
724   /**
725     * @brief Populates keyword list with north_up_angle.
726     * @param kwl Keyword list to populate.
727     */
728    void getNorthUpAngle( ossimImageHandler* ih,
729                          ossimKeywordlist& kwl ) const;
730 
731    /**
732     * @brief Populates keyword list with north_up_angle.
733     * @param entry Entry number to select.  Note this is the entry number from
734     * the getEntryList call not a simple zero based entry index.
735     * @param kwl Keyword list to populate.
736     */
737    void getNorthUpAngle( ossimImageHandler* ih,
738                          ossim_uint32 entry,
739                          ossimKeywordlist& kwl ) const;
740 
741    /**
742     * @brief Populates keyword list with image rectangle.
743     *
744     * @param kwl Keyword list to populate.
745     */
746    void getImageRect( ossimImageHandler* ih,
747                       ossimKeywordlist& kwl ) const;
748 
749    /**
750     * @brief Populates keyword list with image rectangle.
751     * @param entry Entry number to select.  Note this is the entry number from
752     * the getEntryList call not a simple zero based entry index.
753     * @param kwl Keyword list to populate.
754     */
755    void getImageRect( ossimImageHandler* ih,
756                       ossim_uint32 entry,
757                       ossimKeywordlist& kwl ) const;
758 
759    /**
760     * @brief Populates keyword list with rgb bands if available.
761     *
762     * This is image handler specific and within image handler specific to
763     * internal metadata, e.g. NITF IREPBAND keys.
764     *
765     * Example of key:value:
766     * rgb_bands:(2,1,0)
767     *
768     * @param ih Pointer to image handler.
769     * @param entry Current entry of image handler.
770     * @param kwl Keyword list to populate.
771     * @return true on success; false, on error.
772     */
773    bool getRgbBands( ossimImageHandler* ih,
774                      ossim_uint32 entry,
775                      ossimKeywordlist& kwl ) const;
776 
777    /** @return true if current open image entry is an overview. */
778    bool isImageEntryOverview( const ossimImageHandler* ih ) const;
779 
780    /**
781     * @brief Convert keyword list to xml then outputs to standard out.
782     * @param kwl Keyword list to output.
783     */
784    void outputXml( const ossimKeywordlist& kwl ) const;
785 
786    /**
787     * @brief Convert keyword list to xml then outputs to file.
788     * @param kwl Keyword list to output.
789     * @param file Output file to write to.
790     */
791    void outputXml( const ossimKeywordlist& kwl, const ossimFilename& file ) const;
792 
793   /**
794    * @brief Opens image.
795    * @param Image to open.
796    * @return ossimRefPtr with image handler.
797    * @note Throws ossimException if image cannot be opened.
798    */
799    ossimRefPtr<ossimImageHandler> openImageHandler(const ossimFilename& file) const;
800 
801    /** @return true if key is set to true; false, if not. */
802    bool keyIsTrue( const std::string& key ) const;
803 
804    /** Holds the open image. */
805    ossimRefPtr<ossimImageHandler> m_img;
806 };
807 
808 #endif /* #ifndef ossimInfo_HEADER */
809