[SCM] exiv2 packaging branch, master, updated. debian/0.25-3.1-3734-gdcbc29a

Maximiliano Curia maxy at moszumanska.debian.org
Thu Jul 13 17:37:45 UTC 2017


Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-extras/exiv2.git;a=commitdiff;h=3902c1d

The following commit has been merged in the master branch:
commit 3902c1d09295f55f6c27cde967c266468329da34
Author: Andreas Huggel <ahuggel at gmx.net>
Date:   Sun Jun 25 09:42:59 2006 +0000

    Cleaned-up TIFF dependencies
---
 src/Makefile          |   3 +-
 src/cr2image.cpp      |  11 +++---
 src/cr2image.hpp      |  13 +++----
 src/makernote2.hpp    |   3 +-
 src/mrwimage.cpp      |   2 +-
 src/pngchunk.cpp      |   2 +-
 src/tiffcomposite.cpp |  12 +++++-
 src/tiffcomposite.hpp |  70 ++++++++++++++++------------------
 src/tifffwd.hpp       | 103 ++++++++++++++++++++++++++++++++++++++++++++++++++
 src/tiffimage.cpp     |   2 +-
 src/tiffparser.cpp    |  26 +++++--------
 src/tiffparser.hpp    |  52 ++++---------------------
 src/tiffvisitor.hpp   |  15 +++-----
 13 files changed, 187 insertions(+), 127 deletions(-)

diff --git a/src/Makefile b/src/Makefile
index 7b03d9f..1fc049a 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -51,7 +51,8 @@ CCHDR =  exiv2_version.h      \
          exv_conf.h           \
          exv_msvc.h           \
          mn.hpp               \
-         rcsid.hpp
+         rcsid.hpp            \
+         tifffwd.hpp
 
 # Add library C++ source files to this list
 CCSRC =  basicio.cpp          \
diff --git a/src/cr2image.cpp b/src/cr2image.cpp
index 727867c..d596e3a 100644
--- a/src/cr2image.cpp
+++ b/src/cr2image.cpp
@@ -38,6 +38,7 @@ EXIV2_RCSID("@(#) $Id$")
 #endif
 
 #include "cr2image.hpp"
+#include "tiffcomposite.hpp"
 #include "tiffparser.hpp"
 #include "tiffvisitor.hpp"
 #include "image.hpp"
