public class WebPImage
extends com.aspose.imaging.RasterCachedImage
A webp image.
Constructor and Description |
---|
WebPImage(InputStream stream)
Initializes a new instance of the
WebPImage class
from stream. |
WebPImage(int width,
int height,
WebPOptions options)
Initializes a new instance of the
WebPImage class
with empty image. |
WebPImage(RasterImage rasterImage)
Initializes a new instance of the
WebPImage class
from rasterImage. |
WebPImage(String path)
Initializes a new instance of the
WebPImage class
from file. |
Modifier and Type | Method and Description |
---|---|
void |
addBlock(IFrame block)
Adds a new Webp block.
|
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 |
binarizeFixed(byte threshold)
Binarization of an image with predefined threshold
|
void |
binarizeOtsu()
Binarization of an image with Otsu thresholding
|
void |
clearBlocks()
Clears all the Webp blocks.
|
static WebPImage |
createInstance_internalized(int width,
int height,
int pixelFormat,
IRasterImagePixelLoader rasterImagePixelLoader)
Creates a new instance of the
WebPImage |
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.
|
int |
getBitsPerPixel()
Gets the image bits per pixel count.
|
IFrame[] |
getBlocks()
Gets the blocks.
|
int |
getHeight()
Gets the image height.
|
WebPOptions |
getOptions()
Gets or sets the options.
|
int |
getWidth()
Gets the image width.
|
void |
grayscale()
Transformation of an image to its grayscale representation
|
boolean |
hasAlpha()
Gets a value indicating whether this instance has alpha.
|
void |
insertBlock(int index,
IFrame block)
Adds a new Webp block.
|
void |
loadDataFromStreamInternal_internalized(com.aspose.ms.System.IO.Stream stream) |
void |
removeBlock(IFrame block)
Removes the Webp block.
|
void |
rotate(float angle,
boolean resizeProportionally,
Color backgroundColor)
WebPImage.Rotate image around the center. |
void |
rotateFlipAll(int rotateFlip)
Rotates the flip all frames in the image.
|
static void |
saveWebp_internalized(RasterImage inputImage,
com.aspose.ms.System.IO.Stream stream,
Rectangle destImageBounds,
WebPOptions options)
Export to the webp.
|
beginResize_internalized, binarizeBradley, cacheData, getFormatSpecificPalette_internalized, isCached, resize, resize, rotateFlip, setFormatSpecificPalette_internalized
crop, dither, getArgb32Pixel, getDefaultArgb32Pixels, getDefaultPixels, getDefaultRawData, getDefaultRawData, getHorizontalResolution, getPixel, getRawCustomColorConverter, getRawDataFormat, getRawDataSettings, getRawFallbackIndex, getRawIndexedColorConverter, getRawLineSize, getTransparentColor, getVerticalResolution, getXmpData, hasTransparentColor, isRawDataAvailable, loadArgb32Pixels, loadCmykPixels, loadPartialArgb32Pixels, loadPartialPixels, loadPixels, loadRawData, readScanLine, rotate, saveArgb32Pixels, saveCmykPixels, savePixels, saveRawData, setArgb32Pixel, setHorizontalResolution, setPalette, setPixel, setRawCustomColorConverter, setRawFallbackIndex, setRawIndexedColorConverter, setResolution, setTransparentColor, setTransparentColor, setVerticalResolution, setXmpData, writeScanLine
canLoad, canLoad, canLoad, canLoad, canLoadInternal_internalized, canLoadInternal_internalized, canSave, create, getBackgroundColor, getBounds, getContainer, getFileFormat, getFileFormat, getFileFormatInternal_internalized, getFittingRectangle, getFittingRectangle, getPalette, getProportionalHeight, getProportionalWidth, getSize, getVentureLicense_internalized, hasBackgroundColor, load, load, load, load, loadInternal_internalized, loadInternal_internalized, resize, resizeHeightProportionally, resizeHeightProportionally, resizeHeightProportionally, resizeWidthProportionally, resizeWidthProportionally, resizeWidthProportionally, save_internalized, save, save, save, save, save, setBackgroundColor, setBackgroundColor, setContainer_internalized, setPalette, setVentureLicense_internalized
getDataStreamContainer, save_internalized, save, save, save, setDataStreamContainer
close, dispose, getDisposed
public WebPImage(InputStream stream)
Initializes a new instance of the WebPImage
class
from stream.
stream
- The stream WebP image.public WebPImage(String path)
Initializes a new instance of the WebPImage
class
from file.
path
- The path to file WebP Imagepublic WebPImage(RasterImage rasterImage)
Initializes a new instance of the WebPImage
class
from rasterImage.
rasterImage
- The raster image.public WebPImage(int width, int height, WebPOptions options)
Initializes a new instance of the WebPImage
class
with empty image.
width
- The image widthheight
- The image height.options
- The options.public WebPOptions getOptions()
Gets or sets the options.
Value: The options.public int getBitsPerPixel()
Gets the image bits per pixel count.
Value: The image bits per pixel count.getBitsPerPixel
in class Image
public int getHeight()
Gets the image height.
Value: The image height.getHeight
in interface IObjectWithBounds
getHeight
in class Image
public int getWidth()
Gets the image width.
Value: The image width.getWidth
in interface IObjectWithBounds
getWidth
in class Image
public IFrame[] getBlocks()
Gets the blocks.
Gets the Webp blocks.
Value: The blocks.public boolean hasAlpha()
Gets a value indicating whether this instance has alpha.
Value:true
if this instance has alpha; otherwise, false
.hasAlpha
in class RasterImage
public void adjustBrightness(int brightness)
Adjust of a brightness
for image.
adjustBrightness
in class com.aspose.imaging.RasterCachedImage
brightness
- Brightness value.public void adjustContrast(float contrast)
Image
contrasting
adjustContrast
in class com.aspose.imaging.RasterCachedImage
contrast
- Contrast value (in range [-100; 100])public void adjustGamma(float gammaRed, float gammaGreen, float gammaBlue)
Gamma-correction of an image.
adjustGamma
in class com.aspose.imaging.RasterCachedImage
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 com.aspose.imaging.RasterCachedImage
gamma
- Gamma for red, green and blue channels coefficientpublic void binarizeFixed(byte threshold)
Binarization of an image with predefined threshold
binarizeFixed
in class com.aspose.imaging.RasterCachedImage
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 com.aspose.imaging.RasterCachedImage
public void crop(Rectangle rectangle)
Cropping the image.
crop
in class com.aspose.imaging.RasterCachedImage
rectangle
- The rectangle.public void dither(int ditheringMethod, int bitsCount, IColorPalette customPalette)
Performs dithering on the current image.
dither
in class com.aspose.imaging.RasterCachedImage
ditheringMethod
- The dithering method.bitsCount
- The final bits count for dithering.customPalette
- The custom palette for dithering.public void grayscale()
Transformation of an image to its grayscale representation
grayscale
in class com.aspose.imaging.RasterCachedImage
public void rotate(float angle, boolean resizeProportionally, Color backgroundColor)
WebPImage.Rotate
image around the center.
rotate
in class com.aspose.imaging.RasterCachedImage
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
image contents are rotated.backgroundColor
- Color of the background.public void addBlock(IFrame block)
Adds a new Webp block.
block
- The Webp block to add.public void clearBlocks()
Clears all the Webp blocks.
public void insertBlock(int index, IFrame block)
Adds a new Webp block.
index
- The zero-based element, at which block
will be
inserted.block
- The Webp block to add.public void removeBlock(IFrame block)
Removes the Webp block.
block
- The block to remove.
Note: do not forget to Dispose the block
if you
will not add it to some other WebPImage.
public void rotateFlipAll(int rotateFlip)
Rotates the flip all frames in the image.
rotateFlip
- The rotate flip type to perform.public void filter(Rectangle rectangle, FilterOptionsBase options)
Filters the specified rectangle.
filter
in class RasterImage
rectangle
- The rectangle.options
- The options.public static WebPImage createInstance_internalized(int width, int height, int pixelFormat, IRasterImagePixelLoader rasterImagePixelLoader)
Creates a new instance of the WebPImage
width
- The width.height
- The height.pixelFormat
- The pixel format.rasterImagePixelLoader
- The raster image pixel loader.WebPImage
public static void saveWebp_internalized(RasterImage inputImage, com.aspose.ms.System.IO.Stream stream, Rectangle destImageBounds, WebPOptions options)
Export to the webp.
inputImage
- The input image.stream
- The stream.destImageBounds
- The dest image bounds.options
- The options.public void loadDataFromStreamInternal_internalized(com.aspose.ms.System.IO.Stream stream)
Copyright (c) 2008-2016 Aspose Pty Ltd. All Rights Reserved.