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 ¶
SobelFilter detects image edges. See https://en.wikipedia.org/wiki/Sobel_operator
Types ¶
type ActiveSeam ¶
ActiveSeam contains the current seam color and position.
type Carver ¶
Carver struct having as parameters the new image width and height and and also the seam points.
func (*Carver) ComputeSeams ¶
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 ¶
FindLowestEnergySeams find the lowest vertical energy seam.
func (*Carver) RemoveSeam ¶
RemoveSeam remove the least important columns based on the stored energy seams level.
func (*Carver) RotateImage270 ¶
RotateImage270 rotate the image by 270 degree counter clockwise.
type Processor ¶
type Processor struct { SobelThreshold int BlurRadius int NewWidth int NewHeight int Percentage bool Square 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
}
UsedSeams contains the already generated seams.