[Leptonica Home Page]
High Level Outline of Source Code
Contributed by Will Brockman
New: Oct 26, 2009
Basic Pix functions
Basic Pix array functions
Low-level pixel access
Basic Box, Boxa and Boxaa functions
Colormap utilities and related operations
Float-valued images
Image scaling
Other geometric image transforms
Basic image operations: rasterop, arithmetic, convolution and correlation
Image operations with filling: seedfill and watershed
Image quantization and depth conversion in general
Image morphology
Auto-gen'd Destination Word Accumulation (DWA) morphology code
Specialized image filters
Connected components in binary images
Formatted I/O
Line graphics and special output
Specialized document image processing
Fundamental data structures for computation
Miscellaneous utilities
Maze: an example of BF search
Include files: struct and enum definitions
Compile configuration: selection of runtime and external libraries
compare.c: Pix equality, binary Pix correlation, image differences
pix1.c: Implements Pix (image) class - the fundamental one for this
library
pix2.c: Pixel poking of image, pad and border pixels
pix3.c: Masking and logical ops, counting, mirrored tiling
pix4.c: Histograms, fg/bg estimation, rectangle extraction
pixalloc.c: Custom memory allocation for Pix memory
pixabasic.c: Implements Pixa (array of Pix) and Pixaa (2d array of Pix) class
pixafunc1.c: Binary Pixa (array of Pix) filtering, sorting, clipping. See conncomp.c
pixafunc2.c: Render a Pixa or Pixaa in a Pix
pixtiling.c: Split an image into tiles and perform operations independently on each tile
arrayaccess.c: Function access to pixels in 32-bit arrays
arrayaccess.h: Macro access to pixels in 32-bit arrays
runlength.c: Run-length-encoding, horizontal and vertical run membership
boxbasic.c: Implementation of Box, Boxa (Box array), and Boxaa
classes
boxfunc1.c: Box intersection, union, containment; Boxa union, extent,
permutation
boxfunc2.c: Boxa/Box transforms; Boxa/Boxaa sorting; Boxaa utilities
boxfunc3.c: Mask <-> Boxa; painting into and drawing Boxa
blend.c: Blend (optionally with a mask) and re-coloring images
colormap.c: Implements PixColormap; colormap conversions, serialization, transforms
paintcmap.c: Paint onto colormap images - regions, masks
fpix1.c: Implements FPix and DPix classes (float and double images)
fpix2.c: FPix operations: interconversion FPix <-> Pix; borders; rasterop; arithmetic
binexpand.c: Integer upscaling of 1 bpp images by replicated expansion
-- binexpandlow.c: Low-level implementation of integer upscaling
binreduce.c: Power of 2 integer reduction of 1 bpp images by sampling and rank value
-- binreducelow.c: Low-level implementation of power of 2 reduction
scale.c: Image up- and down-scaling, by linear interpolation, area mapping, and sampling; scaling from binary to gray; mipmap scaling; upscaling with thresholding; downscaling with min, max and rank value
-- scalelow.c: Low-level implementation of scaling functions
affine.c: 3-pt affine transforms on images and coordinates, with sampling and interpolation; gauss-jordan solver
affinecompose.c: Composable affine coordinate transforms
bilinear.c: 4-pt bilinear transforms on images and coordinates, with sampling and interpolation
projective.c: 4-pt projective transforms on images and coordinates, with sampling and interpolation
rotate.c: Top-level image rotation by interpolation and sampling
rotateam.c: Interpolated image rotation
-- rotateamlow.c: Low-level helpers for interpolated rotation
rotateorth.c: Orthogonal image rotation and flips
-- rotateorthlow.c: Low-level helpers for orthogonal rotation
rotateshear.c: Image rotation by shear
shear.c: Image shear about arbitrary lines and special points
correlscore.c: Correlation between pairs of binary images
convolve.c: Grayscale, color, float, double convolution; windowed mean, block sum and rank filters; census transform
-- convolvelow.c: Optimized low-level implementation of grayscale convolution and binary rank filter
kernel.c: Basic operations on image kernels for convolution; special kernels
pixacc.c: Simple interface for grayscale image arithmetic
pixarith.c: Grayscale image arithmetic
-- arithlow.c: Low-level implementation of grayscale image arithmetic
rank.c: Rank order filters (generalization of min/median/max filters)
rop.c: General rasterops. "pixRasterop() is your friend; it is worth memorizing!"
-- ropiplow.c: Low-level implementation of in-place rasterops
-- roplow.c: Low-level general rasterop implementation
seedfill.c: Binary and gray seedfill; distance functions; voronoi-like seed spreading; local extrema
-- seedfilllow.c: Low-level implementation of binary and gray seedfill
watershed.c: Find watershed basins from specified seeds in grayscale image
adaptmap.c: local adaptive grayscale quantization; mostly gray-to-gray in preparation
binarize.c: Special binarization methods, locally adaptive: Otsu and Sauvola
colorcontent.c: Measure and map the color content (divergence from gray) of an image
colorquant1.c: Octcube color quantization
colorquant2.c: Modified median cut color quantization (Heckbert)
colorseg.c: Unsupervised color segmentation; selection and display of color content in HSV
grayquant.c: Standard, simple, general grayscale quantization
-- grayquantlow.c: Low-level implementation for some grayscale quantiziation functions
pixconv.c: Convert between images of different types without scaling
colormorph.c: Color morphological operations (apply grayscale separately to each component)
fhmtauto.c: Code generator, writes dwa code for user-supplied hit-miss transform Sels
fmorphauto.c: Code generator, writes dwa code for erosion, dilation, opening and closing, for user-supplied Sels
graymorph.c: Top-level grayscale morphological operations
-- graymorphlow.c: Low-level implementation of grayscale morphology
morph.c: Binary morphological operations (dilate, erode, hit-miss, open, close)
morphapp.c: Composite morph ops: component-wise, union/isect, tophat, gradient, granulometry
morphdwa.c: Binary morphological (dwa) operations
morphseq.c: Interpreter for morphological operations, including binary expansion and reduction
sel1.c: Implements Sel (morph structuring element) and Sela (array of sel)
sel2.c: Contains definitions of simple structuring elements
selgen.c: Generate hit-miss Sels for doing a loose match to a small bitmap
fhmtgen.1.c: DWA morphology with auto-generated hit-miss sels (high-level)
fhmtgenlow.1.c: Low-level Sel implementation for fhmtgen.1.c
fmorphgen.1.c: DWA morphology with auto-generated brick sels
(high-level)
fmorphgenlow.1.c: Low-level Sel implementation for fmorphgen.1.c
dwacomb.2.c: DWA morphology with auto-generated comb Sels for composite
operations on brick Sels
dwacomblow.2.c: Low-level Sel implementation for dwacomb.2.c
edge.c: Sobel and related edge filters
enhance.c: Image enhancements: gamma TRC mapping; contrast enhancement, histogram eq; unsharp-masking; hue and saturation modifications (in HSV color space)
conncomp.c: Connected component counting and extraction (Heckbert's seedfill algorithm)
ccbord.c: Border representation of connected components: display and svg serialization
ccthin.c: Connected-component-preserving thinning
readfile.c: Pix from memory and disk; detecting format
writefile.c: Pix to memory and disk; selecting format
bmpio.c: Read/write bmp format, from/to file and memory
gifio.c: Read/write gif format from/to file and memory
jpegio.c: Read/write jpeg format from/to file and memory
pngio.c: Read/write png format from/to file and memory
pnmio.c: Read/write pnm format from/to file and memory
psio1.c: High level PostScript device driver for wrapping sets of images in PostScript
psio2.c: Lower-level PostScript device driver for wrapping images
tiffio.c: Read/write tiff format from/to file and memory
gplot.c: Basic gnuplot-based plotting; serialization of plots
graphics.c: Rendering shapes from lines (using Pta representation)
viewfiles.c: Generates html for viewing a directory of images
bardecode.c: Decode barcodes after sequence of widths is found
baseline.c: Find text baselines; determine and remove local skew
bmf.c: Generation of bitmap fonts
classapp.c: Unsupervised classification of connected components and words; image comparison using word bounding boxes
finditalic.c: Identifies italic words
flipdetect.c: Page orientation detection (on roman text)
fliphmtgen.c: Hit-miss transforms for flipdetect.c
jbclass.c: data extraction from a set of pages for jbig2 compression: classification and location of connected components (characters or words)
partition.c: Bruel algorithm for extracting large whitespace boxes from a binary image
pageseg.c: Top-level page segmentation, halftone region extraction, textline extraction
readbarcode.c: "Early beta" code for locating and identifying line widths in 1d barcodes
skew.c: Find and remove text page skew
textops.c: Simple utility to put text on images
warper.c: Simple captcha generator based on random warping
heap.c: Implements heap of generic pointers to structs that are keyed
by a float, used for priority queue
list.c: Implements doubly-linked list of generic pointers
numabasic.c: Basic operations for float/int arrays (Numa, Numaa,
Numa2d, NumaHash)
numafunc1.c: Arithmetic, data extraction, interpolation, sorting on numas
numafunc2.c: Shift, scale, convolve, histograms, rank statistics, splitting distributions, extrema finding, threshold crossing, frequency analysis
ptra.c: Implements 1d and 2d arrays of generic pointers (Ptra, Ptraa)
pts.c: Implements 1d and 2d arrays of points (Pta, Ptaa)
queue.c: Implements queue of generic pointers
sarray.c: Impements an array of C strings, and useful utilities based on it
stack.c: Implements a stack of generic pointers
bbuffer.c: Implements ByteBuffer, a byte queue; used for zlib comp/decomp in memory
parseprotos.c: Parse output of cpp to generate ANSII C function prototypes from a file of C functions
utils.c: Error, warning and info macros; safe string ops; file <-> memory ops; byte-swapping, file naming and timing ops
zlibmem.c: Compresses and decompresses a byte array from one memory buffer to another
maze.c: A game with a pedagogical slant: generate and search binary and grayscale mazes
array.h: Structs for basic number and string arrays (Numa, Numaa, Numa2d, NumaHash and Sarray)
bbuffer.h: Struct for expandable byte buffer (see bbuffer.c)
bmf.h: Structs for bitmap fonts
bmp.h: Structs for bmp file format (uncompressed)
ccbord.h: Structs for representation of 1 bpp component outlines
gplot.h: Struct and parameters for generating gnuplot files
heap.h: Struct for representing generic expandable priority queue (L_Heap)
imageio.h: Enums for supported image file formats
jbclass.h: Structs for unsupervised classification of 1 bpp components from a set of pages; used for jbig2 compression
leptprotos.h: ANSII C headers for all functions in the library, automatically generated by xtractprotos
list.h: Struct for generic double-linked list; macros for list traversal
morph.h: Structs for image morphology (Sel, Sela) and convolution (Kernel), with enum flags
pix.h: Basic file defining image and image-related structs (Pix, PixColormap, Pixa, Pixaa, Box, Boxa, Boxaa, Pta, Ptaa, Pixacc, PixTiling, FPix, DPix, PixComp, PixaComp), along with enums for many operations
ptra.h: Structs for generic expandable arrays (L_Ptra, L_Ptraa)
queue.h: Struct for generic expandable queue (L_Queue)
readbarcode.h: Enums and consts for reading 1d barcodes
stack.h: Struct for generic expandable stack (L_Stack)
watershed.h: Struct for generating watershed information from a grayscale image
environ.h: Specifies external libraries to be used, and whether
the runtime supports output redirection from files to memory

Leptonica by Dan Bloomberg is
licensed under a Creative Commons
Attribution 3.0 United States License.