Leptonica 1.68
C Image Processing Library

pix.h File Reference

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. More...

Go to the source code of this file.

Data Structures

struct  Pix
struct  PixColormap
struct  RGBA_Quad
struct  Pixa
struct  Pixaa
struct  Box
struct  Boxa
struct  Boxaa
struct  Pta
struct  Ptaa
struct  Pixacc
struct  PixTiling
struct  FPix
struct  FPixa
struct  DPix
struct  PixComp
struct  PixaComp

Defines

#define PIX_SRC   (0xc << 1)
#define PIX_DST   (0xa << 1)
#define PIX_NOT(op)   ((op) ^ 0x1e)
#define PIX_CLR   (0x0 << 1)
#define PIX_SET   (0xf << 1)
#define PIX_PAINT   (PIX_SRC | PIX_DST)
#define PIX_MASK   (PIX_SRC & PIX_DST)
#define PIX_SUBTRACT   (PIX_DST & PIX_NOT(PIX_SRC))
#define PIX_XOR   (PIX_SRC ^ PIX_DST)
#define PIXAA_VERSION_NUMBER   2
#define PIXA_VERSION_NUMBER   2
#define BOXA_VERSION_NUMBER   2
#define BOXAA_VERSION_NUMBER   3
#define PTA_VERSION_NUMBER   1
#define FPIX_VERSION_NUMBER   1
#define DPIX_VERSION_NUMBER   1
#define PIXACOMP_VERSION_NUMBER   1

Typedefs

typedef struct Pix PIX
typedef struct PixColormap PIXCMAP
typedef struct RGBA_Quad RGBA_QUAD
typedef struct Pixa PIXA
typedef struct Pixaa PIXAA
typedef struct Box BOX
typedef struct Boxa BOXA
typedef struct Boxaa BOXAA
typedef struct Pta PTA
typedef struct Ptaa PTAA
typedef struct Pixacc PIXACC
typedef struct PixTiling PIXTILING
typedef struct FPix FPIX
typedef struct FPixa FPIXA
typedef struct DPix DPIX
typedef struct PixComp PIXC
typedef struct PixaComp PIXAC

Enumerations

