1 // Copyright (c) 2016 The WebM project authors. All Rights Reserved. 2 // 3 // Use of this source code is governed by a BSD-style license 4 // that can be found in the LICENSE file in the root of the source 5 // tree. An additional intellectual property rights grant can be found 6 // in the file PATENTS. All contributing project authors may 7 // be found in the AUTHORS file in the root of the source tree. 8 #ifndef SRC_MASTERING_METADATA_PARSER_H_ 9 #define SRC_MASTERING_METADATA_PARSER_H_ 10 11 #include "src/float_parser.h" 12 #include "src/master_value_parser.h" 13 #include "webm/dom_types.h" 14 #include "webm/id.h" 15 16 namespace webm { 17 18 // Spec reference: 19 // http://matroska.org/technical/specs/index.html#MasteringMetadata 20 // http://www.webmproject.org/docs/container/#MasteringMetadata 21 class MasteringMetadataParser : public MasterValueParser<MasteringMetadata> { 22 public: MasteringMetadataParser()23 MasteringMetadataParser() 24 : MasterValueParser<MasteringMetadata>( 25 MakeChild<FloatParser>( 26 Id::kPrimaryRChromaticityX, 27 &MasteringMetadata::primary_r_chromaticity_x), 28 MakeChild<FloatParser>( 29 Id::kPrimaryRChromaticityY, 30 &MasteringMetadata::primary_r_chromaticity_y), 31 MakeChild<FloatParser>( 32 Id::kPrimaryGChromaticityX, 33 &MasteringMetadata::primary_g_chromaticity_x), 34 MakeChild<FloatParser>( 35 Id::kPrimaryGChromaticityY, 36 &MasteringMetadata::primary_g_chromaticity_y), 37 MakeChild<FloatParser>( 38 Id::kPrimaryBChromaticityX, 39 &MasteringMetadata::primary_b_chromaticity_x), 40 MakeChild<FloatParser>( 41 Id::kPrimaryBChromaticityY, 42 &MasteringMetadata::primary_b_chromaticity_y), 43 MakeChild<FloatParser>( 44 Id::kWhitePointChromaticityX, 45 &MasteringMetadata::white_point_chromaticity_x), 46 MakeChild<FloatParser>( 47 Id::kWhitePointChromaticityY, 48 &MasteringMetadata::white_point_chromaticity_y), 49 MakeChild<FloatParser>(Id::kLuminanceMax, 50 &MasteringMetadata::luminance_max), 51 MakeChild<FloatParser>(Id::kLuminanceMin, 52 &MasteringMetadata::luminance_min)) {} 53 }; 54 55 } // namespace webm 56 57 #endif // SRC_MASTERING_METADATA_PARSER_H_ 58