FFmpeg
Loading...
Searching...
No Matches
gain_map.h
Go to the documentation of this file.
1/*
2 * This file is part of FFmpeg.
3 *
4 * FFmpeg is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * FFmpeg is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with FFmpeg; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18
19/**
20 * @file
21 * Serialization of AVGainMapParams into the metadata blobs that image formats
22 * carry it in, and back. Kept separate from the codecs so that an encoder
23 * writing the blob and a bitstream filter splicing it into an existing
24 * bitstream can share the same code.
25 */
26
27#ifndef AVCODEC_GAIN_MAP_H
28#define AVCODEC_GAIN_MAP_H
29
30#include "libavutil/gain_map.h"
31
32/* May differ from AV_ISO21496_VERSION if libraries are not in sync */
33#define FF_GAIN_MAP_VERSION 0
34
35/* For XMP-based encoding */
36#define FF_GAIN_MAP_XMP_IDENT "http://ns.adobe.com/xap/1.0/"
37#define FF_GAIN_MAP_XMP_NAMESPACE "http://ns.adobe.com/hdr-gain-map/1.0/"
38#define FF_GAIN_MAP_XMP_MAX_LEN 1024
39
40/**
41 * Returns 1 if the gain map parameters are compatible with the XMP-based
42 * encoding, or 0 otherwise.
43 */
45
46/**
47 * Serialize an AVGainMapParams as an Ultra HDR XMP packet.
48 *
49 * @param p parameters to serialize
50 * @param buf Byte buffer to fill with the serialized data. Must contain at
51 * least FF_GAIN_MAP_MAX_XMP_LEN bytes.
52 *
53 * @return Number of bytes written on success, or a negative AVERROR on failure
54 *
55 * @note Always succeeds if ff_gain_map_params_check_xmp() returns 1.
56 */
57int ff_gain_map_params_to_xmp(const AVGainMapParams *p, char *buf);
58
59#endif /* AVCODEC_GAIN_MAP_H */
int ff_gain_map_params_check_xmp(const AVGainMapParams *p)
Returns 1 if the gain map parameters are compatible with the XMP-based encoding, or 0 otherwise.
Definition gain_map.c:31
int ff_gain_map_params_to_xmp(const AVGainMapParams *p, char *buf)
Serialize an AVGainMapParams as an Ultra HDR XMP packet.
Definition gain_map.c:67
Parameters describing how to combine a gain map rendition with its base rendition to recover the alte...
Definition gain_map.h:39