Package com.flir.thermalsdk.image
Class ImageBase
java.lang.Object
com.flir.thermalsdk.image.ImageBase
- All Implemented Interfaces:
Closeable,AutoCloseable
- Direct Known Subclasses:
ThermalImage
A base definition for all FLIR images. Provides basic, common interface to handle the images
within Atlas Android SDK regardless of their source.
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the image and frees all resources.Gets aCompassInformationobject with compass details embedded in the image.Gets an opened file's description/note.@Nullable GasQuantificationInputGets the inputs used for quantification from the image.@Nullable GasQuantificationResultGets the quantification result from the image.Gets aGpsInformationobject with GPS details embedded in the image.intGet the height "raw IR pixels", as stored in the thermal image.abstract JavaImageBuffergetImage()Deprecated.intgetWidth()Get the width "raw IR pixels", as stored in the thermal image.voidrotate(RotationAngle angle) Rotates the image by a certain angle.voidsetCompassInformation(CompassInformation compassInformation) Sets aCompassInformationobject with compass details into the image, overriding any existing data.voidsetDescription(String description) Sets a file's description/note.voidsetGpsInformation(GpsInformation gpsInformation) Sets aGpsInformationobject with GPS details into the image, overriding any existing data.
-
Method Details
-
getImage
Deprecated.For live streaming useThermalStreamer.getImage()API instead, for still images useImageColorizer.getImage()API instead.Gets aJavaImageBufferobject, which represents an image's colorized pixels data depending on selectedFusionMode. Rendered/colorized image, which size, appearance etc. heavily depends on theFusionModeandColorDistributionSettings.
Note: raw IR and DC pixels are used to generate this image (depending on fusion mode), and DC image will be aligned even inFusionMode.VISUAL_ONLYmode.- Returns:
- an image buffer as a
JavaImageBuffercontaining image's colorized pixels data depending on selectedFusionMode. - Throws:
RuntimeException- if image can't be retrieved due to internal error- See Also:
-
getHeight
public int getHeight()Get the height "raw IR pixels", as stored in the thermal image.- Returns:
- image height.
- Throws:
RuntimeException- if image can't be retrieved due to an internal error
-
getWidth
public int getWidth()Get the width "raw IR pixels", as stored in the thermal image.- Returns:
- image width.
- Throws:
RuntimeException- if image can't be retrieved due to an internal error
-
getGpsInformation
Gets aGpsInformationobject with GPS details embedded in the image.
Note:GpsInformationobject is mutable, however in order to applyGpsInformationchanges to theThermalImage, it is required to callsetGpsInformation(GpsInformation).- Returns:
- a
GpsInformationobject with GPS details embedded in the image. - See Also:
-
setGpsInformation
Sets aGpsInformationobject with GPS details into the image, overriding any existing data.- Parameters:
gpsInformation- aGpsInformationobject with GPS details to be set for the image.- See Also:
-
getCompassInformation
Gets aCompassInformationobject with compass details embedded in the image.
Note:CompassInformationobject is mutable, however in order to applyCompassInformationchanges to theThermalImage, it is required to callsetCompassInformation(CompassInformation).- Returns:
- a
CompassInformationobject with compass details embedded in the image.
-
setCompassInformation
Sets aCompassInformationobject with compass details into the image, overriding any existing data.- Parameters:
compassInformation- aCompassInformationobject with compass details to be set for the image.- See Also:
-
getDescription
Gets an opened file's description/note.- Returns:
- an opened file's description/note. or
null, if description could not be obtained.
-
setDescription
Sets a file's description/note.- Parameters:
description- the description/note to be set for the file.
-
rotate
Rotates the image by a certain angle. Only rotation by angle defined inRotationAngleis supported.
Note: This is relative rotation, meaning that RotationAngle.ROTATION_ANGLE_0_DEGREES is always a no-op.
Note: The image pixels will be rotated instantly, so this function may incur heavy computation.
Note: this image rotation feature is intended to be used for still images (a file-based ThermalImage). For live streaming stream rotation is currently undefined and may give unexpected results. Especially when used with enabled measurements or other ThermalImage tools.
If you want to rotate a live stream we recommend rotating the colorized pixels (JavaImageBuffer), which can be acquired i.e. by using ThermalImage.getImage() function.
Important: When rotating the colorized pixels (JavaImageBuffer) any existing ThermalImage tools (i.e. measurements) are not rotated. This means that when using measurements with rotated colorized pixels you are required to handle the difference in the displayed image and the actual ThermalImage i.e. calculate the correct positions and redraw measurements when the image is rotated/flipped. This can became quite complicated and has to be addresses carefully.- Parameters:
angle- a rotation angle defined asRotationAngleenum.
-
getGasQuantificationInput
Gets the inputs used for quantification from the image.
Note: whenGasQuantificationInputis null or invalid, theGasQuantificationResultis also invalid (but the object may be present).- Returns:
GasQuantificationInputobject or null if no quantification data available- See Also:
-
getGasQuantificationResult
Gets the quantification result from the image.
Note: it is important to check whether a correspondingGasQuantificationInputexists and is valid to make sure the returnedGasQuantificationResultobject is valid.- Returns:
GasQuantificationResultobject or null if no quantification data available- See Also:
-
close
public void close()Closes the image and frees all resources.Important: All references to the
ThermalImagefields became invalid and any further access to them generates exception. You must deep-copy any object before closing aThermalImageFile, if you want to use it later.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
ThermalStreamer.getImage()API instead, for still images useImageColorizer.getImage()API instead.