public abstract class SCameraHazeRemoveProcessor extends SCameraProcessor
Applies the haze remove effect on the image data. This processor can be applied to a single image data (Image buffer processing) and also to a stream of image data (Image stream processing).
During 'Image buffer processing' this processor acquire input data via requestProcess(Image)
and haze remove effect applied result
Image will be posted to SCameraEffectProcessor.EventCallback
.
For 'Image stream processing', this processor takes a series of image data from input surface
and writes down
results image data to output surface
. This processing is useful for live-preview haze remove effect.
The output surface
needs to be configured before startStreamProcessing()
as its default output target for 'Image stream processing'.
Initialization key | |
---|---|
Key | Meaning |
SCameraProcessor.STREAM_SIZE | Input stream size |
SCameraProcessor.STILL_SIZE | Still image size |
SCameraProcessor.STILL_INPUT_FORMAT | Still image input format |
SCameraProcessor.STILL_OUTPUT_FORMAT | Still image output format |
Modifier and Type | Class and Description |
---|---|
static class |
SCameraHazeRemoveProcessor.EventCallback
Callback interface used to deliver the result image.
|
Modifier and Type | Field and Description |
---|---|
static SCameraProcessorParameter.Key<Integer> |
HAZE_REMOVE_STRENGTH
Haze remove effect strength level.
|
static SCameraProcessorParameter.Key<Range<Integer>> |
HAZE_REMOVE_STRENGTH_RANGE
Valid haze remove effect strength level range.
|
static String |
NAME
String name of beauty processor.
|
CAMERA_ID, JPEG_ORIENTATION, JPEG_QUALITY, MULTI_INPUT_COUNT_RANGE, NATIVE_PROCESSOR_MSG_DECODING_FAIL, NATIVE_PROCESSOR_MSG_ENCODING_FAIL, NATIVE_PROCESSOR_MSG_PROCESSING_FAIL, NATIVE_PROCESSOR_MSG_UNKNOWN_ERROR, STILL_INPUT_FORMAT, STILL_INPUT_FORMAT_LIST, STILL_OUTPUT_FORMAT, STILL_OUTPUT_FORMAT_LIST, STILL_SIZE, STILL_SIZE_LIST, STREAM_SIZE, STREAM_SIZE_LIST
Modifier and Type | Method and Description |
---|---|
abstract Surface |
getInputSurface()
Returns a surface, which will be an input to this processor.
|
abstract void |
requestProcess(Image data)
Processes image data.
|
abstract void |
setEventCallback(SCameraHazeRemoveProcessor.EventCallback callback,
Handler handler)
Registers a callback to be invoked for result.
|
abstract void |
setOutputSurface(Surface output)
Sets output surface.
|
abstract void |
startStreamProcessing()
Starts the stream processing.
|
abstract void |
stopStreamProcessing()
Stops the processing.
|
close, deinitialize, getParameters, initialize, setParameters
public static final String NAME
public static final SCameraProcessorParameter.Key<Integer> HAZE_REMOVE_STRENGTH
HAZE_REMOVE_STRENGTH_RANGE
.public static final SCameraProcessorParameter.Key<Range<Integer>> HAZE_REMOVE_STRENGTH_RANGE
public abstract Surface getInputSurface()
Returns a surface, which will be an input to this processor.
A returned surface will have a dimension same to SCameraProcessor.STREAM_SIZE
and a format of ImageFormat.YUV_420_888
.
IllegalStateException
- If SCameraProcessor.initialize()
is not called.public abstract void setOutputSurface(Surface output)
Sets output surface. Processed input image from input surface will be written to output surface. Generally, this function sets the surface to output the camera images.
This method must be called after initialize().
A Surface must be one of a TextureView, Allocation, SurfaceView, SurfaceTexture
. Not from ImageReader
.
This function has no checking of wrong format of surface.
output
- Output surface.IllegalStateException
- If SCameraProcessor.initialize()
is not called.IllegalArgumentException
- If surface is null or invalidpublic abstract void startStreamProcessing()
IllegalStateException
- If SCameraProcessor.initialize()
is not called or the processor is Streaming state.IllegalArgumentException
- If setOutputSurface(Surface)
is not called.public abstract void stopStreamProcessing()
IllegalStateException
- If SCameraProcessor.initialize()
is not called or the processor is in Stop state.public abstract void requestProcess(Image data)
Processes image data.
After calling this method, you must not call another requestProcess(Image)
until the EventCallback has returned.
Otherwise, RuntimeException will be thrown.
data
- Image instance which the haze remove effect will be applied to.IllegalStateException
- If SCameraProcessor.initialize()
is not called.IllegalArgumentException
- If data is null. Or if data is invalid.RuntimeException
- If fail to start processing.public abstract void setEventCallback(SCameraHazeRemoveProcessor.EventCallback callback, Handler handler)
callback
- a callback object that receives a result.handler
- the handler on which the callback should be invoked, or null
to use the current thread's looper
.IllegalStateException
- If SCameraProcessor.initialize()
is not called.IllegalArgumentException
- If no handler is given and the calling thread has no looper.Copyright © Samsung Electronics, Co., Ltd. All rights reserved.