Instrument Neutral Distributed Interface INDI 2.2.5
v4l2_colorspace.h
Go to the documentation of this file.
1
2#pragma once
3
4#ifdef __OpenBSD__
5#include <sys/videoio.h>
6#else
7#include <linux/videodev2.h>
8#endif
9
10#ifdef __cplusplus
11extern "C" {
12#endif
13/* for kernel < 3.19 */
14/* ITU-R 601 -- SDTV */
15#define YCBCR_ENC_601 1
16/* Rec. 709 -- HDTV */
17#define YCBCR_ENC_709 2
18/* sYCC (Y'CbCr encoding of sRGB) */
19#define YCBCR_ENC_SYCC 5
20/* SMPTE 240M -- Obsolete HDTV */
21#define YCBCR_ENC_SMPTE240M 8
22#define QUANTIZATION_FULL_RANGE 1
23#define QUANTIZATION_LIM_RANGE 2
24
25void initColorSpace();
26const char *getColorSpaceName(struct v4l2_format *fmt);
27unsigned int getYCbCrEncoding(struct v4l2_format *fmt);
28const char *getYCbCrEncodingName(struct v4l2_format *fmt);
29unsigned int getQuantization(struct v4l2_format *fmt);
30const char *getQuantizationName(struct v4l2_format *fmt);
31
32void rangeY8(unsigned char *buf, unsigned int len);
33void linearize(float *buf, unsigned int len, struct v4l2_format *fmt);
34
35#ifdef __cplusplus
36}
37#endif
std::string fmt(const char *fmt,...)
Definition Utils.cpp:241
const char * getColorSpaceName(struct v4l2_format *fmt)
void initColorSpace()
void rangeY8(unsigned char *buf, unsigned int len)
unsigned int getQuantization(struct v4l2_format *fmt)
const char * getQuantizationName(struct v4l2_format *fmt)
void linearize(float *buf, unsigned int len, struct v4l2_format *fmt)
unsigned int getYCbCrEncoding(struct v4l2_format *fmt)
const char * getYCbCrEncodingName(struct v4l2_format *fmt)