openjpeg

package
v2.10.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2018 License: CC0-1.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const MaxProgressionLevel = 32

MaxProgressionLevel represents the maximum resolution factor for a JP2

Variables

Logger defaults to use the standard uoregon-libraries logging mechanism, but can be overridden (as is the case with the main RAIS command)

Functions

func GoLogError

func GoLogError(cmessage *C.char)

GoLogError bridges the openjpeg logging with our internal logger

func GoLogInfo

func GoLogInfo(cmessage *C.char)

GoLogInfo bridges the openjpeg logging with our internal logger. We map openjpeg's "info" logging to debug because these tend to be very verbose and not terribly important.

func GoLogWarning

func GoLogWarning(cmessage *C.char)

GoLogWarning bridges the openjpeg logging with our internal logger

func JP2ComponentData

func JP2ComponentData(comp C.struct_opj_image_comp) []uint8

JP2ComponentData returns a slice of Image-usable uint8s from the JP2 raw data in the given component struct

Types

type JP2Image

type JP2Image struct {
	// contains filtered or unexported fields
}

JP2Image is a container for our simple JP2 operations

func NewJP2Image

func NewJP2Image(filename string) (*JP2Image, error)

NewJP2Image reads basic information about a file and returns a decode-ready JP2Image instance

func (*JP2Image) DecodeImage

func (i *JP2Image) DecodeImage() (img image.Image, err error)

DecodeImage returns an image.Image that holds the decoded image data, resized and cropped if resizing or cropping was requested. Both cropping and resizing happen here due to the nature of openjpeg, so SetScale, SetResizeWH, and SetCrop must be called before this function.

func (*JP2Image) GetHeight

func (i *JP2Image) GetHeight() int

GetHeight returns the image height

func (*JP2Image) GetLevels

func (i *JP2Image) GetLevels() int

GetLevels returns the number of resolution levels

func (*JP2Image) GetTileHeight

func (i *JP2Image) GetTileHeight() int

GetTileHeight returns the tile height

func (*JP2Image) GetTileWidth

func (i *JP2Image) GetTileWidth() int

GetTileWidth returns the tile width

func (*JP2Image) GetWidth

func (i *JP2Image) GetWidth() int

GetWidth returns the image width

func (*JP2Image) SetCrop

func (i *JP2Image) SetCrop(r image.Rectangle)

SetCrop sets the image crop area for decoding an image

func (*JP2Image) SetResizeWH

func (i *JP2Image) SetResizeWH(width, height int)

SetResizeWH sets the image to scale to the given width and height. If one dimension is 0, the decoded image will preserve the aspect ratio while scaling to the non-zero dimension.

Jump to

Keyboard shortcuts

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