imageprocessorcommon

package
v0.0.0-...-7f3e199 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2019 License: LGPL-3.0 Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	// ImageFormatUndefined is a reserved ImageFormat for cases when it's undefined.
	// So if anybody will have an ImageFormat with zero-value (not defined, yet) it won't receive
	// a mis-leading value like ImageFormatJPEG.
	ImageFormatUndefined = ImageFormat(iota)

	// ImageFormatJPEG is an ImageFormat for JPEGs
	ImageFormatJPEG

	// ImageFormatOther is an ImageFormat for all image formats not listed here in this enumeration
	ImageFormatOther
)

Variables

View Source
var (
	ErrInvalidSize = errors.New(`invalid size`)
)

Functions

This section is empty.

Types

type ImageFormat

type ImageFormat uint

ImageFormat is an enumeration data-type for image formats

func ParseImageFormat

func ParseImageFormat(formatString string) ImageFormat

ParseImageFormat parses a string with an image format to ImageFormat.

Expected values: "JPEG"

func (ImageFormat) String

func (ifmt ImageFormat) String() string

String just implements Stringer for nicer logging

type ImageProcessor

type ImageProcessor interface {
	// Resize reads an image from `in` and writes a resized image to `out`
	// (new image size: `toWidth`x`toHeight`).
	//
	// It returns image format and (if occured:) an error.
	Resize(in io.Reader, out io.Writer, toWidth, toHeight uint) (ImageFormat, error)
}

ImageProcessor is a tool to manipulate images

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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