Leptonica  1.82.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 ,
  L_SELECT_WEIGHTED = 9
}
 
enum  { L_INTERMED_DIFF = 1 , L_AVE_MAX_DIFF_2 = 2 , L_MAX_DIFF = 3 }
 
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_GEOMETRIC_UNION = 1 , L_GEOMETRIC_INTERSECTION = 2 , L_LARGEST_AREA = 3 , L_SMALLEST_AREA = 4 }
 
enum  { L_USE_ALL_BOXES = 1 , L_USE_SAME_PARITY_BOXES = 2 }
 
enum  {
  L_UPPER_LEFT = 1 , L_UPPER_RIGHT = 2 , L_LOWER_LEFT = 3 , L_LOWER_RIGHT = 4 ,
  L_BOX_CENTER = 5
}
 
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_USE_INNER = 1 , L_USE_OUTER = 2 }
 
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 RGBA
        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
        Color content 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
        Selecting or making a box from two (intersecting) boxes
        Flags for replacing invalid boxes
        Flags for box corners and center
        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 making simple masks
        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 trailing 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 451 of file pix.h.

◆ BOXAA_VERSION_NUMBER

#define BOXAA_VERSION_NUMBER   3

Version for Boxaa serialization

Definition at line 452 of file pix.h.

◆ DPIX_VERSION_NUMBER

#define DPIX_VERSION_NUMBER   2

Version for DPix serialization

Definition at line 606 of file pix.h.

◆ FPIX_VERSION_NUMBER

#define FPIX_VERSION_NUMBER   2

Version for FPix serialization

Definition at line 575 of file pix.h.

◆ PIX_CLR

#define PIX_CLR   (0x0)

clear pixels

Definition at line 333 of file pix.h.

◆ PIX_DST

#define PIX_DST   (0xa)

use destination pixels

Definition at line 331 of file pix.h.

◆ PIX_MASK

#define PIX_MASK   (PIX_SRC & PIX_DST)

mask = src & dst

Definition at line 337 of file pix.h.

◆ PIX_NOT

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

invert operation op

Definition at line 332 of file pix.h.

◆ PIX_PAINT

#define PIX_PAINT   (PIX_SRC | PIX_DST)

paint = src | dst

Definition at line 336 of file pix.h.

◆ PIX_SET

#define PIX_SET   (0xf)

set pixels

Definition at line 334 of file pix.h.

◆ PIX_SRC

#define PIX_SRC   (0xc)

use source pixels

Definition at line 330 of file pix.h.

◆ PIX_SUBTRACT

#define PIX_SUBTRACT   (PIX_DST & PIX_NOT(PIX_SRC))

subtract =
src & !dst

Definition at line 339 of file pix.h.

◆ PIX_XOR

#define PIX_XOR   (PIX_SRC ^ PIX_DST)

xor = src ^ dst

Definition at line 340 of file pix.h.

◆ PIXA_VERSION_NUMBER

#define PIXA_VERSION_NUMBER   2

Version for Pixa serialization

Definition at line 450 of file pix.h.

◆ PIXAA_VERSION_NUMBER

#define PIXAA_VERSION_NUMBER   2

Version for Pixaa serialization

Definition at line 449 of file pix.h.

◆ PIXACOMP_VERSION_NUMBER

#define PIXACOMP_VERSION_NUMBER   2

Version for PixaComp serialization

Definition at line 650 of file pix.h.

◆ PTA_VERSION_NUMBER

#define PTA_VERSION_NUMBER   1

Version for Pta serialization

Definition at line 513 of file pix.h.

Typedef Documentation

◆ alloc_fn

typedef void*(* alloc_fn) (size_t)

Allocator function type

Definition at line 1296 of file pix.h.

◆ dealloc_fn

typedef void(* dealloc_fn) (void *)

Deallocator function type

Definition at line 1299 of file pix.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

RGBA Color

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 203 of file pix.h.

◆ anonymous enum

anonymous enum

Box Color

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 224 of file pix.h.

◆ anonymous enum

anonymous enum

Cmap 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 255 of file pix.h.

◆ anonymous enum

anonymous enum

Object Access

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 709 of file pix.h.

◆ anonymous enum

anonymous enum

Sort Mode

Enumerator
L_SHELL_SORT 

use shell sort

L_BIN_SORT 

use bin sort

Definition at line 722 of file pix.h.

◆ anonymous enum

anonymous enum

Sort Order

Enumerator
L_SORT_INCREASING 

sort in increasing order

L_SORT_DECREASING 

sort in decreasing order

Definition at line 728 of file pix.h.

◆ anonymous enum

anonymous enum

Sort Type

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 734 of file pix.h.

◆ anonymous enum

anonymous enum

Blend Types

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 752 of file pix.h.

◆ anonymous enum

anonymous enum

Paint Selection

Enumerator
L_PAINT_LIGHT 

colorize non-black pixels

L_PAINT_DARK 

colorize non-white pixels

