Leptonica  1.77.0
Image processing and image analysis suite
pix.h File Reference

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
 

Macros

#define PIX_SRC   (0xc)
 
#define PIX_DST   (0xa)
 
#define PIX_NOT(op)   ((op) ^ 0x0f)
 
#define PIX_CLR   (0x0)
 
#define PIX_SET   (0xf)
 
#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   2
 
#define DPIX_VERSION_NUMBER   2
 
#define PIXACOMP_VERSION_NUMBER   2
 

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
 
typedef void *(* alloc_fn) (size_t)
 
typedef void(* dealloc_fn) (void *)
 

Enumerations

enum  { COLOR_RED = 0, COLOR_GREEN = 1, COLOR_BLUE = 2, L_ALPHA_CHANNEL = 3 }
 
enum  {
  L_DRAW_RED = 0, L_DRAW_GREEN = 1, L_DRAW_BLUE = 2, L_DRAW_SPECIFIED = 3,
  L_DRAW_RGB = 4, L_DRAW_RANDOM = 5
}
 
enum  {
  REMOVE_CMAP_TO_BINARY = 0, REMOVE_CMAP_TO_GRAYSCALE = 1, REMOVE_CMAP_TO_FULL_COLOR = 2, REMOVE_CMAP_WITH_ALPHA = 3,
  REMOVE_CMAP_BASED_ON_SRC = 4
}
 
enum  {
  L_NOCOPY = 0, L_INSERT = L_NOCOPY, L_COPY = 1, L_CLONE = 2,
  L_COPY_CLONE = 3
}
 
enum  { L_SHELL_SORT = 1, L_BIN_SORT = 2 }
 
enum  { L_SORT_INCREASING = 1, L_SORT_DECREASING = 2 }
 
enum  {
  L_SORT_BY_X = 1, L_SORT_BY_Y = 2, L_SORT_BY_RIGHT = 3, L_SORT_BY_BOT = 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_IF_LT = 1, L_SELECT_IF_GT = 2, L_SELECT_IF_LTE = 3, L_SELECT_IF_GTE = 4 }
 
enum  {
  L_SELECT_BY_WIDTH = 1, L_SELECT_BY_HEIGHT = 2, L_SELECT_BY_MAX_DIMENSION = 3, L_SELECT_BY_AREA = 4,
  L_SELECT_BY_PERIMETER = 5
}
 
enum  {
  L_SELECT_WIDTH = 1, L_SELECT_HEIGHT = 2, L_SELECT_XVAL = 3, L_SELECT_YVAL = 4,
  L_SELECT_IF_EITHER = 5, L_SELECT_IF_BOTH = 6
}
 
enum  { L_CHECK_WIDTH = 1, L_CHECK_HEIGHT = 2, L_CHECK_BOTH = 3 }
 
enum  {
  L_SELECT_RED = 1, L_SELECT_GREEN = 2, L_SELECT_BLUE = 3, L_SELECT_MIN = 4,
  L_SELECT_MAX = 5, L_SELECT_AVERAGE = 6, L_SELECT_HUE = 7, L_SELECT_SATURATION = 8
}
 
enum  {
  L_LS_BYTE = 1, L_MS_BYTE = 2, L_AUTO_BYTE = 3, L_CLIP_TO_FF = 4,
  L_LS_TWO_BYTES = 5, L_MS_TWO_BYTES = 6, L_CLIP_TO_FFFF = 7
}
 
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  { L_GET_WHITE_VAL = 1, L_GET_BLACK_VAL = 2 }
 
enum  { L_WHITE_IS_MAX = 1, L_BLACK_IS_MAX = 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_NEGATIVE = 1, L_NON_NEGATIVE = 2, L_POSITIVE = 3, L_NON_POSITIVE = 4,
  L_ZERO = 5, L_ALL = 6
}
 
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_PORTRAIT_MODE = 0, L_LANDSCAPE_MODE = 1 }
 
enum  {
  L_FROM_LEFT = 0, L_FROM_RIGHT = 1, L_FROM_TOP = 2, L_FROM_BOT = 3,
  L_SCAN_NEGATIVE = 4, L_SCAN_POSITIVE = 5, L_SCAN_BOTH = 6, L_SCAN_HORIZONTAL = 7,
  L_SCAN_VERTICAL = 8
}
 
