summaryrefslogtreecommitdiff
path: root/include/ia_imaging/obgrid_public.h
blob: 0e2816eb273844dd8480cf9fb0b7d58ff675b2ee (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
70
71
72
73
74
75
76
77
/*
 * Copyright (C) 2015 - 2017 Intel Corporation.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef _OBGRID_PUBLIC_H_
#define _OBGRID_PUBLIC_H_

/** @file
* CSS-API header file for 2500/Skycam black level correction (optical black, OB) kernel.
*
* This file contains Configuration parameters for grid-based black level correction
*/

#define IA_CSS_OBGRID_TILE_SIZE         16
/** width; max grid size is derived from the max frame size as seen from obgrid perspective (4618x3464) */
#define IA_CSS_OBGRID_MAX_GRID_WIDTH    146
/** height; max grid size is derived from the max frame size as seen from obgrid perspective (4618x3464) */
#define IA_CSS_OBGRID_MAX_GRID_HEIGHT   110
/** size; max grid size is derived from the max frame size as seen from obgrid perspective (4618x3464) */
#define IA_CSS_OBGRID_MAX_GRID_SIZE     (IA_CSS_OBGRID_MAX_GRID_WIDTH * IA_CSS_OBGRID_MAX_GRID_HEIGHT)

/**
 * Description of the struct members:
 *
 * - tile_size: Width and height of a single grid tile.
 *      Valid value is IA_CSS_OBGRID_TILE_SIZE. Any other value is not supported.
 *      This field is provided for future extensions only. The tile size is
 *      given as a number of pixels of the same bayer color. For example, a
 *      16x16 tile size covers a 32x32 area in the image.
 *
 * - x_offset: X value of the top-left grid point relative to ROI.
 * - y_offset: Y value of the top-left grid point relative to ROI.
 *      Valid value is 0. Any other value is not supported.
 *      These fields are provided for future extensions only.
 *
 * - table_width: Width of the grid.
 *      Valid values are between 1 and IA_CSS_OBGRID_MAX_GRID_WIDTH.
 * - table_height: Heigth of the grid.
 *      Valid values are between 1 and IA_CSS_OBGRID_MAX_GRID_HEIGHT.
 *      To cover the entire image, the width and height must be at least
 *      image_size/tile_size + 1. If the grid is not wide or high enough,
 *      then it will be extended by repeating the right or bottom elements.
 *
 * - table_GR: Grid table values for color Gr.
 * - table_R:  Grid table values for color R.
 * - table_B:  Grid table values for color B.
 * - table_GB: Grid table values for color Gb.
 *      Valid values are between 0 and (2^N)-1, where N is the ISP bit width
 *      minus 1. On skycam, N is 11 bits. Each table must contain at least
 *      table_width*table_height valid elements, in row-major order.
 */
struct ia_css_2500_obgrid_kernel_config
{
    int   x_offset;                               /**< X offset of the grid origin */
    int   y_offset;                               /**< Y offset of the grid origin */
    int   tile_size;                              /**< Grid tile size */
    int   table_width;                            /**< Grid width */
    int   table_height;                           /**< Grid height */
    short table_GR[IA_CSS_OBGRID_MAX_GRID_SIZE];  /**< Grid values for Gr */
    short table_R [IA_CSS_OBGRID_MAX_GRID_SIZE];  /**< Grid values for R */
    short table_B [IA_CSS_OBGRID_MAX_GRID_SIZE];  /**< Grid values for B */
    short table_GB[IA_CSS_OBGRID_MAX_GRID_SIZE];  /**< Grid values for Gb */
};

#endif /* _OBGRID_PUBLIC_H_ */