@@ -55,7 +56,7 @@ EXIV2_RCSID("@(#) $Id$")
 namespace Exiv2 {
 
     // CR2 decoder table for special CR2 decoding requirements
-    const TiffDecoderInfo Cr2DecoderItems::cr2DecoderInfo_[] = {
+    const TiffDecoderInfo Cr2Decoder::cr2DecoderInfo_[] = {
         { "*",       Tag::all, Group::ignr,    0 }, // Do not decode tags with group == Group::ignr
         { "*",         0x014a, Group::ifd0,    0 }, // Todo: Controversial, causes problems with Exiftool
         { "*",         0x0100, Group::ifd0,    0 }, // CR2 IFD0 refers to a preview image, ignore these tags
@@ -70,9 +71,9 @@ namespace Exiv2 {
         { "*",         0x8649, Group::ifd0,    &TiffMetadataDecoder::decodeIrbIptc    }
     };
 
-    const DecoderFct Cr2DecoderItems::findDecoder(const std::string& make, 
-                                                        uint32_t     extendedTag,
-                                                        uint16_t     group)
+    const DecoderFct Cr2Decoder::findDecoder(const std::string& make, 
+                                                   uint32_t     extendedTag,
+                                                   uint16_t     group)
     {
         DecoderFct decoderFct = &TiffMetadataDecoder::decodeStdTiffEntry;
         const TiffDecoderInfo* td = find(cr2DecoderInfo_, 
@@ -165,7 +166,7 @@ namespace Exiv2 {
         if (io_->error() || io_->eof()) throw Error(14);
 
         TiffParser::decode(this, buf.pData_, buf.size_, 
-                           TiffCreator::create, Cr2DecoderItems::findDecoder);
+                           TiffCreator::create, Cr2Decoder::findDecoder);
     } // Cr2Image::readMetadata
 
     void Cr2Image::writeMetadata()
diff --git a/src/cr2image.hpp b/src/cr2image.hpp
index ae7ab2e..048efee 100644
--- a/src/cr2image.hpp
+++ b/src/cr2image.hpp
@@ -34,7 +34,8 @@
 #include "exif.hpp"
 #include "iptc.hpp"
 #include "image.hpp"
-#include "tiffcomposite.hpp"
+#include "tifffwd.hpp"
+#include "types.hpp"
 
 // + standard includes
 #include <string>
@@ -43,8 +44,6 @@
 // namespace extensions
 namespace Exiv2 {
 
-    struct TiffDecoderInfo;
-
 // *****************************************************************************
 // class definitions
 
@@ -157,10 +156,10 @@ namespace Exiv2 {
     }; // class Cr2Image
 
     /*!
-      @brief Table of special Cr2 decoding functions and find function. See
-             TiffDecoderItems for details.
+      @brief Table of Cr2 decoding functions and find function. See
+             TiffDecoder for details.
      */
-    class Cr2DecoderItems {
+    class Cr2Decoder {
     public:
         /*!
           @brief Find the decoder function for a key. 
@@ -181,7 +180,7 @@ namespace Exiv2 {
     private:
         static const TiffDecoderInfo cr2DecoderInfo_[]; //<! CR2 decoder table
 
-    }; // class Cr2DecoderItems
+    }; // class Cr2Decoder
 
     /*!
       @brief This class models a Canon CR2 header structure.
diff --git a/src/makernote2.hpp b/src/makernote2.hpp
index 051b307..95d20da 100644
--- a/src/makernote2.hpp
+++ b/src/makernote2.hpp
@@ -20,7 +20,8 @@
  */
 /*!
   @file    makernote2.hpp
-  @brief   Makernote related classes
+  @brief   Makernote TIFF composite class TiffIfdMakernote and classes for 
+           various makernote headers.
   @version $Rev$
   @author  Andreas Huggel (ahu)
            <a href="mailto:ahuggel at gmx.net">ahuggel at gmx.net</a>
diff --git a/src/mrwimage.cpp b/src/mrwimage.cpp
index 4a7ce6f..c50ddab 100644
--- a/src/mrwimage.cpp
+++ b/src/mrwimage.cpp
@@ -156,7 +156,7 @@ namespace Exiv2 {
         if (io_->error() || io_->eof()) throw Error(14);
 
         TiffParser::decode(this, buf.pData_, buf.size_, 
-                           TiffCreator::create, TiffDecoderItems::findDecoder);
+                           TiffCreator::create, TiffDecoder::findDecoder);
     } // MrwImage::readMetadata
 
     void MrwImage::writeMetadata()
diff --git a/src/pngchunk.cpp b/src/pngchunk.cpp
index 9aed4a6..21fec43 100644
--- a/src/pngchunk.cpp
+++ b/src/pngchunk.cpp
@@ -238,7 +238,7 @@ namespace Exiv2 {
 #endif
                             pos = pos + sizeof(exifHeader);
                             TiffParser::decode(pImage, exifData.pData_ + pos, length - pos, 
-                                               TiffCreator::create, TiffDecoderItems::findDecoder);
+                                               TiffCreator::create, TiffDecoder::findDecoder);
                         }
                     }
                 }
diff --git a/src/tiffcomposite.cpp b/src/tiffcomposite.cpp
index e9d1898..5e847a1 100644
--- a/src/tiffcomposite.cpp
+++ b/src/tiffcomposite.cpp
@@ -107,8 +107,16 @@ namespace Exiv2 {
 
     bool TiffStructure::operator==(const TiffStructure::Key& key) const
     {
-        return    key.e_   == extendedTag_ && key.g_ == group_
-               || Tag::all == extendedTag_ && key.g_ == group_;
+        return    (Tag::all == extendedTag_ || key.e_ == extendedTag_)
+               && key.g_ == group_;
+    }
+
+    bool TiffDecoderInfo::operator==(const TiffDecoderInfo::Key& key) const
+    {
+        std::string make(make_);
+        return    ("*" == make || make == key.m_.substr(0, make.length()))
+               && (Tag::all == extendedTag_ || key.e_ == extendedTag_)
+               && key.g_ == group_;
     }
 
     TiffDirectory::~TiffDirectory()
diff --git a/src/tiffcomposite.hpp b/src/tiffcomposite.hpp
index ff83737..2090923 100644
--- a/src/tiffcomposite.hpp
+++ b/src/tiffcomposite.hpp
@@ -20,7 +20,7 @@
  */
 /*!
   @file    tiffcomposite.hpp
-  @brief
+  @brief   Various classes used in a TIFF composite structure
   @version $Rev$
   @author  Andreas Huggel (ahu)
            <a href="mailto:ahuggel at gmx.net">ahuggel at gmx.net</a>
@@ -32,6 +32,7 @@
 // *****************************************************************************
 // included header files
 #include "image.hpp"                            // for Blob
+#include "tifffwd.hpp"
 #include "types.hpp"
 
 // + standard includes
@@ -45,18 +46,6 @@
 namespace Exiv2 {
 
 // *****************************************************************************
-// class declarations
-
-    class Value;
-    class TiffVisitor;
-    class TiffReader;
-    class TiffMetadataDecoder;
-    class TiffPrinter;
-    class TiffIfdMakernote;
-    struct TiffStructure;
-    class TiffEntryBase;
-
-// *****************************************************************************
 // class definitions
 
     /*!
@@ -175,25 +164,6 @@ namespace Exiv2 {
     }; // class TiffComponent
 
     /*!
-      @brief Function pointer type for a TiffMetadataDecoder member function 
-             to decode a TIFF component.
-     */
-    typedef void (TiffMetadataDecoder::*DecoderFct)(const TiffEntryBase*);
-
-    /*!
-      Type for a function pointer for a function to decode a TIFF component.
-     */
-    typedef const DecoderFct (*FindDecoderFct)(const std::string& make, 
-                                                     uint32_t     extendedTag,
-                                                     uint16_t     group);
-
-    /*!
-      Type for a function pointer for a function to create a TIFF component.
-     */
-    typedef TiffComponent::AutoPtr (*NewTiffCompFct)(uint16_t tag,
-                                                     const TiffStructure* ts);
-
-    /*!
       @brief Data structure used as a row (element) of a table (array)
              describing the TIFF structure of an image format for reading and
              writing.  Different tables can be used to support different TIFF
@@ -221,11 +191,37 @@ namespace Exiv2 {
         uint16_t g_;                    //!< %Group
     };
 
-    /*!
-      Type for a factory function to create new TIFF components.
-     */
-    typedef TiffComponent::AutoPtr (*TiffCompFactoryFct)(uint32_t extendedTag,
-                                                         uint16_t group);
+    //! TIFF decoder table for functions to decode special cases
+    struct TiffDecoderInfo {
+        struct Key;
+        /*!
+          @brief Compare a TiffDecoderInfo with a TiffDecoderInfo::Key.
+                 The two are equal if TiffDecoderInfo::make_ equals a substring
+                 of the key of the same size. E.g., decoder info = "OLYMPUS",
+                 key = "OLYMPUS OPTICAL CO.,LTD" (found in the image) match,
+                 the extendedTag is Tag::all or equal to the extended tag of the
+                 key, and the group is equal to that of the key.
+         */
+        bool operator==(const Key& key) const;
+        //! Return the tag corresponding to the extended tag
+        uint16_t tag() const { return static_cast<uint16_t>(extendedTag_ & 0xffff); }
+
+        // DATA
+        const char* make_;        //!< Camera make for which this decoder function applies
+        uint32_t    extendedTag_; //!< Tag (32 bit so that it can contain special tags)
+        uint16_t    group_;       //!< Group that contains the tag
+        DecoderFct  decoderFct_;  //!< Decoder function for matching tags
+
+    }; // struct TiffDecoderInfo
+
+    //! Search key for TIFF decoder structures.
+    struct TiffDecoderInfo::Key {
+        //! Constructor
+        Key(const std::string& m, uint32_t e, uint16_t g) : m_(m), e_(e), g_(g) {}
+        std::string m_;                    //!< Camera make
+        uint32_t    e_;                    //!< Extended tag
+        uint16_t    g_;                    //!< %Group
+    };
 
     /*!
       @brief This abstract base class provides the common functionality of an
diff --git a/src/tifffwd.hpp b/src/tifffwd.hpp
new file mode 100644
index 0000000..a8b5876
--- /dev/null
+++ b/src/tifffwd.hpp
@@ -0,0 +1,103 @@
+// ***************************************************************** -*- C++ -*-
+/*
+ * Copyright (C) 2006 Andreas Huggel <ahuggel at gmx.net>
+ *
+ * This program is part of the Exiv2 distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301 USA.
+ */
+/*!
+  @file    tifffwd.hpp
+  @brief   TIFF parser related typedefs and forward definitions.
+  @version $Rev$
+  @author  Andreas Huggel (ahu)
+           <a href="mailto:ahuggel at gmx.net">ahuggel at gmx.net</a>
+  @date    24-Jun-06, ahu: created
+ */
+#ifndef TIFFFWD_HPP_
+#define TIFFFWD_HPP_
+
+// *****************************************************************************
+// included header files
+#include "types.hpp"
+
+// + standard includes
+#include <memory>
+
+// *****************************************************************************
+// namespace extensions
+namespace Exiv2 {
+
+// *****************************************************************************
+// class declarations
+
+    class TiffComponent;
+    struct TiffStructure;
+    class TiffEntryBase;
+    class TiffEntry;
+    class TiffDataEntry;
+    class TiffSizeEntry;
+    class TiffDirectory;
+    class TiffSubIfd;
+    class TiffMnEntry;
+    class TiffArrayEntry;
+    class TiffArrayElement;
+
+    class TiffIfdMakernote;
+
+    class TiffVisitor;
+    class TiffFinder;
+    class TiffMetadataDecoder;
+    class TiffReader;
+    class TiffPrinter;
+
+    class TiffRwState;
+    struct TiffDecoderInfo;
+
+    class Image;
+    class Value;
+
+// *****************************************************************************
+// class definitions
+
+    /*!
+      @brief Function pointer type for a TiffMetadataDecoder member function 
+             to decode a TIFF component.
+     */
+    typedef void (TiffMetadataDecoder::*DecoderFct)(const TiffEntryBase*);
+    /*!
+      @brief Type for a function pointer for a function to decode a TIFF component.
+     */
+    typedef const DecoderFct (*FindDecoderFct)(const std::string& make, 
+                                                     uint32_t     extendedTag,
+                                                     uint16_t     group);
+    /*!
+      @brief Type for a function pointer for a function to create a TIFF component.
+             Use TiffComponent::AutoPtr, it is not used in this declaration only
+             to reduce dependencies.
+     */
+    typedef std::auto_ptr<TiffComponent> (*NewTiffCompFct)(      uint16_t       tag,
+                                                           const TiffStructure* ts);
+    /*!
+      @brief Type for a factory function to create new TIFF components. 
+             Use TiffComponent::AutoPtr, it is not used in this declaration only
+             to reduce dependencies.
+     */
+    typedef std::auto_ptr<TiffComponent> (*TiffCompFactoryFct)(uint32_t extendedTag,
+                                                               uint16_t group);
+
+}                                       // namespace Exiv2
+
+#endif                                  // #ifndef TIFFFWD_HPP_
diff --git a/src/tiffimage.cpp b/src/tiffimage.cpp
index 6dd5f7a..a2444b3 100644
--- a/src/tiffimage.cpp
+++ b/src/tiffimage.cpp
@@ -134,7 +134,7 @@ namespace Exiv2 {
         if (io_->error() || io_->eof()) throw Error(14);
 
         TiffParser::decode(this, buf.pData_, buf.size_,
-                           TiffCreator::create, TiffDecoderItems::findDecoder);
+                           TiffCreator::create, TiffDecoder::findDecoder);
 
     } // TiffImage::readMetadata
 
diff --git a/src/tiffparser.cpp b/src/tiffparser.cpp
index d1c371e..106483d 100644
--- a/src/tiffparser.cpp
+++ b/src/tiffparser.cpp
@@ -131,27 +131,19 @@ namespace Exiv2 {
         {  Tag::all, Group::minocs5,   newTiffArrayElement<unsignedShort, bigEndian>, Group::minocs5 }
     };
 
-    // TIFF Decoder table for special decoding requirements
-    const TiffDecoderInfo TiffDecoderItems::tiffDecoderInfo_[] = {
+    // TIFF Decoder table for special decoding requirements, default decoder is decodeStdTiffEntry
+    const TiffDecoderInfo TiffDecoder::tiffDecoderInfo_[] = {
         { "*",       Tag::all, Group::ignr,    0 }, // Do not decode tags with group == Group::ignr
-        { "OLYMPUS",   0x0100, Group::olympmn, &TiffMetadataDecoder::decodeOlympThumb },
+        { "OLYMPUS",   0x0100, Group::olympmn, &TiffMetadataDecoder::decodeOlympThumb   },
         { "*",         0x014a, Group::ifd0,    0 }, // Todo: Controversial, causes problems with Exiftool
-        { "*",       Tag::all, Group::sub0_0,  &TiffMetadataDecoder::decodeSubIfd     },
-        { "*",       Tag::all, Group::sub0_1,  &TiffMetadataDecoder::decodeSubIfd     },
-        { "*",         0x8649, Group::ifd0,    &TiffMetadataDecoder::decodeIrbIptc    }
+        { "*",       Tag::all, Group::sub0_0,  &TiffMetadataDecoder::decodeSubIfd       },
+        { "*",       Tag::all, Group::sub0_1,  &TiffMetadataDecoder::decodeSubIfd       },
+        { "*",         0x8649, Group::ifd0,    &TiffMetadataDecoder::decodeIrbIptc      }
     };
 
-    bool TiffDecoderInfo::operator==(const TiffDecoderInfo::Key& key) const
-    {
-        std::string make(make_);
-        return    ("*" == make || make == key.m_.substr(0, make.length()))
-               && (Tag::all == extendedTag_ || key.e_ == extendedTag_)
-               && key.g_ == group_;
-    }
-
-    const DecoderFct TiffDecoderItems::findDecoder(const std::string& make, 
-                                                         uint32_t     extendedTag,
-                                                         uint16_t     group)
+    const DecoderFct TiffDecoder::findDecoder(const std::string& make, 
+                                                    uint32_t     extendedTag,
+                                                    uint16_t     group)
     {
         DecoderFct decoderFct = &TiffMetadataDecoder::decodeStdTiffEntry;
         const TiffDecoderInfo* td = find(tiffDecoderInfo_, 
diff --git a/src/tiffparser.hpp b/src/tiffparser.hpp
index 6090372..024672f 100644
--- a/src/tiffparser.hpp
+++ b/src/tiffparser.hpp
@@ -31,7 +31,7 @@
 
 // *****************************************************************************
 // included header files
-#include "tiffcomposite.hpp"
+#include "tifffwd.hpp"
 #include "types.hpp"
 
 // + standard includes
@@ -43,11 +43,6 @@
 namespace Exiv2 {
 
 // *****************************************************************************
-// class declarations
-
-    class Image;
-
-// *****************************************************************************
 // class definitions
 
     /*!
@@ -63,8 +58,8 @@ namespace Exiv2 {
           is created.  If the pointer that is returned is 0, then the TIFF entry
           should be ignored.
         */
-        static TiffComponent::AutoPtr create(uint32_t extendedTag,
-                                             uint16_t group);
+        static std::auto_ptr<TiffComponent> create(uint32_t extendedTag,
+                                                   uint16_t group);
 
     private:
         static const TiffStructure tiffStructure_[]; //<! TIFF structure
@@ -99,45 +94,14 @@ namespace Exiv2 {
                                  FindDecoderFct     findDecoderFct);
     }; // class TiffParser
 
-    //! TIFF decoder table for functions to decode special cases
-    struct TiffDecoderInfo {
-        struct Key;
-        /*!
-          @brief Compare a TiffDecoderInfo with a TiffDecoderInfo::Key.
-                 The two are equal if TiffDecoderInfo::make_ equals a substring
-                 of the key of the same size. E.g., decoder info = "OLYMPUS",
-                 key = "OLYMPUS OPTICAL CO.,LTD" (found in the image) match,
-                 the extendedTag is Tag::all or equal to the extended tag of the
-                 key, and the group is equal to that of the key.
-         */
-        bool operator==(const Key& key) const;
-        //! Return the tag corresponding to the extended tag
-        uint16_t tag() const { return static_cast<uint16_t>(extendedTag_ & 0xffff); }
-
-        // DATA
-        const char* make_;        //!< Camera make for which this decoder function applies
-        uint32_t    extendedTag_; //!< Tag (32 bit so that it can contain special tags)
-        uint16_t    group_;       //!< Group that contains the tag
-        DecoderFct  decoderFct_;  //!< Decoder function for matching tags
-
-    }; // struct TiffDecoderInfo
-
-    //! Search key for TIFF decoder structures.
-    struct TiffDecoderInfo::Key {
-        //! Constructor
-        Key(const std::string& m, uint32_t e, uint16_t g) : m_(m), e_(e), g_(g) {}
-        std::string m_;                    //!< Camera make
-        uint32_t    e_;                    //!< Extended tag
-        uint16_t    g_;                    //!< %Group
-    };
-
     /*!
-      @brief Table of special TIFF decoding functions and find function.
+      @brief Table of TIFF decoding functions and find function.
              This class is separated from the metadata decoder visitor so that
              the parser can be parametrized with a different table if needed.
-             This is used, eg., for CR2 format.
+             This is used, eg., for CR2 format, which uses a different decoder
+             table.
      */
-    class TiffDecoderItems {
+    class TiffDecoder {
     public:
         /*!
           @brief Find the decoder function for a key. 
@@ -158,7 +122,7 @@ namespace Exiv2 {
     private:
         static const TiffDecoderInfo tiffDecoderInfo_[]; //<! TIFF decoder table
 
-    }; // class TiffDecoderItems
+    }; // class TiffDecoder
 
 }                                       // namespace Exiv2
 
diff --git a/src/tiffvisitor.hpp b/src/tiffvisitor.hpp
index a56b8bd..a23f5e1 100644
--- a/src/tiffvisitor.hpp
+++ b/src/tiffvisitor.hpp
@@ -20,7 +20,7 @@
  */
 /*!
   @file    tiffvisitor.hpp
-  @brief
+  @brief   Operations on a TIFF composite tree, implemented as visitor classes.
   @version $Rev$
   @author  Andreas Huggel (ahu)
            <a href="mailto:ahuggel at gmx.net">ahuggel at gmx.net</a>
@@ -31,9 +31,9 @@
 
 // *****************************************************************************
 // included header files
-#include "types.hpp"
-#include "tiffcomposite.hpp"
 #include "exif.hpp"
+#include "tifffwd.hpp"
+#include "types.hpp"
 
 // + standard includes
 #include <memory>
@@ -47,12 +47,6 @@
 namespace Exiv2 {
 
 // *****************************************************************************
-// class declarations
-
-    class TiffIfdMakernote;
-    class Image;
-
-// *****************************************************************************
 // class definitions
 
     /*!
@@ -395,7 +389,8 @@ namespace Exiv2 {
         //! Return the base offset. See class TiffRwState for details
         uint32_t baseOffset() const;
         //! Create a TIFF component for \em extendedTag and group
-        TiffComponent::AutoPtr create(uint32_t extendedTag, uint16_t group) const;
+        std::auto_ptr<TiffComponent> create(uint32_t extendedTag, 
+                                            uint16_t group) const;
         //@}
 
     private:

-- 
exiv2 packaging



More information about the pkg-kde-commits mailing list