enum  { COLOR_RED = 0, COLOR_GREEN = 1, COLOR_BLUE = 2, L_ALPHA_CHANNEL = 3 }
enum  { REMOVE_CMAP_TO_BINARY = 0, REMOVE_CMAP_TO_GRAYSCALE = 1, REMOVE_CMAP_TO_FULL_COLOR = 2, REMOVE_CMAP_BASED_ON_SRC = 3 }
enum  { L_INSERT = 0, L_COPY = 1, L_CLONE = 2, L_COPY_CLONE = 3 }
enum  { L_SORT_INCREASING = 1, L_SORT_DECREASING = 2 }
enum  {
  L_SORT_BY_X = 3, L_SORT_BY_Y = 4, L_SORT_BY_WIDTH = 5, L_SORT_BY_HEIGHT = 6,
  L_SORT_BY_MIN_DIMENSION = 7, L_SORT_BY_MAX_DIMENSION = 8, L_SORT_BY_PERIMETER = 9, L_SORT_BY_AREA = 10,
  L_SORT_BY_ASPECT_RATIO = 11
}
enum  {
  L_BLEND_WITH_INVERSE = 1, L_BLEND_TO_WHITE = 2, L_BLEND_TO_BLACK = 3, L_BLEND_GRAY = 4,
  L_BLEND_GRAY_WITH_INVERSE = 5
}
enum  { L_PAINT_LIGHT = 1, L_PAINT_DARK = 2 }
enum  { L_SET_PIXELS = 1, L_CLEAR_PIXELS = 2, L_FLIP_PIXELS = 3 }
enum  { L_SELECT_WIDTH = 1, L_SELECT_HEIGHT = 2, L_SELECT_IF_EITHER = 3, L_SELECT_IF_BOTH = 4 }
enum  { L_SELECT_IF_LT = 1, L_SELECT_IF_GT = 2, L_SELECT_IF_LTE = 3, L_SELECT_IF_GTE = 4 }
enum  {
  L_SELECT_RED = 1, L_SELECT_GREEN = 2, L_SELECT_BLUE = 3, L_SELECT_MIN = 4,
  L_SELECT_MAX = 5
}
enum  { L_ROTATE_AREA_MAP = 1, L_ROTATE_SHEAR = 2, L_ROTATE_SAMPLING = 3 }
enum  { L_BRING_IN_WHITE = 1, L_BRING_IN_BLACK = 2 }
enum  { L_SHEAR_ABOUT_CORNER = 1, L_SHEAR_ABOUT_CENTER = 2 }
enum  {
  L_TR_SC_RO = 1, L_SC_RO_TR = 2, L_RO_TR_SC = 3, L_TR_RO_SC = 4,
  L_RO_SC_TR = 5, L_SC_TR_RO = 6
}
enum  { L_FILL_WHITE = 1, L_FILL_BLACK = 2 }
enum  { L_SET_WHITE = 1, L_SET_BLACK = 2 }
enum  { DEFAULT_CLIP_LOWER_1 = 10, DEFAULT_CLIP_UPPER_1 = 10, DEFAULT_CLIP_LOWER_2 = 5, DEFAULT_CLIP_UPPER_2 = 5 }
enum  { L_MANHATTAN_DISTANCE = 1, L_EUCLIDEAN_DISTANCE = 2 }
enum  {
  L_MEAN_ABSVAL = 1, L_MEDIAN_VAL = 2, L_MODE_VAL = 3, L_MODE_COUNT = 4,
  L_ROOT_MEAN_SQUARE = 5, L_STANDARD_DEVIATION = 6, L_VARIANCE = 7
}
enum  { L_CHOOSE_CONSECUTIVE = 1, L_CHOOSE_SKIP_BY = 2 }
enum  {
  L_TEXT_ORIENT_UNKNOWN = 0, L_TEXT_ORIENT_UP = 1, L_TEXT_ORIENT_LEFT = 2, L_TEXT_ORIENT_DOWN = 3,
  L_TEXT_ORIENT_RIGHT = 4
}
enum  { L_HORIZONTAL_EDGES = 0, L_VERTICAL_EDGES = 1, L_ALL_EDGES = 2 }
enum  {
  L_HORIZONTAL_LINE = 0, L_POS_SLOPE_LINE = 1, L_VERTICAL_LINE = 2, L_NEG_SLOPE_LINE = 3,
  L_OBLIQUE_LINE = 4
}
enum  { L_FROM_LEFT = 0, L_FROM_RIGHT = 1, L_FROM_TOP = 2, L_FROM_BOTTOM = 3 }
enum  { L_WARP_TO_LEFT = 1, L_WARP_TO_RIGHT = 2 }
enum  { L_LINEAR_WARP = 1, L_QUADRATIC_WARP = 2 }
enum  { L_INTERPOLATED = 1, L_SAMPLED = 2 }
enum  { L_THIN_FG = 1, L_THIN_BG = 2 }
enum  { L_HORIZONTAL_RUNS = 0, L_VERTICAL_RUNS = 1 }
enum  { L_SOBEL_EDGE = 1, L_TWO_SIDED_EDGE = 2 }
enum  { L_CLIP_TO_ZERO = 1, L_TAKE_ABSVAL = 2 }
enum  { L_SUBPIXEL_ORDER_RGB = 1, L_SUBPIXEL_ORDER_BGR = 2, L_SUBPIXEL_ORDER_VRGB = 3, L_SUBPIXEL_ORDER_VBGR = 4 }
enum  { L_LESS_THAN_ZERO = 1, L_EQUAL_TO_ZERO = 2, L_GREATER_THAN_ZERO = 3 }
enum  { L_HS_HISTO = 1, L_HV_HISTO = 2, L_SV_HISTO = 3 }
enum  { L_INCLUDE_REGION = 1, L_EXCLUDE_REGION = 2 }
enum  { L_ADD_ABOVE = 1, L_ADD_AT_TOP = 2, L_ADD_AT_BOTTOM = 3, L_ADD_BELOW = 4 }
enum  { L_DISPLAY_WITH_XV = 1, L_DISPLAY_WITH_XLI = 2, L_DISPLAY_WITH_XZGV = 3, L_DISPLAY_WITH_IV = 4 }

