### Triangle.getAllPoints() Source: https://developers.google.com/android/reference/com/google/mlkit/vision/common/Triangle Gets all points inside the Triangle. This method returns a List of generic type T, representing the points contained within the triangle. ```APIDOC ## public List getAllPoints () ### Description Gets all points inside the `Triangle`. ### Method public List ### Parameters None ### Response #### Success Response - **List** - A list containing all points within the triangle. ``` -------------------------------- ### PointF3D Constructors and Methods Source: https://developers.google.com/android/reference/com/google/mlkit/vision/common/PointF3D This section details the constructors and public methods available for the PointF3D class, including how to create a PointF3D object and retrieve its coordinates. ```APIDOC ## PointF3D Represents a 3D point. ### Public Constructors #### public PointF3D () ### Public Methods #### public static PointF3D from (float x, float y, float z) Creates a 3D point with given X, Y, Z coordinate values. ##### Parameters * **x** (float) - The X coordinate. * **y** (float) - The Y coordinate. * **z** (float) - The Z coordinate. ##### Returns * (PointF3D) - A new PointF3D object. The return value is always non-null. #### public abstract float getX () Returns the X value of the point. ##### Returns * (float) - The X value of the point. #### public abstract float getY () Returns the Y value of the point. ##### Returns * (float) - The Y value of the point. #### public abstract float getZ () Returns the Z value of the point. ##### Returns * (float) - The Z value of the point. ``` -------------------------------- ### Create InputImage from File URI Source: https://developers.google.com/android/reference/com/google/mlkit/vision/common/InputImage Creates an InputImage from a local image file URI. Requires a Context and the Uri of the image. ```java static InputImage fromFilePath(Context context, Uri imageUri) ``` -------------------------------- ### InputImage Creation Methods Source: https://developers.google.com/android/reference/com/google/mlkit/vision/common/InputImage Provides static methods to create an InputImage object from different image sources, including Bitmaps, byte arrays, ByteBuffers, file paths, and MediaImage objects. Rotation degrees are used to specify the image orientation. ```APIDOC ## Static Methods for InputImage Creation ### fromBitmap Creates an `InputImage` from a `Bitmap`. - **bitmap** (Bitmap) - The input Bitmap. - **rotationDegrees** (int) - The rotation degrees of the image. ### fromByteArray Creates an `InputImage` from a byte array. - **byteArray** (byte[]) - The input byte array. - **width** (int) - The width of the image. - **height** (int) - The height of the image. - **rotationDegrees** (int) - The rotation degrees of the image. - **format** (int) - The image format (e.g., `InputImage.IMAGE_FORMAT_NV21`). ### fromByteBuffer Creates an `InputImage` from a `ByteBuffer`. - **byteBuffer** (ByteBuffer) - The input ByteBuffer. - **width** (int) - The width of the image. - **height** (int) - The height of the image. - **rotationDegrees** (int) - The rotation degrees of the image. - **format** (int) - The image format (e.g., `InputImage.IMAGE_FORMAT_NV21`). ### fromFilePath Creates an `InputImage` from a local image file Uri. - **context** (Context) - The application context. - **imageUri** (Uri) - The Uri of the image file. ### fromMediaImage Creates an `InputImage` from an `Image` object. - **image** (Image) - The input `Image` object (from `android.hardware.camera2` API). - **rotationDegrees** (int) - The rotation degrees of the image. ``` -------------------------------- ### Create InputImage from ByteBuffer Source: https://developers.google.com/android/reference/com/google/mlkit/vision/common/InputImage Creates an InputImage from a ByteBuffer. Requires image dimensions, rotation, and format. ```java static InputImage fromByteBuffer(ByteBuffer byteBuffer, int width, int height, int rotationDegrees, int format) ``` -------------------------------- ### fromBitmap Source: https://developers.google.com/android/reference/com/google/mlkit/vision/common/InputImage Creates an InputImage from a Bitmap object. Rotation degrees must be 0, 90, 180, or 270. ```APIDOC ## fromBitmap ### Description Creates an `InputImage` from a `Bitmap`. ### Method `public static InputImage fromBitmap(Bitmap bitmap, int rotationDegrees)` ### Parameters #### Path Parameters - **bitmap** (Bitmap) - The input `Bitmap`. - **rotationDegrees** (int) - The image's counter-clockwise orientation degrees. Only 0, 90, 180, 270 are supported. IllegalArgumentException will be thrown if the input degree is not in the list. ``` -------------------------------- ### Create InputImage from Byte Array Source: https://developers.google.com/android/reference/com/google/mlkit/vision/common/InputImage Creates an InputImage from a byte array, commonly obtained from a Camera callback. Requires image dimensions, rotation, and format. ```java static InputImage fromByteArray(byte[] byteArray, int width, int height, int rotationDegrees, int format) ``` -------------------------------- ### Create InputImage from Bitmap Source: https://developers.google.com/android/reference/com/google/mlkit/vision/common/InputImage Creates an InputImage from a Bitmap object. Rotation degrees should be specified. ```java static InputImage fromBitmap(Bitmap bitmap, int rotationDegrees) ``` -------------------------------- ### fromByteBuffer Source: https://developers.google.com/android/reference/com/google/mlkit/vision/common/InputImage Creates an InputImage from a ByteBuffer. Assumes the entire buffer from position zero to its limit is image data. Supported formats are IMAGE_FORMAT_NV21 and IMAGE_FORMAT_YV12. ```APIDOC ## fromByteBuffer ### Description Creates an `InputImage` from a `ByteBuffer`. We assume the entire buffer from position zero to its limit is all image data. ### Method `public static InputImage fromByteBuffer(ByteBuffer byteBuffer, int width, int height, int rotationDegrees, int format)` ### Parameters #### Path Parameters - **byteBuffer** (ByteBuffer) - The content of the image. - **width** (int) - The width of the image. - **height** (int) - The height of the image. - **rotationDegrees** (int) - The image's counter-clockwise orientation degrees. Only 0, 90, 180, 270 are supported. IllegalArgumentException will be thrown if the input degree is not in the list. - **format** (int) - The image format. The supported formats are `IMAGE_FORMAT_NV21` and `IMAGE_FORMAT_YV12`. For IMAGE_FORMAT_YUV_420_888, please use `fromMediaImage(Image, int)`. ``` -------------------------------- ### fromByteArray Source: https://developers.google.com/android/reference/com/google/mlkit/vision/common/InputImage Creates an InputImage from a byte array, commonly obtained from Camera callbacks. Supported formats are IMAGE_FORMAT_NV21 and IMAGE_FORMAT_YV12. ```APIDOC ## fromByteArray ### Description Creates an `InputImage` from a byte array, e.g., what you get from `Camera` callback. ### Method `public static InputImage fromByteArray(byte[] byteArray, int width, int height, int rotationDegrees, int format)` ### Parameters #### Path Parameters - **byteArray** (byte[]) - The content of the image. - **width** (int) - The width of the image. - **height** (int) - The height of the image. - **rotationDegrees** (int) - The image's counter-clockwise orientation degrees. Only 0, 90, 180, 270 are supported. IllegalArgumentException will be thrown if the input degree is not in the list. - **format** (int) - The image format. The supported formats are `IMAGE_FORMAT_NV21` and `IMAGE_FORMAT_YV12`. For IMAGE_FORMAT_YUV_420_888, please use `fromMediaImage(Image, int)`. ``` -------------------------------- ### fromFilePath Source: https://developers.google.com/android/reference/com/google/mlkit/vision/common/InputImage Creates an InputImage from a local image file Uri. This method may throw an IOException if the image cannot be retrieved. ```APIDOC ## fromFilePath ### Description Creates an `InputImage` from a local image file Uri. ### Method `public static InputImage fromFilePath(Context context, Uri imageUri)` ### Parameters #### Path Parameters - **context** (Context) - The application context. - **imageUri** (Uri) - The Uri of the image file. ### Throws - **IOException** - if the image could not be retrieved from the specified imageUri. This could happen even if the Uri came from content chooser, e.g., some users might have content providers for remote resources. ``` -------------------------------- ### Create InputImage from MediaImage Source: https://developers.google.com/android/reference/com/google/mlkit/vision/common/InputImage Creates an InputImage from an Image object, typically obtained from the android.hardware.camera2 API. Rotation degrees should be specified. ```java static InputImage fromMediaImage(Image image, int rotationDegrees) ``` -------------------------------- ### fromMediaImage Source: https://developers.google.com/android/reference/com/google/mlkit/vision/common/InputImage Creates an InputImage from an android.media.Image object. Only JPEG and YUV_420_888 formats are supported. For YUV_420_888, it's more efficient for all APIs. Ensure the underlying Image is not closed before processing. ```APIDOC ## fromMediaImage ### Description Creates an `InputImage` from an `Image` object, e.g., what you obtained from android.hardware.camera2 API. Please wait for the detector to finish processing this `InputImage` before you close the underlying `Image`. ### Method `public static InputImage fromMediaImage(Image image, int rotationDegrees)` ### Parameters #### Path Parameters - **image** (Image) - The android.media.Image, where only JPEG / YUV_420_888 formats are supported at this moment and YUV_420_888 is more efficient for all our APIs. - **rotationDegrees** (int) - The image's counter-clockwise orientation degrees. Only 0, 90, 180, 270 are supported. IllegalArgumentException will be thrown if the input degree is not in the list. ``` -------------------------------- ### InputImage Constants Source: https://developers.google.com/android/reference/com/google/mlkit/vision/common/InputImage Defines constants for accepted image formats used by ML Kit vision APIs. ```APIDOC ## Constants for Image Formats ### IMAGE_FORMAT_NV21 Represents the NV21 image format. ### IMAGE_FORMAT_YUV_420_888 Represents the YUV_420_888 image format. ### IMAGE_FORMAT_YV12 Represents the YV12 image format. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.