enum  {
  L_ADJUST_SKIP = 0, L_ADJUST_LEFT = 1, L_ADJUST_RIGHT = 2, L_ADJUST_LEFT_AND_RIGHT = 3,
  L_ADJUST_TOP = 4, L_ADJUST_BOT = 5, L_ADJUST_TOP_AND_BOT = 6, L_ADJUST_CHOOSE_MIN = 7,
  L_ADJUST_CHOOSE_MAX = 8, L_SET_LEFT = 9, L_SET_RIGHT = 10, L_SET_TOP = 11,
  L_SET_BOT = 12, L_GET_LEFT = 13, L_GET_RIGHT = 14, L_GET_TOP = 15,
  L_GET_BOT = 16
}
 
enum  {
  L_USE_MINSIZE = 1, L_USE_MAXSIZE = 2, L_SUB_ON_LOC_DIFF = 3, L_SUB_ON_SIZE_DIFF = 4,
  L_USE_CAPPED_MIN = 5, L_USE_CAPPED_MAX = 6
}
 
enum  { L_COMBINE = 1, L_REMOVE_SMALL = 2 }
 
enum  { L_USE_ALL_BOXES = 1, L_USE_SAME_PARITY_BOXES = 2 }
 
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_SUBPIXEL_ORDER_RGB = 1, L_SUBPIXEL_ORDER_BGR = 2, L_SUBPIXEL_ORDER_VRGB = 3, L_SUBPIXEL_ORDER_VBGR = 4 }
 
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_BELOW = 2, L_ADD_LEFT = 3, L_ADD_RIGHT = 4,
  L_ADD_AT_TOP = 5, L_ADD_AT_BOT = 6, L_ADD_AT_LEFT = 7, L_ADD_AT_RIGHT = 8
}
 
enum  {
  L_PLOT_AT_TOP = 1, L_PLOT_AT_MID_HORIZ = 2, L_PLOT_AT_BOT = 3, L_PLOT_AT_LEFT = 4,
  L_PLOT_AT_MID_VERT = 5, L_PLOT_AT_RIGHT = 6
}
 
enum  {
  L_DISPLAY_WITH_XZGV = 1, L_DISPLAY_WITH_XLI = 2, L_DISPLAY_WITH_XV = 3, L_DISPLAY_WITH_IV = 4,
  L_DISPLAY_WITH_OPEN = 5
}
 
enum  { L_NO_CHROMA_SAMPLING_JPEG = 1 }
 
enum  { L_CLIP_TO_ZERO = 1, L_TAKE_ABSVAL = 2 }
 
enum  { L_LESS_THAN_ZERO = 1, L_EQUAL_TO_ZERO = 2, L_GREATER_THAN_ZERO = 3 }
 
enum  { L_ADD_TRAIL_SLASH = 1, L_REMOVE_TRAIL_SLASH = 2 }
 

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.3f
 
static const l_float32 L_GREEN_WEIGHT = 0.5f
 
static const l_float32 L_BLUE_WEIGHT = 0.2f
 

Detailed Description

  Valid image types in leptonica:
      Pix: 1 bpp, with and without colormap
      Pix: 2 bpp, with and without colormap
      Pix: 4 bpp, with and without colormap
      Pix: 8 bpp, with and without colormap
      Pix: 16 bpp (1 spp)
      Pix: 32 bpp (rgb, 3 spp)
      Pix: 32 bpp (rgba, 4 spp)
      FPix: 32 bpp float
      DPix: 64 bpp double
      Notes:
         (1) The only valid Pix image type with alpha is rgba.
             In particular, the alpha component is not used in
             cmapped images.
         (2) PixComp can hold any Pix with IFF_PNG encoding.
  Contents:
  (1) This file defines most of the image-related structs used in leptonica:
        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
  (2) This file has definitions for:
        Colors for RGB
        Colors for drawing boxes
        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 and location filter flags
        Color component selection flags
        16-bit conversion flags
        Rotation and shear flags
        Affine transform order flags
        Grayscale filling flags
        Flags for setting to white or black
        Flags for getting white or black pixel value
        Flags for 8 and 16 bit pixel sums
        Dithering flags
        Distance flags
        Value flags
        Statistical measures
        Set selection flags
        Text orientation flags
        Edge orientation flags
        Line orientation flags
        Image orientation flags
        Scan direction flags
        Box size adjustment flags
        Flags for modifying box boundaries using a second box
        Handling overlapping bounding boxes in boxa
        Flags for replacing invalid boxes
        Horizontal warp
        Pixel selection for resampling
        Thinning flags
        Runlength flags
        Edge filter flags
        Subpixel color component ordering in LCD display
        HSV histogram flags
        Region flags (inclusion, exclusion)
        Flags for adding text to a pix
        Flags for plotting on a pix
        Flags for selecting display program
        Flags in the 'special' pix field for non-default operations
        Handling negative values in conversion to unsigned int
        Relative to zero flags
        Flags for adding or removing traling slash from string
  (3) This file has typedefs for the pix allocator and deallocator functions
        alloc_fn()
        dealloc_fn().