Variables

static const l_int32 L_RED_SHIFT
static const l_int32 L_GREEN_SHIFT
static const l_int32 L_BLUE_SHIFT
static const l_int32 L_ALPHA_SHIFT
static const l_float32 L_RED_WEIGHT = 0.3
static const l_float32 L_GREEN_WEIGHT = 0.5
static const l_float32 L_BLUE_WEIGHT = 0.2
static const l_int32 L_NOCOPY = 0

Detailed Description

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.

 Contains the following structures:
     struct Pix
     struct PixColormap
     struct RGBA_Quad
     struct Pixa
     struct Pixaa
     struct Box
     struct Boxa
     struct Boxaa
     struct Pta
     struct Ptaa
     struct Pixacc
     struct PixTiling
     struct FPix
     struct FPixa
     struct DPix
     struct PixComp
     struct PixaComp

 Contains definitions for:
     Colors for RGB
     Perceptual color weights
     Colormap conversion flags
     Rasterop bit flags
     Structure access flags (for insert, copy, clone, copy-clone)
     Sorting flags (by type and direction)
     Blending flags
     Graphics pixel setting flags
     Size filtering flags
     Color component selection flags
     Rotation and shear flags
     Affine transform order flags
     Grayscale filling flags
     Flags for setting to white or black
     Dithering flags
     Distance flags
     Statistical measures
     Set selection flags
     Text orientation flags
     Edge orientation flags
     Line orientation flags
     Scan direction flags
     Horizontal warp
     Pixel selection for resampling
     Thinning flags
     Runlength flags
     Edge filter flags
     Handling negative values in conversion to unsigned int
     Subpixel color component ordering in LCD display
     Relative to zero flags
     HSV histogram flags
     Region flags (inclusion, exclusion)
     Flags for adding text to a pix
     Flags for selecting display program

Definition in file pix.h.


Define Documentation

#define PIX_MASK   (PIX_SRC & PIX_DST)

Definition at line 250 of file pix.h.

Referenced by pixFindOverlapFraction(), pixPaintThroughMask(), and pixSetMasked().

#define PIX_SUBTRACT   (PIX_DST & PIX_NOT(PIX_SRC))

Definition at line 251 of file pix.h.

#define PIX_XOR   (PIX_SRC ^ PIX_DST)

Definition at line 252 of file pix.h.

Referenced by ccbaDisplayImage1(), ccbaDisplayImage2(), and pixQualifyLocalMinima().

#define PIXAA_VERSION_NUMBER   2

Definition at line 357 of file pix.h.

Referenced by pixaaReadStream(), and pixaaWriteStream().

#define PIXA_VERSION_NUMBER   2

Definition at line 358 of file pix.h.

Referenced by pixaReadStream(), and pixaWriteStream().

#define BOXA_VERSION_NUMBER   2

Definition at line 359 of file pix.h.

Referenced by boxaReadStream(), and boxaWriteStream().

#define BOXAA_VERSION_NUMBER   3

Definition at line 360 of file pix.h.

Referenced by boxaaReadStream(), and boxaaWriteStream().

#define PTA_VERSION_NUMBER   1

Definition at line 419 of file pix.h.

Referenced by ptaaReadStream(), ptaaWriteStream(), ptaReadStream(), and ptaWriteStream().

#define FPIX_VERSION_NUMBER   1

Definition at line 477 of file pix.h.

Referenced by fpixReadStream(), and fpixWriteStream().

#define DPIX_VERSION_NUMBER   1

Definition at line 507 of file pix.h.

Referenced by dpixReadStream(), and dpixWriteStream().

#define PIXACOMP_VERSION_NUMBER   1

Definition at line 549 of file pix.h.

Referenced by pixacompReadStream(), and pixacompWriteStream().