Definition at line 762 of file pix.h.

◆ anonymous enum

anonymous enum

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 771 of file pix.h.

◆ anonymous enum

anonymous enum

Size Comparison

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 781 of file pix.h.

◆ anonymous enum

anonymous enum

Size Selection

Enumerator
L_SELECT_BY_WIDTH 

select by width; 1 bpp

L_SELECT_BY_HEIGHT 

select by height; 1 bpp

L_SELECT_BY_MAX_DIMENSION 

select by max of width and
height; 1 bpp

L_SELECT_BY_AREA 

select by foreground area; 1 bpp

L_SELECT_BY_PERIMETER 

select by perimeter; 1 bpp

Definition at line 789 of file pix.h.

◆ anonymous enum

anonymous enum

Location Filter

Enumerator
L_SELECT_WIDTH 

width must satisfy constraint

L_SELECT_HEIGHT 

height must satisfy constraint

L_SELECT_XVAL 

x value must satisfy constraint

L_SELECT_YVAL 

y value must satisfy constraint

L_SELECT_IF_EITHER 

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

L_SELECT_IF_BOTH 

both width and height (or xval
and yval must satisfy constraint

Definition at line 799 of file pix.h.

◆ anonymous enum

anonymous enum

Boxa Check

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 811 of file pix.h.

◆ anonymous enum

anonymous enum

Color Selection

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)

L_SELECT_WEIGHTED 

use weighted average of color comps

Definition at line 821 of file pix.h.

◆ anonymous enum

anonymous enum

Color Content

Enumerator
L_INTERMED_DIFF 

intermediate of diff component values

L_AVE_MAX_DIFF_2 

diff average closest comps to third

L_MAX_DIFF 

maximum diff of component values

Definition at line 837 of file pix.h.

◆ anonymous enum

anonymous enum

16-bit Conversion

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 847 of file pix.h.

◆ anonymous enum

anonymous enum

Rotation Type

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 861 of file pix.h.

◆ anonymous enum

anonymous enum

Background Color

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 868 of file pix.h.

◆ anonymous enum

anonymous enum

Shear Point

Enumerator
L_SHEAR_ABOUT_CORNER 

shear image about UL corner

L_SHEAR_ABOUT_CENTER 

shear image about center

Definition at line 874 of file pix.h.

◆ anonymous enum

anonymous enum

Affine Transform Order

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 883 of file pix.h.

◆ anonymous enum

anonymous enum

Grayscale Fill

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 896 of file pix.h.

◆ anonymous enum

anonymous enum

BlackWhite Set

Enumerator
L_SET_WHITE 

set pixels to white

L_SET_BLACK 

set pixels to black

Definition at line 905 of file pix.h.

◆ anonymous enum

anonymous enum

BlackWhite Get

Enumerator
L_GET_WHITE_VAL 

get white pixel value

L_GET_BLACK_VAL 

get black pixel value

Definition at line 914 of file pix.h.

◆ anonymous enum

anonymous enum

BlackWhite Sum

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 923 of file pix.h.

◆ anonymous enum

anonymous enum

Dither Distance

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 934 of file pix.h.

◆ anonymous enum

anonymous enum

Distance Type

Enumerator
L_MANHATTAN_DISTANCE 

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

L_EUCLIDEAN_DISTANCE 

L2 distance

Definition at line 945 of file pix.h.

◆ anonymous enum

anonymous enum

Distance Value

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 954 of file pix.h.

◆ anonymous enum

anonymous enum

Stats Type

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 967 of file pix.h.

◆ anonymous enum

anonymous enum

Index Selection

Enumerator
L_CHOOSE_CONSECUTIVE 

select 'n' consecutive

L_CHOOSE_SKIP_BY 

select at intervals of 'n'

Definition at line 981 of file pix.h.

◆ anonymous enum

anonymous enum

Text Orientation

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 990 of file pix.h.

◆ anonymous enum

anonymous enum

Edge Orientation

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 1002 of file pix.h.

◆ anonymous enum

anonymous enum

Line Orientation

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 1012 of file pix.h.

◆ anonymous enum

anonymous enum

Image Orientation

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 1024 of file pix.h.

◆ anonymous enum

anonymous enum

Scan Direction

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 1033 of file pix.h.

◆ anonymous enum

anonymous enum

Box Adjustment

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 1049 of file pix.h.

◆ anonymous enum

anonymous enum

Box Boundary Mod

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 1073 of file pix.h.

◆ anonymous enum

anonymous enum

Box Overlap Mod

Enumerator
L_COMBINE 

resize to bounding region; remove smaller

L_REMOVE_SMALL 

only remove smaller

Definition at line 1086 of file pix.h.

◆ anonymous enum

anonymous enum

Box Combine or Select

Enumerator
L_GEOMETRIC_UNION 

use union of two boxes

L_GEOMETRIC_INTERSECTION 

use intersection of two boxes

L_LARGEST_AREA 

