Documentation ¶
Index ¶
- Variables
- func Encode(w io.Writer, m image.Image, jpgOptions *jpeg.Options, gifOptions *gif.Options) error
- type SuperImage
- func Blur(img image.Image, radio int) (*SuperImage, error)
- func Decode(r io.Reader, format string) (*SuperImage, error)
- func Flip(img image.Image) *SuperImage
- func GetByFile(filename string) (*SuperImage, error)
- func GetByURL(link string) (*SuperImage, error)
- func Negative(img image.Image) *SuperImage
- func New(im image.Image, format string) *SuperImage
- func Opacity(img image.Image, op float64) (*SuperImage, error)
- func Reflect(img image.Image) *SuperImage
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidOpacity = errors.New("opacity must be between 0 and 1")
var ErrNegativeRadio = errors.New("radio must be higher than 0")
Functions ¶
Types ¶
type SuperImage ¶
SuperImage is an image.Image implementation
func Blur ¶
func Blur(img image.Image, radio int) (*SuperImage, error)
Blur blurs an image by a given radio. If the radio is negative or bigger than the image's width or height, it returns an error. Radio 0 returns the original image without any change.
References: https://relate.cs.illinois.edu/course/cs357-f15/file-version/03473f64afb954c74c02e8988f518de3eddf49a4/media/00-python-numpy/Image%20Blurring.html | http://arantxa.ii.uam.es/~jms/pfcsteleco/lecturas/20081215IreneBlasco.pdf
func Decode ¶
func Decode(r io.Reader, format string) (*SuperImage, error)
Decode decodes an image from r using the specified format (png, jpg, jpeg, gif).
func Flip ¶
func Flip(img image.Image) *SuperImage
Flip inverts the image horizontally returning a new *SuperImage.
func GetByFile ¶
func GetByFile(filename string) (*SuperImage, error)
GetByFile gets an image from a current project file.
func GetByURL ¶
func GetByURL(link string) (*SuperImage, error)
GetByURL gets an image from an URL with an http GET request.
func Reflect ¶
func Reflect(img image.Image) *SuperImage
Reflect inverts the image vertically returning a new *SuperImage.
func (SuperImage) Format ¶
func (si SuperImage) Format() string