Class Info |
---|
com.huawei.hiai.vision.image.sr.ImageSuperResolution Performs super-resolution processing on the input image, and returns the processed image, as well as the execution result code. |
Constructor Name |
---|
ImageSuperResolution(Context context) Constructs an ImageSuperResolution object. |
Qualifier and Type |
Method Name |
---|---|
void |
setScale(float scale) (Compatible with the earlier aar package, not recommended) Sets the scale of super resolution. |
void |
setQuality(int quality) (Compatible with the earlier aar package, not recommended) Sets the quality of super resolution. |
void |
setSuperResolutionConfiguration(SuperResolutionConfiguration superResolutionConfiguration) (Compatible with the earlier aar package, not recommended) Sets super resolution parameters. If this function is not called, 1x super resolution is used by default. |
ImageResult |
doSuperResolution(Frame frame, IVisionCallback cb) (Compatible with the earlier aar package, not recommended) Performs super resolution processing on an image and returns the result. |
void |
setBitmap(Bitmap bitmap) (Compatible with the earlier aar package, not recommended) Sets the result Bitmap. |
void |
setResultCode(int resultCode) (Compatible with the earlier aar package, not recommended) Sets the result code. |
float |
getScale() (Compatible with the earlier aar package, not recommended) Obtains the scale of super resolution. |
int |
(Compatible with the earlier aar package, not recommended) Obtains the quality of super resolution. |
Bitmap |
(Compatible with the earlier aar package, not recommended) Obtains the result Bitmap of super resolution. |
int |
(Compatible with the earlier aar package, not recommended) Obtains the result code. |
void |
setScale(float scale) (EMUI 10.0 or later) Sets the scale of super resolution. |
void |
setQuality(int quality) (EMUI 10.0 or later) Sets the quality of super resolution. |
void |
setSuperResolutionConfiguration(SISRConfiguration config) (EMUI 10.0 or later) Sets super resolution parameters. If this function is not called, or the input is null, 1x super resolution with the highest quality is used by default. |
int |
doSuperResolution(VisionImage image, ImageResult result, VisionCallback<ImageResult> sisrCallback) (EMUI 10.0 or later) Performs super resolution processing on an image and returns the result code. |
void |
setBitmap(Bitmap bitmap) (EMUI 10.0 or later) Sets the result Bitmap. |
float |
getScale() (EMUI 10.0 or later) Obtains the scale of super resolution. |
int |
(EMUI 10.0 or later) Obtains the quality of super resolution. |
Bitmap |
(EMUI 10.0 or later) Obtains the result Bitmap. |
Constructor |
---|
public ImageSuperResolution(Context context) Creates an image super-resolution constructor instance. |
Name |
Description |
---|---|
context |
App context. |
Method |
---|
public void setScale(float scale) (Compatible with the earlier aar package, not recommended) Sets the scale of super resolution. |
Name |
Description |
---|---|
scale |
The super resolution scale. Currently, SuperResolutionConfiguration.SISR_SCALE_1X and SuperResolutionConfiguration.SISR_SCALE_3X are supported. |
Method |
---|
public void setQuality(int quality) (Compatible with the earlier aar package, not recommended) Sets the quality of super resolution. |
Name |
Description |
---|---|
quality |
Super resolution quality. This parameter is reserved. The highest quality is always used for now. |
Method |
---|
public void setSuperResolutionConfiguration(SuperResolutionConfiguration superResolutionConfiguration) (Compatible with the earlier aar package, not recommended) Sets super resolution parameters. If this function is not called, 1x super resolution is used by default. |
Name |
Description |
---|---|
superResolutionConfiguration |
Type from com.huawei.hiai.vision.visionkit.image.sr, which describes the super resolution configurations. If the input is null, the default value 1x is used. |
Method |
---|
public ImageResult doSuperResolution(Frame frame, IVisionCallback cb) (Compatible with the earlier aar package, not recommended) Performs super resolution processing on an image and returns the result. |
Name |
Description |
---|---|
frame |
Type from com.huawei.hiai.vision.visionkit.common, which describes the input image. Currently, grayscale images and RGB images are supported. In Java, the Bitmap is in ALPHA_8 or ARGB_8888 format. For details about the supported maximum image size, see the restrictions in the Service Introduction. |
cb |
Callback function used to return the result in asynchronous processing. Asynchronous processing is not supported at present. You can set this parameter to null. |
Type |
Description |
---|---|
ImageResult |
The super-resolution processing result. The result Bitmap is encapsulated internally, and the get or set method can be called. It should have the same pixel format as the Bitmap in the input frame. If the input parameters do not meet the preceding requirements, the processing fails and the returned result is null. |
Method |
---|
public void setBitmap(Bitmap bitmap) (Compatible with the earlier aar package, not recommended) Sets the result Bitmap. |
Name |
Description |
---|---|
bitmap |
Android Bitmap type, which is used to set the result image. |
Method |
---|
public void setResultCode(int resultCode) (Compatible with the earlier aar package, not recommended) Sets the result code. |
Name |
Description |
---|---|
bitmap |
Android Bitmap type, which is used to set the result image. |
Method |
---|
public float getScale() (Compatible with the earlier aar package, not recommended) Obtains the scale of super resolution. |
Type |
Description |
---|---|
float |
The super resolution scale. |
Method |
---|
public int getQuality() (Compatible with the earlier aar package, not recommended) Obtains the quality of super resolution. |
Type |
Description |
---|---|
int |
Super resolution quality. |
Method |
---|
public Bitmap getBitmap() (Compatible with the earlier aar package, not recommended) Obtains the result Bitmap of super resolution. |
Type |
Description |
---|---|
Bitmap |
Bitmap of the ImageResult class object in the super-resolution result. |
Method |
---|
public int getResultCode() (Compatible with the earlier aar package, not recommended) Obtains the result code. |
Type |
Description |
---|---|
int |
Result code of the ImageResult class object in the super-resolution result. The value 0 indicates that no error occurs. For details, see com.huawei.hiai.common.HwHiAIResultCode. |
Method |
---|
public void setScale(float scale) (EMUI 10.0 or later) Sets the scale of super resolution. |
Name |
Description |
---|---|
scale |
The super resolution scale. Currently, SuperResolutionConfiguration.SISR_SCALE_1X and SuperResolutionConfiguration.SISR_SCALE_3X are supported. |
Method |
---|
public void setQuality(int quality) (EMUI 10.0 or later) Sets the quality of super resolution. |
Name |
Description |
---|---|
quality |
Super resolution quality. Currently, SISRConfiguration.SISR_QUALITY_LOW, SISRConfiguration.SISR_QUALITY_MEDIUM, and SISRConfiguration.SISR_QUALITY_HIGH are supported. This parameter is reserved. The highest quality is always used for now. |
Method |
---|
public void setSuperResolutionConfiguration(SISRConfiguration config) (EMUI 10.0 or later) Sets super resolution parameters. If this function is not called, or the input is null, 1x super resolution with the highest quality is used by default. |
Name |
Description |
---|---|
config |
Type from com.huawei.hiai.vision.visionkit.image.sr, which describes the super resolution configurations. If the input is null, the default value 1x is used. |
Method |
---|
public int doSuperResolution(VisionImage image, ImageResult result, VisionCallback<ImageResult> sisrCallback) (EMUI 10.0 or later) Performs super resolution processing on an image and returns the result code. image indicates the input image. If sisrCallback is null, doSuperResolution is called synchronously, and the super-resolution image is output from the second parameter. If sisrCallback is not null, doSuperResolution is asynchronously called (HwHiAIResultCode.AIRESULT_ASYNC_MODE is returned upon success), and sisrCallback specifies the callback function object in asynchronous mode. The super-resolution image is returned through callback. |
Name |
Description |
---|---|
image |
Input image description, which is from the com.huawei.hiai.vision.common type. The Bitmap can be specified. Currently, grayscale images and RGB images are supported. In Java, the Bitmap is in ALPHA_8 or ARGB_8888 format. For details about the supported maximum image size, see the Development Guide. |
result |
If doSuperResolution is called synchronously (see the sisrCallback parameter), the processed super-resolution image is output from this parameter. If doSuperResolution is called asynchronously, this parameter is invalid. |
sisrCallback |
If sisrCallback is null, doSuperResolution is called synchronously, and the super-resolution image is output from result. If sisrCallback is not null, doSuperResolution is asynchronously called (HwHiAIResultCode.AIRESULT_ASYNC_MODE is returned upon success), and sisrCallback specifies the callback function object in asynchronous mode. The super-resolution image is returned through callback. |
Type |
Description |
---|---|
int |
Super-resolution result code. For synchronous calling, the specific result code is returned. In asynchronous mode, HwHiAIResultCode.AIRESULT_ASYNC_MODE is returned after the API is called successfully. For details about the meanings of other return values, see com.huawei.hiai.common.HwHiAIResultCode. |
Method |
---|
public void setBitmap(Bitmap bitmap) (EMUI 10.0 or later) Sets the result Bitmap. |
Name |
Description |
---|---|
bitmap |
Android Bitmap type, which is used to set the result image. |
Method |
---|
public float getScale() (EMUI 10.0 or later) Obtains the scale of super resolution. |
Type |
Description |
---|---|
float |
The super resolution scale. |
Method |
---|
public int getQuality() (EMUI 10.0 or later) Obtains the quality of super resolution. |
Type |
Description |
---|---|
int |
Super resolution quality. |
Method |
---|
public Bitmap getBitmap() (EMUI 10.0 or later) Obtains the result Bitmap. |
Type |
Description |
---|---|
Bitmap |
Bitmap of the ImageResult class object in the super-resolution result. |