Effects
Effects add processing such as filters to drawing objects. Below are the implemented effects:
| 1 | 2 | 3 |
|---|---|---|
| Blur | Border | DropShadow |
| InnerShadow | Dilate | Erode |
| HueRotate | HighContrast | Lighting |
| LumaColor | Saturate | Transform |
| CvBlur | CvGaussianBlur | CvMedianBlur |
These are implemented using Skia and OpenCV, with some overlaps.
Effect Application Process
Effects are divided into three types:
- Image Filters
- Color Filters
- Custom Effects
Image filters include effects like Blur and DropShadow.
They are implemented using SkImageFilter.
Image filters can be combined with other image filters.
Color filters include effects like HueRotate and HighContrast.
They are implemented using SkColorFilter.
Color filters can also be converted into image filters.
Custom effects include effects like CvBlur that use other libraries. Applying custom effects requires rasterized images.
Example
Color Filter
Image Filter
Image Filter
Custom Effect
Custom Effect
These effects are optimized in the same flow as the actual process.
Convert color filters to image filters.
Image Filter
Image Filter
Image Filter
Custom Effect
Custom Effect
Combine image filters with other image filters.
Image Filter x3
Custom Effect
Custom Effect
Finally, apply the combined image filter x3, rasterize it, and then apply the custom effects to complete the process.
In practice, boundaries may change due to effects, and combining image filters may be deferred for caching purposes.