Abstract
Base class for creating custom post-processing operations
Extend this class and implement the run method. Instance properties can store state.
run
class CustomOp extends BaseOp { async run(ctx, w, h, params) { ctx.fillStyle = params.color || 'red'; ctx.fillRect(0, 0, w, h); }} Copy
class CustomOp extends BaseOp { async run(ctx, w, h, params) { ctx.fillStyle = params.color || 'red'; ctx.fillRect(0, 0, w, h); }}
Create a new operation
Optional
Optional identifier for debugging
Unique identifier or descriptive name
Execute the post-processing operation
Canvas 2D rendering context
Width in CSS pixels
Height in CSS pixels
Query parameters from the image request
Base class for creating custom post-processing operations
Extend this class and implement the
runmethod. Instance properties can store state.Example