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
import (
"fmt"
"image"
"image/jpeg"
"log"
"os"
)
func exportJPEG(stitchedImage *StitchedImage, outputPath string) error {
func exportJPEG(stitchedImage image.Image, outputPath string) error {
log.Printf("Creating output file %q.", outputPath)
f, err := os.Create(outputPath)
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
import (
"fmt"
"image"
"image/png"
"log"
"os"
)
func exportPNG(stitchedImage *StitchedImage, outputPath string) error {
func exportPNG(stitchedImage image.Image, outputPath string) error {
log.Printf("Creating output file %q.", outputPath)
f, err := os.Create(outputPath)
if err != nil {