/*************************************************************************************************
// INTEL CONFIDENTIAL Copyright 2017-2025 Intel Corporation All Rights Reserved.
//
// The source code contained or described herein and all documents related to the source code
// ("Material") are owned by Intel Corporation or its suppliers or licensors. Title to the Material
// remains with Intel Corporation or its suppliers and licensors. The Material contains trade secrets
// and proprietary and confidential information of Intel or its suppliers and licensors. The Material is
// protected by worldwide copyright and trade secret laws and treaty provisions. No part of the
// Material may be used, copied, reproduced, modified, published, uploaded, posted, transmitted,
// distributed, or disclosed in any way without Intel's prior express written permission.
//
// No license under any patent, copyright, trade secret or other intellectual property right is
// granted to or conferred upon you by disclosure or delivery of the Materials, either expressly, by
// implication, inducement, estoppel or otherwise. Any license under such intellectual property
// rights must be express and approved by Intel in writing.
//*************************************************************************************************/

#ifndef _SENSOR_FEATURE_H_
#define _SENSOR_FEATURE_H_
#include <initguid.h>
/*!
 * \brief Sensor features enum list
 *
 * \It is the parameter of SNSR_SET_EXT_FEATURE and SNSR_GET_EXT_FEATURE interface
 */
typedef enum __SNSR_EXT_FEATURE_
{
    SNSR_EXT_FEATURE_BRIGHTNESS,                            /*!< Soc sensor or external ISP Feature. Brightness. */
    SNSR_EXT_FEATURE_CONSTRAST,                             /*!< Soc sensor or external ISP Feature. Contrast. */
    SNSR_EXT_FEATURE_SATURATION,                            /*!< Soc sensor or external ISP Feature. Sataration. */
    SNSR_EXT_FEATURE_SHARPNESS,                             /*!< Soc sensor or external ISP Feature. Sharpness. */
    SNSR_EXT_FEATURE_HUE,                                   /*!< Soc sensor or external ISP Feature. Hue. */
    SNSR_EXT_FEATURE_BANDING,                               /*!< Soc sensor or external ISP Feature. Banding. */
    SNSR_EXT_FEATURE_WB,                                    /*!< Soc sensor or external ISP Feature. White Balance. */
    SNSR_EXT_FEATURE_EFFECT,                                /*!< Soc sensor or external ISP Feature. Effect. */
    SNSR_EXT_FEATURE_SCENE,                                 /*!< Soc sensor or external ISP Feature. Scence mode. */
    SNSR_EXT_FEATURE_BRACKET,                               /*!< Soc sensor or external ISP Feature. AE Bracket. */
    SNSR_EXT_FEATURE_BACKLIGHT_COMPENSATION,                /*!< Soc sensor or external ISP Feature. Bracket Compensation. */
    SNSR_EXT_FEATURE_EXPOSURE,                              /*!< Soc sensor or external ISP Feature. Exposure time. */
    SNSR_EXT_FEATURE_GAIN,                                  /*!< Soc sensor or external ISP Feature. Gain. */
    SNSR_EXT_FEATURE_ISO,                                   /*!< Soc sensor or external ISP Feature. ISO. */
    SNSR_EXT_FEATURE_FOCUS,                                 /*!< Soc sensor or external ISP Feature. Focus. */
    SNSR_EXT_FEATURE_FACE_DETECTION,                        /*!< Soc sensor or external ISP Feature. Face deteaction. */
    SNSR_EXT_FEATURE_METERING,                              /*!< Soc sensor or external ISP Feature. AE metering. */
    SNSR_EXT_FEATURE_AE,                                    /*!< Soc sensor or external ISP Feature. AE enable. */
    SNSR_EXT_FEATURE_AE_ROI,                                /*!< Soc sensor or external ISP Feature. AE ROI enable. */
    SNSR_EXT_FEATURE_AE_ROI_DATA,                           /*!< Soc sensor or external ISP Feature. AE ROI data. */
    SNSR_EXT_FEATURE_DVS,                                   /*!< Soc sensor or external ISP Feature. DVS. */
    SNSR_EXT_FEATURE_DIGITAL_ZOOM,                          /*!< Soc sensor or external ISP Feature. Digital Zoom. */
    SNSR_EXT_FEATURE_JPEG,                                  /*!< Soc sensor or external ISP Feature. Jpeg encode. */
    SNSR_EXT_FEATURE_SNAP_DURING_VIDEO,                     /*!< Soc sensor or external ISP Feature. SDV. */
    SNSR_EXT_FEATURE_STATE_STRUCT,                          /*!< Soc sensor or external ISP Feature. Status Structue. */
    SNSR_EXT_FEATURE_SENSOR_MODE,                           /*!< Soc sensor or external ISP Feature. Sensor Mode. */
    SNSR_EXT_FEATURE_CONTEXT_CONFIG,                        /*!< Soc sensor or external ISP Feature. Set one context resolution/format, and return back a virtual id for each stream. */
    SNSR_EXT_FEATURE_CONTEXT_ENABLE,                        /*!< Soc sensor or external ISP Feature. DVS. */
    SNSR_EXT_FEATURE_AE_AWB_LOCK,                           /*!< Soc sensor or external ISP Feature. AE, AWB lock. */
    SNSR_EXT_FEATURE_AE_STATUS,                             /*!< Soc sensor or external ISP Feature. AE status. */
    SNSR_EXT_FEATURE_AWB_STATUS,                            /*!< Soc sensor or external ISP Feature. AWB status. */
    SNSR_EXT_FEATURE_AF_1ST_STATUS,                         /*!< Soc sensor or external ISP Feature. AF first circle status. */
    SNSR_EXT_FEATURE_AF_2ND_STATUS,                         /*!< Soc sensor or external ISP Feature. AF second circle status. */
    SNSR_EXT_FEATURE_AUTO_FLASH,                            /*!< Soc sensor or external ISP Feature. Auto flash function. */
    SNSR_EXT_FEATURE_MIPICLK,                               /*!< Raw, Soc sensor or external ISP Feature. Bit rate per lane. */
    SNSR_EXT_FEATURE_TESTMODE,                              /*!< Raw sensor Feature. Sensor feature test mode (eg. color bar). */
    SNSR_EXT_FEATURE_LOCK_PARAMS,                           /*!< Raw sensor Feature. Sensor feature lock params (eg. exposure, gain). */
    SNSR_EXT_FEATURE_PRIVACY_LED,                           /*!< Raw sensor Feature. Sesnor privacy LED (turns on when camera active). */
    SNSR_EXT_FEATURE_ROI,                                   /*!< Raw sensor Feature. Region of interest params. */
    SNSR_EXT_FEATURE_STROBE_FRAME_PATTERN,                  /*!< Raw IR sensor Feature. Strobe frame pattern. */
    SNSR_EXT_FEATURE_RS_IR,                                 /*!<RAW IR sensor Feature. Rolling shutter IR sensor>.*/
    SNSR_EXT_FEATURE_IR_LED_INTENSITY,                      /*!<RAW IR sensor Feature. get IR LED intensity>.*/
    SNSR_EXT_FEATURE_VHDRMODE,                              /*! Feature for VHDR specific workarounds*/
    SNSR_EXT_FEATURE_EOF,
    SNSR_EXT_FEATURE_EMBDATA_MIRROR,                        /*! sensor embedded data mirror property*/
    SNSR_EXT_FEATURE_EMBDATA_BYTES,                         /*! sensor embedded line data bytes*/
    SNSR_EXT_FEATURE_PDAF_MIRROR,                           /*! sensor pdaf data mirror property*/
    SNSR_EXT_FEATURE_TRIGGER_MODE,                          /*! sensor operation mode.*/
    SNSR_EXT_FEATURE_PRIVACY_MOED_CB,                       /*! sensor privacy mode callback from camera driver. (CVF Only)*/
    SNSR_EXT_FEATURE_CVF_AVAILABILITY,                      /*! sensor cvf availability. */
    SNSR_EXT_FEATURE_CVF_POWER,                             /*! sensor power state used for privacy mode. */
    SNSR_EXT_FEATURE_JVS_PIPE,                              /*! sensor using joint video and still pipe for IQ.(IPU6 only)*/
    SNSR_EXT_FEATURE_JVS_BISP_BOUNDARY,                     /*! JVS and BISP boundary (IPU6 only)*/
    SNSR_EXT_FEATURE_BURST_CAPTURE_MODE,                    /*! sensor burst capture mode for Tobii. */
    SNSR_EXT_FEATURE_FRAME_COUNTER,                         /*! sensor frame count. */
    SNSR_EXT_FEATURE_CAMERA_MASK,                           /*! sensor capability of CSE camera mask privacy support. */
    SNSR_EXT_FEATURE_RECOVER_RESOLUTION,                    /*! Sensor resolution recovery when exiting privacy mode. (CVF only)*/
    SNSR_EXT_FEATURE_FLIP_MOED_CB,                          /*! sensor flip mode callback from camera driver. */
    SNSR_EXT_FEATURE_HDMI_STATUS_UPDATE,                    /*! LT6911UXC HDMI plug in status update callback from camera driver*/
    SNSR_EXT_FEATURE_CVF_SUPPORT,                           /*! sensor capability of cvf support*/
    SNSR_EXT_FEATURE_PRIVACY_SHUTTER_SUPPORT,               /*! sensor capability of AE-Histogram-based hardware privacy shutter support*/
    SNSR_EXT_FEATURE_SENSOR_STROBE,                         /*! Flash is triggered by sensor strobe pin instead of rvp*/
    SNSR_EXT_FEATURE_VC_ID,                                 /*! senosr virtual channel id*/
    SNSR_EXT_FEATURE_GET_DEFAULT_VTS,                       /*! sensor default VTS value */
    SNSR_EXT_FEATURE_EMBDATA_INFO,                          /*! sensor embedded data information */
    SNSR_EXT_FEATURE_RGB,                                   /*! background color in privacy mode,it's a COLORREF value such as 0x89 | 0x89 << 8 | 0x89 <<16;*/
    SNSR_EXT_FEATURE_MODE_SWITCH,                           /*! sensor cap of mode switching */
    SNSR_EXT_FEATURE_MODE_NOTIFICATION,                     /*! advanced sensor mode notification */
    SNSR_EXT_FEATURE_LENS_INFO,                             /*! sensor lens information for distingush different sensor modules */
    SNSR_EXT_FEATURE_SENSOR_SECOND_SOURCE_SUPPORT,          /*! sensor capability of second source support*/
    SNSR_EXT_FEATURE_USB_BRIDGE_ACTIVE,                     /*! Optional feature to active USB brige through reg r/w */
    SNSR_EXT_FEATURE_GET_SNR_MODE_BOUNDARY,                 /*! Optional feature to for cross snr mode UC*/
    SNSR_EXT_FEATURE_SENSOR_EXPOUSE_PROPERTY,               /*!.sensor expouse and digital gain set rule*/
    SNSR_EXT_FEATURE_AESETTING_TOCVCHIP,                    /*! Optional feature for CLS(camera light sensing): Pass AE settings from IPU stack to CV chip */
    SNSR_EXT_FEATURE_STROBE_PULSE,                          /*! Optional feature, iacamera can use this to get Global shutter IR sensor flash pattern by sensor register query*/
    SNSR_EXT_FEATURE_PRIVACY_STATUS_NOTIFICATION,           /*! Optional feature for privacy status notification from IPU to WE2 */
    SNSR_EXT_FEATURE_NUM,                                   /*! Do not add new ext ID. suggest to use GUID definition */
} SNSR_EXT_FEATURE_ID;

