ultimatepp/bazaar/TestLeptonica/PageMarkers.cpp
micio b26e58fcd8 Bazaar:Leptonica - added image rectangular markers
git-svn-id: svn://ultimatepp.org/upp/trunk@1577 f0d560ea-af0d-0410-9eb7-867de7ffcac7
2009-09-20 14:55:01 +00:00

40 lines
942 B
C++

#include "TestLeptonica.h"
static void PageMarkers(Pix & source, PixRaster &pixRaster)
{
Markers *markers;
pixRaster.Add(source, true);
pixRaster.Add(source, true);
markers = pixRaster[0].GetMarkers();
markers->Add(new Marker(Point(100, 100), Point(300, 400)));
markers->Add(new Marker(Point(0, 500), Point(300, 800)));
markers = pixRaster[1].GetMarkers();
markers->Add(new Marker(Point(0, 0), Point(200, 100)));
markers->Add(new Marker(Point(400, 500), Point(900, 600)));
}
void TestLeptonica::onPageMarkers()
{
String fileName;
FileSelector fs;
Pix source;
FileIn s("/home/massimo/tmp/TestLept1.tif");
// Loads pixraster from source raster
CHECKR(source.Load(s), "Error loading image");
s.Close();
// apply line removal algothithm
pixRaster.Clear();
PageMarkers(source, pixRaster);
// refresh the PixRasterCtrl control with the new image contents
pixRasterCtrl.Reload();
pixRasterCtrl.SetPage(0);
}