public class TgaImage extends RasterCachedImage
The TGA image.
Saving of the JPG image as a TGA image.
try (Image image = Image.load("test.jpg")) { image.save("test.tga", new TgaOptions()); }
Constructor and Description |
---|
TgaImage(InputStream stream)
Initializes a new instance of the
TgaImage class. |
TgaImage(RasterImage rasterImage)
Initializes a new instance of the
TgaImage class. |
TgaImage(String path)
Initializes a new instance of the
TgaImage class. |
Modifier and Type | Method and Description |
---|---|
TgaImage |
deepClone()
Creates a new object that is a copy of the current instance.
|
void |
deepClone(TgaImage tgaImage)
Clone other
TgaImage object's properties. |
boolean |
equals(Object other)
Equality comparison.
|
boolean |
equals(TgaImage other)
Equality comparison.
|
String |
getAuthorComments()
Gets Author Comments.
|
String |
getAuthorName()
Gets Author Name.
|
Color |
getBackgroundColor()
Gets the background color.
|
int |
getBitsPerPixel()
Gets bits per pixel.
|
int |
getBytesPerPixel()
Gets bytes per pixel.
|
Date |
getDateTimeStamp()
Gets Date/Time Stamp.
|
int |
getGammaValueDenominator()
Gets Gamma Value Denominator part.
|
int |
getGammaValueNumerator()
Gets Gamma Value Numerator part.
|
int |
getHeight()
Gets this image height.
|
String |
getImageId()
Gets Image ID.
|
String |
getJobNameOrId()
Gets Job Name/ID.
|
Date |
getJobTime()
Gets Job Time.
|
int |
getPixelAspectRatioDenominator()
Gets Pixel Aspect Ratio denominator part.
|
int |
getPixelAspectRatioNumerator()
Gets Pixel Aspect Ratio numerator part.
|
String |
getSoftwareId()
Gets Software ID.
|
String |
getSoftwareVersion()
Gets Software Version.
|
char |
getSoftwareVersionLetter()
Gets Software Version letter part.
|
int |
getSoftwareVersionNumber()
Gets Software Version number part.
|
Color |
getTransparentColor()
Gets Key Color.
|
int |
getWidth()
Gets this image width.
|
int |
getXOrigin()
Gets absolute horizontal coordinate for the lower left corner of the image
as it is positioned on a display device having an origin at the lower left of the
screen(e.g., the TARGA series).
|
int |
getYOrigin()
Gets absolute vertical coordinate for the lower left corner of the image
as it is positioned on a display device having an origin at the lower left of the
screen(e.g., the TARGA series).
|
boolean |
hasAlpha()
Gets a value indicating whether this
TgaImage has an alpha channel. |
boolean |
hasBackgroundColor()
Gets a value indicating whether the image has background color.
|
boolean |
hasColorMap()
Gets a value indicating whether this image has color map.
|
int |
hashCode()
Get hash code of this instance.
|
boolean |
hasTransparentColor()
Gets a value indicating whether the image has transparent color.
|
boolean |
isGrayScale()
Gets a value indicating whether this
TgaImage is gray-scale. |
static boolean |
op_Equality(TgaImage first,
TgaImage second)
Equality comparison.
|
static boolean |
op_Inequality(TgaImage first,
TgaImage second)
Non-equality comparison.
|
void |
rotateFlip(int rotateFlipType)
The rotate flip.
|
void |
setAuthorComments(String value)
Sets Author Comments.
|
void |
setAuthorName(String value)
Sets Author Name.
|
void |
setBackgroundColor(boolean value)
Sets a value indicating whether the image has background color.
|
void |
setBackgroundColor(Color value)
Sets the background color.
|
void |
setDateTimeStamp(Date value)
Sets Date/Time Stamp.
|
void |
setImageId(String value)
Sets Image ID.
|
void |
setJobNameOrId(String value)
Sets Job Name/ID.
|
void |
setJobTime(Date value)
Sets Job Time.
|
void |
setSoftwareId(String value)
Sets Software ID.
|
void |
setSoftwareVersion(String value)
Sets Software Version.
|
void |
setSoftwareVersionLetter(char value)
Sets Software Version letter part.
|
void |
setSoftwareVersionNumber(int value)
Sets Software Version number part.
|
void |
setTransparentColor(boolean value)
Sets a value indicating whether the image has transparent color.
|
void |
setTransparentColor(Color value)
Sets Key Color.
|
void |
setXOrigin(int value)
Sets absolute horizontal coordinate for the lower left corner of the image
as it is positioned on a display device having an origin at the lower left of the
screen(e.g., the TARGA series).
|
void |
setYOrigin(int value)
Sets absolute vertical coordinate for the lower left corner of the image
as it is positioned on a display device having an origin at the lower left of the
screen(e.g., the TARGA series).
|
adjustBrightness, adjustContrast, adjustGamma, adjustGamma, binarizeBradley, binarizeBradley, binarizeFixed, binarizeOtsu, cacheData, crop, dither, grayscale, isCached, resize, resize, rotate
crop, dither, filter, getArgb32Pixel, getDefaultArgb32Pixels, getDefaultPixels, getDefaultRawData, getDefaultRawData, getHorizontalResolution, getImageOpacity, getModifyDate, getPixel, getPremultiplyComponents, getRawCustomColorConverter, getRawDataFormat, getRawDataSettings, getRawFallbackIndex, getRawIndexedColorConverter, getRawLineSize, getSkewAngle, getUpdateXmpData, getUseRawData, getVerticalResolution, getXmpData, isRawDataAvailable, loadArgb32Pixels, loadArgb64Pixels, loadCmyk32Pixels, loadCmykPixels, loadPartialArgb32Pixels, loadPartialPixels, loadPixels, loadRawData, loadRawData, normalizeAngle, normalizeAngle, readArgb32ScanLine, readScanLine, replaceColor, replaceColor, replaceNonTransparentColors, 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, getBounds, getBufferSizeHint, getContainer, getDefaultOptions, getFileFormat, getFileFormat, getFileFormat, getFittingRectangle, getFittingRectangle, getInterruptMonitor, getOriginalOptions, getPalette, getProgressEventHandler, getProgressEventHandlerInfo, getProportionalHeight, getProportionalWidth, getSize, isAutoAdjustPalette, load, load, load, load, load, load, resize, resizeHeightProportionally, resizeHeightProportionally, resizeHeightProportionally, resizeWidthProportionally, resizeWidthProportionally, resizeWidthProportionally, save, save, save, save, save, save, save, setAutoAdjustPalette, setBufferSizeHint, setInterruptMonitor, setPalette
getDataStreamContainer, save, save, save, save
close, dispose, getDisposed
public TgaImage(String path)
Initializes a new instance of the TgaImage
class.
path
- The path to load an image.com.aspose.ms.System.ArgumentNullException
- Specified path is null.public TgaImage(RasterImage rasterImage)
Initializes a new instance of the TgaImage
class.
rasterImage
- The raster image.public TgaImage(InputStream stream)
Initializes a new instance of the TgaImage
class.
stream
- The stream to load an image.public int getBitsPerPixel()
Gets bits per pixel.
getBitsPerPixel
in class Image
public final int getBytesPerPixel()
Gets bytes per pixel.
public boolean hasAlpha()
Gets a value indicating whether this TgaImage
has an alpha channel.
hasAlpha
in class RasterImage
TgaImage
has an alpha channel.public final boolean isGrayScale()
Gets a value indicating whether this TgaImage
is gray-scale.
TgaImage
is gray-scale.public int getWidth()
Gets this image width.
getWidth
in interface IObjectWithBounds
getWidth
in class Image
public int getHeight()
Gets this image height.
getHeight
in interface IObjectWithBounds
getHeight
in class Image
public final boolean hasColorMap()
Gets a value indicating whether this image has color map.
public final int getGammaValueNumerator()
Gets Gamma Value Numerator part. An uncorrected image (an image with no gamma) should have the value 1.0 as the result.
public final int getGammaValueDenominator()
Gets Gamma Value Denominator part. An uncorrected image (an image with no gamma) should have the value 1.0 as the result.
public final int getPixelAspectRatioNumerator()
Gets Pixel Aspect Ratio numerator part.
public final int getPixelAspectRatioDenominator()
Gets Pixel Aspect Ratio denominator part.
public final int getXOrigin()
Gets absolute horizontal coordinate for the lower left corner of the image as it is positioned on a display device having an origin at the lower left of the screen(e.g., the TARGA series).
public final void setXOrigin(int value)
Sets absolute horizontal coordinate for the lower left corner of the image as it is positioned on a display device having an origin at the lower left of the screen(e.g., the TARGA series).
value
- absolute horizontal coordinate for the lower left corner of the image
as it is positioned on a display device having an origin at the lower left of the
screen(e.Updating public properties of the loaded TGA image.
try (TgaImage image = (TgaImage)Image.load("test.tga")) { image.setDateTimeStamp(new Date()); image.setAuthorName("John Smith"); image.setAuthorComments("Comment"); image.setImageId("ImageId"); image.setJobNameOrId("Important Job"); image.setJobTime(new Date(0,0, 10)); image.setTransparentColor(Color.fromArgb(123)); image.setSoftwareId("SoftwareId"); image.setSoftwareVersion("abc1"); image.setSoftwareVersionLetter('a'); image.setSoftwareVersionNumber(2); image.setXOrigin(1000); image.setYOrigin(1000); image.save("test.tga"); }
public final int getYOrigin()
Gets absolute vertical coordinate for the lower left corner of the image as it is positioned on a display device having an origin at the lower left of the screen(e.g., the TARGA series).
public final void setYOrigin(int value)
Sets absolute vertical coordinate for the lower left corner of the image as it is positioned on a display device having an origin at the lower left of the screen(e.g., the TARGA series).
value
- absolute vertical coordinate for the lower left corner of the image
as it is positioned on a display device having an origin at the lower left of the
screen(e.Updating public properties of the loaded TGA image.
try (TgaImage image = (TgaImage)Image.load("test.tga")) { image.setDateTimeStamp(new Date()); image.setAuthorName("John Smith"); image.setAuthorComments("Comment"); image.setImageId("ImageId"); image.setJobNameOrId("Important Job"); image.setJobTime(new Date(0,0, 10)); image.setTransparentColor(Color.fromArgb(123)); image.setSoftwareId("SoftwareId"); image.setSoftwareVersion("abc1"); image.setSoftwareVersionLetter('a'); image.setSoftwareVersionNumber(2); image.setXOrigin(1000); image.setYOrigin(1000); image.save("test.tga"); }
public final String getImageId()
Gets Image ID.
This optional field contains identifying information about the image. The maximum length for this field is 255 bytes.
public final void setImageId(String value)
Sets Image ID.
This optional field contains identifying information about the image. The maximum length for this field is 255 bytes.
value
- Image ID.public final String getAuthorComments()
Gets Author Comments. This is an ASCII field consisting of 324 bytes which are organized as four lines of 80 characters, each followed by a null terminator.
public final void setAuthorComments(String value)
Sets Author Comments. This is an ASCII field consisting of 324 bytes which are organized as four lines of 80 characters, each followed by a null terminator.
value
- Author Comments.public final String getAuthorName()
Gets Author Name. This field is a total of 40 ASCII characters for the name. If the field is used, it should contain the name of the person who created the image (author).
public final void setAuthorName(String value)
Sets Author Name. This field is a total of 40 ASCII characters for the name. If the field is used, it should contain the name of the person who created the image (author).
value
- Author Name.public final Date getDateTimeStamp()
Gets Date/Time Stamp. This field defines the value for the date and time that the image was saved. Even though operating systems typically time- and date-stamp files, this feature is provided because the operating system may change the time and date stamp if the file is copied. By using this area, you are guaranteed an unmodified region for date and time recording.
public final void setDateTimeStamp(Date value)
Sets Date/Time Stamp. This field defines the value for the date and time that the image was saved. Even though operating systems typically time- and date-stamp files, this feature is provided because the operating system may change the time and date stamp if the file is copied. By using this area, you are guaranteed an unmodified region for date and time recording.
value
- Date/Time Stamp.Updating public properties of the loaded TGA image.
try (TgaImage image = (TgaImage)Image.load("test.tga")) { image.setDateTimeStamp(new Date()); image.setAuthorName("John Smith"); image.setAuthorComments("Comment"); image.setImageId("ImageId"); image.setJobNameOrId("Important Job"); image.setJobTime(new Date(0,0, 10)); image.setTransparentColor(Color.fromArgb(123)); image.setSoftwareId("SoftwareId"); image.setSoftwareVersion("abc1"); image.setSoftwareVersionLetter('a'); image.setSoftwareVersionNumber(2); image.setXOrigin(1000); image.setYOrigin(1000); image.save("test.tga"); }
public final String getJobNameOrId()
Gets Job Name/ID.
public final void setJobNameOrId(String value)
Sets Job Name/ID.
value
- Job Name/ID.public final Date getJobTime()
Gets Job Time.
public final void setJobTime(Date value)
Sets Job Time.
value
- Job Time.Updating public properties of the loaded TGA image.
try (TgaImage image = (TgaImage)Image.load("test.tga")) { image.setDateTimeStamp(new Date()); image.setAuthorName("John Smith"); image.setAuthorComments("Comment"); image.setImageId("ImageId"); image.setJobNameOrId("Important Job"); image.setJobTime(new Date(0,0, 10)); image.setTransparentColor(Color.fromArgb(123)); image.setSoftwareId("SoftwareId"); image.setSoftwareVersion("abc1"); image.setSoftwareVersionLetter('a'); image.setSoftwareVersionNumber(2); image.setXOrigin(1000); image.setYOrigin(1000); image.save("test.tga"); }
public Color getTransparentColor()
Gets Key Color.
The Key Color can be thought of as the ‘background color’ or ‘transparent color’. This is the color of the ‘non image’ area of the screen, and the same color that the screen would be cleared to if erased in the application.
getTransparentColor
in class RasterImage
public void setTransparentColor(Color value)
Sets Key Color.
The Key Color can be thought of as the ‘background color’ or ‘transparent color’. This is the color of the ‘non image’ area of the screen, and the same color that the screen would be cleared to if erased in the application.
setTransparentColor
in class RasterImage
value
- Key Color.Updating public properties of the loaded TGA image.
try (TgaImage image = (TgaImage)Image.load("test.tga")) { image.setDateTimeStamp(new Date()); image.setAuthorName("John Smith"); image.setAuthorComments("Comment"); image.setImageId("ImageId"); image.setJobNameOrId("Important Job"); image.setJobTime(new Date(0,0, 10)); image.setTransparentColor(Color.fromArgb(123)); image.setSoftwareId("SoftwareId"); image.setSoftwareVersion("abc1"); image.setSoftwareVersionLetter('a'); image.setSoftwareVersionNumber(2); image.setXOrigin(1000); image.setYOrigin(1000); image.save("test.tga"); }
public boolean hasTransparentColor()
Gets a value indicating whether the image has transparent color.
hasTransparentColor
in class RasterImage
public void setTransparentColor(boolean value)
Sets a value indicating whether the image has transparent color.
setTransparentColor
in class RasterImage
value
- a value indicating whether the image has transparent color.public Color getBackgroundColor()
Gets the background color.
getBackgroundColor
in class Image
public void setBackgroundColor(Color value)
Sets the background color.
setBackgroundColor
in class Image
value
- the background color.public boolean hasBackgroundColor()
Gets a value indicating whether the image has background color.
hasBackgroundColor
in class Image
public void setBackgroundColor(boolean value)
Sets a value indicating whether the image has background color.
setBackgroundColor
in class Image
value
- a value indicating whether the image has background color.public final String getSoftwareVersion()
Gets Software Version. Accepted version string length is 3-4 characters.
public final void setSoftwareVersion(String value)
Sets Software Version. Accepted version string length is 3-4 characters.
value
- Software Version.public final char getSoftwareVersionLetter()
Gets Software Version letter part.
public final void setSoftwareVersionLetter(char value)
Sets Software Version letter part.
value
- Software Version letter part.Updating public properties of the loaded TGA image.
try (TgaImage image = (TgaImage)Image.load("test.tga")) { image.setDateTimeStamp(new Date()); image.setAuthorName("John Smith"); image.setAuthorComments("Comment"); image.setImageId("ImageId"); image.setJobNameOrId("Important Job"); image.setJobTime(new Date(0,0, 10)); image.setTransparentColor(Color.fromArgb(123)); image.setSoftwareId("SoftwareId"); image.setSoftwareVersion("abc1"); image.setSoftwareVersionLetter('a'); image.setSoftwareVersionNumber(2); image.setXOrigin(1000); image.setYOrigin(1000); image.save("test.tga"); }
public final int getSoftwareVersionNumber()
Gets Software Version number part.
public final void setSoftwareVersionNumber(int value)
Sets Software Version number part.
value
- Software Version number part.Updating public properties of the loaded TGA image.
try (TgaImage image = (TgaImage)Image.load("test.tga")) { image.setDateTimeStamp(new Date()); image.setAuthorName("John Smith"); image.setAuthorComments("Comment"); image.setImageId("ImageId"); image.setJobNameOrId("Important Job"); image.setJobTime(new Date(0,0, 10)); image.setTransparentColor(Color.fromArgb(123)); image.setSoftwareId("SoftwareId"); image.setSoftwareVersion("abc1"); image.setSoftwareVersionLetter('a'); image.setSoftwareVersionNumber(2); image.setXOrigin(1000); image.setYOrigin(1000); image.save("test.tga"); }
public final String getSoftwareId()
Gets Software ID. A total of 40 ASCII characters for the Software ID.
public final void setSoftwareId(String value)
Sets Software ID. A total of 40 ASCII characters for the Software ID.
value
- Software ID.public static boolean op_Inequality(TgaImage first, TgaImage second)
Non-equality comparison.
public final TgaImage deepClone()
Creates a new object that is a copy of the current instance.
public final void deepClone(TgaImage tgaImage)
Clone other TgaImage
object's properties.
tgaImage
- Other TgaImage
public final boolean equals(TgaImage other)
Equality comparison.
other
- Second TgaImage
that takes part in comparison.public boolean equals(Object other)
Equality comparison.
public void rotateFlip(int rotateFlipType)
The rotate flip.
rotateFlip
in class RasterCachedImage
rotateFlipType
- The rotate flip type.RotateFlipType
Copyright (c) 2008-2020 Aspose Pty Ltd. All Rights Reserved.