Changeset 20747 in project


Ignore:
Timestamp:
10/09/10 14:10:54 (11 years ago)
Author:
petercrlane
Message:

version 0.2

Location:
release/4/leptonica
Files:
6 added
1 edited

Legend:

Unmodified
Added
Removed
  • release/4/leptonica/trunk/leptonica.scm

    r20741 r20747  
    2727    L-LINEAR-SCALE L-LOG-SCALE
    2828    L-CHOOSE-MIN L-CHOOSE-MAX L-CHOOSE-MAX-MIN-DIFF
     29    L-COPY L-CLONE
     30    box-get-geometry
     31    box-set-geometry
     32    boxa-get-box
     33    boxa-get-count
    2934    pix-create pix-copy pix-destroy
    3035    pix-get-width pix-set-width pix-get-height pix-set-height
     
    3641    pix-close-gray
    3742    pix-combine-masked
     43    pix-conn-comp-bb
     44    pix-conn-comp-pixa
     45    pix-count-conn-comp
    3846    pix-dilate-gray
    3947    pix-dither-to-binary
     
    5563    pix-var-threshold-to-binary
    5664    pix-write
     65    pixa-get-count
     66    pixa-get-pix
    5767    )
    5868  (import chicken extras foreign scheme)
     
    98108  (define L-CHOOSE-MAX-MIN-DIFF 3)
    99109
     110  (define L-COPY 1)
     111  (define L-CLONE 2)
     112
     113  ;; -- from boxbasic.c
     114
     115  (define call-box-geometry
     116    (foreign-lambda integer "boxGetGeometry" c-pointer
     117                    (c-pointer integer) (c-pointer integer)
     118                    (c-pointer integer) (c-pointer integer)))
     119
     120  (define (box-get-geometry box)
     121    (let-location ((x-coord integer)
     122                   (y-coord integer)
     123                   (width integer)
     124                   (height integer))
     125                  (let ((value (call-box-geometry box (location x-coord) (location y-coord)
     126                                                  (location width) (location height))))
     127                    (if (zero? value)
     128                      (values x-coord y-coord width height)
     129                      #f))))
     130
     131  (define box-set-geometry
     132    (foreign-lambda integer "boxSetGeometry" c-pointer integer integer integer integer))
     133
     134  (define boxa-get-box
     135    (foreign-lambda c-pointer "boxaGetBox" c-pointer integer integer))
     136
     137  (define boxa-get-count
     138    (foreign-lambda int "boxaGetCount" c-pointer))
     139
     140  ;; -- from conncomp.c
     141
     142  (define pix-conn-comp-bb
     143    (foreign-lambda c-pointer "pixConnCompBB" c-pointer integer))
     144
     145  (define call-pix-conn-comp-pixa
     146    (foreign-lambda c-pointer "pixConnCompPixa" c-pointer c-pointer integer))
     147
     148  (define (pix-conn-comp-pixa pix connectivity)
     149    (let-location ((pixa c-pointer))
     150                  (let ((boxa (call-pix-conn-comp-pixa pix (location pixa) connectivity)))
     151                    (values boxa pixa))))
     152
     153  (define call-count-conn-comp
     154    (foreign-lambda integer "pixCountConnComp" c-pointer integer (c-pointer integer)))
     155
     156  (define (pix-count-conn-comp pix connectivity)
     157    (let-location ((count integer))
     158                  (let ((value (call-count-conn-comp pix connectivity (location count))))
     159                    (if (zero? value)
     160                      count
     161                      #f))))
     162
    100163  ;; -- from graymorph.c (complete)
    101164
     
    162225  (define pix-threshold-to-value
    163226    (foreign-lambda c-pointer "pixThresholdToValue" c-pointer c-pointer integer integer))
     227
     228  ;; -- from pixbasic.
     229
     230  (define pixa-get-count
     231    (foreign-lambda integer "pixaGetCount" c-pointer))
     232
     233  (define pixa-get-pix
     234    (foreign-lambda c-pointer "pixaGetPix" c-pointer integer integer))
    164235
    165236  ;; -- from pix1.c
Note: See TracChangeset for help on using the changeset viewer.