Summary: Ctors | Methods | Inherited Methods
public
static
final
class
ImageWriter.Builder
extends Object
Builder class for ImageWriter objects.
Summary
Public constructors | |
|---|---|
Builder(Surface surface)
Constructs a new builder for |
|
Public methods | |
|---|---|
ImageWriter
|
build()
Builds a new ImageWriter object. |
ImageWriter.Builder
|
setDataSpace(int dataSpace)
Set the dataspace of this ImageWriter. |
ImageWriter.Builder
|
setHardwareBufferFormat(int hardwareBufferFormat)
Set the hardwareBuffer format of this ImageWriter. |
ImageWriter.Builder
|
setImageFormat(int imageFormat)
Set the image format of this ImageWriter. |
ImageWriter.Builder
|
setMaxImages(int maxImages)
Set the maximum number of images. |
ImageWriter.Builder
|
setUsage(long usage)
Set the usage flag of this ImageWriter. |
ImageWriter.Builder
|
setWidthAndHeight(int width, int height)
Set the width and height of images. |
Inherited methods | |||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
From class
| |||||||||||||||||||||||
Public constructors
Builder
public Builder (Surface surface)
Constructs a new builder for ImageWriter.
| Parameters | |
|---|---|
surface |
Surface: The destination Surface this writer produces Image data into.
This value cannot be null. |
| Throws | |
|---|---|
IllegalArgumentException |
if the surface is already abandoned. |
Public methods
build
public ImageWriter build ()
Builds a new ImageWriter object.
| Returns | |
|---|---|
ImageWriter |
The new ImageWriter object.
This value cannot be null. |
setMaxImages
public ImageWriter.Builder setMaxImages (int maxImages)
Set the maximum number of images. Default value is 1.
| Parameters | |
|---|---|
maxImages |
int: The maximum number of Images the user will want to access simultaneously
for producing Image data.
Value is 1 or greater |
| Returns | |
|---|---|
ImageWriter.Builder |
the Builder instance with customized usage value.
This value cannot be null. |
setWidthAndHeight
public ImageWriter.Builder setWidthAndHeight (int width, int height)
Set the width and height of images. Default size is dependent on the Surface that is provided by the downstream end-point.
| Parameters | |
|---|---|
width |
int: The width in pixels that will be passed to the producer.
Value is 1 or greater |
height |
int: The height in pixels that will be passed to the producer.
Value is 1 or greater |
| Returns | |
|---|---|
ImageWriter.Builder |
the Builder instance with customized width and height.
This value cannot be null. |