Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Bindings for Native Image Kit #39

Merged
merged 7 commits into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
2 changes: 1 addition & 1 deletion components/deviceinfo/src/deviceinfo_api12.rs
Original file line number Diff line number Diff line change
@@ -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)]
Expand Down
2 changes: 1 addition & 1 deletion components/drawing/src/bitmap/bitmap_api12_nopublish.rs
Original file line number Diff line number Diff line change
@@ -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)]
Expand Down
2 changes: 1 addition & 1 deletion components/drawing/src/brush/brush_api12_nopublish.rs
Original file line number Diff line number Diff line change
@@ -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)]
Expand Down
2 changes: 1 addition & 1 deletion components/drawing/src/canvas/canvas_api12_nopublish.rs
Original file line number Diff line number Diff line change
@@ -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)]
Expand Down
2 changes: 1 addition & 1 deletion components/drawing/src/color/color_api12_nopublish.rs
Original file line number Diff line number Diff line change
@@ -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)]
Expand Down
Original file line number Diff line number Diff line change
@@ -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)]
Expand Down
2 changes: 1 addition & 1 deletion components/drawing/src/color_space/color_space_api12.rs
Original file line number Diff line number Diff line change
@@ -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)]
Expand Down
2 changes: 1 addition & 1 deletion components/drawing/src/error_code/error_code_api12.rs
Original file line number Diff line number Diff line change
@@ -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)]
Expand Down
2 changes: 1 addition & 1 deletion components/drawing/src/filter/filter_api12_nopublish.rs
Original file line number Diff line number Diff line change
@@ -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)]
Expand Down
2 changes: 1 addition & 1 deletion components/drawing/src/font/font_api12_nopublish.rs
Original file line number Diff line number Diff line change
@@ -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)]
Expand Down
Original file line number Diff line number Diff line change
@@ -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)]
Expand Down
2 changes: 1 addition & 1 deletion components/drawing/src/font_mgr/font_mgr_api12.rs
Original file line number Diff line number Diff line change
@@ -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)]
Expand Down
2 changes: 1 addition & 1 deletion components/drawing/src/gpu_context/gpu_context_api12.rs
Original file line number Diff line number Diff line change
@@ -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)]
Expand Down
2 changes: 1 addition & 1 deletion components/drawing/src/image/image_api12.rs
Original file line number Diff line number Diff line change
@@ -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)]
Expand Down
2 changes: 1 addition & 1 deletion components/drawing/src/image_filter/image_filter_api12.rs
Original file line number Diff line number Diff line change
@@ -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)]
Expand Down
Original file line number Diff line number Diff line change
@@ -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)]
Expand Down
2 changes: 1 addition & 1 deletion components/drawing/src/matrix/matrix_api12_nopublish.rs
Original file line number Diff line number Diff line change
@@ -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)]
Expand Down
Original file line number Diff line number Diff line change
@@ -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)]
Expand Down
2 changes: 1 addition & 1 deletion components/drawing/src/path/path_api12_nopublish.rs
Original file line number Diff line number Diff line change
@@ -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)]
Expand Down
2 changes: 1 addition & 1 deletion components/drawing/src/path_effect/path_effect_api12.rs
Original file line number Diff line number Diff line change
@@ -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)]
Expand Down
2 changes: 1 addition & 1 deletion components/drawing/src/pen/pen_api12_nopublish.rs
Original file line number Diff line number Diff line change
@@ -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)]
Expand Down
2 changes: 1 addition & 1 deletion components/drawing/src/pixel_map/pixel_map_api12.rs
Original file line number Diff line number Diff line change
@@ -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)]
Expand Down
2 changes: 1 addition & 1 deletion components/drawing/src/point/point_api12_nopublish.rs
Original file line number Diff line number Diff line change
@@ -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)]
Expand Down
2 changes: 1 addition & 1 deletion components/drawing/src/rect/rect_api12_nopublish.rs
Original file line number Diff line number Diff line change
@@ -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)]
Expand Down
2 changes: 1 addition & 1 deletion components/drawing/src/region/region_api12.rs
Original file line number Diff line number Diff line change
@@ -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)]
Expand Down
Original file line number Diff line number Diff line change
@@ -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)]
Expand Down
Original file line number Diff line number Diff line change
@@ -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)]
Expand Down
Original file line number Diff line number Diff line change
@@ -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)]
Expand Down
Original file line number Diff line number Diff line change
@@ -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)]
Expand Down
2 changes: 1 addition & 1 deletion components/drawing/src/shadow_layer/shadow_layer_api12.rs
Original file line number Diff line number Diff line change
@@ -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)]
Expand Down
2 changes: 1 addition & 1 deletion components/drawing/src/surface/surface_api12.rs
Original file line number Diff line number Diff line change
@@ -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)]
Expand Down
Original file line number Diff line number Diff line change
@@ -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)]
Expand Down
Original file line number Diff line number Diff line change
@@ -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)]
Expand Down
Original file line number Diff line number Diff line change
@@ -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)]
Expand Down
Original file line number Diff line number Diff line change
@@ -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)]
Expand Down
2 changes: 1 addition & 1 deletion components/drawing/src/types/types_api12_nopublish.rs
Original file line number Diff line number Diff line change
@@ -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)]
Expand Down
Original file line number Diff line number Diff line change
@@ -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)]
Expand Down
2 changes: 1 addition & 1 deletion components/inputmethod/src/controller/controller_api12.rs
Original file line number Diff line number Diff line change
@@ -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)]
Expand Down
Original file line number Diff line number Diff line change
@@ -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)]
Expand Down
Original file line number Diff line number Diff line change
@@ -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)]
Expand Down
Original file line number Diff line number Diff line change
@@ -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)]
Expand Down
Original file line number Diff line number Diff line change
@@ -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)]
Expand Down
Original file line number Diff line number Diff line change
@@ -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)]
Expand Down
Original file line number Diff line number Diff line change
@@ -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)]
Expand Down
2 changes: 1 addition & 1 deletion components/inputmethod/src/types/types_api12.rs
Original file line number Diff line number Diff line change
@@ -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)]
Expand Down
46 changes: 46 additions & 0 deletions components/multimedia/image_framework/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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
24 changes: 24 additions & 0 deletions components/multimedia/image_framework/src/lib.rs
Original file line number Diff line number Diff line change
@@ -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;
10 changes: 10 additions & 0 deletions components/multimedia/image_framework/src/native_image.rs
Original file line number Diff line number Diff line change
@@ -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;
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
//! Common enum and struct declarations used by the image interface
//!
//! <https://docs.openharmony.cn/pages/v5.0/en/application-dev/reference/apis-image-kit/image__common_8h.md>

#[path = "image_common/image_common_api12.rs"]
mod image_common_api12;
pub use image_common_api12::*;
Loading