static constexpr conversions

Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
Rosen Penev
2022-03-18 16:04:13 -07:00
parent 9dc35e7380
commit bad4712df8
7 changed files with 30 additions and 57 deletions
+1 -1
View File
@@ -297,7 +297,7 @@ class EXIV2API IptcParser {
private:
// Constant data
static const byte marker_; // Dataset marker
static constexpr byte marker_ = 0x1C; // Dataset marker
}; // class IptcParser
+6 -6
View File
@@ -24,11 +24,11 @@ namespace Exiv2 {
*/
struct EXIV2API Photoshop {
// Todo: Public for now
static constexpr std::array<const char*, 4> irbId_{"8BIM", "AgHg", "DCSR", "PHUT"}; //!< %Photoshop IRB markers
inline static const char* ps3Id_ = "Photoshop 3.0\0"; //!< %Photoshop marker
inline static const char* bimId_ = "8BIM"; //!< %Photoshop IRB marker (deprecated)
inline static const uint16_t iptc_ = 0x0404; //!< %Photoshop IPTC marker
inline static const uint16_t preview_ = 0x040c; //!< %Photoshop preview marker
static constexpr std::array irbId_{"8BIM", "AgHg", "DCSR", "PHUT"}; //!< %Photoshop IRB markers
static constexpr auto ps3Id_ = "Photoshop 3.0\0"; //!< %Photoshop marker
static constexpr auto bimId_ = "8BIM"; //!< %Photoshop IRB marker (deprecated)
static constexpr uint16_t iptc_ = 0x0404; //!< %Photoshop IPTC marker
static constexpr uint16_t preview_ = 0x040c; //!< %Photoshop preview marker
/*!
@brief Checks an IRB
@@ -313,7 +313,7 @@ class EXIV2API JpegImage : public JpegBase {
private:
// Constant data
static const byte soi_; // SOI marker
static constexpr byte soi_ = 0xd8; // SOI marker
static const byte blank_[]; // Minimal Jpeg image
}; // class JpegImage
+17 -16
View File
@@ -69,22 +69,23 @@ class EXIV2API WebPImage : public Image {
void debugPrintHex(byte* data, long size);
void decodeChunks(long filesize);
void inject_VP8X(BasicIo& iIo, bool has_xmp, bool has_exif, bool has_alpha, bool has_icc, int width, int height);
static const byte WEBP_PAD_ODD;
static const int WEBP_TAG_SIZE;
static const int WEBP_VP8X_ICC_BIT;
static const int WEBP_VP8X_ALPHA_BIT;
static const int WEBP_VP8X_EXIF_BIT;
static const int WEBP_VP8X_XMP_BIT;
static const char* const WEBP_CHUNK_HEADER_VP8X;
static const char* const WEBP_CHUNK_HEADER_VP8L;
static const char* const WEBP_CHUNK_HEADER_VP8;
static const char* const WEBP_CHUNK_HEADER_ANMF;
static const char* const WEBP_CHUNK_HEADER_ANIM;
static const char* const WEBP_CHUNK_HEADER_ICCP;
static const char* const WEBP_CHUNK_HEADER_EXIF;
static const char* const WEBP_CHUNK_HEADER_XMP;
/* Misc. */
static constexpr byte WEBP_PAD_ODD = 0;
static constexpr int WEBP_TAG_SIZE = 0x4;
/* VP8X feature flags */
static constexpr int WEBP_VP8X_ICC_BIT = 0x20;
static constexpr int WEBP_VP8X_ALPHA_BIT = 0x10;
static constexpr int WEBP_VP8X_EXIF_BIT = 0x8;
static constexpr int WEBP_VP8X_XMP_BIT = 0x4;
/* Chunk header names */
static constexpr auto WEBP_CHUNK_HEADER_VP8X = "VP8X";
static constexpr auto WEBP_CHUNK_HEADER_VP8L = "VP8L";
static constexpr auto WEBP_CHUNK_HEADER_VP8 = "VP8 ";
static constexpr auto WEBP_CHUNK_HEADER_ANMF = "ANMF";
static constexpr auto WEBP_CHUNK_HEADER_ANIM = "ANIM";
static constexpr auto WEBP_CHUNK_HEADER_ICCP = "ICCP";
static constexpr auto WEBP_CHUNK_HEADER_EXIF = "EXIF";
static constexpr auto WEBP_CHUNK_HEADER_XMP = "XMP ";
}; // Class WebPImage
// *****************************************************************************