From 47f58553cf96b0b1e45855826fde08e0dc582a20 Mon Sep 17 00:00:00 2001 From: David Vogel Date: Sun, 18 Oct 2020 21:18:43 +0200 Subject: [PATCH] Fix some stuff - Mark mod as compatible - Change mod description - Update go version - Speed up image stitching 2x - Fix stitching progress bar --- .travis.yml | 2 +- bin/stitch/medianBlendedImage.go | 8 ++++++++ compatibility.xml | 3 +++ mod.xml | 2 +- 4 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 compatibility.xml diff --git a/.travis.yml b/.travis.yml index d9c3aad..b6d7ce1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: go go: - - "1.14.x" + - "1.15.x" env: - GO111MODULE=on diff --git a/bin/stitch/medianBlendedImage.go b/bin/stitch/medianBlendedImage.go index 26d8071..9efc2e9 100644 --- a/bin/stitch/medianBlendedImage.go +++ b/bin/stitch/medianBlendedImage.go @@ -72,6 +72,14 @@ func (mbi *MedianBlendedImage) At(x, y int) color.Color { return mbi.cachedRow.RGBAAt(x, y) } +// Opaque returns whether the image is fully opaque. +// +// For more speed and smaller filesizes, MedianBlendedImage will be marked as non-transparent. +// This will speed up image saving by 2x, as there is no need to iterate over the whole image to find a single non opaque pixel. +func (mbi *MedianBlendedImage) Opaque() bool { + return true +} + // Progress returns the approximate progress of any process that scans the image from top to bottom. func (mbi *MedianBlendedImage) Progress() (value, max int) { size := mbi.Bounds().Size() diff --git a/compatibility.xml b/compatibility.xml new file mode 100644 index 0000000..5c12f37 --- /dev/null +++ b/compatibility.xml @@ -0,0 +1,3 @@ + + diff --git a/mod.xml b/mod.xml index ac6fab0..1c5b0a6 100644 --- a/mod.xml +++ b/mod.xml @@ -1,4 +1,4 @@ \ No newline at end of file