Changeset 20745 in project


Ignore:
Timestamp:
10/09/10 13:53:39 (11 years ago)
Author:
petercrlane
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/eggref/4/leptonica

    r20744 r20745  
    167167Returns an array of bounding boxes corresponding to the components within {{pix}}.  {{pix}} must be a 1 bpp image.
    168168
     169<procedure>(pix-conn-comp-pixa pix connectivity)</procedure>
     170Returns two values: an array of bounding boxes (type {{BOXA}}) and an array of pix images (type {{PIXA}}).  The bounding boxes and images are the components within the given {{pix}}.  {{pix}} must be a 1 bpp image.
     171
    169172<procedure>(pix-count-conn-comp pix connectivity)</procedure>
    170173Returns the number of connected components, or {{#f}} if there was an error.  {{pix}} must be a 1 bpp image.
    171174
     175==== Boxes
     176
     177Boxes are used within Leptonica to hold information about regions of an image.  These boxes can be stored as arrays.  The following procedures let you work with boxes and box arrays, extracting information from them and subobjects.
     178
     179{{box}} stands for an instance of the {{BOX}} structure within the C-code.
     180
     181{{boxa}} stands for an instance of the {{BOXA}} structure, an array of boxes.
     182
     183<procedure>(box-get-geometry box)</procedure>
     184Returns four values: the x, y, width, height of the box in pixel coordinates.  Returns {{#f}} on error.
     185
     186<procedure>(box-set-geometry box x y w h)</procedure>
     187Sets the values of x, y, width and height of the given {{box}} in pixels.  Returns 0 if OK, or 1 if error.
     188
     189<procedure>(boxa-get-box boxa index copy-type)</procedure>
     190Return a pointer to the indexed box in the box array: {{copy-type}} is a constant, as defined below, and determines if the box is returned as a copy or a clone.  Returns {{#f}} on error.
     191
     192<procedure>(boxa-get-count boxa)</procedure>
     193Returns a count of the number of boxes within the box array.
     194
     195==== Pix arrays
     196
     197The {{PIXA}} structure can be explored using the following procedures:
     198
     199<procedure>(pixa-get-count pixa)</procedure>
     200Returns the number of pix images in the pix array.
     201
     202<procedure>(pixa-get-pix pixa index copy-type)</procedure>
     203Returns a pointer to the indexed pix in the pix array: {{copy-type}} is a constant, as defined below, and determines if the pix is returned as a copy or a clone.  Returns {{#f}} on error.
     204
    172205==== Constants
    173206
    174207; choose-type : L-CHOOSE-MAX, L-CHOOSE-MIN
     208; copy-type : L-COPY L-CLONE
    175209; image-type : IFF-UNKNOWN, IFF-BMP, IFF-JFIF-JPEG, IFF-PNG, IFF-TIFF, IFF-TIFF-PACKBITS, IFF-TIFF-RLE, IFF-TIFF-G3, IFF-TIFF-G4, IFF-TIFF-LZW, IFF-TIFF-ZIP, IFF-PNM, IFF-PS, IFF-GIF, IFF-JP2, IFF-DEFAULT, IFF-SPIX.
    176210; in-colour : L-BRING-IN-WHITE, L-BRING-IN-BLACK.
Note: See TracChangeset for help on using the changeset viewer.