Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
hmmftg committed Sep 11, 2023
1 parent 491771c commit 5bf2ede
Show file tree
Hide file tree
Showing 45 changed files with 98 additions and 104 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Go Images

[![Go Reference](https://pkg.go.dev/badge/golang.org/x/image.svg)](https://pkg.go.dev/golang.org/x/image)
[![Go Reference](https://pkg.go.dev/badge/github.com/hmmftg/image.svg)](https://pkg.go.dev/github.com/hmmftg/image)

This repository holds supplementary Go image libraries.

## Download/Install

The easiest way to install is to run `go get -u golang.org/x/image/...`. You can
also manually git clone the repository to `$GOPATH/src/golang.org/x/image`.
The easiest way to install is to run `go get -u github.com/hmmftg/image/...`. You can
also manually git clone the repository to `$GOPATH/src/github.com/hmmftg/image`.

## Report Issues / Send Patches

Expand Down
2 changes: 1 addition & 1 deletion bmp/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Package bmp implements a BMP image decoder and encoder.
//
// The BMP specification is at http://www.digicamsoft.com/bmp/bmp.html.
package bmp // import "golang.org/x/image/bmp"
package bmp // import "github.com/hmmftg/image/bmp"

import (
"errors"
Expand Down
6 changes: 3 additions & 3 deletions cmd/webp-manual-test/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
//go:build ignore
// +build ignore

// This build tag means that "go install golang.org/x/image/..." doesn't
// This build tag means that "go install github.com/hmmftg/image/..." doesn't
// install this manual test. Use "go run main.go" to explicitly run it.

// Program webp-manual-test checks that the Go WEBP library's decodings match
// the C WEBP library's.
package main // import "golang.org/x/image/cmd/webp-manual-test"
package main // import "github.com/hmmftg/image/cmd/webp-manual-test"

import (
"bytes"
Expand All @@ -26,7 +26,7 @@ import (
"sort"
"strings"

"golang.org/x/image/webp"
"github.com/hmmftg/image/webp"
)

var (
Expand Down
4 changes: 2 additions & 2 deletions draw/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import (
"math"
"os"

"golang.org/x/image/draw"
"golang.org/x/image/math/f64"
"github.com/hmmftg/image/draw"
"github.com/hmmftg/image/math/f64"
)

func ExampleDraw() {
Expand Down
2 changes: 1 addition & 1 deletion draw/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func main() {
"\"image/color\"\n" +
"\"math\"\n" +
"\n" +
"\"golang.org/x/image/math/f64\"\n" +
"\"github.com/hmmftg/image/math/f64\"\n" +
")\n")

gen(w, "nnInterpolator", codeNNScaleLeaf, codeNNTransformLeaf)
Expand Down
2 changes: 1 addition & 1 deletion draw/impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"image/color"
"math"

"golang.org/x/image/math/f64"
"github.com/hmmftg/image/math/f64"
)

func (z nnInterpolator) Scale(dst Image, dr image.Rectangle, src image.Image, sr image.Rectangle, op Op, opts *Options) {
Expand Down
2 changes: 1 addition & 1 deletion draw/scale.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"math"
"sync"

"golang.org/x/image/math/f64"
"github.com/hmmftg/image/math/f64"
)

// Copy copies the part of the source image defined by src and sr and writes
Expand Down
6 changes: 3 additions & 3 deletions draw/scale_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
"reflect"
"testing"

"golang.org/x/image/math/f64"
"github.com/hmmftg/image/math/f64"

_ "image/jpeg"
)
Expand Down Expand Up @@ -213,8 +213,8 @@ func BenchmarkSimpleTransformScale(b *testing.B) {
func TestOps(t *testing.T) {
blue := image.NewUniform(color.RGBA{0x00, 0x00, 0xff, 0xff})
testCases := map[Op]color.RGBA{
Over: color.RGBA{0x7f, 0x00, 0x80, 0xff},
Src: color.RGBA{0x7f, 0x00, 0x00, 0x7f},
Over: {0x7f, 0x00, 0x80, 0xff},
Src: {0x7f, 0x00, 0x00, 0x7f},
}
for op, want := range testCases {
dst := image.NewRGBA(image.Rect(0, 0, 2, 2))
Expand Down
8 changes: 4 additions & 4 deletions example/font/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
//go:build example
// +build example

// This build tag means that "go install golang.org/x/image/..." doesn't
// This build tag means that "go install github.com/hmmftg/image/..." doesn't
// install this example program. Use "go run main.go" to run it or "go install
// -tags=example" to install it.

Expand All @@ -24,9 +24,9 @@ import (
"path/filepath"
"strings"

"golang.org/x/image/font"
"golang.org/x/image/font/plan9font"
"golang.org/x/image/math/fixed"
"github.com/hmmftg/image/font"
"github.com/hmmftg/image/font/plan9font"
"github.com/hmmftg/image/math/fixed"
)

var (
Expand Down
6 changes: 3 additions & 3 deletions font/basicfont/basicfont.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
//go:generate go run gen.go

// Package basicfont provides fixed-size font faces.
package basicfont // import "golang.org/x/image/font/basicfont"
package basicfont // import "github.com/hmmftg/image/font/basicfont"

import (
"image"

"golang.org/x/image/font"
"golang.org/x/image/math/fixed"
"github.com/hmmftg/image/font"
"github.com/hmmftg/image/math/fixed"
)

// Range maps a contiguous range of runes to vertically adjacent sub-images of
Expand Down
2 changes: 1 addition & 1 deletion font/basicfont/basicfont_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"image"
"testing"

"golang.org/x/image/font"
"github.com/hmmftg/image/font"
)

func TestMetrics(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions font/basicfont/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ import (
"path"
"path/filepath"

"golang.org/x/image/font"
"golang.org/x/image/font/plan9font"
"golang.org/x/image/math/fixed"
"github.com/hmmftg/image/font"
"github.com/hmmftg/image/font/plan9font"
"github.com/hmmftg/image/math/fixed"
)

func main() {
Expand Down
4 changes: 2 additions & 2 deletions font/font.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
//
// Other packages provide font face implementations. For example, a truetype
// package would provide one based on .ttf font files.
package font // import "golang.org/x/image/font"
package font // import "github.com/hmmftg/image/font"

import (
"image"
"image/draw"
"io"
"unicode/utf8"

"golang.org/x/image/math/fixed"
"github.com/hmmftg/image/math/fixed"
)

// TODO: who is responsible for caches (glyph images, glyph indices, kerns)?
Expand Down
2 changes: 1 addition & 1 deletion font/font_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"strings"
"testing"

"golang.org/x/image/math/fixed"
"github.com/hmmftg/image/math/fixed"
)

const toyAdvance = fixed.Int26_6(10 << 6)
Expand Down
2 changes: 1 addition & 1 deletion font/inconsolata/bold8x16.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package inconsolata
import (
"image"

"golang.org/x/image/font/basicfont"
"github.com/hmmftg/image/font/basicfont"
)

// bold8x16 contains 289 10×17 glyphs in 49130 Pix bytes.
Expand Down
4 changes: 2 additions & 2 deletions font/inconsolata/inconsolata.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
//
// Inconsolata's home page is at
// http://www.levien.com/type/myfonts/inconsolata.html
package inconsolata // import "golang.org/x/image/font/inconsolata"
package inconsolata // import "github.com/hmmftg/image/font/inconsolata"

import (
"golang.org/x/image/font/basicfont"
"github.com/hmmftg/image/font/basicfont"
)

// Regular8x16 is a regular weight, 8x16 font face.
Expand Down
2 changes: 1 addition & 1 deletion font/inconsolata/regular8x16.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package inconsolata
import (
"image"

"golang.org/x/image/font/basicfont"
"github.com/hmmftg/image/font/basicfont"
)

// regular8x16 contains 289 9×17 glyphs in 44217 Pix bytes.
Expand Down
8 changes: 4 additions & 4 deletions font/opentype/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ import (
"log"
"os"

"golang.org/x/image/font"
"golang.org/x/image/font/gofont/goitalic"
"golang.org/x/image/font/opentype"
"golang.org/x/image/math/fixed"
"github.com/hmmftg/image/font"
"github.com/hmmftg/image/font/gofont/goitalic"
"github.com/hmmftg/image/font/opentype"
"github.com/hmmftg/image/math/fixed"
)

func ExampleNewFace() {
Expand Down
14 changes: 7 additions & 7 deletions font/opentype/opentype.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@
// OTF (OpenType Fonts).
//
// This package provides a high-level API, centered on the NewFace function,
// implementing the golang.org/x/image/font.Face interface.
// implementing the github.com/hmmftg/image/font.Face interface.
//
// The sibling golang.org/x/image/font/sfnt package provides a low-level API.
package opentype // import "golang.org/x/image/font/opentype"
// The sibling github.com/hmmftg/image/font/sfnt package provides a low-level API.
package opentype // import "github.com/hmmftg/image/font/opentype"

import (
"image"
"image/draw"
"io"

"golang.org/x/image/font"
"golang.org/x/image/font/sfnt"
"golang.org/x/image/math/fixed"
"golang.org/x/image/vector"
"github.com/hmmftg/image/font"
"github.com/hmmftg/image/font/sfnt"
"github.com/hmmftg/image/math/fixed"
"github.com/hmmftg/image/vector"
)

// ParseCollection parses an OpenType font collection, such as TTC or OTC data,
Expand Down
8 changes: 4 additions & 4 deletions font/opentype/opentype_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import (
"image"
"testing"

"golang.org/x/image/font"
"golang.org/x/image/font/gofont/goregular"
"golang.org/x/image/font/sfnt"
"golang.org/x/image/math/fixed"
"github.com/hmmftg/image/font"
"github.com/hmmftg/image/font/gofont/goregular"
"github.com/hmmftg/image/font/sfnt"
"github.com/hmmftg/image/math/fixed"
)

var (
Expand Down
6 changes: 3 additions & 3 deletions font/plan9font/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import (
"path"
"path/filepath"

"golang.org/x/image/font"
"golang.org/x/image/font/plan9font"
"golang.org/x/image/math/fixed"
"github.com/hmmftg/image/font"
"github.com/hmmftg/image/font/plan9font"
"github.com/hmmftg/image/math/fixed"
)

func ExampleParseFont() {
Expand Down
6 changes: 3 additions & 3 deletions font/plan9font/plan9font.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Package plan9font implements font faces for the Plan 9 font and subfont file
// formats. These formats are described at
// https://9p.io/magic/man2html/6/font
package plan9font // import "golang.org/x/image/font/plan9font"
package plan9font // import "github.com/hmmftg/image/font/plan9font"

import (
"bytes"
Expand All @@ -17,8 +17,8 @@ import (
"strconv"
"strings"

"golang.org/x/image/font"
"golang.org/x/image/math/fixed"
"github.com/hmmftg/image/font"
"github.com/hmmftg/image/math/fixed"
)

// fontchar describes one character glyph in a subfont.
Expand Down
2 changes: 1 addition & 1 deletion font/plan9font/plan9font_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"path/filepath"
"testing"

"golang.org/x/image/font"
"github.com/hmmftg/image/font"
)

func TestMetrics(t *testing.T) {
Expand Down
8 changes: 4 additions & 4 deletions font/sfnt/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import (
"log"
"os"

"golang.org/x/image/font/gofont/goregular"
"golang.org/x/image/font/sfnt"
"golang.org/x/image/math/fixed"
"golang.org/x/image/vector"
"github.com/hmmftg/image/font/gofont/goregular"
"github.com/hmmftg/image/font/sfnt"
"github.com/hmmftg/image/math/fixed"
"github.com/hmmftg/image/vector"
)

func Example_rasterizeGlyph() {
Expand Down
6 changes: 3 additions & 3 deletions font/sfnt/kern_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ these fonts stops after -bulkMaxKernPairs.
To opt-in:
go test golang.org/x/image/font/sfnt -test.run=BulkKern -args -bulk -bulkFontDirs /Library/Fonts:./myfonts
go test github.com/hmmftg/image/font/sfnt -test.run=BulkKern -args -bulk -bulkFontDirs /Library/Fonts:./myfonts
*/

import (
Expand All @@ -31,8 +31,8 @@ import (
"strings"
"testing"

"golang.org/x/image/font"
"golang.org/x/image/math/fixed"
"github.com/hmmftg/image/font"
"github.com/hmmftg/image/math/fixed"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion font/sfnt/postscript.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ import (
"math"
"strconv"

"golang.org/x/image/math/fixed"
"github.com/hmmftg/image/math/fixed"
)

const (
Expand Down

0 comments on commit 5bf2ede

Please sign in to comment.