C++: Generate image texture data for software renderer

This commit is contained in:
Olivier Goffart 2022-12-08 16:38:37 +01:00
parent b2ebac63c2
commit ccf3e8e9e9
6 changed files with 117 additions and 33 deletions

View file

@ -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))

View file

@ -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);
}
}
}