Definition in file pix.h.

Macro Definition Documentation

◆ BOXA_VERSION_NUMBER

#define BOXA_VERSION_NUMBER   2

Version for Boxa serialization

Definition at line 450 of file pix.h.

Referenced by boxaReadStream(), and boxaWriteStream().

◆ BOXAA_VERSION_NUMBER

#define BOXAA_VERSION_NUMBER   3

Version for Boxaa serialization

Definition at line 451 of file pix.h.

Referenced by boxaaReadStream(), and boxaaWriteStream().

◆ DPIX_VERSION_NUMBER

#define DPIX_VERSION_NUMBER   2

Version for DPix serialization

Definition at line 610 of file pix.h.

Referenced by dpixReadStream(), and dpixWriteStream().

◆ FPIX_VERSION_NUMBER

#define FPIX_VERSION_NUMBER   2

Version for FPix serialization

Definition at line 579 of file pix.h.

Referenced by fpixReadStream(), and fpixWriteStream().

◆ PIX_CLR

#define PIX_CLR   (0x0)

clear pixels

Definition at line 330 of file pix.h.

Referenced by pixClearInRect(), pixHMT(), pixMakeFrameMask(), and pixSetOrClearBorder().

◆ PIX_DST

#define PIX_DST   (0xa)

◆ PIX_MASK

#define PIX_MASK   (PIX_SRC & PIX_DST)

mask = src & dst

Definition at line 334 of file pix.h.

◆ PIX_NOT

#define PIX_NOT (   op)    ((op) ^ 0x0f)

invert operation op

Definition at line 329 of file pix.h.

Referenced by kernelDisplayInPix(), pixHMT(), pixRemoveWithIndicator(), and selDisplayInPix().

◆ PIX_PAINT

#define PIX_PAINT   (PIX_SRC | PIX_DST)

paint = src | dst

Definition at line 333 of file pix.h.

Referenced by pixMorphSequenceByComponent().

◆ PIX_SET

#define PIX_SET   (0xf)

set pixels

Definition at line 331 of file pix.h.

Referenced by boxaGetCoverage(), pixMakeFrameMask(), and pixSetOrClearBorder().

◆ PIX_SRC

◆ PIX_SUBTRACT

#define PIX_SUBTRACT   (PIX_DST & PIX_NOT(PIX_SRC))

subtract = src & !dst

Definition at line 335 of file pix.h.

◆ PIX_XOR

#define PIX_XOR   (PIX_SRC ^ PIX_DST)

xor = src ^ dst

Definition at line 337 of file pix.h.

Referenced by ccbaDisplayImage1(), and ccbaDisplayImage2().

◆ PIXA_VERSION_NUMBER

#define PIXA_VERSION_NUMBER   2

Version for Pixa serialization

Definition at line 449 of file pix.h.

Referenced by pixaReadStream(), and pixaWriteStream().

◆ PIXAA_VERSION_NUMBER

#define PIXAA_VERSION_NUMBER   2

Version for Pixaa serialization

Definition at line 448 of file pix.h.

Referenced by pixaaReadStream(), and pixaaWriteStream().

◆ PIXACOMP_VERSION_NUMBER

#define PIXACOMP_VERSION_NUMBER   2

Version for PixaComp serialization

Definition at line 655 of file pix.h.

Referenced by pixacompReadStream(), and pixacompWriteStream().

◆ PTA_VERSION_NUMBER

#define PTA_VERSION_NUMBER   1

Version for Pta serialization

Definition at line 514 of file pix.h.

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

Typedef Documentation

◆ alloc_fn

typedef void*(* alloc_fn) (size_t)

Allocator function type

Definition at line 1336 of file pix.h.

◆ dealloc_fn

typedef void(* dealloc_fn) (void *)

Deallocator function type

Definition at line 1339 of file pix.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

