# ruff: noqa: E501
"""
The image capabilities registry holds all the TWAIN image capabilities (ICAP_*).

IMAGE_CAP_REGISTRY was generated by using Google Gemini 3 Pro.
The twain ids and names have all been reviewed manually.
Doctrings and types have only been reviewed partially (should be the same as in the twain specifications 2.5).

TWAIN:
ICAP_xxxx: Capabilities whose names begin with ICAP are capabilities that apply to image
devices. The “I” stands for image. (When TWAIN is expanded to support other data transfer
such as text or fax data, there will be TCAPs and FCAPs in a similar style.)
"""

from .capability import Capability

IMAGE_CAP_REGISTRY: dict[int, Capability] = {
    0x1100: Capability(
        id=0x1100,
        name="auto_bright",
        twain_type="TW_BOOL",
        doc="""Description:
TRUE enables and FALSE disables the Source's Auto-brightness function (if any).

Source:
If TRUE, apply auto-brightness function to acquired image before transfer.""",
        version="1.0",
        allowed_values=[True, False],
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x1134: Capability(
        id=0x1134,
        name="auto_discard_blank_pages",
        twain_type="TW_INT32",
        doc="""Description:
Use this capability to have the Source discard blank images. The Application never sees these images during the scanning session.
TWBP_DISABLE - this must be the default state for the Source. It indicates that all images will be delivered to the Application, none of them will be discarded.
TWBP_AUTO - if this is used, then the Source will decide if an image is blank or not and discard as appropriate.
If the specified value is a positive number in the range 0 to 231-1, then this capability will use it as the byte size cutoff point to identify which images are to be discarded. If the size of the image is less than or equal to this value, then it will be discarded. If the size of the image is greater than this value, then it will be kept so that it can be transferred to the Application.""",
        version="2.0",
        allowed_values=["TWBP_DISABLE", "TWBP_AUTO", "Byte count 0 to 2^31-1"],
        containers=["TW_ONEVALUE", "TW_RANGE"],
    ),
    0x1150: Capability(
        id=0x1150,
        name="automatic_border_detection",
        twain_type="TW_BOOL",
        doc="""Description:
Turns automatic border detection on and off.

Application:
Negotiate this capability to determine the state of the AutoBorder detection.
ICAP_UNDEFINEDIMAGESIZE must be enabled for this feature to work.

Source:
If supported, enable or disable automatic border detection according to the value specified.
Default to FALSE for backward compatibility. For this capability to be enabled, ICAP_UNDEFINEDIMAGESIZE must be enabled.""",
        version="1.8",
        allowed_values=[True, False],
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x1159: Capability(
        id=0x1159,
        name="automatic_color_enabled",
        twain_type="TW_BOOL",
        doc="""Description:
The Source automatically detects the pixel type of the image and returns either a color image or a non-color image specified by ICAP_AUTOMATICCOLORNONCOLORPIXELTYPE.

Application:
When the Application sets this capability to TRUE, it must be prepared to receive a mixture of color and non-color images.

Source:
When this capability is TRUE the Source automatically determines the pixel type.""",
        version="2.1",
        allowed_values=[True, False],
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x115A: Capability(
        id=0x115A,
        name="automatic_color_non_color_pixel_type",
        twain_type="TW_UINT16",
        doc="""Description:
Specifies the non-color pixel type to use when automatic color is enabled.

Application:
ICAP_AUTOMATICCOLORENABLED must be TRUE. When it is, the Application sets this capability to specify the pixel type the Source uses when transferring non-color images.

Source:
When ICAP_AUTOMATICCOLORENABLED is TRUE, this capability determines the pixel type of the non-color images.""",
        version="2.1",
        allowed_values=["TWPT_BW", "TWPT_GRAY"],
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x1157: Capability(
        id=0x1157,
        name="automatic_crop_uses_frame",
        twain_type="TW_BOOL",
        doc="""Description:
Set TRUE if DAT_IMAGELAYOUT, ICAP_SUPPORTEDSIZES or ICAP_FRAMES reduces the amount of data captured from the device, potentially improving the performance of the driver, even if any automatic detection capability like ICAP_AUTOMATICBORDERDECTION is set TRUE.
This is a read only capability.

Application:
If this capability reports TRUE then the Application may assume a performance benefit from specifying a cropping frame using DAT_IMAGELAYOUT, ICAP_SUPPORTEDSIZES or ICAP_FRAMES.
The Application sets the frame after turning on any automated capabilities. For instance, if the Application wants automatic border detection, but knows that the largest paper size it will receive is US Letter, then it sets ICAP_AUTOMATICBORDERDETECTION to TRUE and then sets ICAP_SUPPORTEDSIZES to TWSS_USLETTER.

Source:
The Source reports TRUE if it uses the cropping frame specified by DAT_IMAGELAYOUT, ICAP_SUPPORTEDSIZES or ICAP_FRAMES to reduce the amount of data physically transferred from the device to the Source.
The Source is not obligated to exactly match the frame requested by the Application, but it should use it as a hint to improve the performance of the capture.""",
        version="2.1",
        allowed_values=[True, False],
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x1151: Capability(
        id=0x1151,
        name="automatic_deskew",
        twain_type="TW_BOOL",
        doc="""Description:
Turns automatic deskew correction on and off.

Application:
Negotiate this capability to enable or disable Automatic deskew.

Source:
If supported, enable or disable the Automatic deskew feature according to the value specified for future transfers. Default to FALSE for backward compatibility. Some Sources may require ICAP_UNDEFINEDIMAGESIZE to be enabled.""",
        version="1.8",
        allowed_values=[True, False],
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x1158: Capability(
        id=0x1158,
        name="automatic_length_detection",
        twain_type="TW_BOOL",
        doc="""Description:
Controls the automatic detection of the length of a document, this is intended for use with an Automatic Document Feeder.

Application:
If this capability is present, but does not support TWQC_SET when MSG_QUERYSUPPORT is called, then it indicates the fixed behavior of the Source (always TRUE or always FALSE).
If this capability reports TWQC_SET, then the Application can control the automatic detection of the length of a document.
If ICAP_AUTOMATICBORDERDETECTION (which detects width and length) is set to TRUE, then this capability is ignored.

Source:
If set to TRUE, the Source automatically crops the height of the image to the length of the document.
If set to FALSE (and assuming ICAP_AUTOMATICBORDERDETECTION is FALSE), the Source returns the full height specified by ICAP_FRAME or DAT_IMAGELAYOUT, regardless of the actual height of the captured document (for instance, a check in an A4 size area).""",
        version="2.1",
        allowed_values=[True, False],
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x1152: Capability(
        id=0x1152,
        name="automatic_rotate",
        twain_type="TW_BOOL",
        doc="""Description:
When TRUE this capability depends on intelligent features within the Source to automatically rotate the image to the correct position.

Application:
If this capability is set to TRUE, then it must be assumed that no other correction is required (deskew, rotation, etc…); the Source is guaranteeing that it will deliver images in the correct orientation.

Source:
There are no criteria for how this automatic rotation is determined. A Source may use a field of text, or some distinguishing non-text field, such as a barcode or a logo, or it may rely on form recognition to help rotate the document.""",
        version="1.8",
        allowed_values=[True, False],
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x1156: Capability(
        id=0x1156,
        name="auto_size",
        twain_type="TW_UINT16",
        doc="""Description:
Force the output image dimensions to match either the current value of ICAP_SUPPORTEDSIZES or any of its current allowed values.

Source:
This capability takes precedence over CAP_AUTOMATICBORDERDETECTION and ICAP_AUTOMATICLENGTHDETECTION.
Source will adjust dimensions of the images to exactly match the current value of ICAP_SUPPORTEDSIZES if this capability is set to TWAS_CURRENT.
Source will adjust dimensions of the images to exactly match one of the values of ICAP_SUPPORTEDSIZES if this capability is set to TWAS_AUTO.
If set to TWAS_NONE, then no action is taken.""",
        version="2.0",
        allowed_values=["TWAS_NONE", "TWAS_AUTO", "TWAS_CURRENT"],
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x1137: Capability(
        id=0x1137,
        name="barcode_detection_enabled",
        twain_type="TW_BOOL",
        doc="""Description:
Turns bar code detection on and off.

Source:
Support this capability if the scanner supports any Bar code recognition. If the device allows this feature to be turned off, then default to off. If the device does not support disabling this feature, report TRUE and disallow attempts to set FALSE.""",
        version="1.8",
        allowed_values=[True, False],
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x113C: Capability(
        id=0x113C,
        name="barcode_max_retries",
        twain_type="TW_UINT32",
        doc="""Description:
Restricts the number of times a search will be retried if none are found on each page.

Application:
Refine this capability to limit the number of times the bar code search algorithm is retried on a page that contains no bar codes.

Source:
If supported, limit the number of retries the value specified.""",
        version="1.8",
        allowed_values="1 to 2^32 - 1",
        containers=["TW_ONEVALUE", "TW_RANGE", "TW_ENUMERATION"],
    ),
    0x1139: Capability(
        id=0x1139,
        name="barcode_max_search_priorities",
        twain_type="TW_UINT32",
        doc="""Description:
The maximum number of supported search priorities.

Application:
Query this value to determine how many bar code detection priorities can be set.
Set this value to limit the number of priorities to speed the detection process.

Source:
If bar code searches can be prioritized, report the maximum number of priorities allowed for a search.""",
        version="1.8",
        allowed_values="1 to 2^32 - 1",
        containers=["TW_ONEVALUE", "TW_RANGE", "TW_ENUMERATION"],
    ),
    0x113B: Capability(
        id=0x113B,
        name="barcode_search_mode",
        twain_type="TW_UINT16",
        doc="""Description:
Restricts bar code searching to certain orientations, or prioritizes one orientation over the other.

Application:
Negotiate this capability if the orientation of bar codes is already known to the application.
Refinement of this capability can speed the bar code search.

Source:
If set then apply the specified refinements to future bar code searches.""",
        version="1.8",
        allowed_values=["TWBD_HORZ", "TWBD_VERT", "TWBD_HORZVERT", "TWBD_VERTHORZ"],
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x113A: Capability(
        id=0x113A,
        name="barcode_search_priorities",
        twain_type="TW_UINT16",
        doc="""Description:
A prioritized list of bar code types dictating the order in which bar codes will be sought.

Application:
Set this capability to specify the order and priority for bar code searching. Refining the priorities to only the bar code types of interest to the application can speed the search process.

Source:
If this type of search refinement is supported, then report the current values.
If set, then limit future searches to the specified bar codes in the specified priority order.""",
        version="1.8",
        allowed_values=[
            "TWBT_2OF5DATALOGIC",
            "TWBT_2OF5IATA",
            "TWBT_2OF5INDUSTRIAL",
            "TWBT_2OF5INTERLEAVED",
            "TWBT_2OF5MATRIX",
            "TWBT_2OF5NONINTERLEAVED",
            "TWBT_3OF9",
            "TWBT_3OF9FULLASCII",
            "TWBT_CODABAR",
            "TWBT_CODABARWITHSTARTSTOP",
            "TWBT_CODE128",
            "TWBT_CODE93",
            "TWBT_EAN13",
            "TWBT_EAN8",
            "TWBT_MAXICODE",
            "TWBT_PDF417",
            "TWBT_POSTNET",
            "TWBT_QRCODE",
            "TWBT_UCC128",
            "TWBT_UPCA",
            "TWBT_UPCE",
        ],
        containers=["TW_ARRAY", "TW_ONEVALUE"],
    ),
    0x113D: Capability(
        id=0x113D,
        name="barcode_timeout",
        twain_type="TW_UINT32",
        doc="""Description:
Restricts the total time spent on searching for a bar code on each page.

Application:
Refine this value to tune the length of time the search algorithm is allowed to execute before giving up.

Source:
If supported, limit the duration of a bar code search to the value specified.""",
        version="1.8",
        allowed_values="1 to 2^32 - 1",
        containers=["TW_ONEVALUE", "TW_RANGE", "TW_ENUMERATION"],
    ),
    0x112B: Capability(
        id=0x112B,
        name="bit_depth",
        twain_type="TW_UINT16",
        doc="""Description:
Specifies the pixel bit depths for the Current value of ICAP_PIXELTYPE.
For example;
• ICAP_PIXELTYPE = TWPT_GRAY, this capability specifies whether this is 4-bit gray or 8- bit gray
• ICAP_PIXELTYPE = TWPT_RGB, this capability specifies whether this is 24-bit color or 48-bit color
This depth applies to the total of all the data channels. TW_IMAGEINFO BitsPerSample is used to identify the number of bits in each channel.

Application:
The application should loop through all the ICAP_PIXELTYPEs it is interested in and negotiate the ICAP_BITDEPTH(s) for each.
For all allowed settings of ICAP_PIXELTYPE
• Set ICAP_PIXELTYPE
• Set ICAP_BITDEPTH for the current ICAP_PIXELTYPE

Source:
If the bit depth in a MSG_SET is not supported for the current ICAP_PIXELTYPE setting, return TWRC_FAILURE / TWCC_BADVALUE.""",
        version="1.0",
        allowed_values=">= 1",
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x112C: Capability(
        id=0x112C,
        name="bit_depth_reduction",
        twain_type="TW_UINT16",
        doc="""Description:
Specifies the Reduction Method the Source should use to reduce the bit depth of the data. Most commonly used with ICAP_PIXELTYPE = TWPT_BW to reduce gray data to black and white.

Application:
Set the capability to the reduction method to be used in future acquisitions.
Also select the Halftone or Threshold to be used.""",
        version="1.5",
        allowed_values=[
            "TWBR_THRESHOLD",
            "TWBR_HALFTONE",
            "TWBR_CUSTHALFTONE",
            "TWBR_DIFFUSION",
            "TWBR_DYNAMICTHRESHOLD",
        ],
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x111C: Capability(
        id=0x111C,
        name="bit_order",
        twain_type="TW_UINT16",
        doc="""Description:
Specifies how the bytes in an image are filled by the Source. TWBO_MSBFIRST indicates that the leftmost bit in the byte (usually bit 7) is the byte's Most Significant Bit.""",
        version="1.0",
        allowed_values=["TWBO_LSBFIRST", "TWBO_MSBFIRST"],
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x1126: Capability(
        id=0x1126,
        name="bit_order_codes",
        twain_type="TW_UINT16",
        doc="""Description:
Used for CCITT data compression only. Indicates the bit order representation of the stored compressed codes.""",
        version="1.0",
        allowed_values=["TWBO_LSBFIRST", "TWBO_MSBFIRST"],
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x1101: Capability(
        id=0x1101,
        name="brightness",
        twain_type="TW_FIX32",
        doc="""Description:
The brightness values available within the Source.

Application:
The application can use this capability to inquire, set, or restrict the values for BRIGHTNESS used in the Source.

Source:
Source should normalize the values into the range. Make sure that a '0' value is available as the Current Value when the Source starts up. If the Source's ± range is asymmetric about the '0' value, set range maxima to ±1000 and scale homogeneously from the '0' value in each direction. This will yield a positive range whose step size differs from the negative range's step size.""",
        version="1.0",
        allowed_values=(-1000.0, 1000.0),
        containers=["TW_ONEVALUE", "TW_RANGE", "TW_ENUMERATION"],
    ),
    0x111D: Capability(
        id=0x111D,
        name="ccitt_k_factor",
        twain_type="TW_UINT16",
        doc="""Description:
Used for CCITT Group 3 2-dimensional compression. The 'K' factor indicates how often the new compression baseline should be re-established. A value of 2 or 4 is common in facsimile communication. A value of zero in this field will indicate an infinite K factor—the baseline is only calculated at the beginning of the transfer.""",
        version="1.0",
        allowed_values="0 to 2^16",
        containers=["TW_ONEVALUE", "TW_RANGE"],
    ),
    0x115B: Capability(
        id=0x115B,
        name="color_management_enabled",
        twain_type="TW_BOOL",
        doc="""Description:
Disables the Source's color and gamma tables for color and grayscale images, resulting in output that could be termed “raw”.

Application:
When the Application sets this capability to FALSE, it takes responsibility for profiling the color and grayscale output of the device, and applying the desired color and gamma corrections itself. The Application is completely responsible for the quality of the finished image.

Source:
When this capability is FALSE the Source turns off as much of its color and gamma correction as it can. There is no universal standard for this behavior, so it makes its best effort.
It is recommended that the Source not expose this capability unless it can do a credible job of outputting “raw” image data.""",
        version="2.1",
        allowed_values=[True, False],
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x0100: Capability(
        id=0x0100,
        name="compression",
        twain_type="TW_UINT16",
        doc="""Description:
Allows the application and Source to identify which compression schemes they have in common for Buffered Memory and File transfers.
Note for File transfers: Since only certain file formats support compression, this capability must be negotiated after setting the desired file format with ICAP_IMAGEFILEFORMAT.

Application:
Applications must not assume that a Source can provide compressed Buffered Memory or File transfers, because many cannot. The application should use MSG_SET on a TW_ONEVALUE container to specify the compression type for future transfers.

Source:
The current value of this setting specifies the compression method to be used in future transfers. If the image transfer mechanism is changed, then the allowed list must be modified to reflect the supported values. If the current value is not available on the new allowed list, then the Source must change it to its preferred value.""",
        version="1.0",
        allowed_values=[
            "TWCP_NONE",
            "TWCP_PACKBITS",
            "TWCP_GROUP31D",
            "TWCP_GROUP31DEOL",
            "TWCP_GROUP32D",
            "TWCP_GROUP4",
            "TWCP_JPEG",
            "TWCP_LZW",
            "TWCP_JBIG",
            "TWCP_PNG",
            "TWCP_RLE4",
            "TWCP_RLE8",
            "TWCP_BITFIELDS",
            "TWCP_ZIP",
            "TWCP_JPEG2000",
        ],
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x1103: Capability(
        id=0x1103,
        name="contrast",
        twain_type="TW_FIX32",
        doc="""Description:
The contrast values available within the Source.

Application:
The application can use this capability to inquire, set or restrict the values for CONTRAST used in the Source.

Source:
Scale the values available internally into a homogeneous range between -1000 and 1000. Make sure that a '0' value is available as the Current value when the Source starts up. If the Source's ± range is asymmetric about the '0' value, set range maxima to ±1000 and scale homogeneously from the '0' value in each direction. This will yield a positive range whose step size differs from the negative range's step size.""",
        version="1.0",
        allowed_values=(-1000.0, 1000.0),
        containers=["TW_ONEVALUE", "TW_RANGE", "TW_ENUMERATION"],
    ),
    0x1104: Capability(
        id=0x1104,
        name="cust_halftone",
        twain_type="TW_UINT8",
        doc="""Description:
Specifies the square-cell halftone (dithering) matrix the Source should use to halftone the image.

Application:
The application should also set ICAP_BITDEPTHREDUCTION to TWBR_CUSTHALFTONE to use this capability.""",
        version="1.0",
        allowed_values="Any rectangular array",
        containers=["TW_ARRAY", "TW_ONEVALUE"],
    ),
    0x1105: Capability(
        id=0x1105,
        name="exposure_time",
        twain_type="TW_FIX32",
        doc="""Description:
Specifies the exposure time used to capture the image, in seconds.""",
        version="1.0",
        allowed_values="> 0",
        containers=["TW_ONEVALUE", "TW_RANGE", "TW_ENUMERATION"],
    ),
    0x112F: Capability(
        id=0x112F,
        name="ext_image_info",
        twain_type="TW_BOOL",
        doc="""Description:
Allows the application to query the data source to see if it supports the operation triplet DG_IMAGE / DAT_EXTIMAGEINFO / MSG_GET. Support is only available if the capability is supported and the value TRUE is allowed.
When set to TRUE, the source supports the DG_IMAGE / DAT_EXTIMAGEINFO / MSG_GET message, and data will be returned by this call for any supported TWEI_ items.
When set to FALSE, the application is indicating that it will make no calls to DG_IMAGE / DAT_EXTIMAGEINFO / MSG_GET. FALSE is the default.

Application:
Set this capability to FALSE if there is no intent to use DG_IMAGE / DAT_EXTIMAGEINFO / MSG_GET. This may improve performance, since the Source is not required to collect that information from the device. Set this capability to TRUE if using DG_IMAGE / DAT_EXTIMAGEINFO / MSG_GET to ensure all TWEI_ are available.""",
        version="1.7",
        allowed_values=[True, False],
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x1154: Capability(
        id=0x1154,
        name="feeder_type",
        twain_type="TW_UINT16",
        doc="""Description:
Allows the Application to set scan parameters depending upon the type of feeder.
If the Source has a general type of the feeder only, default scan parameters can depend upon the type of scan (general document or photo). In this case, negotiating this capability will allow the Source adjusting the settings accordingly. It is advised, therefore, that this capability be negotiated prior to the capabilities related to specific Source settings (like ICAP_*RESOLUTION, ICAP_PIXELTYPE, etc.) but after the other feeder-related capabilities (CAP_FEEDERENABLED, CAP_FEEDERLOADED).

Application:
MSG_GET provides a list of available feeder types. MSG_SET specifies which type of feeder to use.

Source:
Use this capability to report either the types of feeders available or (in the case where there is a general type feeder only) the scan types supported through the feeder.""",
        version="1.91",
        allowed_values=["TWFE_GENERAL", "TWFE_PHOTO"],
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x115F: Capability(
        id=0x115F,
        name="film_type",
        twain_type="TW_UINT16",
        doc="""Description:
When ICAP_LIGHTPATH is set to TWLP_TRANSMISSIVE it allows an Application to set what kind of film is being scanned.

Application:
Allows setting of current type of transmissive media you wish to scan.

Source:
If supported, the Source should compensate for the type of media to return a positive image.""",
        version="2.2",
        allowed_values=["TWFM_POSITIVE", "TWFM_NEGATIVE"],
        containers=["TW_ENUMERATION", "TW_ONEVALUE"],
    ),
    0x1106: Capability(
        id=0x1106,
        name="filter",
        twain_type="TW_UINT16",
        doc="""Description:
Describes the color characteristic of the subtractive filter applied to the image data. Multiple filters may be applied to a single acquisition.
If the Source supports DAT_FILTER as well, then it will apply the filter set by the last SET operation invoked by the Application. Setting/Resetting ICAP_FILTER will clear the filter associated with DAT_FILTER. Setting/Resetting DAT_FILTER will clear the filter associated with ICAP_FILTER.

Source:
If the Source only supports application of a single filter during an acquisition and multiple filters are specified by the application, set the current filter to the first one requested and return TWRC_CHECKSTATUS.""",
        version="1.0",
        allowed_values=[
            "TWFT_RED",
            "TWFT_GREEN",
            "TWFT_BLUE",
            "TWFT_NONE",
            "TWFT_WHITE",
            "TWFT_CYAN",
            "TWFT_MAGENTA",
            "TWFT_YELLOW",
            "TWFT_BLACK",
        ],
        containers=["TW_ONEVALUE", "TW_ARRAY"],
    ),
    0x1107: Capability(
        id=0x1107,
        name="flash_used",
        twain_type="Unknown",
        doc="""Probably depricated""",
        version="1.0",
        allowed_values="Unknown",
        containers=["Unknown"],
    ),
    0x1146: Capability(
        id=0x1146,
        name="flash_used_2",
        twain_type="TW_UINT16",
        doc="""Description:
For devices that support flash. MSG_SET selects the flash to be used (if any). MSG_GET reports the current setting. This capability replaces ICAP_FLASHUSED, which is only able to negotiate the flash being on or off.

Application:
Note that an image with flash may have a different color composition than an image without flash.""",
        version="1.8",
        allowed_values=["TWFL_NONE", "TWFL_OFF", "TWFL_ON", "TWFL_AUTO", "TWFL_REDEYE"],
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x1136: Capability(
        id=0x1136,
        name="flip_rotation",
        twain_type="TW_UINT16",
        doc="""Description:
Flip rotation is used to properly orient images that flip orientation every other image.
TWFR_BOOK: The images to be scanned are viewed in book form, flipping each page from left to right or right to left.
TWFR_FANFOLD: The images to be scanned are viewed in fanfold paper style, flipping each page up or down.
On duplex paper, the As are all located on the top, and the Bs are all located on the bottom. If ICAP_FLIPROTATION is set to TWFR_BOOK, and fanfold paper is scanned, then every B image will be upside down. Setting the capability to TWFR_FANFOLD instructs the Source to rotate the B images 180 degrees around the x-axis.
Because this capability is described to act upon every other image, it will work correctly in simplex mode, assuming that every other simplex image is flipped in the manner described above.""",
        version="1.8",
        allowed_values=["TWFR_BOOK", "TWFR_FANFOLD"],
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x1114: Capability(
        id=0x1114,
        name="frames",
        twain_type="TW_FRAME",
        doc="""Description:
The list of frames the Source will acquire on each page.
Defines the Left, Top, Right, and Bottom coordinates (in ICAP_UNITS) of the rectangle enclosing the original image on the original scanner. This ICAP is most useful if the Source supports simultaneous acquisition from multiple frames. Use ICAP_MAXFRAMES to establish this ability.

Application:
MSG_GET returns the size and location of all the frames the Source will acquire image data from when acquiring from each page.
MSG_GETCURRENT returns the size and location of the next frame to be acquired.
MSG_SET allows the application to specify the frames and their locations to be used to acquire from future pages. If the application isn't interested in setting the origin of the image, set both Top and Left to zero.""",
        version="1.0",
        allowed_values="Device dependent",
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x1108: Capability(
        id=0x1108,
        name="gamma",
        twain_type="TW_FIX32",
        doc="""Description:
Gamma correction value for the image data.

Application:
Do not use with TW_CIECOLOR, TW_GRAYRESPONSE, or TW_RGBRESPONSE data.

Source:
If the application supplies an invalid gamma value, the Source selects the closest value and returns TWRC_FAILURE / TWCC_CHECKSTATUS.""",
        version="1.0",
        allowed_values="Any value",
        containers=["TW_ONEVALUE", "TW_RANGE"],
    ),
    0x1109: Capability(
        id=0x1109,
        name="halftones",
        twain_type="TW_STR32",
        doc="""Description:
A list of names of the halftone patterns available within the Source.

Application:
The application may not rename any halftone pattern.
The application should also set ICAP_BITDEPTHREDUCTION to use this capability.
For backwards compatibility, Applications need to be aware that a TWAIN 1.0 Data Sources might respond with a TW_ARRAY container.""",
        version="1.0",
        allowed_values="Any halftone name",
        containers=["TW_ENUMERATION", "TW_ONEVALUE"],
    ),
    0x110A: Capability(
        id=0x110A,
        name="highlight",
        twain_type="TW_FIX32",
        doc="""Description:
Specifies which value in an image should be interpreted as the lightest “highlight.” All values “lighter” than this value will be clipped to this value. Whether lighter values are smaller or larger can be determined by examining the Current value of ICAP_PIXELFLAVOR.

Source:
If more or less than 8 bits are used to describe the image, the actual data values should be normalized to fit within the 0-255 range. The normalization need not result in a homogeneous distribution if the original distribution was not homogeneous.""",
        version="1.0",
        allowed_values="0 to 255",
        containers=["TW_ONEVALUE", "TW_RANGE", "TW_ENUMERATION"],
    ),
    0x1155: Capability(
        id=0x1155,
        name="icc_profile",
        twain_type="TW_UINT16",
        doc="""Description:
Informs the application if the source has an ICC profile and can embed or link it in the current ICAP_IMAGEFILEFORMAT. Tells the source if the application would like an ICC profile embedded or linked into the image file the source will write.

Application:
Use this ICAP to determine if the source supports embedding or linking of ICC profiles into files and to control whether or not the source does so.

Source:
This should only be supported if ICAP_IMAGEFILEFORMAT is set to a file format that supports the embedding or linking of profiles and the source has an ICC profile it can embed.
Since the given ICAP_PIXELTYPE may not have been determined at the time this is called, the source should ignore the current ICAP_PIXELTYPE. For example, if the source has an ICC profile for color data, but not grayscale or monochrome data, it should offer values as if all pixeltypes are supported.
In the case of TWPT_SRGB, the source should embed the sRGB ICC profile to the file if told to embed a profile.""",
        version="1.91",
        allowed_values=["TWIC_NONE", "TWIC_EMBED", "TWIC_LINK"],
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x112E: Capability(
        id=0x112E,
        name="image_data_set",
        twain_type="TW_UINT32",
        doc="""Description:
Gets or sets the image indices that will be delivered during the standard image transfer done in States 6 and 7. Indices are assumed to start at 1, so a TW_ONEVALUE container sets an implied range from 1 to the number specified. TW_RANGE returns are useful for those cases where the images are contiguous (5 .. 36). TW_ARRAY returns should be used were index values are discontinuous (as could be the case where the user previously set such a data set).

Application:
A MSG_RESET operation should always be done before a MSG_GET if the application wishes to get the complete list of available images. A MSG_SET operation will define the number and order of images delivered during States 6 and 7.

Source:
For MSG_GET, if a contiguous range of images are available starting from the first index (e.g., 1 .. 36) it is recommended that the TW_ONEVALUE container is used specifying just the total number of available images (e.g., 36).
If not supported, return TWRC_FAILURE/ TWCC_CAPUNSUPPORTED.""",
        version="1.7",
        allowed_values="0 to 2^32 -1 (for MSG_GET), 1 to 2^32 -1 (for MSG_SET)",
        containers=["TW_ARRAY", "TW_RANGE", "TW_ONEVALUE"],
    ),
    0x110C: Capability(
        id=0x110C,
        name="image_file_format",
        twain_type="TW_UINT16",
        doc="""Description:
Informs the application which file formats the Source can generate (MSG_GET). Tells the Source which file formats the application can handle (MSG_SET).

Application:
Use this ICAP to determine which formats are available for file transfers, and set the context for other capability negotiations such as ICAP_COMPRESSION.
Be sure to use the DG_CONTROL / DAT_SETUPFILEXFER / MSG_SET operation to specify the format to be used for a particular acquisition.""",
        version="1.0",
        allowed_values=[
            "TWFF_TIFF",
            "TWFF_PICT",
            "TWFF_BMP",
            "TWFF_XBM",
            "TWFF_JFIF",
            "TWFF_FPX",
            "TWFF_TIFFMULTI",
            "TWFF_PNG",
            "TWFF_SPIFF",
            "TWFF_EXIF",
            "TWFF_PDF",
            "TWFF_JP2",
            "TWFF_JPX",
            "TWFF_DEJAVU",
            "TWFF_PDFA",
            "TWFF_PDFRASTER",
        ],
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x1147: Capability(
        id=0x1147,
        name="image_filter",
        twain_type="TW_UINT16",
        doc="""Description:
For devices that support image enhancement filtering. This capability selects the algorithm used to improve the quality of the image.

Application:
• TWIF_LOWPASS is good for halftone images.
• TWIF_BANDPASS is good for improving text.
• TWIF_HIGHPASS is good for improving fine lines.""",
        version="1.8",
        allowed_values=[
            "TWIF_NONE",
            "TWIF_AUTO",
            "TWIF_LOWPASS",
            "TWIF_BANDPASS",
            "TWIF_HIGHPASS",
            "TWIF_TEXT",
            "TWIF_FINELINE",
        ],
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x115C: Capability(
        id=0x115C,
        name="image_merge",
        twain_type="TW_UINT16",
        doc="""Description:
Merges the front and rear image of a document in one of four orientations: front on the top, front on the bottom, front on the left or front on the right.

Application:
The front and rear have the same settings. It is a customization for a source to allow different settings, for instance a front of TWPT_RGB and a rear of TWPT_BW.
The merged image can be found at an origin of (0, total-image-height / 2) or (total-image-width, 0), depending on the value of this capability.
Use the TWEI_IMAGEMERGED value with DAT_EXTIMAGEINFO to determine if an image is the result of a merge.

Source:
This capability only has meaning when scanning duplex.
The source chooses how many differences it wants to support between the front and the rear. The only one it is obligated to deal with is differences in the width and height. In both cases the larger value must be selected, and the extra space in the smaller image filled in with some color.
If the source cannot negotiate this capability because of a difference in the front and rear settings, it returns TWCC_CAPSEQERROR.""",
        version="2.1",
        allowed_values=["TWIM_NONE", "TWIM_FRONTONTOP", "TWIM_FRONTONBOTTOM", "TWIM_FRONTONLEFT", "TWIM_FRONTONRIGHT"],
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x115D: Capability(
        id=0x115D,
        name="image_merge_height_threshold",
        twain_type="TW_FIX32",
        doc="""Description:
Specifies a Y-Offset in ICAP_UNITS units. Front and rear images less than or equal to this value are merged according to the settings of ICAP_IMAGEMERGE. If either the front or the rear image is greater than this value, they are not merged.

Application:
The Application specifies this value to help with mixed batches of different paper sizes. For instance, a value of 4.0 inches would be enough to merge check-size documents, while leaving larger paper sizes unmerged.
If ICAP_AUTOMATICDESKEW is FALSE, then this value must allow for image skew in the height.
If ICAP_AUTOMATICDESKEW is TRUE, then some small amount above the expected document height is still recommended.

Source:
This capability only has meaning when CAP_INDICATORS is set to a value other than TWIM_NONE.""",
        version="2.1",
        allowed_values="0.0 to ICAP_PHYSICALHEIGHT",
        containers=["TW_ONEVALUE", "TW_RANGE"],
    ),
    0x1128: Capability(
        id=0x1128,
        name="jpeg_pixel_type",
        twain_type="TW_UINT16",
        doc="""Description:
Allows the application and Source to agree upon a common set of color descriptors that are made available by the Source. This ICAP is only useful for JPEG-compressed buffered memory image transfers.""",
        version="1.0",
        allowed_values=[
            "TWPT_BW",
            "TWPT_GRAY",
            "TWPT_RGB",
            "TWPT_PALETTE",
            "TWPT_CMY",
            "TWPT_CMYK",
            "TWPT_YUV",
            "TWPT_YUVK",
            "TWPT_CIEXYZ",
        ],
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x1153: Capability(
        id=0x1153,
        name="jpeg_quality",
        twain_type="TW_INT16",
        doc="""Description:
Use this capability as a shortcut to select JPEG quantization tables that tradeoff quality versus compressed image size. Used in concert with DAT_JPEGCOMPRESSION it is possible for an Application to obtain the tables that are appropriate for varying percentages of quality within a given Source.
TWJQ_UNKNOWN is a read-only value (MSG_GET or MSG_GETCURRENT), the Application cannot set the Source to this value.
The next three TWJQ_ values are intended as markers into the quality range, and are only applicable with MSG_SET.
MSG_GET, MSG_GETCURRENT and MSG_GETDEFAULT only return values in the range 0 - 100.
TWJQ_UNKNOWN - read-only; must be the setting for this capability if the user sets the JPEG compression tables using DAT_JPEGCOMPRESSION, and the Source is not able to map the selected tables to a specific percentage of quality.
TWJQ_LOW - write-only; implies low quality; the images are at the maximum compression recommended by the Source.
TWJQ_MEDIUM - write-only; implies medium quality; the images are at the balance point between good compression and good images.
TWJQ_HIGH - write-only; implies high quality; the images display the maximum quality that produces any kind of meaningful compression.""",
        version="1.9",
        allowed_values=["TWJQ_UNKNOWN", "TWJQ_LOW", "TWJQ_MEDIUM", "TWJQ_HIGH", "0 - 100"],
        containers=["TW_ONEVALUE", "TW_RANGE", "TW_ENUMERATION"],
    ),
    0x1161: Capability(
        id=0x1161,
        name="jpeg_subsampling",
        twain_type="TW_UINT16",
        doc="""Description:
Use this capability and ICAP_JPEGQUALITY as a shortcut to select JPEG quantization. Used in concert with DAT_JPEGCOMPRESSION it is possible for an Application to obtain the tables that are appropriate for varying percentages of quality within a given Source. It has meaning for color images only.

Source:
If requested image is bitonal or grayscale, return TWRC_FAILURE / TWCC_CAPSEQERROR.""",
        version="2.2",
        allowed_values=[
            "TWJS_444YCBCR",
            "TWJS_444RGB",
            "TWJS_422",
            "TWJS_421",
            "TWJS_411",
            "TWJS_420",
            "TWJS_410",
            "TWJS_311",
        ],
        containers=["TW_ENUMERATION", "TW_ONEVALUE"],
    ),
    0x110D: Capability(
        id=0x110D,
        name="lamp_state",
        twain_type="TW_BOOL",
        doc="""Description:
TRUE means the lamp is currently, or should be set to ON. Sources may not support MSG_SET operations.""",
        version="1.0",
        allowed_values=[True, False],
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x111E: Capability(
        id=0x111E,
        name="light_path",
        twain_type="TW_UINT16",
        doc="""Description:
Describes whether the image was captured transmissively or reflectively.""",
        version="1.0",
        allowed_values=["TWLP_REFLECTIVE", "TWLP_TRANSMISSIVE"],
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x110E: Capability(
        id=0x110E,
        name="light_source",
        twain_type="TW_UINT16",
        doc="""Description:
Describes the general color characteristic of the light source used to acquire the image.""",
        version="1.0",
        allowed_values=["TWLS_RED", "TWLS_GREEN", "TWLS_BLUE", "TWLS_NONE", "TWLS_WHITE", "TWLS_UV", "TWLS_IR"],
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x111A: Capability(
        id=0x111A,
        name="max_frames",
        twain_type="TW_UINT16",
        doc="""Description:
The maximum number of frames the Source can provide or the application can accept per page.
This is a bounding capability only. It does not establish current or future behavior.""",
        version="1.0",
        allowed_values="1 to 2^16",
        containers=["TW_ONEVALUE", "TW_RANGE"],
    ),
    0x1130: Capability(
        id=0x1130,
        name="minimum_height",
        twain_type="TW_FIX32",
        doc="""Description:
Allows the source to define the minimum height (Y-axis) that the source can acquire.
This is a read only capability.

Source:
The minimum height that the device can scan. This may be different depending on the value of CAP_FEEDERENABLED.""",
        version="1.7",
        allowed_values="0 to 32767 in ICAP_UNITS",
        containers=["TW_ONEVALUE"],
    ),
    0x1131: Capability(
        id=0x1131,
        name="minimum_width",
        twain_type="TW_FIX32",
        doc="""Description:
Allows the source to define the minimum width (X-axis) that the source can acquire.
This is a read only capability.

Source:
The minimum width that the device can scan. This may be different depending on the value of CAP_FEEDERENABLED.""",
        version="1.7",
        allowed_values="0 to 32767 in ICAP_UNITS",
        containers=["TW_ONEVALUE"],
    ),
    0x1160: Capability(
        id=0x1160,
        name="mirror",
        twain_type="TW_UINT16",
        doc="""Description:
How the Source can/should mirror the scanned image data prior to transfer. Operation is performed in conjunction with ICAP_ORIENTATION and ICAP_ROTATION.

Source:
Recommend order - Mirror then Rotation.""",
        version="2.2",
        allowed_values=["TWMR_NONE", "TWMR_VERTICAL", "TWMR_HORIZONTAL"],
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x1148: Capability(
        id=0x1148,
        name="noise_filter",
        twain_type="TW_UINT16",
        doc="""Description:
For devices that support noise filtering. This capability selects the algorithm used to remove noise.""",
        version="1.8",
        allowed_values=["TWNF_NONE", "TWNF_AUTO", "TWNF_LONEPIXEL", "TWNF_MAJORITYRULE"],
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x1110: Capability(
        id=0x1110,
        name="orientation",
        twain_type="TW_UINT16",
        doc="""Description:
Defines which edge of the “paper” the image's “top” is aligned with. This information is used to adjust the frames to match the scanning orientation of the paper. For instance, if an ICAP_SUPPORTEDSIZE of TWSS_ISOA4 has been negotiated, and ICAP_ORIENTATION is set to TWOR_LANDSCAPE, then the Source must rotate the frame it downloads to the scanner to reflect the orientation of the paper.
• ICAP_ORIENTATION affects the values reported by ICAP_FRAMES when using ICAP_SUPPORTEDSIZES.
• ICAP_ORIENTATION is ignored when set using ICAP_FRAMES or DAT_IMAGELAYOUT.
The upper-left of the image is defined as the location where both the primary and secondary scans originate. (The X axis is the primary scan direction and the Y axis is the secondary scan direction.) For a flatbed scanner, the light bar moves in the secondary scan direction. For a handheld scanner, the scanner is drug in the secondary scan direction. For a digital camera, the secondary direction is the vertical axis when the viewed image is considered upright.

Application:
If one pivots the image about its center, then orienting the image in TWOR_LANDSCAPE has the effect of rotating the original image 90 degrees to the “left.” TWOR_PORTRAIT mode does not rotate the image. The image may be oriented along any of the four axes located 90 degrees from the unrotated image. Note that: TWOR_ROT0 == TWOR_PORTRAIT and TWOR_ROT270 == TWOR_LANDSCAPE.

Source:
The Source is responsible for rotating the image if it allows this capability to be set.""",
        version="1.0",
        allowed_values=["TWOR_ROT0", "TWOR_ROT90", "TWOR_ROT180", "TWOR_ROT270", "TWOR_PORTRAIT", "TWOR_LANDSCAPE"],
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x1149: Capability(
        id=0x1149,
        name="overscan",
        twain_type="TW_UINT16",
        doc="""Description:
Overscan is used to scan outside of the boundaries described by ICAP_FRAMES, and is used to help acquire image data that may be lost because of skewing.
This is primarily of use for transport scanners which rely on edge detection to begin scanning. If overscan is supported, then the device is capable of scanning in the inter-document gap to get the skewed image information.

Application:
Use this capability, if available, to help software processing images for deskew and border removal.""",
        version="1.8",
        allowed_values=["TWOV_NONE", "TWOV_AUTO", "TWOV_TOPBOTTOM", "TWOV_LEFTRIGHT", "TWOV_ALL"],
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x113F: Capability(
        id=0x113F,
        name="patch_code_detection_enabled",
        twain_type="TW_BOOL",
        doc="""Description:
Turns patch code detection on and off.

Source:
Support this capability if the scanner supports any patch code recognition. If the device allows this feature to be turned off, then default to off. If the device does not support disabling this feature, report TRUE and disallow attempts to set FALSE.""",
        version="1.8",
        allowed_values=[True, False],
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x1144: Capability(
        id=0x1144,
        name="patch_code_max_retries",
        twain_type="TW_UINT32",
        doc="""Description:
Restricts the number of times a search will be retried if none are found on each page.

Application:
Refine this capability to limit the number of times the patch code search algorithm is retried on a page that contains no patch codes.

Source:
If supported, limit the number of retries the value specified.""",
        version="1.8",
        allowed_values="1 to 2^32 - 1",
        containers=["TW_ONEVALUE", "TW_RANGE", "TW_ENUMERATION"],
    ),
    0x1141: Capability(
        id=0x1141,
        name="patch_code_max_search_priorities",
        twain_type="TW_UINT32",
        doc="""Description:
The maximum number of supported search priorities.

Application:
Query this value to determine how many patch code detection priorities can be set.

Source:
Set this value to limit the number of priorities to speed the detection process.
If patch code searches can be prioritized, report the maximum number of priorities allowed for a search.""",
        version="1.8",
        allowed_values="1 to 2^32 - 1",
        containers=["TW_ONEVALUE", "TW_RANGE", "TW_ENUMERATION"],
    ),
    0x1143: Capability(
        id=0x1143,
        name="patch_code_search_mode",
        twain_type="TW_UINT16",
        doc="""Description:
Restricts patch code searching to certain orientations, or prioritizes one orientation over the other.

Application:
Negotiate this capability if the orientation of patch codes is already known to the application.
Refinement of this capability can speed the patch code search.

Source:
If set then apply the specified refinements to future patch code searches.""",
        version="1.8",
        allowed_values=["TWBD_HORZ", "TWBD_VERT", "TWBD_HORZVERT", "TWBD_VERTHORZ"],
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x1142: Capability(
        id=0x1142,
        name="patch_code_search_priorities",
        twain_type="TW_UINT16",
        doc="""Description:
A prioritized list of patch code types dictating the order in which patch codes will be sought.

Application:
Set this capability to specify the order and priority for patch code searching. Refining the priorities to only the patch code types of interest to the application can speed the search process.

Source:
If this type of search refinement is supported, then report the current values.
If set, then limit future searches to the specified patch codes in the specified priority order.""",
        version="1.8",
        allowed_values=["TWPCH_PATCH1", "TWPCH_PATCH2", "TWPCH_PATCH3", "TWPCH_PATCH4", "TWPCH_PATCH6", "TWPCH_PATCHT"],
        containers=["TW_ARRAY", "TW_ONEVALUE"],
    ),
    0x1145: Capability(
        id=0x1145,
        name="patch_code_timeout",
        twain_type="TW_UINT32",
        doc="""Description:
Restricts the total time spent on searching for a patch code on each page.

Application:
Refine this value to tune the length of time the search algorithm is allowed to execute before giving up.

Source:
If supported, limit the duration of a patch code search to the value specified.""",
        version="1.8",
        allowed_values="1 to 2^32 - 1",
        containers=["TW_ONEVALUE", "TW_RANGE", "TW_ENUMERATION"],
    ),
    0x1112: Capability(
        id=0x1112,
        name="physical_height",
        twain_type="TW_FIX32",
        doc="""Description:
The maximum physical height (Y-axis) the Source can acquire (measured in units of ICAP_UNITS).
This is a read only capability.

Source:
For a flatbed scanner, the height of the platen; for a handheld scanner or a sheet fed scanner, the maximum length of a scan.
For dimensionless devices, such as digital cameras, this ICAP is meaningless for all values of ICAP_UNITS other than TWUN_PIXELS. If the device is dimensionless, the Source should return a value of zero if ICAP_UNITS does not equal TWUN_PIXELS. This tells the application to inquire with TWUN_PIXELS.
Note: The physical acquired area may be different depending on the setting of CAP_FEEDERENABLED (if the Source has separate feeder and non-feeder acquire areas).""",
        version="1.0",
        allowed_values="0 to 65535 in ICAP_UNITS",
        containers=["TW_ONEVALUE"],
    ),
    0x1111: Capability(
        id=0x1111,
        name="physical_width",
        twain_type="TW_FIX32",
        doc="""Description:
The maximum physical width (X-axis) the Source can acquire (measured in units of ICAP_UNITS).
This is a read only capability.

Source:
For a flatbed scanner, the width of the platen; for a handheld scanner or a sheet fed scanner, the maximum width of a scan.
For dimensionless devices, such as digital cameras, this ICAP is meaningless for all values of ICAP_UNITS other than TWUN_PIXELS. If the device is dimensionless, the Source should return a value of zero if ICAP_UNITS does not equal TWUN_PIXELS. This tells the application to inquire with TWUN_PIXELS. The Source should then reply with its X-axis pixel count.
Note: The physical acquired area may be different depending on the setting of CAP_FEEDERENABLED (if the Source has separate feeder and non-feeder acquire areas).""",
        version="1.0",
        allowed_values="0 to 65535 in ICAP_UNITS",
        containers=["TW_ONEVALUE"],
    ),
    0x111F: Capability(
        id=0x111F,
        name="pixel_flavor",
        twain_type="TW_UINT16",
        doc="""Description:
Sense of the pixel whose numeric value is zero (minimum data value). For example, consider a black and white image:
If ICAP_PIXELTYPE is TWPT_BW then
If ICAP_PIXELFLAVOR is TWPF_CHOCOLATE then Black = 0
Else if ICAP_PIXELFLAVOR is TWPF_VANILLA then White = 0

Application:
Sources may prefer a different value depending on ICAP_PIXELTYPE. Set ICAP_PIXELTYPE and do a MSG_GETDEFAULT to determine the Source's preferences.

Source:
TWPF_CHOCOLATE means this pixel represents the darkest data value that can be generated by the device (the darkest available optical value may measure greater than 0).
TWPF_VANILLA means this pixel represents the lightest data value that can be generated by the device (the lightest available optical value may measure greater than 0).""",
        version="1.0",
        allowed_values=["TWPF_CHOCOLATE", "TWPF_VANILLA"],
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x1127: Capability(
        id=0x1127,
        name="pixel_flavor_codes",
        twain_type="TW_UINT16",
        doc="""Description:
Used only for CCITT data compression. Specifies whether the compressed codes' pixel “sense” will be inverted from the Current value of ICAP_PIXELFLAVOR prior to transfer.""",
        version="1.0",
        allowed_values=["TWPF_CHOCOLATE", "TWPF_VANILLA"],
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x0101: Capability(
        id=0x0101,
        name="pixel_type",
        twain_type="TW_UINT16",
        doc="""Description:
The type of pixel data that a Source is capable of acquiring (for example, black and white, gray, RGB, etc.).

Application:
• MSG_GET returns a list of all pixel types available from the Source.
• MSG_SET on a TW_ENUMERATION structure requests that the Source restrict the available pixel types to the enumerated list.
• MSG_SET on a TW_ONEVALUE container specifies the only pixel type the application can accept.
If the application plans to transfer data through any mechanism other than Native and cannot handle all possible ICAP_PIXELTYPEs, it must support negotiation of this ICAP.""",
        version="1.0",
        allowed_values=[
            "TWPT_BW",
            "TWPT_GRAY",
            "TWPT_RGB",
            "TWPT_PALETTE",
            "TWPT_CMY",
            "TWPT_CMYK",
            "TWPT_YUV",
            "TWPT_YUVK",
            "TWPT_CIEXYZ",
            "TWPT_LAB",
            "TWPT_SRGB",
            "TWPT_SRGB64",
            "TWPT_BGR",
            "TWPT_CIELAB",
            "TWPT_CIELUV",
            "TWPT_YCBCR",
            "TWPT_INFRARED",
        ],
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x1120: Capability(
        id=0x1120,
        name="planar_chunky",
        twain_type="TW_UINT16",
        doc="""Description:
Allows the application and Source to identify which color data formats are available. There are two options, “planar” and “chunky.”
For example, planar RGB data is transferred with the entire red plane of data first, followed by the entire green plane, followed by the entire blue plane (typical for three-pass scanners). “Chunky” mode repetitively interlaces a pixel from each plane until all the data is transferred (R-G-B-R-G-B…) (typical for one-pass scanners).""",
        version="1.0",
        allowed_values=["TWPC_CHUNKY", "TWPC_PLANAR"],
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x1121: Capability(
        id=0x1121,
        name="rotation",
        twain_type="TW_FIX32",
        doc="""Description:
How the Source can/should rotate the scanned image data prior to transfer. This doesn't use ICAP_UNITS. It is always measured in degrees. Any applied value is additive with any rotation specified in ICAP_ORIENTATION.""",
        version="1.0",
        allowed_values="+/- 360 degrees",
        containers=["TW_ONEVALUE", "TW_RANGE", "TW_ENUMERATION"],
    ),
    0x1113: Capability(
        id=0x1113,
        name="shadow",
        twain_type="TW_FIX32",
        doc="""Description:
Specifies which value in an image should be interpreted as the darkest “shadow.” All values “darker” than this value will be clipped to this value.

Application:
Whether darker values are smaller or larger can be determined by examining the Current value of ICAP_PIXELFLAVOR.

Source:
If more or less than 8 bits are used to describe the image, the actual data values should be normalized to fit within the 0-255 range. The normalization need not result in a homogeneous distribution if the original distribution was not homogeneous.""",
        version="1.0",
        allowed_values="0 to 255",
        containers=["TW_ONEVALUE", "TW_RANGE", "TW_ENUMERATION"],
    ),
    0x1138: Capability(
        id=0x1138,
        name="supported_barcode_types",
        twain_type="TW_UINT16",
        doc="""Description:
Provides a list of bar code types that can be detected by the current Data Source.
This is a read only capability.

Application:
Query this capability to determine if the Data Source can detect bar codes that are appropriate to the particular application.

Source:
If bar code detection is supported, report all the bar code types that can be detected.""",
        version="1.8",
        allowed_values=[
            "TWBT_2OF5DATALOGIC",
            "TWBT_2OF5IATA",
            "TWBT_2OF5INDUSTRIAL",
            "TWBT_2OF5INTERLEAVED",
            "TWBT_2OF5MATRIX",
            "TWBT_2OF5NONINTERLEAVED",
            "TWBT_3OF9",
            "TWBT_3OF9FULLASCII",
            "TWBT_CODABAR",
            "TWBT_CODABARWITHSTARTSTOP",
            "TWBT_CODE128",
            "TWBT_CODE93",
            "TWBT_EAN13",
            "TWBT_EAN8",
            "TWBT_MAXICODE",
            "TWBT_PDF417",
            "TWBT_POSTNET",
            "TWBT_QRCODE",
            "TWBT_UCC128",
            "TWBT_UPCA",
            "TWBT_UPCE",
        ],
        containers=["TW_ARRAY"],
    ),
    0x115E: Capability(
        id=0x115E,
        name="supported_ext_image_info",
        twain_type="TW_UINT16",
        doc="""Description:
Lists all of the information that the Source is capable of returning from a call to DAT_EXTIMAGEINFO.
This is a read only capability.

Application:
This capability mirrors CAP_SUPPORTEDCAPS. The array indicates all of the possible TWEI_ values the Source is capable of returning. It does not guarantee that all of these values will be returned for every call to DAT_EXTIMAGEINFO, because that depends on the negotiated capabilities and on what the device finds.
For instance, if the Source supports ICAP_BARCODEDETECTIONENABLED, then it may report TWEI_BARCODETEXT as part of this capability. However, if the image that was just captured has no barcode data, or if ICAP_BARCODEDETECTIONENABLED was disabled, then the Source can return TWRC_DATANOTAVAILABLE or TWRC_INFONOTSUPPORTED for that TW_INFO field, when the Application calls DAT_EXTIMAGEINFO.

Source:
The Source lists all of the TWEI_ values it is capable of returning in a call to DAT_EXTIMAGEINFO.""",
        version="2.1",
        allowed_values="An array of TWEI_* values",
        containers=["TW_ARRAY"],
    ),
    0x1140: Capability(
        id=0x1140,
        name="supported_patch_code_types",
        twain_type="TW_UINT16",
        doc="""Description:
A list of patch code types that may be detected by the current Data Source.
This is a read only capability.

Application:
Query this capability to determine if the Data Source can detect patch codes that are appropriate to the Application.

Source:
If patch code detection is supported, report all the possible patch code types that might be detected.""",
        version="1.8",
        allowed_values=["TWPCH_PATCH1", "TWPCH_PATCH2", "TWPCH_PATCH3", "TWPCH_PATCH4", "TWPCH_PATCH6", "TWPCH_PATCHT"],
        containers=["TW_ARRAY"],
    ),
    0x1122: Capability(
        id=0x1122,
        name="supported_sizes",
        twain_type="TW_UINT16",
        doc="""Description:
For devices that support fixed frame sizes. Defined sizes match typical page sizes. This specifies the size(s) the Source can/should use to acquire image data.
Note: TWSS_B has been removed from the specification.

Source:
The frame size selected by using this capability should be reflected in the TW_IMAGELAYOUT structure information.
If the Source cannot acquire the exact frame size specified by the application, it should provide the closest possible size (preferably acquiring an image that is larger than the requested frame in both axes).
For devices that support physical dimensions TWSS_NONE indicates that the maximum image size supported by the device is to be used. Devices that do not support physical dimensions should not support this capability.
Note: TWSS_MAXSIZE has been added to simplify negotiating for the entire acquisition area of a device, since TWSS_NONE was overloaded to mean both “a custom frame” and “the maximum image size.”""",
        version="1.0",
        allowed_values=[
            "TWSS_NONE",
            "TWSS_A4",
            "TWSS_B5LETTER",
            "TWSS_USLETTER",
            "TWSS_USLEGAL",
            "TWSS_A5",
            "TWSS_B4",
            "TWSS_B6",
            "TWSS_USLEDGER",
            "TWSS_USEXECUTIVE",
            "TWSS_A3",
            "TWSS_B3",
            "TWSS_A6",
            "TWSS_C4",
            "TWSS_C5",
            "TWSS_C6",
            "TWSS_4A0",
            "TWSS_2A0",
            "TWSS_A0",
            "TWSS_A1",
            "TWSS_A2",
            "TWSS_A7",
            "TWSS_A8",
            "TWSS_A9",
            "TWSS_A10",
            "TWSS_ISOB0",
            "TWSS_ISOB1",
            "TWSS_ISOB2",
            "TWSS_ISOB3",
            "TWSS_ISOB4",
            "TWSS_ISOB5",
            "TWSS_ISOB6",
            "TWSS_ISOB7",
            "TWSS_ISOB8",
            "TWSS_ISOB9",
            "TWSS_ISOB10",
            "TWSS_JISB0",
            "TWSS_JISB1",
            "TWSS_JISB2",
            "TWSS_JISB3",
            "TWSS_JISB4",
            "TWSS_JISB6",
            "TWSS_JISB7",
            "TWSS_JISB8",
            "TWSS_JISB9",
            "TWSS_JISB10",
            "TWSS_C0",
            "TWSS_C1",
            "TWSS_C2",
            "TWSS_C3",
            "TWSS_C7",
            "TWSS_C8",
            "TWSS_C9",
            "TWSS_C10",
            "TWSS_USSTATEMENT",
            "TWSS_BUSINESSCARD",
            "TWSS_MAXSIZE",
        ],
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x1123: Capability(
        id=0x1123,
        name="threshold",
        twain_type="TW_FIX32",
        doc="""Description:
Specifies the dividing line between black and white. This is the value the Source will use to threshold, if needed, when ICAP_PIXELTYPE = TWPT_BW.
The value is normalized so there are no units of measure associated with this ICAP.

Application:
Application will typically set ICAP_BITDEPTHREDUCTION to TWBR_THRESHOLD to use this capability.

Source:
Source should fit available values linearly into the defined range such that the lowest available value equals 0 and the highest equals 255.""",
        version="1.0",
        allowed_values="0 to 255",
        containers=["TW_ONEVALUE", "TW_RANGE", "TW_ENUMERATION"],
    ),
    0x111B: Capability(
        id=0x111B,
        name="tiles",
        twain_type="TW_BOOL",
        doc="""Description:
This is used with buffered memory transfers. If TRUE, Source can provide application with tiled image data.

Application:
If set to TRUE, the application expects the Source to supply tiled data for the upcoming transfer(s). This persists until the application sets it to FALSE. If the application sets it to FALSE, Source will supply strip data.

Source:
If Source can supply tiled data and application does not set this ICAP, Source may or may not supply tiled data at its discretion.
In State 6, ICAP_TILES should reflect whether tiles or strips will be used in the upcoming transfer.""",
        version="1.0",
        allowed_values=[True, False],
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x112A: Capability(
        id=0x112A,
        name="time_fill",
        twain_type="TW_UINT16",
        doc="""Description:
Used only with CCITT data compression. Specifies the minimum number of words of compressed codes (compressed data) to be transmitted per line.""",
        version="1.0",
        allowed_values="1 to 2^16",
        containers=["TW_ONEVALUE", "TW_RANGE"],
    ),
    0x112D: Capability(
        id=0x112D,
        name="undefined_image_size",
        twain_type="TW_BOOL",
        doc="""Description:
If TRUE the Source will issue a MSG_XFERREADY before starting the scan.
Note: The Source may need to scan the image before initiating the transfer. This is the case if the scanned image is rotated or merged with another scanned image.

Application:
Used by the application to notify the Source that the application accepts -1 as the image width or length in the TW_IMAGEINFO structure.""",
        version="1.6",
        allowed_values=[True, False],
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x0102: Capability(
        id=0x0102,
        name="units",
        twain_type="TW_UINT16",
        doc="""Description:
Unless a quantity is dimensionless or uses a specified unit of measure, ICAP_UNITS determines the unit of measure for all quantities.

Application:
Applications should be able to handle TWUN_PIXELS if they want to support data transfers from “dimensionless” devices such as digital cameras.""",
        version="1.0",
        allowed_values=[
            "TWUN_INCHES",
            "TWUN_CENTIMETERS",
            "TWUN_PICAS",
            "TWUN_POINTS",
            "TWUN_TWIPS",
            "TWUN_PIXELS",
            "TWUN_MILLIMETERS",
        ],
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x0103: Capability(
        id=0x0103,
        name="xfer_mech",
        twain_type="TW_UINT16",
        doc="""Description:
Allows the application and Source to identify which transfer mechanisms the source supports.

Application:
The current value of ICAP_XFERMECH must match the data argument type when starting the transfer using the triplet: DG_IMAGE / DAT_IMAGExxxxXFER / MSG_GET.""",
        version="1.0",
        allowed_values=["TWSX_NATIVE", "TWSX_FILE", "TWSX_MEMORY", "TWSX_MEMFILE"],
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x1116: Capability(
        id=0x1116,
        name="x_native_resolution",
        twain_type="TW_FIX32",
        doc="""Description:
The native optical resolution along the X-axis of the device being controlled by the Source. Most devices will respond with a single value (TW_ONEVALUE).
This is NOT a list of all resolutions that can be generated by the device. Rather, this is the resolution of the device's optics. Measured in units of pixels per unit as defined by ICAP_UNITS (pixels per TWUN_PIXELS yields dimensionless data).
This is a read only capability.""",
        version="1.0",
        allowed_values=">0",
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x1118: Capability(
        id=0x1118,
        name="x_resolution",
        twain_type="TW_FIX32",
        doc="""Description:
All the X-axis resolutions the Source can provide.
Measured in units of pixels per unit as defined by ICAP_UNITS (pixels per TWUN_PIXELS yields dimensionless data). That is, when the units are TWUN_PIXELS, both ICAP_XRESOLUTION and ICAP_YRESOLUTION shall report 1 pixel/pixel. Some data sources like to report the actual number of pixels that the device reports, but that response is more appropriate in ICAP_PHYSICALHEIGHT and ICAP_PHYSICALWIDTH.

Application:
Setting this value will restrict the various resolutions that will be available to the user during acquisition.
Applications will want to ensure that the values set for this ICAP match those set for ICAP_YRESOLUTION.""",
        version="1.0",
        allowed_values=">0",
        containers=["TW_ONEVALUE", "TW_RANGE", "TW_ENUMERATION"],
    ),
    0x1124: Capability(
        id=0x1124,
        name="x_scaling",
        twain_type="TW_FIX32",
        doc="""Description:
All the X-axis scaling values available. A value of '1.0' is equivalent to 100% scaling. Do not use values less than or equal to zero.

Application:
Applications will want to ensure that the values set for this ICAP match those set for ICAP_YSCALING. There are no units inherent with this data as it is normalized to 1.0 being “unscaled.”""",
        version="1.0",
        allowed_values=">0",
        containers=["TW_ONEVALUE", "TW_RANGE", "TW_ENUMERATION"],
    ),
    0x1117: Capability(
        id=0x1117,
        name="y_native_resolution",
        twain_type="TW_FIX32",
        doc="""Description:
The native optical resolution along the Y-axis of the device being controlled by the Source.
Measured in units of pixels per unit as defined by ICAP_UNITS (pixels per TWUN_PIXELS yields dimensionless data).
This is a read only capability.

Application:
Most devices will respond with a single value (TW_ONEVALUE). This is NOT a list of all resolutions that can be generated by the device. Rather, this is the resolution of the device's optics""",
        version="1.0",
        allowed_values=">0",
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x1119: Capability(
        id=0x1119,
        name="y_resolution",
        twain_type="TW_FIX32",
        doc="""Description:
All the Y-axis resolutions the Source can provide.
Measured in units of pixels per unit as defined by ICAP_UNITS (pixels per TWUN_PIXELS yields dimensionless data). That is, when the units are TWUN_PIXELS, both ICAP_XRESOLUTION and ICAP_YRESOLUTION shall report 1 pixel/pixel. Some data sources like to report the actual number of pixels that the device reports, but that response is more appropriate in ICAP_PHYSICALHEIGHT and ICAP_PHYSICALWIDTH.

Application:
Setting this value will restrict the various resolutions that will be available to the user during acquisition.
Applications will want to ensure that the values set for this ICAP match those set for ICAP_XRESOLUTION.""",
        version="1.0",
        allowed_values=">0",
        containers=["TW_ONEVALUE", "TW_RANGE", "TW_ENUMERATION"],
    ),
    0x1125: Capability(
        id=0x1125,
        name="y_scaling",
        twain_type="TW_FIX32",
        doc="""Description:
All the Y-axis scaling values available. A value of '1.0' is equivalent to 100% scaling. Do not use values less than or equal to zero.
There are no units inherent with this data as it is normalized to 1.0 being “unscaled.”

Application:
Applications will want to ensure that the values set for this ICAP match those set for ICAP_XSCALING.""",
        version="1.0",
        allowed_values=">0",
        containers=["TW_ONEVALUE", "TW_RANGE", "TW_ENUMERATION"],
    ),
    0x113E: Capability(
        id=0x113E,
        name="zoom_factor",
        twain_type="TW_INT16",
        doc="""Description:
When used with MSG_GET, return all camera supported lens zooming range.

Application:
Use this capability with MSG_SET to select one of the lens zooming value that the Source supports.""",
        version="1.8",
        allowed_values="Source dependent",
        containers=["TW_ONEVALUE", "TW_RANGE", "TW_ENUMERATION"],
    ),
}
