Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Filter ¶
type Filter func(*ProcessingContext) error
Filter is a function that modifies the ProcessingContext.
func Resize ¶
Resize resizes the image to the specified width and height. If one of width or height is 0, it preserves aspect ratio if the underlying library supports it (nfnt/resize does).
func ResizeAspectRatio ¶
ResizeAspectRatio resizes the image to fit within the specified width and height while maintaining aspect ratio. If keepRatio is false, it forces the dimensions to exact width and height. If keepRatio is true, it scales the image such that it fits within width x height, preserving the original aspect ratio.
func ValidateRatio ¶
ValidateRatio validates if the image aspect ratio matches the expected ratio. Supported ratios: "1:1", "16:9", "9:16".
type ImageProcessor ¶
type ImageProcessor struct {
// contains filtered or unexported fields
}
ImageProcessor handles the image processing pipeline.
func NewImageProcessor ¶
func NewImageProcessor() *ImageProcessor
NewImageProcessor creates a new instance of ImageProcessor.
func (*ImageProcessor) AddFilter ¶
func (p *ImageProcessor) AddFilter(filters ...Filter) *ImageProcessor
AddFilter adds filters to the processing pipeline and returns a new ImageProcessor instance. It does not modify the current instance.