RasterCachedImage
Inheritance: java.lang.Object, RasterImage
Represents a raster image supporting raster graphics operations. This image caches pixel data when required.
Methods
| Method | Description |
|---|---|
| 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:
| Parameter | Type | Description |
|---|---|---|
| newWidth | int | The new width. |
| newHeight | int | The new height. |
| resizeType | int | The resize type. |
resize(int newWidth, int newHeight, ImageResizeSettings settings)
public final void resize(int newWidth, int newHeight, ImageResizeSettings settings)
Resizes the image.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| newWidth | int | The new width. |
| newHeight | int | The new height. |
| settings | ImageResizeSettings | The 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:
| Parameter | Type | Description |
|---|---|---|
| angle | float | The rotate angle in degrees. Positive values will rotate clockwise. |
| resizeProportionally | boolean | if 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. |
| backgroundColor | com.aspose.cad.Color | Color of the background. |
crop(com.aspose.cad.Rectangle rectangle)
public void crop(com.aspose.cad.Rectangle rectangle)
Cropping the image.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| rectangle | com.aspose.cad.Rectangle | The 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:
| Parameter | Type | Description |
|---|---|---|
| ditheringMethod | int | The dithering method. |
| bitsCount | int | The final bits count for dithering. |
| customPalette | com.aspose.cad.IColorPalette | The 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:
| Parameter | Type | Description |
|---|---|---|
| threshold | byte | Threshold 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:
| Parameter | Type | Description |
|---|---|---|
| brightnessDifference | double | The 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:
| Parameter | Type | Description |
|---|---|---|
| brightness | int | Brightness value. |
adjustContrast(float contrast)
public void adjustContrast(float contrast)
Image contrasting
Parameters:
| Parameter | Type | Description |
|---|---|---|
| contrast | float | Contrast 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:
| Parameter | Type | Description |
|---|---|---|
| gammaRed | float | Gamma for red channel coefficient |
| gammaGreen | float | Gamma for green channel coefficient |
| gammaBlue | float | Gamma for blue channel coefficient |
adjustGamma(float gamma)
public void adjustGamma(float gamma)
Gamma-correction of an image.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| gamma | float | Gamma 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:
| Parameter | Type | Description |
|---|---|---|
| newPalette | com.aspose.cad.IColorPalette | New 32-bit ARGB palette. |