[114723] trunk/dports/graphics/ocrad

mww at macports.org mww at macports.org
Sat Dec 14 03:23:15 PST 2013


Revision: 114723
          https://trac.macports.org/changeset/114723
Author:   mww at macports.org
Date:     2013-12-14 03:23:15 -0800 (Sat, 14 Dec 2013)
Log Message:
-----------
ocrad: version 0.22

Modified Paths:
--------------
    trunk/dports/graphics/ocrad/Portfile

Added Paths:
-----------
    trunk/dports/graphics/ocrad/files/
    trunk/dports/graphics/ocrad/files/patch-character_r11.cc.diff
    trunk/dports/graphics/ocrad/files/patch-feats_test0.cc.diff
    trunk/dports/graphics/ocrad/files/patch-profile.cc.diff
    trunk/dports/graphics/ocrad/files/patch-track.cc.diff

Modified: trunk/dports/graphics/ocrad/Portfile
===================================================================
--- trunk/dports/graphics/ocrad/Portfile	2013-12-14 11:12:00 UTC (rev 114722)
+++ trunk/dports/graphics/ocrad/Portfile	2013-12-14 11:23:15 UTC (rev 114723)
@@ -3,7 +3,7 @@
 PortSystem 1.0
 
 name                ocrad
-version             0.21
+version             0.22
 categories          graphics
 platforms           darwin
 maintainers         mww
@@ -17,10 +17,16 @@
 
 homepage            http://www.gnu.org/software/ocrad/ocrad.html
 master_sites        gnu
-checksums           md5     83f9eae9d808f9d86c181538d3f64aed \
-                    sha1    857a7e0b671d4216ddf2ec1ec2daf0b21d2a6a64 \
-                    rmd160  9477787f07b35165c1091ce2cf8ad76fba3daea1
+checksums           rmd160  610cd6361b633a1c28b3a5bde252402773483008 \
+                    sha256  d6c9dcbcf4c9cc643edfe5a03cb6125d6c39abe59e83719effb056d63c5198fd
+patchfiles          patch-track.cc.diff patch-profile.cc.diff patch-feats_test0.cc.diff patch-character_r11.cc.diff
 
+depends_extract     bin:lzip:lzip
+
+extract.suffix      .tar.lz
+extract.cmd         lzip
+extract.pre_args    "-dc"
+
 configure.args      CC=${configure.cc} CXX=${configure.cxx} CPPFLAGS=${configure.cppflags} CFLAGS=${configure.cflags} CXXFLAGS=${configure.cxxflags} LDFLAGS=${configure.ldflags}
 
 test.run            yes

