CodeGlyphX logo
CodeGlyphX

API Reference

Class

ImageDecodeOptions

Namespace CodeGlyphX
Assembly CodeGlyphX
Modifiers sealed

Options for decoding from image sources (non-QR). Use Int32)/Int32) or set explicit limits for untrusted inputs.

Inheritance

  • Object
  • ImageDecodeOptions

Usage

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Accepted by parameters

Constructors

public ImageDecodeOptions() #

Methods

public static ImageDecodeOptions Guarded(Int32 maxBytes = 67108864, Int64 maxPixels = 20000000, Int32 maxAnimationFrames = 120, Int32 maxAnimationDurationMs = 60000, Int64 maxAnimationFramePixels = 20000000, Int32 maxDimension = 0) #
Returns: ImageDecodeOptions

Guarded preset for untrusted images (caps bytes, pixels, and animation limits).

Parameters

maxBytes System.Int32 = 67108864 optionalposition: 0
maxPixels System.Int64 = 20000000 optionalposition: 1
maxAnimationFrames System.Int32 = 120 optionalposition: 2
maxAnimationDurationMs System.Int32 = 60000 optionalposition: 3
maxAnimationFramePixels System.Int64 = 20000000 optionalposition: 4
maxDimension System.Int32 = 0 optionalposition: 5
public static ImageDecodeOptions Screen(Int32 recognitionBudgetMilliseconds = 300, Int32 maxDimension = 1200) #
Returns: ImageDecodeOptions

Screen preset (budgeted decode for UI capture scenarios).

Parameters

recognitionBudgetMilliseconds System.Int32 = 300 optionalposition: 0
maxDimension System.Int32 = 1200 optionalposition: 1
public static ImageDecodeOptions Strict(Int32 maxBytes = 8388608, Int64 maxPixels = 8000000, Int32 maxAnimationFrames = 60, Int32 maxAnimationDurationMs = 15000, Int64 maxAnimationFramePixels = 8000000, Int32 maxDimension = 0) #
Returns: ImageDecodeOptions

Strict preset for untrusted images (tighter caps for hostile inputs).

Parameters

maxBytes System.Int32 = 8388608 optionalposition: 0
maxPixels System.Int64 = 8000000 optionalposition: 1
maxAnimationFrames System.Int32 = 60 optionalposition: 2
maxAnimationDurationMs System.Int32 = 15000 optionalposition: 3
maxAnimationFramePixels System.Int64 = 8000000 optionalposition: 4
maxDimension System.Int32 = 0 optionalposition: 5
WithJpegOptions 2 overloads
public ImageDecodeOptions WithJpegOptions(JpegDecodeOptions options) #
Returns: ImageDecodeOptions

Sets JPEG decoding options.

Parameters

options CodeGlyphX.Rendering.Jpeg.JpegDecodeOptions requiredposition: 0

Examples


var options = new ImageDecodeOptions()
    .WithJpegOptions(highQualityChroma: true, allowTruncated: true);
                
public ImageDecodeOptions WithJpegOptions(Boolean highQualityChroma = false, Boolean allowTruncated = false) #
Returns: ImageDecodeOptions

Sets JPEG decoding options.

Parameters

highQualityChroma System.Boolean = false optionalposition: 0
allowTruncated System.Boolean = false optionalposition: 1

Examples


var options = new ImageDecodeOptions()
    .WithJpegOptions(highQualityChroma: true);
                
public ImageDecodeOptions WithMaxAnimationDurationMs(Int32 maxDurationMs) #
Returns: ImageDecodeOptions

Sets the maximum total animation duration (milliseconds) allowed for decoding.

Parameters

maxDurationMs System.Int32 requiredposition: 0
public ImageDecodeOptions WithMaxAnimationFramePixels(Int64 maxPixels) #
Returns: ImageDecodeOptions

Sets the maximum pixel count allowed per animation frame.

Parameters

maxPixels System.Int64 requiredposition: 0
public ImageDecodeOptions WithMaxAnimationFrames(Int32 maxFrames) #
Returns: ImageDecodeOptions

Sets the maximum animation frame count allowed for decoding.

Parameters

maxFrames System.Int32 requiredposition: 0
public ImageDecodeOptions WithMaxBytes(Int32 maxBytes) #
Returns: ImageDecodeOptions

Sets the maximum input size in bytes for decoding.

Parameters

maxBytes System.Int32 requiredposition: 0
public ImageDecodeOptions WithMaxDimension(Int32 maxDimension) #
Returns: ImageDecodeOptions

Sets maximum image dimension (pixels) for decoding.

Parameters

maxDimension System.Int32 requiredposition: 0
public ImageDecodeOptions WithMaxPixels(Int64 maxPixels) #
Returns: ImageDecodeOptions

Sets the maximum pixel count allowed for decoding.

Parameters

maxPixels System.Int64 requiredposition: 0
WithRecognitionBudget 2 overloads
public ImageDecodeOptions WithRecognitionBudget(Int32 milliseconds) #
Returns: ImageDecodeOptions

Sets the cooperative symbol-recognition budget. Raster image decoding itself is not timed.

Parameters

milliseconds System.Int32 requiredposition: 0
public ImageDecodeOptions WithRecognitionBudget(Int32 milliseconds, Int32 maxDimension) #
Returns: ImageDecodeOptions

Sets the symbol-recognition time budget and maximum output dimension in one call.

Parameters

milliseconds System.Int32 requiredposition: 0
maxDimension System.Int32 requiredposition: 1

Properties

public Int32 MaxDimension { get; set; } #

Maximum output dimension, in pixels, for single-image decoding and symbol recognition. Raster codecs validate the original image against MaxPixels first, then resize the decoded RGBA output. Symbol recognition uses only that resized output and does not retry at the original resolution. This setting does not reduce codec memory use. Set to 0 to keep the original dimensions.

public Nullable<Int64> MaxPixels { get; set; } #

Maximum pixel count allowed for decoding (width * height). null uses MaxPixels; 0 disables this limit.

public Nullable<Int32> MaxBytes { get; set; } #

Maximum input size in bytes for decoding. null uses MaxImageBytes; 0 disables this limit.

public Int32 RecognitionBudgetMilliseconds { get; set; } #

Cooperative time budget, in milliseconds, for barcode and matrix recognition after raster decoding. Image codecs do not use this value. Multi-format CodeGlyph entry points apply the budget to each candidate decoder rather than to the complete candidate sequence. Set to 0 to disable the recognition budget.

public Nullable<Int32> MaxAnimationFrames { get; set; } #

Maximum animation frame count allowed for decoding. null uses MaxAnimationFrames; 0 disables this limit.

public Nullable<Int32> MaxAnimationDurationMs { get; set; } #

Maximum total animation duration, in milliseconds, allowed for decoding. null uses MaxAnimationDurationMs; 0 disables this limit.

public Nullable<Int64> MaxAnimationFramePixels { get; set; } #

Maximum pixel count allowed per animation frame. null uses MaxAnimationFramePixels; 0 disables this limit.

public Nullable<JpegDecodeOptions> JpegOptions { get; set; } #

Optional JPEG decoding options (chroma upsampling, truncated handling).