gdg

package module
v0.0.0-...-319fe53 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2014 License: AGPL-3.0 Imports: 10 Imported by: 0

README

Go DZI Generator

Go DZI Generator is a pure Go implementation of vips dzsave.

References

Documentation

Overview

Package Go DZI Generator is a pure Go implementation of `vips dzsave`.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComputeTileRect

func ComputeTileRect(opt *Option, col, row, maxCol, maxRow uint) (rect image.Rectangle)

ComputeTileRect computes and returns corresponding rectangle based on given option, column and row.

func Generate

func Generate(m *image.NRGBA, opt *Option) error

Generate generates DZI files of given image and option. Width and height in option and image should be same.

func GetLevelGrids

func GetLevelGrids(level, width, height, tileSize uint) (uint, uint)

GetLevelGrids returns columns and rows number of current level, tile size, width and height.

func GetMaxLevel

func GetMaxLevel(width, height uint) uint

GetMaxLevel computes and returns the maximum level of DZI files based on given width and height.

func SaveTile

func SaveTile(dirPath string, level, col, row uint, format ImageFormat, m *image.NRGBA, wg *sync.WaitGroup) error

SaveTile saves tile to given path based on level, column and row.

Types

type ImageFormat

type ImageFormat string
const (
	JPEG ImageFormat = "jpeg"
	PNG  ImageFormat = "png"
)

type Option

type Option struct {
	DirPath       string
	Format        ImageFormat
	Overlap       uint
	TileSize      uint
	Width, Height uint
}

Option represents general DZI options.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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