remove using

Signed-off-by: Rosen Penev <rosenp@gmail.com>
main
Rosen Penev 3 years ago
parent 235b1e0d19
commit 2fa84f4bab

@ -42,11 +42,11 @@ constexpr auto emptyYodAdjust_ = std::array{
//! List of all command identifiers and corresponding strings //! List of all command identifiers and corresponding strings
constexpr auto cmdIdAndString = std::array{ constexpr auto cmdIdAndString = std::array{
CmdIdAndString{CmdId::add, "add"}, std::pair(CmdId::add, "add"),
CmdIdAndString{CmdId::set, "set"}, std::pair(CmdId::set, "set"),
CmdIdAndString{CmdId::del, "del"}, std::pair(CmdId::del, "del"),
CmdIdAndString{CmdId::reg, "reg"}, std::pair(CmdId::reg, "reg"),
CmdIdAndString{CmdId::invalid, "invalidCmd"}, // End of list marker std::pair(CmdId::invalid, "invalidCmd"), // End of list marker
}; };
// Return a command Id for a command string // Return a command Id for a command string

@ -62,8 +62,6 @@ struct ModifyCmd {
}; };
//! Container for modification commands //! Container for modification commands
using ModifyCmds = std::vector<ModifyCmd>; using ModifyCmds = std::vector<ModifyCmd>;
//! Structure to link command identifiers to strings
using CmdIdAndString = std::pair<CmdId, std::string_view>;
/*! /*!
@brief Implements the command line handling for the program. @brief Implements the command line handling for the program.

@ -5,44 +5,41 @@
#include <iomanip> #include <iomanip>
#include <iostream> #include <iostream>
using EasyAccessFct = Exiv2::ExifData::const_iterator (*)(const Exiv2::ExifData&); static constexpr auto easyAccess = std::array{
using EasyAccess = std::pair<const char*, EasyAccessFct>; std::pair("Orientation", &Exiv2::orientation),
std::pair("ISO speed", &Exiv2::isoSpeed),
static const EasyAccess easyAccess[] = { std::pair("Date & time original", &Exiv2::dateTimeOriginal),
{"Orientation", Exiv2::orientation}, std::pair("Flash bias", &Exiv2::flashBias),
{"ISO speed", Exiv2::isoSpeed}, std::pair("Exposure mode", &Exiv2::exposureMode),
{"Date & time original", Exiv2::dateTimeOriginal}, std::pair("Scene mode", &Exiv2::sceneMode),
{"Flash bias", Exiv2::flashBias}, std::pair("Macro mode", &Exiv2::macroMode),
{"Exposure mode", Exiv2::exposureMode}, std::pair("Image quality", &Exiv2::imageQuality),
{"Scene mode", Exiv2::sceneMode}, std::pair("White balance", &Exiv2::whiteBalance),
{"Macro mode", Exiv2::macroMode}, std::pair("Lens name", &Exiv2::lensName),
{"Image quality", Exiv2::imageQuality}, std::pair("Saturation", &Exiv2::saturation),
{"White balance", Exiv2::whiteBalance}, std::pair("Sharpness", &Exiv2::sharpness),
{"Lens name", Exiv2::lensName}, std::pair("Contrast", &Exiv2::contrast),
{"Saturation", Exiv2::saturation}, std::pair("Scene capture type", &Exiv2::sceneCaptureType),
{"Sharpness", Exiv2::sharpness}, std::pair("Metering mode", &Exiv2::meteringMode),
{"Contrast", Exiv2::contrast}, std::pair("Camera make", &Exiv2::make),
{"Scene capture type", Exiv2::sceneCaptureType}, std::pair("Camera model", &Exiv2::model),
{"Metering mode", Exiv2::meteringMode}, std::pair("Exposure time", &Exiv2::exposureTime),
{"Camera make", Exiv2::make}, std::pair("FNumber", &Exiv2::fNumber),
{"Camera model", Exiv2::model}, std::pair("Shutter speed value", &Exiv2::shutterSpeedValue),
{"Exposure time", Exiv2::exposureTime}, std::pair("Aperture value", &Exiv2::apertureValue),
{"FNumber", Exiv2::fNumber}, std::pair("Brightness value", &Exiv2::brightnessValue),
{"Shutter speed value", Exiv2::shutterSpeedValue}, std::pair("Exposure bias", &Exiv2::exposureBiasValue),
{"Aperture value", Exiv2::apertureValue}, std::pair("Max aperture value", &Exiv2::maxApertureValue),
{"Brightness value", Exiv2::brightnessValue}, std::pair("Subject distance", &Exiv2::subjectDistance),
{"Exposure bias", Exiv2::exposureBiasValue}, std::pair("Light source", &Exiv2::lightSource),
{"Max aperture value", Exiv2::maxApertureValue}, std::pair("Flash", &Exiv2::flash),
{"Subject distance", Exiv2::subjectDistance}, std::pair("Camera serial number", &Exiv2::serialNumber),
{"Light source", Exiv2::lightSource}, std::pair("Focal length", &Exiv2::focalLength),
{"Flash", Exiv2::flash}, std::pair("Subject location/area", &Exiv2::subjectArea),
{"Camera serial number", Exiv2::serialNumber}, std::pair("Flash energy", &Exiv2::flashEnergy),
{"Focal length", Exiv2::focalLength}, std::pair("Exposure index", &Exiv2::exposureIndex),
{"Subject location/area", Exiv2::subjectArea}, std::pair("Sensing method", &Exiv2::sensingMethod),
{"Flash energy", Exiv2::flashEnergy}, std::pair("AF point", &Exiv2::afPoint),
{"Exposure index", Exiv2::exposureIndex},
{"Sensing method", Exiv2::sensingMethod},
{"AF point", Exiv2::afPoint},
}; };
int main(int argc, char** argv) { int main(int argc, char** argv) {

@ -501,7 +501,6 @@ ByteOrder ExifParser::decode(ExifData& exifData, const byte* pData, size_t size)
//! @cond IGNORE //! @cond IGNORE
enum Ptt { pttLen, pttTag, pttIfd }; enum Ptt { pttLen, pttTag, pttIfd };
using PreviewTags = std::pair<Ptt, const char*>;
//! @endcond //! @endcond
WriteMethod ExifParser::encode(Blob& blob, const byte* pData, size_t size, ByteOrder byteOrder, WriteMethod ExifParser::encode(Blob& blob, const byte* pData, size_t size, ByteOrder byteOrder,
@ -579,34 +578,34 @@ WriteMethod ExifParser::encode(Blob& blob, const byte* pData, size_t size, ByteO
// Todo: Enhance preview classes to be able to write and delete previews and use that instead. // Todo: Enhance preview classes to be able to write and delete previews and use that instead.
// Table must be sorted by preview, the first tag in each group is the size // Table must be sorted by preview, the first tag in each group is the size
static constexpr auto filteredPvTags = std::array{ static constexpr auto filteredPvTags = std::array{
PreviewTags(pttLen, "Exif.Minolta.ThumbnailLength"), std::pair(pttLen, "Exif.Minolta.ThumbnailLength"),
PreviewTags(pttTag, "Exif.Minolta.ThumbnailOffset"), std::pair(pttTag, "Exif.Minolta.ThumbnailOffset"),
PreviewTags(pttLen, "Exif.Minolta.Thumbnail"), std::pair(pttLen, "Exif.Minolta.Thumbnail"),
PreviewTags(pttLen, "Exif.NikonPreview.JPEGInterchangeFormatLength"), std::pair(pttLen, "Exif.NikonPreview.JPEGInterchangeFormatLength"),
PreviewTags(pttIfd, "NikonPreview"), std::pair(pttIfd, "NikonPreview"),
PreviewTags(pttLen, "Exif.Olympus.ThumbnailLength"), std::pair(pttLen, "Exif.Olympus.ThumbnailLength"),
PreviewTags(pttTag, "Exif.Olympus.ThumbnailOffset"), std::pair(pttTag, "Exif.Olympus.ThumbnailOffset"),
PreviewTags(pttLen, "Exif.Olympus.ThumbnailImage"), std::pair(pttLen, "Exif.Olympus.ThumbnailImage"),
PreviewTags(pttLen, "Exif.Olympus.Thumbnail"), std::pair(pttLen, "Exif.Olympus.Thumbnail"),
PreviewTags(pttLen, "Exif.Olympus2.ThumbnailLength"), std::pair(pttLen, "Exif.Olympus2.ThumbnailLength"),
PreviewTags(pttTag, "Exif.Olympus2.ThumbnailOffset"), std::pair(pttTag, "Exif.Olympus2.ThumbnailOffset"),
PreviewTags(pttLen, "Exif.Olympus2.ThumbnailImage"), std::pair(pttLen, "Exif.Olympus2.ThumbnailImage"),
PreviewTags(pttLen, "Exif.Olympus2.Thumbnail"), std::pair(pttLen, "Exif.Olympus2.Thumbnail"),
PreviewTags(pttLen, "Exif.OlympusCs.PreviewImageLength"), std::pair(pttLen, "Exif.OlympusCs.PreviewImageLength"),
PreviewTags(pttTag, "Exif.OlympusCs.PreviewImageStart"), std::pair(pttTag, "Exif.OlympusCs.PreviewImageStart"),
PreviewTags(pttTag, "Exif.OlympusCs.PreviewImageValid"), std::pair(pttTag, "Exif.OlympusCs.PreviewImageValid"),
PreviewTags(pttLen, "Exif.Pentax.PreviewLength"), std::pair(pttLen, "Exif.Pentax.PreviewLength"),
PreviewTags(pttTag, "Exif.Pentax.PreviewOffset"), std::pair(pttTag, "Exif.Pentax.PreviewOffset"),
PreviewTags(pttTag, "Exif.Pentax.PreviewResolution"), std::pair(pttTag, "Exif.Pentax.PreviewResolution"),
PreviewTags(pttLen, "Exif.PentaxDng.PreviewLength"), std::pair(pttLen, "Exif.PentaxDng.PreviewLength"),
PreviewTags(pttTag, "Exif.PentaxDng.PreviewOffset"), std::pair(pttTag, "Exif.PentaxDng.PreviewOffset"),
PreviewTags(pttTag, "Exif.PentaxDng.PreviewResolution"), std::pair(pttTag, "Exif.PentaxDng.PreviewResolution"),
PreviewTags(pttLen, "Exif.SamsungPreview.JPEGInterchangeFormatLength"), std::pair(pttLen, "Exif.SamsungPreview.JPEGInterchangeFormatLength"),
PreviewTags(pttIfd, "SamsungPreview"), std::pair(pttIfd, "SamsungPreview"),
PreviewTags(pttLen, "Exif.Thumbnail.StripByteCounts"), std::pair(pttLen, "Exif.Thumbnail.StripByteCounts"),
PreviewTags(pttIfd, "Thumbnail"), std::pair(pttIfd, "Thumbnail"),
PreviewTags(pttLen, "Exif.Thumbnail.JPEGInterchangeFormatLength"), std::pair(pttLen, "Exif.Thumbnail.JPEGInterchangeFormatLength"),
PreviewTags(pttIfd, "Thumbnail"), std::pair(pttIfd, "Thumbnail"),
}; };
bool delTags = false; bool delTags = false;
for (auto&& [ptt, key] : filteredPvTags) { for (auto&& [ptt, key] : filteredPvTags) {

@ -1641,12 +1641,11 @@ static std::ostream& resolveLens0xffff(std::ostream& os, const Value& value, con
return EXV_PRINT_TAG(minoltaSonyLensID)(os, value, metadata); return EXV_PRINT_TAG(minoltaSonyLensID)(os, value, metadata);
} }
using LensIdFct = std::pair<uint32_t, PrintFct>;
//! List of lens ids which require special treatment from printMinoltaSonyLensID //! List of lens ids which require special treatment from printMinoltaSonyLensID
constexpr auto lensIdFct = std::array{ constexpr auto lensIdFct = std::array{
LensIdFct(0x001c, resolveLens0x1c), LensIdFct(0x0029, resolveLens0x29), LensIdFct(0x0034, resolveLens0x34), std::pair(0x001cu, &resolveLens0x1c), std::pair(0x0029u, &resolveLens0x29), std::pair(0x0034u, &resolveLens0x34),
LensIdFct(0x0080, resolveLens0x80), LensIdFct(0x00ff, resolveLens0xff), LensIdFct(0xffff, resolveLens0xffff), std::pair(0x0080u, &resolveLens0x80), std::pair(0x00ffu, &resolveLens0xff), std::pair(0xffffu, &resolveLens0xffff),
// { 0x00ff, resolveLensTypeUsingExiftool }, // was used for debugging // std::pair(0x00ff, resolveLensTypeUsingExiftool), // was used for debugging
}; };
// #1145 end - respect lenses with shared LensID // #1145 end - respect lenses with shared LensID
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------

@ -42,13 +42,11 @@ TiffImage::TiffImage(BasicIo::UniquePtr io, bool /*create*/) :
Image(ImageType::tiff, mdExif | mdIptc | mdXmp, std::move(io)) { Image(ImageType::tiff, mdExif | mdIptc | mdXmp, std::move(io)) {
} // TiffImage::TiffImage } // TiffImage::TiffImage
//! Structure for TIFF compression to MIME type mappings
using MimeTypeList = std::pair<int, const char*>;
//! List of TIFF compression to MIME type mappings //! List of TIFF compression to MIME type mappings
constexpr auto mimeTypeList = std::array{ constexpr auto mimeTypeList = std::array{
MimeTypeList(32770, "image/x-samsung-srw"), std::pair(32770, "image/x-samsung-srw"),
MimeTypeList(34713, "image/x-nikon-nef"), std::pair(34713, "image/x-nikon-nef"),
MimeTypeList(65535, "image/x-pentax-pef"), std::pair(65535, "image/x-pentax-pef"),
}; };
std::string TiffImage::mimeType() const { std::string TiffImage::mimeType() const {

Loading…
Cancel
Save