Вы можете передать либо изменяемый, либо неизменяемый Bitmap . Однако после передачи Bitmap для сохранения целостности данных не следует изменять его содержимое.
[[["Прост для понимания","easyToUnderstand","thumb-up"],["Помог мне решить мою проблему","solvedMyProblem","thumb-up"],["Другое","otherUp","thumb-up"]],[["Отсутствует нужная мне информация","missingTheInformationINeed","thumb-down"],["Слишком сложен/слишком много шагов","tooComplicatedTooManySteps","thumb-down"],["Устарел","outOfDate","thumb-down"],["Проблема с переводом текста","translationIssue","thumb-down"],["Проблемы образцов/кода","samplesCodeIssue","thumb-down"],["Другое","otherDown","thumb-down"]],["Последнее обновление: 2025-07-25 UTC."],[],[],null,["# BitmapMlImageBuilder\n\npublic class **BitmapMlImageBuilder** \nBuilds [MlImage](/edge/api/tflite/java/com/google/android/odml/image/MlImage) from [Bitmap](https://developer.android.com/reference/android/graphics/Bitmap.html).\n\nYou can pass in either mutable or immutable [Bitmap](https://developer.android.com/reference/android/graphics/Bitmap.html). However once\n[Bitmap](https://developer.android.com/reference/android/graphics/Bitmap.html) is passed in, to keep data integrity you shouldn't modify content\nin it.\n\nUse [BitmapExtractor](/edge/api/tflite/java/com/google/android/odml/image/BitmapExtractor) to get [Bitmap](https://developer.android.com/reference/android/graphics/Bitmap.html) you passed in.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n### Public Constructors\n\n|---|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| | [BitmapMlImageBuilder](/edge/api/tflite/java/com/google/android/odml/image/BitmapMlImageBuilder#BitmapMlImageBuilder(Bitmap))(Bitmap bitmap) Creates the builder with a mandatory [Bitmap](https://developer.android.com/reference/android/graphics/Bitmap.html). |\n| | [BitmapMlImageBuilder](/edge/api/tflite/java/com/google/android/odml/image/BitmapMlImageBuilder#BitmapMlImageBuilder(Context,%20Uri))(Context context, Uri uri) Creates the builder to build [MlImage](/edge/api/tflite/java/com/google/android/odml/image/MlImage) from a file. |\n\n### Public Methods\n\n|--------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [MlImage](/edge/api/tflite/java/com/google/android/odml/image/MlImage) | [build](/edge/api/tflite/java/com/google/android/odml/image/BitmapMlImageBuilder#build())() Builds an [MlImage](/edge/api/tflite/java/com/google/android/odml/image/MlImage) instance. |\n| [BitmapMlImageBuilder](/edge/api/tflite/java/com/google/android/odml/image/BitmapMlImageBuilder) | [setRotation](/edge/api/tflite/java/com/google/android/odml/image/BitmapMlImageBuilder#setRotation(int))(int rotation) Sets value for [MlImage.getRotation()](/edge/api/tflite/java/com/google/android/odml/image/MlImage#getRotation()). |\n\n### Inherited Methods\n\nFrom class java.lang.Object \n\n|----------------------------------------------------------------------------------|--------------------------------------------------------------------------------------|\n| boolean | equals([Object](https://developer.android.com/reference/java/lang/Object.html) arg0) |\n| final [Class](https://developer.android.com/reference/java/lang/Class.html)\\\u003c?\\\u003e | getClass() |\n| int | hashCode() |\n| final void | notify() |\n| final void | notifyAll() |\n| [String](https://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\n**BitmapMlImageBuilder**\n(Bitmap bitmap)\n\nCreates the builder with a mandatory [Bitmap](https://developer.android.com/reference/android/graphics/Bitmap.html).\n\nAlso calls [setRotation(int)](/edge/api/tflite/java/com/google/android/odml/image/BitmapMlImageBuilder#setRotation(int)) to set the optional properties. If not set, the values\nwill be set with default:\n\n- rotation: 0\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n##### Parameters\n\n| bitmap | image data object. |\n|--------|--------------------|\n\n#### public\n**BitmapMlImageBuilder**\n(Context context, Uri uri)\n\nCreates the builder to build [MlImage](/edge/api/tflite/java/com/google/android/odml/image/MlImage) from a file.\n\nAlso calls [setRotation(int)](/edge/api/tflite/java/com/google/android/odml/image/BitmapMlImageBuilder#setRotation(int)) to set the optional properties. If not set, the values\nwill be set with default:\n\n- rotation: 0\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n##### Parameters\n\n| context | the application context. |\n| uri | the path to the resource file. |\n|---------|--------------------------------|\n\n##### Throws\n\n| [IOException](https://developer.android.com/reference/java/io/IOException.html) | |\n|---------------------------------------------------------------------------------|---|\n\nPublic Methods\n--------------\n\n#### public [MlImage](/edge/api/tflite/java/com/google/android/odml/image/MlImage)\n**build**\n()\n\nBuilds an [MlImage](/edge/api/tflite/java/com/google/android/odml/image/MlImage) instance. \n\n#### public [BitmapMlImageBuilder](/edge/api/tflite/java/com/google/android/odml/image/BitmapMlImageBuilder)\n**setRotation**\n(int rotation)\n\nSets value for [MlImage.getRotation()](/edge/api/tflite/java/com/google/android/odml/image/MlImage#getRotation()). \n\n##### Parameters\n\n| rotation | |\n|----------|---|\n\n##### Throws\n\n| [IllegalArgumentException](https://developer.android.com/reference/java/lang/IllegalArgumentException.html) | if the rotation value is not 0, 90, 180 or 270. |\n|-------------------------------------------------------------------------------------------------------------|-------------------------------------------------|"]]