Typedef Documentation

typedef struct Pix PIX

Definition at line 98 of file pix.h.

typedef struct PixColormap PIXCMAP

Definition at line 108 of file pix.h.

typedef struct RGBA_Quad RGBA_QUAD

Definition at line 122 of file pix.h.

typedef struct Pixa PIXA

Definition at line 371 of file pix.h.

typedef struct Pixaa PIXAA

Definition at line 381 of file pix.h.

typedef struct Box BOX

Definition at line 396 of file pix.h.

typedef struct Boxa BOXA

Definition at line 405 of file pix.h.

typedef struct Boxaa BOXAA

Definition at line 413 of file pix.h.

typedef struct Pta PTA

Definition at line 428 of file pix.h.

typedef struct Ptaa PTAA

Definition at line 440 of file pix.h.

typedef struct Pixacc PIXACC

Definition at line 454 of file pix.h.

typedef struct PixTiling PIXTILING

Definition at line 471 of file pix.h.

typedef struct FPix FPIX

Definition at line 491 of file pix.h.

typedef struct FPixa FPIXA

Definition at line 501 of file pix.h.

typedef struct DPix DPIX

Definition at line 521 of file pix.h.

typedef struct PixComp PIXC

Definition at line 543 of file pix.h.

typedef struct PixaComp PIXAC

Definition at line 558 of file pix.h.


Enumeration Type Documentation

anonymous enum
Enumerator:
COLOR_RED 
COLOR_GREEN 
COLOR_BLUE 
L_ALPHA_CHANNEL 

Definition at line 142 of file pix.h.

anonymous enum
Enumerator:
REMOVE_CMAP_TO_BINARY 
REMOVE_CMAP_TO_GRAYSCALE 
REMOVE_CMAP_TO_FULL_COLOR 
REMOVE_CMAP_BASED_ON_SRC 

Definition at line 177 of file pix.h.

anonymous enum
Enumerator:
L_INSERT 
L_COPY 
L_CLONE 
L_COPY_CLONE 

Definition at line 595 of file pix.h.

anonymous enum
Enumerator:
L_SORT_INCREASING 
L_SORT_DECREASING 

Definition at line 608 of file pix.h.

anonymous enum
Enumerator:
L_SORT_BY_X 
L_SORT_BY_Y 
L_SORT_BY_WIDTH 
L_SORT_BY_HEIGHT 
L_SORT_BY_MIN_DIMENSION 
L_SORT_BY_MAX_DIMENSION 
L_SORT_BY_PERIMETER 
L_SORT_BY_AREA 
L_SORT_BY_ASPECT_RATIO 

Definition at line 613 of file pix.h.

anonymous enum
Enumerator:
L_BLEND_WITH_INVERSE 
L_BLEND_TO_WHITE 
L_BLEND_TO_BLACK 
L_BLEND_GRAY 
L_BLEND_GRAY_WITH_INVERSE 

Definition at line 629 of file pix.h.

anonymous enum
Enumerator:
L_PAINT_LIGHT 
L_PAINT_DARK 

Definition at line 638 of file pix.h.

anonymous enum
Enumerator:
L_SET_PIXELS 
L_CLEAR_PIXELS 
L_FLIP_PIXELS 

Definition at line 647 of file pix.h.

anonymous enum
Enumerator:
L_SELECT_WIDTH 
L_SELECT_HEIGHT 
L_SELECT_IF_EITHER 
L_SELECT_IF_BOTH 

Definition at line 657 of file pix.h.

anonymous enum
Enumerator:
L_SELECT_IF_LT 
L_SELECT_IF_GT 
L_SELECT_IF_LTE 
L_SELECT_IF_GTE 

Definition at line 664 of file pix.h.

anonymous enum
Enumerator:
L_SELECT_RED 
L_SELECT_GREEN 
L_SELECT_BLUE 
L_SELECT_MIN 
L_SELECT_MAX 

Definition at line 675 of file pix.h.