Colors for 32 bpp

Enumerator
COLOR_RED 

red color index in RGBA_QUAD

COLOR_GREEN 

green color index in RGBA_QUAD

COLOR_BLUE 

blue color index in RGBA_QUAD

L_ALPHA_CHANNEL 

alpha value index in RGBA_QUAD

Definition at line 200 of file pix.h.

◆ anonymous enum

anonymous enum

Colors for drawing boxes

Enumerator
L_DRAW_RED 

draw in red

L_DRAW_GREEN 

draw in green

L_DRAW_BLUE 

draw in blue

L_DRAW_SPECIFIED 

draw specified color

L_DRAW_RGB 

draw as sequence of r,g,b

L_DRAW_RANDOM 

draw randomly chosen colors

Definition at line 221 of file pix.h.

◆ anonymous enum

anonymous enum

Flags for colormap conversion

Enumerator
REMOVE_CMAP_TO_BINARY 

remove colormap for conv to 1 bpp

REMOVE_CMAP_TO_GRAYSCALE 

remove colormap for conv to 8 bpp

REMOVE_CMAP_TO_FULL_COLOR 

remove colormap for conv to 32 bpp

REMOVE_CMAP_WITH_ALPHA 

remove colormap and alpha

REMOVE_CMAP_BASED_ON_SRC 

remove depending on src format

Definition at line 252 of file pix.h.

◆ anonymous enum

anonymous enum

Access and storage flags

Enumerator
L_NOCOPY 

do not copy the object; do not delete the ptr

L_INSERT 

stuff it in; do not copy or clone

L_COPY 

make/use a copy of the object

L_CLONE 

make/use clone (ref count) of the object

L_COPY_CLONE 

make a new array object (e.g., pixa) and fill the array with clones (e.g., pix)

Definition at line 715 of file pix.h.

◆ anonymous enum

anonymous enum

Sort mode flags

Enumerator
L_SHELL_SORT 

use shell sort

L_BIN_SORT 

use bin sort

Definition at line 730 of file pix.h.

◆ anonymous enum

anonymous enum

Sort order flags

Enumerator
L_SORT_INCREASING 

sort in increasing order

L_SORT_DECREASING 

sort in decreasing order

Definition at line 736 of file pix.h.

◆ anonymous enum

anonymous enum

Sort type flags

Enumerator
L_SORT_BY_X 

sort box or c.c. by left edge location

L_SORT_BY_Y 

sort box or c.c. by top edge location

L_SORT_BY_RIGHT 

sort box or c.c. by right edge location

L_SORT_BY_BOT 

sort box or c.c. by bot edge location

L_SORT_BY_WIDTH 

sort box or c.c. by width

L_SORT_BY_HEIGHT 

sort box or c.c. by height

L_SORT_BY_MIN_DIMENSION 

sort box or c.c. by min dimension

L_SORT_BY_MAX_DIMENSION 

sort box or c.c. by max dimension

L_SORT_BY_PERIMETER 

sort box or c.c. by perimeter

L_SORT_BY_AREA 

sort box or c.c. by area

L_SORT_BY_ASPECT_RATIO 

sort box or c.c. by width/height ratio

Definition at line 742 of file pix.h.

◆ anonymous enum

anonymous enum

Blend flags

Enumerator
L_BLEND_WITH_INVERSE 

add some of src inverse to itself

L_BLEND_TO_WHITE 

shift src colors towards white

L_BLEND_TO_BLACK 

shift src colors towards black

L_BLEND_GRAY 

blend src directly with blender

L_BLEND_GRAY_WITH_INVERSE 

add amount of src inverse to itself, based on blender pix value

Definition at line 762 of file pix.h.

◆ anonymous enum

anonymous enum
Enumerator
L_PAINT_LIGHT 

colorize non-black pixels

L_PAINT_DARK 

colorize non-white pixels

Definition at line 771 of file pix.h.

◆ anonymous enum

anonymous enum

Graphics pixel setting

Enumerator
L_SET_PIXELS 

set all bits in each pixel to 1

L_CLEAR_PIXELS 

set all bits in each pixel to 0

L_FLIP_PIXELS 

flip all bits in each pixel

Definition at line 782 of file pix.h.

◆ anonymous enum

anonymous enum

Size comparison filter flags

Enumerator
L_SELECT_IF_LT 

save if value is less than threshold

L_SELECT_IF_GT 

