public final class ImageStream extends Object
This factory creates objects of IImageStream type.
This has a set of static methods for creating objects from different input data.
OcrEngine ocr = new OcrEngine(); ocr.setImage(ImageStream.fromFile("image.tiff")); ocr.setImage(ImageStream.fromBytes(bytes, imageStreamFormat));
| Modifier and Type | Method and Description |
|---|---|
static IImageStream |
fromBytes(byte[] bytes,
ImageStreamFormat type)
Creates instance of
IImageStream object from bytes array, parameter "format" sets a data type. |
static IImageStream |
fromFile(String imageFile)
Creates instance of “IImageStream” from the specified file.
|
public static IImageStream fromBytes(byte[] bytes, ImageStreamFormat type)
Creates instance of IImageStream object from bytes array, parameter "format" sets a data type.
bytes - The bytes array with image data.type - The ImageStreamFormat object sets image format in bytes parameter.IImageStream.public static IImageStream fromFile(String imageFile)
Creates instance of “IImageStream” from the specified file. This will raise exception if the file not exists or the file formats is not supported.
imageFile - A string that contains the name of the file from which to create the IImageStream.IImageStream object.OcrException - Thrown when file not exists or format not supported.Copyright © 2014. All rights reserved.