Interface ImageOperation
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Image Operation
图片操作函数接口
Functional interface for Raster operations with exception handling.
带异常处理的 Raster 操作函数接口。
Usage Examples | 使用示例:
ImageOperation op = raster -> ResizeOp.resize(raster, 800, 600);
Raster result = op.apply(sourceRaster);
// Chain operations
ImageOperation chain = op1.andThen(op2).andThen(op3);
Features | 主要功能:
- Functional interface for raster transformations - raster 变换的函数接口
- Chainable via andThen composition - 通过 andThen 组合可链式调用
- Exception-aware apply method - 支持异常的 apply 方法
Security | 安全性:
- Thread-safe: Yes (stateless functional interface) - 线程安全: 是(无状态函数接口)
- Null-safe: No (throws on null raster) - 空值安全: 否(null raster 抛异常)
- Since:
- JDK 25, opencode-base-image V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault ImageOperationandThen(ImageOperation after) Chain with another operation 与另一个操作链接Apply operation to raster 应用操作到 rasterdefault ImageOperationcompose(ImageOperation before) Compose with another operation 与另一个操作组合static ImageOperationidentity()Create identity operation (returns input unchanged) 创建恒等操作(返回不变的输入)static ImageOperationwithTimeout(ImageOperation operation, long timeoutMs) Wrap operation with timeout handling 使用超时处理包装操作
-
Method Details
-
apply
-
andThen
Chain with another operation 与另一个操作链接- Parameters:
after- the next operation | 下一个操作- Returns:
- the combined operation | 组合后的操作
-
compose
Compose with another operation 与另一个操作组合- Parameters:
before- the previous operation | 前一个操作- Returns:
- the combined operation | 组合后的操作
-
identity
Create identity operation (returns input unchanged) 创建恒等操作(返回不变的输入)- Returns:
- the identity operation | 恒等操作
-
withTimeout
Wrap operation with timeout handling 使用超时处理包装操作- Parameters:
operation- the operation | 操作timeoutMs- timeout in milliseconds | 超时时间(毫秒)- Returns:
- the wrapped operation | 包装后的操作
-