anonymous enum
Enumerator:
L_ROTATE_AREA_MAP 
L_ROTATE_SHEAR 
L_ROTATE_SAMPLING 

Definition at line 687 of file pix.h.

anonymous enum
Enumerator:
L_BRING_IN_WHITE 
L_BRING_IN_BLACK 

Definition at line 693 of file pix.h.

anonymous enum
Enumerator:
L_SHEAR_ABOUT_CORNER 
L_SHEAR_ABOUT_CENTER 

Definition at line 698 of file pix.h.

anonymous enum
Enumerator:
L_TR_SC_RO 
L_SC_RO_TR 
L_RO_TR_SC 
L_TR_RO_SC 
L_RO_SC_TR 
L_SC_TR_RO 

Definition at line 707 of file pix.h.

anonymous enum
Enumerator:
L_FILL_WHITE 
L_FILL_BLACK 

Definition at line 720 of file pix.h.

anonymous enum
Enumerator:
L_SET_WHITE 
L_SET_BLACK 

Definition at line 729 of file pix.h.

anonymous enum
Enumerator:
DEFAULT_CLIP_LOWER_1 
DEFAULT_CLIP_UPPER_1 
DEFAULT_CLIP_LOWER_2 
DEFAULT_CLIP_UPPER_2 

Definition at line 740 of file pix.h.

anonymous enum
Enumerator:
L_MANHATTAN_DISTANCE 
L_EUCLIDEAN_DISTANCE 

Definition at line 751 of file pix.h.

anonymous enum
Enumerator:
L_MEAN_ABSVAL 
L_MEDIAN_VAL 
L_MODE_VAL 
L_MODE_COUNT 
L_ROOT_MEAN_SQUARE 
L_STANDARD_DEVIATION 
L_VARIANCE 

Definition at line 760 of file pix.h.

anonymous enum
Enumerator:
L_CHOOSE_CONSECUTIVE 
L_CHOOSE_SKIP_BY 

Definition at line 774 of file pix.h.

anonymous enum
Enumerator:
L_TEXT_ORIENT_UNKNOWN 
L_TEXT_ORIENT_UP 
L_TEXT_ORIENT_LEFT 
L_TEXT_ORIENT_DOWN 
L_TEXT_ORIENT_RIGHT 

Definition at line 783 of file pix.h.

anonymous enum
Enumerator:
L_HORIZONTAL_EDGES 
L_VERTICAL_EDGES 
L_ALL_EDGES 

Definition at line 795 of file pix.h.

anonymous enum
Enumerator:
L_HORIZONTAL_LINE 
L_POS_SLOPE_LINE 
L_VERTICAL_LINE 
L_NEG_SLOPE_LINE 
L_OBLIQUE_LINE 

Definition at line 805 of file pix.h.

anonymous enum
Enumerator:
L_FROM_LEFT 
L_FROM_RIGHT 
L_FROM_TOP 
L_FROM_BOTTOM 

Definition at line 817 of file pix.h.

anonymous enum
Enumerator:
L_WARP_TO_LEFT 
L_WARP_TO_RIGHT 

Definition at line 828 of file pix.h.

anonymous enum
Enumerator:
L_LINEAR_WARP 
L_QUADRATIC_WARP 

Definition at line 833 of file pix.h.

anonymous enum
Enumerator:
L_INTERPOLATED 
L_SAMPLED 

Definition at line 842 of file pix.h.

anonymous enum
Enumerator:
L_THIN_FG 
L_THIN_BG 

Definition at line 851 of file pix.h.

anonymous enum
Enumerator:
L_HORIZONTAL_RUNS 
L_VERTICAL_RUNS 

Definition at line 860 of file pix.h.

anonymous enum
Enumerator:
L_SOBEL_EDGE 
L_TWO_SIDED_EDGE 

Definition at line 869 of file pix.h.

anonymous enum
Enumerator:
L_CLIP_TO_ZERO 
L_TAKE_ABSVAL 

Definition at line 878 of file pix.h.

