/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved. * * NVIDIA Corporation and its licensors retain all intellectual property * and proprietary rights in and to this software, related documentation * and any modifications thereto. Any use, reproduction, disclosure or * distribution of this software and related documentation without an * express license agreement from NVIDIA Corporation is strictly prohibited. */ /** @file GFIsp.h GFSDK Image Signal Processing API header file. */ #ifndef _GF_ISP__ #define _GF_ISP__ //#define DVS_DEVELOPMENT #include "GFCamera.h" #include "GFVx.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** @addtogroup groupIsp IspAPI Image Signal Processing API As image resolution increases (three megapixels and up), image signal processing inside the imager module becomes complex and costly, and the required bandwidth to transfer processed data to the GPU increases. One solution to this problem is to incorporate image signal processing (ISP1) capabilities inside the GPU, and let the imager send raw Bayer Pattern Data from the CMOS or CCD sensor to the GPU. This reduces bandwidth as ISP programming is easier and much faster compared to having the ISP unit inside the imager. The ISP pipeline consists of various stages of image processing operations to enhance the image so that its digital representation is as close to the natural look as possible. The ISP pipeline consists of the following stages: - Optical Black Compensation (OB) - De-Knee Linearization - Lens Shading Compensation - White Balance Gain Adjustment (M1, M2, M3 statistics gathering) - Bad Pixel Compensation - Noise Reduction - Demosaicing - Edge Enhancement (M4 statistics gathering) - Color Noise Reduction - Color Correction - Gamma Correction - RGB to YUV conversion Besides these pipeline stages, the ISP module also provides a statistics collection mechanism that can be applied to multiple regions of the image. Image statistics information can be used to compute Auto Exposure (AE), Auto White Balance (AWB) and Auto Focus (AF). The GFISPAPI sets up parameters for each pipeline functional block. If needed, the user can also choose to bypass each individual functional block. Once all blocks are set up, image data flows through them automatically. Figure 1, "Block Diagram of the ISP Interface," shows the ISP with respect to other input blocks such as video input (VI) and the encoder preprocessor (EPP). @image html ISPFigure1.bmp Figure 2, "Internal ISP Data Flow," shows the data flow inside the ISP. @image html ISPFigure2.bmp */ /*@{*/ /** @defgroup groupIspCapability ISP Capability Flags These flags represent the various capabilities of the ISP. @see GFISPPROPERTY */ /*@{*/ /** IspAPI property flag: Bayer format input supported. @see GFISPGetProperty() */ #define GFISP_CAP_FORMAT_BAYER 0x00000001 /** IspAPI property flag: Stacked format input supported. @see GFISPGetProperty() */ #define GFISP_CAP_FORMAT_STACKED 0x00000002 /** IspAPI property flag: Three optical black regions supported. @see GFISPGetProperty(), GFISPOBCONTROL */ #define GFISP_CAP_THREE_OB_REGIONS 0x00000004 /** IspAPI property flag: Four optical black regions supported. @see GFISPGetProperty(), GFISPOBCONTROL */ #define GFISP_CAP_FOUR_OB_REGIONS 0x00000008 /** IspAPI property flag: Frame-based optical black supported. @see GFISPGetProperty(), GFISPOBCONTROL */ #define GFISP_CAP_FRAME_OB 0x00000010 /** IspAPI property flag: Line-based optical black supported. @see GFISPGetProperty(), GFISPOBCONTROL */ #define GFISP_CAP_LINE_OB 0x00000020 /** IspAPI property flag: Column-based optical black supported. @see GFISPGetProperty() */ #define GFISP_CAP_COLUMN_OB 0x00000040 /** IspAPI property flag: Deknee (input linearization) supported. @see GFISPGetProperty(), GFISPDEKNEECONTROL */ #define GFISP_CAP_DE_KNEE 0x00000100 /** IspAPI property flag: Lens shading supported. @see GFISPGetProperty(), GFISPLENSSHADING */ #define GFISP_CAP_LENSSHADING 0x00000200 /** IspAPI property flag: White balance supported. @see GFISPGetProperty(), GFISPWBCONTROL */ #define GFISP_CAP_WB 0x00000400 /** IspAPI property flag: Demosaic supported. @see GFISPGetProperty(), GFISPDEMOSAICCONTROL */ #define GFISP_CAP_DEMOSIAC 0x00000800 /** IspAPI property flag: Edge enhancement supported. @see GFISPGetProperty(), GFISPEDGEENHANCECONTROL */ #define GFISP_CAP_EDGEENHANCE 0x00001000 /** IspAPI property flag: Bad pixel concealment supported. @see GFISPGetProperty(), GFISPBADPIXELCONTROL */ #define GFISP_CAP_BADPIXEL 0x00002000 /** IspAPI property flag: Noise reduction supported. @see GFISPGetProperty(), GFISPNOISECONTROL1 */ #define GFISP_CAP_NOISEREDUCTION1 0x00004000 /** IspAPI property flag: Color noise reduction supported. @see GFISPGetProperty(), GFISPNOISECONTROL2 */ #define GFISP_CAP_NOISEREDUCTION2 0x00008000 /** IspAPI property flag: Color correction supported. @see GFISPGetProperty(), GFISPCOLORCORRECTION */ #define GFISP_CAP_COLORCORRECTION 0x00100000 /** IspAPI property flag: Gamma correction supported. @see GFISPGetProperty(), GFISPGAMMACONTROL */ #define GFISP_CAP_GAMMACORRECTION 0x00200000 /** IspAPI property flag: YUV conversion supported. @see GFISPGetProperty(), GFISPYUVCONVERSION */ #define GFISP_CAP_YUVCONVERSION 0x00400000 /** IspAPI property flag: M1 window statistics supported. @see GFISPGetProperty(), GFISPM1WINDOW */ #define GFISP_CAP_M1 0x01000000 /** IspAPI property flag: M2 window statistics supported. @see GFISPGetProperty(), GFISPM2WINDOW */ #define GFISP_CAP_M2 0x02000000 /** IspAPI property flag: M3 window statistics supported. @see GFISPGetProperty(), GFISPM3WINDOW */ #define GFISP_CAP_M3 0x04000000 /** IspAPI property flag: M4 window statistics supported. @see GFISPGetProperty(), GFISPM4WINDOW */ #define GFISP_CAP_M4 0x08000000 /** IspAPI property flag: Negative effect supported. @see GFISPGetProperty() */ #define GFISP_CAP_NEGATIVEEFFECT 0x80000000 /*@}*/ //#define MANUAL_ENABLE_WAIT_FOR_OUTPUT_END 1 /** Struct for ISP version and capabilities. @see GFISPGetProperty */ typedef struct _GFISPPROPERTY { NvU32 size; /**< Actual size of GFISPPROPERTY data structure. */ NvU32 version; /**< Version of GFISPAPI. */ NvU32 cap; /**< Combination of @ref groupIspCapability. Each bit corresponds to one ISP capability. */ NvU32 maxWidth, /**< Maximum supported image width. */ maxHeight; /**< Maximum image height. */ NvU32 supportedScriptVersion; /**< Version of script supported by ISP API. Incorrect script version may cause some API calls to fail. */ } GFISPPROPERTY, *PGFISPPROPERTY; /** Definition of attribute ids for GFISPGetAttribute() and GFISPSetAttribute(). */ typedef enum _GFISPATTRIBUTES { GFISP_ATTR_ENABLE_ISP, /**< The master switch of ISP. 1 = Enable ISP processing, 0 = Disable */ GFISP_ATTR_ENABLE_OB, /**< The master switch for optical black. 1 = Enable OB, 0 = Disable */ GFISP_ATTR_ENABLE_SENSOR_MANUAL_OB, /**< The master switch for SENSOR Manual optical black. 1 = Enable OB, 0 = Disable */ GFISP_ATTR_ENABLE_SENSOR_AUTO_OB, /**< The master switch for SENSOR Auto optical black. 1 = Enable OB, 0 = Disable */ GFISP_ATTR_ENABLE_FOB, /**< Switch for frame based optical black. 1 = Enable frame based optical black, 0 = Disable */ GFISP_ATTR_ENABLE_FOB_SELFRESET, /**< Switch for self-reset for frame based optical black. 1 = Enable (reset every frame), 0 = Disable */ GFISP_ATTR_ENABLE_FOB_TEMPORAL, /**< Switch for temporal filtering for frame based optical black. 1 = Enable temporal filtering, 0 = Disable */ GFISP_ATTR_ENABLE_LOB, /**< Switch for line based optical black. 1 = Enable line based OB, 0 = Disable */ GFISP_ATTR_ENABLE_DEKNEE, /**< Switch for deknee. 1 = Enable deknee, 0 = Disable */ GFISP_ATTR_ENABLE_LENS_SHADING, /**< Switch for lens shading correction. 1 = Enable lens shading correction, 0 = Disable */ GFISP_ATTR_ENABLE_WB, /**< The master switch for white balance. 1 = Enable white balance, 0 = Disable */ GFISP_ATTR_ENABLE_AWB, /**< Switch for built-in automatic white balance. 1 = Automatic/dynamic (real-time) white balance, 0 = Preprogrammed mode white balance */ GFISP_ATTR_AWB_HOLD, /**< Switch to pause automatic white balance. Only effective when GFISP_ATTR_ENABLE_AWB=1. 1 = Start applying current AWB gain value to all future frames, 0 = Restore normal AWB mode */ GFISP_ATTR_ENABLE_DEMOSAIC, /**< Switch for demosaic processing. 1 = Enable demosaic processing, 0 = Disable */ GFISP_ATTR_ENABLE_EDGE_ENHANCE, /**< Switch for edge enhancement. 1 = Enable edge enhancement, 0 = Disable */ GFISP_ATTR_ENABLE_NOISE_CONTROL1, /**< Switch for noise control 1. Noise control method 1 is built in the demosaic unit. 1 = Enable noise control 1, 0 = Disable */ GFISP_ATTR_ENABLE_BAD_PIXEL, /**< Switch for bad pixel concealment. 1 = Enable bad pixel detection and concealment, 0 = Disable */ GFISP_ATTR_ENABLE_COLOR_CORRECTION, /**< Switch for color correction. 1 = Enable color correction, 0 = Disable */ GFISP_ATTR_ENABLE_NOISE_CONTROL2, /**< Switch for noise control 2. Noise control method 2 is built in the color correction unit. 1 = Enable noise control 2, 0 = Disable */ GFISP_ATTR_ENABLE_GAMMA_CORRECTION, /**< Switch for gamma correction. 1 = Enable gamma correction, 0 = Disable */ GFISP_ATTR_ENABLE_YUV_CONVERSION, /**< Switch for RGB to YUV conversion. 1 = Enable RGB-YUV conversion, 0 = Disable */ GFISP_ATTR_ENABLE_NEGATIVE_EFFECT, /**< Switch for negative effect. 1 = Negate whole output image, 0 = Normal image */ GFISP_ATTR_ENABLE_M2, /**< Switch for M2 statistics. 1 = Enable M2 statistics gathering, 0 = Disable */ GFISP_ATTR_ENABLE_M3, /**< Switch for M3 statistics. 1 = Enable M3 statistics gathering, 0 = Disable */ GFISP_ATTR_ENABLE_M4, /**< Switch for M4 statistics. 1 = Enable M4 statistics gathering, 0 = Disable */ GFISP_ATTR_ENABLE_STATS_RAISE, /**< Switch for statistics raise. 1 = Generate raise vector when statistics gathering is complete, 0 = Disable */ GFISP_ATTR_ENABLE_STATS_INT, /**< Switch for statistics interrupt. 1 = Generate interrupt when statistics gathering is complete, 0 = Disable */ GFISP_ATTR_STATS_LINE_END, /**< The line at which statistics gathering is complete. When the line counter reaches STATS_LINE_END, the raise vector and/or interrupt are generated (if enabled). */ #ifdef MANUAL_ENABLE_WAIT_FOR_OUTPUT_END GFISP_ATTR_ENABLE_WAIT_FOR_OUTPUT_END, /**< Temporary used to enable wait for OUTPUT_END. 1 = Wait for output end, 0 = Disable */ #endif /* Special effects */ GFISP_ATTR_ENABLE_EMBOSS, /**< Switch for emboss special effect. 1 = Enable emboss special effect, 0 = Disable */ GFISP_ATTR_ENABLE_SOLARIZE, /**< Switch for solarize special effect. 1 = Enable solarize special effect, 0 = Disable */ GFISP_ATTR_ENABLE_SEPIA, /**< Switch for sepia special effect. 1 = Enable sepia special effect, 0 = Disable */ GFISP_ATTR_ENABLE_MONOCHROME, /**< Switch for monochrome special effect. 1 = Enable monochrome special effect, 0 = Disable */ /* Video settings */ GFISP_ATTR_CONTRAST, /**< Contrast control. Acts as offset for Y data. Range is [0, 128]. */ GFISP_ATTR_BRIGHTNESS, /**< Brightness control. Modifies slope of Y data. Range is [0, 256]. */ GFISP_ATTR_HUE, /**< Hue control. Modifies slope of UV data. Range is [0, 128]. */ GFISP_ATTR_SATURATION_U, /**< Hue control. Modifies slope of UV data. Range is [0, 256]. */ GFISP_ATTR_SATURATION_V, /**< Hue control. Modifies slope of UV data. Range is [0, 256]. */ /* Software 3A control */ GFISP_ATTR_ENABLE_3A_AE, /**< Switch for software auto exposure. 1 = Enable auto exposure and disable sensor exposure, 0 = Disable */ GFISP_ATTR_ENABLE_3A_AWB, /**< Switch for software auto white balance. 1 = Enable auto white balance and disable sensor exposure, 0 = Disable */ GFISP_ATTR_ENABLE_3A_AF, /**< Switch for software auto focus. 1 = Enable auto focus and disable sensor auto focus, 0 = Disable */ GFISP_ATTR_ENABLE_SENSOR_AE, /**< Switch for sensor auto exposure. 1 = Enable sensor auto exposure and disable software expoture, 0 = Disable */ GFISP_ATTR_ENABLE_SENSOR_AWB, /**< Switch for sensor auto white balance. 1 = Enable sensor auto white balance and disable software white balance, 0 = Disable */ GFISP_ATTR_ENABLE_SENSOR_AF, /**< Switch for sensor auto focus. 1 = Enable sensor auto focus and disable software auto focus, 0 = Disable */ GFISP_ATTR_ENABLE_AUTO_CC_VIVIDITY /**< Flag for auto vividity. 1 = Enable auto vividity, 0 = Disable auto vividity*/ } GFISPATTRIBUTES; /** Definition of parameter ids and data structures for #GFISPGetParameter and #GFISPSetParameter. */ typedef enum _GFISPPARAMETERS { GFISP_PARA_TIMING, /**< Get/Set timing parameters. @see GFISPIMGTIMING */ GFISP_PARA_M1WINDOW, /**< Get/Set M1 statistics parameters. @see GFISPM1WINDOW */ GFISP_PARA_M2WINDOW, /**< Get/Set M2 statistics parameters. @see GFISPM2WINDOW */ GFISP_PARA_M3WINDOW, /**< Get/Set M3 statistics parameters. @see GFISPM3WINDOW */ GFISP_PARA_M4WINDOW, /**< Get/Set M4 statistics parameters. @see GFISPM4WINDOW */ GFISP_PARA_OB, /**< Get/Set optical black parameters. @see GFISPOBCONTROL */ GFISP_PARA_DEKNEE, /**< Get/Set deknee parameters. @see GFISPDEKNEECONTROL */ GFISP_PARA_LENSSHADING, /**< Get/Set lens shading parameters. @see GFISPLENSSHADING */ GFISP_PARA_WB, /**< Get/Set white balance parameters. @see GFISPWBCONTROL */ GFISP_PARA_DEMOSAIC, /**< Get/Set demosaic parameters. @see GFISPDEMOSAICCONTROL */ GFISP_PARA_EDGEENHANCE, /**< Get/Set edge enhancement parameters. @see GFISPEDGEENHANCECONTROL */ GFISP_PARA_NOISECONTROL1, /**< Get/Set noise control 1 parameters. @see GFISPNOISECONTROL1 */ GFISP_PARA_NOISECONTROL2, /**< Get/Set noise control 2 parameters. @see GFISPNOISECONTROL2 */ GFISP_PARA_BADPIXEL, /**< Get/Set bad pixel parameters. @see GFISPBADPIXELCONTROL */ GFISP_PARA_COLORCORRECT, /**< Get/Set color correction parameters. @see GFISPCOLORCORRECTION */ GFISP_PARA_GAMMACORRECT, /**< Get/Set gamma correction parameters. @see GFISPGAMMACONTROL */ GFISP_PARA_YUVCONVERT, /**< Get/Set YUV conversion parameters. @see GFISPYUVCONVERSION */ GFISP_PARA_SETMODE, /**< Get/Set ISP mode as specified in script. @see GFISPSETMODE */ GFISP_PARA_3A_AE, /**< Get/Set 3A AE parameters. @see GFISP3AAE */ GFISP_PARA_3A_AWB, /**< Get/Set 3A AWB parameters. @see GFISP3AAWB */ GFISP_PARA_3A_AF , /**< Get/Set 3A AF parameters. @see GFISP3AAF */ GFISP_PARA_3A_PREV_MODE_AWB, GFISP_PARA_3A_AWB_SAT_Y_LIMITS, GFISP_PARA_3A_FRAME_RATE_LOW_LIMIT, GFISP_PARA_3A_FRAME_RATE_HIGH_LIMIT, GFISP_PARA_3A_FRAME_RATE_CHOICE, GFISP_PARA_ISO_SENSITIVITY, /**< Get/Set ISO Sensitivity for 3AAE. */ GFISP_PARA_REDUCE_GAIN_COMPRESS_GAMMA, /**< Reduce/Restore sensor gain and compensate gain change through Gamma curve Compression/Restoration. To be used only with SetParameter fn. @see GFISPGAINGAMMACTRL */ GFISP_PARA_IMAGE_STABILIZATION, /**< Set Image Stabilization. 1 = Enable Image Stabilization, 0 = Disable */ GFISP_PARA_EXPOSURE_CONTROL, /**< Get/Set exposure control parameters. @see GFISPEXPOSURECONTROL */ GFISP_PARA_EXPOSURE, /**< Get/Set exposure manually. @see GFISPMANUALEXPOSURE */ GFISP_ISP_SENSOR_CAPABILITY, /**< ISP 3A Capability >*/ GFISP_PARA_SENSOR_REGISTER /**< SENSOR Register Read wrtie parameter>*/ } GFISPPARAMETERS; /** Number of fractional bits of fixed point parameters. All fixed point parameters are in u8.8 format or 2's complement s7.8 format regardless of internal precision to simplify the interface and keep it consistent across chip revisions. Generic macros have been provided to convert to and from floating point format on systems that support it. For actual range and precision of individual parameters, see the description of that parameter. */ #define GFISP_FIXEDPOINTPARAMETER_FBITS 8 /** Total number of bits of fixed point parameters. All fixed point parameters are in u8.8 format or 2's complement s7.8 format regardless of internal precision to simplify the interface and keep it consistent across chip revisions. Generic macros have been provided to convert to and from floating point format on systems that support it. For actual range and precision of individual parameters, see the description of that parameter. */ #define GFISP_FIXEDPOINTPARAMETER_BITS 16 /** Macro to convert floating point to fixed point. All fixed point parameters are in u8.8 format or 2's complement s7.8 format regardless of internal precision to simplify the interface and keep it consistent across chip revisions. Generic macros have been provided to convert to and from floating point format on systems that support it. For actual range and precision of individual parameters, see the description of that parameter. */ #define GFISP_CONVERT_FLOAT_TO_FIXED_SIGNED(x) ((NvS16)(x * (2 << GFISP_FIXEDPOINTPARAMETER_FBITS))) /** Macro to convert floating point to fixed point. All fixed point parameters are in u8.8 format or 2's complement s7.8 format regardless of internal precision to simplify the interface and keep it consistent across chip revisions. Generic macros have been provided to convert to and from floating point format on systems that support it. For actual range and precision of individual parameters, see the description of that parameter. */ #define GFISP_CONVERT_FLOAT_TO_FIXED_UNSIGNED(x) ((NvU16)(x * (2 << GFISP_FIXEDPOINTPARAMETER_FBITS))) /** Macro to convert fixed point to floating point. All fixed point parameters are in u8.8 format or 2's complement s7.8 format regardless of internal precision to simplify the interface and keep it consistent across chip revisions. Generic macros have been provided to convert to and from floating point format on systems that support it. For actual range and precision of individual parameters, see the description of that parameter. */ #define GFISP_CONVERT_FIXED_TO_FLOAT(x) (((float)x) / (2 << GFISP_FIXEDPOINTPARAMETER_FBITS)) /** Enum for which pixel of the R, G, G, B pattern the active frame starts on. @see GFISPIMGTIMING */ typedef enum { GFISP_RGGB = 0, GFISP_GRBG = 1, GFISP_GBRG = 2, GFISP_BGGR = 3 } GFISP_BAYERPATTERN_SEL; /** Timing Generator Control. Whole timing frame consists of scanned part and idle parts (void periods in between lines and frames). Overall scanned image frame is specified by H_SCAN_SIZE and V_SCAN_SIZE which includes H and V blank periods. Line and pixel counters are set to 1 at transitions of active edge of V and H sync input pulses. Note that coordinate in the whole frame starts with (1,1) instead of (0,0). In horizotal direction, H sync active edge indicates start of scan line and it initiates pixel count from 1 to H_SCAN_SIZE (end of line). After H_SCAN_SIZE pixels are received, the ISP module goes into void period, in which it waits for next arrival of H sync active edge. In practice, H blank period is composed of inactive period during H_SCAN SIZE and the void period in between end of line and start next line. Same applies to vertical direction. Active part (non-blanking part) consists of "optical black" lines at top and bottom of the image frame and left and right of image line, and active lines with active pixels in the middle. @see GFISPGetParameter, GFISPSetParameter */ typedef struct _GFISPIMGTIMING { NvU16 hScanSize, /**< Number of pixel clock periods per scan line (including H blanking). */ vScanSize; /**< Number of line periods per scan frame (including V blanking). */ NvU8 hSyncEdge, /**< Active edge selection for horizontal sync. 0 = positive transition, 1 = negative transition. */ vSyncEdge; /**< Active edge selection for vertical sync. 0 = positive transition, 1 = negative transition. */ GFISP_BAYERPATTERN_SEL bayerSel; /**< Bayer timing format. Specifies which pixel of the R, G, G, B pattern the active frame starts on. */ GFRECT ActiveRect; /**< Active image area. */ GFRECT OutputRect; /**< Output image area. */ } GFISPIMGTIMING, *PGFISPIMGTIMING; /** Enum for the number of samples to take across the M1 statistics window. @see GFISPM1WINDOW */ typedef enum { GFISP_M1SAMPLE32 = 0, GFISP_M1SAMPLE64 = 1 } GFISP_M1_SAMPLE_SEL; /** M1 statistics window control. The GFISPAPI provides four methods that programmers can use to gather statistics on pixel values. Based on the values, the programmer can take appropriate compensating action as needed. The four methods are M1 Window, M2 Window, M3 Window, and M4 Window. This structure describes the M1 Window method, which measures average/ peak pixel values inside the specified area. It returns eight values—four values (RGGB) represent average pixels, and four values represent peak pixels. The measurement result can be used for white balance, either automatically by AWB or manually by the programmer. Refer to the function #GFISPReadMWindowValues() for reading the measured values. @see GFISPGetParameter, GFISPSetParameter, GFISPReadMWindowValues */ typedef struct _GFISPM1WINDOW { GFRECT M1WindowRect; /**< M1 Window size/position. */ GFISP_M1_SAMPLE_SEL horzSampSel, /**< Horizontal sample density. */ vertSampSel; /**< Vertical sample density. */ NvU16 PeakMax; /**< Maximum limit of peak detection. */ NvU16 TemporalFilterStrength; /**< Selects temporal filter coefficients. Valid range is [0-7]. Value 0 effectively turns off temporal filter. */ } GFISPM1WINDOW, *PGFISPM1WINDOW; /** M2 statistics window control. The GFISPAPI provides four methods that programmers can use to gather statistics on pixel values. Based on the values, the programmer can take appropriate compensating action as needed. The four methods are M1 Window, M2 Window, M3 Window, and M4 Window. This structure describes the M2 Window method for gathering statistics on pixel values. The M2 Window method measures the number of pixels at specified ranges inside a specified area. A histogram with four bins is generated. Refer to the function #GFISPReadMWindowValues() for reading the measured values. @see GFISPGetParameter, GFISPSetParameter, GFISPReadMWindowValues, GFISP_ATTR_ENABLE_M2 */ typedef struct _GFISPM2WINDOW { GFRECT M2WindowRect; /**< M2 Window size/pos. */ NvU16 HistBinL1, /**< Cut point of 1st bin. */ HistBinL2, /**< Cut point of 2nd bin. */ HistBinL3; /**< Cut point of 3rd bin. */ NvU16 reserved; } GFISPM2WINDOW, *PGFISPM2WINDOW; /** M3 statistics window control. The GFISPAPI provides four methods that programmers can use to gather statistics on pixel values. Based on the values, the programmer can take appropriate compensating action as needed. The four methods are M1 Window, M2 Window, M3 Window, and M4 Window. This structure describes the M3 Window method for gathering statistics on pixel values, The M3 Window method generates a group of pixel samples from the specified area. Each sub-window generates one 32-bit value. The horizontal interval of M3 sub-windows is derived from M3 window line width divided by M3 window horizontal count, rounded down. The vertical interval of M3 sub-windows is derived from M3 window frame height divided by M3 window vertical count, rounded down. Refer to the function #GFISPReadMWindowValues() for reading the measured values. @see GFISPGetParameter, GFISPSetParameter, GFISPReadMWindowValues, GFISP_ATTR_ENABLE_M3 */ typedef struct _GFISPM3WINDOW { GFRECT M3WindowRect; /**< M3 Window size/pos. */ NvU8 SubWindowCountH, /**< Number of sub-windows in horizontal direction. Can be {16,32,64}. */ SubWindowCountV; /**< Number of sub-windows in vertical direction. Can be {16,32,64}. */ NvU16 SubWindowWidth, /**< Width of sub-windows. Can be {2,4,8,16,32}. */ SubWindowHeight; /**< Height of sub-windows. Can be {2,4,8,16,32}. */ NvU16 reserved; } GFISPM3WINDOW, *PGFISPM3WINDOW; /** M4 statistics window control. The GFISPAPI provides four methods that programmers can use to gather statistics on pixel values. Based on the values, the programmer can take appropriate compensating action as needed. The four methods are M1 Window, M2 Window, M3 Window, and M4 Window. This structure describes the M4 Window method for gathering statistics on pixel values. The M4 Window method takes statistical measurements for auto-focus control. It generates two values for each sub-window. One value represents the high frequency factor inside the sub-window. The other value represents sub-window luminance. There are {1, 2, 3, 4, 6, 9} sub-windows in {1,2,3}x{1,2,3} configurations. SC15 implementation has the following constraints * SubWindowintervalH >= SubWindowWidth * SubWindowintervalV >= SubWindowHeight Refer to the function #GFISPReadMWindowValues() for reading the measured values. @see GFISPGetParameter, GFISPSetParameter, GFISPReadMWindowValues, GFISP_ATTR_ENABLE_M4 */ typedef struct _GFISPM4WINDOW { NvU32 Left, /**< Specifies left of first M4 sub-window. */ Top; /**< Specifies top of first M4 sub-window. */ NvU8 SubWindowCountH, /**< Specifies the number of sub-windows in the horizontal direction. Can be {1,2,3}. */ SubWindowCountV; /**< Specifies the number of sub-windows in the vertical direction. Can be {1,2,3}. */ NvU16 SubWindowWidth, /**< Specifies the width of each sub-window. */ SubWindowHeight; /**< Specifies the height of each sub-window. */ NvU16 SubWindowIntervalH, /**< Specifies the horizontal interval of sub-windows. */ SubWindowIntervalV; /**< Specifies the vertical interval of sub-windows. */ NvU8 CoreLimit; /**< Top limit of noise coring for M4 statistics gathering. Valid range is [0-63]. */ NvU8 reserved; } GFISPM4WINDOW, *PGFISPM4WINDOW; /** Enum for the Optical Black Mode. @see GFISPOBCONTROL */ typedef enum { OB_MODE_FRAME = 0, OB_MODE_AVG_FRAME_LINE = 1, OB_MODE_LINE = 2 } GFISP_OB_MODE_SEL; /** Optical black control. The very first ISP operation to be applied to the input pixel signal is to establish "black" level. This anchors signal activities to a black reference level, or "zero" level. There are two methods of accomplishing optical blacking. One method is performed on each frame and is called Frame-based Optical Blacking (FOB). The other method is performed on each scan line and is called Line-based Optical Blacking (LOB). Under FOB, optical black level can be established in one of two ways--by setting it manually, or more commonly by letting the ISP measure it automatically. In the automatic method the user can specify black regions which surround the active imaging area. The pixel levels from these regions are used to determine the input signal level of reference black, which is mapped to "zero" level in the subsequent pixel processing. LOB is applied to each scan line and is used to detect and compensate for fluctuations in the imager input signal level of reference black. The user can choose to use either FOB, or LOB, or both. Four optical black regions are defined through 16 coordinates. If ISP's OB capability is GFISP_CAP_THREE_OB_REGIONS, then: - Only six of the 16 OB coordinates are used: - OBTopRegionStartV, OBTopRegionHeight, - OBLeftRegionStartH, OBLeftRegionWidth, - OBBottomRegionStartV, OBBottomRegionHeight - Right OB region is not supported. - Top region width is assumed equal to input width. - Left region height is assumed equal to input height. - Bottom region width is assumed equal to input width. - Bottom region is only used if GFISP_ATTR_ENABLE_FOB_SELFRESET is disabled. If ISP's OB capability is GFISP_CAP_FOUR_OB_REGIONS, then all sixteen OB coordinates are used. @see GFISPGetParameter, GFISPSetParameter, GFISP_ATTR_ENABLE_FOB, GFISP_ATTR_ENABLE_FOB_SELFRESET, GFISP_ATTR_ENABLE_FOB_TEMPORAL, GFISP_ATTR_ENABLE_MANUALOB, GFISP_ATTR_ENABLE_LOB */ typedef struct _GFISPOBCONTROL { NvU32 OBTopRegionStartV, OBTopRegionHeight, OBTopRegionStartH, OBTopRegionWidth; NvU32 OBBottomRegionStartV, OBBottomRegionHeight, OBBottomRegionStartH, OBBottomRegionWidth; NvU32 OBLeftRegionStartV, OBLeftRegionHeight, OBLeftRegionStartH, OBLeftRegionWidth; NvU32 OBRightRegionStartV, OBRightRegionHeight, OBRightRegionStartH, OBRightRegionWidth; NvU8 FOBCoef; /**< Filter coefficient of FOB acquisition. Valid range is [0-15]. */ NvU8 TOBCoef; /**< Temporal filter coefficient of FOB temporal filter. Valid range is [0-15]. */ NvU8 LOBWidth; /**< Width used for LOB. Valid values are {2, 4, 8}. */ NvU8 FOBAdjust; /**< Manual adjustment applied to the black level. Valid range is [0, 63]. */ GFISP_OB_MODE_SEL OBMode; /**< Optical black mode vales {frame, avg of frame + line, line } */ } GFISPOBCONTROL, *PGFISPOBCONTROL; /** This structure describes one approximated linear segment for deknee. @see GFISPDEKNEECONTROL */ typedef struct _GFISPDEKNEEENTRY { NvU16 start; /**< Start of a range. */ NvU16 slope; /**< Slope of the linear. Unsigned fixed point format. Valid range is [0, 3 63/64] with precision of 1/64. */ } GFISPDEKNEEENTRY, *PGFISPDEKNEEENTRY; /** Deknee control. Imagers tend to show some degree of non-linearity in their light-to-electric transfer characteristics. Deknee unit attempts to improve the linearity. NVIDIA ISP implements Deknee as a piece-wise linear approximation of up to 16 segments. This structure describes the start and slope values for the Deknee look-up table. The caller may choose to divide the table into 4, 8, or 16 linear segments (4, 8, or 16 entries in the table). @see GFISPGetParameter, GFISPSetParameter, GFISP_ATTR_ENABLE_DEKNEE */ typedef struct _GFISPDEKNEECONTROL { NvU32 nEntries; /**< Number of entries in the pEntry table. Valid values are {4,8,16}. */ GFISPDEKNEEENTRY *pEntries; /**< Deknee entry table. */ } GFISPDEKNEECONTROL, *PGFISPDEKNEECONTROL; /** Lens shading compensation control. An optical lens in front of the imager tends to introduce shading and unevenness in the strength of incident light. It is strongest at the center and diminishes as the distance from the center increases. Actual shading characteristics vary depending on the choice of optics. This structure describes a method for compensating for this shading by applying varying levels of gain to the pixel signal in the reverse function of the shading. The GFISPAPI implements this as a second degree quadratic equation for each color component at H and V: F = 1 + X * (Coef1 + Coef2 *X) @see GFISPGetParameter, GFISPSetParameter, GFISP_ATTR_ENABLE_LENS_SHADING */ typedef struct _GFISPLENSHADING { NvU16 hCenter, /**< Horizontal center point of camera lens. */ vCenter; /**< Vertical center point of camera lens. */ NvU16 rHorzCoef1, /**< First order coefficient for Horizontal Red. Unsigned fixed point format. Valid range is [0, 7 63/64] with precision of 1/64. */ rHorzCoef2; /**< Second order coefficient for Horizontal Red. Unsigned fixed point format. Valid range is [0, 7 63/64] with precision of 1/64. */ NvU16 rVertCoef1, /**< First order coefficient for Vertical Red. Unsigned fixed point format. Valid range is [0, 7 63/64] with precision of 1/64. */ rVertCoef2; /**< Second order coefficient for Vertical Red. Unsigned fixed point format. Valid range is [0, 7 63/64] with precision of 1/64. */ NvU16 gHorzCoef1, /**< First order coefficient for Horizontal Green. Unsigned fixed point format. Valid range is [0, 7 63/64] with precision of 1/64. */ gHorzCoef2; /**< Second order coefficient for Horizontal Green. Unsigned fixed point format. Valid range is [0, 7 63/64] with precision of 1/64. */ NvU16 gVertCoef1, /**< First order coefficient for Vertical Green. Unsigned fixed point format. Valid range is [0, 7 63/64] with precision of 1/64. */ gVertCoef2; /**< Second order coefficient for Vertical Green. Unsigned fixed point format. Valid range is [0, 7 63/64] with precision of 1/64. */ NvU16 bHorzCoef1, /**< First order coefficient for Horizontal Blue. Unsigned fixed point format. Valid range is [0, 7 63/64] with precision of 1/64. */ bHorzCoef2; /**< Second order coefficient for Horizontal Blue. Unsigned fixed point format. Valid range is [0, 7 63/64] with precision of 1/64. */ NvU16 bVertCoef1, /**< First order coefficient for Vertical Blue. Unsigned fixed point format. Valid range is [0, 7 63/64] with precision of 1/64. */ bVertCoef2; /**< Second order coefficient for Vertical Blue. Unsigned fixed point format. Valid range is [0, 7 63/64] with precision of 1/64. */ } GFISPLENSSHADING, *PGFISPLENSSHADING; /** White balance control. White Values RGB component signal levels are balanced to render white objects as white. This is a normalization step of electronic signal of RGB color primaries. Depending on the "color temperature" of the white reference, the relative strength of RGB tri-stimulus values vary. In the electric signal, ER/EG/EB corresponding to the RGB tri-stimulus values are normalized so that white (of 100% strength) is represented by ER = EG = EB = 1. The original image in front of the imager is reproduced only when a display device does precise reverse conversion, which is a purely ideal case. Otherwise, the original image is rendered in different shades of colors depending on the reference white for which the display device is tuned. Gray Values RGB pixel values that represent "gray" objects may be obtained in various ways. For example, a picture frame can be filled with a "white" object, or average values for a large number of pixels can be calculated, or a set of average values collected in many sampling spotscan be used to represent the approximated "gray" object. Gain Factors and White Balance Digital gain values are dedicated to each of the four color channels (R, Gr, Gb, B). Depending on how to set gain factors, there are two ways to use White Balance. A commonly used method is called Dynamic WB, or AWB. Under AWB, gain values are updated automatically by ISP internal AWB control based on the average values and peak values in {R, G1, G2, B} color channels. Refer to #GFISP_PARA_M1WINDOW. - If the frame exposure is high ("Top" level, controlled by ThresholdT2M/ ThresholdM2T), gains are calculated from the average RGrGbB values. - If the frame exposure is low ("Bottom" level, controlled by ThresholdM2B/ThresholdB2M), gains are calculated from peak RGrGbB values. - If the frame exposure is in the middle range, gains are calculated from both average and peak values. Under AWB, the user can send a command to freeze the current gain value by setting GFISP_ATTR_AWB_HOLD to 1. Then the current AWB gain value is applied to all future frames. The other method is called pre-programmed WB or Static WB. It sets preprogrammed gain values and applies them all time. Under this mode, the programmer determines the proper gain values based on the M1/M3 measurement window output. @see GFISPGetParameter, GFISPSetParameter, GFISP_ATTR_ENABLE_WB, GFISP_ATTR_ENABLE_AWB, GFISP_ATTR_AWB_HOLD, GFISPM1WINDOW */ typedef struct _GFISPWBCONTROL { // Static WB. NvU16 RGain, /**< Static gain factor for Red. Only effective when GFISP_ATTR_ENABLE_AWB==0. */ GrGain, /**< Static gain factor for Green on Red. Only effective when GFISP_ATTR_ENABLE_AWB==0. */ BGain, /**< Static gain factor for Blue. Only effective when GFISP_ATTR_ENABLE_AWB==0. */ GbGain; /**< Static gain factor for Green on Blue. Only effective when GFISP_ATTR_ENABLE_AWB==0. */ // Both statis and auto WB. NvU16 TopClipLimit; /**< Lower limit of gain based clipping. Effective for both Static WB and Auto WB. Value 0 effectively turns off Top-clipping. */ // Auto WB. NvU16 PeakRef; /**< White reference level for gain adjustment. Only effective when GFISP_ATTR_ENABLE_AWB==1. */ NvU16 RGainMax, RGainMin; /**< Max/Min Gain factor for Red. Only effective when GFISP_ATTR_ENABLE_AWB==1. */ NvU16 GGainMax, GGainMin; /**< Max/Min Gain factor for Green. Only effective when GFISP_ATTR_ENABLE_AWB==1. */ NvU16 BGainMax, BGainMin; /**< Max/Min Gain factor for Blue. Only effective when GFISP_ATTR_ENABLE_AWB==1. */ NvU16 ThresholdT2M, /**< Top-to-Middle transition level. Only effective when GFISP_ATTR_ENABLE_AWB==1. */ ThresholdM2T, /**< Middle-to-Top transition level. Only effective when GFISP_ATTR_ENABLE_AWB==1. */ ThresholdM2B, /**< Middle-to-Bottom transition level. Only effective when GFISP_ATTR_ENABLE_AWB==1. */ ThresholdB2M; /**< Bottom-to-Middle transition level. Only effective when GFISP_ATTR_ENABLE_AWB==1. */ } GFISPWBCONTROL, *PGFISPWBCONTROL; /** Demosaic mode enum for #GFISPDEMOSAICCONTROL. */ typedef enum { GFISP_DM3X3 = 0, // 3x3 one-shot demosaicing GFISP_DM3X3BPNR = 1, // 3x3 demosaicing/bad-pixel/noise-reduction GFISP_DM5X5 = 2, // 5x5 one-shot demosaicing GFISP_DM5X5BP = 3, // 5x5 demosaicing/bad-pixel GFISP_DM5X5BPNR = 4 // 5x5 demosaicing/bad-pixel/noise-reduction } GFISP_DEMOSAIC_MODE_SEL; /** Demosaic control. This structure controls the demosaic process, which uses 2D interpolation to convert Bayer format R/G/B pixel signals obtained from the imager to generate R/G/B component values. Under the SC15 hardware implementation, the Demosaic unit is built with bad pixel (BP) and noise reduction (NR) control inside, so picking demosaic mode affects bad pixel and noise reduction control. Unless limited by memory bandwidth, programmers should always pick BPNR modes. Otherwise, BP and NR features are not available, even if you try to turn on BP or NR controls with GFISPSetAttribute(). @see GFISPGetParameter, GFISPSetParameter, GFISP_ATTR_ENABLE_DEMOSAIC, GFISPBADPIXELCONTROL, GFISPNOISECONTROL1 */ typedef struct _GFISPDEMOSAICCONTROL { GFISP_DEMOSAIC_MODE_SEL DemosaicMode; /**< Demosaic mode selection. */ } GFISPDEMOSAICCONTROL, *PGFISPDEMOSAICCONTROL; /** Coring limit scaling selection enum for #GFISPEDGEENHANCECONTROL. */ typedef enum { GFISP_GCLIMIT_SCALE_4 = 0, // range [1,4.5] GFISP_GCLIMIT_SCALE_8 = 1, // range [1,8.5] GFISP_GCLIMIT_SCALE_16= 2, // range [1,16.5] GFISP_GCLIMIT_SCALE_32= 3 // range [1,32.5] } GFISP_GCORINGLIMIT_SCALE_SEL; /** Edge enhancement control. This structure controls the edge enhancement process, accomplished by the following: -# Extracting the high frequency component (HF) of the pixel -# Amplifying HF if the extracted value is "large" (that is, coring) -# Adding the amplified HF back to the Y channel of the pixel. In the SC15 implementation, edge enhancement control resides in the Demosaic unit. It is effective only if DM3X3BPNR, DM5X5NR, or DM5X5BPNR demosaic mode is selected. The threshold that's used for coring is not a predetermined fixed value, but instead is adaptive depending on the brightness level. If the pixel surround is bright (more visible), the coring threshold will be larger, which means only stronger edges are enhanced. Weaker edges are considered more noise-prone and therefore are not enhanced. Two control parameters are used to determine the adaptive coring threshold: GCoringLimit and GCoreScaleSel. @see GFISPGetParameter, GFISPSetParameter, GFISP_ATTR_ENABLE_EDGE_ENHANCE */ typedef struct _GFISPEDGEENHANCECONTROL { NvU16 StrengthLevel; /**< How heavily the edge enhancement is applied. Unsigned fixed-point format. Valid range is [0, 3 7/8] with a precision of 1/8, plus [4, 15 1/2] with a precision of 1/2. */ NvU16 GCoringLimit; /**< Minimum coring level. The coring level increases when the pixel's surrounding brightness level goes up. Valid range is [0-63]. */ GFISP_GCORINGLIMIT_SCALE_SEL GCoringScaleSel; /**< Scaling factor of GCoringLimit. Specifies the influence of the brightness level to the coring level. The higher the GCoreScaleSel is, the larger the coring level grows under the same brightness. */ } GFISPEDGEENHANCECONTROL, *PGFISPEDGEENHANCECONTROL; /** Noise Reduction 1 control. There are two noise reduction functions in ISP datapath: -# 3D noise reduction -# False color reduction GFISPNOISECONTROL1 applies to the first method. It resides in Demosaic unit along with edge enhancement. It is effective only if DM3X3BPNR, DM5X5NR, or DM5X5BPNR demosaic mode is selected. This method reduces noise not only in the image plane but also in the intensity domain. In other words, low pass filtering is applied to pixels that have a similar pixel value and are also close to the same location. FilterStrengthLevel defines the filter kernel size on the intensity domain. Larger FilterStrengthLevel generates a smoother but blurry image. @see GFISPGetParameter, GFISPSetParameter, GFISP_ATTR_ENABLE_NOISE_CONTROL1 */ typedef struct _GFISPNOISECONTROL1 { NvU16 FilterStrengthLevel; /**< Weighted average scaling factor. Valid range is [0,7]. */ } GFISPNOISECONTROL1, *PGFISPNOISECONTROL1; /** Noise Reduction 2 control. There are two noise reduction functions in ISP datapath: -# 3D noise reduction -# False color reduction GFISPNOISECONTROL2 applies to the second method. It resides in color correction unit. This method reduces the colorfulness of pixels at shadow region or at edges to de-emphasize color noise and color aliasing effects. HighLimit and TransitionWidth specify the pixels that will undergo the color reduction. If the luminance level of the pixel is larger than (HighLimit + TransitionWidth), the pixel's colorfulness is intact. If the luminance level is smaller than HighLimit, the colorfulness is reduced to a minimum (i.e., no color correction is applied). Pixels with luminance levels between these limits pass through an intermediate colorfulness reduction factor. CCScaleFactor specifies how much color reduction should be applied at edge pixels. Larger CCScaleFactor creates a more noticeable color reduction at the edges. @see GFISPGetParameter, GFISPSetParameter, GFISP_ATTR_ENABLE_NOISE_CONTROL2 */ typedef struct _GFISPNOISECONTROL2 { NvU16 HighLimit; /**< Upper-limit level of noise reduction curve. */ NvU16 TransitionWidth; /**< Width of noise reduction curve. Valid values are {16, 32, 64, 128}. */ NvU16 CCScaleFactor; /**< Slope of noise reduction curve. Unsigned fixed point format. Valid range is [0, 31]. */ } GFISPNOISECONTROL2, *PGFISPNOISECONTROL2; /** Bad pixel control. This structure controls a method to conceal bad pixels. The process resides in the Demosaic unit along with edge enhancement and noise control 1. It is effective only if DM3X3BPNR or DM5X5BPNR demosaic mode is selected. If a pixel value deviates greatly from its surrounding pixels, the pixel is considered to be a bad pixel. The deviation is defined in terms of the percentage of the average value of the surrounding pixels. Two ratio coefficients are used: - If the pixel is within a flat area, LowCoef is used, - If the pixel is at an edge region, UpCoef is used. If the average of the surrounding pixels is lower than DarkLevel, it is considered to be at a shadow region, and DarkLevel instead of the average value will be used to calculate the deviation threshold. @see GFISPGetParameter, GFISPSetParameter, GFISP_ATTR_ENABLE_BAD_PIXEL */ typedef struct _GFISPBADPIXELCONTROL { NvU16 DarkLevel; /**< Bad-pixel dark level. */ NvU16 UpCoef, /**< Coefficient for upper threshold. Unsigned fixed point format. Valid range is [0, 1 7/8] with precision of 1/8. */ LowCoef; /**< Coefficient for lower threshold. Unsigned fixed point format. Valid range is [0, 1 7/8] with precision of 1/8. */ } GFISPBADPIXELCONTROL, *PGFISPBADPIXELCONTROL; /** Color correction control. This structure controls the color correction process. In a strict sense, the color correction module transforms a given color space (based on the optical characteristics of the imager) to a specific color space such as described by the CCIR 601 standard. The color component signals are then handled according to that standard color space from that point on. For high-end cameras, color correction is used to match some sensitive colors such as flesh tone to a desired shade of colors, and is handled primarily by experts who know what they are doing. In practice, there may be a simpler means with fewer control parameters, where the color shade of images is adjusted to suit the viewer's taste. So, gain and offset of R, G, and B pixels are individually adjusted. GFISP color correction consists of 3x3 matrix factors for the camera RGB (cRGB) to standard RGB (sRGB) conversion. Subjective adjustment of color can also be included. - Coefficients on the main diagonal are unsigned. Valid range is [0, 7 255/256]. - Off-diagonal coefficients are unsigned. Valid range is [-7 255/256, 7 255/256]. @see GFISPGetParameter, GFISPSetParameter, GFISP_ATTR_ENABLE_COLOR_CORRECTION */ typedef struct _GFISPCOLORCORRECTION { NvU16 R2R; /**< Red-to-red coefficient. Unsigned fixed point format. Valid range is [0, 7 255/256]. */ NvS16 R2G; /**< Red-to-green coefficient. Signed fixed point format. Valid range is [-7 255/256, 7 255/256]. */ NvS16 R2B; /**< Red-to-blue coefficient. Signed fixed point format. Valid range is [-7 255/256, 7 255/256]. */ NvS16 G2R; /**< Green-to-red coefficient. Signed fixed point format. Valid range is [-7 255/256, 7 255/256]. */ NvU16 G2G; /**< Green-to-green coefficient. Unsigned fixed point format. Valid range is [0, 7 255/256]. */ NvS16 G2B; /**< Green-to-blue coefficient. Signed fixed point format. Valid range is [-7 255/256, 7 255/256]. */ NvS16 B2R; /**< Blue-to-red coefficient. Signed fixed point format. Valid range is [-7 255/256, 7 255/256]. */ NvS16 B2G; /**< Blue-to-green coefficient. Signed fixed point format. Valid range is [-7 255/256, 7 255/256]. */ NvU16 B2B; /**< Blue-to-blue coefficient. Unsigned fixed point format. Valid range is [0, 7 255/256]. */ NvS16 Vividity; /**< Multiplier to boost the diagonal elements. Signed fixed point format. Valid Range [-64/256, 64/256]. */ NvS16 VividityScaleFactor; /**< Multiplier to boost the diagonal elements. Signed fixed point format. Valid Range [-OffDiagona/64, OffDiagonal/64]. */ NvU16 GainStart; /**< Starting Gain for Auto Vividity . */ NvU16 GainEnd; /**< End Gain for Auto Vividity. */ } GFISPCOLORCORRECTION, *PGFISPCOLORCORRECTION; /** This structure describes one approximated linear segment for gamma. @see GFISPGAMMACONTROL */ typedef struct _GFISPGAMMAENTRY { NvU16 inputStart; /**< Input start value of line segment. Valid range is [0, 1023]. */ NvU16 outputStart; /**< Output start value of line segment. Valid range is [0, 255]. */ NvS16 slope; /**< Slope of the line segment. Signed fixed point format. Valid range is [-7 63/64, 7 63/64]. */ NvU16 reserved; } GFISPGAMMAENTRY, *PGFISPGAMMAENTRY; /** Gamma correction control. This structure controls the gamma correction process. Gamma correction applies non-linear characteristics to compensate for the non-linear characteristics of display devices such as cathode ray tubes driven by R, G, B primary color signals. So, in a strict sense, this must be applied to R, G, B signals. In SC15 implementation, gamma correction is approximated using up to 16 line segments. Each line entry must be provided in ascending order (within the input range). @see GFISPGetParameter, GFISPSetParameter, GFISP_ATTR_ENABLE_GAMMA_CORRECTION */ typedef struct _GFISPGAMMACONTROL { NvU32 nEntries; /**< Number of entries in the pEntries table. Valid range is [1-16]. */ GFISPGAMMAENTRY *pEntries; /**< Gamma entry table. */ } GFISPGAMMACONTROL, *PGFISPGAMMACONTROL; /** Y signal range selection enum for #GFISPYUVCONVERSION. */ typedef enum { GFISP_YRANGE_FULL = 0, /**< Range of [0,255]. */ GFISP_YRANGE_NEARFULL = 1, /**< Rage of [1,254] (exclude 00 and FF). */ GFISP_YRANGE_ITU601 = 2 /**< ITU601 standard. */ } GFISP_YRANGE_SEL; /** RGB to YUV conversion control. This structure controls the YUV conversion process, which converts RGB color space to corresponding YUV color space, based on the 3x3 matrix. {Y, U, V} shall have offset values that are not shown in the formula above. */ typedef struct _GFISPYUVCONVERSION { GFISP_YRANGE_SEL YRangeSel; /**< YUV output signal range. */ NvS16 YOff; /**< Y value offset. Valid range is [-128, 127]. */ // 3x3 YUV conversion matrix. // G2Y is unsigned fixed point format. Valid range is [0, 1 255/256]. // R2Y and B2Y are unsigned fixed point format. Valid range is [0, 255/256]. // R2U, G2U, B2U, R2V, G2V, B2V are signed fixed point format. // Valid range is [-255/256, 255/256]. NvS16 R2Y; /**< Red-to-Y coefficient. Unsigned fixed point format. Valid range is [0, 255/256]. */ NvS16 G2Y; /**< Green-to-Y coefficient. Unsigned fixed point format. Valid range is [0, 1 255/256]. */ NvS16 B2Y; /**< Blue-to-Y coefficient. Unsigned fixed point format. Valid range is [0, 1 255/256]. */ NvS16 R2U; /**< Red-to-U coefficient. Signed fixed point format. Valid range is [-255/256, 255/256]. */ NvS16 G2U; /**< Green-to-U coefficient. Signed fixed point format. Valid range is [-255/256, 255/256]. */ NvS16 B2U; /**< Blue-to-U coefficient. Signed fixed point format. Valid range is [-255/256, 255/256]. */ NvS16 R2V; /**< Red-to-V coefficient. Signed fixed point format. Valid range is [-255/256, 255/256]. */ NvS16 G2V; /**< Green-to-V coefficient. Signed fixed point format. Valid range is [-255/256, 255/256]. */ NvS16 B2V; /**< Blue-to-V coefficient. Signed fixed point format. Valid range is [-255/256, 255/256]. */ } GFISPYUVCONVERSION, *PGFISPYUVCONVERSION; /** Isp set mode This structure set ISP parameters to the specified mode, as specidied in the ISP script. */ typedef struct _GFISPSETMODE { NvS32 Mode; /**< Mode number. */ } GFISPSETMODE, *PGFISPSETMODE; /** 3A AE parameter These enum contains 3A AE control parameters. */ typedef enum { GFISP_AE_FRAME_CHOICE_FIXED = 0, /**< fixed frame rate. At lowlux AE will use only digital gain to increase brightness */ GFISP_AE_FRAME_CHOICE_FLEXIBLE = 1 /**< At lowlux AE will increase frame height first (i.e., lower frame rate) to increase brightness Frame height is bounded by FrameHeight at GFISP_AE_SENSORINFO. */ }GFISP_AE_FRAME_CHOICE; typedef enum { GFISP_AE_METERING_CHOICE_EVALUATIVE = 0, /**< calculate luminance average by propriotary algorithm */ GFISP_AE_METERING_CHOICE_SPOT = 1, /**< calculate luminance average from center window only */ GFISP_AE_METERING_CHOICE_CENTER = 2, /**< GFISP_AE_METERING_CHOICE_CENTER: calculate luminance average from weighted sum of center window and whole frame */ GFISP_AE_METERING_CHOICE_MATRIX = 3 /**< calculate luminance average from weighted sum of 3x3 sub-windows */ }GFISP_AE_METERING_CHOICE; typedef enum { GFISP_AE_ANTIFLICKER_CHOICE_50HZ = 0, /**< use AEStep_50Hz in GFISP_AE_SENSORINFO as exposure steps */ GFISP_AE_ANTIFLICKER_CHOICE_60HZ = 1, /**< use AEStep_60Hz in GFISP_AE_SENSORINFO as exposure steps */ GFISP_AE_ANTIFLICKER_CHOICE_MANUAL = 2, /**< use ManualAntiFlickerStep in GFISP_AE_CONTROL1 as exposure steps */ GFISP_AE_ANTIFLICKER_CHOICE_AUTO = 3 /**< enable auto anti-flickering */ }GFISP_AE_ANTIFLICKER_CHOICE; /** 3A AE parameter This structure contains 3A AE parameters. */ typedef struct _GFISP3AAE { NvU16 AETarget; /**< [0..255]. Target average luminance value for AE convergence. Higher value renders brighter image. */ NvU16 AEToleranceIn; /**< [0..255]. Convergence tolerance from AESTATE_OUT to AESTATE_IN */ NvU16 AEToleranceOut; /**< [0..255]. Convergence tolerance from AESTATE_OUT to AESTATE_IN. Normally AEToleranceOut >= AEToleranceIn */ GFISP_AE_FRAME_CHOICE FrameRateChoice; /**< GFISP_AE_FRAME_CHOICE */ GFISP_AE_METERING_CHOICE MeteringChoice; /**< GFISP_AE_METERING_CHOICE */ GFISP_AE_ANTIFLICKER_CHOICE AntiFlickerChoice; /**< GFISP_AE_ANTIFLICKER_CHOICE */ NvU8 ConvergeSpeed; /**< [1..15]. AE convergence speed. 1 being the fastest (immediate update) */ NvS32 Status; /**< 3A AE Status. Read only */ NvU32 ManualAntiFlickerStep; // manual exposure step. Used when AntiFlickerChoice=GFISP_AE_ANTIFLICKER_CHOICE_MANUAL NvS32 CenterWeight, FrameWeight; // weights for MeteringChoice=GFISP_AE_METERING_CHOICE_CENTER NvS32 Metering11, Metering12, Metering13,// weights for MeteringChoice=GFISP_AE_METERING_CHOICE_MATRIX Metering21, Metering22, Metering23, Metering31, Metering32, Metering33; NvU16 AdditionalLumaIncreaseForFlatScene;// [0..255]. give final exposure additional increase if scene is flat. NvU16 BacklightTbright; // [0..255]. Threshold for determining "bright regions" (for backlight checking) NvU16 BacklightTdark; // [0..255]. Threshold for determining "dark regions" (for backlight checking) NvU16 TOverexposed; // [0..255]. Threshold for determining overexposed condition. NvU16 TDark; // [0..255]. Threshold for determining dark condition. NvU8 AutoNoiseControl; /**< Auto Noise Control */ } GFISP3AAE, *PGFISP3AAE; /* Exposure parameter USED for Manual Exposure and Gain settings */ typedef struct _GFISPEXPOSURECONTROL { NvU32 MaxFrameHeight; // longest exposure time allowed. >= DefaultFrameHeight, in unit // of per scanline. // For constant framerate application, set MaxFrameHeight=FrameHeight. NvU32 DefaultFrameHeight; // sensor's default time difference betwee two consecutive VSYNC pulses, // in unit of per scanline. NvU32 DefaultFrameHeightIS; // Limit the frame height corresponding to ET of 1/60 sec NvU16 MaxGain; // [1..128]. max digital gains allowed. Normally set to 2 (=200%) // if anti-flickering is on. If larger sensitivity boost is needed // at lowlux condition set MaxGain to higher value. NvU16 MinGain; //Minimum Exposure Gain in ISP Format NvU16 MaxGainIS; // max digital gain allowed in the case of image stabilization }GFISPEXPOSURECONTROL, *PGFISPEXPOSURECONTROL; /* Manual Exposure and Gain settings */ typedef struct _GFISPMANUALEXPOSURE { NvU32 Exposure; // exposure time NvU32 Gain; // digital gain }GFISPMANUALEXPOSURE, *PGFISPMANUALEXPOSURE; /** 3A AWB parameter This structure contains 3A AWB parameters. */ typedef enum { GFISP_AWB_WBMODE_CLOUDY = 0, /**<: for cloudy conditions (7,000K - 8,000K) */ GFISP_AWB_WBMODE_SUNNY = 1, /**<: for sunny conditions (5,500K - 6,000K) */ GFISP_AWB_WBMODE_FLASH = 2, /**<: for strobe or xenon flashes (~5,000K) */ GFISP_AWB_WBMODE_FLUORESCENT = 3, /**<: for indoor office conditions (~3,000K) */ GFISP_AWB_WBMODE_INCANDESCENT = 4, /**<: for indoor home conditions (~2,800K) */ }GFISP_AWB_WBCUSTOM; typedef enum { GFISP_AWB_COPLEXITY_HIGH = 0, /***/ GFISP_AWB_COPLEXITY_MEDIUM = 1, /***/ GFISP_AWB_COPLEXITY_LOW = 2 /***/ }GFISP_AWB_COMPLEXITY; typedef struct _GFISP3AAWB { NvU8 fWBCustom; // =0 when WB Custom Setting OFF // =1 when WB Custom Setting ON GFISP_AWB_WBCUSTOM WBCustomK; // Choose one of the defined illum class when fWBCustom=1 // GFISP_AWB_WBMODE_CLOUDY = 0, /**<: for cloudy conditions (7,000K - 8,000K) */ // GFISP_AWB_WBMODE_SUNNY = 1, /**<: for sunny conditions (5,500K - 6,000K) */ // GFISP_AWB_WBMODE_FLASH = 2 /**<: for strobe or xenon flashes (~5,000K) */ // GFISP_AWB_WBMODE_FLUORESCENT = 3, /**<: for indoor office conditions (~3,000K) */ // GFISP_AWB_WBMODE_INCANDESCENT = 4, /**<: for indoor home conditions (~2,800K) */ // Must be < NumWBCustom GFISP_AWB_COMPLEXITY ComplexityMode; NvS8 WBShift; /**< Moves up or down illuminant class. For white balance bracketing. */ /**< timing and stability control */ NvU8 ConvergeSpeed; /**< [0..6], 6 being the fastest (immediate update) */ NvU8 ToleranceIn; /**< [0..255], tolerance for convergence. */ NvU8 ToleranceOut; /**< [0..255], threshold for triggering new AWB update. Normally ToleranceIn < ToleranceOut, and both toelrances are small (e.g., 5 to 10). */ NvU32 FilterCoefficient; /**< [0-20] Filter coefficient used for scene change detection . */ NvU32 M3FilterCoefficient; /**< [0-60] Filter coefficient used for temporal low pass filtering of M3 Buffer . */ NvU32 UseM3LPFilter; /**< Flag for M3 Low Pass Filter. 1 = Enable LPF, 0 = Disable */ NvU32 KXYCorrelation; /**< To be used for scene change detection. */ NvS32 Status; /**< 3A AWB Status. Read only */ } GFISP3AAWB, *PGFISP3AAWB; typedef enum { GFISP_AFSTATE_IN = 0, GFISP_AFSTATE_OUT = 1, GFISP_AFSTATE_INIT = 2 }GFISP_AF_STATE; typedef enum { GFISP_AF_TYPE_CENTER = 1, GFISP_AF_TYPE_AUTO_EVALUATE = 2, GFISP_AF_TYPE_FACE_PRIORITY = 3 }GFISP_AF_TYPE; typedef enum { GFISP_AF_MODE_CONTINUOUS = 0, GFISP_AF_MODE_SINGLE = 1 }GFISP_AF_MODE; /** 3A AF parameter This structure contains 3A AF parameters. */ typedef struct _GFISP3AAF { GFISP_AF_STATE Status; /**< 3A AF Status. Read only */ GFISP_AF_MODE Mode; NvU8 Speed; NvU8 LockTillAE; NvU8 LockTillAWB; NvU8 TakeSnapshot; } GFISP3AAF, *PGFISP3AAF; /** ISP 3A Capability. To get the 3A capability for a particular sensor. */ typedef struct _GFISPSENSORCAPABILITY { NvU8 AWBCapability; /***/ NvU8 AECapability; /***/ NvU8 AFCapability; /***/ NvU8 ManualOBCapability; /***/ NvU8 AutoOBCapability; /***/ }GFISPSENSORCAPABILITY, *PGFISPSENSORCAPABILITY; typedef enum { GFISP_SENSOR_I2C_8_BIT_REGISTER = 0, GFISP_SENSOR_I2C_16_BIT_REGISTER = 1, } REGISTERTYPE; typedef struct _GFISPSENSORRWREGISTER { REGISTERTYPE RegisterType; //0: 8-bit register , 1: 16-bit register NvU32 Addr; /**< Address : data read-write address>*/ NvU32 Data; /**< Value of data at that address >*/ }GFISPSENSORRWREGISTER, *PGFISPSENSORRWREGISTER; /** 3A algorithm type These enum contains 3A algorithm type required for checking convergence. */ typedef enum { GFISP_CB_REGISTER_3A_AWB = 0, GFISP_CB_REGISTER_3A_AE = 1, GFISP_CB_REGISTER_3A_AF = 2 } GFISP3ATYPE; /** Enabling or disabling the "gain reduction and gamma compression" property for reducing noise introduced due to high gain * in case of Image Stabilization. */ typedef enum { GFISP_REDUCE_GAIN_COMPRESS_GAMMA_ON, GFISP_REDUCE_GAIN_COMPRESS_GAMMA_OFF } GFISPGAINGAMMACTRL; /** Public exposed ISP API function table. See @ref groupIspFunctions. */ typedef struct _GFISPTABLE { GF_RETTYPE (* ISPGetProperty) ( GFIspHandle ISPHandle, PGFISPPROPERTY pIspProp ); #if defined(DVS_DEVELOPMENT) GF_RETTYPE (* ISPSetup) ( GFIspHandle ISPHandle, GFVxHandle VxHandle, PGFCAMERARESOLUTIONTYPE pCameraResolution, GFVXBLT vxBlt ); #else GF_RETTYPE (* ISPSetup) ( GFIspHandle ISPHandle, PGFCAMERARESOLUTIONTYPE pCameraResolution ); #endif GF_RETTYPE (* ISPSetResolution) ( GFIspHandle ISPHandle, PGFCAMERARESOLUTIONTYPE pCameraResolution ); GF_RETTYPE (* ISPGetAttribute) ( GFIspHandle ISPHandle, GFISPATTRIBUTES aid, NvU32 *attr); GF_RETTYPE (* ISPSetAttribute) ( GFIspHandle ISPHandle, GFISPATTRIBUTES aid, NvU32 attr); GF_RETTYPE (* ISPSetAttributeToDefault) (GFIspHandle ISPHandle, GFISPATTRIBUTES aid); GF_RETTYPE (* ISPGetParameter) ( GFIspHandle ISPHandle, GFISPPARAMETERS pid, NvU32 *pSize, void *pPara); GF_RETTYPE (* ISPSetParameter) ( GFIspHandle ISPHandle, GFISPPARAMETERS pid, NvU32 size, void *pPara); GF_RETTYPE (* ISPSetParameterToDefault) (GFIspHandle ISPHandle, GFISPPARAMETERS pid); GF_RETTYPE (* ISPTriggerMWindowGather) (GFIspHandle ISPHandle); GF_RETTYPE (* ISPReadMWindowValues) ( GFIspHandle ISPHandle, NvS32 szM1Buffer, NvU32 *pM1Buffer, NvS32 szM2Buffer, NvU32 *pM2Buffer, NvS32 szM3Buffer, NvU32 *pM3Buffer, NvS32 szM4Buffer, NvU32 *pM4Buffer); GF_RETTYPE (* ISPOEMScriptFunc) (GFIspHandle ISPHandle, NvU32 ScriptFuncTag, NvU32 size, NvU32 *pBuffer); GF_RETTYPE (* ISP3APeriodicTrigger)(GFIspHandle ISPHandle); GF_RETTYPE (* ISPAeBracketingSetET) (NvS32 mode, NvU32 *pRetExposure, NvS32 *pRetGain); GF_RETTYPE (* ISPAwbBracketingSetIllum) (NvS32 mode, NvU16 *pRetCCT); GF_RETTYPE (* ISPRegister3ACallback) (GFIspHandle ISPHandle, GFISP3ATYPE type, void (*func)(void *), void *pParameter); } GFISPTABLE, *PGFISPTABLE; // Typesafe functions for opening and closing this component GF_RETTYPE GFIspOpen(GFRmHandle hRm, GFIspHandle *phIsp, GF_STATE_TYPE state, GFRmChHandle hCh); void GFIspClose(GFIspHandle *phIsp); /** @defgroup groupIspFunctions ISP Function macros These function macros represent the function calls for GFISPAPI. */ /*@{*/ /** Returns information about the GFISPAPI. @param handle Valid handle to GFISPAPI component. @param pIspProp Pointer to a #GFISPPROPERTY struct. For the sake of future expansion, the caller should put the size of the structure into the #GFISPPROPERTY::size field; GFISPAPI will not fill the structure beyond this size. @retval GF_SUCCESS Success @retval GFISP_ERROR_SIZE_TOO_SMALL Error: size parameter is too small to fit even partial results. This function returns information about the GFISPAPI, including the following: - GFISPAPI module version - ISP capability - ISP limit parameters It is good practice to use this function to query for the API version and capabilities before using other GFISPAPI functions. @see GFISPPROPERTY, groupIspCapability */ #define GFISPGetProperty( handle, pIspProp ) \ ((PGFISPTABLE)handle)->ISPGetProperty( handle, pIspProp ) /** Sets up the ISP API for use with a particular camera. @param handle Valid handle to GFISPAPI component. @param pCameraResolution Pointer to a #GFCAMERARESOLUTIONTYPE structure with valid BayerInfo. @retval GF_SUCCESS Success @retval GFISP_ERROR_BAD_HANDLE #handle is invalid. @retval GFISP_ERROR_ILLEGAL_PARAMETER One or more parameters is NULL or out-of-range. You must call GFISPGetProperty before calling any other ISP API functions, with the exception of GFISPGetProperty. This function initializes ISP to work with a particular resolution of camera. */ #if defined(DVS_DEVELOPMENT) #define GFISPSetup( handle, vxhandle, pCameraResolution, vxBlt ) \ ((PGFISPTABLE)handle)->ISPSetup( handle, vxhandle, pCameraResolution, vxBlt ) #else #define GFISPSetup( handle, pCameraResolution ) \ ((PGFISPTABLE)handle)->ISPSetup( handle, pCameraResolution ) #endif /** Resizes/repositions all windows based on resolution data. @param handle Valid handle to GFISPAPI component. @param pCameraResolution Pointer to a #GFCAMERARESOLUTIONTYPE structure with valid BayerInfo. @retval GF_SUCCESS Success @retval GFISP_ERROR_BAD_HANDLE #handle is invalid. @retval GFISP_ERROR_ILLEGAL_PARAMETER One or more parameters is NULL or out-of-range. @retval GFISP_ERROR_CALL_SETUP_FIRST The application did not call GFISPSetup() prior to calling this function. This function resizes and repositions the windows for several ISP parameters based on the provided BayerInfo struct. Affected parameters are: - Timing - M1-M4 statistics windows - Optical black regions - Lens shading center point */ #define GFISPSetResolution( handle, pCameraResolution ) \ ((PGFISPTABLE)handle)->ISPSetResolution( handle, pCameraResolution ) /** Get an attribute of the GFISPAPI. @param handle Valid handle to GFISPAPI component. @param aid Attribute ID. One of #GFISPATTRIBUTES enumeration type. @param pAttrData Pointer to an #NvU32 to be filled with the attribute value. @retval GF_SUCCESS Success @retval GFISP_ERROR_BAD_HANDLE #handle is invalid. @retval GFISP_ERROR_ILLEGAL_PARAMETER One or more parameters is NULL or out-of-range. @retval GFISP_ERROR_CALL_SETUP_FIRST The application did not call GFISPSetup() prior to calling this function. @see GFISPATTRIBUTES */ #define GFISPGetAttribute( handle, aid, pAttrData ) \ ((PGFISPTABLE)handle)->ISPGetAttribute( handle, aid, pAttrData ) /** Set an attribute of the GFISPAPI. @param handle Valid handle to GFISPAPI component. @param aid Attribute ID. A #GFISPATTRIBUTES enumeration type value. @param attrData Pointer to an #NvU32 to be filled with the attribute value. @retval GF_SUCCESS Success @retval GFISP_ERROR_BAD_HANDLE #handle is invalid. @retval GFISP_ERROR_ILLEGAL_PARAMETER One or more parameters is NULL or out-of-range. @retval GFISP_ERROR_CALL_SETUP_FIRST The application did not call GFISPSetup() prior to calling this function. Under the NVIDIA ISP implementation, certain ISP functions can be turned on or off independent of parameter settings. In most cases, this function simply switches certain ISP functions on or off. To set parameters for specific ISP functions, see GFISPSetParameter(). @see GFISPATTRIBUTES */ #define GFISPSetAttribute( handle, aid, attrData ) \ ((PGFISPTABLE)handle)->ISPSetAttribute( handle, aid, attrData ) /** Set an attribute of the GFISPAPI to its default value. @param handle Valid handle to GFISPAPI component. @param aid Attribute ID. A #GFISPATTRIBUTES enumeration type value. @retval GF_SUCCESS Success @retval GFISP_ERROR_BAD_HANDLE #handle is invalid. @retval GFISP_ERROR_ILLEGAL_PARAMETER One or more parameters is NULL or out-of-range. @retval GFISP_ERROR_CALL_SETUP_FIRST The application did not call GFISPSetup() prior to calling this function. @see GFISPATTRIBUTES */ #define GFISPSetAttributeToDefault( handle, aid ) \ ((PGFISPTABLE)handle)->ISPSetAttributeToDefault( handle, aid ) /** Get parameters for a given ISP functional block. @param handle Valid handle to GFISPAPI component. @param pid Parameter ID. A #GFISPPARAMETERS enumeration type value. @param pSize Pointer to an #NvU32 to be filled with the parameter size. Can be NULL. @param pPara Pointer to a certain GFISPAPI data structure, depending on #pid. Can be NULL. @retval GF_SUCCESS Success @retval GFISP_ERROR_BAD_HANDLE #handle is invalid. @retval GFISP_ERROR_ILLEGAL_PARAMETER One or more parameters is NULL or out-of-range. @retval GFISP_ERROR_CALL_SETUP_FIRST The application did not call GFISPSetup() prior to calling this function. @see GFISPPARAMETERS */ #define GFISPGetParameter( handle, pid, pSize, pPara ) \ ((PGFISPTABLE)handle)->ISPGetParameter( handle, pid, pSize, pPara ) /** Set parameters for a given ISP functional block. @param handle Valid handle to GFISPAPI component. @param pid Parameter ID. A #GFISPPARAMETERS enumeration type value. @param size #NvU32 with actual size of GFISPAPI structure pointed to by #pPara. @param pPara Pointer to a certain GFISPAPI data structure, depending on #pid. @retval GF_SUCCESS Success @retval GFISP_ERROR_BAD_HANDLE #handle is invalid. @retval GFISP_ERROR_ILLEGAL_PARAMETER One or more parameters is NULL or out-of-range. @retval GFISP_ERROR_SIZE_TOO_SMALL #size parameter is too small @retval GFISP_ERROR_CALL_SETUP_FIRST The application did not call GFISPSetup() prior to calling this function. @see GFISPPARAMETERS */ #define GFISPSetParameter( handle, pid, size, pPara ) \ ((PGFISPTABLE)handle)->ISPSetParameter( handle, pid, size, pPara ) /** Set parameters for a given ISP functional block to their default value. @param handle Valid handle to GFISPAPI component. @param pid Parameter ID. A #GFISPPARAMETERS enumeration type value. @retval GF_SUCCESS Success @retval GFISP_ERROR_BAD_HANDLE #handle is invalid. @retval GFISP_ERROR_ILLEGAL_PARAMETER One or more parameters is NULL or out-of-range. @retval GFISP_ERROR_CALL_SETUP_FIRST The application did not call GFISPSetup() prior to calling this function. @see GFISPPARAMETERS */ #define GFISPSetParameterToDefault( handle, pid ) \ ((PGFISPTABLE)handle)->ISPSetParameterToDefault( handle, pid ) /** Triggers MWindow statistics to be gathered on the next frame. @param handle Valid handle to GFISPAPI component. @retval GF_SUCCESS Success @retval GFISP_ERROR_BAD_HANDLE #handle is invalid. @retval GFISP_ERROR_CALL_SETUP_FIRST The application did not call GFISPSetup() prior to calling this function. This function will trigger MWindow statistics to be gathered for any of the M2, M3, M4 statistics that are turned on. M1 statistics are constantly gathered. The statistics will become available at the end of the next frame, and can be read by calling GFISPReadMWindowValues(). Calling GFISPTriggerMWindowGather implicitly sets #GFISP_ATTR_ENABLE_STATS_INT to 1. @see GFISPReadMWindowValues */ #define GFISPTriggerMWindowGather( handle ) \ ((PGFISPTABLE)handle)->ISPTriggerMWindowGather( handle ) /** Reads gathered MWindow statistics if they are ready. @param handle Valid handle to GFISPAPI component. @param szM1Buffer Maximum size of M1Buffer provided by caller (in bytes). The GFISPAPI fills the buffer as much as it can. If zero, the GFISPAPI doesn't fill the M1Buffer. @param pM1Buffer Array of 8 data. First four 32-bit values will be filled with average RGGB pixel values. Next four values will be filled with peak pixel values. Can be NULL, then the GFISPAPI doesn't fill M1Buffer. @param szM2Buffer Maximum size of M2Buffer provided by caller (in bytes). The GFISPAPI fills the buffer as much as it can. If zero, the GFISPAPI doesn't fill the M2Buffer. @param pM2Buffer Array of 16 data. Data is arranged in 32-bit words as follows: {R1, Gr1, Gb1, B1, R2, Gr2, Gb2, B2, ...} Can be NULL, then the GFISPAPI doesn't fill M2Buffer. @param szM3Buffer Maximum size of M3Buffer provided by caller (in bytes). The GFISPAPI fills the buffer as much as it can. If zero, the GFISPAPI doesn't fill the M3Buffer. @param pM3Buffer Array to hold pixel samples. The size matches the M3 Window specification. The data is arranged as follows: {R1, R2, R3, R4}, {Gr1, Gr2, Gr3, Gr4}, {Gb1, Gb2, Gb3, Gb4}, {B1, B2, B3, B4}, {R5, R6, R7, R8}, ... Can be NULL, then the GFISPAPI doesn't fill M3Buffer. @param szM4Buffer Maximum size of M4Buffer provided by caller (in bytes). The GFISPAPI fills the buffer as much as it can. If zero, the GFISPAPI doesn't fill the M4Buffer. @param pM4Buffer Array of 2*M4WindowNumber data. Data is arranged as follows: {HF1, Luma1, HF2, Luma2, ...} Can be NULL, then the GFISPAPI doesn't fill M4Buffer. @retval GF_SUCCESS Success @retval GFISP_ERROR_BAD_HANDLE #handle is invalid. @retval GFISP_ERROR_STATISTICS_NOT_READY M2/M3/M4 statistics not ready. @retval GFISP_ERROR_CALL_SETUP_FIRST The application did not call GFISPSetup() prior to calling this function. Call this function to read the MWindow values gathered by the last call to GFISPTriggerMWindowGather(). The user may either poll for statistics ready by checking the return code, or use the interrupt mechanism to only call GFISPReadMWindowValues once the statistics are ready. After the statistics are gathered, they will remain available for reading until the next call to GFISPTriggerMWindowGather(). M1 statistics are gathered every frame regardless of whether GFISPTriggerMWindowGather() has been called. The user can read the last frame's M1 statistics without ever triggering a gather by passing 0 and NULL for the M2-M4 parameters to GFISPReadMWindowValues(). @see GFISPTriggerMWindowGather */ #define GFISPReadMWindowValues( handle, szM1Buffer, pM1Buffer, \ szM2Buffer, pM2Buffer, szM3Buffer, pM3Buffer, szM4Buffer, pM4Buffer ) \ ((PGFISPTABLE)handle)->ISPReadMWindowValues( handle, szM1Buffer, pM1Buffer, \ szM2Buffer, pM2Buffer, szM3Buffer, pM3Buffer, szM4Buffer, pM4Buffer ) /** Call Oem function defined in ISP script. @param handle Valid handle to GFISPAPI component. @param ScriptFuncTag Function tag used by the script. @param size Number of entries in the buffer pointed to by #pBuffer. @param pBuffer Point to a @param #NvU32 buffer that will be passed to script function. Use it to send parameter to script function and get data back. @retval GF_SUCCESS Success @retval GFISP_ERROR_BAD_HANDLE #handle is invalid. @retval GFISP_ERROR_CALL_SETUP_FIRST The application did not call GFISPSetup() prior to calling this function. Call this function to access script function OemScriptFunc(). */ #define GFISPOEMScriptFunc( handle, ScriptFuncTag, size, pBuffer ) \ ((PGFISPTABLE)handle)->ISPOEMScriptFunc( handle, ScriptFuncTag, size, pBuffer ) /** Trigger periodic software 3A function. @param handle Valid handle to GFISPAPI component. @retval GF_SUCCESS Success @retval GFISP_ERROR_BAD_HANDLE #handle is invalid. @retval GFISP_ERROR_CALL_SETUP_FIRST The application did not call GFISPSetup() prior to calling this function. Call this function at every vertical blank to trigger periodic software 3A function */ #define GFISP3APeriodicTrigger( handle ) \ ((PGFISPTABLE)handle)->ISP3APeriodicTrigger( handle ) /** Exposure Bracketing Function @param handle Valid handle to GFISPAPI component @param mode Range: 0 Exposure value output by AC Algo -1 Less by one-third stop than AC Output 1 More by one-third stop than AC Output @param.pRetExpsoure Expsoure at current mode is returned through this pointer @param pGain Gain at current mode is returned through this pointer @retval GF_SUCCESS or GF_ERROR Call this function three times with different modes each time in order to record images with exposure bracketing */ #define GFISPAeBracketingSetET(handle, mode, pRetExposure, pRetGain) \ ((PGFISPTABLE)handle)->ISPAeBracketingSetET( mode, pRetExposure, pRetGain ) /** White Balance Bracketing Function @param handle Valid handle to GFISPAPI component @param mode Range: 0 Exposure value output by AC Algo -1 Less by one Illuminant than AC Output 1 More by one Illuminant than AC Output @param pRetCCT Color Temprature at current mode is returned through this pointer @retval GF_SUCCESS or GF_ERROR Call this function three times with different modes each time in order to record images with White Balance bracketing */ #define GFISPAwbBracketingSetIllum(handle, mode, pRetCCT) \ ((PGFISPTABLE)handle)->ISPAwbBracketingSetIllum( mode, pRetCCT ) /** Register callback function for the convergence of software Auto White balance @param handle Valid handle to GFISPAPI component. @param algoType whether AWB, AE or AF @param func Pointer to the callback function @param pParameter pointer to the argument of function call @retval GF_SUCCESS Success @retval GFISP_ERROR_BAD_HANDLE #handle is invalid. @retval GFISP_ERROR If invalid function pointer is passed Call this function when application wants to know whether the auto white balance algorithm is converged or not. When algorithm converges it calls the function func which is registered as callback function. */ #define GFISPRegister3ACallback(handle, algoType, func, pParameter) \ ((PGFISPTABLE)handle)->ISPRegister3ACallback( handle, algoType, func, pParameter ) /*@}*/ // End function macros /*@}*/ // End ISP API Doxygen #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* _GF_ISP__ */