zoom

package module
v1.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 12, 2022 License: MIT Imports: 18 Imported by: 0

README

zoom

Description

瓦片化图像处理

Installation
go get gitee.com/eshax/zoom
Usage
  • go.mod
module zoomtest

go 1.16

require gitee.com/eshax/zoom v1.2.12
  • go.sum
gitee.com/eshax/zoom v1.2.4 h1:r1dJ095pfhAoiqIrZkv+OcuPU0ofCcOJBJdfdtLwBzM=
gitee.com/eshax/zoom v1.2.4/go.mod h1:RzvWQo3oqdkqgKtpL/Sg3+A2wDlk9TBjQU0zthcUipk=
github.com/disintegration/imaging v1.6.2 h1:w1LecBlG2Lnp8B3jk5zSuNqd7b4DXhcjwek1ei82L+c=
github.com/disintegration/imaging v1.6.2/go.mod h1:44/5580QXChDfwIclfc/PCwrr44amcmDAg8hxG0Ewe4=
golang.org/x/image v0.0.0-20191009234506-e7c1f5e7dbb8 h1:hVwzHzIUGRjiF7EcUjqNxk3NCfkPxbDKRdnNE1Rpg0U=
golang.org/x/image v0.0.0-20191009234506-e7c1f5e7dbb8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
  • main.go
package main

import (
    "os"
    "gitee.com/eshax/zoom"
)

func main() {
    zoom.Matrix.Run("100x", "dzi")
}

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Carpet = new(carpet)
View Source
var Matrix = new(matrix)
View Source
var Single = new(single)
View Source
var Square = new(square)

Functions

func CheckExtension added in v1.4.0

func CheckExtension(srcPath string) (ext string, err error)

检查图片类型

params:
	source_path: 源文件路径
returns:
	extension: 图片扩展名
	err: error message

func Cut added in v1.4.0

func Cut(img image.Image, target, ext string) (err error)

单图瓦片制作

func GetBlockSize added in v1.5.0

func GetBlockSize(source, ext string) (height, width int, err error)

获取原始块尺寸

params:
	source: 源文件或路径

func GetLevelSize added in v1.4.0

func GetLevelSize(width, height, level int) (levelWidth, levelHeight int, err error)

计算某个级别的逻辑大图尺寸

func GetMaxLevel added in v1.4.0

func GetMaxLevel(width, height int) (max_level int)

计算瓦片的最大级别

params:
	width: 图像宽度
	height: 图像高度
returns:
	max_level: 瓦片的最大级别

func IsPower added in v1.7.0

func IsPower(n int) bool

验证数字是否是 2 的 n 次方

func IsSquare added in v1.7.0

func IsSquare(image_path string) bool

判断图片是否为正方形, 同时边长又是 2 的 n 次方

func Tile added in v1.5.0

func Tile(img image.Image) (imgs [][]image.Image, err error)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL