Code to convert images to NRGB

This commit is contained in:
Kovid Goyal
2023-01-02 15:22:41 +05:30
parent 143fd6e4dd
commit d192dcb0d7
2 changed files with 259 additions and 3 deletions

View File

@@ -5,7 +5,6 @@ package icat
import (
"errors"
"fmt"
"image/color"
"os"
"runtime"
"strconv"
@@ -19,6 +18,7 @@ import (
"kitty/tools/tui/graphics"
"kitty/tools/tui/loop"
"kitty/tools/utils"
"kitty/tools/utils/images"
"kitty/tools/utils/shm"
"kitty/tools/utils/style"
)
@@ -33,7 +33,7 @@ var opts *Options
var lp *loop.Loop
var place *Place
var z_index int32
var remove_alpha *color.NRGBA
var remove_alpha *images.NRGBColor
var flip, flop bool
type transfer_mode int
@@ -72,7 +72,7 @@ func parse_background() (err error) {
if err != nil {
return fmt.Errorf("Invalid value for --background: %w", err)
}
remove_alpha = &color.NRGBA{col.Red, col.Green, col.Blue, 255}
remove_alpha = &images.NRGBColor{col.Red, col.Green, col.Blue}
return
}