Repository: tesseract-ocr/tesseract
File: src/ccstruct/publictypes.h (C/C++)

Code before:
};

/**
 * The text lines are read in the given sequence.
 *
 * In English, the order is top-to-bottom.
 * In Chinese, vertical text lines are read right-to-left.  Mongolian is
 * written in vertical columns top to bottom like Chinese, but the lines
 * order left-to right.
 *
 * Note that only some combinations make sense.  For example,
 * WRITING_DIRECTION_LEFT_TO_RIGHT implies TEXTLINE_ORDER_TOP_TO_BOTTOM
*/
enum TextlineOrder {
  TEXTLINE_ORDER_LEFT_TO_RIGHT = 0,
  TEXTLINE_ORDER_RIGHT_TO_LEFT = 1,
  TEXTLINE_ORDER_TOP_TO_BOTTOM = 2,
};

/**
 * Possible modes for page layout analysis. These *must* be kept in order
 * of decreasing amount of layout analysis to be done, except for OSD_ONLY,
 * so that the inequality test macros below work.
*/
enum PageSegMode {
  PSM_OSD_ONLY,       ///< 0 - Orientation and script detection only.
  PSM_AUTO_OSD,       ///< 1 - Automatic page segmentation with orientation and
                      ///< script detection. (OSD)
  PSM_AUTO_ONLY,      ///< 2 - Automatic page segmentation, but no OSD, or OCR.
  PSM_AUTO,           ///< 3 - Fully automatic page segmentation, but no OSD.
  PSM_SINGLE_COLUMN,  ///< 4 - Assume a single column of text of variable sizes.
  PSM_SINGLE_BLOCK_VERT_TEXT,  ///< 5 - Assume a single uniform block of vertically
                               ///< aligned text.
  PSM_SINGLE_BLOCK,   ///< 6 - Assume a single uniform block of text. (Default.)
  PSM_SINGLE_LINE,    ///< 7 - Treat the image as a single text line.
  PSM_SINGLE_WORD,    ///< 8 - Treat the image as a single word.
  PSM_CIRCLE_WORD,    ///< 9 - Treat the image as a single word in a circle.
  PSM_SINGLE_CHAR,    ///< 10 - Treat the image as a single character.
  PSM_SPARSE_TEXT,    ///< 11 - Find as much text as possible in no particular order.
  PSM_SPARSE_TEXT_OSD,  ///< 12 - Sparse text with orientation and script det.
  PSM_RAW_LINE,       ///< 13 - Treat the image as a single text line, bypassing
                      ///< hacks that are Tesseract-specific.

  PSM_COUNT           ///< Number of enum entries.
};

/**
 * Inline functions that act on a PageSegMode to determine whether components of
 * layout analysis are enabled.
 * *Depend critically on the order of elements of PageSegMode.*
 * NOTE that arg is an int for compatibility with INT_PARAM.

Review comment (suggestion):
```suggestion
  PSM_OSD_ONLY = 0,       ///< Orientation and script detection only.
```

Code after:
};

/**
 * The text lines are read in the given sequence.
 *
 * In English, the order is top-to-bottom.
 * In Chinese, vertical text lines are read right-to-left.  Mongolian is
 * written in vertical columns top to bottom like Chinese, but the lines
 * order left-to right.
 *
 * Note that only some combinations make sense.  For example,
 * WRITING_DIRECTION_LEFT_TO_RIGHT implies TEXTLINE_ORDER_TOP_TO_BOTTOM
*/
enum TextlineOrder {
  TEXTLINE_ORDER_LEFT_TO_RIGHT = 0,
  TEXTLINE_ORDER_RIGHT_TO_LEFT = 1,
  TEXTLINE_ORDER_TOP_TO_BOTTOM = 2,
};

/**
 * Possible modes for page layout analysis. These *must* be kept in order
 * of decreasing amount of layout analysis to be done, except for OSD_ONLY,
 * so that the inequality test macros below work.
*/
enum PageSegMode {
  PSM_OSD_ONLY = 0,       ///< Orientation and script detection only.
  PSM_AUTO_OSD = 1,       ///< Automatic page segmentation with orientation and
                      ///< script detection. (OSD)
  PSM_AUTO_ONLY = 2,      ///< Automatic page segmentation, but no OSD, or OCR.
  PSM_AUTO = 3,           ///< Fully automatic page segmentation, but no OSD.
  PSM_SINGLE_COLUMN = 4,  ///< Assume a single column of text of variable sizes.
  PSM_SINGLE_BLOCK_VERT_TEXT = 5,  ///< Assume a single uniform block of vertically
                               ///< aligned text.
  PSM_SINGLE_BLOCK = 6,   ///< Assume a single uniform block of text. (Default.)
  PSM_SINGLE_LINE = 7,    ///< Treat the image as a single text line.
  PSM_SINGLE_WORD = 8,    ///< Treat the image as a single word.
  PSM_CIRCLE_WORD = 9,    ///< Treat the image as a single word in a circle.
  PSM_SINGLE_CHAR = 10,    ///< Treat the image as a single character.
  PSM_SPARSE_TEXT = 11,    ///< Find as much text as possible in no particular order.
  PSM_SPARSE_TEXT_OSD = 12,  ///< Sparse text with orientation and script det.
  PSM_RAW_LINE = 13,       ///< Treat the image as a single text line, bypassing
                      ///< hacks that are Tesseract-specific.

  PSM_COUNT           ///< Number of enum entries.
};

/**
 * Inline functions that act on a PageSegMode to determine whether components of
 * layout analysis are enabled.
 * *Depend critically on the order of elements of PageSegMode.*
 * NOTE that arg is an int for compatibility with INT_PARAM.