/*!
 * \Sensor features GUID list for SNSR_GET_FEATURE interface
 *
 * This section defines GUIDs used to query specific sensor features.
 */

// For querying if ACS is supported for this sensor device.
// {B2A20CF6-D3C8-40FC-A788-A70E5D000092}
DEFINE_GUID(GUID_SNR_FEATURE_ACS_SUPPORT, 0xb2a20cf6, 0xd3c8, 0x40fc, 0xa7, 0x88, 0xa7, 0xe, 0x5d, 0x0, 0x0, 0x92);

// For querying if customized privacy icon is requested for this sensor device.
// {E3F1A2B4-5D6C-4E7F-9A8B-C1D2E3F4A5B6}
DEFINE_GUID(GUID_SNR_FEATURE_CUSTOM_PRIVACY_IMAGE, 0xe3f1a2b4, 0x5d6c, 0x4e7f, 0x9a, 0x8b, 0xc1, 0xd2, 0xe3, 0xf4, 0xa5, 0xb6);

/*!
* \brief Soc Sensor or External ISP features Color effect
*/
typedef enum __FEATRUE_COLOR_EFFECTS
{
    EFFECT_NORNAL,                                          /*!< Color effect. Normal. */
    EFFECT_ALIEN,                                           /*!< Color effect. Alien. */
    EFFECT_ANTIQUE,                                         /*!< Color effect. Antique. */
    EFFECT_BLACK_WHITE,                                     /*!< Color effect. Black white. */
    EFFECT_EMBOSS,                                          /*!< Color effect. Emboss. */
    EFFECT_EMBOSS_COLORED,                                  /*!< Color effect. Emboss colored. */
    EFFECT_GRAYSCALE,                                       /*!< Color effect. Grayscale. */
    EFFECT_NEGATIVE,                                        /*!< Color effect. Negative. */
    EFFECT_BLUISH,                                          /*!< Color effect. Bluish. */
    EFFECT_GREENISH,                                        /*!< Color effect. Greensish. */
    EFFECT_REDISH,                                          /*!< Color effect. Redish. */
    EFFECT_POSTERIZE1,                                      /*!< Color effect. Posterize1. */
    EFFECT_POSTERIZE2,                                      /*!< Color effect. Posterize2. */
    EFFECT_SEPIA1,                                          /*!< Color effect. Sepia1. */
    EFFECT_SEPIA2,                                          /*!< Color effect. Sepia2. */
    EFFECT_SKETCH,                                          /*!< Color effect. Sketch. */
    EFFECT_SOLARIZE,                                        /*!< Color effect. Solarize. */
    EFFECT_FOGGY,                                           /*!< Color effect. Foggy. */
    EFFECT_NUM,                                             /*!< Color effect. Number of Effect. */
} SR_COLOR_EFFECT;

