public final class GifFrameBlock extends RasterCachedImage implements IGifBlock
Gif frame block.
RasterCachedImage.RotateTestMode
Modifier and Type | Field and Description |
---|---|
static int |
EXTENSION_LABEL
Block extension label.
|
static int |
IMAGE_DESCRIPTOR_SIZE
The image descriptor size.
|
Constructor and Description |
---|
GifFrameBlock(InputStream stream)
Initializes a new instance of the
GifFrameBlock class. |
GifFrameBlock(InputStream stream,
int left,
int top)
Initializes a new instance of the
GifFrameBlock class. |
GifFrameBlock(InputStream stream,
int left,
int top,
boolean isPaletteSorted,
boolean isGifFrameInterlaced,
byte lzwCodeSize)
Initializes a new instance of the
GifFrameBlock class. |
GifFrameBlock(int width,
int height)
Initializes a new instance of the
GifFrameBlock class. |
GifFrameBlock(int left,
int top,
int width,
int height)
Initializes a new instance of the
GifFrameBlock class. |
GifFrameBlock(int left,
int top,
int width,
int height,
IColorPalette colorPalette,
boolean isPaletteSorted,
boolean isGifFrameInterlaced,
byte bitsPerPixel)
Initializes a new instance of the
GifFrameBlock class. |
GifFrameBlock(RasterImage image)
Initializes a new instance of the
GifFrameBlock class. |
GifFrameBlock(RasterImage image,
int left,
int top)
Initializes a new instance of the
GifFrameBlock class. |
GifFrameBlock(RasterImage image,
int left,
int top,
boolean isPaletteSorted,
boolean isGifFrameInterlaced,
byte lzwCodeSize)
Initializes a new instance of the
GifFrameBlock class. |
GifFrameBlock(com.aspose.ms.System.IO.Stream stream) |
GifFrameBlock(String path)
Initializes a new instance of the
GifFrameBlock class. |
GifFrameBlock(String path,
int left,
int top)
Initializes a new instance of the
GifFrameBlock class. |
GifFrameBlock(String path,
int left,
int top,
boolean isPaletteSorted,
boolean isGifFrameInterlaced,
byte lzwCodeSize)
Initializes a new instance of the
GifFrameBlock class. |
Modifier and Type | Method and Description |
---|---|
static byte |
createFlags(IColorPalette colorPalette,
boolean isPaletteSorted,
boolean isGifFrameInterlaced)
Creates the flags.
|
int |
getBitsPerPixel()
Gets the image bits per pixel count.
|
static IColorPalette |
getColorPalette(IColorPalette framePalette,
IColorPalette containerPalette)
Gets the associated color palette.
|
GifGraphicsControlBlock |
getControlBlock()
Gets the graphics control block associated with this block.
|
long |
getFileFormat()
Gets a value of file format
|
byte |
getFlags()
Gets or sets the flags.
|
byte |
getGifFrameBitsPerPixel()
Gets or sets the GIF frame bits per pixel.
|
int |
getHeight()
Gets the image height.
|
boolean |
getInterlaced()
Gets or sets a value indicating whether this
GifFrameBlock is interlaced. |
int |
getLeft()
Gets or sets the left image location.
|
int |
getTop()
Gets or sets the top image location.
|
Color |
getTransparentColor()
Gets the transparent color of frame block.
|
int |
getWidth()
Gets the image width.
|
boolean |
hasTransparentColor()
Gets a value indicating whether frame block has transparent color.
|
boolean |
isPaletteSorted()
Gets or sets a value indicating whether color palette is sorted.
|
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 |
setFlags(byte value)
Gets or sets the flags.
|
void |
setGifFrameBitsPerPixel(byte value)
Gets or sets the GIF frame bits per pixel.
|
void |
setInterlaced(boolean value)
Gets or sets a value indicating whether this
GifFrameBlock is interlaced. |
void |
setLeft(int value)
Gets or sets the left image location.
|
void |
setPaletteSorted(boolean value)
Gets or sets a value indicating whether color palette is sorted.
|
void |
setTop(int value)
Gets or sets the top image location.
|
void |
setTransparentColor(boolean value)
Gets a value indicating whether frame block has transparent color.
|
void |
setTransparentColor(Color value)
Gets the transparent color of frame block.
|
adjustBrightness, adjustContrast, adjustGamma, adjustGamma, binarizeBradley, binarizeBradley, binarizeFixed, binarizeOtsu, cacheData, crop, dither, getMaxAllowedAllocationForPartialRotateSave, getRotateMode, grayscale, isCached, resize, resize, rotate, rotateFlip, setMaxAllowedAllocationForPartialRotateSave, setRotateMode
crop, dither, filter, getArgb32Pixel, getDefaultArgb32Pixels, getDefaultPixels, getDefaultRawData, getDefaultRawData, getHorizontalResolution, getImageOpacity, getModifyDate, getPixel, getPremultiplyComponents, getRawCustomColorConverter, getRawDataFormat, getRawDataSettings, getRawFallbackIndex, getRawIndexedColorConverter, getRawLineSize, getUpdateXmpData, getUseRawData, getVerticalResolution, getXmpData, hasAlpha, 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, 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, resizeHeightProportionally, resizeWidthProportionally, resizeWidthProportionally, resizeWidthProportionally, save, save, save, save, save, save, save, setAutoAdjustPalette, setBackgroundColor, setBackgroundColor, setInterruptMonitor, setPalette
getDataStreamContainer, save, save, save, save
close, dispose, getDisposed
public static final int EXTENSION_LABEL
Block extension label.
public static final int IMAGE_DESCRIPTOR_SIZE
The image descriptor size.
public GifFrameBlock(int width, int height)
Initializes a new instance of the GifFrameBlock
class.
width
- The image width.height
- The image height.public GifFrameBlock(int left, int top, int width, int height)
Initializes a new instance of the GifFrameBlock
class.
left
- The left image position.top
- The top image position.width
- The image width.height
- The image height.public GifFrameBlock(int left, int top, int width, int height, IColorPalette colorPalette, boolean isPaletteSorted, boolean isGifFrameInterlaced, byte bitsPerPixel)
Initializes a new instance of the GifFrameBlock
class.
left
- The left image position.top
- The top image position.width
- The image Width.height
- The image Height.colorPalette
- The color palette.isPaletteSorted
- if set to true
the color palette is sorted.isGifFrameInterlaced
- if set to true
the GIF frame is interlaced.bitsPerPixel
- The bits per pixel.public GifFrameBlock(RasterImage image)
Initializes a new instance of the GifFrameBlock
class.
image
- The image to initialize frame pixel and palette data with.public GifFrameBlock(RasterImage image, int left, int top)
Initializes a new instance of the GifFrameBlock
class.
image
- The image to initialize frame pixel and palette data with.left
- The left image position.top
- The top image position.public GifFrameBlock(RasterImage image, int left, int top, boolean isPaletteSorted, boolean isGifFrameInterlaced, byte lzwCodeSize)
Initializes a new instance of the GifFrameBlock
class.
image
- The image to initialize frame pixel and palette data with.left
- The left image position.top
- The top image position.isPaletteSorted
- if set to true
the color palette is sorted.isGifFrameInterlaced
- if set to true
the GIF frame is interlaced.lzwCodeSize
- The bits per pixel.public GifFrameBlock(InputStream stream)
Initializes a new instance of the GifFrameBlock
class.
stream
- The stream to load an image from and initialize frame pixel and palette data with.public GifFrameBlock(com.aspose.ms.System.IO.Stream stream)
public GifFrameBlock(InputStream stream, int left, int top)
Initializes a new instance of the GifFrameBlock
class.
stream
- The stream to load an image from and initialize frame pixel and palette data with.left
- The left image position.top
- The top image position.public GifFrameBlock(InputStream stream, int left, int top, boolean isPaletteSorted, boolean isGifFrameInterlaced, byte lzwCodeSize)
Initializes a new instance of the GifFrameBlock
class.
stream
- The stream to load an image from and initialize frame pixel and palette data with.left
- The left image position.top
- The top image position.isPaletteSorted
- if set to true
the color palette is sorted.isGifFrameInterlaced
- if set to true
the GIF frame is interlaced.lzwCodeSize
- The bits per pixel.public GifFrameBlock(String path)
Initializes a new instance of the GifFrameBlock
class.
path
- The path to load an image from and initialize frame pixel and palette data with.public GifFrameBlock(String path, int left, int top)
Initializes a new instance of the GifFrameBlock
class.
path
- The path to load an image from and initialize frame pixel and palette data with.left
- The left image position.top
- The top image position.public GifFrameBlock(String path, int left, int top, boolean isPaletteSorted, boolean isGifFrameInterlaced, byte lzwCodeSize)
Initializes a new instance of the GifFrameBlock
class.
path
- The path to load an image from and initialize frame pixel and palette data with.left
- The left image position.top
- The top image position.isPaletteSorted
- if set to true
the color palette is sorted.isGifFrameInterlaced
- if set to true
the GIF frame is interlaced.lzwCodeSize
- The bits per pixel.public static IColorPalette getColorPalette(IColorPalette framePalette, IColorPalette containerPalette)
Gets the associated color palette.
framePalette
- The frame palette.containerPalette
- The container palette.public static byte createFlags(IColorPalette colorPalette, boolean isPaletteSorted, boolean isGifFrameInterlaced)
Creates the flags.
colorPalette
- The color palette.isPaletteSorted
- if set to true
the colors in color palette are sorted.isGifFrameInterlaced
- if set to true
the GIF frame image is interlaced.public long getFileFormat()
Gets a value of file format
getFileFormat
in class Image
public int getWidth()
Gets the image width.
getWidth
in interface IObjectWithBounds
getWidth
in class Image
public int getHeight()
Gets the image height.
getHeight
in interface IObjectWithBounds
getHeight
in class Image
public int getBitsPerPixel()
Gets the image bits per pixel count.
getBitsPerPixel
in class Image
public boolean getInterlaced()
Gets or sets a value indicating whether this GifFrameBlock
is interlaced.
true
if interlaced; otherwise, false
.public void setInterlaced(boolean value)
Gets or sets a value indicating whether this GifFrameBlock
is interlaced.
value
- true
if interlaced; otherwise, false
.public boolean isPaletteSorted()
Gets or sets a value indicating whether color palette is sorted.
true
if color palette is sorted; otherwise, false
.public void setPaletteSorted(boolean value)
Gets or sets a value indicating whether color palette is sorted.
value
- true
if color palette is sorted; otherwise, false
.public byte getGifFrameBitsPerPixel()
Gets or sets the GIF frame bits per pixel.
public void setGifFrameBitsPerPixel(byte value)
Gets or sets the GIF frame bits per pixel.
value
- The GIF frame bits per pixel.public int getLeft()
Gets or sets the left image location.
public void setLeft(int value)
Gets or sets the left image location.
value
- The left image location.public int getTop()
Gets or sets the top image location.
public void setTop(int value)
Gets or sets the top image location.
value
- The top image location.public byte getFlags()
Gets or sets the flags.
public void setFlags(byte value)
Gets or sets the flags.
value
- The flags.public GifGraphicsControlBlock getControlBlock()
Gets the graphics control block associated with this block.
public boolean hasTransparentColor()
Gets a value indicating whether frame block has transparent color.
hasTransparentColor
in class RasterImage
public void setTransparentColor(boolean value)
Gets a value indicating whether frame block has transparent color.
setTransparentColor
in class RasterImage
public Color getTransparentColor()
Gets the transparent color of frame block.
getTransparentColor
in class RasterImage
public void setTransparentColor(Color value)
Gets the transparent color of frame block.
setTransparentColor
in class RasterImage
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.