[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: playground/base/nepomuk-kde/annotation/plugins/olena
From: Sebastian Trueg <sebastian () trueg ! de>
Date: 2009-09-17 13:52:54
Message-ID: 1253195574.625731.9622.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 1024899 by trueg:
Less crash = more no crash = happy
M +12 -6 olenatextextractionjob.cpp
--- trunk/playground/base/nepomuk-kde/annotation/plugins/olena/olenatextextractionjob.cpp \
#1024898:1024899 @@ -61,12 +61,19 @@
const int rows = img.height();
const int cols = img.width();
- mln::image2d<mln::value::rgb8> mlnImg( rows, cols, 0 );
+ mln::image2d<mln::value::rgb8> mlnImg( rows, cols );
- ::qMemCopy( mlnImg.buffer(),
- img.scanLine(0),
- img.numBytes() );
+ // trueg: the commented code, while nicer, crashes in the return statement \
below! +// ::qMemCopy( mlnImg.buffer(),
+// img.scanLine(0),
+// img.numBytes() );
+ mln_piter_(mln::box2d) p(mlnImg.domain());
+ for_all(p) {
+ QRgb c = img.pixel(p.col(), p.row());
+ mlnImg(p) = mln::value::rgb8(qRed(c), qGreen(c), qBlue(c));
+ }
+
return mlnImg;
}
@@ -91,8 +98,7 @@
kDebug() << "3";
// objects -> text string
- // FIXME: do not default to "fra" here but use the current locale (although that \
is rather useless as tesseract only supports
- // deu, eng, and fra.)
+ // FIXME: do not default to "fra" here but use the current locale
std::string txt = scribo::text::obj2txt(obj, "fra");
kDebug() << "4";
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic