java.lang.Object
org.libheiffx.LibheifImage
Loads the native libheif lib and process the image in the native space. This
is the entry point of the whole libheif lib to be used
- Author:
- Clemens Lanthaler
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintImage bit depth (e.g.intImage colorsURL of the given fileintGets the height of the given imageintGets the width of the native imageRetrievs for the given file in the constructor the metadata Important: The timestamps are in EpocheInSeconds and not millisecondsintsame as getStride but without the including the width of the imageintOne line of the native imagestatic voidUnpacks all native libs and places them in a temp directory and include them in the directoryint[]Reads from give URL as string the file.byte[]readPixelDataFromStream(byte[] sourceFileAsByteArray) Loading the native image from the given stream and give it as byte array backtoString()String representation of the image
-
Constructor Details
-
LibheifImage
-
-
Method Details
-
loadLibs
Unpacks all native libs and places them in a temp directory and include them in the directory- Parameters:
tempDir- directory where the native libs are placed- Throws:
IOException- if it is not possible to load/unpack the native libs into a temp directory
-
readPixelDataFromStream
Loading the native image from the given stream and give it as byte array back- Parameters:
sourceFileAsByteArray- the stream as array of bytes (raw bytes)- Returns:
- an array of rgb bytes of the image which can be feed to the image class
- Throws:
IOException- if the given byte array cannot be read
-
readPixelData
Reads from give URL as string the file. Please use before constructor LibrawImage(String imageFile)- Returns:
- int array of RGB values which can be further processed
- Throws:
IOException- if the given file cannot be read
-
getMetaData
Retrievs for the given file in the constructor the metadata Important: The timestamps are in EpocheInSeconds and not milliseconds- Returns:
- Hashmap of all meta data
- Throws:
IOException
-
getImageFileURL
URL of the given file- Returns:
- the URL to be read by readPixelData
-
getImageWidth
public int getImageWidth()Gets the width of the native image- Returns:
- width as short (int) of the native image
-
getImageHeight
public int getImageHeight()Gets the height of the given image- Returns:
- height as short (int) of the given image
-
getImageBits
public int getImageBits()Image bit depth (e.g. 16bit, 8 bit, ...)- Returns:
- the image bits
-
getImageColors
public int getImageColors()Image colors- Returns:
- if RGB or ARGB (3 or 4 color model)
-
getStride
public int getStride()One line of the native image- Returns:
- line of the image
-
getNumBands
public int getNumBands()same as getStride but without the including the width of the image- Returns:
- numBands
-
getCameraModel
-
getShootingDateTime
-
toString
String representation of the image
-