AI-generated Key Takeaways
-
BitmapMlImageBuilder builds MlImage from Bitmap.
-
You can use either mutable or immutable Bitmap, but do not modify the Bitmap after it's passed in.
-
You can retrieve the Bitmap you passed in using BitmapExtractor.
-
BitmapMlImageBuilder can be created with a Bitmap object or from a file specified by Context and Uri.
-
The build() method constructs the MlImage instance, and setRotation() sets the rotation property.
You can pass in either mutable or immutable Bitmap. However
once Bitmap is passed
in, to keep data integrity you shouldn't modify content in it.
Use BitmapExtractor
to get Bitmap you passed
in.
Public Constructor Summary
Public Method Summary
| MlImage | |
| BitmapMlImageBuilder |
setRotation(int rotation)
Sets value for
MlImage.getRotation().
|
Inherited Method Summary
Public Constructors
public BitmapMlImageBuilder (Bitmap bitmap)
Creates the builder with a mandatory Bitmap.
Also calls
setRotation(int) to set the optional properties. If not set, the values will
be set with default:
- rotation: 0
Parameters
| bitmap | image data object. |
|---|
public BitmapMlImageBuilder (Context context, Uri uri)
Creates the builder to build MlImage from
a file.
Also calls
setRotation(int) to set the optional properties. If not set, the values will
be set with default:
- rotation: 0
Parameters
| context | the application context. |
|---|---|
| uri | the path to the resource file. |
Throws
| IOException |
|---|
Public Methods
public BitmapMlImageBuilder setRotation (int rotation)
Sets value for MlImage.getRotation().
Throws
| IllegalArgumentException | if the rotation value is not 0, 90, 180 or 270. |
|---|