/*!
* \brief Soc Sensor or External ISP features Scene mode
*/
typedef enum __FEATUER_SCENE_MODE
{
    SCENE_AUTO,                                             /*!< Scene Mode. Auto. */
    SCENE_NORMAL,                                           /*!< Scene Mode. Normal. */
    SCENE_PORTRAIT,                                         /*!< Scene Mode. PORTRAIT. */
    SCENE_LANDSCAPE,                                        /*!< Scene Mode. LANDSCAPE. */
    SCENE_SPORT,                                            /*!< Scene Mode. SPORT. */
    SCENE_CLOSEUP,                                          /*!< Scene Mode. CLOSEUP. */
    SCENE_NIGHT,                                            /*!< Scene Mode. NIGHT. */
    SCENE_TWILIGHT,                                         /*!< Scene Mode. TWILIGHT. */
    SCENE_BACKLIT,                                          /*!< Scene Mode. BACKLIT. */
    SCENE_HIGH_SENSITIVITY,                                 /*!< Scene Mode. HIGH_SENSITIVITY. */
    SCENE_NIGHT_PORTRAIT,                                   /*!< Scene Mode. NIGHT_PORTRAIT. */
    SCENE_BEACH,                                            /*!< Scene Mode. BEACH. */
    SCENE_DOCUMENT,                                         /*!< Scene Mode. DOCUMENT. */
    SCENE_PARTY,                                            /*!< Scene Mode. PARTY. */
    SCENE_FIREWORKS,                                        /*!< Scene Mode. FIREWORKS. */
    SCENE_SUNSET,                                           /*!< Scene Mode. SUNSET. */
    SCENE_NUM,
} SR_SCENE_MODE;

