Changeset 20741 in project


Ignore:
Timestamp:
10/09/10 01:21:44 (11 years ago)
Author:
petercrlane
Message:

further functions

File:
1 edited

Legend:

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

    r20674 r20741  
    2525    IFF-TIFF-RLE IFF-TIFF-G3 IFF-TIFF-G4 IFF-TIFF-LZW IFF-TIFF-ZIP
    2626    IFF-PNM IFF-PS IFF-GIF IFF-JP2 IFF-DEFAULT IFF-SPIX
     27    L-LINEAR-SCALE L-LOG-SCALE
     28    L-CHOOSE-MIN L-CHOOSE-MAX L-CHOOSE-MAX-MIN-DIFF
    2729    pix-create pix-copy pix-destroy
    2830    pix-get-width pix-set-width pix-get-height pix-set-height
     
    3032    pix-get-x-res pix-set-x-res pix-get-y-res pix-set-y-res
    3133    pix-set-resolution pix-scale-resolution pix-get-input-format pix-set-input-format
     34    pix-abs-difference
    3235    pix-add-gray
    3336    pix-close-gray
    3437    pix-combine-masked
    3538    pix-dilate-gray
     39    pix-dither-to-binary
     40    pix-dither-to-binary-spec
    3641    pix-erode-gray
    3742    pix-find-skew
    3843    pix-invert
     44    pix-max-dynamic-range
     45    pix-min-or-max
     46    pix-mult-constant-gray
    3947    pix-open-gray
    4048    pix-read
     
    4250    pix-rotate-am-gray
    4351    pix-scale
     52    pix-subtract-gray
    4453    pix-threshold-to-binary
    4554    pix-threshold-to-value
     55    pix-var-threshold-to-binary
    4656    pix-write
    4757    )
     
    8191  (define IFF-SPIX 16)
    8292
    83   ;; -- from graymorph.c
     93  (define L-LINEAR-SCALE 1)
     94  (define L-LOG-SCALE 2)
     95
     96  (define L-CHOOSE-MIN 1)
     97  (define L-CHOOSE-MAX 2)
     98  (define L-CHOOSE-MAX-MIN-DIFF 3)
     99
     100  ;; -- from graymorph.c (complete)
    84101
    85102  (define pix-close-gray
     
    97114  ;; -- from grayquant.c
    98115
     116  ;; ---- threshold from 8 bpp to 1 bpp
     117
     118  ;; Uses Floyd-Steinberg error diffusion dithering algorithm to convert
     119  ;; given pix to a new pix.  Returns #f on error
     120  (define pix-dither-to-binary
     121    (foreign-lambda c-pointer "pixDitherToBinary" c-pointer))
     122
     123  ;; as above, but takes parameters for the lowerclip (distance from 0) and
     124  ;; upperclip (distance from 255), to adjust the values below and above which
     125  ;; the routine does not propagate excess.
     126  (define pix-dither-to-binary-spec
     127    (foreign-lambda c-pointer "pixDitherToBinarySpec" c-pointer integer integer))
     128
     129  ;; Simple (pixelwise) binarisation with fixed threshold
    99130  ;; converts an image pix with 4 or 8 bpp to an image pix with 1 bpp,
    100131  ;; thresholding on given level
     
    102133    (foreign-lambda c-pointer "pixThresholdToBinary" c-pointer integer))
    103134
     135  ;; uses second argument as a source of variable thresholds for first argument.
     136  (define pix-var-threshold-to-binary
     137    (foreign-lambda c-pointer "pixVarThresholdToBinary" c-pointer c-pointer))
     138
    104139  ;; -- from pixarith.c
     140
     141  (define pix-abs-difference
     142    (foreign-lambda c-pointer "pixAbsDifference" c-pointer c-pointer))
    105143
    106144  (define pix-add-gray
    107145    (foreign-lambda c-pointer "pixAddGray" c-pointer c-pointer c-pointer))
     146
     147  (define pix-add-constant-gray
     148    (foreign-lambda integer "pixAddConstantGray" c-pointer integer))
     149
     150  (define pix-max-dynamic-range
     151    (foreign-lambda c-pointer "pixMaxDynamicRange" c-pointer integer))
     152
     153  (define pix-min-or-max
     154    (foreign-lambda c-pointer "pixMinOrMax" c-pointer c-pointer c-pointer integer))
     155
     156  (define pix-mult-constant-gray
     157    (foreign-lambda integer "pixMultConstantGray" c-pointer float))
     158
     159  (define pix-subtract-gray
     160    (foreign-lambda c-pointer "pixSubtractGray" c-pointer c-pointer c-pointer))
    108161
    109162  (define pix-threshold-to-value
Note: See TracChangeset for help on using the changeset viewer.