Documentation ¶
Index ¶
- func Grayscale(src *image.NRGBA) *image.NRGBA
- func Resize(s SeamCarver, img *image.NRGBA) (image.Image, error)
- func SobelFilter(img *image.NRGBA, threshold float64) *image.NRGBA
- func Stackblur(img *image.NRGBA, width, height, radius uint32) *image.NRGBA
- type ActiveSeam
- type Carver
- func (c *Carver) AddSeam(img *image.NRGBA, seams []Seam, debug bool) *image.NRGBA
- func (c *Carver) ComputeSeams(img *image.NRGBA, p *Processor) []float64
- func (c *Carver) FindLowestEnergySeams() []Seam
- func (c *Carver) RemoveSeam(img *image.NRGBA, seams []Seam, debug bool) *image.NRGBA
- func (c *Carver) RotateImage270(src *image.NRGBA) *image.NRGBA
- func (c *Carver) RotateImage90(src *image.NRGBA) *image.NRGBA
- type Processor
- type Seam
- type SeamCarver
- type UsedSeams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SobelFilter ¶
Detect image edges. See https://en.wikipedia.org/wiki/Sobel_operator
Types ¶
type ActiveSeam ¶
Struct containing the current seam color and position.
type Carver ¶
func (*Carver) ComputeSeams ¶
Compute the minimum energy level based on the following logic:
traverse the image from the second row to the last row and compute the cumulative minimum energy M for all possible connected seams for each entry (i, j).
the minimum energy level is calculated by summing up the current pixel value with the minimum pixel value of the neighboring pixels from the previous row.
func (*Carver) FindLowestEnergySeams ¶
Find the lowest vertical energy seam.
func (*Carver) RemoveSeam ¶
Remove the least important columns based on the stored energy seams level.
func (*Carver) RotateImage270 ¶
Rotate image by 270 degree counter clockwise
type Processor ¶
type Processor struct { SobelThreshold int BlurRadius int NewWidth int NewHeight int Percentage bool Debug bool }
Processor options
type SeamCarver ¶
SeamCarver is an interface that Carver uses to implement the Resize function. It takes an image and the output as parameters and returns the resized image.
type UsedSeams ¶
type UsedSeams struct {
ActiveSeam []ActiveSeam
}
Struct containing the generated seams.