use suffix _rect instead of _partial for functions that use rects to specify image / bitmap transformation rectangles
@@ -9,8 +9,7 @@ impl ImageSource {
ImageFilter::from_ptr(unsafe { C_SkImageSource_Make(image.shared_native()) })
}
- // TODO: improve naming of that function?
- pub fn from_image_partial<SR: AsRef<Rect>, DR: AsRef<Rect>>(
+ pub fn from_image_rect<SR: AsRef<Rect>, DR: AsRef<Rect>>(
image: &Image,
src_rect: SR,
dst_rect: DR,
@@ -32,14 +31,13 @@ impl RCHandle<SkImageFilter> {
ImageSource::from_image(image)
}
- // TODO: improve naming of that function?
- pub fn from_image_partial<SR: AsRef<Rect>, DR: AsRef<Rect>>(
+ pub fn from_image_rect<SR: AsRef<Rect>, DR: AsRef<Rect>>(
image: &Image,
src_rect: SR,
dst_rect: DR,
filter_quality: FilterQuality,
) -> Option<Self> {
- ImageSource::from_image_partial(image, src_rect, dst_rect, filter_quality)
+ ImageSource::from_image_rect(image, src_rect, dst_rect, filter_quality)
}
}
@@ -48,13 +46,12 @@ impl RCHandle<SkImage> {
ImageSource::from_image(self)
}
- // TODO: improve naming of that function?
- pub fn as_filter_partial<SR: AsRef<Rect>, DR: AsRef<Rect>>(
+ pub fn as_filter_rect<SR: AsRef<Rect>, DR: AsRef<Rect>>(
&self,
src_rect: SR,
dst_rect: DR,
filter_quality: FilterQuality,
) -> Option<ImageFilter> {
- ImageSource::from_image_partial(self, src_rect, dst_rect, filter_quality)
+ ImageSource::from_image_rect(self, src_rect, dst_rect, filter_quality)
}
}
