public final class DjvuImage extends RasterImage
DjvuDocument class
Modifier and Type | Field and Description |
---|---|
com.aspose.ms.lang.Event<com.aspose.ms.System.ComponentModel.PropertyChangedEventHandler> |
PropertyChanged |
Constructor and Description |
---|
DjvuImage(InputStream stream)
Initializes a new instance of the
DjvuImage class. |
DjvuImage(InputStream stream,
LoadOptions loadOptions)
Initializes a new instance of the
DjvuImage class. |
DjvuImage(com.aspose.ms.System.IO.Stream stream,
LoadOptions loadOptions) |
Modifier and Type | Method and Description |
---|---|
void |
adjustBrightness(int brightness)
Adjust of a brightness for image.
|
void |
adjustContrast(float contrast)
Image contrasting
|
void |
adjustGamma(float gamma)
Gamma-correction of an image.
|
void |
adjustGamma(float gammaRed,
float gammaGreen,
float gammaBlue)
Gamma-correction of an image.
|
void |
binarizeBradley(double brightnessDifference)
Binarization of an image using Bradley's adaptive thresholding algorithm using the integral image thresholding
|
void |
binarizeBradley(double brightnessDifference,
int windowSize)
Binarization of an image using Bradley's adaptive thresholding algorithm using the integral image thresholding
|
void |
binarizeFixed(byte threshold)
Binarization of an image with predefined threshold
|
void |
binarizeOtsu()
Binarization of an image with Otsu thresholding
|
void |
cacheData()
Caches the data and ensures no additional data loading will be performed from the underlying
DataStreamSupporter.DataStreamContainer . |
void |
crop(Rectangle rectangle)
Cropping the image.
|
void |
dither(int ditheringMethod,
int bitsCount,
IColorPalette customPalette)
Performs dithering on the current image.
|
void |
filter(Rectangle rectangle,
FilterOptionsBase options)
Filters the specified rectangle.
|
DjvuPage |
getActivePage()
Gets or sets the currently active page
|
int |
getBitsPerPixel()
Gets the image bits per pixel count.
|
long |
getFileFormat()
Gets a value of file format
|
DjvuPage |
getFirstPage()
Gets the first page of the document
|
int |
getHeight()
Gets the image height.
|
int |
getIdentifier()
Gets the unique identifier for the document
|
float |
getImageOpacity()
Gets opacity of this image.
|
DjvuPage |
getLastPage()
Gets the last page of the document
|
DjvuPage |
getNextPage()
Gets the next page of the document
|
DjvuPage[] |
getPages()
Gets the pages for the document
|
DjvuPage |
getPreviousPage()
Gets the previous page of the document
|
int |
getWidth()
Gets the image width.
|
void |
grayscale()
Transformation of an image to its grayscale representation
|
boolean |
isCached()
Gets a value indicating whether object's data is cached currently and no data readig is required.
|
static DjvuImage |
loadDocument(InputStream stream)
Loads the document.
|
static DjvuImage |
loadDocument(InputStream stream,
LoadOptions loadOptions)
Loads the document.
|
void |
replaceColor(int oldColorArgb,
byte oldColorDiff,
int newColorArgb)
Replaces one color to another with allowed difference and preserves original alpha value to save smooth edges.
|
void |
replaceNonTransparentColors(int newColorArgb)
Replaces all non-transparent colors with new color and preserves original alpha value to save smooth edges.
|
void |
resize(int newWidth,
int newHeight,
ImageResizeSettings settings)
Resizes the image with extended options.
|
void |
resize(int newWidth,
int newHeight,
int resizeType)
Resizes the image.
|
void |
resizeHeightProportionally(int newHeight,
int resizeType)
Resizes the height proportionally.
|
void |
resizeWidthProportionally(int newWidth,
int resizeType)
Resizes the width proportionally.
|
void |
rotate(float angle,
boolean resizeProportionally,
Color backgroundColor)
Rotate image around the center.
|
void |
rotateFlip(int rotateFlipType)
Rotates, flips, or rotates and flips the Active frame only.
|
void |
rotateFlipAll(int rotateFlip)
Rotates the flip all frames in image.
|
void |
setActivePage(DjvuPage value)
Gets or sets the currently active page
|
crop, dither, getArgb32Pixel, getDefaultArgb32Pixels, getDefaultPixels, getDefaultRawData, getDefaultRawData, getHorizontalResolution, getModifyDate, getPixel, getPremultiplyComponents, getRawCustomColorConverter, getRawDataFormat, getRawDataSettings, getRawFallbackIndex, getRawIndexedColorConverter, getRawLineSize, getTransparentColor, getUpdateXmpData, getUseRawData, getVerticalResolution, getXmpData, hasAlpha, hasTransparentColor, isRawDataAvailable, loadArgb32Pixels, loadArgb64Pixels, loadCmyk32Pixels, loadCmykPixels, loadPartialArgb32Pixels, loadPartialPixels, loadPixels, loadRawData, loadRawData, readArgb32ScanLine, readScanLine, replaceColor, replaceNonTransparentColors, rotate, saveArgb32Pixels, saveCmyk32Pixels, saveCmykPixels, savePixels, saveRawData, setArgb32Pixel, setHorizontalResolution, setPalette, setPixel, setPremultiplyComponents, setRawCustomColorConverter, setRawFallbackIndex, setRawIndexedColorConverter, setResolution, setTransparentColor, setTransparentColor, setUpdateXmpData, setUseRawData, setVerticalResolution, setXmpData, toBitmap, writeArgb32ScanLine, writeScanLine
canLoad, canLoad, canLoad, canLoad, canSave, create, getBackgroundColor, getBounds, getContainer, getDefaultOptions, getFileFormat, getFileFormat, getFittingRectangle, getFittingRectangle, getInterruptMonitor, getOriginalOptions, getPalette, getProportionalHeight, getProportionalWidth, getSize, hasBackgroundColor, isAutoAdjustPalette, load, load, load, load, load, load, resize, resizeHeightProportionally, resizeHeightProportionally, resizeWidthProportionally, resizeWidthProportionally, save, save, save, save, save, save, save, setAutoAdjustPalette, setBackgroundColor, setBackgroundColor, setInterruptMonitor, setPalette
getDataStreamContainer, save, save, save, save
close, dispose, getDisposed
public final com.aspose.ms.lang.Event<com.aspose.ms.System.ComponentModel.PropertyChangedEventHandler> PropertyChanged
public DjvuImage(InputStream stream)
Initializes a new instance of the DjvuImage
class.
stream
- The stream.DjvuImageException
- Stream is emptypublic DjvuImage(InputStream stream, LoadOptions loadOptions)
Initializes a new instance of the DjvuImage
class.
stream
- The stream to load from.loadOptions
- The load options.DjvuImageException
- Stream is emptypublic DjvuImage(com.aspose.ms.System.IO.Stream stream, LoadOptions loadOptions)
public int getIdentifier()
Gets the unique identifier for the document
public DjvuPage[] getPages()
Gets the pages for the document
public DjvuPage getActivePage()
Gets or sets the currently active page
DjvuImageException
- There is no active page selected.public void setActivePage(DjvuPage value)
Gets or sets the currently active page
value
- The active page.DjvuImageException
- When the active page cannot be set as it belongs to another image.public DjvuPage getFirstPage()
Gets the first page of the document
DjvuImageException
- The first page can not be foundpublic DjvuPage getLastPage()
Gets the last page of the document
DjvuImageException
- The last page can not be foundpublic DjvuPage getNextPage()
Gets the next page of the document
DjvuImageException
- The next page can not be foundpublic DjvuPage getPreviousPage()
Gets the previous page of the document
DjvuImageException
- The previous page can not be foundpublic int getBitsPerPixel()
Gets the image bits per pixel count.
getBitsPerPixel
in class Image
public int getHeight()
Gets the image height.
getHeight
in interface IObjectWithBounds
getHeight
in class Image
public int getWidth()
Gets the image width.
getWidth
in interface IObjectWithBounds
getWidth
in class Image
public final boolean isCached()
Gets a value indicating whether object's data is cached currently and no data readig is required.
isCached
in class DataStreamSupporter
true
if object's data is cached; otherwise, false
.public float getImageOpacity()
Gets opacity of this image. 0 = fully transparent, 1 = fully opaque.
getImageOpacity
in class RasterImage
public long getFileFormat()
Gets a value of file format
getFileFormat
in class Image
public static DjvuImage loadDocument(InputStream stream)
Loads the document.
stream
- The stream.public static DjvuImage loadDocument(InputStream stream, LoadOptions loadOptions)
Loads the document.
stream
- The stream.loadOptions
- The load options.public void resize(int newWidth, int newHeight, int resizeType)
Resizes the image.
resize
in class RasterImage
newWidth
- The new width.newHeight
- The new height.resizeType
- The resize type.public void resize(int newWidth, int newHeight, ImageResizeSettings settings)
Resizes the image with extended options.
resize
in class RasterImage
newWidth
- The new width.newHeight
- The new height.settings
- The resize settings.public void resizeHeightProportionally(int newHeight, int resizeType)
Resizes the height proportionally.
resizeHeightProportionally
in class Image
newHeight
- The new height.resizeType
- Type of the resize.public void resizeWidthProportionally(int newWidth, int resizeType)
Resizes the width proportionally.
resizeWidthProportionally
in class Image
newWidth
- The new width.resizeType
- Type of the resize.public void crop(Rectangle rectangle)
Cropping the image.
crop
in class RasterImage
rectangle
- The rectangle.public void rotateFlip(int rotateFlipType)
Rotates, flips, or rotates and flips the Active frame only.
rotateFlip
in class Image
rotateFlipType
- The rotate flip type.public void grayscale()
Transformation of an image to its grayscale representation
grayscale
in class RasterImage
public void binarizeFixed(byte threshold)
Binarization of an image with predefined threshold
binarizeFixed
in class RasterImage
threshold
- Threshold value. If corresponding gray value of a pixel is greater than threshold, a value of 255 will be assigned to it, 0 otherwise.public void binarizeOtsu()
Binarization of an image with Otsu thresholding
binarizeOtsu
in class RasterImage
public void binarizeBradley(double brightnessDifference, int windowSize)
Binarization of an image using Bradley's adaptive thresholding algorithm using the integral image thresholding
binarizeBradley
in class RasterImage
brightnessDifference
- The brightness difference between pixel and the average of an s x s window of pixels centered around this pixel.windowSize
- The size of s x s window of pixels centered around this pixelpublic void binarizeBradley(double brightnessDifference)
Binarization of an image using Bradley's adaptive thresholding algorithm using the integral image thresholding
binarizeBradley
in class RasterImage
brightnessDifference
- The brightness difference between pixel and the average of an s x s window of pixels centered around this pixel.public void adjustBrightness(int brightness)
Adjust of a brightness for image.
adjustBrightness
in class RasterImage
brightness
- Brightness value.public void adjustContrast(float contrast)
Image contrasting
adjustContrast
in class RasterImage
contrast
- Contrast value (in range [-100; 100])public void adjustGamma(float gammaRed, float gammaGreen, float gammaBlue)
Gamma-correction of an image.
adjustGamma
in class RasterImage
gammaRed
- Gamma for red channel coefficientgammaGreen
- Gamma for green channel coefficientgammaBlue
- Gamma for blue channel coefficientpublic void adjustGamma(float gamma)
Gamma-correction of an image.
adjustGamma
in class RasterImage
gamma
- Gamma for red, green and blue channels coefficientpublic void rotateFlipAll(int rotateFlip)
Rotates the flip all frames in image.
rotateFlip
- The rotate flip type.public void rotate(float angle, boolean resizeProportionally, Color backgroundColor)
Rotate image around the center.
rotate
in class RasterImage
angle
- The rotate angle in degrees. Positive values will rotate clockwise.resizeProportionally
- 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 of the background.public final void cacheData()
Caches the data and ensures no additional data loading will be performed from the underlying DataStreamSupporter.DataStreamContainer
.
cacheData
in class DataStreamSupporter
public void dither(int ditheringMethod, int bitsCount, IColorPalette customPalette)
Performs dithering on the current image.
dither
in class RasterImage
ditheringMethod
- The dithering method.bitsCount
- The final bits count for dithering.customPalette
- The custom palette for dithering.public void filter(Rectangle rectangle, FilterOptionsBase options)
Filters the specified rectangle.
filter
in class RasterImage
rectangle
- The rectangle.options
- The options.public void replaceColor(int oldColorArgb, byte oldColorDiff, int newColorArgb)
Replaces one color to another with allowed difference and preserves original alpha value to save smooth edges.
replaceColor
in class RasterImage
oldColorArgb
- Old color ARGB value to be replaced.oldColorDiff
- Allowed difference in old color to be able to widen replaced color tone.newColorArgb
- New color ARGB value to replace old color with.public void replaceNonTransparentColors(int newColorArgb)
Replaces all non-transparent colors with new color and preserves original alpha value to save smooth edges. Note: if you use it on images without transparency, all colors will be replaced with a single one.
replaceNonTransparentColors
in class RasterImage
newColorArgb
- New color ARGB value to replace non transparent colors with.Copyright (c) 2008-2018 Aspose Pty Ltd. All Rights Reserved.