imgtools

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2020 License: MIT Imports: 5 Imported by: 1

README

imgtools

Build Status Coverage Status Go Report Card GoDoc

Utilities for working with images in Go, completing the standard image package.

  • imgtools/binimg : binary image implementation of the image.Image interface, that is an image with two possible values for each pixel.

  • imgtools/imgscan : fast scanning of rectangular regions of image.Image.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsPowerOf2Image

func IsPowerOf2Image(img image.Image) bool

IsPowerOf2Image reports wether img is a power-of-2 square image or not.

func Pow2Roundup

func Pow2Roundup(x int) int

Pow2Roundup rounds up to next higher power of 2, or n if n is already a power of 2.

func PowerOf2Image

func PowerOf2Image(src image.Image, pad color.Color) (image.Image, error)

PowerOf2Image returns a square image which dimension being a power-of-2, it does so by creating such square image with uniform pad color, and copying the pixels of src over it, at point { 0,0}.

Note: if src dimensions is already a power-of-2 square image, it is returned as-is.This is an helper function supports the standard Go image and binimg.Image types.

Types

This section is empty.

Directories

Path Synopsis
Package binimg proposes an in-memory binary image format, implementing the image.Image interface, alongside a set of efficient tools to scan rectangular regions of such images.
Package binimg proposes an in-memory binary image format, implementing the image.Image interface, alongside a set of efficient tools to scan rectangular regions of such images.
internal

Jump to

Keyboard shortcuts

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