summaryrefslogtreecommitdiff
path: root/src/qcam/assets/feathericons/edit-2.svg
diff options
context:
space:
mode:
Diffstat (limited to 'src/qcam/assets/feathericons/edit-2.svg')
0 files changed, 0 insertions, 0 deletions
oid/ndk/pinephonepro&id=94cbaa381aa8b1b3f34ad8bf14989456ba79a9af'>plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/* SPDX-License-Identifier: LGPL-2.1-or-later */
/*
 * Copyright (C) 2019, Google Inc.
 *
 * formats.h - libcamera image formats
 */

#ifndef __LIBCAMERA_INTERNAL_FORMATS_H__
#define __LIBCAMERA_INTERNAL_FORMATS_H__

#include <array>
#include <map>
#include <vector>

#include <libcamera/geometry.h>
#include <libcamera/pixel_format.h>

#include "libcamera/internal/v4l2_pixelformat.h"

namespace libcamera {

class PixelFormatInfo
{
public:
	enum ColourEncoding {
		ColourEncodingRGB,
		ColourEncodingYUV,
		ColourEncodingRAW,
	};

	struct Plane {
		unsigned int bytesPerGroup;
		unsigned int verticalSubSampling;
	};

	bool isValid() const { return format.isValid(); }

	static const PixelFormatInfo &info(const PixelFormat &format);
	static const PixelFormatInfo &info(const V4L2PixelFormat &format);
	static const PixelFormatInfo &info(const std::string &name);

	unsigned int stride(unsigned int width, unsigned int plane,
			    unsigned int align = 1) const;
	unsigned int planeSize(const Size &size, unsigned int plane,
			       unsigned int align = 1) const;
	unsigned int planeSize(unsigned int height, unsigned int plane,
			       unsigned int stride) const;