UltraGrid
UltraGrid Low-Latency High-Resolution Transmission System
Loading...
Searching...
No Matches
src
utils
y4m.h
Go to the documentation of this file.
1
7
/*
8
* Copyright (c) 2022-2023, CESNET z.s.p.o.
9
*
10
* All rights reserved.
11
*
12
* Redistribution and use in source and binary forms, with or without
13
* modification, are permitted provided that the following conditions are met:
14
*
15
* * Redistributions of source code must retain the above copyright
16
* notice, this list of conditions and the following disclaimer.
17
*
18
* * Redistributions in binary form must reproduce the above copyright
19
* notice, this list of conditions and the following disclaimer in the
20
* documentation and/or other materials provided with the distribution.
21
*
22
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
26
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32
* POSSIBILITY OF SUCH DAMAGE.
33
*/
34
35
#ifndef Y4M_H_DB8BEC68_AA48_4A63_81C3_DC3821F5555B
36
#define Y4M_H_DB8BEC68_AA48_4A63_81C3_DC3821F5555B
37
38
#ifdef __cplusplus
39
#include <cstddef>
40
#else
41
#include <stdbool.h>
42
#include <stddef.h>
43
#endif
44
45
#ifdef __cplusplus
46
extern
"C"
{
47
#endif
48
49
enum
y4m_subsampling
{
50
Y4M_SUBS_MONO
= 400,
51
Y4M_SUBS_420
= 420,
52
Y4M_SUBS_422
= 422,
53
Y4M_SUBS_444
= 444,
54
Y4M_SUBS_YUVA
= 4444,
55
};
56
57
struct
y4m_metadata
{
58
int
width
;
59
int
height
;
60
int
bitdepth
;
61
int
subsampling
;
62
bool
limited
;
63
};
64
69
size_t
y4m_read
(
const
char
*filename,
struct
y4m_metadata
*info,
unsigned
char
**data,
void
*(*allocator)(
size_t
));
70
bool
y4m_write
(
const
char
*filename,
const
struct
y4m_metadata
*info,
const
unsigned
char
*data);
71
72
#ifdef __cplusplus
73
}
// extern "C"
74
#endif
75
76
#endif
// defined Y4M_H_DB8BEC68_AA48_4A63_81C3_DC3821F5555B
y4m_metadata
Definition
y4m.h:57
y4m_metadata::width
int width
Definition
y4m.h:58
y4m_metadata::limited
bool limited
Definition
y4m.h:62
y4m_metadata::subsampling
int subsampling
Definition
y4m.h:61
y4m_metadata::bitdepth
int bitdepth
Definition
y4m.h:60
y4m_metadata::height
int height
Definition
y4m.h:59
y4m_read
size_t y4m_read(const char *filename, struct y4m_metadata *info, unsigned char **data, void *(*allocator)(size_t))
Definition
y4m.c:77
y4m_write
bool y4m_write(const char *filename, const struct y4m_metadata *info, const unsigned char *data)
Definition
y4m.c:135
y4m_subsampling
y4m_subsampling
Definition
y4m.h:49
Y4M_SUBS_MONO
@ Y4M_SUBS_MONO
Definition
y4m.h:50
Y4M_SUBS_444
@ Y4M_SUBS_444
Definition
y4m.h:53
Y4M_SUBS_422
@ Y4M_SUBS_422
Definition
y4m.h:52
Y4M_SUBS_420
@ Y4M_SUBS_420
Definition
y4m.h:51
Y4M_SUBS_YUVA
@ Y4M_SUBS_YUVA
Definition
y4m.h:54
Generated on Wed Sep 25 2024 14:27:20 for UltraGrid by
1.12.0