FFmpeg
Loading...
Searching...
No Matches
gain_map.c File Reference
#include <stdio.h>
#include "libavutil/avassert.h"
#include "libavutil/common.h"
#include "libavutil/error.h"
#include "libavutil/gain_map.h"
#include "libavutil/mem.h"
#include "libavutil/rational.h"
#include "bytestream.h"
#include "gain_map.h"

Go to the source code of this file.

Macros

#define XMP_GAIN_MAP_TEMPLATE
 

Functions

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.
 
int ff_gain_map_params_to_xmp (const AVGainMapParams *p, char *buf)
 Serialize an AVGainMapParams as an Ultra HDR XMP packet.
 

Macro Definition Documentation

◆ XMP_GAIN_MAP_TEMPLATE

#define XMP_GAIN_MAP_TEMPLATE
Value:
"<x:xmpmeta xmlns:x=\"adobe:ns:meta/\" x:xmptk=\"XMP Core 5.5.0\">\n" \
" <rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n" \
" <rdf:Description rdf:about=\"\"\n" \
" xmlns:hdrgm=\"" FF_GAIN_MAP_XMP_NAMESPACE "\"\n" \
" hdrgm:Version=\"1.0\"\n" \
" hdrgm:GainMapMin=\"%g\"\n" \
" hdrgm:GainMapMax=\"%g\"\n" \
" hdrgm:Gamma=\"%g\"\n" \
" hdrgm:OffsetSDR=\"%g\"\n" \
" hdrgm:OffsetHDR=\"%g\"\n" \
" hdrgm:HDRCapacityMin=\"%g\"\n" \
" hdrgm:HDRCapacityMax=\"%g\"\n" \
" hdrgm:BaseRenditionIsHDR=\"%s\"/>\n" \
" </rdf:RDF>\n" \
"</x:xmpmeta>"
#define FF_GAIN_MAP_XMP_NAMESPACE
Definition gain_map.h:37

Definition at line 47 of file gain_map.c.

Referenced by ff_gain_map_params_to_xmp().

Function Documentation

◆ ff_gain_map_params_check_xmp()

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 at line 31 of file gain_map.c.

Referenced by ff_gain_map_params_to_xmp(), ff_mjpeg_add_gain_map_size(), and want_gain_map_xmp().

◆ ff_gain_map_params_to_xmp()

int ff_gain_map_params_to_xmp ( const AVGainMapParams * p,
char * buf )

Serialize an AVGainMapParams as an Ultra HDR XMP packet.

Parameters
pparameters to serialize
bufByte buffer to fill with the serialized data. Must contain at least FF_GAIN_MAP_MAX_XMP_LEN bytes.
Returns
Number of bytes written on success, or a negative AVERROR on failure
Note
Always succeeds if ff_gain_map_params_check_xmp() returns 1.

Definition at line 67 of file gain_map.c.

Referenced by jpeg_put_comments().