• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #include "image_io/jpeg/jpeg_xmp_info.h"
2 
3 namespace photos_editing_formats {
4 namespace image_io {
5 
6 using std::string;
7 using std::vector;
8 
9 const char kGDepthDataPropertyName[] = "GDepth:Data";
10 const char kGImageDataPropertyName[] = "GImage:Data";
11 const char kGDepthMimePropertyName[] = "GDepth:Mime";
12 const char kGImageMimePropertyName[] = "GImage:Mime";
13 
InitializeVector(vector<JpegXmpInfo> * xmp_info_vector)14 void JpegXmpInfo::InitializeVector(vector<JpegXmpInfo>* xmp_info_vector) {
15   xmp_info_vector->clear();
16   xmp_info_vector->push_back(JpegXmpInfo(JpegXmpInfo::kGDepthInfoType));
17   xmp_info_vector->push_back(JpegXmpInfo(JpegXmpInfo::kGImageInfoType));
18 }
19 
GetIdentifier(Type jpeg_xmp_info_type)20 string JpegXmpInfo::GetIdentifier(Type jpeg_xmp_info_type) {
21   switch (jpeg_xmp_info_type) {
22     case kGDepthInfoType:
23       return kXmpGDepthV1Id;
24     case kGImageInfoType:
25       return kXmpGImageV1Id;
26   }
27 }
28 
GetDataPropertyName(Type jpeg_xmp_info_type)29 string JpegXmpInfo::GetDataPropertyName(Type jpeg_xmp_info_type) {
30   switch (jpeg_xmp_info_type) {
31     case kGDepthInfoType:
32       return kGDepthDataPropertyName;
33     case kGImageInfoType:
34       return kGImageDataPropertyName;
35   }
36 }
37 
GetMimePropertyName(Type jpeg_xmp_info_type)38 string JpegXmpInfo::GetMimePropertyName(Type jpeg_xmp_info_type) {
39   switch (jpeg_xmp_info_type) {
40     case kGDepthInfoType:
41       return kGDepthMimePropertyName;
42     case kGImageInfoType:
43       return kGImageMimePropertyName;
44   }
45 }
46 
47 }  // namespace image_io
48 }  // namespace photos_editing_formats
49