| 1 | package libwebp |
| 2 | |
| 3 | import ( |
| 4 | "image" |
| 5 | "io" |
| 6 | |
| 7 | "github.com/bep/gowebp/libwebp/webpoptions" |
| 8 | |
| 9 | "github.com/bep/gowebp/internal/libwebp" |
| 10 | ) |
| 11 | |
| 12 | // Encode encodes src as Webp into w using the options in o. |
| 13 | // |
| 14 | // Any src that isn't one of *image.RGBA, *image.NRGBA, or *image.Gray |
| 15 | // will be converted to *image.NRGBA using draw.Draw first. |
| 16 | func Encode(w io.Writer, src image.Image, o webpoptions.EncodingOptions) error { |
| 17 | return libwebp.Encode(w, src, o) |
| 18 | } |