diff --git a/include/exiv2/jpgimage.hpp b/include/exiv2/jpgimage.hpp index 4901a890..9cda26aa 100644 --- a/include/exiv2/jpgimage.hpp +++ b/include/exiv2/jpgimage.hpp @@ -187,33 +187,42 @@ namespace Exiv2 { //@} // Constant Data - static const byte dht_; //!< JPEG DHT marker - static const byte dqt_; //!< JPEG DQT marker - static const byte dri_; //!< JPEG DRI marker - static const byte sos_; //!< JPEG SOS marker - static const byte eoi_; //!< JPEG EOI marker - static const byte app0_; //!< JPEG APP0 marker - static const byte app1_; //!< JPEG APP1 marker - static const byte app2_; //!< JPEG APP2 marker - static const byte app13_; //!< JPEG APP13 marker - static const byte com_; //!< JPEG Comment marker - static const byte sof0_; //!< JPEG Start-Of-Frame marker - static const byte sof1_; //!< JPEG Start-Of-Frame marker - static const byte sof2_; //!< JPEG Start-Of-Frame marker - static const byte sof3_; //!< JPEG Start-Of-Frame marker - static const byte sof5_; //!< JPEG Start-Of-Frame marker - static const byte sof6_; //!< JPEG Start-Of-Frame marker - static const byte sof7_; //!< JPEG Start-Of-Frame marker - static const byte sof9_; //!< JPEG Start-Of-Frame marker - static const byte sof10_; //!< JPEG Start-Of-Frame marker - static const byte sof11_; //!< JPEG Start-Of-Frame marker - static const byte sof13_; //!< JPEG Start-Of-Frame marker - static const byte sof14_; //!< JPEG Start-Of-Frame marker - static const byte sof15_; //!< JPEG Start-Of-Frame marker - static const char* const exifId_; //!< Exif identifier - static const char* const jfifId_; //!< JFIF identifier - static const char* const xmpId_; //!< XMP packet identifier - static const char* const iccId_; //!< ICC profile identifier + static constexpr byte dht_ = 0xc4; //!< JPEG DHT marker + static constexpr byte dqt_ = 0xdb; //!< JPEG DQT marker + static constexpr byte dri_ = 0xdd; //!< JPEG DRI marker + static constexpr byte sos_ = 0xda; //!< JPEG SOS marker + static constexpr byte eoi_ = 0xd9; //!< JPEG EOI marker + static constexpr byte app0_ = 0xe0; //!< JPEG APP0 marker + static constexpr byte app1_ = 0xe1; //!< JPEG APP1 marker + static constexpr byte app2_ = 0xe2; //!< JPEG APP2 marker + static constexpr byte app13_ = 0xed; //!< JPEG APP13 marker + static constexpr byte com_ = 0xfe; //!< JPEG Comment marker + + // Start of Frame markers, nondifferential Huffman-coding frames + static constexpr byte sof0_ = 0xc0; //!< JPEG Start-Of-Frame marker + static constexpr byte sof1_ = 0xc1; //!< JPEG Start-Of-Frame marker + static constexpr byte sof2_ = 0xc2; //!< JPEG Start-Of-Frame marker + static constexpr byte sof3_ = 0xc3; //!< JPEG Start-Of-Frame marker + + // Start of Frame markers, differential Huffman-coding frames + static constexpr byte sof5_ = 0xc5; //!< JPEG Start-Of-Frame marker + static constexpr byte sof6_ = 0xc6; //!< JPEG Start-Of-Frame marker + static constexpr byte sof7_ = 0xc7; //!< JPEG Start-Of-Frame marker + + // Start of Frame markers, nondifferential arithmetic-coding frames + static constexpr byte sof9_ = 0xc9; //!< JPEG Start-Of-Frame marker + static constexpr byte sof10_ = 0xca; //!< JPEG Start-Of-Frame marker + static constexpr byte sof11_ = 0xcb; //!< JPEG Start-Of-Frame marker + + // Start of Frame markers, differential arithmetic-coding frames + static constexpr byte sof13_ = 0xcd; //!< JPEG Start-Of-Frame marker + static constexpr byte sof14_ = 0xce; //!< JPEG Start-Of-Frame marker + static constexpr byte sof15_ = 0xcf; //!< JPEG Start-Of-Frame marker + + static constexpr auto exifId_ = "Exif\0\0"; //!< Exif identifier + static constexpr auto jfifId_ = "JFIF\0"; //!< JFIF identifier + static constexpr auto xmpId_ = "http://ns.adobe.com/xap/1.0/\0"; //!< XMP packet identifier + static constexpr auto iccId_ = "ICC_PROFILE\0"; //!< ICC profile identifier private: //! @name Manipulators diff --git a/src/epsimage.cpp b/src/epsimage.cpp index 8626d1e8..9dade980 100644 --- a/src/epsimage.cpp +++ b/src/epsimage.cpp @@ -36,7 +36,7 @@ namespace { const std::string dosEpsSignature = "\xC5\xD0\xD3\xC6"; // first line of EPS - const std::array epsFirstLine{ + constexpr auto epsFirstLine = std::array{ "%!PS-Adobe-3.0 EPSF-3.0", "%!PS-Adobe-3.0 EPSF-3.0 ", // OpenOffice "%!PS-Adobe-3.1 EPSF-3.0", // Illustrator diff --git a/src/jpgimage.cpp b/src/jpgimage.cpp index 61d42f7a..384a327e 100644 --- a/src/jpgimage.cpp +++ b/src/jpgimage.cpp @@ -34,44 +34,6 @@ // class member definitions namespace Exiv2 { - constexpr byte JpegBase::dht_ = 0xc4; - constexpr byte JpegBase::dqt_ = 0xdb; - constexpr byte JpegBase::dri_ = 0xdd; - constexpr byte JpegBase::sos_ = 0xda; - constexpr byte JpegBase::eoi_ = 0xd9; - constexpr byte JpegBase::app0_ = 0xe0; - constexpr byte JpegBase::app1_ = 0xe1; - constexpr byte JpegBase::app2_ = 0xe2; - constexpr byte JpegBase::app13_ = 0xed; - constexpr byte JpegBase::com_ = 0xfe; - - // Start of Frame markers, nondifferential Huffman-coding frames - constexpr byte JpegBase::sof0_ = 0xc0; // start of frame 0, baseline DCT - constexpr byte JpegBase::sof1_ = 0xc1; // start of frame 1, extended sequential DCT, Huffman coding - constexpr byte JpegBase::sof2_ = 0xc2; // start of frame 2, progressive DCT, Huffman coding - constexpr byte JpegBase::sof3_ = 0xc3; // start of frame 3, lossless sequential, Huffman coding - - // Start of Frame markers, differential Huffman-coding frames - constexpr byte JpegBase::sof5_ = 0xc5; // start of frame 5, differential sequential DCT, Huffman coding - constexpr byte JpegBase::sof6_ = 0xc6; // start of frame 6, differential progressive DCT, Huffman coding - constexpr byte JpegBase::sof7_ = 0xc7; // start of frame 7, differential lossless, Huffman coding - - // Start of Frame markers, nondifferential arithmetic-coding frames - constexpr byte JpegBase::sof9_ = 0xc9; // start of frame 9, extended sequential DCT, arithmetic coding - constexpr byte JpegBase::sof10_ = 0xca; // start of frame 10, progressive DCT, arithmetic coding - constexpr byte JpegBase::sof11_ = 0xcb; // start of frame 11, lossless sequential, arithmetic coding - - // Start of Frame markers, differential arithmetic-coding frames - constexpr byte JpegBase::sof13_ = 0xcd; // start of frame 13, differential sequential DCT, arithmetic coding - constexpr byte JpegBase::sof14_ = 0xce; // start of frame 14, progressive DCT, arithmetic coding - constexpr byte JpegBase::sof15_ = 0xcf; // start of frame 15, differential lossless, arithmetic coding - - constexpr const char* JpegBase::exifId_ = "Exif\0\0"; - constexpr const char* JpegBase::jfifId_ = "JFIF\0"; - constexpr const char* JpegBase::xmpId_ = "http://ns.adobe.com/xap/1.0/\0"; - constexpr const char* JpegBase::iccId_ = "ICC_PROFILE\0"; - - static inline bool inRange(int lo,int value, int hi) { return lo<=value && value <= hi;