Change export functions to use image.Image

This commit is contained in:
David Vogel 2023-12-23 01:09:23 +01:00
parent 182373d3cc
commit a0168df91f
2 changed files with 14 additions and 2 deletions

View File

@ -1,13 +1,19 @@
// Copyright (c) 2023 David Vogel
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT
package main package main
import ( import (
"fmt" "fmt"
"image"
"image/jpeg" "image/jpeg"
"log" "log"
"os" "os"
) )
func exportJPEG(stitchedImage *StitchedImage, outputPath string) error { func exportJPEG(stitchedImage image.Image, outputPath string) error {
log.Printf("Creating output file %q.", outputPath) log.Printf("Creating output file %q.", outputPath)
f, err := os.Create(outputPath) f, err := os.Create(outputPath)
if err != nil { if err != nil {

View File

@ -1,13 +1,19 @@
// Copyright (c) 2023 David Vogel
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT
package main package main
import ( import (
"fmt" "fmt"
"image"
"image/png" "image/png"
"log" "log"
"os" "os"
) )
func exportPNG(stitchedImage *StitchedImage, outputPath string) error { func exportPNG(stitchedImage image.Image, outputPath string) error {
log.Printf("Creating output file %q.", outputPath) log.Printf("Creating output file %q.", outputPath)
f, err := os.Create(outputPath) f, err := os.Create(outputPath)
if err != nil { if err != nil {