Added: trunk/dports/graphics/ocrad/files/patch-character_r11.cc.diff
===================================================================
--- trunk/dports/graphics/ocrad/files/patch-character_r11.cc.diff	                        (rev 0)
+++ trunk/dports/graphics/ocrad/files/patch-character_r11.cc.diff	2013-12-14 11:23:15 UTC (rev 114723)
@@ -0,0 +1,38 @@
+--- character_r11.cc	2013-06-21 01:35:33.000000000 +0200
++++ character_r11.cc	2013-12-14 12:20:37.000000000 +0100
+@@ -20,6 +20,7 @@
+ #include <cstdio>
+ #include <vector>
+ #include <stdint.h>
++#include <cstdlib>
+ 
+ #include "common.h"
+ #include "rectangle.h"
+@@ -229,7 +230,7 @@
+   Features f( b );
+   int top_delta = h.top() - b.top(), bottom_delta = b.bottom() - h.bottom();
+ 
+-  if( std::abs( top_delta - bottom_delta ) <= std::max( 2, h.height() / 4 ) ||
++  if( abs( top_delta - bottom_delta ) <= std::max( 2, h.height() / 4 ) ||
+       Ocrad::similar( top_delta, bottom_delta, 40, 2 ) )
+     {					// hole is vertically centred
+     int code = f.test_4ADQao( charset, charbox );
+@@ -283,15 +284,15 @@
+   Profile bp( b, Profile::bottom );
+ 
+   // Check for 'm' or 'w' with merged serifs
+-  if( 10 * std::abs( h2.vcenter() - h1.vcenter() ) <= b.height() &&
++  if( 10 * abs( h2.vcenter() - h1.vcenter() ) <= b.height() &&
+       h1.is_vcentred_in( b ) && h2.is_vcentred_in( b ) )
+     {
+     if( ( b.bottom() - h1.bottom() <= h1.top() - b.top() ) &&
+         ( b.bottom() - h2.bottom() <= h2.top() - b.top() ) && bp.isflats() )
+       { add_guess( 'm', 0 ); return; }
+ 
+-    if( 5 * std::abs( h1.bottom() - b.vcenter() ) <= b.height() &&
+-        5 * std::abs( h2.bottom() - b.vcenter() ) <= b.height() &&
++    if( 5 * abs( h1.bottom() - b.vcenter() ) <= b.height() &&
++        5 * abs( h2.bottom() - b.vcenter() ) <= b.height() &&
+         tp.isflats() && bp.minima() == 2 )
+       { add_guess( 'w', 0 ); return; }
+     return;

Added: trunk/dports/graphics/ocrad/files/patch-feats_test0.cc.diff
===================================================================
--- trunk/dports/graphics/ocrad/files/patch-feats_test0.cc.diff	                        (rev 0)
+++ trunk/dports/graphics/ocrad/files/patch-feats_test0.cc.diff	2013-12-14 11:23:15 UTC (rev 114723)
@@ -0,0 +1,73 @@
+--- feats_test0.cc	2013-06-20 01:19:40.000000000 +0200
++++ feats_test0.cc	2013-12-14 12:19:40.000000000 +0100
+@@ -20,6 +20,7 @@
+ #include <cstdio>
+ #include <vector>
+ #include <stdint.h>
++#include <cstdlib>
+ 
+ #include "common.h"
+ #include "rectangle.h"
+@@ -181,14 +182,14 @@
+   const int botmin = b.bottom() - vnoise;
+   if( vbars() == 1 && vbar(0).width() >= 2 && 2 * vbar(0).width() < b.width() )
+     {
+-    if( std::abs( vbar(0).hcenter() - b.hcenter() ) <= noise &&
+-        std::abs( (vbar(0).left() - b.left()) - (b.right() - vbar(0).right()) ) <= 2 * noise )
++    if( abs( vbar(0).hcenter() - b.hcenter() ) <= noise &&
++        abs( (vbar(0).left() - b.left()) - (b.right() - vbar(0).right()) ) <= 2 * noise )
+       {
+       if( hbars() == 1 && 4 * hbar(0).height() <= b.height() )
+         {
+         if( hbar(0).top() <= topmax || hbar(0).bottom() < b.vpos( 15 ) )
+           return 'T';
+-        if( std::abs( hbar(0).vcenter() - b.vcenter() ) <= 1 &&
++        if( abs( hbar(0).vcenter() - b.vcenter() ) <= 1 &&
+             Ocrad::similar( b.height(), b.width(), 50 ) ) return '+';
+         }
+       if( hbars() == 2 &&
+@@ -223,7 +224,7 @@
+         }
+       if( hbars() == 2 && hbar(1).bottom() >= botmin &&
+           b.height() > b.width() && hbar(1).width() > hbar(0).width() &&
+-          std::abs( vbar(0).hcenter() - hbar(0).hcenter() ) <= 1 &&
++          abs( vbar(0).hcenter() - hbar(0).hcenter() ) <= 1 &&
+           rp.iminimum() > rp.pos( 70 ) )
+         return 'L';
+       if( hbars() == 1 && Ocrad::similar( hbar(0).width(), b.width(), 10 ) &&
+@@ -316,7 +317,7 @@
+           if( i > lp.pos( 10 ) && i < lp.pos( 40 ) ) return '1'; }
+       }
+     }
+-  if( hbars() == 1 && std::abs( hbar(0).vcenter() - b.vcenter() ) <= 1 &&
++  if( hbars() == 1 && abs( hbar(0).vcenter() - b.vcenter() ) <= 1 &&
+       Ocrad::similar( b.height(), b.width(), 50 ) &&
+       tp.isupit() && bp.isupit() )
+     return '+';
+@@ -525,7 +526,7 @@
+       int hdiff;
+       if( b.bottom_hook( &hdiff ) )
+         {
+-        if( std::abs( hdiff ) <= b.height() / 8 )
++        if( abs( hdiff ) <= b.height() / 8 )
+           {
+           if( segments_in_row( b.vpos( 30 ) ) >= 3 ) return 'v';
+           if( bp.isconvex() )
+@@ -601,7 +602,7 @@
+         if( ( vbars() <= 2 || ( vbars() == 3 && b.height() >= b.width() ) ) &&
+             tp.minima( b.height() / 2 ) <= 2 &&
+             tp.minima( ( 2 * b.height() ) / 5 ) <= 2 && !lp.istpit() &&
+-            4 * std::abs( rp[rp.pos(20)] - rp[rp.pos(80)] ) <= b.width() )
++            4 * abs( rp[rp.pos(20)] - rp[rp.pos(80)] ) <= b.width() )
+           {
+           const int row = b.top() + tp[tp.pos(50)];
+           if( row > b.vcenter() )
+@@ -855,7 +856,7 @@
+         if( b.get_bit( b.top() + i, b.left() + i ) ) ++d;
+         if( b.get_bit( b.top() + i, b.right() - i ) ) --d;
+         }
+-      if( 2 * std::abs( d ) >= n - 1 ) return 0;
++      if( 2 * abs( d ) >= n - 1 ) return 0;
+       }
+     if( ( !porosity && inner_area * 100 >= inner_size * 75 ) ||
+         ( b.width() >= 7 && b.height() >= 7 &&

Added: trunk/dports/graphics/ocrad/files/patch-profile.cc.diff
===================================================================
--- trunk/dports/graphics/ocrad/files/patch-profile.cc.diff	                        (rev 0)
+++ trunk/dports/graphics/ocrad/files/patch-profile.cc.diff	2013-12-14 11:23:15 UTC (rev 114723)
@@ -0,0 +1,28 @@
+--- profile.cc	2013-06-20 12:39:37.000000000 +0200
++++ profile.cc	2013-12-14 12:18:36.000000000 +0100
+@@ -20,6 +20,7 @@
+ #include <cstdio>
+ #include <vector>
+ #include <stdint.h>
++#include <cstdlib>
+ 
+ #include "common.h"
+ #include "rectangle.h"
+@@ -251,7 +252,7 @@
+         { if( data[i] <= noise ) continue; else return isconvex_; }
+       int d = data[i] - data[i-1];
+       if( d == 0 ) continue;
+-      if( d > dmax ) { if( std::abs( d ) <= noise ) ++dmax; else dmax = d; }
++      if( d > dmax ) { if( abs( d ) <= noise ) ++dmax; else dmax = d; }
+       else if( d < dmax - noise ) return isconvex_;
+       }
+     if( 2 * ( min_end - min_begin + 1 ) < samples() )
+@@ -616,7 +617,7 @@
+   for( int i = 0; i < samples(); ++i )
+     {
+     int y = ( dx * yl ) + ( ( i - xl ) * dy );
+-    int d = std::abs( ( dx * data[i] ) - y );
++    int d = abs( ( dx * data[i] ) - y );
+     if( d >= dmax && ( ( dx * data[i] ) < y || ( i >= xl && i <= xr ) ) )
+       if( d > dmax || ( d == dmax && --faults < 0 ) ) return false;
+     }

Added: trunk/dports/graphics/ocrad/files/patch-track.cc.diff
===================================================================
--- trunk/dports/graphics/ocrad/files/patch-track.cc.diff	                        (rev 0)
+++ trunk/dports/graphics/ocrad/files/patch-track.cc.diff	2013-12-14 11:23:15 UTC (rev 114723)
@@ -0,0 +1,26 @@
+--- track.cc	2013-03-24 18:51:08.000000000 +0100
++++ track.cc	2013-12-14 12:15:57.000000000 +0100
+@@ -19,6 +19,7 @@
+ #include <algorithm>
+ #include <cstdio>
+ #include <vector>
++#include <cstdlib>
+ 
+ #include "common.h"
+ #include "rectangle.h"
+@@ -43,12 +44,12 @@
+       {
+       if( 9 * r1.height() <= 10 * mean_height &&
+           9 * r2.height() <= 10 * mean_height &&
+-          10 * std::abs( r1.bottom() - r2.bottom() ) <= mean_height )
++          10 * abs( r1.bottom() - r2.bottom() ) <= mean_height )
+         { val = 0; return ( r1.height() <= r2.height() ) ? 0 : 1; }
+-      if( val > 1 && 10 * std::abs( r1.vcenter() - r2.vcenter() ) <= mean_height )
++      if( val > 1 && 10 * abs( r1.vcenter() - r2.vcenter() ) <= mean_height )
+         { val = 1; return ( r1.bottom() <= r2.bottom() ) ? 0 : 1; }
+       }
+-    if( val > 2 && 10 * std::abs( r1.vcenter() - r2.vcenter() ) <= mean_height )
++    if( val > 2 && 10 * abs( r1.vcenter() - r2.vcenter() ) <= mean_height )
+       { val = 2; return ( r1.bottom() <= r2.bottom() ) ? 0 : 1; }
+     }
+   return -1;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20131214/95c3bd81/attachment.html>


More information about the macports-changes mailing list