162306a36Sopenharmony_ci.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
262306a36Sopenharmony_ci
362306a36Sopenharmony_ci.. _image-source-controls:
462306a36Sopenharmony_ci
562306a36Sopenharmony_ci******************************
662306a36Sopenharmony_ciImage Source Control Reference
762306a36Sopenharmony_ci******************************
862306a36Sopenharmony_ci
962306a36Sopenharmony_ciThe Image Source control class is intended for low-level control of
1062306a36Sopenharmony_ciimage source devices such as image sensors. The devices feature an
1162306a36Sopenharmony_cianalogue to digital converter and a bus transmitter to transmit the
1262306a36Sopenharmony_ciimage data out of the device.
1362306a36Sopenharmony_ci
1462306a36Sopenharmony_ci
1562306a36Sopenharmony_ci.. _image-source-control-id:
1662306a36Sopenharmony_ci
1762306a36Sopenharmony_ciImage Source Control IDs
1862306a36Sopenharmony_ci========================
1962306a36Sopenharmony_ci
2062306a36Sopenharmony_ci``V4L2_CID_IMAGE_SOURCE_CLASS (class)``
2162306a36Sopenharmony_ci    The IMAGE_SOURCE class descriptor.
2262306a36Sopenharmony_ci
2362306a36Sopenharmony_ci``V4L2_CID_VBLANK (integer)``
2462306a36Sopenharmony_ci    Vertical blanking. The idle period after every frame during which no
2562306a36Sopenharmony_ci    image data is produced. The unit of vertical blanking is a line.
2662306a36Sopenharmony_ci    Every line has length of the image width plus horizontal blanking at
2762306a36Sopenharmony_ci    the pixel rate defined by ``V4L2_CID_PIXEL_RATE`` control in the
2862306a36Sopenharmony_ci    same sub-device.
2962306a36Sopenharmony_ci
3062306a36Sopenharmony_ci``V4L2_CID_HBLANK (integer)``
3162306a36Sopenharmony_ci    Horizontal blanking. The idle period after every line of image data
3262306a36Sopenharmony_ci    during which no image data is produced. The unit of horizontal
3362306a36Sopenharmony_ci    blanking is pixels.
3462306a36Sopenharmony_ci
3562306a36Sopenharmony_ci``V4L2_CID_ANALOGUE_GAIN (integer)``
3662306a36Sopenharmony_ci    Analogue gain is gain affecting all colour components in the pixel
3762306a36Sopenharmony_ci    matrix. The gain operation is performed in the analogue domain
3862306a36Sopenharmony_ci    before A/D conversion.
3962306a36Sopenharmony_ci
4062306a36Sopenharmony_ci``V4L2_CID_TEST_PATTERN_RED (integer)``
4162306a36Sopenharmony_ci    Test pattern red colour component.
4262306a36Sopenharmony_ci
4362306a36Sopenharmony_ci``V4L2_CID_TEST_PATTERN_GREENR (integer)``
4462306a36Sopenharmony_ci    Test pattern green (next to red) colour component.
4562306a36Sopenharmony_ci
4662306a36Sopenharmony_ci``V4L2_CID_TEST_PATTERN_BLUE (integer)``
4762306a36Sopenharmony_ci    Test pattern blue colour component.
4862306a36Sopenharmony_ci
4962306a36Sopenharmony_ci``V4L2_CID_TEST_PATTERN_GREENB (integer)``
5062306a36Sopenharmony_ci    Test pattern green (next to blue) colour component.
5162306a36Sopenharmony_ci
5262306a36Sopenharmony_ci``V4L2_CID_UNIT_CELL_SIZE (struct)``
5362306a36Sopenharmony_ci    This control returns the unit cell size in nanometers. The struct
5462306a36Sopenharmony_ci    :c:type:`v4l2_area` provides the width and the height in separate
5562306a36Sopenharmony_ci    fields to take into consideration asymmetric pixels.
5662306a36Sopenharmony_ci    This control does not take into consideration any possible hardware
5762306a36Sopenharmony_ci    binning.
5862306a36Sopenharmony_ci    The unit cell consists of the whole area of the pixel, sensitive and
5962306a36Sopenharmony_ci    non-sensitive.
6062306a36Sopenharmony_ci    This control is required for automatic calibration of sensors/cameras.
6162306a36Sopenharmony_ci
6262306a36Sopenharmony_ci.. c:type:: v4l2_area
6362306a36Sopenharmony_ci
6462306a36Sopenharmony_ci.. flat-table:: struct v4l2_area
6562306a36Sopenharmony_ci    :header-rows:  0
6662306a36Sopenharmony_ci    :stub-columns: 0
6762306a36Sopenharmony_ci    :widths:       1 1 2
6862306a36Sopenharmony_ci
6962306a36Sopenharmony_ci    * - __u32
7062306a36Sopenharmony_ci      - ``width``
7162306a36Sopenharmony_ci      - Width of the area.
7262306a36Sopenharmony_ci    * - __u32
7362306a36Sopenharmony_ci      - ``height``
7462306a36Sopenharmony_ci      - Height of the area.
7562306a36Sopenharmony_ci
7662306a36Sopenharmony_ci``V4L2_CID_NOTIFY_GAINS (integer array)``
7762306a36Sopenharmony_ci    The sensor is notified what gains will be applied to the different
7862306a36Sopenharmony_ci    colour channels by subsequent processing (such as by an ISP). The
7962306a36Sopenharmony_ci    sensor is merely informed of these values in case it performs
8062306a36Sopenharmony_ci    processing that requires them, but it does not apply them itself to
8162306a36Sopenharmony_ci    the output pixels.
8262306a36Sopenharmony_ci
8362306a36Sopenharmony_ci    Currently it is defined only for Bayer sensors, and is an array
8462306a36Sopenharmony_ci    control taking 4 gain values, being the gains for each of the
8562306a36Sopenharmony_ci    Bayer channels. The gains are always in the order B, Gb, Gr and R,
8662306a36Sopenharmony_ci    irrespective of the exact Bayer order of the sensor itself.
8762306a36Sopenharmony_ci
8862306a36Sopenharmony_ci    The use of an array allows this control to be extended to sensors
8962306a36Sopenharmony_ci    with, for example, non-Bayer CFAs (colour filter arrays).
9062306a36Sopenharmony_ci
9162306a36Sopenharmony_ci    The units for the gain values are linear, with the default value
9262306a36Sopenharmony_ci    representing a gain of exactly 1.0. For example, if this default value
9362306a36Sopenharmony_ci    is reported as being (say) 128, then a value of 192 would represent
9462306a36Sopenharmony_ci    a gain of exactly 1.5.
95