File: encode.go

package info (click to toggle)
golang-github-bep-gowebp 0.3.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 6,660 kB
  • sloc: ansic: 76,136; sh: 1,085; makefile: 585; python: 416; cpp: 262
file content (19 lines) | stat: -rw-r--r-- 448 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package libwebp

import (
	"image"
	"io"

	"github.com/bep/gowebp/libwebp/webpoptions"

	"github.com/bep/gowebp/internal/libwebp"
)

// Encode encodes src as Webp into w using the options in o.
//
// Any src that isn't one of *image.RGBA, *image.NRGBA, or *image.Gray
// will be converted to *image.NRGBA using draw.Draw first.
//
func Encode(w io.Writer, src image.Image, o webpoptions.EncodingOptions) error {
	return libwebp.Encode(w, src, o)
}