MediaMlImageBuilder
Stay organized with collections
Save and categorize content based on your preferences.
Public Constructor Summary
Inherited Method Summary
From class java.lang.Object
Public Constructors
Creates the builder with a mandatory Image
.
Also calls setRotation(int)
to set the optional properties. If not set, the values will
be set with default:
Parameters
mediaImage
image data object.
Public Methods
Throws
if the rotation value is not 0, 90, 180 or 270.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License
, and code samples are licensed under the Apache 2.0 License
. For details, see the Google Developers Site Policies
. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-31 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-10-31 UTC."],[[["\u003cp\u003e\u003ccode\u003eMediaMlImageBuilder\u003c/code\u003e facilitates the creation of \u003ccode\u003eMlImage\u003c/code\u003e objects from \u003ccode\u003eImage\u003c/code\u003e data.\u003c/p\u003e\n"],["\u003cp\u003eIt's crucial to maintain the integrity of the original \u003ccode\u003eImage\u003c/code\u003e data after passing it to the builder.\u003c/p\u003e\n"],["\u003cp\u003eYou can customize the \u003ccode\u003eMlImage\u003c/code\u003e by setting its rotation using the \u003ccode\u003esetRotation\u003c/code\u003e method.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eMediaMlImageBuilder\u003c/code\u003e provides a \u003ccode\u003ebuild\u003c/code\u003e method to finalize and obtain the constructed \u003ccode\u003eMlImage\u003c/code\u003e instance.\u003c/p\u003e\n"],["\u003cp\u003eBy default, if rotation is not specified, it is set to 0.\u003c/p\u003e\n"]]],[],null,["# MediaMlImageBuilder\n\npublic class **MediaMlImageBuilder** extends [Object](//developer.android.com/reference/java/lang/Object.html) \nBuilds [MlImage](/android/reference/com/google/android/odml/image/MlImage) from\n[Image](//developer.android.com/reference/android/media/Image.html).\n\nOnce [Image](//developer.android.com/reference/android/media/Image.html) is passed in,\nto keep data integrity you shouldn't modify content in it.\n\nUse [MediaImageExtractor](/android/reference/com/google/android/odml/image/MediaImageExtractor)\nto get [Image](//developer.android.com/reference/android/media/Image.html) you passed\nin. \n\n### Public Constructor Summary\n\n|---|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| | [MediaMlImageBuilder](/android/reference/com/google/android/odml/image/MediaMlImageBuilder#MediaMlImageBuilder(android.media.Image))([Image](//developer.android.com/reference/android/media/Image.html) mediaImage) Creates the builder with a mandatory [Image](//developer.android.com/reference/android/media/Image.html). |\n\n### Public Method Summary\n\n|---------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [MlImage](/android/reference/com/google/android/odml/image/MlImage) | [build](/android/reference/com/google/android/odml/image/MediaMlImageBuilder#build())() Builds an [MlImage](/android/reference/com/google/android/odml/image/MlImage) instance. |\n| [MediaMlImageBuilder](/android/reference/com/google/android/odml/image/MediaMlImageBuilder) | [setRotation](/android/reference/com/google/android/odml/image/MediaMlImageBuilder#setRotation(int))(int rotation) Sets value for [MlImage.getRotation()](/android/reference/com/google/android/odml/image/MlImage#getRotation()). |\n\n### Inherited Method Summary\n\nFrom class java.lang.Object \n\n|----------------------------------------------------------------------------|--------------------------------------------------------------------------------|\n| [Object](//developer.android.com/reference/java/lang/Object.html) | clone() |\n| boolean | equals([Object](//developer.android.com/reference/java/lang/Object.html) arg0) |\n| void | finalize() |\n| final [Class](//developer.android.com/reference/java/lang/Class.html)\\\u003c?\\\u003e | getClass() |\n| int | hashCode() |\n| final void | notify() |\n| final void | notifyAll() |\n| [String](//developer.android.com/reference/java/lang/String.html) | toString() |\n| final void | wait(long arg0, int arg1) |\n| final void | wait(long arg0) |\n| final void | wait() |\n\nPublic Constructors\n-------------------\n\n#### public **MediaMlImageBuilder** ([Image](//developer.android.com/reference/android/media/Image.html) mediaImage)\n\nCreates the builder with a mandatory [Image](//developer.android.com/reference/android/media/Image.html).\n\nAlso calls [setRotation(int)](/android/reference/com/google/android/odml/image/MediaMlImageBuilder#setRotation(int)) to set the optional properties. If not set, the values will\nbe set with default:\n\n- rotation: 0 \n\n##### Parameters\n\n| mediaImage | image data object. |\n|------------|--------------------|\n\nPublic Methods\n--------------\n\n#### public [MlImage](/android/reference/com/google/android/odml/image/MlImage)\n**build** ()\n\nBuilds an [MlImage](/android/reference/com/google/android/odml/image/MlImage)\ninstance. \n\n#### public [MediaMlImageBuilder](/android/reference/com/google/android/odml/image/MediaMlImageBuilder)\n**setRotation** (int rotation)\n\nSets value for [MlImage.getRotation()](/android/reference/com/google/android/odml/image/MlImage#getRotation()). \n\n##### Throws\n\n| [IllegalArgumentException](//developer.android.com/reference/java/lang/IllegalArgumentException.html) | if the rotation value is not 0, 90, 180 or 270. |\n|-------------------------------------------------------------------------------------------------------|-------------------------------------------------|"]]