Class ColorFilterOp
java.lang.Object
cloud.opencode.base.image.color.ColorFilterOp
Color Filter Operations
颜色滤镜操作工具类
Provides artistic color filter transformations including sepia tone and color inversion.
提供艺术色彩滤镜变换,包括怀旧棕褐色调和反色。
Features | 主要功能:
- Sepia (nostalgic brown tone) filter - 怀旧棕褐色滤镜
- Color inversion filter (preserving alpha) - 反色滤镜(保留 Alpha 通道)
Usage Examples | 使用示例:
Raster sepiaImage = ColorFilterOp.sepia(raster);
Raster invertedImage = ColorFilterOp.invert(raster);
Performance | 性能特性:
- Time: O(n) where n = pixel count - 时间: O(n),n 为像素数量
- Space: O(n) for output image - 空间: O(n) 用于输出图像
Security | 安全性:
- Thread-safe: Yes (stateless) - 线程安全: 是(无状态)
- Null-safe: No - 空值安全: 否
- Since:
- JDK 25, opencode-base-image V1.0.3
- Author:
- Leon Soo www.LeonSoo.com
- See Also:
-
Method Summary
-
Method Details
-
sepia
Apply sepia (nostalgic brown tone) filter to aRaster. 对Raster应用怀旧棕褐色滤镜。Uses the standard sepia tone matrix; alpha channel is preserved. Returns a freshly allocated
RGBA_8raster.使用标准棕褐色矩阵;保留 alpha 通道。返回新分配的
RGBA_8raster。- Parameters:
raster- the source raster | 源 raster- Returns:
- the sepia-filtered
RGBA_8raster | 应用棕褐色滤镜后的RGBA_8raster - Throws:
NullPointerException- if raster is null | 当 raster 为 null 时抛出- Since:
- opencode-base-image V1.0.4
-
invert
Apply color inversion filter to aRaster. 对Raster应用反色滤镜。Each RGB component is inverted:
newVal = 255 - oldVal; alpha channel is preserved. Returns a freshly allocatedRGBA_8raster.每个 RGB 分量被反转:
newVal = 255 - oldVal;保留 alpha 通道。 返回新分配的RGBA_8raster。- Parameters:
raster- the source raster | 源 raster- Returns:
- the color-inverted
RGBA_8raster | 反色后的RGBA_8raster - Throws:
NullPointerException- if raster is null | 当 raster 为 null 时抛出- Since:
- opencode-base-image V1.0.4
-