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 TypeMethodDescriptionvoid
close()
Closes the image and frees all resources.Gets aCompassInformation
object with compass details embedded in the image.Gets an opened file's description/note.@Nullable GasQuantificationInput
Gets the inputs used for quantification from the image.@Nullable GasQuantificationResult
Gets the quantification result from the image.Gets aGpsInformation
object with GPS details embedded in the image.int
Get the height "raw IR pixels", as stored in the thermal image.abstract JavaImageBuffer
getImage()
Deprecated.int
getWidth()
Get the width "raw IR pixels", as stored in the thermal image.void
rotate
(RotationAngle angle) Rotates the image by a certain angle.void
setCompassInformation
(CompassInformation compassInformation) Sets aCompassInformation
object with compass details into the image, overriding any existing data.void
setDescription
(String description) Sets a file's description/note.void
setGpsInformation
(GpsInformation gpsInformation) Sets aGpsInformation
object 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 aJavaImageBuffer
object, which represents an image's colorized pixels data depending on selectedFusionMode
. Rendered/colorized image, which size, appearance etc. heavily depends on theFusionMode
andColorDistributionSettings
.
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_ONLY
mode.- Returns:
- an image buffer as a
JavaImageBuffer
containing 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 aGpsInformation
object with GPS details embedded in the image.
Note:GpsInformation
object is mutable, however in order to applyGpsInformation
changes to theThermalImage
, it is required to callsetGpsInformation(GpsInformation)
.- Returns:
- a
GpsInformation
object with GPS details embedded in the image. - See Also:
-
setGpsInformation
Sets aGpsInformation
object with GPS details into the image, overriding any existing data.- Parameters:
gpsInformation
- aGpsInformation
object with GPS details to be set for the image.- See Also:
-
getCompassInformation
Gets aCompassInformation
object with compass details embedded in the image.
Note:CompassInformation
object is mutable, however in order to applyCompassInformation
changes to theThermalImage
, it is required to callsetCompassInformation(CompassInformation)
.- Returns:
- a
CompassInformation
object with compass details embedded in the image.
-
setCompassInformation
Sets aCompassInformation
object with compass details into the image, overriding any existing data.- Parameters:
compassInformation
- aCompassInformation
object 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 inRotationAngle
is 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 asRotationAngle
enum.
-
getGasQuantificationInput
Gets the inputs used for quantification from the image.
Note: whenGasQuantificationInput
is null or invalid, theGasQuantificationResult
is also invalid (but the object may be present).- Returns:
GasQuantificationInput
object 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 correspondingGasQuantificationInput
exists and is valid to make sure the returnedGasQuantificationResult
object is valid.- Returns:
GasQuantificationResult
object 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
ThermalImage
fields 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:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
ThermalStreamer.getImage()
API instead, for still images useImageColorizer.getImage()
API instead.