FileTransformFactory
public final class FileTransformFactory
Factory for extracting transform info from image files.
This class is for extracting a OutputTransform from an image file saved by ImageCapture. The OutputTransform represents the transform being applied to the original camera buffer, which can be used by CoordinateTransform to transform coordinates between UseCases.
| See also | |
|---|---|
OutputTransform |
|
CoordinateTransform |
Summary
Public constructors |
|---|
Public methods |
|
|---|---|
@NonNull OutputTransform |
getOutputTransform(@NonNull File file)Extracts transform info from the given |
@NonNull OutputTransform |
getOutputTransform(@NonNull InputStream inputStream)Extracts transform info from the given |
@NonNull OutputTransform |
getOutputTransform(Extracts transform info from the given |
boolean |
Whether the factory respects the exif of the image file. |
void |
setUsingExifOrientation(boolean usingExifOrientation)Whether to include the |
Public constructors
Public methods
getOutputTransform
public @NonNull OutputTransform getOutputTransform(@NonNull File file)
Extracts transform info from the given File.
| Throws | |
|---|---|
java.io.IOException |
getOutputTransform
public @NonNull OutputTransform getOutputTransform(@NonNull InputStream inputStream)
Extracts transform info from the given InputStream.
| Throws | |
|---|---|
java.io.IOException |
getOutputTransform
public @NonNull OutputTransform getOutputTransform(
@NonNull ContentResolver contentResolver,
@NonNull Uri uri
)
Extracts transform info from the given Uri.
| Throws | |
|---|---|
java.io.IOException |
isUsingExifOrientation
public boolean isUsingExifOrientation()
Whether the factory respects the exif of the image file.
setUsingExifOrientation
public void setUsingExifOrientation(boolean usingExifOrientation)
Whether to include the TAG_ORIENTATION. By default, this value is false, e.g. loading image with BitmapFactory does not apply the exif orientation to the loaded Bitmap. Only set this if the exif orientation is applied to the loaded file. For example, if the image is loaded by a 3P library that automatically applies exif orientation.