File indexing completed on 2025-01-19 03:53:37
0001 /* ============================================================ 0002 * 0003 * This file is a part of digiKam project 0004 * https://www.digikam.org 0005 * 0006 * Date : 2005-04-21 0007 * Description : Handling access to one item and associated data - private 0008 * 0009 * SPDX-FileCopyrightText: 2005 by Renchi Raju <renchi dot raju at gmail dot com> 0010 * SPDX-FileCopyrightText: 2007-2013 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de> 0011 * SPDX-FileCopyrightText: 2009-2024 by Gilles Caulier <caulier dot gilles at gmail dot com> 0012 * SPDX-FileCopyrightText: 2013 by Michael G. Hansen <mike at mghansen dot de> 0013 * 0014 * SPDX-License-Identifier: GPL-2.0-or-later 0015 * 0016 * ============================================================ */ 0017 0018 #include "iteminfo_p.h" 0019 0020 namespace Digikam 0021 { 0022 0023 MetadataInfo::Field DatabaseVideoMetadataFieldsToMetadataInfoField(const DatabaseFields::VideoMetadata videoMetadataField) 0024 { 0025 switch (videoMetadataField) 0026 { 0027 case DatabaseFields::AspectRatio: 0028 return MetadataInfo::AspectRatio; 0029 0030 case DatabaseFields::AudioBitRate: 0031 return MetadataInfo::AudioBitRate; 0032 0033 case DatabaseFields::AudioChannelType: 0034 return MetadataInfo::AudioChannelType; 0035 0036 case DatabaseFields::AudioCodec: 0037 return MetadataInfo::AudioCodec; 0038 0039 case DatabaseFields::Duration: 0040 return MetadataInfo::Duration; 0041 0042 case DatabaseFields::FrameRate: 0043 return MetadataInfo::FrameRate; 0044 0045 case DatabaseFields::VideoCodec: 0046 return MetadataInfo::VideoCodec; 0047 0048 default: 0049 break; 0050 } 0051 0052 /// @todo Invalid request... 0053 return MetadataInfo::Field(); 0054 } 0055 0056 MetadataInfo::Field DatabaseImageMetadataFieldsToMetadataInfoField(const DatabaseFields::ImageMetadata imageMetadataField) 0057 { 0058 switch (imageMetadataField) 0059 { 0060 case DatabaseFields::Make: 0061 return MetadataInfo::Make; 0062 0063 case DatabaseFields::Model: 0064 return MetadataInfo::Model; 0065 0066 case DatabaseFields::Lens: 0067 return MetadataInfo::Lens; 0068 0069 case DatabaseFields::Aperture: 0070 return MetadataInfo::Aperture; 0071 0072 case DatabaseFields::FocalLength: 0073 return MetadataInfo::FocalLength; 0074 0075 case DatabaseFields::FocalLength35: 0076 return MetadataInfo::FocalLengthIn35mm; 0077 0078 case DatabaseFields::ExposureTime: 0079 return MetadataInfo::ExposureTime; 0080 0081 case DatabaseFields::ExposureProgram: 0082 return MetadataInfo::ExposureProgram; 0083 0084 case DatabaseFields::ExposureMode: 0085 return MetadataInfo::ExposureMode; 0086 0087 case DatabaseFields::Sensitivity: 0088 return MetadataInfo::Sensitivity; 0089 0090 case DatabaseFields::FlashMode: 0091 return MetadataInfo::FlashMode; 0092 0093 case DatabaseFields::WhiteBalance: 0094 return MetadataInfo::WhiteBalance; 0095 0096 case DatabaseFields::WhiteBalanceColorTemperature: 0097 return MetadataInfo::WhiteBalanceColorTemperature; 0098 0099 case DatabaseFields::MeteringMode: 0100 return MetadataInfo::MeteringMode; 0101 0102 case DatabaseFields::SubjectDistance: 0103 return MetadataInfo::SubjectDistance; 0104 0105 case DatabaseFields::SubjectDistanceCategory: 0106 return MetadataInfo::SubjectDistanceCategory; 0107 0108 default: 0109 break; 0110 } 0111 0112 /// @todo Invalid request... 0113 return MetadataInfo::Field(); 0114 } 0115 0116 } // namespace Digikam