mpo: Index | Files

package mpo

import ""

Package mpo implements an MPO image decoder.

MPO is defined in CIPA DC-007:


Package Files

anaglyph.go reader.go stereo.go


const (
    // RedCyan is Red on left eye, cyan on right
    RedCyan colorType = iota

    // CyanRed is Cyan on left eye, red on right

    // RedGreen is Red on left eye, green on right

    // GreenRed is Green on left eye, red on right


var ErrInconsistentBounds = errors.New("anaglyph images must be the same size")

ErrInconsistentBounds indicates that not all images within the MPO file were found to be the same size, which is a requirement for the anaglyph conversion.

var ErrInvalidImageCount = errors.New("anaglph conversion only supports 2 image")

ErrInvalidImageCount indicates that incorrect number of images were found during the anaglyph conversion process.

var ErrNoImages = errors.New("no images found in mpo image")

ErrNoImages indicates that no images were found in the specified file.

func Decode Uses

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

Decode reads a MPO image from r and returns it as an image.Image.

func DecodeConfig Uses

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

DecodeConfig returns the color model and dimensions of an MPO image without decoding the entire image.

TODO Optimize this - possibly just faling back to jpeg.DecodeConfig

type MPO Uses

type MPO struct {
    Image []image.Image

MPO represents the likely multiple images stored in a MPO file.

func DecodeAll Uses

func DecodeAll(rr io.Reader) (*MPO, error)

DecodeAll reads an MPO image from r and returns the sequential frames

func (*MPO) ConvertToAnaglyph Uses

func (m *MPO) ConvertToAnaglyph(ct colorType) (image.Image, error)

ConvertToAnaglyph converts an MPO to the anaglyph format specified by ct colorType constant

func (*MPO) ConvertToStereo Uses

func (m *MPO) ConvertToStereo() image.Image

ConvertToStereo converts an MPO to a StereoScopic image

Package mpo imports 8 packages (graph). Updated 2019-03-17. Refresh now. Tools for package owners.