1.1.0版本
This commit is contained in:
27
UniTAP/dev/ports/modules/internal_utils/image_utils.py
Normal file
27
UniTAP/dev/ports/modules/internal_utils/image_utils.py
Normal file
@@ -0,0 +1,27 @@
|
||||
from UniTAP.libs.lib_uicl.uicl import *
|
||||
|
||||
|
||||
def save_video_to_bin(path: str, data: list):
|
||||
raise NotImplementedError(f"Temporary not supported saving to bin file format.")
|
||||
|
||||
|
||||
def save_video_to_mp4(path: str, data: list):
|
||||
raise NotImplementedError(f"Temporary not supported saving to mp4 file format.")
|
||||
|
||||
|
||||
def save_image_to_bin(path: str, image_object: UICL_Image):
|
||||
res = UICL_SaveToFile(image_object, path, ImageFileFormat.FILE_FORMAT_BIN)
|
||||
if res != 0:
|
||||
raise SystemError(f"Error saving image to BIN format. Error code {res}. Description {uicl_errors.get(res)}")
|
||||
|
||||
|
||||
def save_image_to_bmp(path: str, image_object: UICL_Image):
|
||||
res = UICL_SaveToFile(image_object, path, ImageFileFormat.FILE_FORMAT_BMP)
|
||||
if res != 0:
|
||||
raise SystemError(f"Error saving image to BMP format. Error code {res}. Description {uicl_errors.get(res)}")
|
||||
|
||||
|
||||
def save_image_to_ppm(path: str, image_object: UICL_Image):
|
||||
res = UICL_SaveToFile(image_object, path, ImageFileFormat.FILE_FORMAT_PPM)
|
||||
if res != 0:
|
||||
raise SystemError(f"Error saving image to PPM format. Error code {res}. Description {uicl_errors.get(res)}")
|
||||
Reference in New Issue
Block a user