Table of Contents

Class RasterCachedImage

Namespace
Aspose.Imaging
Assembly
Aspose.Imaging.dll

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

public abstract class RasterCachedImage : RasterImage, IDisposable, IObjectWithBounds, IRasterImageArgb32PixelLoader, IRasterImageRawDataLoader, IHasXmpData, IHasMetadata
Inheritance
RasterCachedImage
Implements
Derived
Inherited Members

Constructors

RasterCachedImage()

Initializes a new instance of the RasterCachedImage class.

protected RasterCachedImage()

RasterCachedImage(IColorPalette)

Initializes a new instance of the RasterCachedImage class.

protected RasterCachedImage(IColorPalette colorPalette)

Parameters

colorPalette IColorPalette

The color palette.

Properties

IsCached

Gets a value indicating whether image data is cached currently.

public override bool IsCached { get; }

Property Value

bool

true if image data is cached; otherwise, false.

Methods

AdjustBrightness(int)

Adjust of a brightness for image.

public override void AdjustBrightness(int brightness)

Parameters

brightness int

Brightness value.

AdjustContrast(float)

Image contrasting

public override void AdjustContrast(float contrast)

Parameters

contrast float

Contrast value (in range [-100; 100])

AdjustGamma(float)

Gamma-correction of an image.

public override void AdjustGamma(float gamma)

Parameters

gamma float

Gamma for red, green and blue channels coefficient

AdjustGamma(float, float, float)

Gamma-correction of an image.

public override void AdjustGamma(float gammaRed, float gammaGreen, float gammaBlue)

Parameters

gammaRed float

Gamma for red channel coefficient

gammaGreen float

Gamma for green channel coefficient

gammaBlue float

Gamma for blue channel coefficient

BinarizeBradley(double)

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

public override void BinarizeBradley(double brightnessDifference)

Parameters

brightnessDifference double

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

BinarizeBradley(double, int)

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

public override void BinarizeBradley(double brightnessDifference, int windowSize)

Parameters

brightnessDifference double

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

windowSize int

The size of s x s window of pixels centered around this pixel

BinarizeFixed(byte)

Binarization of an image with predefined threshold

public override void BinarizeFixed(byte threshold)

Parameters

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()

Binarization of an image with Otsu thresholding

public override void BinarizeOtsu()

Blend(Point, RasterImage, Rectangle, byte)

Blends this image instance with the overlay image.

public override void Blend(Point origin, RasterImage overlay, Rectangle overlayArea, byte overlayAlpha = 255)

Parameters

origin Point

The background image blending origin.

overlay RasterImage

The overlay image.

overlayArea Rectangle

The overlay area.

overlayAlpha byte

The overlay alpha.

CacheData()

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

public override void CacheData()

Crop(Rectangle)

Cropping the image.

public override void Crop(Rectangle rectangle)

Parameters

rectangle Rectangle

The rectangle.

Dither(DitheringMethod, int, IColorPalette)

Performs dithering on the current image.

public override void Dither(DitheringMethod ditheringMethod, int bitsCount, IColorPalette customPalette)

Parameters

ditheringMethod DitheringMethod

The dithering method.

bitsCount int

The final bits count for dithering.

customPalette IColorPalette

The custom palette for dithering.

Grayscale()

Transformation of an image to its grayscale representation

public override void Grayscale()

OnCached()

Called when data is cached and all related resources may be de-allocated.

protected virtual void OnCached()

OnPaletteChanged(IColorPalette, IColorPalette)

Called when palette is changed.

protected override void OnPaletteChanged(IColorPalette oldPalette, IColorPalette newPalette)

Parameters

oldPalette IColorPalette

The old palette.

newPalette IColorPalette

The new palette.

Resize(int, int, ImageResizeSettings)

Resizes the image.

public override void Resize(int newWidth, int newHeight, ImageResizeSettings settings)

Parameters

newWidth int

The new width.

newHeight int

The new height.

settings ImageResizeSettings

The resize settings.

Resize(int, int, ResizeType)

Resizes the image.

public override void Resize(int newWidth, int newHeight, ResizeType resizeType)

Parameters

newWidth int

The new width.

newHeight int

The new height.

resizeType ResizeType

The resize type.

Rotate(float, bool, Color)

Rotate image around the center.

public override void Rotate(float angle, bool resizeProportionally, Color backgroundColor)

Parameters

angle float

The rotate angle in degrees. Positive values will rotate clockwise.

resizeProportionally bool

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 Color

Color of the background.

RotateFlip(RotateFlipType)

Rotates, flips, or rotates and flips the image.

public override void RotateFlip(RotateFlipType rotateFlipType)

Parameters

rotateFlipType RotateFlipType

The rotate flip type.

UpdateDimensions(int, int)

Updates the image dimensions.

protected abstract void UpdateDimensions(int newWidth, int newHeight)

Parameters

newWidth int

The new image width.

newHeight int

The new image height.