Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qlibcamera_format_support_p.h
Go to the documentation of this file.
1// Copyright (C) 2026 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3#ifndef QLIBCAMERA_FORMAT_SUPPORT_P_H
4#define QLIBCAMERA_FORMAT_SUPPORT_P_H
5
6//
7// W A R N I N G
8// -------------
9//
10// This file is not part of the Qt API. It exists purely as an
11// implementation detail. This header file may change from version to
12// version without notice, or even be removed.
13//
14// We mean it.
15//
16
17#include <QtMultimedia/qvideoframeformat.h>
18#include <QtCore/qsize.h>
19
20#include <optional>
21#include <utility>
22#include <vector>
23
24namespace libcamera {
25class ColorSpace;
26class ControlInfoMap;
27class PixelFormat;
28class Size;
29class StreamFormats;
30} // namespace libcamera
31
32QT_BEGIN_NAMESPACE
33
34namespace QLibCamera {
35
37
39pixelFormatFromLibcamera(const libcamera::PixelFormat &);
40
42colorSpaceFromLibcamera(const std::optional<libcamera::ColorSpace> &);
43
44// Extracts a [minFrameRate, maxFrameRate] pair from controls::FrameDurationLimits. Not every pipeline
45// handler advertises this pre-acquire(), so this returns a generic 1-30 fps fallback range rather than failing
46std::pair<float, float> frameRateRangeFromControls(const libcamera::ControlInfoMap &);
47
48std::vector<QSize> sizesForPixelFormat(const libcamera::StreamFormats &,
49 const libcamera::PixelFormat &);
50
51QSize toQSize(const libcamera::Size &);
52libcamera::Size toSize(const QSize &);
53
54} // namespace QLibCameraFormatSupport
55
56} // namespace QLibCamera
57
58QT_END_NAMESPACE
59
60#endif // QLIBCAMERA_FORMAT_SUPPORT_P_H
void handleRequestCompleted(libcamera::Request *)
QLibCameraCameraStream(std::shared_ptr< libcamera::Camera >, libcamera::Stream *, int bytesPerLine, QVideoFrameFormat, double maxFrameRate)
libcamera::Stream * stream() const
void setExposureCompensation(float compensation) override
void setManualIsoSensitivity(int iso) override
void setActive(bool active) override
void setCamera(const QCameraDevice &) override
void setManualExposureTime(float seconds) override
bool setCameraFormat(const QCameraFormat &) override
void zoomTo(float newZoomFactor, float rate=-1.) override
void setExposureMode(QCamera::ExposureMode) override
QVideoFrameFormat frameFormat() const override
int cameraPixelFormatScore(QVideoFrameFormat::PixelFormat, QVideoFrameFormat::ColorRange) const override
void setColorTemperature(int temperature) override
void setWhiteBalanceMode(QCamera::WhiteBalanceMode) override
bool isExposureModeSupported(QCamera::ExposureMode mode) const override
void setExposureCompensation(ControlList &pending, float stops)
void setAnalogueGainForIso(ControlList &pending, int iso)
void setAwbEnable(ControlList &pending, bool enable)
void setZoomFactor(ControlList &pending, const ControlInfoMap &controls, float zoomFactor)
void setColorTemperature(ControlList &pending, int kelvin)
void setManualExposureTime(ControlList &pending, float seconds)
void setAeEnable(ControlList &pending, bool enable)
QCamera::Features detectSupportedFeatures(const ControlInfoMap &controls)
std::pair< float, float > frameRateRangeFromControls(const ControlInfoMap &controls)
std::optional< QVideoFrameFormat::PixelFormat > pixelFormatFromLibcamera(const PixelFormat &format)
std::pair< QVideoFrameFormat::ColorSpace, QVideoFrameFormat::ColorRange > colorSpaceFromLibcamera(const std::optional< ColorSpace > &colorSpace)
std::vector< QSize > sizesForPixelFormat(const StreamFormats &formats, const PixelFormat &pixelFormat)