Bump version of imaging

This commit is contained in:
Kovid Goyal
2025-10-11 13:17:15 +05:30
parent 3ba6c3f4b9
commit 4c0c5c01f2
8 changed files with 36 additions and 186 deletions

View File

@@ -11,12 +11,12 @@ import (
"sync/atomic"
"time"
"github.com/kovidgoyal/imaging"
"github.com/kovidgoyal/kitty/tools/cli"
"github.com/kovidgoyal/kitty/tools/tty"
"github.com/kovidgoyal/kitty/tools/tui"
"github.com/kovidgoyal/kitty/tools/tui/graphics"
"github.com/kovidgoyal/kitty/tools/utils"
"github.com/kovidgoyal/kitty/tools/utils/images"
"github.com/kovidgoyal/kitty/tools/utils/style"
"golang.org/x/sys/unix"
@@ -31,7 +31,7 @@ type Place struct {
var opts *Options
var place *Place
var z_index int32
var remove_alpha *images.NRGBColor
var remove_alpha *imaging.NRGBColor
var flip, flop bool
type transfer_mode int
@@ -68,7 +68,7 @@ func parse_background() (err error) {
if err != nil {
return fmt.Errorf("Invalid value for --background: %w", err)
}
remove_alpha = &images.NRGBColor{R: col.Red, G: col.Green, B: col.Blue}
remove_alpha = &imaging.NRGBColor{R: col.Red, G: col.Green, B: col.Blue}
return
}

View File

@@ -49,13 +49,13 @@ func add_frame(ctx *images.Context, imgd *image_data, img image.Image) *image_fr
bytes_per_pixel := 4
if is_opaque || remove_alpha != nil {
var rgb *images.NRGB
var rgb *imaging.NRGB
bytes_per_pixel = 3
m, err := shm.CreateTemp(shm_template, uint64(f.width*f.height*bytes_per_pixel))
if err != nil {
rgb = images.NewNRGB(dest_rect)
rgb = imaging.NewNRGB(dest_rect)
} else {
rgb = &images.NRGB{Pix: m.Slice(), Stride: bytes_per_pixel * f.width, Rect: dest_rect}
rgb = &imaging.NRGB{Pix: m.Slice(), Stride: bytes_per_pixel * f.width, Rect: dest_rect}
f.shm = m
}
f.transmission_format = graphics.GRT_format_rgb