MP4v2

ColorParameterBox.h
1
2//
3// The contents of this file are subject to the Mozilla Public License
4// Version 1.1 (the "License"); you may not use this file except in
5// compliance with the License. You may obtain a copy of the License at
6// http://www.mozilla.org/MPL/
7//
8// Software distributed under the License is distributed on an "AS IS"
9// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
10// License for the specific language governing rights and limitations
11// under the License.
12//
13// The Original Code is MP4v2.
14//
15// The Initial Developer of the Original Code is Kona Blend.
16// Portions created by Kona Blend are Copyright (C) 2008.
17// All Rights Reserved.
18//
19// Contributors:
20// Kona Blend, kona8lend@@gmail.com
21//
23
24#ifndef MP4V2_IMPL_QTFF_COLORPARAMETERBOX_H
25#define MP4V2_IMPL_QTFF_COLORPARAMETERBOX_H
26
27 namespace mp4v2 { namespace impl { namespace qtff {
28
30
43 class MP4V2_EXPORT ColorParameterBox
44{
45 public:
49 class MP4V2_EXPORT Item
50 {
51 public:
52 Item();
53
55 void reset();
56
57 // convert from string CSV format.
58 void convertFromCSV( const string& csv );
59
60 // convert to string CSV format.
61 string convertToCSV() const;
62
63 // convert to string CSV format with buffer.
64 string& convertToCSV( string& buffer ) const;
65
66 public:
72 uint16_t primariesIndex;
73
81 uint16_t transferFunctionIndex;
82
88 uint16_t matrixIndex;
89 };
90
91 class MP4V2_EXPORT IndexedItem {
92 public:
93 IndexedItem();
94
95 uint16_t trackIndex;
96 uint16_t trackId;
97 Item item;
98 };
99
100 typedef vector<IndexedItem> ItemList;
101
102 static bool list( MP4FileHandle file, ItemList& itemList );
103
116 static bool add( MP4FileHandle file, uint16_t trackIndex, const Item& item );
117
130 static bool add( MP4FileHandle file, MP4TrackId trackId, const Item& item );
131
143 static bool set( MP4FileHandle file, uint16_t trackIndex, const Item& item );
144
156 static bool set( MP4FileHandle file, MP4TrackId trackId, const Item& item );
157
169 static bool get( MP4FileHandle file, uint16_t trackIndex, Item& item );
170
182 static bool get( MP4FileHandle file, MP4TrackId trackId, Item& item );
183
191 static bool remove( MP4FileHandle file, uint16_t trackIndex );
192
200 static bool remove( MP4FileHandle file, MP4TrackId trackId );
201};
202
204
205}}} // namespace mp4v2::impl::qtff
206
207#endif // MP4V2_IMPL_QTTF_COLORPARAMETERBOX_H
mp4v2::impl::qtff::ColorParameterBox::IndexedItem
Definition: ColorParameterBox.h:91
mp4v2::impl::qtff::ColorParameterBox::Item
Data object for colr-box item.
Definition: ColorParameterBox.h:50
mp4v2::impl::qtff::ColorParameterBox::Item::primariesIndex
uint16_t primariesIndex
a 16-bit unsigned integer index.
Definition: ColorParameterBox.h:72
mp4v2::impl::qtff::ColorParameterBox::Item::reset
void reset()
reset to state of newly constructed object.
mp4v2::impl::qtff::ColorParameterBox::Item::transferFunctionIndex
uint16_t transferFunctionIndex
a 16-bit unsigned integer index.
Definition: ColorParameterBox.h:81
mp4v2::impl::qtff::ColorParameterBox::Item::matrixIndex
uint16_t matrixIndex
a 16-bit unsigned integer index.
Definition: ColorParameterBox.h:88
mp4v2::impl::qtff::ColorParameterBox
Functional class for colr-box (Color Parameter Box) support.
Definition: ColorParameterBox.h:44
mp4v2::impl::qtff::ColorParameterBox::set
static bool set(MP4FileHandle file, MP4TrackId trackId, const Item &item)
Store colr-box (Color Parameter Box) properties by track-id.
mp4v2::impl::qtff::ColorParameterBox::add
static bool add(MP4FileHandle file, MP4TrackId trackId, const Item &item)
Add colr-box by track-id.
mp4v2::impl::qtff::ColorParameterBox::remove
static bool remove(MP4FileHandle file, uint16_t trackIndex)
Remove colr-box (Color Parameter Box) by track-index.
mp4v2::impl::qtff::ColorParameterBox::get
static bool get(MP4FileHandle file, uint16_t trackIndex, Item &item)
Fetch colr-box (Color Parameter Box) properties by track-index.
mp4v2::impl::qtff::ColorParameterBox::set
static bool set(MP4FileHandle file, uint16_t trackIndex, const Item &item)
Store colr-box (Color Parameter Box) properties by track-index.
mp4v2::impl::qtff::ColorParameterBox::get
static bool get(MP4FileHandle file, MP4TrackId trackId, Item &item)
Fetch colr-box (Color Parameter Box) properties by track-id.
mp4v2::impl::qtff::ColorParameterBox::add
static bool add(MP4FileHandle file, uint16_t trackIndex, const Item &item)
Add colr-box by track-index.
mp4v2::impl::qtff::ColorParameterBox::remove
static bool remove(MP4FileHandle file, MP4TrackId trackId)
Remove colr-box (Color Parameter Box) by track-id.