/*!
* \brief Soc Sensor or External ISP features white balance
*/
typedef enum __FEATUER_WHITE_BALANCE
{
    WB_AUTO,                                                /*!< White Balance. Auto. */
    WB_MEASURE,                                             /*!< White Balance. Measure. */
    WB_MANUAL,                                              /*!< White Balance. Manual. */
    WB_D75,                                                 /*!< White Balance. D75. */
    WB_D65,                                                 /*!< White Balance. D65. */
    WB_D50,                                                 /*!< White Balance. D50. */
    WB_CWF,                                                 /*!< White Balance. CWF. */
    WB_A,                                                   /*!< White Balance. A. */
    WB_HORIZON,                                             /*!< White Balance. Horizon. */
    WB_WHITE_POINT,                                         /*!< White Balance. White Point. */
    WB_NUM,
} SR_WHITE_BALANCE;

/*!
* \brief Soc Sensor or External ISP features Bracket
*/
typedef enum __FEATUER_BRACKET
{
    BRACKET_BRIGHTNESS,                                    /*!< AE Bracket. Brightness. */
    BRACKET_EXPOSURE,                                      /*!< AE Bracket. Exposure. */
    BRACKET_ISO,                                           /*!< AE Bracket. ISO. */
    BRACKET_AWBQX,                                         /*!< AE Bracket. AWBQX. */
    BRACKET_AWBQY,                                         /*!< AE Bracket. AWBQY. */
    BRACKET_CONTRAST,                                      /*!< AE Bracket. Contrast. */
    BRACKET_AF_RELATIVE,                                   /*!< AE Bracket. AF Relative. */
    BRACKET_LENS,                                          /*!< AE Bracket. Lens. */
    BRACKET_NUM,
} SR_BRACKET;