anonymous enum
Enumerator:
L_SUBPIXEL_ORDER_RGB 
L_SUBPIXEL_ORDER_BGR 
L_SUBPIXEL_ORDER_VRGB 
L_SUBPIXEL_ORDER_VBGR 

Definition at line 887 of file pix.h.

anonymous enum
Enumerator:
L_LESS_THAN_ZERO 
L_EQUAL_TO_ZERO 
L_GREATER_THAN_ZERO 

Definition at line 898 of file pix.h.

anonymous enum
Enumerator:
L_HS_HISTO 
L_HV_HISTO 
L_SV_HISTO 

Definition at line 908 of file pix.h.

anonymous enum
Enumerator:
L_INCLUDE_REGION 
L_EXCLUDE_REGION 

Definition at line 918 of file pix.h.

anonymous enum
Enumerator:
L_ADD_ABOVE 
L_ADD_AT_TOP 
L_ADD_AT_BOTTOM 
L_ADD_BELOW 

Definition at line 927 of file pix.h.

anonymous enum
Enumerator:
L_DISPLAY_WITH_XV 
L_DISPLAY_WITH_XLI 
L_DISPLAY_WITH_XZGV 
L_DISPLAY_WITH_IV 

Definition at line 938 of file pix.h.


Variable Documentation

const l_int32 L_ALPHA_SHIFT [static]
Initial value:
       8 * (sizeof(l_uint32) - 1 - L_ALPHA_CHANNEL)

Definition at line 155 of file pix.h.

const l_float32 L_RED_WEIGHT = 0.3 [static]

Definition at line 169 of file pix.h.

Referenced by pixConvertRGBToGray().

const l_float32 L_GREEN_WEIGHT = 0.5 [static]

Definition at line 170 of file pix.h.

Referenced by pixConvertRGBToGray().

const l_float32 L_BLUE_WEIGHT = 0.2 [static]

Definition at line 171 of file pix.h.

Referenced by pixConvertRGBToGray().

const l_int32 L_NOCOPY = 0 [static]

Definition at line 602 of file pix.h.

Referenced by convertFilesTo1bpp(), convertSegmentedFilesToPdf(), dewarpBuildModel(), fhmtautogen2(), fmorphautogen2(), fpixBuildHorizontalDisparity(), generateOutputDataPdf(), getNumberedPathnamesInDirectory(), getSortedPathnamesInDirectory(), gplotGenCommandFile(), gplotGenDataFiles(), kernelCreateFromFile(), lept_rmdir(), main(), numaAddBorder(), numaAddSpecifiedBorder(), numaDifferentiateInterval(), numaDilate(), numaErode(), numaGetFArray(), numaGetMode(), numaGetPeakWidthLUT(), numaIntegrateInterval(), numaInterpolateArbxInterval(), numaInterpolateArbxVal(), numaInterpolateEqxVal(), numaRemoveBorder(), numaUniformSampling(), numaWindowedMean(), numaWindowedMeanSquare(), numaWindowedVariance(), parseTrailerPdf(), pathJoin(), pixacompCreateFromSA(), pixaReadFilesSA(), pixAverageRasterScans(), pixColumnStats(), pixCompareRankDifference(), pixCountPixelsByColumn(), pixGetCmapHistogram(), pixGetCmapHistogramMasked(), pixGetColorHistogram(), pixGetColorHistogramMasked(), pixGetDifferenceHistogram(), pixGetDifferenceStats(), pixGetGrayHistogram(), pixGetGrayHistogramMasked(), pixHtmlViewer(), pixOctcubeHistogram(), pixReadIndexed(), pixRowStats(), pixSumPixelsByColumn(), ptraConcatenatePdfToData(), saConcatenatePdfToData(), saConvertFilesToPdfData(), sarrayAppendRange(), sarrayConcatenate(), sarrayConvertFilesFittedToPS(), sarrayConvertFilesToPS(), sarrayConvertWordsToLines(), sarrayGetString(), sarrayParseRange(), sarraySelectBySubstring(), sarrayToStringRange(), selaCreateFromFile(), selCreateFromSArray(), sudokuReadFile(), and writeMultipageTiffSA().

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines