Class CaptureRequest.Builder¶
- java.lang.Object
-
- com.iristick.smartglass.support.camera2.CaptureRequest.Builder
- Enclosing class:
- CaptureRequest
public abstract static class CaptureRequest.Builder extends Object
This class allows to construct immutable capture requests.
To obtain a builder instance, use the
CameraDevice.createCaptureRequest(int)
method, which initializes the
request fields to one of the templates defined in CameraDevice
.
- See Also:
CameraDevice.createCaptureRequest(int)
Method Summary¶
Modifier and Type | Method and Description |
---|---|
abstract void |
addTarget(Surface outputTarget)
Adds a surface to the list of targets for this request.
|
abstract CaptureRequest |
build()
Builds a request using the current target surfaces and settings.
|
abstract <T,TA,TI> T |
get(CaptureRequest.Key<T,TA,TI> key)
Gets a capture request field value.
|
abstract void |
removeTarget(Surface outputTarget)
Removes a surface from the list of targets for this request.
|
abstract <T,TA,TI> void |
set(CaptureRequest.Key<T,TA,TI> key,
T value)
Sets a capture request field value.
|
abstract void |
setTag(Object tag)
Sets the tag for this request.
|
Methods inherited from class java.lang.Object¶
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Method Detail¶
addTarget¶
public abstract void addTarget(Surface outputTarget)
Adds a surface to the list of targets for this request.
Adding a target more than once has no effect.
- Parameters:
outputTarget
- Surface to use as an output target for this request.
removeTarget¶
public abstract void removeTarget(Surface outputTarget)
Removes a surface from the list of targets for this request.
Removing a target that is not currently added has no effect.
- Parameters:
outputTarget
- Surface to remove from the output target of this request.
get¶
public abstract <T,TA,TI> T get(CaptureRequest.Key<T,TA,TI> key)
- Type Parameters:
T
- The request field type.TA
- The Android key type.TI
- The Iristick key type.- Parameters:
key
- The field to read (keys are defined as constants inCaptureRequest
.- Returns:
- The value of the key, or
null
if the field is not set. - Throws:
IllegalArgumentException
- if the key is not supported by this type of camera device.
set¶
public abstract <T,TA,TI> void set(CaptureRequest.Key<T,TA,TI> key, T value)
- Type Parameters:
T
- The request field type.TA
- The Android key type.TI
- The Iristick key type.- Parameters:
key
- The field to set (keys are defined as constants inCaptureRequest
.value
- The value to set the field to.- Throws:
IllegalArgumentException
- if the key is not supported by this type of camera device.
setTag¶
public abstract void setTag(Object tag)
Sets the tag for this request.
Tags allow easy identification of a capture request. They are not used by the camera device.
- Parameters:
tag
- An arbitrary object to store with this request. This value may benull
.
build¶
public abstract CaptureRequest build()
Builds a request using the current target surfaces and settings.
Note that, although it is possible to create a CaptureRequest
with no target
surfaces, passing such a request into CameraCaptureSession.capture(com.iristick.smartglass.support.camera2.CaptureRequest, com.iristick.smartglass.support.camera2.CameraCaptureSession.CaptureCallback, android.os.Handler)
,
CameraCaptureSession.captureBurst(java.util.List<com.iristick.smartglass.support.camera2.CaptureRequest>, com.iristick.smartglass.support.camera2.CameraCaptureSession.CaptureCallback, android.os.Handler)
, or
CameraCaptureSession.setRepeatingRequest(com.iristick.smartglass.support.camera2.CaptureRequest, com.iristick.smartglass.support.camera2.CameraCaptureSession.CaptureCallback, android.os.Handler)
will cause
that method to throw an IllegalArgumentException
.
- Returns:
- A new capture request instance, ready for submission to the camera device.