Skip to content

Commit

Permalink
Suggestions from @neheb and @piponazo.
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinbackhouse committed Aug 2, 2022
1 parent 9a3f567 commit 7498fa6
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/tiffimage_int.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

// *****************************************************************************
// included header files
#include <unordered_map>
#include "image.hpp"
#include "tiffcomposite_int.hpp"
#include "tifffwd_int.hpp"
Expand Down Expand Up @@ -146,13 +147,19 @@ struct TiffImgTagStruct {
IfdId group_; //!< Group that contains the image tag
}; // struct TiffImgTagStruct

typedef std::pair<uint32_t, IfdId> TiffGroupKey;
using TiffGroupKey = std::pair<uint32_t, IfdId>;

struct TiffGroupKey_hash {
std::size_t operator()(const TiffGroupKey& pair) const {
return std::hash<uint64_t>{}(static_cast<uint64_t>(pair.first) << 32 | static_cast<uint64_t>(pair.second));
}
};

/*!
@brief Data structure used as a row (element) of a table (array)
defining the TIFF component used for each tag in a group.
*/
typedef std::map<TiffGroupKey, NewTiffCompFct> TiffGroupTable;
using TiffGroupTable = std::unordered_map<TiffGroupKey, NewTiffCompFct, TiffGroupKey_hash>;

/*!
@brief Data structure used as a row of the table which describes TIFF trees.
Expand Down

0 comments on commit 7498fa6

Please sign in to comment.