Documentation
¶
Index ¶
- type Processor
- func (p *Processor) CalculateOptimalCropBox(centerX, centerY float64, targetWidth, targetHeight, imgWidth, imgHeight int, ...) types.Box
- func (p *Processor) CreateDebugOverlay(img image.Image, modelBox, cropBox types.Box, cropCx, cropCy float64) image.Image
- func (p *Processor) CropImageToBox(img image.Image, box types.Box, targetWidth, targetHeight int) (image.Image, error)
- func (p *Processor) FindNearestPointToCenter(box types.Box) (float64, float64)
- func (p *Processor) LoadImage(path string) (image.Image, error)
- func (p *Processor) LoadImageFromURL(imageURL string) (image.Image, error)
- func (p *Processor) LoadImageSmart(source string) (image.Image, error)
- func (p *Processor) PrepareImageForModel(img image.Image, format string, maxDim int, quality int) (string, error)
- func (p *Processor) SaveImage(img image.Image, path, format string, quality int, lossless bool) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Processor ¶
type Processor struct{}
Processor handles image processing operations
func (*Processor) CalculateOptimalCropBox ¶
func (p *Processor) CalculateOptimalCropBox(centerX, centerY float64, targetWidth, targetHeight, imgWidth, imgHeight int, zoom float64) types.Box
CalculateOptimalCropBox calculates the optimal crop box for given aspect ratio centered at a point
func (*Processor) CreateDebugOverlay ¶
func (p *Processor) CreateDebugOverlay(img image.Image, modelBox, cropBox types.Box, cropCx, cropCy float64) image.Image
CreateDebugOverlay creates an overlay image showing detection and crop boxes
func (*Processor) CropImageToBox ¶
func (p *Processor) CropImageToBox(img image.Image, box types.Box, targetWidth, targetHeight int) (image.Image, error)
CropImageToBox crops an image to the specified normalized box
func (*Processor) FindNearestPointToCenter ¶
FindNearestPointToCenter finds the nearest point in a box to the image center
func (*Processor) LoadImageFromURL ¶
LoadImageFromURL downloads and loads an image from a URL
func (*Processor) LoadImageSmart ¶
LoadImageSmart loads an image from either a file path or URL
Click to show internal directories.
Click to hide internal directories.