/*!
* \brief Soc Sensor or External ISP features AE metering
*/
typedef enum __FEATUER_METERING
{
    METERING_AUTO_AVERAGE,                                 /*!< AE Metering. Auto Average. */
    METERING_AUTO_WIDE_CENTER,                             /*!< AE Metering. Auto Wide Center. */
    METERING_AUTO_NARROW_CENTER,                           /*!< AE Metering. Auto Narrow center. */
    METERING_AUTO_SPOT,                                    /*!< AE Metering. Auto Spot. */
    METERING_MANUAL,                                       /*!< AE Metering. Manual. */
    METERING_NUM,
} SR_METERING;

/*!
* \brief Soc Sensor or External ISP features Face detection
*/
typedef enum __FEATUER_FACE
{
    FACE_ON,                                               /*!< Face Detection. On. */
    FACE_SMILE_ON,                                         /*!< Face Detection. Smile On. */
    FACE_OFF,                                              /*!< Face Detection. Off. */
    FACE_NUM
} SR_FACE;

/*!
* \brief Soc Sensor or External ISP features AE mode
*/
typedef enum __FEATUER_AE
{
    AE_NORNAL,                                             /*!< AE mode. Normal. */
    AE_TIME,                                               /*!< AE mode. Time. */
    AE_GAIN,                                               /*!< AE mode. Gain. */
    AE_ISO,                                                /*!< AE mode. ISO. */
    ME_BV,                                                 /*!< AE mode. Manual BV. */
    ME_BV_TIME,                                            /*!< AE mode. Manual BV Timing. */
    ME_BV_GAIN,                                            /*!< AE mode. Manual BV Gain. */
    ME_BV_ISO,                                             /*!< AE mode. Manual BV ISO. */
    ME_TIME_GAIN,                                          /*!< AE mode. Manual Timing Gain. */
    AE_NUM,
} SR_AE;

/*!
* \brief Soc Sensor or External ISP features Flicker
*
* \It should be mapping with KS_POWERLINEFREQUENCY
*/
typedef enum __FEATUER_FLICKER
{
    FLICKER_OFF,                                           /*!< Flicker. Off. */
    FLICKER_FORCE_50HZ,                                    /*!< Flicker. 50Hz. */
    FLICKER_FORCE_60HZ,                                    /*!< Flicker. 60Hz. */
    FLICKER_AUTO,                                          /*!< Flicker. Auto. */
    FLICKER_NUM,
} SR_FLICKER;

/*!
* \brief Soc Sensor or External ISP features DVS enable
*/
typedef enum __FEATUER_DVS
{
    DVS_OFF,                                               /*!< DVS. Off. */
    DVS_ON,                                                /*!< DVS. On. */
    DVS_NUM,
} SR_DVS;

