mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-04 02:39:28 +00:00
C++: Generate image texture data for software renderer
This commit is contained in:
parent
b2ebac63c2
commit
ccf3e8e9e9
6 changed files with 117 additions and 33 deletions
|
@ -203,6 +203,7 @@ fn gen_corelib(
|
|||
"slint_image_path",
|
||||
"slint_image_load_from_path",
|
||||
"slint_image_load_from_embedded_data",
|
||||
"slint_image_from_embedded_textures",
|
||||
"Coord",
|
||||
"LogicalRect",
|
||||
"LogicalPoint",
|
||||
|
@ -272,6 +273,7 @@ fn gen_corelib(
|
|||
"slint_image_path",
|
||||
"slint_image_load_from_path",
|
||||
"slint_image_load_from_embedded_data",
|
||||
"slint_image_from_embedded_textures",
|
||||
"SharedPixelBuffer",
|
||||
"SharedImageBuffer",
|
||||
"StaticTextures",
|
||||
|
@ -333,6 +335,7 @@ fn gen_corelib(
|
|||
"slint_image_path",
|
||||
"slint_image_load_from_path",
|
||||
"slint_image_load_from_embedded_data",
|
||||
"slint_image_from_embedded_textures",
|
||||
]
|
||||
.iter()
|
||||
.filter(|exclusion| !rust_types.iter().any(|inclusion| inclusion == *exclusion))
|
||||
|
|
|
@ -74,6 +74,13 @@ inline Image load_image_from_embedded_data(std::span<const uint8_t> data,
|
|||
&img);
|
||||
return Image(img);
|
||||
}
|
||||
|
||||
inline Image image_from_embedded_textures(const cbindgen_private::types::StaticTextures *textures)
|
||||
{
|
||||
cbindgen_private::types::Image img(cbindgen_private::types::Image::ImageInner_None());
|
||||
cbindgen_private::types::slint_image_from_embedded_textures(textures, &img);
|
||||
return Image(img);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue