STATE Variables

STATE Variables

The following table lists the so-called STATE variables implemented in the ApBase library, DevWare, and related software. STATE variables control the operation of the software, mainly the image processing. STATE variables can be set by commands or Python statements in initialization files, and by various APIs supported by the software such as the ApBase API, the DevWare COM interface, and the DevWare plug-in interface. The data type of a variable is either integer or string. (Non-integer numbers are string-valued for the purposes of the APIs.) Most variables have a corresponding control on the DevWare user interface (UI).

The ini file command to set a STATE variable is STATE= variable [(0 | 1)], value. The value is interpreted as an integer or a string according to the name of the variable.
"[(0 | 1)]" is the optional parameter for those STATE variables that on duplicated per-context; see below under "per-Context variables".

The Python functions to get and set STATE variables are apbase.getstate( variable ), and apbase.setstate( variable , value ). The return value from getstate() will be an integer or a string according to the specific variable. The data type of the value passed to setstate() must be int or str according to the variable.

It is possible to set a variable with a name of your choosing. The software will store the value, which can be retrieved later. This is useful with software extensions such as DevWare plug-ins and user-defined toolbars. For example, parameter values used by a plug-in could be set in ini files like native DevWare settings. The STATE= ini command will always create a string-valued variable if the variable is not yet defined. The Python setstate() function can create either a integer-valued or string-valued variable depending on the data type of the value parameter.

Note on per-Context variables; some ColorPipe variables are duplicated per-context - those are noted by "Duplicated per-context." in their description.
Their value can optionally be set per-context only via an INI file version; the format is STATE =  variable (0 | 1), value.
For Python functions and through ApBase, the STATE value is set per the sensor's currently active context.

 

2 Floating-point values

STATE Variable Name, Description

Value

STATE Variable Name, Description

Value

Display Zoom Percent
Corresponds to Zoom In/Out buttons on the DevWare toolbar. Value is zoom factor * 100. The following settings are special cases: 12 will be 12.5% (1/8 exactly), 6 will be 6.25% (1/16 exactly) and 3 will be 3.125% (1/32 exactly).

3 to 1600 (default = 100)

Reset Image Fifo
Reset the image FIFOs on the demo board.

 0 or 1

Filter
Corresponds to Filter selection on the Data Interpretation page.

Note that the value(s) presented on the Data Interpretation page change depending on the output format in use. For example, Bayer as compared to YCBCR as compared to SuperCell - all will have a different list of possible Filter choices.
This in turn changes the corresponding value for the "Filter" state.

The method of determining the state value is to use DevWare to set the output format that you're using, and then go to the "Data Interpretation" dialog in the "Control" dialog.
Starting at 0, count down until you find the filter that you want to apply.

For example, if your output format is Bayer, selecting a Filter state of "Bayer Grayscale" would be 3.

Note; the set of Filters can be set via the "CFA Pattern" STATE command, listed below.

0 to n

Subimage
Which subimage to display if there are more than one. 0 means main image, 1 means post-view image, 2 means thumbnail image.

0, 1 or 2

Current Subimage
Returns subimage is being displayed if there are more than one. 0 means main image, 1 means post-view image, 2 means thumbnail image.

0, 1 or 2

Subimage Merge
Whether to inset the subimage in the main image.

0 or 1

X Offset
Sets the Bayer pattern horizontal offset. 0 means first column is G1/B, 1 means R/G2. Corresponds to Horizontal skip checkmark on the Data Interpretation page.

0 or 1

Y Offset
Sets the Bayer pattern vertical offset. 0 means first row is G1/R, 1 means B/G2. Corresponds to Vertical skip checkmark on the Data Interpretation page.

0 or 1

Auto Offset
Set X Offset and Y Offset automatically. Corresponds to Automatic checkmark on the Data Interpretation page.

0 or 1

Gb-B Swap
Swap Gb and B pixels in a Bayer image.

0 or 1

Byte Swap
Swap adjacent bytes in the input image.

0 or 1

True Black Enable
Enable black level (a.k.a. pedestal) subtraction from raw Bayer data. Corresponds to Subtract True Black controls on the Data Interpretation page.

0 :light_bulb_off:, 1 :light_bulb_on:, or 2 (automatic)

True Black Level
Black level, as a fraction of the True Black Scale. Normally loaded automatically from sensor registers. Corresponds to True Black value on the Data Interpretation page.

Integer

True Black Scale
Usually either 1024 or 4096, indicates whether True Black Level is expressed as a 10-bit or 12-bit value.

Integer

Active True Black
Black level scaled to the decompressed image depth.

Integer

ALTM Enable
Enable Adaptive Local Tone Mapping algorithm. This intelligently reduces an HDR image of 16 bits or more to 12 bits for the software color pipeline.

Note; use "HDR" version of STATE variables when ALTM is enabled. For example, "HDR Black Correct" instead of "Black Correct".

Duplicated per-context.

0 or 1

Comments