use box with largest area

L_SMALLEST_AREA 

use box with smallest area

Definition at line 1095 of file pix.h.

◆ anonymous enum

anonymous enum

Box Replacement

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 1106 of file pix.h.

◆ anonymous enum

anonymous enum

Box Corners and Center

Enumerator
L_UPPER_LEFT 

UL corner

L_UPPER_RIGHT 

UR corner

L_LOWER_LEFT 

LL corner

L_LOWER_RIGHT 

LR corner

L_BOX_CENTER 

center

Definition at line 1115 of file pix.h.

◆ anonymous enum

anonymous enum

Horiz Warp Stretch

Enumerator
L_WARP_TO_LEFT 

increasing stretch or contraction to left

L_WARP_TO_RIGHT 

increasing stretch or contraction to right

Definition at line 1127 of file pix.h.

◆ anonymous enum

anonymous enum

Horiz Warp Mode

Enumerator
L_LINEAR_WARP 

stretch or contraction grows linearly

L_QUADRATIC_WARP 

stretch or contraction grows quadratically

Definition at line 1133 of file pix.h.

◆ anonymous enum

anonymous enum

Pixel Selection

Enumerator
L_INTERPOLATED 

linear interpolation from src pixels

L_SAMPLED 

nearest src pixel sampling only

Definition at line 1142 of file pix.h.

◆ anonymous enum

anonymous enum

Thinning Polarity

Enumerator
L_THIN_FG 

thin foreground of 1 bpp image

L_THIN_BG 

thin background of 1 bpp image

Definition at line 1151 of file pix.h.

◆ anonymous enum

anonymous enum

Runlength Direction

Enumerator
L_HORIZONTAL_RUNS 

determine runlengths of horizontal runs

L_VERTICAL_RUNS 

determine runlengths of vertical runs

Definition at line 1160 of file pix.h.

◆ anonymous enum

anonymous enum

Edge Filter

Enumerator
L_SOBEL_EDGE 

Sobel edge filter

L_TWO_SIDED_EDGE 

Two-sided edge filter

Definition at line 1169 of file pix.h.

◆ anonymous enum

anonymous enum

Subpixel Color Order

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 1178 of file pix.h.

◆ anonymous enum

anonymous enum

HSV Histogram

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 1189 of file pix.h.

◆ anonymous enum

anonymous enum

HSV Region

Enumerator
L_INCLUDE_REGION 

Use pixels with specified HSV region

L_EXCLUDE_REGION 

Use pixels outside HSV region

Definition at line 1199 of file pix.h.

◆ anonymous enum

anonymous enum

Add Text Location

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 1208 of file pix.h.

◆ anonymous enum

anonymous enum

Pix Plot

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 1223 of file pix.h.

◆ anonymous enum

anonymous enum

Mask Generation

Enumerator
L_USE_INNER 

Select the interior part

L_USE_OUTER 

Select the outer part (e.g., a frame)

Definition at line 1236 of file pix.h.

◆ anonymous enum

anonymous enum

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 1245 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 1260 of file pix.h.

◆ anonymous enum

anonymous enum

Negative Value

Enumerator
L_CLIP_TO_ZERO 

Clip negative values to 0

L_TAKE_ABSVAL 

Convert to positive using L_ABS()

Definition at line 1268 of file pix.h.

◆ anonymous enum

anonymous enum

Relative To Zero

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 1277 of file pix.h.

◆ anonymous enum

anonymous enum

Trailing Slash

Enumerator
L_ADD_TRAIL_SLASH 

Add trailing slash to string

L_REMOVE_TRAIL_SLASH 

Remove trailing slash from string

Definition at line 1287 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)
@ L_ALPHA_CHANNEL
Definition: pix.h:207

Definition at line 216 of file pix.h.

◆ L_BLUE_SHIFT

const l_int32 L_BLUE_SHIFT
static
Initial value:
=
8 * (sizeof(l_uint32) - 1 - COLOR_BLUE)
@ COLOR_BLUE
Definition: pix.h:206

Definition at line 214 of file pix.h.

◆ L_BLUE_WEIGHT

const l_float32 L_BLUE_WEIGHT = 0.2f
static

Percept. weight for blue

Definition at line 248 of file pix.h.

◆ L_GREEN_SHIFT

const l_int32 L_GREEN_SHIFT
static
Initial value:
=
8 * (sizeof(l_uint32) - 1 - COLOR_GREEN)
@ COLOR_GREEN
Definition: pix.h:205

Definition at line 212 of file pix.h.

◆ L_GREEN_WEIGHT

const l_float32 L_GREEN_WEIGHT = 0.5f
static

Percept. weight for green

Definition at line 247 of file pix.h.

◆ L_RED_SHIFT

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

Definition at line 210 of file pix.h.

◆ L_RED_WEIGHT

const l_float32 L_RED_WEIGHT = 0.3f
static

Percept. weight for red

Definition at line 246 of file pix.h.