# Subject

public class **Subject** extends [Object](https://developer.android.com/reference/java/lang/Object.html)  
A segmented subject from the input image by `https://developers.google.com/android/reference/com/google/mlkit/vision/segmentation/subject/SubjectSegmenter`.

### Public Method Summary

|---|---|
| [Bitmap](https://developer.android.com/reference/android/graphics/Bitmap.html) | [getBitmap](https://developers.google.com/android/reference/com/google/mlkit/vision/segmentation/subject/Subject#getBitmap())() Returns the masked bitmap for this subject. |
| [FloatBuffer](https://developer.android.com/reference/java/nio/FloatBuffer.html) | [getConfidenceMask](https://developers.google.com/android/reference/com/google/mlkit/vision/segmentation/subject/Subject#getConfidenceMask())() Returns the confidence mask for this subject. |
| int | [getHeight](https://developers.google.com/android/reference/com/google/mlkit/vision/segmentation/subject/Subject#getHeight())() Returns the height of this subject. |
| int | [getStartX](https://developers.google.com/android/reference/com/google/mlkit/vision/segmentation/subject/Subject#getStartX())() Returns the starting x-coordinate of this subject in the input image. |
| int | [getStartY](https://developers.google.com/android/reference/com/google/mlkit/vision/segmentation/subject/Subject#getStartY())() Returns the starting y-coordinate of this subject in the input image. |
| int | [getWidth](https://developers.google.com/android/reference/com/google/mlkit/vision/segmentation/subject/Subject#getWidth())() Returns the width of this subject. |

### Inherited Method Summary

From class java.lang.Object

|---|---|
| [Object](https://developer.android.com/reference/java/lang/Object.html) | clone() |
| boolean | equals([Object](https://developer.android.com/reference/java/lang/Object.html) arg0) |
| void | finalize() |
| final [Class](https://developer.android.com/reference/java/lang/Class.html)\<?\> | getClass() |
| int | hashCode() |
| final void | notify() |
| final void | notifyAll() |
| [String](https://developer.android.com/reference/java/lang/String.html) | toString() |
| final void | wait(long arg0, int arg1) |
| final void | wait(long arg0) |
| final void | wait() |

## Public Methods

#### public [Bitmap](https://developer.android.com/reference/android/graphics/Bitmap.html)
**getBitmap** ()

Returns the masked bitmap for this subject.

Returns null if it is not enabled by `https://developers.google.com/android/reference/com/google/mlkit/vision/segmentation/subject/SubjectSegmenterOptions.SubjectResultOptions.Builder#enableSubjectBitmap()`

#### public [FloatBuffer](https://developer.android.com/reference/java/nio/FloatBuffer.html)
**getConfidenceMask** ()

Returns the confidence mask for this subject.

Returns null if it is not enabled by `https://developers.google.com/android/reference/com/google/mlkit/vision/segmentation/subject/SubjectSegmenterOptions.SubjectResultOptions.Builder#enableConfidenceMask()`

#### public int **getHeight** ()

Returns the height of this subject.

#### public int **getStartX** ()

Returns the starting x-coordinate of this subject in the input image.

#### public int **getStartY** ()

Returns the starting y-coordinate of this subject in the input image.

#### public int **getWidth** ()

Returns the width of this subject.