Files
kitty/tools/utils/images/to_rgb.go
Kovid Goyal 1e6d67b975 Update to the latest version of imaging
Gives us a bunch of new features and allows us to move a bunch of code
into imaging
2025-11-06 22:31:31 +05:30

24 lines
504 B
Go

// License: GPLv3 Copyright: 2023, Kovid Goyal, <kovid at kovidgoyal.net>
package images
import (
"fmt"
"image"
"github.com/kovidgoyal/imaging"
"github.com/kovidgoyal/imaging/nrgb"
)
var _ = fmt.Print
func (self *Context) paste_nrgb_onto_opaque(background *imaging.NRGB, img image.Image, pos image.Point, bgcol *imaging.NRGBColor) {
bg := imaging.NRGBColor{}
if bgcol != nil {
bg = *bgcol
}
src := nrgb.NewNRGBScanner(img, bg)
self.run_paste(src, background, pos, func(dst []byte) {})
}