AdaptiveWhiteStretchFilterOptions

Inheritance: java.lang.Object, com.aspose.imaging.imagefilters.filteroptions.FilterOptionsBase

public class AdaptiveWhiteStretchFilterOptions extends FilterOptionsBase

Provides options for configuring the Adaptive White Stretch filter. Allows customization of histogram stretch parameters to enhance the white level and improve the readability of faint-text or low-contrast document images.

Constructors

ConstructorDescription
AdaptiveWhiteStretchFilterOptions()
AdaptiveWhiteStretchFilterOptions(boolean isGrayscale)
AdaptiveWhiteStretchFilterOptions(boolean isGrayscale, int lowPercentile)
AdaptiveWhiteStretchFilterOptions(boolean isGrayscale, int lowPercentile, int highPercentile)
AdaptiveWhiteStretchFilterOptions(boolean isGrayscale, int lowPercentile, int highPercentile, int targetWhite)
AdaptiveWhiteStretchFilterOptions(boolean isGrayscale, int lowPercentile, int highPercentile, int targetWhite, float maxScale)Initializes a new instance of the AdaptiveWhiteStretchFilter class.

Methods

MethodDescription
isGrayscale()Gets a value indicating whether the filter operates in grayscale mode.
getLowPercentile()Gets the lower percentile for black point calculation.
getHighPercentile()Gets the upper percentile for white point calculation.
getTargetWhite()Gets the target white value the stretch aims to achieve.
getMaxScale()Gets the maximum allowed brightness scale.

AdaptiveWhiteStretchFilterOptions()

public AdaptiveWhiteStretchFilterOptions()

AdaptiveWhiteStretchFilterOptions(boolean isGrayscale)

public AdaptiveWhiteStretchFilterOptions(boolean isGrayscale)

Parameters:

ParameterTypeDescription
isGrayscaleboolean

AdaptiveWhiteStretchFilterOptions(boolean isGrayscale, int lowPercentile)

public AdaptiveWhiteStretchFilterOptions(boolean isGrayscale, int lowPercentile)

Parameters:

ParameterTypeDescription
isGrayscaleboolean
lowPercentileint

AdaptiveWhiteStretchFilterOptions(boolean isGrayscale, int lowPercentile, int highPercentile)

public AdaptiveWhiteStretchFilterOptions(boolean isGrayscale, int lowPercentile, int highPercentile)

Parameters:

ParameterTypeDescription
isGrayscaleboolean
lowPercentileint
highPercentileint

AdaptiveWhiteStretchFilterOptions(boolean isGrayscale, int lowPercentile, int highPercentile, int targetWhite)

public AdaptiveWhiteStretchFilterOptions(boolean isGrayscale, int lowPercentile, int highPercentile, int targetWhite)

Parameters:

ParameterTypeDescription
isGrayscaleboolean
lowPercentileint
highPercentileint
targetWhiteint

AdaptiveWhiteStretchFilterOptions(boolean isGrayscale, int lowPercentile, int highPercentile, int targetWhite, float maxScale)

public AdaptiveWhiteStretchFilterOptions(boolean isGrayscale, int lowPercentile, int highPercentile, int targetWhite, float maxScale)

Initializes a new instance of the AdaptiveWhiteStretchFilter class.

Parameters:

ParameterTypeDescription
isGrayscalebooleanIndicates whether the filter should operate in grayscale mode.
lowPercentileintLower percentile for black point (e.g. 10).
highPercentileintUpper percentile for white point (e.g. 90).
targetWhiteintTarget white value (e.g. 240).
maxScalefloatMaximum allowed brightness scale (e.g. 1.7).

The algorithm stretches the histogram so that the white percentile approaches targetWhite, but without exceeding maxScale to avoid over-brightening. |

isGrayscale()

public final boolean isGrayscale()

Gets a value indicating whether the filter operates in grayscale mode.

Returns: boolean - a value indicating whether the filter operates in grayscale mode.

getLowPercentile()

public final int getLowPercentile()

Gets the lower percentile for black point calculation. Pixel values below this percentile are considered as black during stretching.

Returns: int - the lower percentile for black point calculation.

getHighPercentile()

public final int getHighPercentile()

Gets the upper percentile for white point calculation. Pixel values above this percentile are considered as white during stretching.

Returns: int - the upper percentile for white point calculation.

getTargetWhite()

public final int getTargetWhite()

Gets the target white value the stretch aims to achieve.

Returns: int - the target white value the stretch aims to achieve.

getMaxScale()

public final float getMaxScale()

Gets the maximum allowed brightness scale. The actual stretching will not exceed this factor, to avoid over-brightening.

Returns: float - the maximum allowed brightness scale.