typedef enum __FEATURE_LDC
{
    DISABLE_LDC = 0,
    MSFT_LDC,         // MSFT LDC
    INTEL_LDC         // Intel GDC to run LDC
} SR_LDC;


/*!
* \brief Soc Sensor or External ISP features AE ROI mode
*/
typedef enum __FEATUER_AE_ROI
{
    AE_ROI_DISABLE,                                         /*!< AE ROI. Disable. */
    AE_ROI_FACE,                                            /*!< AE ROI. Face. */
    AE_ROI_USER,                                            /*!< AE ROI. User. */
    AE_ROI_NUM
} SR_AE_ROI;

/*!
* \brief Soc Sensor or External ISP features AE ROI data
*/
typedef struct __FEATURE_AE_AF_ROI__
{
    ULONG x0;                                                /*!< AE AF ROI Data. x0. */
    ULONG y0;                                                /*!< AE AF ROI Data. y0. */
    ULONG x1;                                                /*!< AE AF ROI Data. x1. */
    ULONG y1;                                                /*!< AE AF ROI Data. y1. */
} SR_AEAF_ROI;

/*!
* \brief Soc Sensor or External ISP features Sensor Mode
*/
typedef enum __FEATUER_SENSOR_MODE
{
    SENSOR_PRIMARY,                                          /*!< Sensor Mode for 3D camera case. Primary camera. */
    SENSOR_SECONDARY,                                        /*!< Sensor Mode for 3D camera case. Secondary camera. */
    SENSOR_SIDE_BY_SIDE,                                     /*!< Sensor Mode for 3D camera case. 3D camera mode. */
    SENSOR_NUM,
} SR_SENSOR_MODE;

/*!
* \brief Soc Sensor or External ISP features Output format
*/
typedef enum __OUTFMT__
{
    FMT_YUV422,                                              /*!< Output format. YUV422. */
    FMT_RAW10,                                               /*!< Output format. RAW10. */
    FMT_JPEG,                                                /*!< Output format. JPEG. */
    FMT_NUM
} SR_OUT_FMT;

/*!
* \brief Soc Sensor or External ISP features output streaming information
*/
typedef struct __STREAM_RES__
{
    BOOLEAN Flag;                                            /*!< Sensor Stream Information. Enable. */
    ULONG ChannelID;                                         /*!< Sensor Stream Information, output. Virtual Channel ID. */
    ULONG Width;                                             /*!< Sensor Stream Information, input. Resolution Width. */
    ULONG Height;                                            /*!< Sensor Stream Information, input. Resolution Height. */
    SR_OUT_FMT Format;                                       /*!< Sensor Stream Information, input. Resolution Format. */
} STREAM_RES;

/*!
* \brief Soc Sensor or External ISP features Sensor context
*/
typedef struct __FEATURE_CONTEXT_CONFIG__
{
    SNSR_MODE Context;                                       /*!< Stream context. Sensor Mode. */
    STREAM_RES Main;                                         /*!< Stream context. Sensor Main Streaming. */
    STREAM_RES Auxi;                                         /*!< Stream context. Sensor Auxi Streaming. */
} SR_CONTEXT_CONFIG;

/*!
* \brief Soc Sensor or External ISP features Context enable
*/
typedef struct __FEATURE_CONTEXT_ENABLE__
{
    SNSR_MODE Context;                                       /*!< Stream context enable. Sensor Mode. */
    BOOLEAN Enable;                                          /*!< Stream context enable. Sensor Context enable. */
    ULONG ChannelId;                                         /*!< Stream context enable. Sensor Context virtual channel ID. */
} SR_CONTEXT_ENABLE;

/*!
* \brief Raw IR sensor strobe frame pattern
*/
#define IR_STROBE_ALL_ON           0xFF                      /*!< every frame being illuminated. */
#define IR_STROBE_ALTERNATE_ON_OFF 0xAA                      /*!< every other frame being illuminated. */
#define IR_STROBE_1_ON_3_OFF       0x88                      /*!< 1 frame on, 3 frames off, and repeat. */
#define IR_STROBE_2_ON_2_OFF       0xCC                      /*!< 2 frame on, 2 frames off, and repeat. */
#define IR_STROBE_ALL_OFF          0x00                      /*!< LED off, all frames are dark. */

#endif
