Documentation ¶
Index ¶
- Constants
- Variables
- func GoLogError(cmessage *C.char)
- func GoLogInfo(cmessage *C.char)
- func GoLogWarning(cmessage *C.char)
- func JP2ComponentData(comp C.struct_opj_image_comp) []uint8
- type JP2Image
- func (i *JP2Image) DecodeImage() (img image.Image, err error)
- func (i *JP2Image) GetHeight() int
- func (i *JP2Image) GetLevels() int
- func (i *JP2Image) GetTileHeight() int
- func (i *JP2Image) GetTileWidth() int
- func (i *JP2Image) GetWidth() int
- func (i *JP2Image) SetCrop(r image.Rectangle)
- func (i *JP2Image) SetResizeWH(width, height int)
Constants ¶
const MaxProgressionLevel = 32
MaxProgressionLevel represents the maximum resolution factor for a JP2
Variables ¶
var Logger = logger.DefaultLogger
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 ¶
GoLogError bridges the openjpeg logging with our internal logger
func GoLogInfo ¶
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 ¶
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 ¶
NewJP2Image reads basic information about a file and returns a decode-ready JP2Image instance
func (*JP2Image) DecodeImage ¶
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) GetTileHeight ¶
GetTileHeight returns the tile height
func (*JP2Image) GetTileWidth ¶
GetTileWidth returns the tile width
func (*JP2Image) SetResizeWH ¶
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.