RasterCachedImage

Inheritance: java.lang.Object, RasterImage

Represents a raster image supporting raster graphics operations. This image caches pixel data when required.

Methods

MethodDescription
isCached()Gets a value indicating whether image data is cached currently.
cacheData()Caches the data and ensures no additional data loading will be performed from the underlying DataStreamSupporter.DataStreamContainer .
resize(int newWidth, int newHeight, int resizeType)Resizes the image.
resize(int newWidth, int newHeight, ImageResizeSettings settings)Resizes the image.
rotate(float angle, boolean resizeProportionally, com.aspose.cad.Color backgroundColor)Rotate image around the center.
crop(com.aspose.cad.Rectangle rectangle)Cropping the image.
dither(int ditheringMethod, int bitsCount, com.aspose.cad.IColorPalette customPalette)Performs dithering on the current image.
grayscale()Transformation of an image to its grayscale representation
binarizeFixed(byte threshold)Binarization of an image with predefined threshold
binarizeOtsu()Binarization of an image with Otsu thresholding
binarizeBradley(double brightnessDifference)Binarization of an image using Bradley’s adaptive thresholding algorithm using the integral image thresholding
adjustBrightness(int brightness)Adjust of a brightness for image.
adjustContrast(float contrast)Image contrasting
adjustGamma(float gammaRed, float gammaGreen, float gammaBlue)Gamma-correction of an image.
adjustGamma(float gamma)Gamma-correction of an image.
getFormatSpecificPalette()Gets palette from format-specific places
setFormatSpecificPalette(com.aspose.cad.IColorPalette newPalette)Sets palette into format-specific places

isCached()

public final boolean isCached()

Gets a value indicating whether image data is cached currently.

Returns: boolean - true if image data is cached; otherwise, false .

cacheData()

public final void cacheData()

Caches the data and ensures no additional data loading will be performed from the underlying DataStreamSupporter.DataStreamContainer .

resize(int newWidth, int newHeight, int resizeType)

public final void resize(int newWidth, int newHeight, int resizeType)

Resizes the image.

Parameters:

ParameterTypeDescription
newWidthintThe new width.
newHeightintThe new height.
resizeTypeintThe resize type.

resize(int newWidth, int newHeight, ImageResizeSettings settings)

public final void resize(int newWidth, int newHeight, ImageResizeSettings settings)

Resizes the image.

Parameters:

ParameterTypeDescription
newWidthintThe new width.
newHeightintThe new height.
settingsImageResizeSettingsThe resize settings.

rotate(float angle, boolean resizeProportionally, com.aspose.cad.Color backgroundColor)

public void rotate(float angle, boolean resizeProportionally, com.aspose.cad.Color backgroundColor)

Rotate image around the center.

Parameters:

ParameterTypeDescription
anglefloatThe rotate angle in degrees. Positive values will rotate clockwise.
resizeProportionallybooleanif set to true you will have your image size changed according to rotated rectangle (corner points) projections in other case that leaves dimensions untouched and only internal image contents are rotated.
backgroundColorcom.aspose.cad.ColorColor of the background.

crop(com.aspose.cad.Rectangle rectangle)

public void crop(com.aspose.cad.Rectangle rectangle)

Cropping the image.

Parameters:

ParameterTypeDescription
rectanglecom.aspose.cad.RectangleThe rectangle.

dither(int ditheringMethod, int bitsCount, com.aspose.cad.IColorPalette customPalette)

public void dither(int ditheringMethod, int bitsCount, com.aspose.cad.IColorPalette customPalette)

Performs dithering on the current image.

Parameters:

ParameterTypeDescription
ditheringMethodintThe dithering method.
bitsCountintThe final bits count for dithering.
customPalettecom.aspose.cad.IColorPaletteThe custom palette for dithering.

grayscale()

public void grayscale()

Transformation of an image to its grayscale representation

binarizeFixed(byte threshold)

public void binarizeFixed(byte threshold)

Binarization of an image with predefined threshold

Parameters:

ParameterTypeDescription
thresholdbyteThreshold value. If corresponding gray value of a pixel is greater than threshold, a value of 255 will be assigned to it, 0 otherwise.

binarizeOtsu()

public void binarizeOtsu()

Binarization of an image with Otsu thresholding

binarizeBradley(double brightnessDifference)

public void binarizeBradley(double brightnessDifference)

Binarization of an image using Bradley’s adaptive thresholding algorithm using the integral image thresholding

Parameters:

ParameterTypeDescription
brightnessDifferencedoubleThe brightness difference between pixel and the average of an s x s window of pixels centered around this pixel.

adjustBrightness(int brightness)

public void adjustBrightness(int brightness)

Adjust of a brightness for image.

Parameters:

ParameterTypeDescription
brightnessintBrightness value.

adjustContrast(float contrast)

public void adjustContrast(float contrast)

Image contrasting

Parameters:

ParameterTypeDescription
contrastfloatContrast value (in range [-100; 100])

adjustGamma(float gammaRed, float gammaGreen, float gammaBlue)

public void adjustGamma(float gammaRed, float gammaGreen, float gammaBlue)

Gamma-correction of an image.

Parameters:

ParameterTypeDescription
gammaRedfloatGamma for red channel coefficient
gammaGreenfloatGamma for green channel coefficient
gammaBluefloatGamma for blue channel coefficient

adjustGamma(float gamma)

public void adjustGamma(float gamma)

Gamma-correction of an image.

Parameters:

ParameterTypeDescription
gammafloatGamma for red, green and blue channels coefficient

getFormatSpecificPalette()

public com.aspose.cad.IColorPalette getFormatSpecificPalette()

Gets palette from format-specific places

Returns: com.aspose.cad.IColorPalette - Format-specific IColorPalette .

setFormatSpecificPalette(com.aspose.cad.IColorPalette newPalette)

public void setFormatSpecificPalette(com.aspose.cad.IColorPalette newPalette)

Sets palette into format-specific places

Parameters:

ParameterTypeDescription
newPalettecom.aspose.cad.IColorPaletteNew 32-bit ARGB palette.