.. SPDX-License-Identifier: CC-BY-SA-4.0 .. contents:: :local: ************* Documentation ************* .. toctree:: :hidden: API API === The libcamera API is extensively documented using Doxygen. The :ref:`API nightly build ` contains the most up-to-date API documentation, built from the latest master branch. Feature Requirements ==================== Device enumeration ------------------ The library shall support enumerating all camera devices available in the system, including both fixed cameras and hotpluggable cameras. It shall support cameras plugged and unplugged after the initialization of the library, and shall offer a mechanism to notify applications of camera plug and unplug. The following types of cameras shall be supported: * Internal cameras designed for point-and-shoot still image and video capture usage, either controlled directly by the CPU, or exposed through an internal USB bus as a UVC device. * External UVC cameras designed for video conferencing usage. Other types of camera, including analog cameras, depth cameras, thermal cameras, external digital picture or movie cameras, are out of scope for this project. A hardware device that includes independent camera sensors, such as front and back sensors in a phone, shall be considered as multiple camera devices for the purpose of this library. Independent Camera Devices -------------------------- When multiple cameras are present in the system and are able to operate independently from each other, the library shall expose them as multiple camera devices and support parallel operation without any additional usage restriction apart from the limitations inherent to the hardware (such as memory bandwidth, CPU usage or number of CSI-2 receivers for instance). Independent processes shall be able to use independent cameras devices without interfering with each other. A single camera device shall be usable by a single process at a time. Multiple streams support ------------------------ The library shall support multiple video streams running in parallel for each camera device, within the limits imposed by the system. Per frame controls ------------------ The library shall support controlling capture parameters for each stream on a per-frame basis, on a best effort basis based on the capabilities of the hardware and underlying software stack (including kernel drivers and firmware). It shall apply capture parameters to the frame they target, and report the value of the parameters that have effectively been used for each captured frame. When a camera device supports multiple streams, the library shall allow both control of each stream independently, and control of multiple streams together. Streams that are controlled together shall be synchronized. No synchronization is required for streams controlled independently. Capability Enumeration ---------------------- The library shall expose capabilities of each camera device in a way that allows applications to discover those capabilities dynamically. Applications shall be allowed to cache capabilities for as long as they are using the library. If capabilities can change at runtime, the library shall offer a mechanism to notify applications of such changes. Applications shall not cache capabilities in long term storage between runs. Capabilities shall be discovered dynamically at runtime from the device when possible, and may come, in part or in full, from platform configuration data. Device Profiles --------------- The library may define different camera device profiles, each with a minimum set of required capabilities. Applications may use those profiles to quickly determine the level of features exposed by a device without parsing the full list of capabilities. Camera devices may implement additional capabilities on top of the minimum required set for the profile they expose. 3A and Image Enhancement Algorithms ----------------------------------- The camera devices shall implement auto exposure, auto gain and auto white balance. Camera devices that include a focus lens shall implement auto focus. Additional image enhancement algorithms, such as noise reduction or video stabilization, may be implemented. All algorithms may be implemented in hardware or firmware outside of the library, or in software in the library. They shall all be controllable by applications. The library shall be architectured to isolate the 3A and image enhancement algorithms in a component with a documented API, respectively called the 3A component and the 3A API. The 3A API shall be stable, and shall allow both open-source and closed-source implementations of the 3A component. The library may include statically-linked open-source 3A components, and shall support dynamically-linked open-source and closed-source 3A components. Closed-source 3A Component Sandboxing ------------------------------------- For security purposes, it may be desired to run closed-source 3A components in a separate process. The 3A API would in such a case be transported over IPC. The 3A API shall make it possible to use any IPC mechanism that supports passing file descriptors. The library may implement an IPC mechanism, and shall support third-party platform-specific IPC mechanisms through the implementation of a platform-specific 3A API wrapper. No modification to the library shall be needed to use such third-party IPC mechanisms. The 3A component shall not directly access any device node on the system. Such accesses shall instead be performed through the 3A API. The library shall validate all accesses and restrict them to what is absolutely required by 3A components. V4L2 Compatibility Layer ------------------------ The project shall support traditional V4L2 application through an additional libcamera wrapper library. The wrapper library shall trap all accesses to camera devices through `LD_PRELOAD`, and route them through libcamera to emulate a high-level V4L2 camera device. It shall expose camera device features on a best-effort basis, and aim for the level of features traditionally available from a UVC camera designed for video conferencing. Android Camera HAL v3 Compatibility ----------------------------------- The library API shall expose all the features required to implement an Android Camera HAL v3 on top of libcamera. Some features of the HAL may be omitted as long as they can be implemented separately in the HAL, such as JPEG encoding, or YUV reprocessing. Camera Stack ============ :: a c / +-------------+ +-------------+ +-------------+ +-------------+ p a | | Native | | Framework | | Native | | Android | p t | | V4L2 | | Application | | libcamera | | Camera | l i | | Application | | (gstreamer) | | Application | | Framework | i o \ +-------------+ +-------------+ +-------------+ +-------------+ n ^ ^ ^ ^ | | | | l a | | | | i d v v | v b a / +-------------+ +-------------+ | +-------------+ c p | | V4L2 | | Camera | | | Android | a t | | Compat. | | Framework | | | Camera | m a | | | | (gstreamer) | | | HAL | e t \ +-------------+ +-------------+ | +-------------+ r i ^ ^ | ^ a o | | | | n | | | | / | ,................................................ | | ! : Language : ! l f | | ! : Bindings : ! i r | | ! : (optional) : ! b a | | \...............................................' c m | | | | | a e | | | | | m w | v v v v e o | +----------------------------------------------------------------+ r r | | | a k | | libcamera | | | | \ +----------------------------------------------------------------+ ^ ^ ^ Userspace | | | ------------------------ | ---------------- | ---------------- | --------------- Kernel | | | v v v +-----------+ +-----------+ +-----------+ | Media | <--> | Video | <--> | V4L2 | | Device | | Device | | Subdev | +-----------+ +-----------+ +-----------+ The camera stack comprises four software layers. From bottom to top: * The kernel drivers control the camera hardware and expose a low-level interface to userspace through the Linux kernel V4L2 family of APIs (Media Controller API, V4L2 Video Device API and V4L2 Subdev API). * The libcamera framework is the core part of the stack. It handles all control of the camera devices in its core component, libcamera, and exposes a native C++ API to upper layers. Optional language bindings allow interfacing to libcamera from other programming languages. Those components live in the same source code repository and all together constitute the libcamera framework. * The libcamera adaptation is an umbrella term designating the components that interface to libcamera in other frameworks. Notable examples are a V4L2 compatibility layer, a gstreamer libcamera element, and an Android camera HAL implementation based on libcamera. Those components can live in the libcamera project source code in separate repositories, or move to their respective project's repository (for instance the gstreamer libcamera element). * The applications and upper level frameworks are based on the libcamera framework or libcamera adaptation, and are outside of the scope of the libcamera project. libcamera Architecture ====================== :: ---------------------------< libcamera Public API >--------------------------- ^ ^ | | v v +-------------+ +-------------------------------------------------+ | Camera | | Camera Device | | Devices | | +---------------------------------------------+ | | Manager | | | Device-Agnostic | | +-------------+ | | | | ^ | | +------------------------+ | | | | | ~~~~~~~~~~~~~~~~~~~~~ | | | | | { +---------------+ } | | | | | } | ////Image//// | { | | | | | <-> | /Processing// | } | | | | | } | /Algorithms// | { | | | | | { +---------------+ } | | | | | ~~~~~~~~~~~~~~~~~~~~~ | | | | | ======================== | | | | | +---------------+ | | | | | | //Pipeline/// | | | | | | <-> | ///Handler/// | | | | | | | ///////////// | | | | +--------------------+ +---------------+ | | | Device-Specific | | +-------------------------------------------------+ | ^ ^ | | | v v v +--------------------------------------------------------------------+ | Helpers and Support Classes | | +-------------+ +-------------+ +-------------+ +-------------+ | | | MC & V4L2 | | Buffers | | Sandboxing | | Plugins | | | | Support | | Allocator | | IPC | | Manager | | | +-------------+ +-------------+ +-------------+ +-------------+ | | +-------------+ +-------------+ | | | Pipeline | | ... | | | | Runner | | | | | +-------------+ +-------------+ | +--------------------------------------------------------------------+ /// Device-Specific Components ~~~ Sandboxing While offering a unified API towards upper layers, and presenting itself as a single library, libcamera isn't monolithic. It exposes multiple components through its public API, is built around a set of separate helpers internally, uses device-specific components and can load dynamic plugins. Camera Devices Manager The Camera Devices Manager provides a view of available cameras in the system. It performs cold enumeration and runtime camera management, and supports a hotplug notification mechanism in its public API. To avoid the cost associated with cold enumeration of all devices at application start, and to arbitrate concurrent access to camera devices, the Camera Devices Manager could later be split to a separate service, possibly with integration in platform-specific device management. Camera Device The Camera Device represents a camera device to upper layers. It exposes full control of the device through the public API, and is thus the highest level object exposed by libcamera. Camera Device instances are created by the Camera Devices Manager. An optional function to create new instances could be exposed through the public API to speed up initialization when the upper layer knows how to directly address camera devices present in the system. Pipeline Handler The Pipeline Handler manages complex pipelines exposed by the kernel drivers through the Media Controller and V4L2 APIs. It abstracts pipeline handling to hide device-specific details to the rest of the library, and implements both pipeline configuration based on stream configuration, and pipeline runtime execution and scheduling when needed by the device. This component is device-specific and is part of the libcamera code base. As such it is covered by the same free software license as the rest of libcamera and needs to be contributed upstream by device vendors. The Pipeline Handler lives in the same process as the rest of the library, and has access to all helpers and kernel camera-related devices. Image Processing Algorithms Together with the hardware image processing and hardware statistics collection, the Image Processing Algorithms implement 3A (Auto-Exposure, Auto-White Balance and Auto-Focus) and other algorithms. They run on the CPU and interact with the kernel camera devices to control hardware image processing based on the parameters supplied by upper layers, closing the control loop of the ISP. This component is device-specific and is loaded as an external plugin. It can be part of the libcamera code base, in which case it is covered by the same license, or provided externally as an open-source or closed-source component. The component is sandboxed and can only interact with libcamera through internal APIs specifically marked as such. In particular it will have no direct access to kernel camera devices, and all its accesses to image and metadata will be mediated by dmabuf instances explicitly passed to the component. The component must be prepared to run in a process separate from the main libcamera process, and to have a very restricted view of the system, including no access to networking APIs and limited access to file systems. The sandboxing mechanism isn't defined by libcamera. One example implementation will be provided as part of the project, and platforms vendors will be able to provide their own sandboxing mechanism as a plugin. libcamera should provide a basic implementation of Image Processing Algorithms, to serve as a reference for the internal API. Device vendors are expected to provide a full-fledged implementation compatible with their Pipeline Handler. One goal of the libcamera project is to create an environment in which the community will be able to compete with the closed-source vendor binaries and develop a high quality open source implementation. Helpers and Support Classes While Pipeline Handlers are device-specific, implementations are expected to share code due to usage of identical APIs towards the kernel camera drivers and the Image Processing Algorithms. This includes without limitation handling of the MC and V4L2 APIs, buffer management through dmabuf, and pipeline discovery, configuration and scheduling. Such code will be factored out to helpers when applicable. Other parts of libcamera will also benefit from factoring code out to self-contained support classes, even if such code is present only once in the code base, in order to keep the source code clean and easy to read. This should be the case for instance for plugin management. V4L2 Compatibility Layer ------------------------ V4L2 compatibility is achieved through a shared library that traps all accesses to camera devices and routes them to libcamera to emulate high-level V4L2 camera devices. It is injected in a process address space through `LD_PRELOAD` and is completely transparent for applications. The compatibility layer exposes camera device features on a best-effort basis, and aims for the level of features traditionally available from a UVC camera designed for video conferencing. Android Camera HAL ------------------ Camera support for Android is achieved through a generic Android camera HAL implementation on top of libcamera. The HAL will implement internally features required by Android and missing from libcamera, such as JPEG encoding support. The Android camera HAL implementation will initially target the LIMITED hardware level, with support for the FULL level then being gradually implemented. ef='#n482'>482 483 484 485 486 487
{
    "version": 2.0,
    "target": "bcm2835",
    "algorithms": [
        {
            "rpi.black_level":
            {
                "black_level": 1024
            }
        },
        {
            "rpi.dpc": { }
        },
        {
            "rpi.lux":
            {
                "reference_shutter_speed": 21663,
                "reference_gain": 1.0,
                "reference_aperture": 1.0,
                "reference_lux": 987,
                "reference_Y": 8961
            }
        },
        {
            "rpi.noise":
            {
                "reference_constant": 0,
                "reference_slope": 4.25
            }
        },
        {
            "rpi.geq":
            {
                "offset": 401,
                "slope": 0.05619
            }
        },
        {
            "rpi.sdn": { }
        },
        {
            "rpi.awb":
            {
                "priors": [
                    {
                        "lux": 0,
                        "prior":
                        [
                            2000, 1.0,
                            3000, 0.0,
                            13000, 0.0
                        ]
                    },
                    {
                        "lux": 800,
                        "prior":
                        [
                            2000, 0.0,
                            6000, 2.0,
                            13000, 2.0
                        ]
                    },
                    {
                        "lux": 1500,
                        "prior":
                        [
                            2000, 0.0,
                            4000, 1.0,
                            6000, 6.0,
                            6500, 7.0,
                            7000, 1.0,
                            13000, 1.0
                        ]
                    }
                ],
                "modes":
                {
                    "auto":
                    {
                        "lo": 2500,
                        "hi": 8000
                    },
                    "incandescent":
                    {
                        "lo": 2500,
                        "hi": 3000
                    },
                    "tungsten":
                    {
                        "lo": 3000,
                        "hi": 3500
                    },
                    "fluorescent":
                    {
                        "lo": 4000,
                        "hi": 4700
                    },
                    "indoor":
                    {
                        "lo": 3000,
                        "hi": 5000
                    },
                    "daylight":
                    {
                        "lo": 5500,
                        "hi": 6500
                    },
                    "cloudy":
                    {
                        "lo": 7000,
                        "hi": 8600
                    }
                },
                "bayes": 1,
                "ct_curve":
                [
                    2500.0, 1.0289, 0.4503,
                    2803.0, 0.9428, 0.5108,
                    2914.0, 0.9406, 0.5127,
                    3605.0, 0.8261, 0.6249,
                    4540.0, 0.7331, 0.7533,
                    5699.0, 0.6715, 0.8627,
                    8625.0, 0.6081, 1.0012
                ],
                "sensitivity_r": 1.05,
                "sensitivity_b": 1.05,
                "transverse_pos": 0.0321,
                "transverse_neg": 0.04313
            }
        },
        {
            "rpi.agc":
            {
                "metering_modes":
                {
                    "centre-weighted":
                    {
                        "weights": [ 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0 ]
                    },
                    "spot":
                    {
                        "weights": [ 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
                    },
                    "matrix":
                    {
                        "weights": [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
                    }
                },
                "exposure_modes":
                {
                    "normal":
                    {
                        "shutter": [ 100, 10000, 30000, 60000, 66666 ],
                        "gain": [ 1.0, 2.0, 4.0, 6.0, 8.0 ]
                    },
                    "short":
                    {
                        "shutter": [ 100, 5000, 10000, 20000, 33333 ],
                        "gain": [ 1.0, 2.0, 4.0, 6.0, 8.0 ]
                    },
                    "long":
                    {
                        "shutter": [ 100, 10000, 30000, 60000, 120000 ],
                        "gain": [ 1.0, 2.0, 4.0, 6.0, 12.0 ]
                    }
                },
                "constraint_modes":
                {
                    "normal": [
                        {
                            "bound": "LOWER",
                            "q_lo": 0.98,
                            "q_hi": 1.0,
                            "y_target":
                            [
                                0, 0.5,
                                1000, 0.5
                            ]
                        }
                    ],
                    "highlight": [
                        {
                            "bound": "LOWER",
                            "q_lo": 0.98,
                            "q_hi": 1.0,
                            "y_target":
                            [
                                0, 0.5,
                                1000, 0.5
                            ]
                        },
                        {
                            "bound": "UPPER",
                            "q_lo": 0.98,
                            "q_hi": 1.0,
                            "y_target":
                            [
                                0, 0.8,
                                1000, 0.8
                            ]
                        }
                    ],
                    "shadows": [
                        {
                            "bound": "LOWER",
                            "q_lo": 0.0,
                            "q_hi": 0.5,
                            "y_target":
                            [
                                0, 0.17,
                                1000, 0.17
                            ]
                        }
                    ]
                },
                "y_target":
                [
                    0, 0.16,
                    1000, 0.165,
                    10000, 0.17
                ],
                "base_ev": 1.25
            }
        },
        {
            "rpi.alsc":
            {
                "omega": 1.3,
                "n_iter": 100,
                "luminance_strength": 0.5,
                "calibrations_Cr": [
                    {
                        "ct": 3000,
                        "table":
                        [
                            1.105, 1.103, 1.093, 1.083, 1.071, 1.065, 1.065, 1.065, 1.066, 1.069, 1.072, 1.077, 1.084, 1.089, 1.093, 1.093,
                            1.103, 1.096, 1.084, 1.072, 1.059, 1.051, 1.047, 1.047, 1.051, 1.053, 1.059, 1.067, 1.075, 1.082, 1.085, 1.086,
                            1.096, 1.084, 1.072, 1.059, 1.051, 1.045, 1.039, 1.038, 1.039, 1.045, 1.049, 1.057, 1.063, 1.072, 1.081, 1.082,
                            1.092, 1.075, 1.061, 1.052, 1.045, 1.039, 1.036, 1.035, 1.035, 1.039, 1.044, 1.049, 1.056, 1.063, 1.072, 1.081,
                            1.092, 1.073, 1.058, 1.048, 1.043, 1.038, 1.035, 1.033, 1.033, 1.035, 1.039, 1.044, 1.051, 1.057, 1.069, 1.078,
                            1.091, 1.068, 1.054, 1.045, 1.041, 1.038, 1.035, 1.032, 1.032, 1.032, 1.036, 1.041, 1.045, 1.055, 1.069, 1.078,
                            1.091, 1.068, 1.052, 1.043, 1.041, 1.038, 1.035, 1.032, 1.031, 1.032, 1.034, 1.036, 1.043, 1.055, 1.069, 1.078,
                            1.092, 1.068, 1.052, 1.047, 1.042, 1.041, 1.038, 1.035, 1.032, 1.032, 1.035, 1.039, 1.043, 1.055, 1.071, 1.079,
                            1.092, 1.073, 1.057, 1.051, 1.047, 1.047, 1.044, 1.041, 1.038, 1.038, 1.039, 1.043, 1.051, 1.059, 1.076, 1.083,
                            1.092, 1.081, 1.068, 1.058, 1.056, 1.056, 1.053, 1.052, 1.049, 1.048, 1.048, 1.051, 1.059, 1.066, 1.083, 1.085,
                            1.091, 1.087, 1.081, 1.068, 1.065, 1.064, 1.062, 1.062, 1.061, 1.056, 1.056, 1.056, 1.064, 1.069, 1.084, 1.089,
                            1.091, 1.089, 1.085, 1.079, 1.069, 1.068, 1.067, 1.067, 1.067, 1.063, 1.061, 1.063, 1.068, 1.069, 1.081, 1.092
                        ]
                    },
                    {
                        "ct": 5000,
                        "table":
                        [
                            1.486, 1.484, 1.468, 1.449, 1.427, 1.403, 1.399, 1.399, 1.399, 1.404, 1.413, 1.433, 1.454, 1.473, 1.482, 1.488,
                            1.484, 1.472, 1.454, 1.431, 1.405, 1.381, 1.365, 1.365, 1.367, 1.373, 1.392, 1.411, 1.438, 1.458, 1.476, 1.481,
                            1.476, 1.458, 1.433, 1.405, 1.381, 1.361, 1.339, 1.334, 1.334, 1.346, 1.362, 1.391, 1.411, 1.438, 1.462, 1.474,
                            1.471, 1.443, 1.417, 1.388, 1.361, 1.339, 1.321, 1.313, 1.313, 1.327, 1.346, 1.362, 1.391, 1.422, 1.453, 1.473,
                            1.469, 1.439, 1.408, 1.377, 1.349, 1.321, 1.312, 1.299, 1.299, 1.311, 1.327, 1.348, 1.378, 1.415, 1.446, 1.468,
                            1.468, 1.434, 1.402, 1.371, 1.341, 1.316, 1.299, 1.296, 1.295, 1.299, 1.314, 1.338, 1.371, 1.408, 1.441, 1.466,
                            1.468, 1.434, 1.401, 1.371, 1.341, 1.316, 1.301, 1.296, 1.295, 1.297, 1.314, 1.338, 1.369, 1.408, 1.441, 1.465,
                            1.469, 1.436, 1.401, 1.374, 1.348, 1.332, 1.315, 1.301, 1.301, 1.313, 1.324, 1.342, 1.372, 1.409, 1.442, 1.465,
                            1.471, 1.444, 1.413, 1.388, 1.371, 1.348, 1.332, 1.323, 1.323, 1.324, 1.342, 1.362, 1.386, 1.418, 1.449, 1.467,
                            1.473, 1.454, 1.431, 1.407, 1.388, 1.371, 1.359, 1.352, 1.351, 1.351, 1.362, 1.383, 1.404, 1.433, 1.462, 1.472,
                            1.474, 1.461, 1.447, 1.424, 1.407, 1.394, 1.385, 1.381, 1.379, 1.381, 1.383, 1.401, 1.419, 1.444, 1.466, 1.481,
                            1.474, 1.464, 1.455, 1.442, 1.421, 1.408, 1.403, 1.403, 1.403, 1.399, 1.402, 1.415, 1.432, 1.446, 1.467, 1.483
                        ]
                    },
                    {
                        "ct": 6500,
                        "table":
                        [
                            1.567, 1.565, 1.555, 1.541, 1.525, 1.518, 1.518, 1.518, 1.521, 1.527, 1.532, 1.541, 1.551, 1.559, 1.567, 1.569,
                            1.565, 1.557, 1.542, 1.527, 1.519, 1.515, 1.511, 1.516, 1.519, 1.524, 1.528, 1.533, 1.542, 1.553, 1.559, 1.562,
                            1.561, 1.546, 1.532, 1.521, 1.518, 1.515, 1.511, 1.516, 1.519, 1.524, 1.528, 1.529, 1.533, 1.542, 1.554, 1.559,
                            1.561, 1.539, 1.526, 1.524, 1.521, 1.521, 1.522, 1.524, 1.525, 1.531, 1.529, 1.529, 1.531, 1.538, 1.549, 1.558,
                            1.559, 1.538, 1.526, 1.525, 1.524, 1.528, 1.534, 1.536, 1.536, 1.536, 1.532, 1.529, 1.531, 1.537, 1.548, 1.556,
                            1.561, 1.537, 1.525, 1.524, 1.526, 1.532, 1.537, 1.539, 1.538, 1.537, 1.532, 1.529, 1.529, 1.537, 1.546, 1.556,
                            1.561, 1.536, 1.524, 1.522, 1.525, 1.532, 1.538, 1.538, 1.537, 1.533, 1.528, 1.526, 1.527, 1.536, 1.546, 1.555,
                            1.561, 1.537, 1.522, 1.521, 1.524, 1.531, 1.536, 1.537, 1.534, 1.529, 1.526, 1.522, 1.523, 1.534, 1.547, 1.555,
                            1.561, 1.538, 1.524, 1.522, 1.526, 1.531, 1.535, 1.535, 1.534, 1.527, 1.524, 1.522, 1.522, 1.535, 1.549, 1.556,
                            1.558, 1.543, 1.532, 1.526, 1.526, 1.529, 1.534, 1.535, 1.533, 1.526, 1.523, 1.522, 1.524, 1.537, 1.552, 1.557,
                            1.555, 1.546, 1.541, 1.528, 1.527, 1.528, 1.531, 1.533, 1.531, 1.527, 1.522, 1.522, 1.526, 1.536, 1.552, 1.561,
                            1.555, 1.547, 1.542, 1.538, 1.526, 1.526, 1.529, 1.531, 1.529, 1.528, 1.519, 1.519, 1.527, 1.531, 1.543, 1.561
                        ]
                    }
                ],
                "calibrations_Cb": [
                    {
                        "ct": 3000,
                        "table":
                        [
                            1.684, 1.688, 1.691, 1.697, 1.709, 1.722, 1.735, 1.745, 1.747, 1.745, 1.731, 1.719, 1.709, 1.705, 1.699, 1.699,
                            1.684, 1.689, 1.694, 1.708, 1.721, 1.735, 1.747, 1.762, 1.762, 1.758, 1.745, 1.727, 1.716, 1.707, 1.701, 1.699,
                            1.684, 1.691, 1.704, 1.719, 1.734, 1.755, 1.772, 1.786, 1.789, 1.788, 1.762, 1.745, 1.724, 1.709, 1.702, 1.698,
                            1.682, 1.694, 1.709, 1.729, 1.755, 1.773, 1.798, 1.815, 1.817, 1.808, 1.788, 1.762, 1.733, 1.714, 1.704, 1.699,
                            1.682, 1.693, 1.713, 1.742, 1.772, 1.798, 1.815, 1.829, 1.831, 1.821, 1.807, 1.773, 1.742, 1.716, 1.703, 1.699,
                            1.681, 1.693, 1.713, 1.742, 1.772, 1.799, 1.828, 1.839, 1.839, 1.828, 1.807, 1.774, 1.742, 1.715, 1.699, 1.695,
                            1.679, 1.691, 1.712, 1.739, 1.771, 1.798, 1.825, 1.829, 1.831, 1.818, 1.801, 1.774, 1.738, 1.712, 1.695, 1.691,
                            1.676, 1.685, 1.703, 1.727, 1.761, 1.784, 1.801, 1.817, 1.817, 1.801, 1.779, 1.761, 1.729, 1.706, 1.691, 1.684,
                            1.669, 1.678, 1.692, 1.714, 1.741, 1.764, 1.784, 1.795, 1.795, 1.779, 1.761, 1.738, 1.713, 1.696, 1.683, 1.679,
                            1.664, 1.671, 1.679, 1.693, 1.716, 1.741, 1.762, 1.769, 1.769, 1.753, 1.738, 1.713, 1.701, 1.687, 1.681, 1.676,
                            1.661, 1.664, 1.671, 1.679, 1.693, 1.714, 1.732, 1.739, 1.739, 1.729, 1.708, 1.701, 1.685, 1.679, 1.676, 1.677,
                            1.659, 1.661, 1.664, 1.671, 1.679, 1.693, 1.712, 1.714, 1.714, 1.708, 1.701, 1.687, 1.679, 1.672, 1.673, 1.677
                        ]
                    },
                    {
                        "ct": 5000,
                        "table":
                        [
                            1.177, 1.183, 1.187, 1.191, 1.197, 1.206, 1.213, 1.215, 1.215, 1.215, 1.211, 1.204, 1.196, 1.191, 1.183, 1.182,
                            1.179, 1.185, 1.191, 1.196, 1.206, 1.217, 1.224, 1.229, 1.229, 1.226, 1.221, 1.212, 1.202, 1.195, 1.188, 1.182,
                            1.183, 1.191, 1.196, 1.206, 1.217, 1.229, 1.239, 1.245, 1.245, 1.245, 1.233, 1.221, 1.212, 1.199, 1.193, 1.187,
                            1.183, 1.192, 1.201, 1.212, 1.229, 1.241, 1.252, 1.259, 1.259, 1.257, 1.245, 1.233, 1.217, 1.201, 1.194, 1.192,
                            1.183, 1.192, 1.202, 1.219, 1.238, 1.252, 1.261, 1.269, 1.268, 1.261, 1.257, 1.241, 1.223, 1.204, 1.194, 1.191,
                            1.182, 1.192, 1.202, 1.219, 1.239, 1.255, 1.266, 1.271, 1.271, 1.265, 1.258, 1.242, 1.223, 1.205, 1.192, 1.191,
                            1.181, 1.189, 1.199, 1.218, 1.239, 1.254, 1.262, 1.268, 1.268, 1.258, 1.253, 1.241, 1.221, 1.204, 1.191, 1.187,
                            1.179, 1.184, 1.193, 1.211, 1.232, 1.243, 1.254, 1.257, 1.256, 1.253, 1.242, 1.232, 1.216, 1.199, 1.187, 1.183,
                            1.174, 1.179, 1.187, 1.202, 1.218, 1.232, 1.243, 1.246, 1.246, 1.239, 1.232, 1.218, 1.207, 1.191, 1.183, 1.179,
                            1.169, 1.175, 1.181, 1.189, 1.202, 1.218, 1.229, 1.232, 1.232, 1.224, 1.218, 1.207, 1.199, 1.185, 1.181, 1.174,
                            1.164, 1.168, 1.175, 1.179, 1.189, 1.201, 1.209, 1.213, 1.213, 1.209, 1.201, 1.198, 1.186, 1.181, 1.174, 1.173,
                            1.161, 1.166, 1.171, 1.175, 1.179, 1.189, 1.197, 1.198, 1.198, 1.197, 1.196, 1.186, 1.182, 1.175, 1.173, 1.173
                        ]
                    },
                    {
                        "ct": 6500,
                        "table":
                        [
                            1.166, 1.171, 1.173, 1.178, 1.187, 1.193, 1.201, 1.205, 1.205, 1.205, 1.199, 1.191, 1.184, 1.179, 1.174, 1.171,
                            1.166, 1.172, 1.176, 1.184, 1.195, 1.202, 1.209, 1.216, 1.216, 1.213, 1.208, 1.201, 1.189, 1.182, 1.176, 1.171,
                            1.166, 1.173, 1.183, 1.195, 1.202, 1.214, 1.221, 1.228, 1.229, 1.228, 1.221, 1.209, 1.201, 1.186, 1.179, 1.174,
                            1.165, 1.174, 1.187, 1.201, 1.214, 1.223, 1.235, 1.241, 1.242, 1.241, 1.229, 1.221, 1.205, 1.188, 1.181, 1.177,
                            1.165, 1.174, 1.189, 1.207, 1.223, 1.235, 1.242, 1.253, 1.252, 1.245, 1.241, 1.228, 1.211, 1.189, 1.181, 1.178,
                            1.164, 1.173, 1.189, 1.207, 1.224, 1.238, 1.249, 1.255, 1.255, 1.249, 1.242, 1.228, 1.211, 1.191, 1.179, 1.176,
                            1.163, 1.172, 1.187, 1.207, 1.223, 1.237, 1.245, 1.253, 1.252, 1.243, 1.237, 1.228, 1.207, 1.188, 1.176, 1.173,
                            1.159, 1.167, 1.179, 1.199, 1.217, 1.227, 1.237, 1.241, 1.241, 1.237, 1.228, 1.217, 1.201, 1.184, 1.174, 1.169,
                            1.156, 1.164, 1.172, 1.189, 1.205, 1.217, 1.226, 1.229, 1.229, 1.222, 1.217, 1.204, 1.192, 1.177, 1.171, 1.166,
                            1.154, 1.159, 1.166, 1.177, 1.189, 1.205, 1.213, 1.216, 1.216, 1.209, 1.204, 1.192, 1.183, 1.172, 1.168, 1.162,
                            1.152, 1.155, 1.161, 1.166, 1.177, 1.188, 1.195, 1.198, 1.199, 1.196, 1.187, 1.183, 1.173, 1.168, 1.163, 1.162,
                            1.151, 1.154, 1.158, 1.162, 1.168, 1.177, 1.183, 1.184, 1.184, 1.184, 1.182, 1.172, 1.168, 1.165, 1.162, 1.161
                        ]
                    }
                ],
                "luminance_lut":
                [
                    2.236, 2.111, 1.912, 1.741, 1.579, 1.451, 1.379, 1.349, 1.349, 1.361, 1.411, 1.505, 1.644, 1.816, 2.034, 2.159,
                    2.139, 1.994, 1.796, 1.625, 1.467, 1.361, 1.285, 1.248, 1.239, 1.265, 1.321, 1.408, 1.536, 1.703, 1.903, 2.087,
                    2.047, 1.898, 1.694, 1.511, 1.373, 1.254, 1.186, 1.152, 1.142, 1.166, 1.226, 1.309, 1.441, 1.598, 1.799, 1.978,
                    1.999, 1.824, 1.615, 1.429, 1.281, 1.179, 1.113, 1.077, 1.071, 1.096, 1.153, 1.239, 1.357, 1.525, 1.726, 1.915,
                    1.976, 1.773, 1.563, 1.374, 1.222, 1.119, 1.064, 1.032, 1.031, 1.049, 1.099, 1.188, 1.309, 1.478, 1.681, 1.893,
                    1.973, 1.756, 1.542, 1.351, 1.196, 1.088, 1.028, 1.011, 1.004, 1.029, 1.077, 1.169, 1.295, 1.459, 1.663, 1.891,
                    1.973, 1.761, 1.541, 1.349, 1.193, 1.087, 1.031, 1.006, 1.006, 1.023, 1.075, 1.169, 1.298, 1.463, 1.667, 1.891,
                    1.982, 1.789, 1.568, 1.373, 1.213, 1.111, 1.051, 1.029, 1.024, 1.053, 1.106, 1.199, 1.329, 1.495, 1.692, 1.903,
                    2.015, 1.838, 1.621, 1.426, 1.268, 1.159, 1.101, 1.066, 1.068, 1.099, 1.166, 1.259, 1.387, 1.553, 1.751, 1.937,
                    2.076, 1.911, 1.692, 1.507, 1.346, 1.236, 1.169, 1.136, 1.139, 1.174, 1.242, 1.349, 1.475, 1.641, 1.833, 2.004,
                    2.193, 2.011, 1.798, 1.604, 1.444, 1.339, 1.265, 1.235, 1.237, 1.273, 1.351, 1.461, 1.598, 1.758, 1.956, 2.125,
                    2.263, 2.154, 1.916, 1.711, 1.549, 1.432, 1.372, 1.356, 1.356, 1.383, 1.455, 1.578, 1.726, 1.914, 2.119, 2.211
                ],
                "sigma": 0.006,
                "sigma_Cb": 0.00208
            }
        },
        {
            "rpi.contrast":
            {
                "ce_enable": 1,
                "gamma_curve":
                [
                    0, 0,
                    1024, 5040,
                    2048, 9338,
                    3072, 12356,
                    4096, 15312,
                    5120, 18051,
                    6144, 20790,
                    7168, 23193,
                    8192, 25744,
                    9216, 27942,
                    10240, 30035,
                    11264, 32005,
                    12288, 33975,
                    13312, 35815,
                    14336, 37600,
                    15360, 39168,
                    16384, 40642,
                    18432, 43379,
                    20480, 45749,
                    22528, 47753,
                    24576, 49621,
                    26624, 51253,
                    28672, 52698,
                    30720, 53796,
                    32768, 54876,
                    36864, 57012,
                    40960, 58656,
                    45056, 59954,
                    49152, 61183,
                    53248, 62355,
                    57344, 63419,
                    61440, 64476,
                    65535, 65535
                ]
            }
        },
        {
            "rpi.ccm":
            {
                "ccms": [
                    {
                        "ct": 2500,
                        "ccm":
                        [
                            1.70741, -0.05307, -0.65433,
                            -0.62822, 1.68836, -0.06014,
                            -0.04452, -1.87628, 2.92079
                        ]
                    },
                    {
                        "ct": 2803,
                        "ccm":
                        [
                            1.74383, -0.18731, -0.55652,
                            -0.56491, 1.67772, -0.11281,
                            -0.01522, -1.60635, 2.62157
                        ]
                    },
                    {
                        "ct": 2912,
                        "ccm":
                        [
                            1.75215, -0.22221, -0.52995,
                            -0.54568, 1.63522, -0.08954,
                            0.02633, -1.56997, 2.54364
                        ]
                    },
                    {
                        "ct": 2914,
                        "ccm":
                        [
                            1.72423, -0.28939, -0.43484,
                            -0.55188, 1.62925, -0.07737,
                            0.01959, -1.28661, 2.26702
                        ]
                    },
                    {
                        "ct": 3605,
                        "ccm":
                        [
                            1.80381, -0.43646, -0.36735,
                            -0.46505, 1.56814, -0.10309,
                            0.00929, -1.00424, 1.99495
                        ]
                    },
                    {
                        "ct": 4540,
                        "ccm":
                        [
                            1.85263, -0.46545, -0.38719,
                            -0.44136, 1.68443, -0.24307,
                            0.04108, -0.85599, 1.81491
                        ]
                    },
                    {
                        "ct": 5699,
                        "ccm":
                        [
                            1.98595, -0.63542, -0.35054,
                            -0.34623, 1.54146, -0.19522,
                            0.00411, -0.70936, 1.70525
                        ]
                    },
                    {
                        "ct": 8625,
                        "ccm":
                        [
                            2.21637, -0.56663, -0.64974,
                            -0.41133, 1.96625, -0.55492,
                            -0.02307, -0.83529, 1.85837
                        ]
                    }
                ]
            }
        },
        {
            "rpi.sharpen": { }
        }
    ]
}