leptonica

package module
v0.0.0-...-69e757e Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2014 License: BSD-2-Clause Imports: 5 Imported by: 12

README

go.leptonica

go.leptonica wraps the leptonica library for "efficient image processing and image analysis operations".

Installation

go.leptonica requires the leptonica library and development headers to compile. Install following instructions below, then use the gopkg.in versioned release:

go get gopkg.in/GeertJohan/go.leptonica.v1

Debian Wheezy 7 (or later)

sudo apt-get install libleptonica-dev

Manual installation

Install dependencies.

sudo apt-get install autoconf automake libtool libpng12-dev libjpeg62-dev libtiff4-dev zlib1g-dev

Download, configure, make and install

wget http://leptonica.googlecode.com/files/leptonica-1.69.tar.gz
tar zxvf leptonica-1.69.tar.gz
cd leptonica-1.69
./configure
make
sudo make install

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ImageType

type ImageType int32
const (
	UNKNOWN ImageType = iota
	BMP
	JFIF_JPEG
	PNG
	TIFF
	TIFF_PACKBITS
	TIFF_RLE
	TIFF_G3
	TIFF_G4
	TIFF_LZW
	TIFF_ZIP
	PNM
	PS
	GIF
	JP2
	WEBP
	LPDF
	DEFAULT
	SPIX
)

type Pix

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

func NewPixFromFile

func NewPixFromFile(filename string) (*Pix, error)

LEPT_DLL extern PIX * pixRead ( const char *filename ); NewPixFromFile creates a new Pix from given filename

func NewPixReadMem

func NewPixReadMem(image *[]byte) (*Pix, error)

NewPixReadMem creates a new Pix instance from a byte array

func (*Pix) CPIX

func (p *Pix) CPIX() *C.PIX

func (*Pix) Close

func (p *Pix) Close()

func (*Pix) EncodedBytes

func (p *Pix) EncodedBytes(format ImageType) ([]byte, error)

EncodedBytes will return a byte array holding the data from PIX in the given format

func (*Pix) GetDimensions

func (p *Pix) GetDimensions() (int32, int32, int32, error)

GetDimensions returns the dimensions in Width, Height, Depth, Error format

func (*Pix) WriteFile

func (p *Pix) WriteFile(filename string, format ImageType) error

WriteFile saves to disk the current pix in the given format

Jump to

Keyboard shortcuts

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