Package com.mindee.extraction
Class ExtractedImage
- java.lang.Object
-
- com.mindee.extraction.ExtractedImage
-
public class ExtractedImage extends Object
An extracted sub-image.
-
-
Constructor Summary
Constructors Constructor Description ExtractedImage(BufferedImage image, String filename, String saveFormat)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LocalInputSource
asInputSource()
Return the image in a format suitable for sending to MindeeClient for parsing.String
getFilename()
BufferedImage
getImage()
String
getSaveFormat()
void
writeToFile(String outputPath)
Write the image to a file.
-
-
-
Constructor Detail
-
ExtractedImage
public ExtractedImage(BufferedImage image, String filename, String saveFormat)
- Parameters:
image
- Buffered image object.filename
- Name of the extracted image.saveFormat
- Format to save the image as, defaults to PNG.
-
-
Method Detail
-
writeToFile
public void writeToFile(String outputPath) throws IOException
Write the image to a file. Uses the default image format and filename.- Parameters:
outputPath
- the output directory (must exist).- Throws:
IOException
- Throws if the file can't be accessed.
-
asInputSource
public LocalInputSource asInputSource() throws IOException
Return the image in a format suitable for sending to MindeeClient for parsing.- Returns:
- an instance of
LocalInputSource
- Throws:
IOException
- Throws if the file can't be accessed.
-
getImage
public BufferedImage getImage()
-
getFilename
public String getFilename()
-
getSaveFormat
public String getSaveFormat()
-
-