save if value is more than threshold

L_SELECT_IF_LTE 

save if value is <= to the threshold

L_SELECT_IF_GTE 

save if value is >= to the threshold

Definition at line 794 of file pix.h.

◆ anonymous enum

anonymous enum

Size selection flags for 1 bpp pix foreground components

Enumerator
L_SELECT_BY_WIDTH 

select by width

L_SELECT_BY_HEIGHT 

select by height

L_SELECT_BY_MAX_DIMENSION 

select by max of width and height

L_SELECT_BY_AREA 

select by foreground area

L_SELECT_BY_PERIMETER 

select by perimeter

Definition at line 802 of file pix.h.

◆ anonymous enum

anonymous enum

Location filter flags

Enumerator
L_SELECT_WIDTH 

width must satisfy constraint

L_SELECT_HEIGHT 

height must satisfy constraint

L_SELECT_XVAL 

x value satisfy constraint

L_SELECT_YVAL 

y value must satisfy constraint

L_SELECT_IF_EITHER 

either width or height (or xval or yval) can satisfy

L_SELECT_IF_BOTH 

both width and height (or xval and yval must satisfy

Definition at line 811 of file pix.h.

◆ anonymous enum

anonymous enum

Boxa modification flags

Enumerator
L_CHECK_WIDTH 

check and possibly modify width

L_CHECK_HEIGHT 

check and possibly modify height

L_CHECK_BOTH 

check and possibly modify both

Definition at line 823 of file pix.h.

◆ anonymous enum

anonymous enum

Color component selection flags

Enumerator
L_SELECT_RED 

use red component

L_SELECT_GREEN 

use green component

L_SELECT_BLUE 

use blue component

L_SELECT_MIN 

use min color component

L_SELECT_MAX 

use max color component

L_SELECT_AVERAGE 

use average of color components

L_SELECT_HUE 

use hue value (in HSV color space)

L_SELECT_SATURATION 

use saturation value (in HSV space)

Definition at line 835 of file pix.h.

◆ anonymous enum

anonymous enum

16-bit conversion flags

Enumerator
L_LS_BYTE 

use LSB

L_MS_BYTE 

use MSB

L_AUTO_BYTE 

use LSB if max(val) < 256; else MSB

L_CLIP_TO_FF 

use max(val, 255)

L_LS_TWO_BYTES 

use two LSB

L_MS_TWO_BYTES 

use two MSB

L_CLIP_TO_FFFF 

use max(val, 65535)

Definition at line 852 of file pix.h.

◆ anonymous enum

anonymous enum

Rotate flags

Enumerator
L_ROTATE_AREA_MAP 

use area map rotation, if possible

L_ROTATE_SHEAR 

use shear rotation

L_ROTATE_SAMPLING 

use sampling

Definition at line 868 of file pix.h.

◆ anonymous enum

anonymous enum

Background flags

Enumerator
L_BRING_IN_WHITE 

bring in white pixels from the outside

L_BRING_IN_BLACK 

bring in black pixels from the outside

Definition at line 875 of file pix.h.

◆ anonymous enum

anonymous enum

Shear flags

Enumerator
L_SHEAR_ABOUT_CORNER 

shear image about UL corner

L_SHEAR_ABOUT_CENTER 

shear image about center

Definition at line 881 of file pix.h.

◆ anonymous enum

anonymous enum

Affine transform order flags

Enumerator
L_TR_SC_RO 

translate, scale, rotate

L_SC_RO_TR 

scale, rotate, translate

L_RO_TR_SC 

rotate, translate, scale

L_TR_RO_SC 

translate, rotate, scale

L_RO_SC_TR 

rotate, scale, translate

L_SC_TR_RO 

scale, translate, rotate

Definition at line 892 of file pix.h.

◆ anonymous enum

anonymous enum

Grayscale filling flags

Enumerator
L_FILL_WHITE 

fill white pixels (e.g, in fg map)

L_FILL_BLACK 

fill black pixels (e.g., in bg map)

Definition at line 907 of file pix.h.

◆ anonymous enum

anonymous enum

Flags for setting to white or black

Enumerator
L_SET_WHITE 

set pixels to white

L_SET_BLACK 

set pixels to black

Definition at line 918 of file pix.h.

◆ anonymous enum

anonymous enum

Flags for getting white or black value

Enumerator
L_GET_WHITE_VAL 

get white pixel value

L_GET_BLACK_VAL 

get black pixel value

Definition at line 929 of file pix.h.

◆ anonymous enum

anonymous enum

Flags for 8 bit and 16 bit pixel sums

Enumerator
L_WHITE_IS_MAX 

white pixels are 0xff or 0xffff; black are 0

L_BLACK_IS_MAX 

black pixels are 0xff or 0xffff; white are 0

Definition at line 940 of file pix.h.

◆ anonymous enum

anonymous enum

Dither parameters

Enumerator
DEFAULT_CLIP_LOWER_1 

dist to black with no prop; 1 bpp

DEFAULT_CLIP_UPPER_1 

dist to black with no prop; 1 bpp

DEFAULT_CLIP_LOWER_2 

dist to black with no prop; 2 bpp

DEFAULT_CLIP_UPPER_2 

dist to black with no prop; 2 bpp

Definition at line 953 of file pix.h.

◆ anonymous enum

anonymous enum

Distance flags

Enumerator
L_MANHATTAN_DISTANCE 

L1 distance (e.g., in color space)

L_EUCLIDEAN_DISTANCE 

L2 distance

Definition at line 966 of file pix.h.

◆ anonymous enum

anonymous enum

Value flags

Enumerator
L_NEGATIVE 

values < 0

L_NON_NEGATIVE 

values >= 0

L_POSITIVE 

values > 0

L_NON_POSITIVE 

values <= 0

L_ZERO 

values = 0

L_ALL 

all values

Definition at line 977 of file pix.h.

◆ anonymous enum

anonymous enum

Statistical measures

Enumerator
L_MEAN_ABSVAL 

average of abs values

L_MEDIAN_VAL 

median value of set

L_MODE_VAL 

mode value of set

L_MODE_COUNT 

mode count of set

L_ROOT_MEAN_SQUARE 

rms of values

L_STANDARD_DEVIATION 

standard deviation from mean

L_VARIANCE 

variance of values

Definition at line 992 of file pix.h.

◆ anonymous enum

anonymous enum

Set selection flags

Enumerator
L_CHOOSE_CONSECUTIVE 

select 'n' consecutive

L_CHOOSE_SKIP_BY 

select at intervals of 'n'

Definition at line 1008 of file pix.h.

◆ anonymous enum

anonymous enum

Text orientation flags

Enumerator
L_TEXT_ORIENT_UNKNOWN 

low confidence on text orientation

L_TEXT_ORIENT_UP 

portrait, text rightside-up

L_TEXT_ORIENT_LEFT 

landscape, text up to left

L_TEXT_ORIENT_DOWN 

portrait, text upside-down

L_TEXT_ORIENT_RIGHT 

landscape, text up to right

Definition at line 1019 of file pix.h.

◆ anonymous enum

anonymous enum

Edge orientation flags

Enumerator
L_HORIZONTAL_EDGES 

filters for horizontal edges

L_VERTICAL_EDGES 

filters for vertical edges

L_ALL_EDGES 

filters for all edges

Definition at line 1033 of file pix.h.

◆ anonymous enum

anonymous enum

Line orientation flags

Enumerator
L_HORIZONTAL_LINE 

horizontal line

L_POS_SLOPE_LINE 

45 degree line with positive slope

L_VERTICAL_LINE 

vertical line

L_NEG_SLOPE_LINE 

45 degree line with negative slope

L_OBLIQUE_LINE 

neither horizontal nor vertical

Definition at line 1045 of file pix.h.

◆ anonymous enum

anonymous enum

Image orientation flags

Enumerator
L_PORTRAIT_MODE 

typical: page is viewed with height > width

L_LANDSCAPE_MODE 

page is viewed at 90 deg to portrait mode

Definition at line 1059 of file pix.h.

◆ anonymous enum

anonymous enum

Scan direction flags

Enumerator
L_FROM_LEFT 

scan from left

L_FROM_RIGHT 

scan from right

L_FROM_TOP 

scan from top

L_FROM_BOT 

scan from bottom

L_SCAN_NEGATIVE 

scan in negative direction

L_SCAN_POSITIVE 

scan in positive direction

L_SCAN_BOTH 

scan in both directions

L_SCAN_HORIZONTAL 

horizontal scan (direction unimportant)

L_SCAN_VERTICAL 

vertical scan (direction unimportant)

Definition at line 1070 of file pix.h.

◆ anonymous enum

anonymous enum

Box size adjustment and location flags

Enumerator
L_ADJUST_SKIP 

do not adjust

L_ADJUST_LEFT 

adjust left edge

L_ADJUST_RIGHT 

adjust right edge

L_ADJUST_LEFT_AND_RIGHT 

adjust both left and right edges

L_ADJUST_TOP 

adjust top edge

L_ADJUST_BOT 

adjust bottom edge

L_ADJUST_TOP_AND_BOT 

adjust both top and bottom edges

L_ADJUST_CHOOSE_MIN 

choose the min median value

L_ADJUST_CHOOSE_MAX 

choose the max median value

L_SET_LEFT 

set left side to a given value

L_SET_RIGHT 

set right side to a given value

L_SET_TOP 

set top side to a given value

L_SET_BOT 

set bottom side to a given value

L_GET_LEFT 

get left side location

L_GET_RIGHT 

get right side location

L_GET_TOP 

get top side location

L_GET_BOT 

get bottom side location

Definition at line 1088 of file pix.h.

◆ anonymous enum

anonymous enum

Flags for modifying box boundaries using a second box

Enumerator
L_USE_MINSIZE 

use boundaries giving min size

L_USE_MAXSIZE 

use boundaries giving max size

L_SUB_ON_LOC_DIFF 

modify boundary if big location diff

L_SUB_ON_SIZE_DIFF 

modify boundary if big size diff

L_USE_CAPPED_MIN 

modify boundary with capped min

L_USE_CAPPED_MAX 

modify boundary with capped max

Definition at line 1114 of file pix.h.

◆ anonymous enum

anonymous enum

Handling overlapping bounding boxes in Boxa

Enumerator
L_COMBINE 

resize to bounding region; remove smaller

L_REMOVE_SMALL 

only remove smaller

Definition at line 1128 of file pix.h.

◆ anonymous enum

anonymous enum

Flags for replacing invalid boxes

Enumerator
L_USE_ALL_BOXES 

consider all boxes in the sequence

L_USE_SAME_PARITY_BOXES 

consider boxes with the same parity

Definition at line 1138 of file pix.h.

◆ anonymous enum

anonymous enum

Horizontal warp direction

Enumerator
L_WARP_TO_LEFT 

increasing stretch or contraction to left

L_WARP_TO_RIGHT 

increasing stretch or contraction to right

Definition at line 1148 of file pix.h.

◆ anonymous enum

anonymous enum

Horizontal warp stretch mode

Enumerator
L_LINEAR_WARP 

stretch or contraction grows linearly

L_QUADRATIC_WARP 

stretch or contraction grows quadratically

Definition at line 1154 of file pix.h.

◆ anonymous enum

anonymous enum

Pixel selection for resampling

Enumerator
L_INTERPOLATED 

linear interpolation from src pixels

L_SAMPLED 

nearest src pixel sampling only

Definition at line 1165 of file pix.h.

◆ anonymous enum

anonymous enum

Thinning flags

Enumerator
L_THIN_FG 

thin foreground of 1 bpp image

L_THIN_BG 

thin background of 1 bpp image

Definition at line 1176 of file pix.h.

◆ anonymous enum

anonymous enum

Runlength flags

Enumerator
L_HORIZONTAL_RUNS 

determine runlengths of horizontal runs

L_VERTICAL_RUNS 

determine runlengths of vertical runs

Definition at line 1187 of file pix.h.

◆ anonymous enum

anonymous enum

Edge filter flags

Enumerator
L_SOBEL_EDGE 

Sobel edge filter

L_TWO_SIDED_EDGE 

Two-sided edge filter

Definition at line 1198 of file pix.h.

◆ anonymous enum

anonymous enum

Subpixel color component ordering in LC display

Enumerator
L_SUBPIXEL_ORDER_RGB 

sensor order left-to-right RGB

L_SUBPIXEL_ORDER_BGR 

sensor order left-to-right BGR

L_SUBPIXEL_ORDER_VRGB 

sensor order top-to-bottom RGB

L_SUBPIXEL_ORDER_VBGR 

sensor order top-to-bottom BGR

Definition at line 1209 of file pix.h.

◆ anonymous enum

anonymous enum

HSV histogram flags

Enumerator
L_HS_HISTO 

Use hue-saturation histogram

L_HV_HISTO 

Use hue-value histogram

L_SV_HISTO 

Use saturation-value histogram

Definition at line 1222 of file pix.h.

◆ anonymous enum

anonymous enum

Region flags (inclusion, exclusion)

Enumerator
L_INCLUDE_REGION 

Use hue-saturation histogram

L_EXCLUDE_REGION 

Use hue-value histogram

Definition at line 1234 of file pix.h.

◆ anonymous enum

anonymous enum

Flags for adding text to a Pix

Enumerator
L_ADD_ABOVE 

Add text above the image

L_ADD_BELOW 

Add text below the image

L_ADD_LEFT 

Add text to the left of the image

L_ADD_RIGHT 

Add text to the right of the image

L_ADD_AT_TOP 

Add text over the top of the image

L_ADD_AT_BOT 

Add text over the bottom of the image

L_ADD_AT_LEFT 

Add text over left side of the image

L_ADD_AT_RIGHT 

Add text over right side of the image

Definition at line 1245 of file pix.h.

◆ anonymous enum

anonymous enum

Flags for plotting on a Pix

Enumerator
L_PLOT_AT_TOP 

Plot horizontally at top

L_PLOT_AT_MID_HORIZ 

Plot horizontally at middle

L_PLOT_AT_BOT 

Plot horizontally at bottom

L_PLOT_AT_LEFT 

Plot vertically at left

L_PLOT_AT_MID_VERT 

Plot vertically at middle

L_PLOT_AT_RIGHT 

Plot vertically at right

Definition at line 1262 of file pix.h.

◆ anonymous enum

anonymous enum

Flags for selecting display program

Enumerator
L_DISPLAY_WITH_XZGV 

Use xzgv with pixDisplay()

L_DISPLAY_WITH_XLI 

Use xli with pixDisplay()

L_DISPLAY_WITH_XV 

Use xv with pixDisplay()

L_DISPLAY_WITH_IV 

Use irfvanview (win) with pixDisplay()

L_DISPLAY_WITH_OPEN 

Use open (apple) with pixDisplay()

Definition at line 1277 of file pix.h.

◆ anonymous enum

anonymous enum

Flags used in Pix::special

Enumerator
L_NO_CHROMA_SAMPLING_JPEG 

Write full resolution chroma

Definition at line 1293 of file pix.h.

◆ anonymous enum

anonymous enum

Handling negative values in conversion to unsigned int

Enumerator
L_CLIP_TO_ZERO 

Clip negative values to 0

L_TAKE_ABSVAL 

Convert to positive using L_ABS()

Definition at line 1303 of file pix.h.

◆ anonymous enum

anonymous enum

Relative to zero flags

Enumerator
L_LESS_THAN_ZERO 

Choose values less than zero

L_EQUAL_TO_ZERO 

Choose values equal to zero

L_GREATER_THAN_ZERO 

Choose values greater than zero

Definition at line 1314 of file pix.h.

◆ anonymous enum

anonymous enum

Flags for adding or removing traling slash from string

Enumerator
L_ADD_TRAIL_SLASH 

Add trailing slash to string

L_REMOVE_TRAIL_SLASH 

Remove trailing slash from string

Definition at line 1326 of file pix.h.

Variable Documentation

◆ L_ALPHA_SHIFT

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

Definition at line 213 of file pix.h.

◆ L_BLUE_SHIFT

const l_int32 L_BLUE_SHIFT
static
Initial value:
=
8 * (sizeof(l_uint32) - 1 - COLOR_BLUE)

Definition at line 211 of file pix.h.

◆ L_BLUE_WEIGHT

const l_float32 L_BLUE_WEIGHT = 0.2f
static

Percept. weight for blue

Definition at line 245 of file pix.h.

◆ L_GREEN_SHIFT

const l_int32 L_GREEN_SHIFT
static
Initial value:
=
8 * (sizeof(l_uint32) - 1 - COLOR_GREEN)

Definition at line 209 of file pix.h.

◆ L_GREEN_WEIGHT

const l_float32 L_GREEN_WEIGHT = 0.5f
static

Percept. weight for green

Definition at line 244 of file pix.h.

◆ L_RED_SHIFT

const l_int32 L_RED_SHIFT
static
Initial value:
=
8 * (sizeof(l_uint32) - 1 - COLOR_RED)
Definition: pix.h:201

Definition at line 207 of file pix.h.

◆ L_RED_WEIGHT

const l_float32 L_RED_WEIGHT = 0.3f
static

Percept. weight for red

Definition at line 243 of file pix.h.