diff --git a/Cargo.lock b/Cargo.lock index ba37715..ed837e3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -64,7 +64,14 @@ dependencies = [ [[package]] name = "ohos-drawing-sys" -version = "0.1.1" +version = "0.1.2" +dependencies = [ + "document-features", +] + +[[package]] +name = "ohos-image-kit-sys" +version = "0.1.0" dependencies = [ "document-features", ] diff --git a/Cargo.toml b/Cargo.toml index 4888cbd..2850790 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,9 +9,11 @@ keywords = ["OpenHarmony", "HarmonyOS", "ffi"] exclude = ["src/**/*_api11.rs", "src/**/*_api12.rs"] readme = "Readme.md" resolver = "2" +rust-version = "1.78.0" [workspace] -members = ["components/*"] +members = ["components/*", "components/multimedia/image_framework"] +exclude = ["components/multimedia"] [dependencies] document-features = { version = "0.2", optional = true } diff --git a/components/deviceinfo/src/deviceinfo_api12.rs b/components/deviceinfo/src/deviceinfo_api12.rs index cf35272..b626b98 100644 --- a/components/deviceinfo/src/deviceinfo_api12.rs +++ b/components/deviceinfo/src/deviceinfo_api12.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.69.4 */ +/* automatically generated by rust-bindgen 0.70.1 */ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] diff --git a/components/drawing/src/bitmap/bitmap_api12_nopublish.rs b/components/drawing/src/bitmap/bitmap_api12_nopublish.rs index d3ed775..d2fe6d7 100644 --- a/components/drawing/src/bitmap/bitmap_api12_nopublish.rs +++ b/components/drawing/src/bitmap/bitmap_api12_nopublish.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.69.4 */ +/* automatically generated by rust-bindgen 0.70.1 */ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] diff --git a/components/drawing/src/brush/brush_api12_nopublish.rs b/components/drawing/src/brush/brush_api12_nopublish.rs index 60c25cb..234508d 100644 --- a/components/drawing/src/brush/brush_api12_nopublish.rs +++ b/components/drawing/src/brush/brush_api12_nopublish.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.69.4 */ +/* automatically generated by rust-bindgen 0.70.1 */ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] diff --git a/components/drawing/src/canvas/canvas_api12_nopublish.rs b/components/drawing/src/canvas/canvas_api12_nopublish.rs index af41611..ccdb65e 100644 --- a/components/drawing/src/canvas/canvas_api12_nopublish.rs +++ b/components/drawing/src/canvas/canvas_api12_nopublish.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.69.4 */ +/* automatically generated by rust-bindgen 0.70.1 */ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] diff --git a/components/drawing/src/color/color_api12_nopublish.rs b/components/drawing/src/color/color_api12_nopublish.rs index 5a244fb..87e840c 100644 --- a/components/drawing/src/color/color_api12_nopublish.rs +++ b/components/drawing/src/color/color_api12_nopublish.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.69.4 */ +/* automatically generated by rust-bindgen 0.70.1 */ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] diff --git a/components/drawing/src/color_filter/color_filter_api12_nopublish.rs b/components/drawing/src/color_filter/color_filter_api12_nopublish.rs index 0526fa3..529f9d2 100644 --- a/components/drawing/src/color_filter/color_filter_api12_nopublish.rs +++ b/components/drawing/src/color_filter/color_filter_api12_nopublish.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.69.4 */ +/* automatically generated by rust-bindgen 0.70.1 */ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] diff --git a/components/drawing/src/color_space/color_space_api12.rs b/components/drawing/src/color_space/color_space_api12.rs index 57bd935..863b2c9 100644 --- a/components/drawing/src/color_space/color_space_api12.rs +++ b/components/drawing/src/color_space/color_space_api12.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.69.4 */ +/* automatically generated by rust-bindgen 0.70.1 */ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] diff --git a/components/drawing/src/error_code/error_code_api12.rs b/components/drawing/src/error_code/error_code_api12.rs index 9c8a968..6e03d94 100644 --- a/components/drawing/src/error_code/error_code_api12.rs +++ b/components/drawing/src/error_code/error_code_api12.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.69.4 */ +/* automatically generated by rust-bindgen 0.70.1 */ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] diff --git a/components/drawing/src/filter/filter_api12_nopublish.rs b/components/drawing/src/filter/filter_api12_nopublish.rs index ad5a563..242ee8a 100644 --- a/components/drawing/src/filter/filter_api12_nopublish.rs +++ b/components/drawing/src/filter/filter_api12_nopublish.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.69.4 */ +/* automatically generated by rust-bindgen 0.70.1 */ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] diff --git a/components/drawing/src/font/font_api12_nopublish.rs b/components/drawing/src/font/font_api12_nopublish.rs index 18ce46a..6535b19 100644 --- a/components/drawing/src/font/font_api12_nopublish.rs +++ b/components/drawing/src/font/font_api12_nopublish.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.69.4 */ +/* automatically generated by rust-bindgen 0.70.1 */ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] diff --git a/components/drawing/src/font_collection/font_collection_api12_nopublish.rs b/components/drawing/src/font_collection/font_collection_api12_nopublish.rs index 6f1f7f9..5213f8d 100644 --- a/components/drawing/src/font_collection/font_collection_api12_nopublish.rs +++ b/components/drawing/src/font_collection/font_collection_api12_nopublish.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.69.4 */ +/* automatically generated by rust-bindgen 0.70.1 */ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] diff --git a/components/drawing/src/font_mgr/font_mgr_api12.rs b/components/drawing/src/font_mgr/font_mgr_api12.rs index 612a197..35455f4 100644 --- a/components/drawing/src/font_mgr/font_mgr_api12.rs +++ b/components/drawing/src/font_mgr/font_mgr_api12.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.69.4 */ +/* automatically generated by rust-bindgen 0.70.1 */ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] diff --git a/components/drawing/src/gpu_context/gpu_context_api12.rs b/components/drawing/src/gpu_context/gpu_context_api12.rs index d11da53..87b7a36 100644 --- a/components/drawing/src/gpu_context/gpu_context_api12.rs +++ b/components/drawing/src/gpu_context/gpu_context_api12.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.69.4 */ +/* automatically generated by rust-bindgen 0.70.1 */ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] diff --git a/components/drawing/src/image/image_api12.rs b/components/drawing/src/image/image_api12.rs index 7b50d09..bd629d9 100644 --- a/components/drawing/src/image/image_api12.rs +++ b/components/drawing/src/image/image_api12.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.69.4 */ +/* automatically generated by rust-bindgen 0.70.1 */ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] diff --git a/components/drawing/src/image_filter/image_filter_api12.rs b/components/drawing/src/image_filter/image_filter_api12.rs index a80f86a..6b3cea0 100644 --- a/components/drawing/src/image_filter/image_filter_api12.rs +++ b/components/drawing/src/image_filter/image_filter_api12.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.69.4 */ +/* automatically generated by rust-bindgen 0.70.1 */ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] diff --git a/components/drawing/src/mask_filter/mask_filter_api12_nopublish.rs b/components/drawing/src/mask_filter/mask_filter_api12_nopublish.rs index 9cc0e60..b2754c3 100644 --- a/components/drawing/src/mask_filter/mask_filter_api12_nopublish.rs +++ b/components/drawing/src/mask_filter/mask_filter_api12_nopublish.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.69.4 */ +/* automatically generated by rust-bindgen 0.70.1 */ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] diff --git a/components/drawing/src/matrix/matrix_api12_nopublish.rs b/components/drawing/src/matrix/matrix_api12_nopublish.rs index 2e29e4e..cff349b 100644 --- a/components/drawing/src/matrix/matrix_api12_nopublish.rs +++ b/components/drawing/src/matrix/matrix_api12_nopublish.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.69.4 */ +/* automatically generated by rust-bindgen 0.70.1 */ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] diff --git a/components/drawing/src/memory_stream/memory_stream_api12.rs b/components/drawing/src/memory_stream/memory_stream_api12.rs index fe4c6e5..65b65b4 100644 --- a/components/drawing/src/memory_stream/memory_stream_api12.rs +++ b/components/drawing/src/memory_stream/memory_stream_api12.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.69.4 */ +/* automatically generated by rust-bindgen 0.70.1 */ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] diff --git a/components/drawing/src/path/path_api12_nopublish.rs b/components/drawing/src/path/path_api12_nopublish.rs index 70e69a5..6db68a1 100644 --- a/components/drawing/src/path/path_api12_nopublish.rs +++ b/components/drawing/src/path/path_api12_nopublish.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.69.4 */ +/* automatically generated by rust-bindgen 0.70.1 */ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] diff --git a/components/drawing/src/path_effect/path_effect_api12.rs b/components/drawing/src/path_effect/path_effect_api12.rs index caaff93..7dc0244 100644 --- a/components/drawing/src/path_effect/path_effect_api12.rs +++ b/components/drawing/src/path_effect/path_effect_api12.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.69.4 */ +/* automatically generated by rust-bindgen 0.70.1 */ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] diff --git a/components/drawing/src/pen/pen_api12_nopublish.rs b/components/drawing/src/pen/pen_api12_nopublish.rs index 1de6859..767057a 100644 --- a/components/drawing/src/pen/pen_api12_nopublish.rs +++ b/components/drawing/src/pen/pen_api12_nopublish.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.69.4 */ +/* automatically generated by rust-bindgen 0.70.1 */ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] diff --git a/components/drawing/src/pixel_map/pixel_map_api12.rs b/components/drawing/src/pixel_map/pixel_map_api12.rs index a79f144..3661f18 100644 --- a/components/drawing/src/pixel_map/pixel_map_api12.rs +++ b/components/drawing/src/pixel_map/pixel_map_api12.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.69.4 */ +/* automatically generated by rust-bindgen 0.70.1 */ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] diff --git a/components/drawing/src/point/point_api12_nopublish.rs b/components/drawing/src/point/point_api12_nopublish.rs index 5c467f0..99cf034 100644 --- a/components/drawing/src/point/point_api12_nopublish.rs +++ b/components/drawing/src/point/point_api12_nopublish.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.69.4 */ +/* automatically generated by rust-bindgen 0.70.1 */ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] diff --git a/components/drawing/src/rect/rect_api12_nopublish.rs b/components/drawing/src/rect/rect_api12_nopublish.rs index 6b8ab85..2e4dc4a 100644 --- a/components/drawing/src/rect/rect_api12_nopublish.rs +++ b/components/drawing/src/rect/rect_api12_nopublish.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.69.4 */ +/* automatically generated by rust-bindgen 0.70.1 */ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] diff --git a/components/drawing/src/region/region_api12.rs b/components/drawing/src/region/region_api12.rs index a64b000..02e99e7 100644 --- a/components/drawing/src/region/region_api12.rs +++ b/components/drawing/src/region/region_api12.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.69.4 */ +/* automatically generated by rust-bindgen 0.70.1 */ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] diff --git a/components/drawing/src/register_font/register_font_api12_nopublish.rs b/components/drawing/src/register_font/register_font_api12_nopublish.rs index 4dca410..37699a0 100644 --- a/components/drawing/src/register_font/register_font_api12_nopublish.rs +++ b/components/drawing/src/register_font/register_font_api12_nopublish.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.69.4 */ +/* automatically generated by rust-bindgen 0.70.1 */ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] diff --git a/components/drawing/src/round_rect/round_rect_api12_nopublish.rs b/components/drawing/src/round_rect/round_rect_api12_nopublish.rs index 4bffc82..b5dfb48 100644 --- a/components/drawing/src/round_rect/round_rect_api12_nopublish.rs +++ b/components/drawing/src/round_rect/round_rect_api12_nopublish.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.69.4 */ +/* automatically generated by rust-bindgen 0.70.1 */ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] diff --git a/components/drawing/src/sampling_options/sampling_options_api12.rs b/components/drawing/src/sampling_options/sampling_options_api12.rs index 409af6c..1bcbbe8 100644 --- a/components/drawing/src/sampling_options/sampling_options_api12.rs +++ b/components/drawing/src/sampling_options/sampling_options_api12.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.69.4 */ +/* automatically generated by rust-bindgen 0.70.1 */ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] diff --git a/components/drawing/src/shader_effect/shader_effect_api12_nopublish.rs b/components/drawing/src/shader_effect/shader_effect_api12_nopublish.rs index 328c097..00ba3a2 100644 --- a/components/drawing/src/shader_effect/shader_effect_api12_nopublish.rs +++ b/components/drawing/src/shader_effect/shader_effect_api12_nopublish.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.69.4 */ +/* automatically generated by rust-bindgen 0.70.1 */ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] diff --git a/components/drawing/src/shadow_layer/shadow_layer_api12.rs b/components/drawing/src/shadow_layer/shadow_layer_api12.rs index 997e1b7..f8ae87c 100644 --- a/components/drawing/src/shadow_layer/shadow_layer_api12.rs +++ b/components/drawing/src/shadow_layer/shadow_layer_api12.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.69.4 */ +/* automatically generated by rust-bindgen 0.70.1 */ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] diff --git a/components/drawing/src/surface/surface_api12.rs b/components/drawing/src/surface/surface_api12.rs index f7744ff..3f62bf2 100644 --- a/components/drawing/src/surface/surface_api12.rs +++ b/components/drawing/src/surface/surface_api12.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.69.4 */ +/* automatically generated by rust-bindgen 0.70.1 */ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] diff --git a/components/drawing/src/text_blob/text_blob_api12_nopublish.rs b/components/drawing/src/text_blob/text_blob_api12_nopublish.rs index 82da7ed..5e13f9c 100644 --- a/components/drawing/src/text_blob/text_blob_api12_nopublish.rs +++ b/components/drawing/src/text_blob/text_blob_api12_nopublish.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.69.4 */ +/* automatically generated by rust-bindgen 0.70.1 */ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] diff --git a/components/drawing/src/text_declaration/text_declaration_api12_nopublish.rs b/components/drawing/src/text_declaration/text_declaration_api12_nopublish.rs index d38b24b..96a21f5 100644 --- a/components/drawing/src/text_declaration/text_declaration_api12_nopublish.rs +++ b/components/drawing/src/text_declaration/text_declaration_api12_nopublish.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.69.4 */ +/* automatically generated by rust-bindgen 0.70.1 */ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] diff --git a/components/drawing/src/text_typography/text_typography_api12_nopublish.rs b/components/drawing/src/text_typography/text_typography_api12_nopublish.rs index 781cf04..f3dc017 100644 --- a/components/drawing/src/text_typography/text_typography_api12_nopublish.rs +++ b/components/drawing/src/text_typography/text_typography_api12_nopublish.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.69.4 */ +/* automatically generated by rust-bindgen 0.70.1 */ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] diff --git a/components/drawing/src/typeface/typeface_api12_nopublish.rs b/components/drawing/src/typeface/typeface_api12_nopublish.rs index 4a83c0a..0dea31f 100644 --- a/components/drawing/src/typeface/typeface_api12_nopublish.rs +++ b/components/drawing/src/typeface/typeface_api12_nopublish.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.69.4 */ +/* automatically generated by rust-bindgen 0.70.1 */ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] diff --git a/components/drawing/src/types/types_api12_nopublish.rs b/components/drawing/src/types/types_api12_nopublish.rs index b63e08c..2e3e3e4 100644 --- a/components/drawing/src/types/types_api12_nopublish.rs +++ b/components/drawing/src/types/types_api12_nopublish.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.69.4 */ +/* automatically generated by rust-bindgen 0.70.1 */ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] diff --git a/components/inputmethod/src/attach_options/attach_options_api12.rs b/components/inputmethod/src/attach_options/attach_options_api12.rs index d4b098f..ed62451 100644 --- a/components/inputmethod/src/attach_options/attach_options_api12.rs +++ b/components/inputmethod/src/attach_options/attach_options_api12.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.69.4 */ +/* automatically generated by rust-bindgen 0.70.1 */ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] diff --git a/components/inputmethod/src/controller/controller_api12.rs b/components/inputmethod/src/controller/controller_api12.rs index a09a6ad..09f7e1e 100644 --- a/components/inputmethod/src/controller/controller_api12.rs +++ b/components/inputmethod/src/controller/controller_api12.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.69.4 */ +/* automatically generated by rust-bindgen 0.70.1 */ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] diff --git a/components/inputmethod/src/cursor_info/cursor_info_api12.rs b/components/inputmethod/src/cursor_info/cursor_info_api12.rs index c6c30ff..a8320e5 100644 --- a/components/inputmethod/src/cursor_info/cursor_info_api12.rs +++ b/components/inputmethod/src/cursor_info/cursor_info_api12.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.69.4 */ +/* automatically generated by rust-bindgen 0.70.1 */ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] diff --git a/components/inputmethod/src/inputmethod_proxy/inputmethod_proxy_api12.rs b/components/inputmethod/src/inputmethod_proxy/inputmethod_proxy_api12.rs index 3d8cd86..318ee7b 100644 --- a/components/inputmethod/src/inputmethod_proxy/inputmethod_proxy_api12.rs +++ b/components/inputmethod/src/inputmethod_proxy/inputmethod_proxy_api12.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.69.4 */ +/* automatically generated by rust-bindgen 0.70.1 */ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] diff --git a/components/inputmethod/src/private_command/private_command_api12.rs b/components/inputmethod/src/private_command/private_command_api12.rs index b751fde..7d109c4 100644 --- a/components/inputmethod/src/private_command/private_command_api12.rs +++ b/components/inputmethod/src/private_command/private_command_api12.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.69.4 */ +/* automatically generated by rust-bindgen 0.70.1 */ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] diff --git a/components/inputmethod/src/text_avoid_info/text_avoid_info_api12.rs b/components/inputmethod/src/text_avoid_info/text_avoid_info_api12.rs index f079810..d366629 100644 --- a/components/inputmethod/src/text_avoid_info/text_avoid_info_api12.rs +++ b/components/inputmethod/src/text_avoid_info/text_avoid_info_api12.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.69.4 */ +/* automatically generated by rust-bindgen 0.70.1 */ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] diff --git a/components/inputmethod/src/text_config/text_config_api12.rs b/components/inputmethod/src/text_config/text_config_api12.rs index 019b99b..460e3b5 100644 --- a/components/inputmethod/src/text_config/text_config_api12.rs +++ b/components/inputmethod/src/text_config/text_config_api12.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.69.4 */ +/* automatically generated by rust-bindgen 0.70.1 */ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] diff --git a/components/inputmethod/src/text_editor_proxy/text_editor_proxy_api12.rs b/components/inputmethod/src/text_editor_proxy/text_editor_proxy_api12.rs index 315900c..c22e3e6 100644 --- a/components/inputmethod/src/text_editor_proxy/text_editor_proxy_api12.rs +++ b/components/inputmethod/src/text_editor_proxy/text_editor_proxy_api12.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.69.4 */ +/* automatically generated by rust-bindgen 0.70.1 */ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] diff --git a/components/inputmethod/src/types/types_api12.rs b/components/inputmethod/src/types/types_api12.rs index d8dd0ff..b2063b1 100644 --- a/components/inputmethod/src/types/types_api12.rs +++ b/components/inputmethod/src/types/types_api12.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.69.4 */ +/* automatically generated by rust-bindgen 0.70.1 */ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] diff --git a/components/multimedia/image_framework/Cargo.toml b/components/multimedia/image_framework/Cargo.toml new file mode 100644 index 0000000..3beab91 --- /dev/null +++ b/components/multimedia/image_framework/Cargo.toml @@ -0,0 +1,46 @@ +[package] +name = "ohos-image-kit-sys" +version = "0.1.0" +edition = "2021" +description = "Bindings to the multimedia Image Kit API of OpenHarmony" +license = "Apache-2.0" +repository = "https://github.com/openharmony-rs/ohos-sys" +keywords = ["OpenHarmony", "HarmonyOS", "multimedia", "image"] +exclude = ["src/**/*_nopublish.rs"] +readme = "README.md" + +[dependencies] +document-features = { version = "0.2", optional = true } + +[features] +default = [] + +#! ### OpenHarmony API level +#! The `inputmethod` API was added in API-level 12. +#! Defaults to no bindings at all, to maintain feature composability in `ohos-sys`. +#! Optionally enable one of the `api-*` features to get access to bindings for newer +#! OpenHarmony versions. + +## Enables bindings for OpenHarmony API-level 12. +api-12 = [] + +#! ### Image Kit Modules +#! +#! The Image kit is divided into different shared libraries. +#! We provide features, so that you can select which components you want to use. + +## Image Encoding +image-packer = [] +## Obtain image data from the native layer +image-receiver = [] +## Image decoding +image-source = [] +## Pixel Map +pixelmap = [] +## Document available features when building the documentation +document-features = ["dep:document-features"] + +[package.metadata.docs.rs] +features = ["document-features"] +targets = ["aarch64-unknown-linux-ohos", "armv7-unknown-linux-ohos", "x86_64-unknown-linux-ohos"] +all-features = true diff --git a/components/multimedia/image_framework/src/lib.rs b/components/multimedia/image_framework/src/lib.rs new file mode 100644 index 0000000..f1b8c3c --- /dev/null +++ b/components/multimedia/image_framework/src/lib.rs @@ -0,0 +1,24 @@ +//! Image Kit +//! +//! Image development is the process of parsing, processing, and constructing image pixel data to +//! achieve the required image effect. Image development mainly involves image decoding, processing, +//! and encoding. +//! +//! See the official upstream documentation for more information: +//! +//! - [Introduction to Image Kit] +//! - [Image NativeModule] +//! +//! [Introduction to Image Kit]: https://docs.openharmony.cn/pages/v5.0/en/application-dev/media/image/image-overview.md +//! [Image NativeModule]: https://docs.openharmony.cn/pages/v5.0/en/application-dev/media/image/image-structure-c.md +//! +//! ## Feature flags +#![cfg_attr( + feature = "document-features", + cfg_attr(doc, doc = ::document_features::document_features!()) +)] +#![cfg_attr(docsrs, feature(doc_cfg))] + +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +pub mod native_image; diff --git a/components/multimedia/image_framework/src/native_image.rs b/components/multimedia/image_framework/src/native_image.rs new file mode 100644 index 0000000..c4d3cc7 --- /dev/null +++ b/components/multimedia/image_framework/src/native_image.rs @@ -0,0 +1,10 @@ +//! Bindings to [Image_NativeModule] on OpenHarmony +//! +//! [Image_NativeModule]: https://docs.openharmony.cn/pages/v5.0/en/application-dev/media/image/image-structure-c.md + +pub mod common; +pub mod image; +pub mod image_packer; +pub mod image_receiver; +pub mod image_source; +pub mod pixelmap; diff --git a/components/multimedia/image_framework/src/native_image/common.rs b/components/multimedia/image_framework/src/native_image/common.rs new file mode 100644 index 0000000..01b3aa2 --- /dev/null +++ b/components/multimedia/image_framework/src/native_image/common.rs @@ -0,0 +1,7 @@ +//! Common enum and struct declarations used by the image interface +//! +//! + +#[path = "image_common/image_common_api12.rs"] +mod image_common_api12; +pub use image_common_api12::*; diff --git a/components/multimedia/image_framework/src/native_image/image.rs b/components/multimedia/image_framework/src/native_image/image.rs new file mode 100644 index 0000000..abcf0d4 --- /dev/null +++ b/components/multimedia/image_framework/src/native_image/image.rs @@ -0,0 +1,28 @@ +//! Bindings for image_native.h +//! +//! + +#[link(name = "ohimage")] +extern "C" {} + +mod image_api12; +pub use image_api12::*; + +#[cfg(feature = "pixelmap")] +#[cfg_attr(docsrs, doc(cfg(feature = "pixelmap")))] +extern "C" { + + /** @brief Get byte buffer from an {@link OH_ImageNative} object by the component type. + + @param image Indicates the pointer to an {@link OH_ImageNative} object. + @param componentType Indicates the type of component. + @param nativeBuffer Indicates the pointer to the component buffer obtained. + @return Returns {@link Image_ErrorCode} IMAGE_SUCCESS - if the operation is successful. + returns {@link Image_ErrorCode} IMAGE_BAD_PARAMETER - if bad parameter. + @since 12*/ + pub fn OH_ImageNative_GetByteBuffer( + image: *mut OH_ImageNative, + componentType: u32, + nativeBuffer: *mut *mut crate::native_image::pixelmap::OH_NativeBuffer, + ) -> crate::native_image::common::Image_ErrorCode; +} diff --git a/components/multimedia/image_framework/src/native_image/image/image_api12.rs b/components/multimedia/image_framework/src/native_image/image/image_api12.rs new file mode 100644 index 0000000..5ad0720 --- /dev/null +++ b/components/multimedia/image_framework/src/native_image/image/image_api12.rs @@ -0,0 +1,100 @@ +/* automatically generated by rust-bindgen 0.70.1 */ + +#![allow(non_upper_case_globals)] +#![allow(non_camel_case_types)] +#![allow(non_snake_case)] +use crate::native_image::common::*; + +/** @brief Defines an OH_ImageNative object. + +@since 12*/ +#[repr(C)] +pub struct OH_ImageNative { + _unused: [u8; 0], +} +extern "C" { + /** @brief Obtains {@link Image_Size} of an {@link OH_ImageNative} object. + + @param image Indicates the pointer to an {@link OH_ImageNative} object. + @param size Indicates the pointer to the {@link Image_Size} object obtained. + @return Returns {@link Image_ErrorCode} IMAGE_SUCCESS - if the operation is successful. + returns {@link Image_ErrorCode} IMAGE_BAD_PARAMETER - if invalid parameter. + returns {@link Image_ErrorCode} IMAGE_UNKNOWN_ERROR - inner unknown error. + @since 12*/ + pub fn OH_ImageNative_GetImageSize( + image: *mut OH_ImageNative, + size: *mut Image_Size, + ) -> Image_ErrorCode; + /** @brief Get type arry from an {@link OH_ImageNative} object. + + @param image Indicates the pointer to an {@link OH_ImageNative} object. + @param types Indicates the pointer to an {@link OH_ImageNative} component arry obtained. + @param typeSize Indicates the pointer to the {@link OH_ImageNative} component arry size obtained. + @return Returns {@link Image_ErrorCode} IMAGE_SUCCESS - if the operation is successful. + returns {@link Image_ErrorCode} IMAGE_BAD_PARAMETER - if bad parameter. + @since 12*/ + pub fn OH_ImageNative_GetComponentTypes( + image: *mut OH_ImageNative, + types: *mut *mut u32, + typeSize: *mut usize, + ) -> Image_ErrorCode; + /** @brief Get size of buffer from an {@link OH_ImageNative} object by the component type. + + @param image Indicates the pointer to an {@link OH_ImageNative} object. + @param componentType Indicates the type of component. + @param size Indicates the pointer to the size of buffer obtained. + @return Returns {@link Image_ErrorCode} IMAGE_SUCCESS - if the operation is successful. + returns {@link Image_ErrorCode} IMAGE_BAD_PARAMETER - if bad parameter. + @since 12*/ + pub fn OH_ImageNative_GetBufferSize( + image: *mut OH_ImageNative, + componentType: u32, + size: *mut usize, + ) -> Image_ErrorCode; + /** @brief Get row stride from an {@link OH_ImageNative} object by the component type. + + @param image Indicates the pointer to an {@link OH_ImageNative} object. + @param componentType Indicates the type of component. + @param rowStride Indicates the pointer to the row stride obtained. + @return Returns {@link Image_ErrorCode} IMAGE_SUCCESS - if the operation is successful. + returns {@link Image_ErrorCode} IMAGE_BAD_PARAMETER - if bad parameter. + @since 12*/ + pub fn OH_ImageNative_GetRowStride( + image: *mut OH_ImageNative, + componentType: u32, + rowStride: *mut i32, + ) -> Image_ErrorCode; + /** @brief Get pixel stride from an {@link OH_ImageNative} object by the component type. + + @param image Indicates the pointer to an {@link OH_ImageNative} object. + @param componentType Indicates the type of component. + @param pixelStride Indicates the pointer to the pixel stride obtained. + @return Returns {@link Image_ErrorCode} IMAGE_SUCCESS - if the operation is successful. + returns {@link Image_ErrorCode} IMAGE_BAD_PARAMETER - if bad parameter. + @since 12*/ + pub fn OH_ImageNative_GetPixelStride( + image: *mut OH_ImageNative, + componentType: u32, + pixelStride: *mut i32, + ) -> Image_ErrorCode; + /** @brief Get timestamp from an {@link OH_ImageNative} object. + + @param image Indicates the pointer to an {@link OH_ImageNative} object. + @param timestamp Indicates the pointer to the timestamp obtained. + @return Image functions result code. + {@link IMAGE_SUCCESS} if the operation is successful. + {@link IMAGE_BAD_PARAMETER} if the input parameter is invalid. + @since 12*/ + pub fn OH_ImageNative_GetTimestamp( + image: *mut OH_ImageNative, + timestamp: *mut i64, + ) -> Image_ErrorCode; + /** @brief Releases an {@link OH_ImageNative} object. + It is used to release the object {@link OH_ImageNative}. + + @param image Indicates the pointer to an {@link OH_ImageNative} object. + @return Returns {@link Image_ErrorCode} IMAGE_SUCCESS - if the operation is successful. + returns {@link Image_ErrorCode} IMAGE_BAD_PARAMETER - if bad parameter. + @since 12*/ + pub fn OH_ImageNative_Release(image: *mut OH_ImageNative) -> Image_ErrorCode; +} diff --git a/components/multimedia/image_framework/src/native_image/image_common/image_common_api12.rs b/components/multimedia/image_framework/src/native_image/image_common/image_common_api12.rs new file mode 100644 index 0000000..b7e1313 --- /dev/null +++ b/components/multimedia/image_framework/src/native_image/image_common/image_common_api12.rs @@ -0,0 +1,862 @@ +/* automatically generated by rust-bindgen 0.70.1 */ + +#![allow(non_upper_case_globals)] +#![allow(non_camel_case_types)] +#![allow(non_snake_case)] + +/** @brief Defines the image size. + +@since 12*/ +#[repr(C)] +pub struct Image_Size { + /// Image width, in pixels. + pub width: u32, + /// Image height, in pixels. + pub height: u32, +} +/** @brief Defines the region of the image source to decode. + +@since 12*/ +#[repr(C)] +pub struct Image_Region { + /// X coordinate of the start point, in pixels. + pub x: u32, + /// Y coordinate of the start point, in pixels. + pub y: u32, + /// Width of the region, in pixels. + pub width: u32, + /// Height of the region, in pixels. + pub height: u32, +} +/** @brief Defines the region of the image source to decode. + +@since 12*/ +#[repr(C)] +pub struct Image_String { + /// data for string type + pub data: *mut ::core::ffi::c_char, + /// data lenth for string type + pub size: usize, +} +/** @brief Defines the image encode format. + +@since 12*/ +pub type Image_MimeType = Image_String; +impl Image_ErrorCode { + /// operation success + pub const IMAGE_SUCCESS: Image_ErrorCode = Image_ErrorCode(0); +} +impl Image_ErrorCode { + /// invalid parameter + pub const IMAGE_BAD_PARAMETER: Image_ErrorCode = Image_ErrorCode(401); +} +impl Image_ErrorCode { + /// unsupported mime type + pub const IMAGE_UNSUPPORTED_MIME_TYPE: Image_ErrorCode = Image_ErrorCode(7600101); +} +impl Image_ErrorCode { + /// unknown mime type + pub const IMAGE_UNKNOWN_MIME_TYPE: Image_ErrorCode = Image_ErrorCode(7600102); +} +impl Image_ErrorCode { + /// too large data or image + pub const IMAGE_TOO_LARGE: Image_ErrorCode = Image_ErrorCode(7600103); +} +impl Image_ErrorCode { + /// @error DMA memory does not exist + pub const IMAGE_DMA_NOT_EXIST: Image_ErrorCode = Image_ErrorCode(7600173); +} +impl Image_ErrorCode { + /// @error DMA operation failed + pub const IMAGE_DMA_OPERATION_FAILED: Image_ErrorCode = Image_ErrorCode(7600174); +} +impl Image_ErrorCode { + /// unsupported operations + pub const IMAGE_UNSUPPORTED_OPERATION: Image_ErrorCode = Image_ErrorCode(7600201); +} +impl Image_ErrorCode { + /// unsupported metadata + pub const IMAGE_UNSUPPORTED_METADATA: Image_ErrorCode = Image_ErrorCode(7600202); +} +impl Image_ErrorCode { + /// unsupported conversion + pub const IMAGE_UNSUPPORTED_CONVERSION: Image_ErrorCode = Image_ErrorCode(7600203); +} +impl Image_ErrorCode { + /// invalid region + pub const IMAGE_INVALID_REGION: Image_ErrorCode = Image_ErrorCode(7600204); +} +impl Image_ErrorCode { + /// failed to allocate memory + pub const IMAGE_ALLOC_FAILED: Image_ErrorCode = Image_ErrorCode(7600301); +} +impl Image_ErrorCode { + /// memory copy failed + pub const IMAGE_COPY_FAILED: Image_ErrorCode = Image_ErrorCode(7600302); +} +impl Image_ErrorCode { + /// unknown error + pub const IMAGE_UNKNOWN_ERROR: Image_ErrorCode = Image_ErrorCode(7600901); +} +impl Image_ErrorCode { + /// decode data source exception + pub const IMAGE_BAD_SOURCE: Image_ErrorCode = Image_ErrorCode(7700101); +} +impl Image_ErrorCode { + /// decode failed + pub const IMAGE_DECODE_FAILED: Image_ErrorCode = Image_ErrorCode(7700301); +} +impl Image_ErrorCode { + /// encode failed + pub const IMAGE_ENCODE_FAILED: Image_ErrorCode = Image_ErrorCode(7800301); +} +#[repr(transparent)] +/** @brief Enumerates the return values that may be used by the interface. + +@since 12*/ +#[derive(Clone, Hash, PartialEq, Eq)] +pub struct Image_ErrorCode(pub ::core::ffi::c_uint); +/** @brief Defines the bmp mime type. + +@since 12*/ +pub const MIME_TYPE_BMP: &[u8; 10] = b"image/bmp\0"; +/** @brief Defines the jpeg mime type. + +@since 12*/ +pub const MIME_TYPE_JPEG: &[u8; 11] = b"image/jpeg\0"; +/** @brief Defines the heic mime type. + +@since 12*/ +pub const MIME_TYPE_HEIC: &[u8; 11] = b"image/heic\0"; +/** @brief Defines the png mime type. + +@since 12*/ +pub const MIME_TYPE_PNG: &[u8; 10] = b"image/png\0"; +/** @brief Defines the webp mime type. + +@since 12*/ +pub const MIME_TYPE_WEBP: &[u8; 11] = b"image/webp\0"; +/** @brief Defines the gif mime type. + +@since 12*/ +pub const MIME_TYPE_GIF: &[u8; 10] = b"image/gif\0"; +/** @brief Defines the x-icon mime type. + +@since 12*/ +pub const MIME_TYPE_ICON: &[u8; 13] = b"image/x-icon\0"; +/** @brief Defines a pointer to bits per sample, one of the image properties. +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_BITS_PER_SAMPLE: &[u8; 14] = b"BitsPerSample\0"; +/** @brief Defines a pointer to the orientation, one of the image properties. +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_ORIENTATION: &[u8; 12] = b"Orientation\0"; +/** @brief Defines a pointer to the image length, one of the image properties. +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_IMAGE_LENGTH: &[u8; 12] = b"ImageLength\0"; +/** @brief Defines a pointer to the image width, one of the image properties. +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_IMAGE_WIDTH: &[u8; 11] = b"ImageWidth\0"; +/** @brief Defines a pointer to the GPS latitude, one of the image properties. +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_GPS_LATITUDE: &[u8; 12] = b"GPSLatitude\0"; +/** @brief Defines a pointer to the GPS longitude, one of the image properties. +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_GPS_LONGITUDE: &[u8; 13] = b"GPSLongitude\0"; +/** @brief Defines a pointer to the GPS latitude reference information, one of the image properties. +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_GPS_LATITUDE_REF: &[u8; 15] = b"GPSLatitudeRef\0"; +/** @brief Defines a pointer to the GPS longitude reference information, one of the image properties. +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_GPS_LONGITUDE_REF: &[u8; 16] = b"GPSLongitudeRef\0"; +/** @brief Defines a pointer to the created date and time, one of the image properties. +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_DATE_TIME_ORIGINAL: &[u8; 17] = b"DateTimeOriginal\0"; +/** @brief Defines a pointer to the exposure time, one of the image properties. +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_EXPOSURE_TIME: &[u8; 13] = b"ExposureTime\0"; +/** @brief Defines a pointer to the scene type, one of the image properties. +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_SCENE_TYPE: &[u8; 10] = b"SceneType\0"; +/** @brief Defines a pointer to the ISO speed ratings, one of the image properties. +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_ISO_SPEED_RATINGS: &[u8; 16] = b"ISOSpeedRatings\0"; +/** @brief Defines a pointer to the f-number of the image, one of the image properties. +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_F_NUMBER: &[u8; 8] = b"FNumber\0"; +/** @brief Defines a pointer to the compressed bits per pixel, one of the image properties. +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_COMPRESSED_BITS_PER_PIXEL: &[u8; 23] = b"CompressedBitsPerPixel\0"; +/** @brief The scheme used for image compression. +Used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_COMPRESSION: &[u8; 12] = b"Compression\0"; +/** @brief Pixel composition, such as RGB or YCbCr. +Used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_PHOTOMETRIC_INTERPRETATION: &[u8; 26] = + b"PhotometricInterpretation\0"; +/** @brief For each strip, the byte offset of that strip. +Used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_STRIP_OFFSETS: &[u8; 13] = b"StripOffsets\0"; +/** @brief The number of components per pixel. +Used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_SAMPLES_PER_PIXEL: &[u8; 16] = b"SamplesPerPixel\0"; +/** @brief The number of rows per strip of image data. +Used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_ROWS_PER_STRIP: &[u8; 13] = b"RowsPerStrip\0"; +/** @brief The total number of bytes in each strip of image data. +Used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_STRIP_BYTE_COUNTS: &[u8; 16] = b"StripByteCounts\0"; +/** @brief The image resolution in the width direction. +Used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_X_RESOLUTION: &[u8; 12] = b"XResolution\0"; +/** @brief The image resolution in the height direction. +Used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_Y_RESOLUTION: &[u8; 12] = b"YResolution\0"; +/** @brief Indicates whether pixel components are recorded in a chunky or planar format. +Used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_PLANAR_CONFIGURATION: &[u8; 20] = b"PlanarConfiguration\0"; +/** @brief The unit used to measure XResolution and YResolution. +Used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_RESOLUTION_UNIT: &[u8; 15] = b"ResolutionUnit\0"; +/** @brief The transfer function for the image, typically used for color correction. +Used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_TRANSFER_FUNCTION: &[u8; 17] = b"TransferFunction\0"; +/** @brief The name and version of the software used to generate the image. +Used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_SOFTWARE: &[u8; 9] = b"Software\0"; +/** @brief The name of the person who created the image. +Used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_ARTIST: &[u8; 7] = b"Artist\0"; +/** @brief The chromaticity of the white point of the image. +Used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_WHITE_POINT: &[u8; 11] = b"WhitePoint\0"; +/** @brief The chromaticity of the primary colors of the image. +Used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_PRIMARY_CHROMATICITIES: &[u8; 22] = b"PrimaryChromaticities\0"; +/** @brief The matrix coefficients for transformation from RGB to YCbCr image data. +Used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_YCBCR_COEFFICIENTS: &[u8; 18] = b"YCbCrCoefficients\0"; +/** @brief The sampling ratio of chrominance components to the luminance component. +Used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_YCBCR_SUB_SAMPLING: &[u8; 17] = b"YCbCrSubSampling\0"; +/** @brief The position of chrominance components in relation to the luminance component. +Used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_YCBCR_POSITIONING: &[u8; 17] = b"YCbCrPositioning\0"; +/** @brief The reference black point value and reference white point value. +Used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_REFERENCE_BLACK_WHITE: &[u8; 20] = b"ReferenceBlackWhite\0"; +/** @brief Copyright information for the image. +Used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_COPYRIGHT: &[u8; 10] = b"Copyright\0"; +/** @brief The offset to the start byte (SOI) of JPEG compressed thumbnail data. +Used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_JPEG_INTERCHANGE_FORMAT: &[u8; 22] = b"JPEGInterchangeFormat\0"; +/** @brief The number of bytes of JPEG compressed thumbnail data. +Used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_JPEG_INTERCHANGE_FORMAT_LENGTH: &[u8; 28] = + b"JPEGInterchangeFormatLength\0"; +/** @brief The class of the program used by the camera to set exposure when the picture is taken. +Used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_EXPOSURE_PROGRAM: &[u8; 16] = b"ExposureProgram\0"; +/** @brief Indicates the spectral sensitivity of each channel of the camera used. +Used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_SPECTRAL_SENSITIVITY: &[u8; 20] = b"SpectralSensitivity\0"; +/** @brief Indicates the Opto-Electric Conversion Function (OECF) specified in ISO 14524. +Used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_OECF: &[u8; 5] = b"OECF\0"; +/** @brief The version of the Exif standard supported. +Used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_EXIF_VERSION: &[u8; 12] = b"ExifVersion\0"; +/** @brief The date and time when the image was stored as digital data. +Used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_DATE_TIME_DIGITIZED: &[u8; 18] = b"DateTimeDigitized\0"; +/** @brief Information specific to compressed data. +Used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_COMPONENTS_CONFIGURATION: &[u8; 24] = b"ComponentsConfiguration\0"; +/** @brief The shutter speed, expressed as an APEX (Additive System of Photographic Exposure) value. +Used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_SHUTTER_SPEED_VALUE: &[u8; 18] = b"ShutterSpeedValue\0"; +/** @brief The brightness value of the image, in APEX units. +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_BRIGHTNESS_VALUE: &[u8; 16] = b"BrightnessValue\0"; +/** @brief The smallest F number of lens. +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_MAX_APERTURE_VALUE: &[u8; 17] = b"MaxApertureValue\0"; +/** @brief The distance to the subject, measured in meters. +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_SUBJECT_DISTANCE: &[u8; 16] = b"SubjectDistance\0"; +/** @brief This tag indicate the location and area of the main subject in the overall scene. +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_SUBJECT_AREA: &[u8; 12] = b"SubjectArea\0"; +/** @brief A tag for manufacturers of Exif/DCF writers to record any desired infomation. +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_MAKER_NOTE: &[u8; 10] = b"MakerNote\0"; +/** @brief A tag for record fractions of seconds for the DateTime tag. +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_SUBSEC_TIME: &[u8; 11] = b"SubsecTime\0"; +/** @brief A tag used to record fractions of seconds for the DateTimeOriginal tag. +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_SUBSEC_TIME_ORIGINAL: &[u8; 19] = b"SubsecTimeOriginal\0"; +/** @brief A tag used to record fractions of seconds for the DateTimeDigitized tag. +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_SUBSEC_TIME_DIGITIZED: &[u8; 20] = b"SubsecTimeDigitized\0"; +/** @brief This tag denotes the Flashpix format version supported by an FPXR file, enhancing device compatibility. +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_FLASHPIX_VERSION: &[u8; 16] = b"FlashpixVersion\0"; +/** @brief The color space information tag, often recorded as the color space specifier. +Used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_COLOR_SPACE: &[u8; 11] = b"ColorSpace\0"; +/** @brief The name of an audio file related to the image data. +Used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_RELATED_SOUND_FILE: &[u8; 17] = b"RelatedSoundFile\0"; +/** @brief Strobe energy at image capture, in BCPS. +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_FLASH_ENERGY: &[u8; 12] = b"FlashEnergy\0"; +/** @brief Camera or input device spatial frequency table. +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_SPATIAL_FREQUENCY_RESPONSE: &[u8; 25] = b"SpatialFrequencyResponse\0"; +/** @brief Pixels per FocalPlaneResolutionUnit in the image width. +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_FOCAL_PLANE_X_RESOLUTION: &[u8; 22] = b"FocalPlaneXResolution\0"; +/** @brief Pixels per FocalPlaneResolutionUnit in the image height. +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_FOCAL_PLANE_Y_RESOLUTION: &[u8; 22] = b"FocalPlaneYResolution\0"; +/** @brief Unit for measuring FocalPlaneXResolution and FocalPlaneYResolution. +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_FOCAL_PLANE_RESOLUTION_UNIT: &[u8; 25] = + b"FocalPlaneResolutionUnit\0"; +/** @brief Location of the main subject, relative to the left edge. +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_SUBJECT_LOCATION: &[u8; 16] = b"SubjectLocation\0"; +/** @brief Selected exposure index at capture. +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_EXPOSURE_INDEX: &[u8; 14] = b"ExposureIndex\0"; +/** @brief Image sensor type on the camera. +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_SENSING_METHOD: &[u8; 14] = b"SensingMethod\0"; +/** @brief Indicates the image source. +Used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_FILE_SOURCE: &[u8; 11] = b"FileSource\0"; +/** @brief Color filter array (CFA) geometric pattern of the image sensor. +Used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_CFA_PATTERN: &[u8; 11] = b"CFAPattern\0"; +/** @brief Indicates special processing on image data. +Used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_CUSTOM_RENDERED: &[u8; 15] = b"CustomRendered\0"; +/** @brief Exposure mode set when the image was shot. +Used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_EXPOSURE_MODE: &[u8; 13] = b"ExposureMode\0"; +/** @brief Digital zoom ratio at the time of capture. +Used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_DIGITAL_ZOOM_RATIO: &[u8; 17] = b"DigitalZoomRatio\0"; +/** @brief Type of scene captured. +Used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_SCENE_CAPTURE_TYPE: &[u8; 17] = b"SceneCaptureType\0"; +/** @brief Degree of overall image gain adjustment. +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_GAIN_CONTROL: &[u8; 12] = b"GainControl\0"; +/** @brief Direction of contrast processing applied by the camera. +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_CONTRAST: &[u8; 9] = b"Contrast\0"; +/** @brief Direction of saturation processing applied by the camera. +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_SATURATION: &[u8; 11] = b"Saturation\0"; +/** @brief The direction of sharpness processing applied by the camera. +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_SHARPNESS: &[u8; 10] = b"Sharpness\0"; +/** @brief Information on picture-taking conditions for a specific camera model. +Used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_DEVICE_SETTING_DESCRIPTION: &[u8; 25] = b"DeviceSettingDescription\0"; +/** @brief Indicates the distance range to the subject. +Used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_SUBJECT_DISTANCE_RANGE: &[u8; 21] = b"SubjectDistanceRange\0"; +/** @brief An identifier uniquely assigned to each image. +Used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_IMAGE_UNIQUE_ID: &[u8; 14] = b"ImageUniqueID\0"; +/** @brief The version of the GPSInfoIFD. +Used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_GPS_VERSION_ID: &[u8; 13] = b"GPSVersionID\0"; +/** @brief Reference altitude used for GPS altitude. +Used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_GPS_ALTITUDE_REF: &[u8; 15] = b"GPSAltitudeRef\0"; +/** @brief The altitude based on the reference in GPSAltitudeRef. +Used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_GPS_ALTITUDE: &[u8; 12] = b"GPSAltitude\0"; +/** @brief The GPS satellites used for measurements. +Used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_GPS_SATELLITES: &[u8; 14] = b"GPSSatellites\0"; +/** @brief The status of the GPS receiver when the image is recorded. +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_GPS_STATUS: &[u8; 10] = b"GPSStatus\0"; +/** @brief The GPS measurement mode. +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_GPS_MEASURE_MODE: &[u8; 15] = b"GPSMeasureMode\0"; +/** @brief The GPS DOP (data degree of precision). +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_GPS_DOP: &[u8; 7] = b"GPSDOP\0"; +/** @brief The unit used to express the GPS receiver speed of movement. +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_GPS_SPEED_REF: &[u8; 12] = b"GPSSpeedRef\0"; +/** @brief The speed of GPS receiver movement. +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_GPS_SPEED: &[u8; 9] = b"GPSSpeed\0"; +/** @brief The reference for giving the direction of GPS receiver movement. +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_GPS_TRACK_REF: &[u8; 12] = b"GPSTrackRef\0"; +/** @brief The direction of GPS receiver movement. +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_GPS_TRACK: &[u8; 9] = b"GPSTrack\0"; +/** @brief The reference for the image's direction. +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_GPS_IMG_DIRECTION_REF: &[u8; 19] = b"GPSImgDirectionRef\0"; +/** @brief The direction of the image when captured. +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_GPS_IMG_DIRECTION: &[u8; 16] = b"GPSImgDirection\0"; +/** @brief Geodetic survey data used by the GPS receiver. +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_GPS_MAP_DATUM: &[u8; 12] = b"GPSMapDatum\0"; +/** @brief Indicates the latitude reference of the destination point. +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_GPS_DEST_LATITUDE_REF: &[u8; 19] = b"GPSDestLatitudeRef\0"; +/** @brief The latitude of the destination point. +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_GPS_DEST_LATITUDE: &[u8; 16] = b"GPSDestLatitude\0"; +/** @brief Indicates the longitude reference of the destination point. +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_GPS_DEST_LONGITUDE_REF: &[u8; 20] = b"GPSDestLongitudeRef\0"; +/** @brief A character string recording the name of the method used for location finding. +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_GPS_PROCESSING_METHOD: &[u8; 20] = b"GPSProcessingMethod\0"; +/** @brief A character string recording the name of the GPS area. +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_GPS_AREA_INFORMATION: &[u8; 19] = b"GPSAreaInformation\0"; +/** @brief This field denotes if differential correction was applied to GPS data, crucial for precise location accuracy. +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_GPS_DIFFERENTIAL: &[u8; 16] = b"GPSDifferential\0"; +/** @brief The serial number of the camera body. +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_BODY_SERIAL_NUMBER: &[u8; 17] = b"BodySerialNumber\0"; +/** @brief The name of the camera owner. +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_CAMERA_OWNER_NAME: &[u8; 16] = b"CameraOwnerName\0"; +/** @brief The name of the camera owner. +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_COMPOSITE_IMAGE: &[u8; 15] = b"CompositeImage\0"; +/** @brief The DNGVersion tag encodes the four-tier version number for DNG specification compliance. +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_DNG_VERSION: &[u8; 11] = b"DNGVersion\0"; +/** @brief The longitude of the destination point. +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_GPS_DEST_LONGITUDE: &[u8; 17] = b"GPSDestLongitude\0"; +/** @brief The reference for the bearing to the destination point. +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_GPS_DEST_BEARING_REF: &[u8; 18] = b"GPSDestBearingRef\0"; +/** @brief The bearing to the destination point. +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_GPS_DEST_BEARING: &[u8; 15] = b"GPSDestBearing\0"; +/** @brief The measurement unit for the distance to the target point. +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_GPS_DEST_DISTANCE_REF: &[u8; 19] = b"GPSDestDistanceRef\0"; +/** @brief The distance to the destination point. +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_GPS_DEST_DISTANCE: &[u8; 16] = b"GPSDestDistance\0"; +/** @brief DefaultCropSize specifies the final image size in raw coordinates, accounting for extra edge pixels. +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_DEFAULT_CROP_SIZE: &[u8; 16] = b"DefaultCropSize\0"; +/** @brief Indicates the value of coefficient gamma. +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_GAMMA: &[u8; 6] = b"Gamma\0"; +/** @brief The tag indicate the ISO speed latitude yyy value of the camera or input device that is defined in ISO 12232. +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_ISO_SPEED_LATITUDEYYY: &[u8; 20] = b"ISOSpeedLatitudeyyy\0"; +/** @brief The tag indicate the ISO speed latitude zzz value of the camera or input device that is defined in ISO 12232. +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_ISO_SPEED_LATITUDEZZZ: &[u8; 20] = b"ISOSpeedLatitudezzz\0"; +/** @brief The manufacturer of the lens. +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_LENS_MAKE: &[u8; 9] = b"LensMake\0"; +/** @brief The model name of the lens. +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_LENS_MODEL: &[u8; 10] = b"LensModel\0"; +/** @brief The serial number of the lens. +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_LENS_SERIAL_NUMBER: &[u8; 17] = b"LensSerialNumber\0"; +/** @brief Specifications of the lens used. +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_LENS_SPECIFICATION: &[u8; 18] = b"LensSpecification\0"; +/** @brief This tag provides a broad description of the data type in this subfile. +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_NEW_SUBFILE_TYPE: &[u8; 15] = b"NewSubfileType\0"; +/** @brief This tag records the UTC offset for the DateTime tag, ensuring accurate timestamps regardless of location. +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_OFFSET_TIME: &[u8; 11] = b"OffsetTime\0"; +/** @brief This tag logs the UTC offset when the image was digitized, aiding in accurate timestamp adjustment. +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_OFFSET_TIME_DIGITIZED: &[u8; 20] = b"OffsetTimeDigitized\0"; +/** @brief This tag records the UTC offset when the original image was created, crucial for time-sensitive applications. +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_OFFSET_TIME_ORIGINAL: &[u8; 19] = b"OffsetTimeOriginal\0"; +/** @brief Exposure times of source images for a composite image. +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_SOURCE_EXPOSURE_TIMES_OF_COMPOSITE_IMAGE: &[u8; 36] = + b"SourceExposureTimesOfCompositeImage\0"; +/** @brief The number of source images used for a composite image. +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_SOURCE_IMAGE_NUMBER_OF_COMPOSITE_IMAGE: &[u8; 34] = + b"SourceImageNumberOfCompositeImage\0"; +/** @brief This deprecated field signifies the type of data in this subfile. Use the NewSubfileType field instead. +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_SUBFILE_TYPE: &[u8; 12] = b"SubfileType\0"; +/** @brief This tag indicates horizontal positioning errors in meters. +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_GPS_H_POSITIONING_ERROR: &[u8; 21] = b"GPSHPositioningError\0"; +/** @brief This tag indicates the sensitivity of the camera or input device when the image was shot. +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_PHOTOGRAPHIC_SENSITIVITY: &[u8; 24] = b"PhotographicSensitivity\0"; +/** @brief Burst Number +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_BURST_NUMBER: &[u8; 19] = b"HwMnoteBurstNumber\0"; +/** @brief Face Conf +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_FACE_CONF: &[u8; 16] = b"HwMnoteFaceConf\0"; +/** @brief Face Leye Center +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_FACE_LEYE_CENTER: &[u8; 22] = b"HwMnoteFaceLeyeCenter\0"; +/** @brief Face Mouth Center +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_FACE_MOUTH_CENTER: &[u8; 23] = b"HwMnoteFaceMouthCenter\0"; +/** @brief Face Pointer +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_FACE_POINTER: &[u8; 19] = b"HwMnoteFacePointer\0"; +/** @brief Face Rect +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_FACE_RECT: &[u8; 16] = b"HwMnoteFaceRect\0"; +/** @brief Face Reye Center +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_FACE_REYE_CENTER: &[u8; 22] = b"HwMnoteFaceReyeCenter\0"; +/** @brief Face Smile Score +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_FACE_SMILE_SCORE: &[u8; 22] = b"HwMnoteFaceSmileScore\0"; +/** @brief Face Version +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_FACE_VERSION: &[u8; 19] = b"HwMnoteFaceVersion\0"; +/** @brief Front Camera +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_FRONT_CAMERA: &[u8; 19] = b"HwMnoteFrontCamera\0"; +/** @brief Scene Pointer +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_SCENE_POINTER: &[u8; 20] = b"HwMnoteScenePointer\0"; +/** @brief Scene Version +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_SCENE_VERSION: &[u8; 20] = b"HwMnoteSceneVersion\0"; +/** @brief Is Xmage Supported +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_IS_XMAGE_SUPPORTED: &[u8; 24] = b"HwMnoteIsXmageSupported\0"; +/** @brief Xmage Mode +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_XMAGE_MODE: &[u8; 17] = b"HwMnoteXmageMode\0"; +/** @brief Xmage X1 Coordinate +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_XMAGE_LEFT: &[u8; 17] = b"HwMnoteXmageLeft\0"; +/** @brief Xmage Y1 Coordinate +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_XMAGE_TOP: &[u8; 16] = b"HwMnoteXmageTop\0"; +/** @brief Xmage X2 Coordinate +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_XMAGE_RIGHT: &[u8; 18] = b"HwMnoteXmageRight\0"; +/** @brief Xmage Y2 Coordinate +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_XMAGE_BOTTOM: &[u8; 19] = b"HwMnoteXmageBottom\0"; +/** @brief Cloud Enhancement Mode +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_CLOUD_ENHANCEMENT_MODE: &[u8; 28] = b"HwMnoteCloudEnhancementMode\0"; +/** @brief Wind Snapshot Mode +It is used in {@link OH_ImageSource_GetImageProperty} and {@link OH_ImageSource_ModifyImageProperty}. + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_WIND_SNAPSHOT_MODE: &[u8; 24] = b"HwMnoteWindSnapshotMode\0"; +/** @brief Gif Loop Count +It is used in {@link OH_ImageSource_GetImageProperty}. +If infinite loop returns 0, other values represent the number of loops + +@since 12*/ +pub const OHOS_IMAGE_PROPERTY_GIF_LOOP_COUNT: &[u8; 13] = b"GIFLoopCount\0"; diff --git a/components/multimedia/image_framework/src/native_image/image_packer.rs b/components/multimedia/image_framework/src/native_image/image_packer.rs new file mode 100644 index 0000000..4d0bf89 --- /dev/null +++ b/components/multimedia/image_framework/src/native_image/image_packer.rs @@ -0,0 +1,81 @@ +//! Declares APIs for image encoding +//! +//! + +#[link(name = "image_packer")] +extern "C" {} + +mod image_packer_api12; +pub use image_packer_api12::*; + +#[cfg(feature = "image-source")] +#[cfg_attr(docsrs, doc(cfg(feature = "image-source")))] +extern "C" { + /** @brief Encoding an ImageSource into the data with required format. + + @param imagePacker The imagePacker to use for packing. + @param options Indicates the encoding {@link OH_PackingOptions}. + @param imageSource The imageSource to be packed. + @param outData The output data buffer to store the packed image. + @param size A pointer to the size of the output data buffer. + @return Returns {@link Image_ErrorCode} + @since 12*/ + pub fn OH_ImagePackerNative_PackToDataFromImageSource( + imagePacker: *mut OH_ImagePackerNative, + options: *mut OH_PackingOptions, + imageSource: *mut crate::native_image::image_source::OH_ImageSourceNative, + outData: *mut u8, + size: *mut usize, + ) -> crate::native_image::common::Image_ErrorCode; + + /** @brief Encoding an ImageSource into the a file with fd with required format. + + @param imagePacker The image packer to use for packing. + @param options Indicates the encoding {@link OH_PackingOptions}. + @param imageSource The imageSource to be packed. + @param fd Indicates a writable file descriptor. + @return Returns {@link Image_ErrorCode} + @since 12*/ + pub fn OH_ImagePackerNative_PackToFileFromImageSource( + imagePacker: *mut OH_ImagePackerNative, + options: *mut OH_PackingOptions, + imageSource: *mut crate::native_image::image_source::OH_ImageSourceNative, + fd: i32, + ) -> crate::native_image::common::Image_ErrorCode; + +} + +#[cfg(feature = "pixelmap")] +#[cfg_attr(docsrs, doc(cfg(feature = "pixelmap")))] +extern "C" { + /** @brief Encoding a Pixelmap into the data with required format. + + @param imagePacker The imagePacker to use for packing. + @param options Indicates the encoding {@link OH_PackingOptions}. + @param pixelmap The pixelmap to be packed. + @param outData The output data buffer to store the packed image. + @param size A pointer to the size of the output data buffer. + @return Returns {@link Image_ErrorCode} + @since 12*/ + pub fn OH_ImagePackerNative_PackToDataFromPixelmap( + imagePacker: *mut OH_ImagePackerNative, + options: *mut OH_PackingOptions, + pixelmap: *mut crate::native_image::pixelmap::OH_PixelmapNative, + outData: *mut u8, + size: *mut usize, + ) -> crate::native_image::common::Image_ErrorCode; + /** @brief Encoding a Pixelmap into the a file with fd with required format + + @param imagePacker The image packer to use for packing. + @param options Indicates the encoding {@link OH_PackingOptions}. + @param pixelmap The pixelmap to be packed. + @param fd Indicates a writable file descriptor. + @return Returns {@link Image_ErrorCode} + @since 12*/ + pub fn OH_ImagePackerNative_PackToFileFromPixelmap( + imagePacker: *mut OH_ImagePackerNative, + options: *mut OH_PackingOptions, + pixelmap: *mut crate::native_image::pixelmap::OH_PixelmapNative, + fd: i32, + ) -> crate::native_image::common::Image_ErrorCode; +} diff --git a/components/multimedia/image_framework/src/native_image/image_packer/image_packer_api12.rs b/components/multimedia/image_framework/src/native_image/image_packer/image_packer_api12.rs new file mode 100644 index 0000000..ba52f24 --- /dev/null +++ b/components/multimedia/image_framework/src/native_image/image_packer/image_packer_api12.rs @@ -0,0 +1,146 @@ +/* automatically generated by rust-bindgen 0.70.1 */ + +#![allow(non_upper_case_globals)] +#![allow(non_camel_case_types)] +#![allow(non_snake_case)] +use crate::native_image::common::*; + +/** @brief Define a ImagePacker struct type, used for ImagePacker pointer controls. + +@since 12*/ +#[repr(C)] +pub struct OH_ImagePackerNative { + _unused: [u8; 0], +} +/** @brief Defines the image packing options. + +@since 12*/ +#[repr(C)] +pub struct OH_PackingOptions { + _unused: [u8; 0], +} +impl IMAGE_PACKER_DYNAMIC_RANGE { + pub const IMAGE_PACKER_DYNAMIC_RANGE_AUTO: IMAGE_PACKER_DYNAMIC_RANGE = + IMAGE_PACKER_DYNAMIC_RANGE(0); +} +impl IMAGE_PACKER_DYNAMIC_RANGE { + pub const IMAGE_PACKER_DYNAMIC_RANGE_SDR: IMAGE_PACKER_DYNAMIC_RANGE = + IMAGE_PACKER_DYNAMIC_RANGE(1); +} +#[repr(transparent)] +/** @brief Enumerates packing dynamic range. + +@since 12*/ +#[derive(Clone, Hash, PartialEq, Eq)] +pub struct IMAGE_PACKER_DYNAMIC_RANGE(pub ::core::ffi::c_uint); +extern "C" { + /** @brief Create a pointer for PackingOptions struct. + + @param options The PackingOptions pointer will be operated. + @return Returns {@link Image_ErrorCode} + @since 12*/ + pub fn OH_PackingOptions_Create(options: *mut *mut OH_PackingOptions) -> Image_ErrorCode; + /** @brief Get mime type for OH_PackingOptions struct. + + @param options The OH_PackingOptions pointer will be operated. + @param format the number of image format.The user can pass in a null pointer and zero size, we will allocate memory, + but user must free memory after use. + @return Returns {@link Image_ErrorCode} + @since 12*/ + pub fn OH_PackingOptions_GetMimeType( + options: *mut OH_PackingOptions, + format: *mut Image_MimeType, + ) -> Image_ErrorCode; + /** @brief Set format number for OH_PackingOptions struct. + + @param options The OH_PackingOptions pointer will be operated. + @param format the number of image format. + @return Returns {@link Image_ErrorCode} + @since 12*/ + pub fn OH_PackingOptions_SetMimeType( + options: *mut OH_PackingOptions, + format: *mut Image_MimeType, + ) -> Image_ErrorCode; + /** @brief Get quality for OH_PackingOptions struct. + + @param options The OH_PackingOptions pointer will be operated. + @param quality The number of image quality. + @return Returns {@link Image_ErrorCode} + @since 12*/ + pub fn OH_PackingOptions_GetQuality( + options: *mut OH_PackingOptions, + quality: *mut u32, + ) -> Image_ErrorCode; + /** @brief Set quality number for OH_PackingOptions struct. + + @param options The OH_PackingOptions pointer will be operated. + @param quality The number of image quality. + @return Returns {@link Image_ErrorCode} + @since 12*/ + pub fn OH_PackingOptions_SetQuality( + options: *mut OH_PackingOptions, + quality: u32, + ) -> Image_ErrorCode; + /** @brief Get needsPackProperties for OH_PackingOptions struct. + + @param options The OH_PackingOptions pointer will be operated. + @param needsPackProperties Whether the image properties can be saved, like Exif. + @return Returns {@link Image_ErrorCode} + @since 12*/ + pub fn OH_PackingOptions_GetNeedsPackProperties( + options: *mut OH_PackingOptions, + needsPackProperties: *mut bool, + ) -> Image_ErrorCode; + /** @brief Set needsPackProperties for OH_PackingOptions struct. + + @param options The OH_PackingOptions pointer will be operated. + @param needsPackProperties Whether the image properties can be saved, like Exif. + @return Returns {@link Image_ErrorCode} + @since 12*/ + pub fn OH_PackingOptions_SetNeedsPackProperties( + options: *mut OH_PackingOptions, + needsPackProperties: bool, + ) -> Image_ErrorCode; + /** @brief Get desiredDynamicRange for PackingOptions struct. + + @param options The PackingOptions pointer will be operated. Pointer connot be null. + @param desiredDynamicRange The number of dynamic range {@link IMAGE_PACKER_DYNAMIC_RANGE}. Pointer connot be null. + @return Returns {@link Image_ErrorCode} IMAGE_SUCCESS - The operation is successful. + returns {@link Image_ErrorCode} IMAGE_BAD_PARAMETER - Parameter error.Possible causes:Parameter verification failed. + @since 12*/ + pub fn OH_PackingOptions_GetDesiredDynamicRange( + options: *mut OH_PackingOptions, + desiredDynamicRange: *mut i32, + ) -> Image_ErrorCode; + /** @brief Set desiredDynamicRange number for PackingOptions struct. + + @param options The PackingOptions pointer will be operated. Pointer connot be null. + @param desiredDynamicRange The number of dynamic range {@link IMAGE_PACKER_DYNAMIC_RANGE}. + @return Returns {@link Image_ErrorCode} IMAGE_SUCCESS - The operation is successful. + returns {@link Image_ErrorCode} IMAGE_BAD_PARAMETER - Parameter error.Possible causes:Parameter verification failed. + @since 12*/ + pub fn OH_PackingOptions_SetDesiredDynamicRange( + options: *mut OH_PackingOptions, + desiredDynamicRange: i32, + ) -> Image_ErrorCode; + /** @brief delete OH_PackingOptions pointer. + + @param options The OH_PackingOptions pointer will be operated. + @return Returns {@link Image_ErrorCode} + @since 12*/ + pub fn OH_PackingOptions_Release(options: *mut OH_PackingOptions) -> Image_ErrorCode; + /** @brief Create a pointer for OH_ImagePackerNative struct. + + @param options The OH_ImagePackerNative pointer will be operated. + @return Returns {@link Image_ErrorCode} + @since 12*/ + pub fn OH_ImagePackerNative_Create( + imagePacker: *mut *mut OH_ImagePackerNative, + ) -> Image_ErrorCode; + /** @brief Releases an imagePacker object. + + @param imagePacker A pointer to the image packer object to be released. + @return Returns {@link Image_ErrorCode} + @since 12*/ + pub fn OH_ImagePackerNative_Release(imagePacker: *mut OH_ImagePackerNative) -> Image_ErrorCode; +} diff --git a/components/multimedia/image_framework/src/native_image/image_receiver.rs b/components/multimedia/image_framework/src/native_image/image_receiver.rs new file mode 100644 index 0000000..fcbaa79 --- /dev/null +++ b/components/multimedia/image_framework/src/native_image/image_receiver.rs @@ -0,0 +1,9 @@ +//! Declares APIs used to obtain image data from the native layer +//! +//! + +#[link(name = "image_receiver")] +extern "C" {} + +mod image_receiver_api12; +pub use image_receiver_api12::*; diff --git a/components/multimedia/image_framework/src/native_image/image_receiver/image_receiver_api12.rs b/components/multimedia/image_framework/src/native_image/image_receiver/image_receiver_api12.rs new file mode 100644 index 0000000..17c72ba --- /dev/null +++ b/components/multimedia/image_framework/src/native_image/image_receiver/image_receiver_api12.rs @@ -0,0 +1,206 @@ +/* automatically generated by rust-bindgen 0.70.1 */ + +#![allow(non_upper_case_globals)] +#![allow(non_camel_case_types)] +#![allow(non_snake_case)] +use crate::native_image::common::*; +use crate::native_image::image::OH_ImageNative; + +/** @brief Defines an OH_ImageReceiverNative object. + +@since 12*/ +#[repr(C)] +pub struct OH_ImageReceiverNative { + _unused: [u8; 0], +} +/** @brief Defines an image receiver options object. + +@since 12*/ +#[repr(C)] +pub struct OH_ImageReceiverOptions { + _unused: [u8; 0], +} +/** @brief Defines the callbacks for images. + +@since 12*/ +pub type OH_ImageReceiver_OnCallback = + ::core::option::Option; +extern "C" { + /** @brief Creates an OH_ImageReceiverOptions object at the application layer. + + @param options Indicates the pointer to the OH_ImageReceiverOptions object obtained. + @return Returns {@link Image_ErrorCode} IMAGE_SUCCESS - if the operation is successful. + returns {@link Image_ErrorCode} IMAGE_BAD_PARAMETER - if bad parameter. + returns {@link Image_ErrorCode} IMAGE_ALLOC_FAILED - if alloc failed. + @since 12*/ + pub fn OH_ImageReceiverOptions_Create( + options: *mut *mut OH_ImageReceiverOptions, + ) -> Image_ErrorCode; + /** @brief Get size of an {@link OH_ImageReceiverOptions} object. + + @param options Indicates the pointer to an {@link OH_ImageReceiverOptions} object. + @param size Indicates the value of the {@Link Image_Size} object will be obtained. + @return Returns {@link Image_ErrorCode} IMAGE_SUCCESS - if the operation is successful. + returns {@link Image_ErrorCode} IMAGE_BAD_PARAMETER - if bad parameter. + @since 12*/ + pub fn OH_ImageReceiverOptions_GetSize( + options: *mut OH_ImageReceiverOptions, + size: *mut Image_Size, + ) -> Image_ErrorCode; + /** @brief Set size of an {@link OH_ImageReceiverOptions} object. + + @param options Indicates the pointer to an {@link OH_ImageReceiverOptions} object. + @param size Indicates the value of the {@link Image_Size} object will be seted. + @return Returns {@link Image_ErrorCode} IMAGE_SUCCESS - if the operation is successful. + returns {@link Image_ErrorCode} IMAGE_BAD_PARAMETER - if bad parameter. + @since 12*/ + pub fn OH_ImageReceiverOptions_SetSize( + options: *mut OH_ImageReceiverOptions, + size: Image_Size, + ) -> Image_ErrorCode; + /** @brief Get capacity from an {@link OH_ImageReceiverOptions} object. + + @param options Indicates the pointer to an {@link OH_ImageReceiverOptions} object. + @param capacity Indicates the pointer to capacity will be obtained. + @return Returns {@link Image_ErrorCode} IMAGE_SUCCESS - if the operation is successful. + returns {@link Image_ErrorCode} IMAGE_BAD_PARAMETER - if bad parameter. + @since 12*/ + pub fn OH_ImageReceiverOptions_GetCapacity( + options: *mut OH_ImageReceiverOptions, + capacity: *mut i32, + ) -> Image_ErrorCode; + /** @brief Set capacity of an {@link OH_ImageReceiverOptions} object. + + @param options Indicates the pointer to an {@link OH_ImageReceiverOptions} object. + @param capacity Indicates the value of capacity will be seted. + @return Returns {@link Image_ErrorCode} IMAGE_SUCCESS - if the operation is successful. + returns {@link Image_ErrorCode} IMAGE_BAD_PARAMETER - if bad parameter. + @since 12*/ + pub fn OH_ImageReceiverOptions_SetCapacity( + options: *mut OH_ImageReceiverOptions, + capacity: i32, + ) -> Image_ErrorCode; + /** @brief Releases an {@link OH_ImageReceiverOptions} object. + It is used to release the object {@link OH_ImageReceiverOptions}. + + @param options Indicates the pointer to an {@link OH_ImageReceiverOptions} object. + @return Returns {@link Image_ErrorCode} IMAGE_SUCCESS - if the operation is successful. + returns {@link Image_ErrorCode} IMAGE_BAD_PARAMETER - if bad parameter. + @see OH_ImageReceiverOptions + @since 12*/ + pub fn OH_ImageReceiverOptions_Release( + options: *mut OH_ImageReceiverOptions, + ) -> Image_ErrorCode; + /** @brief Creates an OH_ImageReceiverNative object at the application layer. + + @param options Indicates the options for setting the OH_ImageReceiverNative object. + @param receiver Indicates the pointer to the OH_ImageReceiverNative object obtained. + @return Returns {@link Image_ErrorCode} IMAGE_SUCCESS - if the operation is successful. + returns {@link Image_ErrorCode} IMAGE_BAD_PARAMETER - if bad parameter. + returns {@link Image_ErrorCode} IMAGE_ALLOC_FAILED - if alloc failed. + @since 12*/ + pub fn OH_ImageReceiverNative_Create( + options: *mut OH_ImageReceiverOptions, + receiver: *mut *mut OH_ImageReceiverNative, + ) -> Image_ErrorCode; + /** @brief Obtains the receiver ID through an {@link OH_ImageReceiverNative} object. + + @param receiver Indicates the pointer to an {@link OH_ImageReceiverNative} object. + @param surfaceId Indicates the pointer to the surfaceID will be obtained. + @return Returns {@link Image_ErrorCode} IMAGE_SUCCESS - if the operation is successful. + returns {@link Image_ErrorCode} IMAGE_BAD_PARAMETER - if bad parameter. + returns {@link Image_ErrorCode} IMAGE_UNKNOWN_ERROR - inner unknown error. + @see OH_ImageReceiverNative + @since 12*/ + pub fn OH_ImageReceiverNative_GetReceivingSurfaceId( + receiver: *mut OH_ImageReceiverNative, + surfaceId: *mut u64, + ) -> Image_ErrorCode; + /** @brief Obtains the latest image through an {@link OH_ImageReceiverNative} object. + + @param receiver Indicates the pointer to an {@link OH_ImageReceiverNative} object. + @param image Indicates the pointer to an OH_ImageNative object at the application layer. + @return Returns {@link Image_ErrorCode} IMAGE_SUCCESS - if the operation is successful. + returns {@link Image_ErrorCode} IMAGE_BAD_PARAMETER - if bad parameter. + returns {@link Image_ErrorCode} IMAGE_UNKNOWN_ERROR - inner unknown error. + returns {@link Image_ErrorCode} IMAGE_ALLOC_FAILED - if alloc failed. + @see OH_ImageReceiverNative, OH_ImageNative + @since 12*/ + pub fn OH_ImageReceiverNative_ReadLatestImage( + receiver: *mut OH_ImageReceiverNative, + image: *mut *mut OH_ImageNative, + ) -> Image_ErrorCode; + /** @brief Obtains the next image through an {@link OH_ImageReceiverNative} object. + + @param receiver Indicates the pointer to an {@link OH_ImageReceiverNative} object. + @param image Indicates the pointer to an OH_ImageNative object at the application layer. + @return Returns {@link Image_ErrorCode} IMAGE_SUCCESS - if the operation is successful. + returns {@link Image_ErrorCode} IMAGE_BAD_PARAMETER - if bad parameter. + returns {@link Image_ErrorCode} IMAGE_UNKNOWN_ERROR - inner unknown error. + returns {@link Image_ErrorCode} IMAGE_ALLOC_FAILED - if alloc failed. + @see OH_ImageReceiverNative, OH_ImageNative + @since 12*/ + pub fn OH_ImageReceiverNative_ReadNextImage( + receiver: *mut OH_ImageReceiverNative, + image: *mut *mut OH_ImageNative, + ) -> Image_ErrorCode; + /** @brief Registers an {@link OH_ImageReceiver_OnCallback} callback event. + + This callback event is triggered whenever a new image is received. + + @param receiver Indicates the pointer to an {@link OH_ImageReceiverNative} object. + @param callback Indicates the {@link OH_ImageReceiver_OnCallback} callback event to register. + @return Returns {@link Image_ErrorCode} IMAGE_SUCCESS - if the operation is successful. + returns {@link Image_ErrorCode} IMAGE_BAD_PARAMETER - if bad parameter. + @see OH_ImageReceiverNative, OH_ImageReceiver_OnCallback + @since 12*/ + pub fn OH_ImageReceiverNative_On( + receiver: *mut OH_ImageReceiverNative, + callback: OH_ImageReceiver_OnCallback, + ) -> Image_ErrorCode; + /** @brief Unregisters the {@link OH_ImageReceiver_OnCallback} callback event. + + Turn off the callback witch triggered by {@link OH_ImageReceiverNative_On}. + + @param receiver Indicates the pointer to an {@link OH_ImageReceiverNative} object. + @return Returns {@link Image_ErrorCode} IMAGE_SUCCESS - if the operation is successful. + returns {@link Image_ErrorCode} IMAGE_BAD_PARAMETER - if bad parameter. + @see OH_ImageReceiverNative, OH_ImageReceiverNative_On + @since 12*/ + pub fn OH_ImageReceiverNative_Off(receiver: *mut OH_ImageReceiverNative) -> Image_ErrorCode; + /** @brief Obtains the size of the image receiver through an {@link OH_ImageReceiverNative} object. + + @param receiver Indicates the pointer to an {@link OH_ImageReceiverNative} object. + @param size Indicates the pointer to the {@link Image_Size} object will be obtained. + @return Returns {@link Image_ErrorCode} IMAGE_SUCCESS - if the operation is successful. + returns {@link Image_ErrorCode} IMAGE_BAD_PARAMETER - if bad parameter. + @see OH_ImageReceiverNative, Image_Size + @since 12*/ + pub fn OH_ImageReceiverNative_GetSize( + receiver: *mut OH_ImageReceiverNative, + size: *mut Image_Size, + ) -> Image_ErrorCode; + /** @brief Obtains the capacity of the image receiver through an {@link OH_ImageReceiverNative} object. + + @param receiver Indicates the pointer to an {@link OH_ImageReceiverNative} object. + @param capacity Indicates the pointer to the capacity will be obtained. + @return Returns {@link Image_ErrorCode} IMAGE_SUCCESS - if the operation is successful. + returns {@link Image_ErrorCode} IMAGE_BAD_PARAMETER - if bad parameter. + @see OH_ImageReceiverNative + @since 12*/ + pub fn OH_ImageReceiverNative_GetCapacity( + receiver: *mut OH_ImageReceiverNative, + capacity: *mut i32, + ) -> Image_ErrorCode; + /** @brief Releases an {@link OH_ImageReceiverNative} object. + + This API is not used to release an ImageReceiver2 object at the application layer. + + @param receiver Indicates the pointer to an {@link OH_ImageReceiverNative} object. + @return Returns {@link Image_ErrorCode} IMAGE_SUCCESS - if the operation is successful. + returns {@link Image_ErrorCode} IMAGE_BAD_PARAMETER - if bad parameter. + @see OH_ImageReceiverNative + @since 12*/ + pub fn OH_ImageReceiverNative_Release(receiver: *mut OH_ImageReceiverNative) + -> Image_ErrorCode; +} diff --git a/components/multimedia/image_framework/src/native_image/image_source.rs b/components/multimedia/image_framework/src/native_image/image_source.rs new file mode 100644 index 0000000..74e32fc --- /dev/null +++ b/components/multimedia/image_framework/src/native_image/image_source.rs @@ -0,0 +1,46 @@ +//! Declares APIs for image decoding +//! +//! + +#[link(name = "image_source")] +extern "C" {} + +mod image_source_api12; +pub use image_source_api12::*; + +#[cfg(feature = "pixelmap")] +#[cfg_attr(docsrs, doc(cfg(feature = "pixelmap")))] +extern "C" { + /** @brief Decodes an void pointer + based on the specified {@link OH_DecodingOptions} struct. + + @param source Indicates a void pointer(from ImageSource pointer convert). + @param options Indicates a pointer to the options for decoding the image source. + For details, see {@link OH_DecodingOptions}. + @param resPixMap Indicates a void pointer to the Pixelmap object obtained at the C++ native layer. + @return Returns {@link Image_ErrorCode} + @since 12*/ + pub fn OH_ImageSourceNative_CreatePixelmap( + source: *mut OH_ImageSourceNative, + options: *mut OH_DecodingOptions, + pixelmap: *mut *mut crate::native_image::pixelmap::OH_PixelmapNative, + ) -> crate::native_image::common::Image_ErrorCode; + /** @brief Decodes an void pointer + the Pixelmap objects at the C++ native layer + based on the specified {@link OH_DecodingOptions} struct. + + @param source Indicates a void pointer(from ImageSource pointer convert). + @param options Indicates a pointer to the options for decoding the image source. + For details, see {@link OH_DecodingOptions}. + @param resVecPixMap Indicates a pointer array to the Pixelmap objects obtained at the C++ native layer. + It cannot be a null pointer. + @param size Indicates a size of resVecPixMap. User can get size from {@link OH_ImageSourceNative_GetFrameCount}. + @return Returns {@link Image_ErrorCode} + @since 12*/ + pub fn OH_ImageSourceNative_CreatePixelmapList( + source: *mut OH_ImageSourceNative, + options: *mut OH_DecodingOptions, + resVecPixMap: *mut *mut crate::native_image::common::Image_ErrorCode, + size: usize, + ) -> crate::native_image::common::Image_ErrorCode; +} diff --git a/components/multimedia/image_framework/src/native_image/image_source/image_source_api12.rs b/components/multimedia/image_framework/src/native_image/image_source/image_source_api12.rs new file mode 100644 index 0000000..9766190 --- /dev/null +++ b/components/multimedia/image_framework/src/native_image/image_source/image_source_api12.rs @@ -0,0 +1,325 @@ +/* automatically generated by rust-bindgen 0.70.1 */ + +#![allow(non_upper_case_globals)] +#![allow(non_camel_case_types)] +#![allow(non_snake_case)] +use crate::native_image::common::*; + +/** @brief Defines an image source object for the image interface. + +@since 12*/ +#[repr(C)] +pub struct OH_ImageSourceNative { + _unused: [u8; 0], +} +/** @brief Defines image source infomation +{@link OH_ImageSourceInfo_Create}. + +@since 12*/ +#[repr(C)] +pub struct OH_ImageSource_Info { + _unused: [u8; 0], +} +impl IMAGE_DYNAMIC_RANGE { + pub const IMAGE_DYNAMIC_RANGE_AUTO: IMAGE_DYNAMIC_RANGE = IMAGE_DYNAMIC_RANGE(0); +} +impl IMAGE_DYNAMIC_RANGE { + pub const IMAGE_DYNAMIC_RANGE_SDR: IMAGE_DYNAMIC_RANGE = IMAGE_DYNAMIC_RANGE(1); +} +impl IMAGE_DYNAMIC_RANGE { + pub const IMAGE_DYNAMIC_RANGE_HDR: IMAGE_DYNAMIC_RANGE = IMAGE_DYNAMIC_RANGE(2); +} +#[repr(transparent)] +/** @brief Enumerates decoding dynamic range.. + +@since 12*/ +#[derive(Clone, Hash, PartialEq, Eq)] +pub struct IMAGE_DYNAMIC_RANGE(pub ::core::ffi::c_uint); +/** @brief Defines the options for decoding the image source. +It is used in {@link OH_ImageSourceNative_CreatePixelmap}. + +@since 12*/ +#[repr(C)] +pub struct OH_DecodingOptions { + _unused: [u8; 0], +} +extern "C" { + /** @brief Create a pointer for OH_ImageSource_Info struct. + + @param info The OH_ImageSource_Info pointer will be operated. + @return Returns {@link Image_ErrorCode} + @since 12*/ + pub fn OH_ImageSourceInfo_Create(info: *mut *mut OH_ImageSource_Info) -> Image_ErrorCode; + /** @brief Get width number for OH_ImageSource_Info struct. + + @param info The OH_ImageSource_Info pointer will be operated. + @param width the number of image width. + @return Returns {@link Image_ErrorCode} + @since 12*/ + pub fn OH_ImageSourceInfo_GetWidth( + info: *mut OH_ImageSource_Info, + width: *mut u32, + ) -> Image_ErrorCode; + /** @brief Get height number for OH_ImageSource_Info struct. + + @param info The OH_ImageSource_Info pointer will be operated. + @param height the number of image height. + @return Returns {@link Image_ErrorCode} + @since 12*/ + pub fn OH_ImageSourceInfo_GetHeight( + info: *mut OH_ImageSource_Info, + height: *mut u32, + ) -> Image_ErrorCode; + /** @brief Get isHdr for OH_ImageSource_Info struct. + + @param info The OH_ImageSource_Info pointer will be operated. Pointer connot be null. + @param isHdr Whether the image has a high dynamic range. + @return Returns {@link Image_ErrorCode} IMAGE_SUCCESS - The operation is successful. + returns {@link Image_ErrorCode} IMAGE_BAD_PARAMETER - Parameter error.Possible causes:Parameter verification failed. + @since 12*/ + pub fn OH_ImageSourceInfo_GetDynamicRange( + info: *mut OH_ImageSource_Info, + isHdr: *mut bool, + ) -> Image_ErrorCode; + /** @brief delete OH_ImageSource_Info pointer. + + @param info The OH_ImageSource_Info pointer will be operated. + @return Returns {@link Image_ErrorCode} + @since 12*/ + pub fn OH_ImageSourceInfo_Release(info: *mut OH_ImageSource_Info) -> Image_ErrorCode; + /** @brief Create a pointer for OH_DecodingOptions struct. + + @param options The OH_DecodingOptions pointer will be operated. + @return Returns {@link Image_ErrorCode} + @since 12*/ + pub fn OH_DecodingOptions_Create(options: *mut *mut OH_DecodingOptions) -> Image_ErrorCode; + /** @brief Get pixelFormat number for OH_DecodingOptions struct. + + @param options The OH_DecodingOptions pointer will be operated. + @param pixelFormat the number of image pixelFormat. + @return Returns {@link Image_ErrorCode} + @since 12*/ + pub fn OH_DecodingOptions_GetPixelFormat( + options: *mut OH_DecodingOptions, + pixelFormat: *mut i32, + ) -> Image_ErrorCode; + /** @brief Set pixelFormat number for OH_DecodingOptions struct. + + @param options The OH_DecodingOptions pointer will be operated. + @param pixelFormat the number of image pixelFormat. + @return Returns {@link Image_ErrorCode} + @since 12*/ + pub fn OH_DecodingOptions_SetPixelFormat( + options: *mut OH_DecodingOptions, + pixelFormat: i32, + ) -> Image_ErrorCode; + /** @brief Get index number for OH_DecodingOptions struct. + + @param options The OH_DecodingOptions pointer will be operated. + @param index the number of image index. + @return Returns {@link Image_ErrorCode} + @since 12*/ + pub fn OH_DecodingOptions_GetIndex( + options: *mut OH_DecodingOptions, + index: *mut u32, + ) -> Image_ErrorCode; + /** @brief Set index number for OH_DecodingOptions struct. + + @param options The OH_DecodingOptions pointer will be operated. + @param index the number of image index. + @return Returns {@link Image_ErrorCode} + @since 12*/ + pub fn OH_DecodingOptions_SetIndex( + options: *mut OH_DecodingOptions, + index: u32, + ) -> Image_ErrorCode; + /** @brief Get rotate number for OH_DecodingOptions struct. + + @param options The OH_DecodingOptions pointer will be operated. + @param rotate the number of image rotate. + @return Returns {@link Image_ErrorCode} + @since 12*/ + pub fn OH_DecodingOptions_GetRotate( + options: *mut OH_DecodingOptions, + rotate: *mut f32, + ) -> Image_ErrorCode; + /** @brief Set rotate number for OH_DecodingOptions struct. + + @param options The OH_DecodingOptions pointer will be operated. + @param rotate the number of image rotate. + @return Returns {@link Image_ErrorCode} + @since 12*/ + pub fn OH_DecodingOptions_SetRotate( + options: *mut OH_DecodingOptions, + rotate: f32, + ) -> Image_ErrorCode; + /** @brief Get desiredSize number for OH_DecodingOptions struct. + + @param options The OH_DecodingOptions pointer will be operated. + @param desiredSize the number of image desiredSize. + @return Returns {@link Image_ErrorCode} + @since 12*/ + pub fn OH_DecodingOptions_GetDesiredSize( + options: *mut OH_DecodingOptions, + desiredSize: *mut Image_Size, + ) -> Image_ErrorCode; + /** @brief Set desiredSize number for OH_DecodingOptions struct. + + @param options The OH_DecodingOptions pointer will be operated. + @param desiredSize the number of image desiredSize. + @return Returns {@link Image_ErrorCode} + @since 12*/ + pub fn OH_DecodingOptions_SetDesiredSize( + options: *mut OH_DecodingOptions, + desiredSize: *mut Image_Size, + ) -> Image_ErrorCode; + /** @brief Set desiredRegion number for OH_DecodingOptions struct. + + @param options The OH_DecodingOptions pointer will be operated. + @param desiredRegion the number of image desiredRegion. + @return Returns {@link Image_ErrorCode} + @since 12*/ + pub fn OH_DecodingOptions_GetDesiredRegion( + options: *mut OH_DecodingOptions, + desiredRegion: *mut Image_Region, + ) -> Image_ErrorCode; + /** @brief Set desiredRegion number for OH_DecodingOptions struct. + + @param options The OH_DecodingOptions pointer will be operated. + @param desiredRegion the number of image desiredRegion. + @return Returns {@link Image_ErrorCode} + @since 12*/ + pub fn OH_DecodingOptions_SetDesiredRegion( + options: *mut OH_DecodingOptions, + desiredRegion: *mut Image_Region, + ) -> Image_ErrorCode; + /** @brief Set desiredDynamicRange number for OH_DecodingOptions struct. + + @param options The OH_DecodingOptions pointer will be operated. Pointer connot be null. + @param desiredDynamicRange the number of desired dynamic range {@link IMAGE_DYNAMIC_RANGE}. Pointer connot be null. + @return Returns {@link Image_ErrorCode} IMAGE_SUCCESS - The operation is successful. + returns {@link Image_ErrorCode} IMAGE_BAD_PARAMETER - Parameter error.Possible causes:Parameter verification failed. + @since 12*/ + pub fn OH_DecodingOptions_GetDesiredDynamicRange( + options: *mut OH_DecodingOptions, + desiredDynamicRange: *mut i32, + ) -> Image_ErrorCode; + /** @brief Set desiredDynamicRange number for OH_DecodingOptions struct. + + @param options The OH_DecodingOptions pointer will be operated. Pointer connot be null. + @param desiredDynamicRange the number of desired dynamic range {@link IMAGE_DYNAMIC_RANGE}. + @return Returns {@link Image_ErrorCode} IMAGE_SUCCESS - The operation is successful. + returns {@link Image_ErrorCode} IMAGE_BAD_PARAMETER - Parameter error.Possible causes:Parameter verification failed. + @since 12*/ + pub fn OH_DecodingOptions_SetDesiredDynamicRange( + options: *mut OH_DecodingOptions, + desiredDynamicRange: i32, + ) -> Image_ErrorCode; + /** @brief delete OH_DecodingOptions pointer. + + @param options The OH_DecodingOptions pointer will be operated. + @return Returns {@link Image_ErrorCode} + @since 12*/ + pub fn OH_DecodingOptions_Release(options: *mut OH_DecodingOptions) -> Image_ErrorCode; + /** @brief Creates an ImageSource pointer. + + @param uri Indicates a pointer to the image source URI. Only a file URI or Base64 URI is accepted. + @param uriSize Indicates the length of the image source URI. + @param res Indicates a pointer to the ImageSource object created at the C++ native layer. + @return Returns {@link Image_ErrorCode} + @since 12*/ + pub fn OH_ImageSourceNative_CreateFromUri( + uri: *mut ::core::ffi::c_char, + uriSize: usize, + res: *mut *mut OH_ImageSourceNative, + ) -> Image_ErrorCode; + /** @brief Creates an void pointer + + @param fd Indicates the image source file descriptor. + @param res Indicates a void pointer to the ImageSource object created at the C++ native layer. + @return Returns {@link Image_ErrorCode} + @since 12*/ + pub fn OH_ImageSourceNative_CreateFromFd( + fd: i32, + res: *mut *mut OH_ImageSourceNative, + ) -> Image_ErrorCode; + /** @brief Creates an void pointer + + @param data Indicates a pointer to the image source data. Only a formatted packet data or Base64 data is accepted. + @param dataSize Indicates the size of the image source data. + @param res Indicates a void pointer to the ImageSource object created at the C++ native layer. + @return Returns {@link Image_ErrorCode} + @since 12*/ + pub fn OH_ImageSourceNative_CreateFromData( + data: *mut u8, + dataSize: usize, + res: *mut *mut OH_ImageSourceNative, + ) -> Image_ErrorCode; + /** @brief Obtains the delay time list from some ImageSource objects (such as GIF image sources). + + @param source Indicates a void pointer(from ImageSource pointer convert). + @param delayTimeList Indicates a pointer to the delay time list obtained. It cannot be a null pointer. + @param size Indicates a size of delayTimeList. User can get size from {@link OH_ImageSourceNative_GetFrameCount}. + @return Returns {@link Image_ErrorCode} + @since 12*/ + pub fn OH_ImageSourceNative_GetDelayTimeList( + source: *mut OH_ImageSourceNative, + delayTimeList: *mut i32, + size: usize, + ) -> Image_ErrorCode; + /** @brief Obtains image source information from an ImageSource object by index. + + @param source Indicates a void pointer(from ImageSource pointer convert). + @param index Indicates the index of the frame. + @param info Indicates a pointer to the image source information obtained. + For details, see {@link OH_ImageSource_Info}. + @return Returns {@link Image_ErrorCode} + @since 12*/ + pub fn OH_ImageSourceNative_GetImageInfo( + source: *mut OH_ImageSourceNative, + index: i32, + info: *mut OH_ImageSource_Info, + ) -> Image_ErrorCode; + /** @brief Obtains the value of an image property from an ImageSource object. + + @param source Indicates a void pointer(from ImageSource pointer convert). + @param key Indicates a pointer to the property. For details, see {@link Image_String}., key is an exif constant. + Release after use ImageSource, see {@link OH_ImageSourceNative_Release}. + @param value Indicates a pointer to the value obtained.The user can pass in a null pointer and zero size, + we will allocate memory, but user must free memory after use. + @return Returns {@link Image_ErrorCode} + @since 12*/ + pub fn OH_ImageSourceNative_GetImageProperty( + source: *mut OH_ImageSourceNative, + key: *mut Image_String, + value: *mut Image_String, + ) -> Image_ErrorCode; + /** @brief Modifies the value of an image property of an ImageSource object. + @param source Indicates a void pointer(from ImageSource pointer convert). + @param key Indicates a pointer to the property. For details, see {@link Image_String}., key is an exif constant. + Release after use ImageSource, see {@link OH_ImageSourceNative_Release}. + @param value Indicates a pointer to the new value of the property. + @return Returns {@link Image_ErrorCode} + @since 12*/ + pub fn OH_ImageSourceNative_ModifyImageProperty( + source: *mut OH_ImageSourceNative, + key: *mut Image_String, + value: *mut Image_String, + ) -> Image_ErrorCode; + /** @brief Obtains the number of frames from an ImageSource object. + + @param source Indicates a pointer to the {@link OH_ImageSource} object at the C++ native layer. + @param res Indicates a pointer to the number of frames obtained. + @return Returns {@link Image_ErrorCode} + @since 12*/ + pub fn OH_ImageSourceNative_GetFrameCount( + source: *mut OH_ImageSourceNative, + frameCount: *mut u32, + ) -> Image_ErrorCode; + /** @brief Releases an ImageSourc object. + + @param source Indicates a ImageSource pointer. + @return Returns {@link Image_ErrorCode} + @since 12*/ + pub fn OH_ImageSourceNative_Release(source: *mut OH_ImageSourceNative) -> Image_ErrorCode; +} diff --git a/components/multimedia/image_framework/src/native_image/pixelmap.rs b/components/multimedia/image_framework/src/native_image/pixelmap.rs new file mode 100644 index 0000000..cab4cfd --- /dev/null +++ b/components/multimedia/image_framework/src/native_image/pixelmap.rs @@ -0,0 +1,9 @@ +//! Declares APIs for accessing a PixelMap +//! +//! + +#[link(name = "pixelmap")] +extern "C" {} + +mod pixelmap_api12; +pub use pixelmap_api12::*; diff --git a/components/multimedia/image_framework/src/native_image/pixelmap/pixelmap_api12.rs b/components/multimedia/image_framework/src/native_image/pixelmap/pixelmap_api12.rs new file mode 100644 index 0000000..c3975c4 --- /dev/null +++ b/components/multimedia/image_framework/src/native_image/pixelmap/pixelmap_api12.rs @@ -0,0 +1,669 @@ +/* automatically generated by rust-bindgen 0.70.1 */ + +#![allow(non_upper_case_globals)] +#![allow(non_camel_case_types)] +#![allow(non_snake_case)] +use crate::native_image::common::*; + +/** @brief Define a Pixelmap struct type, used for pixelmap pointer controls. + +@since 12*/ +#[repr(C)] +pub struct OH_PixelmapNative { + _unused: [u8; 0], +} +/** @brief Define a native buffer type, used for retrieving a native buffer. + +@since 12*/ +#[repr(C)] +pub struct OH_NativeBuffer { + _unused: [u8; 0], +} +impl PIXELMAP_ALPHA_TYPE { + pub const PIXELMAP_ALPHA_TYPE_UNKNOWN: PIXELMAP_ALPHA_TYPE = PIXELMAP_ALPHA_TYPE(0); +} +impl PIXELMAP_ALPHA_TYPE { + pub const PIXELMAP_ALPHA_TYPE_OPAQUE: PIXELMAP_ALPHA_TYPE = PIXELMAP_ALPHA_TYPE(1); +} +impl PIXELMAP_ALPHA_TYPE { + pub const PIXELMAP_ALPHA_TYPE_PREMULTIPLIED: PIXELMAP_ALPHA_TYPE = PIXELMAP_ALPHA_TYPE(2); +} +impl PIXELMAP_ALPHA_TYPE { + pub const PIXELMAP_ALPHA_TYPE_UNPREMULTIPLIED: PIXELMAP_ALPHA_TYPE = PIXELMAP_ALPHA_TYPE(3); +} +#[repr(transparent)] +/** @brief Define a pixelmap alpha type. + +@since 12*/ +#[derive(Clone, Hash, PartialEq, Eq)] +pub struct PIXELMAP_ALPHA_TYPE(pub ::core::ffi::c_uint); +impl PIXEL_FORMAT { + pub const PIXEL_FORMAT_UNKNOWN: PIXEL_FORMAT = PIXEL_FORMAT(0); +} +impl PIXEL_FORMAT { + pub const PIXEL_FORMAT_RGB_565: PIXEL_FORMAT = PIXEL_FORMAT(2); +} +impl PIXEL_FORMAT { + pub const PIXEL_FORMAT_RGBA_8888: PIXEL_FORMAT = PIXEL_FORMAT(3); +} +impl PIXEL_FORMAT { + pub const PIXEL_FORMAT_BGRA_8888: PIXEL_FORMAT = PIXEL_FORMAT(4); +} +impl PIXEL_FORMAT { + pub const PIXEL_FORMAT_RGB_888: PIXEL_FORMAT = PIXEL_FORMAT(5); +} +impl PIXEL_FORMAT { + pub const PIXEL_FORMAT_ALPHA_8: PIXEL_FORMAT = PIXEL_FORMAT(6); +} +impl PIXEL_FORMAT { + pub const PIXEL_FORMAT_RGBA_F16: PIXEL_FORMAT = PIXEL_FORMAT(7); +} +impl PIXEL_FORMAT { + pub const PIXEL_FORMAT_NV21: PIXEL_FORMAT = PIXEL_FORMAT(8); +} +impl PIXEL_FORMAT { + pub const PIXEL_FORMAT_NV12: PIXEL_FORMAT = PIXEL_FORMAT(9); +} +impl PIXEL_FORMAT { + pub const PIXEL_FORMAT_RGBA_1010102: PIXEL_FORMAT = PIXEL_FORMAT(10); +} +impl PIXEL_FORMAT { + pub const PIXEL_FORMAT_YCBCR_P010: PIXEL_FORMAT = PIXEL_FORMAT(11); +} +impl PIXEL_FORMAT { + pub const PIXEL_FORMAT_YCRCB_P010: PIXEL_FORMAT = PIXEL_FORMAT(12); +} +#[repr(transparent)] +#[derive(Clone, Hash, PartialEq, Eq)] +pub struct PIXEL_FORMAT(pub ::core::ffi::c_uint); +impl OH_PixelmapNative_AntiAliasingLevel { + /// Nearest-neighbor interpolation algorithm + pub const OH_PixelmapNative_AntiAliasing_NONE: OH_PixelmapNative_AntiAliasingLevel = + OH_PixelmapNative_AntiAliasingLevel(0); +} +impl OH_PixelmapNative_AntiAliasingLevel { + /// Bilinear interpolation algorithm + pub const OH_PixelmapNative_AntiAliasing_LOW: OH_PixelmapNative_AntiAliasingLevel = + OH_PixelmapNative_AntiAliasingLevel(1); +} +impl OH_PixelmapNative_AntiAliasingLevel { + /// Bilinear interpolation algorithm with mipmap linear filtering + pub const OH_PixelmapNative_AntiAliasing_MEDIUM: OH_PixelmapNative_AntiAliasingLevel = + OH_PixelmapNative_AntiAliasingLevel(2); +} +impl OH_PixelmapNative_AntiAliasingLevel { + /// Cubic interpolation algorithm + pub const OH_PixelmapNative_AntiAliasing_HIGH: OH_PixelmapNative_AntiAliasingLevel = + OH_PixelmapNative_AntiAliasingLevel(3); +} +#[repr(transparent)] +/** @brief Defines the anti-aliasing level. + +@since 12*/ +#[derive(Clone, Hash, PartialEq, Eq)] +pub struct OH_PixelmapNative_AntiAliasingLevel(pub ::core::ffi::c_uint); +impl OH_Pixelmap_HdrMetadataKey { + /// Indicate the types of metadata that image needs to use. + pub const HDR_METADATA_TYPE: OH_Pixelmap_HdrMetadataKey = OH_Pixelmap_HdrMetadataKey(0); +} +impl OH_Pixelmap_HdrMetadataKey { + /// Static metadata key. + pub const HDR_STATIC_METADATA: OH_Pixelmap_HdrMetadataKey = OH_Pixelmap_HdrMetadataKey(1); +} +impl OH_Pixelmap_HdrMetadataKey { + /// Dynamic metadata key. + pub const HDR_DYNAMIC_METADATA: OH_Pixelmap_HdrMetadataKey = OH_Pixelmap_HdrMetadataKey(2); +} +impl OH_Pixelmap_HdrMetadataKey { + /// Gainmap metadata key. + pub const HDR_GAINMAP_METADATA: OH_Pixelmap_HdrMetadataKey = OH_Pixelmap_HdrMetadataKey(3); +} +#[repr(transparent)] +/** @brief Enumerates the HDR metadata types that need to be stored in Pixelmap. + +@since 12*/ +#[derive(Clone, Hash, PartialEq, Eq)] +pub struct OH_Pixelmap_HdrMetadataKey(pub ::core::ffi::c_uint); +impl OH_Pixelmap_HdrMetadataType { + /// No metadata. + pub const HDR_METADATA_TYPE_NONE: OH_Pixelmap_HdrMetadataType = OH_Pixelmap_HdrMetadataType(0); +} +impl OH_Pixelmap_HdrMetadataType { + /// Indicates that metadata will be used for the base image. + pub const HDR_METADATA_TYPE_BASE: OH_Pixelmap_HdrMetadataType = OH_Pixelmap_HdrMetadataType(1); +} +impl OH_Pixelmap_HdrMetadataType { + /// Indicates that metadata will be used for the gainmap image. + pub const HDR_METADATA_TYPE_GAINMAP: OH_Pixelmap_HdrMetadataType = + OH_Pixelmap_HdrMetadataType(2); +} +impl OH_Pixelmap_HdrMetadataType { + /// Indicates that metadata will be used for the alternate image. + pub const HDR_METADATA_TYPE_ALTERNATE: OH_Pixelmap_HdrMetadataType = + OH_Pixelmap_HdrMetadataType(3); +} +#[repr(transparent)] +/** @brief Value for HDR_METADATA_TYPE. + +@since 12*/ +#[derive(Clone, Hash, PartialEq, Eq)] +pub struct OH_Pixelmap_HdrMetadataType(pub ::core::ffi::c_uint); +/** @brief Value for HDR_STATIC_METADATA. + +@since 12*/ +#[repr(C)] +pub struct OH_Pixelmap_HdrStaticMetadata { + /// The X-coordinate of the primary colors. The length of the array is three. Store in the order of r, g, b. + pub displayPrimariesX: [f32; 3usize], + /// The Y-coordinate of the primary colors. The length of the array is three. Store in the order of r, g, b. + pub displayPrimariesY: [f32; 3usize], + /// The X-coordinate of the white point value. + pub whitePointX: f32, + /// The Y-coordinate of the white point value. + pub whitePointY: f32, + /// Max luminance. + pub maxLuminance: f32, + /// Min luminance. + pub minLuminance: f32, + /// Maximum brightness of displayed content. + pub maxContentLightLevel: f32, + /// Maximum average brightness of displayed content. + pub maxFrameAverageLightLevel: f32, +} +/** @brief Value for HDR_DYNAMIC_METADATA. + +@since 12*/ +#[repr(C)] +pub struct OH_Pixelmap_HdrDynamicMetadata { + /// The value of dynamic metadata. + pub data: *mut u8, + /// The length of dynamic metadata. + pub length: u32, +} +/** @brief Value for HDR_GAINMAP_METADATA. + +@since 12*/ +#[repr(C)] +pub struct OH_Pixelmap_HdrGainmapMetadata { + /// The version used by the writer. + pub writerVersion: u16, + /// The minimum version a parser needs to understand. + pub miniVersion: u16, + /// The number of gain map channels, with a value of 1 or 3. + pub gainmapChannelNum: u8, + /// Indicate whether to use the color space of the base image. + pub useBaseColorFlag: bool, + /// The baseline hdr headroom. + pub baseHeadroom: f32, + /// The alternate hdr headroom. + pub alternateHeadroom: f32, + /// The per-component max gain map values. + pub gainmapMax: [f32; 3usize], + /// The per-component min gain map values. + pub gainmapMin: [f32; 3usize], + /// The per-component gamma values. + pub gamma: [f32; 3usize], + /// The per-component baseline offset. + pub baselineOffset: [f32; 3usize], + /// The per-component alternate offset. + pub alternateOffset: [f32; 3usize], +} +/** @brief Value for HDR_METADATA_KEY. Corresponding relationship with HDR_METADATA_KEY. + +@since 12*/ +#[repr(C)] +pub struct OH_Pixelmap_HdrMetadataValue { + /// The value corresponding to the HDR_METADATA_TYPE key + pub type_: OH_Pixelmap_HdrMetadataType, + /// The value corresponding to the HDR_STATIC_METADATA key + pub staticMetadata: OH_Pixelmap_HdrStaticMetadata, + /// The value corresponding to the HDR_DYNAMIC_METADATA key + pub dynamicMetadata: OH_Pixelmap_HdrDynamicMetadata, + /// The value corresponding to the HDR_GAINMAP_METADATA key + pub gainmapMetadata: OH_Pixelmap_HdrGainmapMetadata, +} +/** @brief Defines the options used for creating a pixel map. + +@since 12*/ +#[repr(C)] +pub struct OH_Pixelmap_InitializationOptions { + _unused: [u8; 0], +} +/** @brief Defines the pixel map information. + +@since 12*/ +#[repr(C)] +pub struct OH_Pixelmap_ImageInfo { + _unused: [u8; 0], +} +extern "C" { + /** @brief Create a for InitializationOtions struct. + + @param options The InitializationOtions pointer will be operated. + @return Returns {@link Image_ErrorCode} + @since 12*/ + pub fn OH_PixelmapInitializationOptions_Create( + options: *mut *mut OH_Pixelmap_InitializationOptions, + ) -> Image_ErrorCode; + /** @brief Get width number for InitializationOtions struct. + + @param options The InitializationOtions pointer will be operated. + @param width the number of image width. + @return Returns {@link Image_ErrorCode} + @since 12*/ + pub fn OH_PixelmapInitializationOptions_GetWidth( + options: *mut OH_Pixelmap_InitializationOptions, + width: *mut u32, + ) -> Image_ErrorCode; + /** @brief Set width number for InitializationOtions struct. + + @param options The InitializationOtions pointer will be operated. + @param width the number of image width. + @return Returns {@link Image_ErrorCode} + @since 12*/ + pub fn OH_PixelmapInitializationOptions_SetWidth( + options: *mut OH_Pixelmap_InitializationOptions, + width: u32, + ) -> Image_ErrorCode; + /** @brief Get height number for InitializationOtions struct. + + @param options The InitializationOtions pointer will be operated. + @param height the number of image height. + @return Returns {@link Image_ErrorCode} + @since 12*/ + pub fn OH_PixelmapInitializationOptions_GetHeight( + options: *mut OH_Pixelmap_InitializationOptions, + height: *mut u32, + ) -> Image_ErrorCode; + /** @brief Set height number for InitializationOtions struct. + + @param options The InitializationOtions pointer will be operated. + @param height the number of image height. + @return Returns {@link Image_ErrorCode} + @since 12*/ + pub fn OH_PixelmapInitializationOptions_SetHeight( + options: *mut OH_Pixelmap_InitializationOptions, + height: u32, + ) -> Image_ErrorCode; + /** @brief Get pixelFormat number for InitializationOtions struct. + + @param options The InitializationOtions pointer will be operated. + @param pixelFormat the number of image pixelFormat. + @return Returns {@link Image_ErrorCode} + @since 12*/ + pub fn OH_PixelmapInitializationOptions_GetPixelFormat( + options: *mut OH_Pixelmap_InitializationOptions, + pixelFormat: *mut i32, + ) -> Image_ErrorCode; + /** @brief Set pixelFormat number for InitializationOtions struct. + + @param options The InitializationOtions pointer will be operated. + @param pixelFormat the number of image pixelFormat. + @return Returns {@link Image_ErrorCode} + @since 12*/ + pub fn OH_PixelmapInitializationOptions_SetPixelFormat( + options: *mut OH_Pixelmap_InitializationOptions, + pixelFormat: i32, + ) -> Image_ErrorCode; + /** @brief Get pixelFormat number for InitializationOtions struct. + + @param options The InitializationOtions pointer will be operated. + @param srcpixelFormat the number of image srcpixelFormat. + @return Returns {@link Image_ErrorCode} + @since 12*/ + pub fn OH_PixelmapInitializationOptions_GetSrcPixelFormat( + options: *mut OH_Pixelmap_InitializationOptions, + srcpixelFormat: *mut i32, + ) -> Image_ErrorCode; + /** @brief Set pixelFormat number for InitializationOtions struct. + + @param options The InitializationOtions pointer will be operated. + @param srcpixelFormat the number of image srcpixelFormat. + @return Returns {@link Image_ErrorCode} + @since 12*/ + pub fn OH_PixelmapInitializationOptions_SetSrcPixelFormat( + options: *mut OH_Pixelmap_InitializationOptions, + srcpixelFormat: i32, + ) -> Image_ErrorCode; + /** @brief Get rowStride for InitializationOptions struct. + + @param options The InitializationOptions pointer will be operated. + @param rowStride the rowStride of image buffer. + @return Returns {@link Image_ErrorCode} IMAGE_SUCCESS - if the operation is successful. + returns {@link Image_ErrorCode} IMAGE_BAD_PARAMETER - if rowStride is null. + returns {@link Image_ErrorCode} IMAGE_UNKNOWN_ERROR - inner unknown error, maybe options is released. + @since 12*/ + pub fn OH_PixelmapInitializationOptions_GetRowStride( + options: *mut OH_Pixelmap_InitializationOptions, + rowStride: *mut i32, + ) -> Image_ErrorCode; + /** @brief Set rowStride number for InitializationOptions struct. + + @param options The InitializationOptions pointer will be operated. + @param rowStride the rowStride of image buffer. + @return Returns {@link Image_ErrorCode} IMAGE_SUCCESS - if the operation is successful. + returns {@link Image_ErrorCode} IMAGE_BAD_PARAMETER - if rowStride does not match width. + returns {@link Image_ErrorCode} IMAGE_UNKNOWN_ERROR - inner unknown error, maybe options is released. + @since 12*/ + pub fn OH_PixelmapInitializationOptions_SetRowStride( + options: *mut OH_Pixelmap_InitializationOptions, + rowStride: i32, + ) -> Image_ErrorCode; + /** @brief Get alphaType number for InitializationOtions struct. + + @param options The InitializationOtions pointer will be operated. + @param alphaType the number of image alphaType. + @return Returns {@link Image_ErrorCode} + @since 12*/ + pub fn OH_PixelmapInitializationOptions_GetAlphaType( + options: *mut OH_Pixelmap_InitializationOptions, + alphaType: *mut i32, + ) -> Image_ErrorCode; + /** @brief Set alphaType number for InitializationOtions struct. + + @param options The InitializationOtions pointer will be operated. + @param alphaType the number of image alphaType. + @return Returns {@link Image_ErrorCode} + @since 12*/ + pub fn OH_PixelmapInitializationOptions_SetAlphaType( + options: *mut OH_Pixelmap_InitializationOptions, + alphaType: i32, + ) -> Image_ErrorCode; + /** @brief delete InitializationOtions pointer. + + @param options The InitializationOtions pointer will be operated. + @return Returns {@link Image_ErrorCode} + @since 12*/ + pub fn OH_PixelmapInitializationOptions_Release( + options: *mut OH_Pixelmap_InitializationOptions, + ) -> Image_ErrorCode; + /** @brief Create imageinfo struct . + + @param info The imageinfo pointer will be operated. + @return Returns {@link Image_ErrorCode} + @since 12*/ + pub fn OH_PixelmapImageInfo_Create(info: *mut *mut OH_Pixelmap_ImageInfo) -> Image_ErrorCode; + /** @brief Get width number for imageinfo struct. + + @param info The imageinfo pointer will be operated. + @param width The number of imageinfo width. + @return Returns {@link Image_ErrorCode} + @since 12*/ + pub fn OH_PixelmapImageInfo_GetWidth( + info: *mut OH_Pixelmap_ImageInfo, + width: *mut u32, + ) -> Image_ErrorCode; + /** @brief Get height number for imageinfo struct. + + @param info The imageinfo pointer will be operated. + @param height The number of imageinfo height. + @return Returns {@link Image_ErrorCode} + @since 12*/ + pub fn OH_PixelmapImageInfo_GetHeight( + info: *mut OH_Pixelmap_ImageInfo, + height: *mut u32, + ) -> Image_ErrorCode; + /** @brief Get rowStride number for imageinfo struct. + + @param info The imageinfo pointer will be operated. + @param rowStride The number of imageinfo rowStride. + @return Returns {@link Image_ErrorCode} + @since 12*/ + pub fn OH_PixelmapImageInfo_GetRowStride( + info: *mut OH_Pixelmap_ImageInfo, + rowStride: *mut u32, + ) -> Image_ErrorCode; + /** @brief Get pixelFormat number for imageinfo struct. + + @param info The imageinfo pointer will be operated. + @param pixelFormat The number of imageinfo pixelFormat. + @return Returns {@link Image_ErrorCode} + @since 12*/ + pub fn OH_PixelmapImageInfo_GetPixelFormat( + info: *mut OH_Pixelmap_ImageInfo, + pixelFormat: *mut i32, + ) -> Image_ErrorCode; + /** @brief Get density number for imageinfo struct. + + @param info The imageinfo pointer will be operated. + @param density The number of imageinfo density. + @return Returns {@link Image_ErrorCode} + @since 12*/ + pub fn OH_PixelmapImageInfo_GetAlphaType( + info: *mut OH_Pixelmap_ImageInfo, + alphaType: *mut i32, + ) -> Image_ErrorCode; + /** @brief Get isHdr boolean for imageinfo struct. + + @param info The imageinfo pointer will be operated. Pointer connot be null. + @param isHdr Whether the image has a high dynamic range. + @return Returns {@link Image_ErrorCode} IMAGE_SUCCESS - The operation is successful. + returns {@link Image_ErrorCode} IMAGE_BAD_PARAMETER - Parameter error.Possible causes:Parameter verification failed. + @since 12*/ + pub fn OH_PixelmapImageInfo_GetDynamicRange( + info: *mut OH_Pixelmap_ImageInfo, + isHdr: *mut bool, + ) -> Image_ErrorCode; + /** @brief Delete imageinfo struct pointer. + + @param info The imageinfo pointer will be operated. + @return Returns {@link Image_ErrorCode} + @since 12*/ + pub fn OH_PixelmapImageInfo_Release(info: *mut OH_Pixelmap_ImageInfo) -> Image_ErrorCode; + /** @brief Creates a PixelMap object. + + @param data Color buffer in BGRA_8888 format. + @param dataLength Color buffer size in BGRA_8888 format. + @param options IPixel properties, including the alpha type, size, pixel format, and editable. + @param pixelmap Pixelmap pointer for created. + @return Returns {@link Image_ErrorCode} + @since 12*/ + pub fn OH_PixelmapNative_CreatePixelmap( + data: *mut u8, + dataLength: usize, + options: *mut OH_Pixelmap_InitializationOptions, + pixelmap: *mut *mut OH_PixelmapNative, + ) -> Image_ErrorCode; + /** @brief Reads data of this pixel map to an Buffer. If this pixel map is created in the BGRA_8888 format, + the data read is the same as the original data. + + @param pixelmap The Pixelmap pointer will be operated. + @param destination Buffer to which the image pixel map data will be written. + @param bufferSize Buffer size to which the image pixel map data will be written. + @return Returns {@link Image_ErrorCode} + @since 12*/ + pub fn OH_PixelmapNative_ReadPixels( + pixelmap: *mut OH_PixelmapNative, + destination: *mut u8, + bufferSize: *mut usize, + ) -> Image_ErrorCode; + /** @brief Reads image data in an Buffer and writes the data to a Pixelmap object. + + @param pixelmap The Pixelmap pointer will be operated. + @param source Buffer from which the image data will be read. + @param bufferSize Buffer size from which the image data will be read. + @return Returns {@link Image_ErrorCode} + @since 12*/ + pub fn OH_PixelmapNative_WritePixels( + pixelmap: *mut OH_PixelmapNative, + source: *mut u8, + bufferSize: usize, + ) -> Image_ErrorCode; + /** @brief Convert {@link OH_PixelmapNative} to standard dynamic range. + + @param pixelmap The Pixelmap pointer will be operated. Pointer connot be null. + @return Returns {@link Image_ErrorCode} IMAGE_SUCCESS - The operation is successful. + returns {@link Image_ErrorCode} IMAGE_BAD_PARAMETER - Parameter error.Possible causes:Parameter verification failed. + returns {@link Image_ErrorCode} IMAGE_UNSUPPORTED_OPERATION - Unsupported operation.Pixelmap can't be converted. + @since 12*/ + pub fn OH_PixelmapNative_ToSdr(pixelmap: *mut OH_PixelmapNative) -> Image_ErrorCode; + /** @brief Obtains pixel map information of this image. + + @param pixelmap The Pixelmap pointer will be operated. + @param imageInfo Indicates the pointer to the image information. + @return Returns {@link Image_ErrorCode} + @since 12*/ + pub fn OH_PixelmapNative_GetImageInfo( + pixelmap: *mut OH_PixelmapNative, + imageInfo: *mut OH_Pixelmap_ImageInfo, + ) -> Image_ErrorCode; + /** @brief Sets an opacity rate for this image pixel map. + + @param pixelmap The Pixelmap pointer will be operated. + @param rate Opacity rate to set. The value ranges from 0 to 1. + @return Returns {@link Image_ErrorCode} + @since 12*/ + pub fn OH_PixelmapNative_Opacity( + pixelmap: *mut OH_PixelmapNative, + rate: f32, + ) -> Image_ErrorCode; + /** @brief Scales this image based on the input width and height. + + @param pixelmap The Pixelmap pointer will be operated. + @param scaleX Scaling ratio of the width. + @param scaleY Scaling ratio of the height. + @return Returns {@link Image_ErrorCode} + @since 12*/ + pub fn OH_PixelmapNative_Scale( + pixelmap: *mut OH_PixelmapNative, + scaleX: f32, + scaleY: f32, + ) -> Image_ErrorCode; + /** @brief Scales this image based on the input width and height with anti-aliasing. + + @param pixelmap The Pixelmap pointer will be operated. + @param scaleX Scaling ratio of the width. + @param scaleY Scaling ratio of the height. + @param level The anti-aliasing algorithm to be used. + @return Returns {@link Image_ErrorCode} IMAGE_SUCCESS - if the operation is successful. + returns {@link Image_ErrorCode} IMAGE_BAD_PARAMETER - if invalid parameter, x and y are incorrect. + returns {@link Image_ErrorCode} IMAGE_TOO_LARGE - if image is too large. + returns {@link Image_ErrorCode} IMAGE_ALLOC_FAILED - if device has no memory. + returns {@link Image_ErrorCode} IMAGE_UNKNOWN_ERROR - inner unknown error, maybe source pixelmap is released. + @see OH_PixelmapNative + @since 12*/ + pub fn OH_PixelmapNative_ScaleWithAntiAliasing( + pixelmap: *mut OH_PixelmapNative, + scaleX: f32, + scaleY: f32, + level: OH_PixelmapNative_AntiAliasingLevel, + ) -> Image_ErrorCode; + /** @brief Translates this image based on the input coordinates. + + @param pixelmap The Pixelmap pointer will be operated. + @param x The distance to be translate in the X direction. + @param y The distance to be translate in the Y direction. + @return Returns {@link Image_ErrorCode} + @since 12*/ + pub fn OH_PixelmapNative_Translate( + pixelmap: *mut OH_PixelmapNative, + x: f32, + y: f32, + ) -> Image_ErrorCode; + /** @brief Rotates this image based on the input angle. + + @param pixelmap The Pixelmap pointer will be operated. + @param angle Angle to rotate. + @return Returns {@link Image_ErrorCode} + @since 12*/ + pub fn OH_PixelmapNative_Rotate( + pixelmap: *mut OH_PixelmapNative, + angle: f32, + ) -> Image_ErrorCode; + /** @brief Flips this image horizontally or vertically, or both. + + @param pixelmap The Pixelmap pointer will be operated. + @param shouldFilpHorizontally Whether to flip the image horizontally. + @param shouldFilpVertically Whether to flip the image vertically. + @return Returns {@link Image_ErrorCode} + @since 12*/ + pub fn OH_PixelmapNative_Flip( + pixelmap: *mut OH_PixelmapNative, + shouldFilpHorizontally: bool, + shouldFilpVertically: bool, + ) -> Image_ErrorCode; + /** @brief Crops this image based on the input size. + + @param pixelmap The Pixelmap pointer will be operated. + @param region Area size, read according to area. + @return Returns {@link Image_ErrorCode} + @since 12*/ + pub fn OH_PixelmapNative_Crop( + pixelmap: *mut OH_PixelmapNative, + region: *mut Image_Region, + ) -> Image_ErrorCode; + /** @brief Releases an OH_Pixelmap object. + + @param pixelmap The Pixelmap pointer will be operated. + @return Returns {@link Image_ErrorCode} + @since 12*/ + pub fn OH_PixelmapNative_Release(pixelmap: *mut OH_PixelmapNative) -> Image_ErrorCode; + /** @brief Converting images to alpha format + + @param srcpixelmap The source pixel map pointer will be operated. + @param dstpixelmap The destination pixel map pointer will be operated. + @param isPremul Whether it is pre-multiplied, true for prediction, false for non-pre-multiplied. + @return Returns {@link Image_ErrorCode} + @since 12*/ + pub fn OH_PixelmapNative_ConvertAlphaFormat( + srcpixelmap: *mut OH_PixelmapNative, + dstpixelmap: *mut OH_PixelmapNative, + isPremul: bool, + ) -> Image_ErrorCode; + /** @brief Create a empty PixelMap object. + + @param options IPixel properties, including the alpha type, size, pixel format, and editable. + @param pixelmap Pixelmap pointer for created. + @return Returns {@link Image_ErrorCode} + @since 12*/ + pub fn OH_PixelmapNative_CreateEmptyPixelmap( + options: *mut OH_Pixelmap_InitializationOptions, + pixelmap: *mut *mut OH_PixelmapNative, + ) -> Image_ErrorCode; + /** @brief Get metadata. + + @param pixelmap The Pixelmap pointer to be operated. + @param key Type of metadata. + @param value Value of metadata. + @return Returns {@link Image_ErrorCode} IMAGE_SUCCESS - if the operation is successful. + returns {@link Image_ErrorCode} IMAGE_BAD_PARAMETER - if invalid parameter, key and value are incorrect. + returns {@link Image_ErrorCode} IMAGE_DMA_NOT_EXIST - if DMA memory does not exist. + returns {@link Image_ErrorCode} IMAGE_COPY_FAILED - if memory copy failed. + @see OH_PixelmapNative + @since 12*/ + pub fn OH_PixelmapNative_GetMetadata( + pixelmap: *mut OH_PixelmapNative, + key: OH_Pixelmap_HdrMetadataKey, + value: *mut *mut OH_Pixelmap_HdrMetadataValue, + ) -> Image_ErrorCode; + /** @brief Set metadata. + + @param pixelmap The Pixelmap pointer to be operated. + @param key Type of metadata. + @param value Value of metadata. + @return Returns {@link Image_ErrorCode} IMAGE_SUCCESS - if the operation is successful. + returns {@link Image_ErrorCode} IMAGE_BAD_PARAMETER - if invalid parameter, key and value are incorrect. + returns {@link Image_ErrorCode} IMAGE_DMA_NOT_EXIST - if DMA memory does not exist. + returns {@link Image_ErrorCode} IMAGE_COPY_FAILED - if memory copy failed. + @see OH_PixelmapNative + @since 12*/ + pub fn OH_PixelmapNative_SetMetadata( + pixelmap: *mut OH_PixelmapNative, + key: OH_Pixelmap_HdrMetadataKey, + value: *mut OH_Pixelmap_HdrMetadataValue, + ) -> Image_ErrorCode; + /** @brief Get the native buffer from the PixelMap. + + @param pixelmap The PixelMap to get the native buffer from. + @param nativeBuffer The native buffer to retrieve. + @return Returns {@link Image_ErrorCode} IMAGE_RESULT_SUCCESS - if the operation is successful. + returns {@link Image_ErrorCode} IMAGE_BAD_PARAMETER - if invalid parameter, pixelmap or nativeBuffer is null. + returns {@link Image_ErrorCode} IMAGE_DMA_NOT_EXIST - if DMA memory dose not exist. + returns {@link Image_ErrorCode} IMAGE_DMA_OPERATION_FAILED - if operations related to DMA memory has failed. + @see OH_PixelmapNative + @since 12*/ + pub fn OH_PixelmapNative_GetNativeBuffer( + pixelmap: *mut OH_PixelmapNative, + nativeBuffer: *mut *mut OH_NativeBuffer, + ) -> Image_ErrorCode; +} diff --git a/scripts/generate_bindings.sh b/scripts/generate_bindings.sh index 087e579..a3b870c 100755 --- a/scripts/generate_bindings.sh +++ b/scripts/generate_bindings.sh @@ -49,7 +49,7 @@ OHOS_API_VERSION=$(jq '.apiVersion' -j < "${OHOS_NDK_HOME}/oh-uni-package.json") echo "Generating bindings for API version ${OHOS_API_VERSION}" PREVIOUS_API_VERSION=$((OHOS_API_VERSION - 1)) -BASE_BINDGEN_ARGS=(--no-layout-tests --formatter=prettyplease --merge-extern-blocks) +BASE_BINDGEN_ARGS=(--no-layout-tests --formatter=prettyplease --merge-extern-blocks --rust-target=1.77) BASE_BINDGEN_ARGS+=(--blocklist-file='.*stdint\.h' --blocklist-file='.*stddef\.h') BASE_BINDGEN_ARGS+=(--blocklist-file='.*stdarg\.h' --blocklist-file='.*stdbool\.h') BASE_BINDGEN_ARGS+=(--blocklist-file='.*/std[a-z]{3,4}\.h' --blocklist-file='.*/__std[a-z_]+\.h') @@ -313,10 +313,66 @@ if (( OHOS_API_VERSION >= 12)); then --output "${output_dir}/${rust_name}_api${OHOS_API_VERSION}${no_publish_suffix}.rs" \ "${abs_ime_header}" \ -- "${BASE_CLANG_ARGS[@]}" \ - -x c++ \ - #-include stdbool.h \ - #-include stddef.h \ - #-include stdint.h + -x c++ + done +fi + +# Todo: Add the necessary imports / relations and remove this restriction again. +IMG_pixelmap_ADDITIONAL_ARGS=('--blocklist-function=^OH_PixelmapNative_ConvertPixelmapNative(To|From)Napi') +IMG_image_source_ADDITIONAL_ARGS=('--blocklist-function=^OH_ImageSourceNative_CreateFromRawFile') +# Todo: these bindings are hand-picked and feature guarded right now - autogenerate... +IMG_image_source_ADDITIONAL_ARGS+=('--blocklist-function=^OH_ImageSourceNative_CreatePixelmap(List)?') +IMG_image_receiver_ADDITIONAL_ARGS=('--raw-line=use crate::native_image::image::OH_ImageNative;') +IMG_image_packer_ADDITIONAL_ARGS=('--blocklist-function=^OH_ImagePackerNative_PackTo(Data|File)FromImageSource') +IMG_image_packer_ADDITIONAL_ARGS+=('--blocklist-function=^OH_ImagePackerNative_PackTo(Data|File)FromPixelmap') +IMG_image_ADDITIONAL_ARGS+=('--blocklist-function=^OH_ImageNative_GetByteBuffer') + + +if (( OHOS_API_VERSION >= 12)); then + for abs_img_header in "${OHOS_SYSROOT_DIR}/usr/include/multimedia/image_framework/image"/* ; do + img_header=$(basename "${abs_img_header}") + echo "Generating bindings for ${img_header}" + rust_name=${img_header} + rust_name=${rust_name%".h"} + rust_name=${rust_name%"_native"} + output_dir="${ROOT_DIR}/components/multimedia/image_framework/src/native_image/${rust_name}" + if [ ! -d "${output_dir}" ]; then + mkdir "${output_dir}" + fi + rs_includes=() + if [[ "${rust_name}" != "image_common" ]]; then + rs_includes+=("--raw-line=use crate::native_image::common::*;") + fi + additional_args_var_name="IMG_${rust_name}_ADDITIONAL_ARGS" + if [[ ! -z "${!additional_args_var_name+x}" ]]; then + echo "Have additional args!" + additional_args_var_name="${additional_args_var_name}[@]" + rs_includes+=( "${!additional_args_var_name}" ) + fi + # We want to commit all generated files to version control, so we can easily see if something changed, + # when updating bindgen or the SDK patch release. + # However, we any split changes into incremental modules, and don't use any of the newer versions of the API + # besides the first one. If a binding was not introduced in the current api version, then we add a nopublish + # suffix, so we can exclude the file from cargo publish and save some download bandwidth. + no_publish_suffix="" + if [[ -f "${output_dir}/${rust_name}_api${PREVIOUS_API_VERSION}.rs" + || -f "${output_dir}/${rust_name}_api${PREVIOUS_API_VERSION}_nopublish.rs" ]]; then + no_publish_suffix="_nopublish" + fi + + # Note: block-listing `^std_.*` doesn't seem to work, perhaps the underscore replaces some other character. + bindgen "${BASE_BINDGEN_ARGS[@]}" \ + --default-enum-style=newtype \ + --allowlist-file ".*/${img_header}$" \ + --no-recursive-allowlist \ + "${rs_includes[@]}" \ + --no-derive-copy \ + --no-derive-debug \ + --no-prepend-enum-name \ + --output "${output_dir}/${rust_name}_api${OHOS_API_VERSION}${no_publish_suffix}.rs" \ + "${abs_img_header}" \ + -- "${BASE_CLANG_ARGS[@]}" \ + -x c++ done fi diff --git a/src/native_buffer/native_buffer_api12.rs b/src/native_buffer/native_buffer_api12.rs index 214f3aa..f24874a 100644 --- a/src/native_buffer/native_buffer_api12.rs +++ b/src/native_buffer/native_buffer_api12.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.69.4 */ +/* automatically generated by rust-bindgen 0.70.1 */ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] diff --git a/src/native_image/native_image_api12.rs b/src/native_image/native_image_api12.rs index 4112c51..8ca2116 100644 --- a/src/native_image/native_image_api12.rs +++ b/src/native_image/native_image_api12.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.69.4 */ +/* automatically generated by rust-bindgen 0.70.1 */ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] diff --git a/src/syscap/syscap_api12.rs b/src/syscap/syscap_api12.rs index 78bc105..58d3d41 100644 --- a/src/syscap/syscap_api12.rs +++ b/src/syscap/syscap_api12.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.69.4 */ +/* automatically generated by rust-bindgen 0.70.1 */ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] diff --git a/src/vsync/vsync_api12.rs b/src/vsync/vsync_api12.rs index 735eff6..372350a 100644 --- a/src/vsync/vsync_api12.rs +++ b/src/vsync/vsync_api12.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.70.0 */ +/* automatically generated by rust-bindgen 0.70.1 */ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)]