Fixed the C++ port to compile on a Linux system.

git-svn-id: https://zxing.googlecode.com/svn/trunk@1211 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
ralf.kistner@gmail.com 2010-02-15 17:00:07 +00:00
parent 6758fcdca7
commit 997c485a35
6 changed files with 13 additions and 3 deletions

View file

@ -33,6 +33,11 @@ LocalBlockBinarizer::LocalBlockBinarizer(Ref<LuminanceSource> source) :
LocalBlockBinarizer::~LocalBlockBinarizer() { LocalBlockBinarizer::~LocalBlockBinarizer() {
} }
Ref<BitArray> LocalBlockBinarizer::estimateBlackRow(int y, Ref<BitArray> row) {
//TODO: implement
return Ref<BitArray>();
}
// Calculates the final BitMatrix once for all requests. This could be called once from the // Calculates the final BitMatrix once for all requests. This could be called once from the
// constructor instead, but there are some advantages to doing it lazily, such as making // constructor instead, but there are some advantages to doing it lazily, such as making
// profiling easier, and not doing heavy lifting when callers don't expect it. // profiling easier, and not doing heavy lifting when callers don't expect it.

View file

@ -31,8 +31,10 @@ public:
virtual ~LocalBlockBinarizer(); virtual ~LocalBlockBinarizer();
virtual Ref<BitMatrix> estimateBlackMatrix(); virtual Ref<BitMatrix> estimateBlackMatrix();
Ref<BitArray> estimateBlackRow(int y, Ref<BitArray> row);
private: private:
void calculateThresholdForBlock(const unsigned char* luminances, int subWidth, int subHeight, void calculateThresholdForBlock(const unsigned char* luminances, int subWidth, int subHeight,
int stride, const unsigned char* averages, const unsigned char* types, BitMatrix& matrix); int stride, const unsigned char* averages, const unsigned char* types, BitMatrix& matrix);
void sharpenRow(unsigned char* luminances, int width, int height); void sharpenRow(unsigned char* luminances, int width, int height);

View file

@ -23,6 +23,7 @@
#include <zxing/common/Array.h> #include <zxing/common/Array.h>
#include <zxing/ReaderException.h> #include <zxing/ReaderException.h>
#include <math.h> #include <math.h>
#include <string.h>
namespace zxing { namespace zxing {
namespace oned { namespace oned {

View file

@ -23,6 +23,7 @@
#include <zxing/common/Array.h> #include <zxing/common/Array.h>
#include <zxing/ReaderException.h> #include <zxing/ReaderException.h>
#include <math.h> #include <math.h>
#include <limits.h>
namespace zxing { namespace zxing {
namespace oned { namespace oned {

View file

@ -21,6 +21,7 @@
#include "OneDReader.h" #include "OneDReader.h"
#include <zxing/ReaderException.h> #include <zxing/ReaderException.h>
#include <math.h> #include <math.h>
#include <limits.h>
namespace zxing { namespace zxing {
namespace oned { namespace oned {

View file

@ -240,12 +240,12 @@ int main(int argc, char** argv) {
int lresult = 1; int lresult = 1;
if (outfolder == string("-")) { if (outfolder == string("-")) {
//gresult = test_image_global(image, ""); gresult = test_image_global(image, "");
lresult = test_image_local(image, ""); lresult = test_image_local(image, "");
} else { } else {
replace(infilename.begin(), infilename.end(), '/', '_'); replace(infilename.begin(), infilename.end(), '/', '_');
string prefix = string(outfolder) + string("/") + infilename; string prefix = string(outfolder) + string("/") + infilename;
//gresult = test_image_global(image, prefix + ".g"); gresult = test_image_global(image, prefix + ".g");
lresult = test_image_local(image, prefix + ".l"); lresult = test_image_local(image, prefix + ".l");
} }