Function vizia::vg::gpu::images::subset_texture_from
pub fn subset_texture_from(
context: &mut RCHandle<GrDirectContext>,
image: &RCHandle<SkImage>,
subset: impl AsRef<IRect>,
) -> Option<RCHandle<SkImage>>
Expand description
Returns subset of this image as a texture-backed image.
Returns None
if any of the following are true:
- Subset is empty
- Subset is not contained inside the image’s bounds
- Pixels in the source image could not be read or copied
- The source image is texture-backed and context does not match the source image’s context.
context
- theDirectContext
to which the subset should be uploaded.subset
- bounds of returnedImage
Returns: the subsetted image, uploaded as a texture, orNone