public final class TiffImage extends RasterImage
The tiff image.
Constructor and Description |
---|
TiffImage(TiffFrame frame)
Initializes a new instance of the
TiffImage class. |
TiffImage(TiffFrame[] frames)
Initializes a new instance of the
TiffImage class. |
Modifier and Type | Method and Description |
---|---|
void |
add(TiffImage image)
Adds the specified image's frames to current frame.
|
void |
addFrame(TiffFrame frame)
Adds the frame to image
|
void |
addFrames(TiffFrame[] frames)
Adds the frames array to image
|
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 |
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(int leftShift,
int rightShift,
int topShift,
int bottomShift)
Crop image with shifts.
|
void |
crop(Rectangle rectangle)
Cropping the image.
|
void |
dither(int ditheringMethod,
int bitsCount,
IColorPalette customPalette)
Performs dithering on the current image.
|
TiffFrame |
getActiveFrame()
Gets or sets the active frame.
|
int |
getBitsPerPixel()
Gets the image bits per pixel value of current frame.
|
int |
getByteOrder()
Gets or sets a value indicating the tiff byte order.
|
ExifData |
getExifData()
Gets or sets EXIF data for the active frame.
|
TiffFrame[] |
getFrames()
Gets Frames array of the image.
|
int |
getHeight()
Gets the image height.
|
double |
getHorizontalResolution()
Gets the horizontal resolution, in pixels per inch, of this
Image . |
double |
getVerticalResolution()
Gets the vertical resolution, in pixels per inch, of this
Image . |
int |
getWidth()
Gets the image width.
|
void |
grayscale()
Transformation of an image to its grayscale representation
|
void |
insertFrame(int index,
TiffFrame frameToInsert)
The insert frame.
|
boolean |
isCached()
Gets a value indicating whether object's data is cached currently and no data reading is required.
|
TiffFrame |
removeFrame(int index)
Removes the frame by its index.
|
void |
removeFrame(TiffFrame frame)
Removes the specified frame.
|
void |
resize(int newWidth,
int newHeight,
int resizeType)
Resizes the image.
|
void |
resizeHeightProportionally(int newHeight,
int resizeType)
Resizes the height proportionally.
|
void |
resizeProportional(int newWidth,
int newHeight,
int resizeType)
Performs proportional resize on the image.
|
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 |
setActiveFrame(TiffFrame value)
Gets or sets the active frame.
|
void |
setByteOrder(int value)
Gets or sets a value indicating the tiff byte order.
|
void |
setExifData(ExifData value)
Gets or sets EXIF data for the active frame.
|
void |
setHorizontalResolution(double value)
Gets the horizontal resolution, in pixels per inch, of this
Image . |
void |
setResolution(double dpiX,
double dpiY)
Sets the resolution for this
RasterImage . |
void |
setVerticalResolution(double value)
Gets the vertical resolution, in pixels per inch, of this
Image . |
dither, getArgb32Pixel, getDefaultArgb32Pixels, getDefaultPixels, getDefaultRawData, getDefaultRawData, getPixel, getRawCustomColorConverter, getRawDataFormat, getRawDataSettings, getRawFallbackIndex, getRawIndexedColorConverter, getRawLineSize, getTransparentColor, hasTransparentColor, isRawDataAvailable, loadArgb32Pixels, loadCMYKPixels, loadPartialArgb32Pixels, loadPartialPixels, loadPixels, loadRawData, readScanLine, rotate, saveArgb32Pixels, saveCMYKPixels, savePixels, saveRawData, setArgb32Pixel, setPalette, setPixel, setRawCustomColorConverter, setRawFallbackIndex, setRawIndexedColorConverter, setTransparentColor, setTransparentColor, writeScanLine
canLoad, canLoad, canLoad, canLoad, canSave, create, getBackgroundColor, getBounds, getContainer, getFileFormat, getFileFormat, getFittingRectangle, getFittingRectangle, getPalette, getProportionalHeight, getProportionalWidth, getSize, hasBackgroundColor, load, load, load, load, loadInternal_internalized, resize, resizeHeightProportionally, resizeWidthProportionally, save_internalized, save_internalized, save, save, save, save, save, setBackgroundColor, setBackgroundColor, setContainer_internalized, setPalette
getDataStreamContainer, save_internalized, save, save, save, setDataStreamContainer
dispose, getDisposed
public TiffImage(TiffFrame frame)
Initializes a new instance of the TiffImage
class.
frame
- The tiff frame to initialize image with.com.aspose.ms.System.ArgumentNullException
- Tiff frame cannot be empty.;framepublic TiffImage(TiffFrame[] frames)
Initializes a new instance of the TiffImage
class.
frames
- The frames.com.aspose.ms.System.ArgumentNullException
- framespublic int getByteOrder()
Gets or sets a value indicating the tiff byte order.
Value: The tiff byte order.public void setByteOrder(int value)
Gets or sets a value indicating the tiff byte order.
Value: The tiff byte order.public double getHorizontalResolution()
Gets the horizontal resolution, in pixels per inch, of this Image
.
Note by default this value is always 96 since different platforms cannot return the screen resolution. You may consider using the SetResolution method for updating both resolution values in single call.
getHorizontalResolution
in class RasterImage
public void setHorizontalResolution(double value)
Gets the horizontal resolution, in pixels per inch, of this Image
.
Note by default this value is always 96 since different platforms cannot return the screen resolution. You may consider using the SetResolution method for updating both resolution values in single call.
setHorizontalResolution
in class RasterImage
public double getVerticalResolution()
Gets the vertical resolution, in pixels per inch, of this Image
.
Note by default this value is always 96 since different platforms cannot return the screen resolution. You may consider using the SetResolution method for updating both resolution values in single call.
getVerticalResolution
in class RasterImage
public void setVerticalResolution(double value)
Gets the vertical resolution, in pixels per inch, of this Image
.
Note by default this value is always 96 since different platforms cannot return the screen resolution. You may consider using the SetResolution method for updating both resolution values in single call.
setVerticalResolution
in class RasterImage
public int getBitsPerPixel()
Gets the image bits per pixel value of current frame.
Value: The image bits per pixel count.getBitsPerPixel
in class Image
public TiffFrame getActiveFrame()
Gets or sets the active frame.
Value: Active frame.public void setActiveFrame(TiffFrame value)
Gets or sets the active frame.
Value: Active frame.public TiffFrame[] getFrames()
Gets Frames array of the 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 final boolean isCached()
Gets a value indicating whether object's data is cached currently and no data reading is required.
Value:true
if object's data is cached; otherwise, false
.isCached
in class DataStreamSupporter
public ExifData getExifData()
Gets or sets EXIF data for the active frame.
public void setExifData(ExifData value)
Gets or sets EXIF data for the active frame.
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 setResolution(double dpiX, double dpiY)
Sets the resolution for this RasterImage
.
setResolution
in class RasterImage
dpiX
- The horizontal resolution, in dots per inch, of the RasterImage
.dpiY
- The vertical resolution, in dots per inch, of the RasterImage
.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 rotateFlip(int rotateFlipType)
Rotates, flips, or rotates and flips the Active frame only.
rotateFlip
in class Image
rotateFlipType
- The rotate flip type.public 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 void addFrame(TiffFrame frame)
Adds the frame to image
frame
- The frame to add.public void add(TiffImage image)
Adds the specified image's frames to current frame.
image
- The source image.public void addFrames(TiffFrame[] frames)
Adds the frames array to image
frames
- The frames array to addpublic void insertFrame(int index, TiffFrame frameToInsert)
The insert frame.
index
- Index of new frame in list of framesframeToInsert
- The frame To Insert.public TiffFrame removeFrame(int index)
Removes the frame by its index.
index
- Index of frame to be removed.
Note: do not forget to Dispose the frame if you will not add it to some other TiffImage.
public void removeFrame(TiffFrame frame)
Removes the specified frame.
frame
- The frame to remove.
Note: do not forget to Dispose the frame if you will not add it to some other TiffImage.
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 resizeWidthProportionally(int newWidth, int resizeType)
Resizes the width proportionally.
resizeWidthProportionally
in class Image
newWidth
- The new width.resizeType
- Type of the resize.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 resizeProportional(int newWidth, int newHeight, int resizeType)
Performs proportional resize on the image.
The proportional resize will resize each frame according to the ratio of newWidth
/width and newHeight
/height.
newWidth
- The new width.newHeight
- The new height.resizeType
- The resize type.public void crop(Rectangle rectangle)
Cropping the image.
crop
in class RasterImage
rectangle
- The rectangle.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)
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 crop(int leftShift, int rightShift, int topShift, int bottomShift)
Crop image with shifts.
crop
in class RasterImage
leftShift
- The left shift.rightShift
- The right shift.topShift
- The top shift.bottomShift
- The bottom shift.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 coefficientCopyright (c) 2008-2016 Aspose Pty Ltd. All Rights Reserved.