pnm

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package pnm support Portable Any Map image format.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(r io.Reader) (image.Image, error)

func DecodeConfig

func DecodeConfig(r io.Reader) (image.Config, error)

func Encode

func Encode(w io.Writer, m image.Image) error

Encode writes the image m to w in PNM format.

Types

type Encoder

type Encoder struct {
	// Plain specifies whether to encode in plain(ASCII) format.
	Plain bool

	// Type specifies the image type.
	Type Type

	// Max specifies the maximum value of the image color.
	// If Max is 0, the maximum value is determined by the image type.
	// If Type is TypePBM, Max is ignored.
	Max uint16
}

Encoder is a Portable Any Map image encoder.

func (*Encoder) Encode

func (enc *Encoder) Encode(w io.Writer, m image.Image) error

type Type

type Type int
const (
	TypeAuto Type = 0
	TypePBM  Type = 1
	TypePGM  Type = 2
	TypePPM  Type = 3
)

Jump to

Keyboard shortcuts

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