├── .gitignore ├── .npmignore ├── .travis.yml ├── AUTHORS ├── CHANGELOG.md ├── LICENSE ├── README.md ├── appveyor.yml ├── binding.gyp ├── deps ├── common.gyp ├── jpg │ ├── jpg.gyp │ ├── jpgd.cpp │ ├── jpgd.h │ ├── jpge.cpp │ └── jpge.h ├── leptonica │ ├── leptonica-license.txt │ ├── leptonica.gyp │ └── src │ │ ├── adaptmap.c │ │ ├── affine.c │ │ ├── affinecompose.c │ │ ├── allheaders.h │ │ ├── alltypes.h │ │ ├── array.h │ │ ├── arrayaccess.c │ │ ├── arrayaccess.h │ │ ├── bardecode.c │ │ ├── baseline.c │ │ ├── bbuffer.c │ │ ├── bbuffer.h │ │ ├── bilateral.c │ │ ├── bilateral.h │ │ ├── bilinear.c │ │ ├── binarize.c │ │ ├── binexpand.c │ │ ├── binreduce.c │ │ ├── blend.c │ │ ├── bmf.c │ │ ├── bmf.h │ │ ├── bmfdata.h │ │ ├── bmp.h │ │ ├── bmpio.c │ │ ├── bmpiostub.c │ │ ├── bootnumgen1.c │ │ ├── bootnumgen2.c │ │ ├── bootnumgen3.c │ │ ├── boxbasic.c │ │ ├── boxfunc1.c │ │ ├── boxfunc2.c │ │ ├── boxfunc3.c │ │ ├── boxfunc4.c │ │ ├── bytearray.c │ │ ├── ccbord.c │ │ ├── ccbord.h │ │ ├── ccthin.c │ │ ├── classapp.c │ │ ├── colorcontent.c │ │ ├── coloring.c │ │ ├── colormap.c │ │ ├── colormorph.c │ │ ├── colorquant1.c │ │ ├── colorquant2.c │ │ ├── colorseg.c │ │ ├── colorspace.c │ │ ├── compare.c │ │ ├── conncomp.c │ │ ├── convertfiles.c │ │ ├── convolve.c │ │ ├── correlscore.c │ │ ├── dewarp.h │ │ ├── dewarp1.c │ │ ├── dewarp2.c │ │ ├── dewarp3.c │ │ ├── dewarp4.c │ │ ├── dnabasic.c │ │ ├── dnafunc1.c │ │ ├── dnahash.c │ │ ├── dwacomb.2.c │ │ ├── dwacomblow.2.c │ │ ├── edge.c │ │ ├── encoding.c │ │ ├── endianness.h │ │ ├── enhance.c │ │ ├── environ.h │ │ ├── fhmtauto.c │ │ ├── fhmtgen.1.c │ │ ├── fhmtgenlow.1.c │ │ ├── finditalic.c │ │ ├── flipdetect.c │ │ ├── fliphmtgen.c │ │ ├── fmorphauto.c │ │ ├── fmorphgen.1.c │ │ ├── fmorphgenlow.1.c │ │ ├── fpix1.c │ │ ├── fpix2.c │ │ ├── gifio.c │ │ ├── gifiostub.c │ │ ├── gplot.c │ │ ├── gplot.h │ │ ├── graphics.c │ │ ├── graymorph.c │ │ ├── grayquant.c │ │ ├── heap.c │ │ ├── heap.h │ │ ├── imageio.h │ │ ├── jbclass.c │ │ ├── jbclass.h │ │ ├── jp2kheader.c │ │ ├── jp2kheaderstub.c │ │ ├── jp2kio.c │ │ ├── jp2kiostub.c │ │ ├── jpegio.c │ │ ├── jpegiostub.c │ │ ├── kernel.c │ │ ├── leptwin.c │ │ ├── leptwin.h │ │ ├── libversions.c │ │ ├── list.c │ │ ├── list.h │ │ ├── map.c │ │ ├── maze.c │ │ ├── morph.c │ │ ├── morph.h │ │ ├── morphapp.c │ │ ├── morphdwa.c │ │ ├── morphseq.c │ │ ├── numabasic.c │ │ ├── numafunc1.c │ │ ├── numafunc2.c │ │ ├── pageseg.c │ │ ├── paintcmap.c │ │ ├── parseprotos.c │ │ ├── partition.c │ │ ├── pdfio1.c │ │ ├── pdfio1stub.c │ │ ├── pdfio2.c │ │ ├── pdfio2stub.c │ │ ├── pix.h │ │ ├── pix1.c │ │ ├── pix2.c │ │ ├── pix3.c │ │ ├── pix4.c │ │ ├── pix5.c │ │ ├── pixabasic.c │ │ ├── pixacc.c │ │ ├── pixafunc1.c │ │ ├── pixafunc2.c │ │ ├── pixalloc.c │ │ ├── pixarith.c │ │ ├── pixcomp.c │ │ ├── pixconv.c │ │ ├── pixlabel.c │ │ ├── pixtiling.c │ │ ├── pngio.c │ │ ├── pngiostub.c │ │ ├── pnmio.c │ │ ├── pnmiostub.c │ │ ├── projective.c │ │ ├── psio1.c │ │ ├── psio1stub.c │ │ ├── psio2.c │ │ ├── psio2stub.c │ │ ├── ptabasic.c │ │ ├── ptafunc1.c │ │ ├── ptafunc2.c │ │ ├── ptra.c │ │ ├── ptra.h │ │ ├── quadtree.c │ │ ├── queue.c │ │ ├── queue.h │ │ ├── rank.c │ │ ├── rbtree.c │ │ ├── rbtree.h │ │ ├── readbarcode.c │ │ ├── readbarcode.h │ │ ├── readfile.c │ │ ├── recog.h │ │ ├── recogbasic.c │ │ ├── recogdid.c │ │ ├── recogident.c │ │ ├── recogtrain.c │ │ ├── regutils.c │ │ ├── regutils.h │ │ ├── rop.c │ │ ├── roplow.c │ │ ├── rotate.c │ │ ├── rotateam.c │ │ ├── rotateorth.c │ │ ├── rotateshear.c │ │ ├── runlength.c │ │ ├── sarray1.c │ │ ├── sarray2.c │ │ ├── scale1.c │ │ ├── scale2.c │ │ ├── seedfill.c │ │ ├── sel1.c │ │ ├── sel2.c │ │ ├── selgen.c │ │ ├── shear.c │ │ ├── skew.c │ │ ├── spixio.c │ │ ├── stack.c │ │ ├── stack.h │ │ ├── stringcode.c │ │ ├── stringcode.h │ │ ├── strokes.c │ │ ├── sudoku.c │ │ ├── sudoku.h │ │ ├── textops.c │ │ ├── tiffio.c │ │ ├── tiffiostub.c │ │ ├── utils1.c │ │ ├── utils2.c │ │ ├── warper.c │ │ ├── watershed.c │ │ ├── watershed.h │ │ ├── webpio.c │ │ ├── webpiostub.c │ │ ├── writefile.c │ │ ├── zlibmem.c │ │ └── zlibmemstub.c ├── lodepng │ ├── lodepng.cpp │ ├── lodepng.gyp │ └── lodepng.h ├── lswms │ ├── COPYING.LESSER │ ├── LSWMS.cpp │ ├── LSWMS.h │ └── lswms.gyp ├── opencv │ ├── LICENSE │ ├── include │ │ ├── cvconfig.h │ │ └── version_string.inc │ ├── modules │ │ ├── core │ │ │ ├── include │ │ │ │ └── opencv2 │ │ │ │ │ ├── core.hpp │ │ │ │ │ └── core │ │ │ │ │ ├── affine.hpp │ │ │ │ │ ├── core.hpp │ │ │ │ │ ├── core_c.h │ │ │ │ │ ├── cuda_devptrs.hpp │ │ │ │ │ ├── devmem2d.hpp │ │ │ │ │ ├── eigen.hpp │ │ │ │ │ ├── gpumat.hpp │ │ │ │ │ ├── internal.hpp │ │ │ │ │ ├── mat.hpp │ │ │ │ │ ├── opengl_interop.hpp │ │ │ │ │ ├── opengl_interop_deprecated.hpp │ │ │ │ │ ├── operations.hpp │ │ │ │ │ ├── types_c.h │ │ │ │ │ ├── version.hpp │ │ │ │ │ └── wimage.hpp │ │ │ └── src │ │ │ │ ├── algorithm.cpp │ │ │ │ ├── alloc.cpp │ │ │ │ ├── arithm.cpp │ │ │ │ ├── array.cpp │ │ │ │ ├── cmdparser.cpp │ │ │ │ ├── convert.cpp │ │ │ │ ├── copy.cpp │ │ │ │ ├── datastructs.cpp │ │ │ │ ├── drawing.cpp │ │ │ │ ├── dxt.cpp │ │ │ │ ├── gl_core_3_1.cpp │ │ │ │ ├── gl_core_3_1.hpp │ │ │ │ ├── glob.cpp │ │ │ │ ├── gpumat.cpp │ │ │ │ ├── lapack.cpp │ │ │ │ ├── mathfuncs.cpp │ │ │ │ ├── matmul.cpp │ │ │ │ ├── matop.cpp │ │ │ │ ├── matrix.cpp │ │ │ │ ├── opengl_interop.cpp │ │ │ │ ├── opengl_interop_deprecated.cpp │ │ │ │ ├── out.cpp │ │ │ │ ├── parallel.cpp │ │ │ │ ├── persistence.cpp │ │ │ │ ├── precomp.hpp │ │ │ │ ├── rand.cpp │ │ │ │ ├── stat.cpp │ │ │ │ ├── system.cpp │ │ │ │ └── tables1.cpp │ │ ├── dynamicuda │ │ │ ├── include │ │ │ │ └── opencv2 │ │ │ │ │ └── dynamicuda │ │ │ │ │ └── dynamicuda.hpp │ │ │ └── src │ │ │ │ ├── cuda │ │ │ │ └── matrix_operations.cu │ │ │ │ └── main.cpp │ │ └── imgproc │ │ │ ├── include │ │ │ └── opencv2 │ │ │ │ ├── imgproc.hpp │ │ │ │ └── imgproc │ │ │ │ ├── imgproc.hpp │ │ │ │ ├── imgproc_c.h │ │ │ │ └── types_c.h │ │ │ └── src │ │ │ ├── _geom.h │ │ │ ├── _list.h │ │ │ ├── accum.cpp │ │ │ ├── approx.cpp │ │ │ ├── avx │ │ │ ├── imgwarp_avx.cpp │ │ │ └── imgwarp_avx.hpp │ │ │ ├── avx2 │ │ │ ├── imgwarp_avx2.cpp │ │ │ └── imgwarp_avx2.hpp │ │ │ ├── canny.cpp │ │ │ ├── clahe.cpp │ │ │ ├── color.cpp │ │ │ ├── contours.cpp │ │ │ ├── convhull.cpp │ │ │ ├── corner.cpp │ │ │ ├── cornersubpix.cpp │ │ │ ├── deriv.cpp │ │ │ ├── distransform.cpp │ │ │ ├── emd.cpp │ │ │ ├── featureselect.cpp │ │ │ ├── filter.cpp │ │ │ ├── floodfill.cpp │ │ │ ├── gabor.cpp │ │ │ ├── gcgraph.hpp │ │ │ ├── generalized_hough.cpp │ │ │ ├── geometry.cpp │ │ │ ├── grabcut.cpp │ │ │ ├── histogram.cpp │ │ │ ├── hough.cpp │ │ │ ├── imgwarp.cpp │ │ │ ├── linefit.cpp │ │ │ ├── matchcontours.cpp │ │ │ ├── moments.cpp │ │ │ ├── morph.cpp │ │ │ ├── phasecorr.cpp │ │ │ ├── precomp.hpp │ │ │ ├── pyramids.cpp │ │ │ ├── rotcalipers.cpp │ │ │ ├── samplers.cpp │ │ │ ├── segmentation.cpp │ │ │ ├── shapedescr.cpp │ │ │ ├── smooth.cpp │ │ │ ├── subdivision2d.cpp │ │ │ ├── sumpixels.cpp │ │ │ ├── tables2.cpp │ │ │ ├── templmatch.cpp │ │ │ ├── thresh.cpp │ │ │ ├── undistort.cpp │ │ │ └── utils.cpp │ └── opencv.gyp ├── tesseract │ ├── COPYING │ ├── api │ │ ├── apitypes.h │ │ ├── baseapi.cpp │ │ ├── baseapi.h │ │ ├── capi.cpp │ │ ├── capi.h │ │ ├── pdfrenderer.cpp │ │ ├── renderer.cpp │ │ ├── renderer.h │ │ └── tesseractmain.cpp │ ├── ccmain │ │ ├── adaptions.cpp │ │ ├── applybox.cpp │ │ ├── control.cpp │ │ ├── control.h │ │ ├── cube_control.cpp │ │ ├── cube_reco_context.cpp │ │ ├── cube_reco_context.h │ │ ├── cubeclassifier.cpp │ │ ├── cubeclassifier.h │ │ ├── docqual.cpp │ │ ├── docqual.h │ │ ├── equationdetect.cpp │ │ ├── equationdetect.h │ │ ├── fixspace.cpp │ │ ├── fixspace.h │ │ ├── fixxht.cpp │ │ ├── ltrresultiterator.cpp │ │ ├── ltrresultiterator.h │ │ ├── mutableiterator.h │ │ ├── osdetect.cpp │ │ ├── osdetect.h │ │ ├── output.cpp │ │ ├── output.h │ │ ├── pageiterator.cpp │ │ ├── pageiterator.h │ │ ├── pagesegmain.cpp │ │ ├── pagewalk.cpp │ │ ├── par_control.cpp │ │ ├── paragraphs.cpp │ │ ├── paragraphs.h │ │ ├── paragraphs_internal.h │ │ ├── paramsd.cpp │ │ ├── paramsd.h │ │ ├── pgedit.cpp │ │ ├── pgedit.h │ │ ├── recogtraining.cpp │ │ ├── reject.cpp │ │ ├── reject.h │ │ ├── resultiterator.cpp │ │ ├── resultiterator.h │ │ ├── superscript.cpp │ │ ├── tessbox.cpp │ │ ├── tessbox.h │ │ ├── tessedit.cpp │ │ ├── tessedit.h │ │ ├── tesseract_cube_combiner.cpp │ │ ├── tesseract_cube_combiner.h │ │ ├── tesseractclass.cpp │ │ ├── tesseractclass.h │ │ ├── tessvars.cpp │ │ ├── tessvars.h │ │ ├── tfacepp.cpp │ │ ├── thresholder.cpp │ │ ├── thresholder.h │ │ ├── werdit.cpp │ │ └── werdit.h │ ├── ccstruct │ │ ├── blamer.cpp │ │ ├── blamer.h │ │ ├── blckerr.h │ │ ├── blobbox.cpp │ │ ├── blobbox.h │ │ ├── blobs.cpp │ │ ├── blobs.h │ │ ├── blread.cpp │ │ ├── blread.h │ │ ├── boxread.cpp │ │ ├── boxread.h │ │ ├── boxword.cpp │ │ ├── boxword.h │ │ ├── ccstruct.cpp │ │ ├── ccstruct.h │ │ ├── coutln.cpp │ │ ├── coutln.h │ │ ├── crakedge.h │ │ ├── detlinefit.cpp │ │ ├── detlinefit.h │ │ ├── dppoint.cpp │ │ ├── dppoint.h │ │ ├── fontinfo.cpp │ │ ├── fontinfo.h │ │ ├── genblob.cpp │ │ ├── genblob.h │ │ ├── hpdsizes.h │ │ ├── imagedata.cpp │ │ ├── imagedata.h │ │ ├── ipoints.h │ │ ├── linlsq.cpp │ │ ├── linlsq.h │ │ ├── matrix.cpp │ │ ├── matrix.h │ │ ├── mod128.cpp │ │ ├── mod128.h │ │ ├── normalis.cpp │ │ ├── normalis.h │ │ ├── ocrblock.cpp │ │ ├── ocrblock.h │ │ ├── ocrpara.cpp │ │ ├── ocrpara.h │ │ ├── ocrrow.cpp │ │ ├── ocrrow.h │ │ ├── otsuthr.cpp │ │ ├── otsuthr.h │ │ ├── pageres.cpp │ │ ├── pageres.h │ │ ├── params_training_featdef.cpp │ │ ├── params_training_featdef.h │ │ ├── pdblock.cpp │ │ ├── pdblock.h │ │ ├── points.cpp │ │ ├── points.h │ │ ├── polyaprx.cpp │ │ ├── polyaprx.h │ │ ├── polyblk.cpp │ │ ├── polyblk.h │ │ ├── publictypes.cpp │ │ ├── publictypes.h │ │ ├── quadlsq.cpp │ │ ├── quadlsq.h │ │ ├── quadratc.h │ │ ├── quspline.cpp │ │ ├── quspline.h │ │ ├── ratngs.cpp │ │ ├── ratngs.h │ │ ├── rect.cpp │ │ ├── rect.h │ │ ├── rejctmap.cpp │ │ ├── rejctmap.h │ │ ├── seam.cpp │ │ ├── seam.h │ │ ├── split.cpp │ │ ├── split.h │ │ ├── statistc.cpp │ │ ├── statistc.h │ │ ├── stepblob.cpp │ │ ├── stepblob.h │ │ ├── vecfuncs.cpp │ │ ├── vecfuncs.h │ │ ├── werd.cpp │ │ └── werd.h │ ├── ccutil │ │ ├── ambigs.cpp │ │ ├── ambigs.h │ │ ├── basedir.cpp │ │ ├── basedir.h │ │ ├── bits16.cpp │ │ ├── bits16.h │ │ ├── bitvector.cpp │ │ ├── bitvector.h │ │ ├── ccutil.cpp │ │ ├── ccutil.h │ │ ├── clst.cpp │ │ ├── clst.h │ │ ├── doubleptr.h │ │ ├── elst.cpp │ │ ├── elst.h │ │ ├── elst2.cpp │ │ ├── elst2.h │ │ ├── errcode.cpp │ │ ├── errcode.h │ │ ├── fileerr.h │ │ ├── genericheap.h │ │ ├── genericvector.h │ │ ├── globaloc.cpp │ │ ├── globaloc.h │ │ ├── hashfn.h │ │ ├── helpers.h │ │ ├── host.h │ │ ├── indexmapbidi.cpp │ │ ├── indexmapbidi.h │ │ ├── kdpair.h │ │ ├── lsterr.h │ │ ├── mainblk.cpp │ │ ├── memry.cpp │ │ ├── memry.h │ │ ├── ndminx.h │ │ ├── nwmain.h │ │ ├── object_cache.h │ │ ├── ocrclass.h │ │ ├── params.cpp │ │ ├── params.h │ │ ├── platform.h │ │ ├── qrsequence.h │ │ ├── scanutils.cpp │ │ ├── scanutils.h │ │ ├── serialis.cpp │ │ ├── serialis.h │ │ ├── sorthelper.h │ │ ├── stderr.h │ │ ├── strngs.cpp │ │ ├── strngs.h │ │ ├── tesscallback.h │ │ ├── tessdatamanager.cpp │ │ ├── tessdatamanager.h │ │ ├── tprintf.cpp │ │ ├── tprintf.h │ │ ├── unichar.cpp │ │ ├── unichar.h │ │ ├── unicharmap.cpp │ │ ├── unicharmap.h │ │ ├── unicharset.cpp │ │ ├── unicharset.h │ │ ├── unicity_table.h │ │ ├── unicodes.cpp │ │ ├── unicodes.h │ │ ├── universalambigs.cpp │ │ └── universalambigs.h │ ├── classify │ │ ├── adaptive.cpp │ │ ├── adaptive.h │ │ ├── adaptmatch.cpp │ │ ├── blobclass.cpp │ │ ├── blobclass.h │ │ ├── classify.cpp │ │ ├── classify.h │ │ ├── cluster.cpp │ │ ├── cluster.h │ │ ├── clusttool.cpp │ │ ├── clusttool.h │ │ ├── cutoffs.cpp │ │ ├── cutoffs.h │ │ ├── errorcounter.cpp │ │ ├── errorcounter.h │ │ ├── featdefs.cpp │ │ ├── featdefs.h │ │ ├── float2int.cpp │ │ ├── float2int.h │ │ ├── fpoint.cpp │ │ ├── fpoint.h │ │ ├── intfeaturedist.cpp │ │ ├── intfeaturedist.h │ │ ├── intfeaturemap.cpp │ │ ├── intfeaturemap.h │ │ ├── intfeaturespace.cpp │ │ ├── intfeaturespace.h │ │ ├── intfx.cpp │ │ ├── intfx.h │ │ ├── intmatcher.cpp │ │ ├── intmatcher.h │ │ ├── intproto.cpp │ │ ├── intproto.h │ │ ├── kdtree.cpp │ │ ├── kdtree.h │ │ ├── mastertrainer.cpp │ │ ├── mastertrainer.h │ │ ├── mf.cpp │ │ ├── mf.h │ │ ├── mfdefs.cpp │ │ ├── mfdefs.h │ │ ├── mfoutline.cpp │ │ ├── mfoutline.h │ │ ├── mfx.cpp │ │ ├── mfx.h │ │ ├── normfeat.cpp │ │ ├── normfeat.h │ │ ├── normmatch.cpp │ │ ├── normmatch.h │ │ ├── ocrfeatures.cpp │ │ ├── ocrfeatures.h │ │ ├── outfeat.cpp │ │ ├── outfeat.h │ │ ├── picofeat.cpp │ │ ├── picofeat.h │ │ ├── protos.cpp │ │ ├── protos.h │ │ ├── sampleiterator.cpp │ │ ├── sampleiterator.h │ │ ├── shapeclassifier.cpp │ │ ├── shapeclassifier.h │ │ ├── shapetable.cpp │ │ ├── shapetable.h │ │ ├── tessclassifier.cpp │ │ ├── tessclassifier.h │ │ ├── trainingsample.cpp │ │ ├── trainingsample.h │ │ ├── trainingsampleset.cpp │ │ └── trainingsampleset.h │ ├── cube │ │ ├── altlist.cpp │ │ ├── altlist.h │ │ ├── beam_search.cpp │ │ ├── beam_search.h │ │ ├── bmp_8.cpp │ │ ├── bmp_8.h │ │ ├── cached_file.cpp │ │ ├── cached_file.h │ │ ├── char_altlist.cpp │ │ ├── char_altlist.h │ │ ├── char_bigrams.cpp │ │ ├── char_bigrams.h │ │ ├── char_samp.cpp │ │ ├── char_samp.h │ │ ├── char_samp_enum.cpp │ │ ├── char_samp_enum.h │ │ ├── char_samp_set.cpp │ │ ├── char_samp_set.h │ │ ├── char_set.cpp │ │ ├── char_set.h │ │ ├── classifier_base.h │ │ ├── classifier_factory.cpp │ │ ├── classifier_factory.h │ │ ├── con_comp.cpp │ │ ├── con_comp.h │ │ ├── conv_net_classifier.cpp │ │ ├── conv_net_classifier.h │ │ ├── cube_const.h │ │ ├── cube_line_object.cpp │ │ ├── cube_line_object.h │ │ ├── cube_line_segmenter.cpp │ │ ├── cube_line_segmenter.h │ │ ├── cube_object.cpp │ │ ├── cube_object.h │ │ ├── cube_search_object.cpp │ │ ├── cube_search_object.h │ │ ├── cube_tuning_params.cpp │ │ ├── cube_tuning_params.h │ │ ├── cube_utils.cpp │ │ ├── cube_utils.h │ │ ├── feature_base.h │ │ ├── feature_bmp.cpp │ │ ├── feature_bmp.h │ │ ├── feature_chebyshev.cpp │ │ ├── feature_chebyshev.h │ │ ├── feature_hybrid.cpp │ │ ├── feature_hybrid.h │ │ ├── hybrid_neural_net_classifier.cpp │ │ ├── hybrid_neural_net_classifier.h │ │ ├── lang_mod_edge.h │ │ ├── lang_model.h │ │ ├── search_column.cpp │ │ ├── search_column.h │ │ ├── search_node.cpp │ │ ├── search_node.h │ │ ├── search_object.h │ │ ├── string_32.h │ │ ├── tess_lang_mod_edge.cpp │ │ ├── tess_lang_mod_edge.h │ │ ├── tess_lang_model.cpp │ │ ├── tess_lang_model.h │ │ ├── tuning_params.h │ │ ├── word_altlist.cpp │ │ ├── word_altlist.h │ │ ├── word_list_lang_model.cpp │ │ ├── word_list_lang_model.h │ │ ├── word_size_model.cpp │ │ ├── word_size_model.h │ │ ├── word_unigrams.cpp │ │ └── word_unigrams.h │ ├── cutil │ │ ├── bitvec.cpp │ │ ├── bitvec.h │ │ ├── callcpp.cpp │ │ ├── callcpp.h │ │ ├── const.h │ │ ├── cutil.cpp │ │ ├── cutil.h │ │ ├── cutil_class.cpp │ │ ├── cutil_class.h │ │ ├── danerror.cpp │ │ ├── danerror.h │ │ ├── efio.cpp │ │ ├── efio.h │ │ ├── emalloc.cpp │ │ ├── emalloc.h │ │ ├── freelist.cpp │ │ ├── freelist.h │ │ ├── globals.h │ │ ├── oldlist.cpp │ │ ├── oldlist.h │ │ ├── structures.cpp │ │ └── structures.h │ ├── dict │ │ ├── context.cpp │ │ ├── dawg.cpp │ │ ├── dawg.h │ │ ├── dawg_cache.cpp │ │ ├── dawg_cache.h │ │ ├── dict.cpp │ │ ├── dict.h │ │ ├── hyphen.cpp │ │ ├── matchdefs.h │ │ ├── permdawg.cpp │ │ ├── stopper.cpp │ │ ├── stopper.h │ │ ├── trie.cpp │ │ └── trie.h │ ├── neural_networks │ │ └── runtime │ │ │ ├── input_file_buffer.cpp │ │ │ ├── input_file_buffer.h │ │ │ ├── neural_net.cpp │ │ │ ├── neural_net.h │ │ │ ├── neuron.cpp │ │ │ ├── neuron.h │ │ │ └── sigmoid_table.cpp │ ├── opencl │ │ ├── oclkernels.h │ │ ├── opencl_device_selection.h │ │ ├── openclwrapper.cpp │ │ └── openclwrapper.h │ ├── port │ │ ├── gettimeofday.cpp │ │ ├── gettimeofday.h │ │ ├── mathfix.h │ │ ├── strtok_r.cpp │ │ ├── strtok_r.h │ │ └── vcsversion.h │ ├── tesseract.gyp │ ├── textord │ │ ├── alignedblob.cpp │ │ ├── alignedblob.h │ │ ├── baselinedetect.cpp │ │ ├── baselinedetect.h │ │ ├── bbgrid.cpp │ │ ├── bbgrid.h │ │ ├── blkocc.cpp │ │ ├── blkocc.h │ │ ├── blobgrid.cpp │ │ ├── blobgrid.h │ │ ├── ccnontextdetect.cpp │ │ ├── ccnontextdetect.h │ │ ├── cjkpitch.cpp │ │ ├── cjkpitch.h │ │ ├── colfind.cpp │ │ ├── colfind.h │ │ ├── colpartition.cpp │ │ ├── colpartition.h │ │ ├── colpartitiongrid.cpp │ │ ├── colpartitiongrid.h │ │ ├── colpartitionset.cpp │ │ ├── colpartitionset.h │ │ ├── devanagari_processing.cpp │ │ ├── devanagari_processing.h │ │ ├── drawedg.cpp │ │ ├── drawedg.h │ │ ├── drawtord.cpp │ │ ├── drawtord.h │ │ ├── edgblob.cpp │ │ ├── edgblob.h │ │ ├── edgloop.cpp │ │ ├── edgloop.h │ │ ├── equationdetectbase.cpp │ │ ├── equationdetectbase.h │ │ ├── fpchop.cpp │ │ ├── fpchop.h │ │ ├── gap_map.cpp │ │ ├── gap_map.h │ │ ├── imagefind.cpp │ │ ├── imagefind.h │ │ ├── linefind.cpp │ │ ├── linefind.h │ │ ├── makerow.cpp │ │ ├── makerow.h │ │ ├── oldbasel.cpp │ │ ├── oldbasel.h │ │ ├── pithsync.cpp │ │ ├── pithsync.h │ │ ├── pitsync1.cpp │ │ ├── pitsync1.h │ │ ├── scanedg.cpp │ │ ├── scanedg.h │ │ ├── sortflts.cpp │ │ ├── sortflts.h │ │ ├── strokewidth.cpp │ │ ├── strokewidth.h │ │ ├── tabfind.cpp │ │ ├── tabfind.h │ │ ├── tablefind.cpp │ │ ├── tablefind.h │ │ ├── tablerecog.cpp │ │ ├── tablerecog.h │ │ ├── tabvector.cpp │ │ ├── tabvector.h │ │ ├── textlineprojection.cpp │ │ ├── textlineprojection.h │ │ ├── textord.cpp │ │ ├── textord.h │ │ ├── topitch.cpp │ │ ├── topitch.h │ │ ├── tordmain.cpp │ │ ├── tordmain.h │ │ ├── tospace.cpp │ │ ├── tovars.cpp │ │ ├── tovars.h │ │ ├── underlin.cpp │ │ ├── underlin.h │ │ ├── wordseg.cpp │ │ ├── wordseg.h │ │ ├── workingpartset.cpp │ │ └── workingpartset.h │ ├── viewer │ │ ├── scrollview.cpp │ │ ├── scrollview.h │ │ ├── svmnode.cpp │ │ ├── svmnode.h │ │ ├── svpaint.cpp │ │ ├── svutil.cpp │ │ └── svutil.h │ └── wordrec │ │ ├── associate.cpp │ │ ├── associate.h │ │ ├── chop.cpp │ │ ├── chop.h │ │ ├── chopper.cpp │ │ ├── chopper.h │ │ ├── drawfx.cpp │ │ ├── drawfx.h │ │ ├── findseam.cpp │ │ ├── findseam.h │ │ ├── gradechop.cpp │ │ ├── gradechop.h │ │ ├── language_model.cpp │ │ ├── language_model.h │ │ ├── lm_consistency.cpp │ │ ├── lm_consistency.h │ │ ├── lm_pain_points.cpp │ │ ├── lm_pain_points.h │ │ ├── lm_state.cpp │ │ ├── lm_state.h │ │ ├── measure.h │ │ ├── outlines.cpp │ │ ├── outlines.h │ │ ├── params_model.cpp │ │ ├── params_model.h │ │ ├── pieces.cpp │ │ ├── plotedges.cpp │ │ ├── plotedges.h │ │ ├── render.cpp │ │ ├── render.h │ │ ├── segsearch.cpp │ │ ├── tface.cpp │ │ ├── wordclass.cpp │ │ ├── wordrec.cpp │ │ └── wordrec.h └── zxing │ ├── core │ └── src │ │ ├── bigint │ │ ├── BigInteger.cc │ │ ├── BigInteger.hh │ │ ├── BigIntegerAlgorithms.cc │ │ ├── BigIntegerAlgorithms.hh │ │ ├── BigIntegerLibrary.hh │ │ ├── BigIntegerUtils.cc │ │ ├── BigIntegerUtils.hh │ │ ├── BigUnsigned.cc │ │ ├── BigUnsigned.hh │ │ ├── BigUnsignedInABase.cc │ │ ├── BigUnsignedInABase.hh │ │ ├── ChangeLog │ │ ├── NumberlikeArray.hh │ │ └── README │ │ ├── win32 │ │ └── zxing │ │ │ ├── iconv.h │ │ │ ├── stdint.h │ │ │ └── win_iconv.c │ │ └── zxing │ │ ├── BarcodeFormat.cpp │ │ ├── BarcodeFormat.h │ │ ├── Binarizer.cpp │ │ ├── Binarizer.h │ │ ├── BinaryBitmap.cpp │ │ ├── BinaryBitmap.h │ │ ├── ChecksumException.cpp │ │ ├── ChecksumException.h │ │ ├── DecodeHints.cpp │ │ ├── DecodeHints.h │ │ ├── Exception.cpp │ │ ├── Exception.h │ │ ├── FormatException.cpp │ │ ├── FormatException.h │ │ ├── IllegalStateException.h │ │ ├── InvertedLuminanceSource.cpp │ │ ├── InvertedLuminanceSource.h │ │ ├── LuminanceSource.cpp │ │ ├── LuminanceSource.h │ │ ├── MultiFormatReader.cpp │ │ ├── MultiFormatReader.h │ │ ├── NotFoundException.h │ │ ├── Reader.cpp │ │ ├── Reader.h │ │ ├── ReaderException.h │ │ ├── Result.cpp │ │ ├── Result.h │ │ ├── ResultIO.cpp │ │ ├── ResultPoint.cpp │ │ ├── ResultPoint.h │ │ ├── ResultPointCallback.cpp │ │ ├── ResultPointCallback.h │ │ ├── ZXing.h │ │ ├── aztec │ │ ├── AztecDetectorResult.cpp │ │ ├── AztecDetectorResult.h │ │ ├── AztecReader.cpp │ │ ├── AztecReader.h │ │ ├── decoder │ │ │ ├── 1Decoder.cpp │ │ │ └── Decoder.h │ │ └── detector │ │ │ ├── 1Detector.cpp │ │ │ └── Detector.h │ │ ├── common │ │ ├── Array.h │ │ ├── BitArray.cpp │ │ ├── BitArray.h │ │ ├── BitArrayIO.cpp │ │ ├── BitMatrix.cpp │ │ ├── BitMatrix.h │ │ ├── BitSource.cpp │ │ ├── BitSource.h │ │ ├── CharacterSetECI.cpp │ │ ├── CharacterSetECI.h │ │ ├── Counted.h │ │ ├── DecoderResult.cpp │ │ ├── DecoderResult.h │ │ ├── DetectorResult.cpp │ │ ├── DetectorResult.h │ │ ├── GlobalHistogramBinarizer.cpp │ │ ├── GlobalHistogramBinarizer.h │ │ ├── GreyscaleLuminanceSource.cpp │ │ ├── GreyscaleLuminanceSource.h │ │ ├── GreyscaleRotatedLuminanceSource.cpp │ │ ├── GreyscaleRotatedLuminanceSource.h │ │ ├── GridSampler.cpp │ │ ├── GridSampler.h │ │ ├── HybridBinarizer.cpp │ │ ├── HybridBinarizer.h │ │ ├── IllegalArgumentException.cpp │ │ ├── IllegalArgumentException.h │ │ ├── PerspectiveTransform.cpp │ │ ├── PerspectiveTransform.h │ │ ├── Point.h │ │ ├── Str.cpp │ │ ├── Str.h │ │ ├── StringUtils.cpp │ │ ├── StringUtils.h │ │ ├── detector │ │ │ ├── JavaMath.h │ │ │ ├── MathUtils.h │ │ │ ├── MonochromeRectangleDetector.cpp │ │ │ ├── MonochromeRectangleDetector.h │ │ │ ├── WhiteRectangleDetector.cpp │ │ │ └── WhiteRectangleDetector.h │ │ └── reedsolomon │ │ │ ├── GenericGF.cpp │ │ │ ├── GenericGF.h │ │ │ ├── GenericGFPoly.cpp │ │ │ ├── GenericGFPoly.h │ │ │ ├── ReedSolomonDecoder.cpp │ │ │ ├── ReedSolomonDecoder.h │ │ │ ├── ReedSolomonException.cpp │ │ │ └── ReedSolomonException.h │ │ ├── datamatrix │ │ ├── 1Version.cpp │ │ ├── DataMatrixReader.cpp │ │ ├── DataMatrixReader.h │ │ ├── Version.h │ │ ├── decoder │ │ │ ├── 1BitMatrixParser.cpp │ │ │ ├── 1DataBlock.cpp │ │ │ ├── 1DecodedBitStreamParser.cpp │ │ │ ├── 2Decoder.cpp │ │ │ ├── BitMatrixParser.h │ │ │ ├── DataBlock.h │ │ │ ├── DecodedBitStreamParser.h │ │ │ └── Decoder.h │ │ └── detector │ │ │ ├── 2Detector.cpp │ │ │ ├── CornerPoint.cpp │ │ │ ├── CornerPoint.h │ │ │ ├── Detector.h │ │ │ ├── DetectorException.cpp │ │ │ └── DetectorException.h │ │ ├── multi │ │ ├── ByQuadrantReader.cpp │ │ ├── ByQuadrantReader.h │ │ ├── GenericMultipleBarcodeReader.cpp │ │ ├── GenericMultipleBarcodeReader.h │ │ ├── MultipleBarcodeReader.cpp │ │ ├── MultipleBarcodeReader.h │ │ └── qrcode │ │ │ ├── QRCodeMultiReader.cpp │ │ │ ├── QRCodeMultiReader.h │ │ │ └── detector │ │ │ ├── MultiDetector.cpp │ │ │ ├── MultiDetector.h │ │ │ ├── MultiFinderPatternFinder.cpp │ │ │ └── MultiFinderPatternFinder.h │ │ ├── oned │ │ ├── CodaBarReader.cpp │ │ ├── CodaBarReader.h │ │ ├── Code128Reader.cpp │ │ ├── Code128Reader.h │ │ ├── Code39Reader.cpp │ │ ├── Code39Reader.h │ │ ├── Code93Reader.cpp │ │ ├── Code93Reader.h │ │ ├── EAN13Reader.cpp │ │ ├── EAN13Reader.h │ │ ├── EAN8Reader.cpp │ │ ├── EAN8Reader.h │ │ ├── ITFReader.cpp │ │ ├── ITFReader.h │ │ ├── MultiFormatOneDReader.cpp │ │ ├── MultiFormatOneDReader.h │ │ ├── MultiFormatUPCEANReader.cpp │ │ ├── MultiFormatUPCEANReader.h │ │ ├── OneDReader.cpp │ │ ├── OneDReader.h │ │ ├── OneDResultPoint.cpp │ │ ├── OneDResultPoint.h │ │ ├── UPCAReader.cpp │ │ ├── UPCAReader.h │ │ ├── UPCEANReader.cpp │ │ ├── UPCEANReader.h │ │ ├── UPCEReader.cpp │ │ └── UPCEReader.h │ │ ├── pdf417 │ │ ├── PDF417Reader.cpp │ │ ├── PDF417Reader.h │ │ ├── decoder │ │ │ ├── 2BitMatrixParser.cpp │ │ │ ├── 2DecodedBitStreamParser.cpp │ │ │ ├── 3Decoder.cpp │ │ │ ├── BitMatrixParser.h │ │ │ ├── DecodedBitStreamParser.h │ │ │ ├── Decoder.h │ │ │ └── ec │ │ │ │ ├── ErrorCorrection.cpp │ │ │ │ ├── ErrorCorrection.h │ │ │ │ ├── ModulusGF.cpp │ │ │ │ ├── ModulusGF.h │ │ │ │ ├── ModulusPoly.cpp │ │ │ │ └── ModulusPoly.h │ │ └── detector │ │ │ ├── 3Detector.cpp │ │ │ ├── Detector.h │ │ │ ├── LinesSampler.cpp │ │ │ └── LinesSampler.h │ │ └── qrcode │ │ ├── 2Version.cpp │ │ ├── ErrorCorrectionLevel.cpp │ │ ├── ErrorCorrectionLevel.h │ │ ├── FormatInformation.cpp │ │ ├── FormatInformation.h │ │ ├── QRCodeReader.cpp │ │ ├── QRCodeReader.h │ │ ├── Version.h │ │ ├── decoder │ │ ├── 2DataBlock.cpp │ │ ├── 3BitMatrixParser.cpp │ │ ├── 3DecodedBitStreamParser.cpp │ │ ├── 4Decoder.cpp │ │ ├── BitMatrixParser.h │ │ ├── DataBlock.h │ │ ├── DataMask.cpp │ │ ├── DataMask.h │ │ ├── DecodedBitStreamParser.h │ │ ├── Decoder.h │ │ ├── Mode.cpp │ │ └── Mode.h │ │ └── detector │ │ ├── 4Detector.cpp │ │ ├── AlignmentPattern.cpp │ │ ├── AlignmentPattern.h │ │ ├── AlignmentPatternFinder.cpp │ │ ├── AlignmentPatternFinder.h │ │ ├── Detector.h │ │ ├── FinderPattern.cpp │ │ ├── FinderPattern.h │ │ ├── FinderPatternFinder.cpp │ │ ├── FinderPatternFinder.h │ │ ├── FinderPatternInfo.cpp │ │ └── FinderPatternInfo.h │ └── zxing.gyp ├── lib └── dv.js ├── package-lock.json ├── package.json ├── src ├── image.cc ├── image.h ├── module.cc ├── tesseract.cc ├── tesseract.h ├── util.cc ├── util.h ├── zxing.cc └── zxing.h ├── test ├── fixtures │ ├── barcode1.png │ ├── barcode2.png │ ├── barcode3.png │ ├── dave.png │ ├── rgb.jpg │ ├── rgba.png │ └── textpage300.png ├── fixtures_out │ └── .empty ├── image.test.js ├── tesseract.test.js └── zxing.test.js ├── tools ├── fix_zxing_basenames.py ├── glob.py ├── pretty_gyp.py └── update-authors.sh └── yarn.lock /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | [Tt]humbs.db 3 | 4 | *~ 5 | *.bak 6 | *.log 7 | 8 | build 9 | lib/*.node 10 | node_modules 11 | test/fixtures_out/*.png 12 | test/fixtures_out/*.jpg 13 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | *~ 2 | *.bak 3 | *.log 4 | .travis.yml 5 | 6 | build/ 7 | lib/*.node 8 | test/ 9 | tools/ 10 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | sudo: false 3 | os: 4 | - linux 5 | - osx 6 | node_js: 7 | - "0.12" 8 | - "4.4" 9 | - "5.8" 10 | before_install: 11 | - export CXX="g++-4.8" CC="gcc-4.8" 12 | addons: 13 | apt: 14 | sources: 15 | - ubuntu-toolchain-r-test 16 | packages: 17 | - libyajl-dev 18 | - libxml2-dev 19 | - gcc-4.8 20 | - g++-4.8 21 | branches: 22 | only: 23 | - master 24 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | # Authors ordered by first contribution. 2 | 3 | Christoph Schulz 4 | Wolfgang Fellger 5 | routix 6 | Christian Dittrich 7 | chrox 8 | Barrington Haynes 9 | rashfael 10 | 11 | # Generated by tools/update-authors.sh 12 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2012 Christoph Schulz 4 | Copyright (c) 2013-2015 creatale GmbH, contributors listed under AUTHORS 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | 24 | External libraries are licensed under their respective licenses. 25 | -------------------------------------------------------------------------------- /appveyor.yml: -------------------------------------------------------------------------------- 1 | # Test against this version of Node.js 2 | environment: 3 | matrix: 4 | - MSVS_VERSION: 2012 5 | nodejs_version: "4" 6 | - MSVS_VERSION: 2013 7 | nodejs_version: "4" 8 | - MSVS_VERSION: 2015 9 | nodejs_version: "4" 10 | - MSVS_VERSION: 2012 11 | nodejs_version: "5" 12 | - MSVS_VERSION: 2013 13 | nodejs_version: "5" 14 | - MSVS_VERSION: 2015 15 | nodejs_version: "5" 16 | 17 | # Install scripts. (runs after repo cloning) 18 | install: 19 | # Get the latest stable version of Node.js or io.js 20 | - ps: Install-Product node $env:nodejs_version 21 | # install modules 22 | - npm install --msvs_version=%MSVS_VERSION% 23 | 24 | # Post-install test scripts. 25 | test_script: 26 | # Output useful info for debugging. 27 | - node --version 28 | - npm --version 29 | # run tests 30 | # - npm test 31 | 32 | # Don't actually build. 33 | build: off 34 | -------------------------------------------------------------------------------- /deps/common.gyp: -------------------------------------------------------------------------------- 1 | { 2 | 'target_defaults': { 3 | 'conditions': [ 4 | ['OS=="linux"', 5 | { 6 | 'cflags_cc!': [ '-fno-exceptions' ], 7 | 'cflags': [ '-O3', '-march=native', '-w' ], 8 | } 9 | ], 10 | ['OS=="mac"', 11 | { 12 | 'xcode_settings': { 13 | 'GCC_ENABLE_CPP_EXCEPTIONS': 'YES', 14 | 'OTHER_CFLAGS': [ '-O3', '-march=native', '-w' ], 15 | 'OTHER_CPLUSPLUSFLAGS' : ['-Wno-c++11-narrowing'] 16 | } 17 | } 18 | ], 19 | ['OS=="win"', 20 | { 21 | 'configurations': { 22 | 'Debug': { 23 | 'msvs_settings': { 24 | 'VCCLCompilerTool': { 25 | 'ExceptionHandling': '1', 26 | }, 27 | }, 28 | }, 29 | 'Release': { 30 | 'msvs_settings': { 31 | 'VCCLCompilerTool': { 32 | 'WarningLevel': '0', 33 | 'ExceptionHandling': '1', 34 | }, 35 | }, 36 | }, 37 | }, 38 | } 39 | ] 40 | ] 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /deps/jpg/jpg.gyp: -------------------------------------------------------------------------------- 1 | { 2 | 'includes': [ '../common.gyp' ], 3 | 'targets': [ 4 | { 5 | 'target_name': 'jpg', 6 | 'type': 'static_library', 7 | 'include_dirs': [ 8 | '.', 9 | ], 10 | 'sources': [ 11 | './jpgd.cpp', 12 | './jpge.cpp', 13 | ], 14 | }, 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /deps/leptonica/leptonica-license.txt: -------------------------------------------------------------------------------- 1 | /*====================================================================* 2 | - Copyright (C) 2001-2016 Leptonica. All rights reserved. 3 | - 4 | - Redistribution and use in source and binary forms, with or without 5 | - modification, are permitted provided that the following conditions 6 | - are met: 7 | - 1. Redistributions of source code must retain the above copyright 8 | - notice, this list of conditions and the following disclaimer. 9 | - 2. Redistributions in binary form must reproduce the above 10 | - copyright notice, this list of conditions and the following 11 | - disclaimer in the documentation and/or other materials 12 | - provided with the distribution. 13 | - 14 | - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 15 | - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 16 | - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 17 | - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANY 18 | - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 19 | - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 20 | - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 21 | - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 22 | - OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 23 | - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | *====================================================================*/ 26 | 27 | -------------------------------------------------------------------------------- /deps/leptonica/src/endianness.h: -------------------------------------------------------------------------------- 1 | #if !defined (L_BIG_ENDIAN) && !defined (L_LITTLE_ENDIAN) 2 | # if 0 3 | # ifdef __BIG_ENDIAN__ 4 | # define L_BIG_ENDIAN 5 | # else 6 | # define L_LITTLE_ENDIAN 7 | # endif 8 | # else 9 | # define L_LITTLE_ENDIAN 10 | # endif 11 | #endif 12 | -------------------------------------------------------------------------------- /deps/lodepng/lodepng.gyp: -------------------------------------------------------------------------------- 1 | { 2 | 'includes': [ '../common.gyp' ], 3 | 'targets': [ 4 | { 5 | 'target_name': 'lodepng', 6 | 'type': 'static_library', 7 | 'include_dirs': [ 8 | '.', 9 | ], 10 | 'sources': [ 11 | './lodepng.cpp', 12 | ], 13 | }, 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /deps/lswms/lswms.gyp: -------------------------------------------------------------------------------- 1 | { 2 | 'includes': [ '../common.gyp' ], 3 | 'targets': [ 4 | { 5 | 'target_name': 'liblswms', 6 | 'type': 'static_library', 7 | 'dependencies': [ 8 | '../opencv/opencv.gyp:libopencv' 9 | ], 10 | 'include_dirs': [ 11 | '../opencv/include', 12 | '../opencv/modules/core/include', 13 | '../opencv/modules/imgproc/include', 14 | ], 15 | 'sources': [ 16 | 'LSWMS.cpp', 17 | ], 18 | }, 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /deps/opencv/include/cvconfig.h: -------------------------------------------------------------------------------- 1 | #ifndef OPENCV_CVCONFIG_H_INCLUDED 2 | #define OPENCV_CVCONFIG_H_INCLUDED 3 | 4 | #define __OPENCV_BUILD 5 | 6 | #endif // OPENCV_CVCONFIG_H_INCLUDED 7 | -------------------------------------------------------------------------------- /deps/opencv/include/version_string.inc: -------------------------------------------------------------------------------- 1 | "\n" 2 | "General configuration for OpenCV 2.4.13.6 =====================================\n" 3 | "-----------------------------------------------------------------\n" 4 | "\n" 5 | -------------------------------------------------------------------------------- /deps/opencv/modules/dynamicuda/src/main.cpp: -------------------------------------------------------------------------------- 1 | #include "cvconfig.h" 2 | #include "opencv2/core/core.hpp" 3 | #include "opencv2/core/gpumat.hpp" 4 | 5 | #include 6 | #include 7 | 8 | #ifdef HAVE_CUDA 9 | # include 10 | # include 11 | 12 | # define CUDART_MINIMUM_REQUIRED_VERSION 4020 13 | # define NPP_MINIMUM_REQUIRED_VERSION 4200 14 | 15 | # if (CUDART_VERSION < CUDART_MINIMUM_REQUIRED_VERSION) 16 | # error "Insufficient Cuda Runtime library version, please update it." 17 | # endif 18 | 19 | # if (NPP_VERSION_MAJOR * 1000 + NPP_VERSION_MINOR * 100 + NPP_VERSION_BUILD < NPP_MINIMUM_REQUIRED_VERSION) 20 | # error "Insufficient NPP version, please update it." 21 | # endif 22 | #endif 23 | 24 | using namespace std; 25 | using namespace cv; 26 | using namespace cv::gpu; 27 | 28 | #define throw_nogpu CV_Error(CV_GpuNotSupported, "The library is compiled without CUDA support") 29 | 30 | #include "opencv2/dynamicuda/dynamicuda.hpp" 31 | 32 | #ifdef HAVE_CUDA 33 | static CudaDeviceInfoFuncTable deviceInfoTable; 34 | static CudaFuncTable gpuTable; 35 | #else 36 | static EmptyDeviceInfoFuncTable deviceInfoTable; 37 | static EmptyFuncTable gpuTable; 38 | #endif 39 | 40 | extern "C" { 41 | 42 | DeviceInfoFuncTable* deviceInfoFactory(); 43 | GpuFuncTable* gpuFactory(); 44 | 45 | DeviceInfoFuncTable* deviceInfoFactory() 46 | { 47 | return (DeviceInfoFuncTable*)&deviceInfoTable; 48 | } 49 | 50 | GpuFuncTable* gpuFactory() 51 | { 52 | return (GpuFuncTable*)&gpuTable; 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /deps/tesseract/COPYING: -------------------------------------------------------------------------------- 1 | This package contains the Tesseract Open Source OCR Engine. 2 | Originally developed at Hewlett Packard Laboratories Bristol and 3 | at Hewlett Packard Co, Greeley Colorado, all the code 4 | in this distribution is now licensed under the Apache License: 5 | 6 | ** Licensed under the Apache License, Version 2.0 (the "License"); 7 | ** you may not use this file except in compliance with the License. 8 | ** You may obtain a copy of the License at 9 | ** http://www.apache.org/licenses/LICENSE-2.0 10 | ** Unless required by applicable law or agreed to in writing, software 11 | ** distributed under the License is distributed on an "AS IS" BASIS, 12 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | ** See the License for the specific language governing permissions and 14 | ** limitations under the License. 15 | 16 | 17 | Other Dependencies and Licenses: 18 | ================================ 19 | 20 | Tesseract uses Leptonica library (http://leptonica.com/) which essentially 21 | uses a BSD 2-clause license. (http://leptonica.com/about-the-license.html) 22 | -------------------------------------------------------------------------------- /deps/tesseract/api/apitypes.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////// 2 | // File: apitypes.h 3 | // Description: Types used in both the API and internally 4 | // Author: Ray Smith 5 | // Created: Wed Mar 03 09:22:53 PST 2010 6 | // 7 | // (C) Copyright 2010, Google Inc. 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | // 18 | /////////////////////////////////////////////////////////////////////// 19 | 20 | #ifndef TESSERACT_API_APITYPES_H__ 21 | #define TESSERACT_API_APITYPES_H__ 22 | 23 | #include "publictypes.h" 24 | 25 | // The types used by the API and Page/ResultIterator can be found in: 26 | // ccstruct/publictypes.h 27 | // ccmain/resultiterator.h 28 | // ccmain/pageiterator.h 29 | // API interfaces and API users should be sure to include this file, rather 30 | // than the lower-level one, and lower-level code should be sure to include 31 | // only the lower-level file. 32 | 33 | #endif // TESSERACT_API_APITYPES_H__ 34 | -------------------------------------------------------------------------------- /deps/tesseract/ccmain/control.h: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * File: control.h (Formerly control.h) 3 | * Description: Module-independent matcher controller. 4 | * Author: Ray Smith 5 | * Created: Thu Apr 23 11:09:58 BST 1992 6 | * 7 | * (C) Copyright 1992, Hewlett-Packard Ltd. 8 | ** Licensed under the Apache License, Version 2.0 (the "License"); 9 | ** you may not use this file except in compliance with the License. 10 | ** You may obtain a copy of the License at 11 | ** http://www.apache.org/licenses/LICENSE-2.0 12 | ** Unless required by applicable law or agreed to in writing, software 13 | ** distributed under the License is distributed on an "AS IS" BASIS, 14 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | ** See the License for the specific language governing permissions and 16 | ** limitations under the License. 17 | * 18 | **********************************************************************/ 19 | 20 | /** 21 | * @file control.h 22 | * Module-independent matcher controller. 23 | */ 24 | 25 | #ifndef CONTROL_H 26 | #define CONTROL_H 27 | 28 | #include "params.h" 29 | #include "ocrblock.h" 30 | #include "ratngs.h" 31 | #include "statistc.h" 32 | #include "pageres.h" 33 | 34 | enum ACCEPTABLE_WERD_TYPE 35 | { 36 | AC_UNACCEPTABLE, ///< Unacceptable word 37 | AC_LOWER_CASE, ///< ALL lower case 38 | AC_UPPER_CASE, ///< ALL upper case 39 | AC_INITIAL_CAP, ///< ALL but initial lc 40 | AC_LC_ABBREV, ///< a.b.c. 41 | AC_UC_ABBREV ///< A.B.C. 42 | }; 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /deps/tesseract/ccmain/docqual.h: -------------------------------------------------------------------------------- 1 | /****************************************************************** 2 | * File: docqual.h (Formerly docqual.h) 3 | * Description: Document Quality Metrics 4 | * Author: Phil Cheatle 5 | * Created: Mon May 9 11:27:28 BST 1994 6 | * 7 | * (C) Copyright 1994, Hewlett-Packard Ltd. 8 | ** Licensed under the Apache License, Version 2.0 (the "License"); 9 | ** you may not use this file except in compliance with the License. 10 | ** You may obtain a copy of the License at 11 | ** http://www.apache.org/licenses/LICENSE-2.0 12 | ** Unless required by applicable law or agreed to in writing, software 13 | ** distributed under the License is distributed on an "AS IS" BASIS, 14 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | ** See the License for the specific language governing permissions and 16 | ** limitations under the License. 17 | * 18 | **********************************************************************/ 19 | 20 | #ifndef DOCQUAL_H 21 | #define DOCQUAL_H 22 | 23 | #include "control.h" 24 | 25 | enum GARBAGE_LEVEL 26 | { 27 | G_NEVER_CRUNCH, 28 | G_OK, 29 | G_DODGY, 30 | G_TERRIBLE 31 | }; 32 | 33 | inT16 word_blob_quality(WERD_RES *word, ROW *row); 34 | void reject_whole_page(PAGE_RES_IT &page_res_it); 35 | #endif 36 | -------------------------------------------------------------------------------- /deps/tesseract/ccmain/fixspace.h: -------------------------------------------------------------------------------- 1 | /****************************************************************** 2 | * File: fixspace.h (Formerly fixspace.h) 3 | * Description: Implements a pass over the page res, exploring the alternative 4 | * spacing possibilities, trying to use context to improve the 5 | word spacing 6 | * Author: Phil Cheatle 7 | * Created: Thu Oct 21 11:38:43 BST 1993 8 | * 9 | * (C) Copyright 1993, Hewlett-Packard Ltd. 10 | ** Licensed under the Apache License, Version 2.0 (the "License"); 11 | ** you may not use this file except in compliance with the License. 12 | ** You may obtain a copy of the License at 13 | ** http://www.apache.org/licenses/LICENSE-2.0 14 | ** Unless required by applicable law or agreed to in writing, software 15 | ** distributed under the License is distributed on an "AS IS" BASIS, 16 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | ** See the License for the specific language governing permissions and 18 | ** limitations under the License. 19 | * 20 | **********************************************************************/ 21 | 22 | #ifndef FIXSPACE_H 23 | #define FIXSPACE_H 24 | 25 | #include "pageres.h" 26 | #include "params.h" 27 | 28 | void initialise_search(WERD_RES_LIST &src_list, WERD_RES_LIST &new_list); 29 | void transform_to_next_perm(WERD_RES_LIST &words); 30 | void fixspace_dbg(WERD_RES *word); 31 | #endif 32 | -------------------------------------------------------------------------------- /deps/tesseract/ccmain/output.h: -------------------------------------------------------------------------------- 1 | /****************************************************************** 2 | * File: output.h (Formerly output.h) 3 | * Description: Output pass 4 | * Author: Phil Cheatle 5 | * Created: Thu Aug 4 10:56:08 BST 1994 6 | * 7 | * (C) Copyright 1994, Hewlett-Packard Ltd. 8 | ** Licensed under the Apache License, Version 2.0 (the "License"); 9 | ** you may not use this file except in compliance with the License. 10 | ** You may obtain a copy of the License at 11 | ** http://www.apache.org/licenses/LICENSE-2.0 12 | ** Unless required by applicable law or agreed to in writing, software 13 | ** distributed under the License is distributed on an "AS IS" BASIS, 14 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | ** See the License for the specific language governing permissions and 16 | ** limitations under the License. 17 | * 18 | **********************************************************************/ 19 | 20 | #ifndef OUTPUT_H 21 | #define OUTPUT_H 22 | 23 | #include "params.h" 24 | //#include "epapconv.h" 25 | #include "pageres.h" 26 | 27 | /** test line ends */ 28 | char determine_newline_type(WERD *word, ///< word to do 29 | BLOCK *block, ///< current block 30 | WERD *next_word, ///< next word 31 | BLOCK *next_block ///< block of next word 32 | ); 33 | #endif 34 | -------------------------------------------------------------------------------- /deps/tesseract/ccmain/reject.h: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * File: reject.h (Formerly reject.h) 3 | * Description: Rejection functions used in tessedit 4 | * Author: Phil Cheatle 5 | * Created: Wed Sep 23 16:50:21 BST 1992 6 | * 7 | * (C) Copyright 1992, Hewlett-Packard Ltd. 8 | ** Licensed under the Apache License, Version 2.0 (the "License"); 9 | ** you may not use this file except in compliance with the License. 10 | ** You may obtain a copy of the License at 11 | ** http://www.apache.org/licenses/LICENSE-2.0 12 | ** Unless required by applicable law or agreed to in writing, software 13 | ** distributed under the License is distributed on an "AS IS" BASIS, 14 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | ** See the License for the specific language governing permissions and 16 | ** limitations under the License. 17 | * 18 | **********************************************************************/ 19 | 20 | #ifndef REJECT_H 21 | #define REJECT_H 22 | 23 | #include "params.h" 24 | #include "pageres.h" 25 | 26 | void reject_blanks(WERD_RES *word); 27 | void reject_poor_matches(WERD_RES *word); 28 | float compute_reject_threshold(WERD_CHOICE* word); 29 | BOOL8 word_contains_non_1_digit(const char *word, const char *word_lengths); 30 | void dont_allow_1Il(WERD_RES *word); 31 | void flip_hyphens(WERD_RES *word); 32 | void flip_0O(WERD_RES *word); 33 | BOOL8 non_0_digit(const char* str, int length); 34 | #endif 35 | -------------------------------------------------------------------------------- /deps/tesseract/ccmain/tessbox.h: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * File: tessbox.h (Formerly tessbox.h) 3 | * Description: Black boxed Tess for developing a resaljet. 4 | * Author: Ray Smith 5 | * Created: Thu Apr 23 11:03:36 BST 1992 6 | * 7 | * (C) Copyright 1992, Hewlett-Packard Ltd. 8 | ** Licensed under the Apache License, Version 2.0 (the "License"); 9 | ** you may not use this file except in compliance with the License. 10 | ** You may obtain a copy of the License at 11 | ** http://www.apache.org/licenses/LICENSE-2.0 12 | ** Unless required by applicable law or agreed to in writing, software 13 | ** distributed under the License is distributed on an "AS IS" BASIS, 14 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | ** See the License for the specific language governing permissions and 16 | ** limitations under the License. 17 | * 18 | **********************************************************************/ 19 | 20 | #ifndef TESSBOX_H 21 | #define TESSBOX_H 22 | 23 | #include "ratngs.h" 24 | #include "tesseractclass.h" 25 | 26 | // TODO(ocr-team): Delete this along with other empty header files. 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /deps/tesseract/ccmain/tessedit.h: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * File: tessedit.h (Formerly tessedit.h) 3 | * Description: Main program for merge of tess and editor. 4 | * Author: Ray Smith 5 | * Created: Tue Jan 07 15:21:46 GMT 1992 6 | * 7 | * (C) Copyright 1992, Hewlett-Packard Ltd. 8 | ** Licensed under the Apache License, Version 2.0 (the "License"); 9 | ** you may not use this file except in compliance with the License. 10 | ** You may obtain a copy of the License at 11 | ** http://www.apache.org/licenses/LICENSE-2.0 12 | ** Unless required by applicable law or agreed to in writing, software 13 | ** distributed under the License is distributed on an "AS IS" BASIS, 14 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | ** See the License for the specific language governing permissions and 16 | ** limitations under the License. 17 | * 18 | **********************************************************************/ 19 | 20 | #ifndef TESSEDIT_H 21 | #define TESSEDIT_H 22 | 23 | #include "blobs.h" 24 | #include "pgedit.h" 25 | 26 | //progress monitor 27 | extern ETEXT_DESC *global_monitor; 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /deps/tesseract/ccmain/tessvars.cpp: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * File: tessvars.cpp (Formerly tessvars.c) 3 | * Description: Variables and other globals for tessedit. 4 | * Author: Ray Smith 5 | * Created: Mon Apr 13 13:13:23 BST 1992 6 | * 7 | * (C) Copyright 1992, Hewlett-Packard Ltd. 8 | ** Licensed under the Apache License, Version 2.0 (the "License"); 9 | ** you may not use this file except in compliance with the License. 10 | ** You may obtain a copy of the License at 11 | ** http://www.apache.org/licenses/LICENSE-2.0 12 | ** Unless required by applicable law or agreed to in writing, software 13 | ** distributed under the License is distributed on an "AS IS" BASIS, 14 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | ** See the License for the specific language governing permissions and 16 | ** limitations under the License. 17 | * 18 | **********************************************************************/ 19 | 20 | #include 21 | 22 | #include "tessvars.h" 23 | 24 | FILE *debug_fp = stderr; // write debug stuff here 25 | -------------------------------------------------------------------------------- /deps/tesseract/ccmain/tessvars.h: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * File: tessvars.h (Formerly tessvars.h) 3 | * Description: Variables and other globals for tessedit. 4 | * Author: Ray Smith 5 | * Created: Mon Apr 13 13:13:23 BST 1992 6 | * 7 | * (C) Copyright 1992, Hewlett-Packard Ltd. 8 | ** Licensed under the Apache License, Version 2.0 (the "License"); 9 | ** you may not use this file except in compliance with the License. 10 | ** You may obtain a copy of the License at 11 | ** http://www.apache.org/licenses/LICENSE-2.0 12 | ** Unless required by applicable law or agreed to in writing, software 13 | ** distributed under the License is distributed on an "AS IS" BASIS, 14 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | ** See the License for the specific language governing permissions and 16 | ** limitations under the License. 17 | * 18 | **********************************************************************/ 19 | 20 | #ifndef TESSVARS_H 21 | #define TESSVARS_H 22 | 23 | #include 24 | 25 | 26 | extern FILE *debug_fp; // write debug stuff here 27 | #endif 28 | -------------------------------------------------------------------------------- /deps/tesseract/ccmain/werdit.h: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * File: wordit.c 3 | * Description: An iterator for passing over all the words in a document. 4 | * Author: Ray Smith 5 | * Created: Mon Apr 27 08:51:22 BST 1992 6 | * 7 | * (C) Copyright 1992, Hewlett-Packard Ltd. 8 | ** Licensed under the Apache License, Version 2.0 (the "License"); 9 | ** you may not use this file except in compliance with the License. 10 | ** You may obtain a copy of the License at 11 | ** http://www.apache.org/licenses/LICENSE-2.0 12 | ** Unless required by applicable law or agreed to in writing, software 13 | ** distributed under the License is distributed on an "AS IS" BASIS, 14 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | ** See the License for the specific language governing permissions and 16 | ** limitations under the License. 17 | * 18 | **********************************************************************/ 19 | 20 | #ifndef WERDIT_H 21 | #define WERDIT_H 22 | 23 | #include "pageres.h" 24 | 25 | PAGE_RES_IT* make_pseudo_word(PAGE_RES* page_res, const TBOX& selection_box); 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /deps/tesseract/ccstruct/blckerr.h: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * File: blckerr.h (Formerly blockerr.h) 3 | * Description: Error codes for the page block classes. 4 | * Author: Ray Smith 5 | * Created: Tue Mar 19 17:43:30 GMT 1991 6 | * 7 | * (C) Copyright 1991, Hewlett-Packard Ltd. 8 | ** Licensed under the Apache License, Version 2.0 (the "License"); 9 | ** you may not use this file except in compliance with the License. 10 | ** You may obtain a copy of the License at 11 | ** http://www.apache.org/licenses/LICENSE-2.0 12 | ** Unless required by applicable law or agreed to in writing, software 13 | ** distributed under the License is distributed on an "AS IS" BASIS, 14 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | ** See the License for the specific language governing permissions and 16 | ** limitations under the License. 17 | * 18 | **********************************************************************/ 19 | 20 | #ifndef BLCKERR_H 21 | #define BLCKERR_H 22 | 23 | #include "errcode.h" 24 | 25 | const ERRCODE BADBLOCKLINE = "Y coordinate in block out of bounds"; 26 | const ERRCODE LOSTBLOCKLINE = "Can't find rectangle for line"; 27 | const ERRCODE ILLEGAL_GRADIENT = "Gradient wrong side of edge step!"; 28 | const ERRCODE WRONG_WORD = "Word doesn't have blobs of that type"; 29 | #endif 30 | -------------------------------------------------------------------------------- /deps/tesseract/ccstruct/blread.h: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * File: blread.h (Formerly pdread.h) 3 | * Description: Friend function of BLOCK to read the uscan pd file. 4 | * Author: Ray Smith 5 | * Created: Mon Mar 18 14:39:00 GMT 1991 6 | * 7 | * (C) Copyright 1991, Hewlett-Packard Ltd. 8 | ** Licensed under the Apache License, Version 2.0 (the "License"); 9 | ** you may not use this file except in compliance with the License. 10 | ** You may obtain a copy of the License at 11 | ** http://www.apache.org/licenses/LICENSE-2.0 12 | ** Unless required by applicable law or agreed to in writing, software 13 | ** distributed under the License is distributed on an "AS IS" BASIS, 14 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | ** See the License for the specific language governing permissions and 16 | ** limitations under the License. 17 | * 18 | **********************************************************************/ 19 | 20 | #ifndef BLREAD_H 21 | #define BLREAD_H 22 | 23 | #include "params.h" 24 | #include "ocrblock.h" 25 | 26 | bool read_unlv_file( //print list of sides 27 | STRING name, //basename of file 28 | inT32 xsize, //image size 29 | inT32 ysize, //image size 30 | BLOCK_LIST *blocks //output list 31 | ); 32 | void FullPageBlock(int width, int height, BLOCK_LIST *blocks); 33 | #endif 34 | -------------------------------------------------------------------------------- /deps/tesseract/ccstruct/ccstruct.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////// 2 | // File: ccstruct.cpp 3 | // Description: ccstruct class. 4 | // Author: Samuel Charron 5 | // 6 | // (C) Copyright 2006, Google Inc. 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | /////////////////////////////////////////////////////////////////////// 18 | 19 | #include "ccstruct.h" 20 | 21 | namespace tesseract { 22 | 23 | // APPROXIMATIONS of the fractions of the character cell taken by 24 | // the descenders, ascenders, and x-height. 25 | const double CCStruct::kDescenderFraction = 0.25; 26 | const double CCStruct::kXHeightFraction = 0.5; 27 | const double CCStruct::kAscenderFraction = 0.25; 28 | const double CCStruct::kXHeightCapRatio = CCStruct::kXHeightFraction / 29 | (CCStruct::kXHeightFraction + CCStruct::kAscenderFraction); 30 | 31 | CCStruct::CCStruct() {} 32 | 33 | CCStruct::~CCStruct() { 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /deps/tesseract/ccstruct/ccstruct.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////// 2 | // File: ccstruct.h 3 | // Description: ccstruct class. 4 | // Author: Samuel Charron 5 | // 6 | // (C) Copyright 2006, Google Inc. 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | /////////////////////////////////////////////////////////////////////// 18 | 19 | #ifndef TESSERACT_CCSTRUCT_CCSTRUCT_H__ 20 | #define TESSERACT_CCSTRUCT_CCSTRUCT_H__ 21 | 22 | #include "cutil.h" 23 | 24 | namespace tesseract { 25 | class CCStruct : public CUtil { 26 | public: 27 | CCStruct(); 28 | ~CCStruct(); 29 | 30 | // Globally accessible constants. 31 | // APPROXIMATIONS of the fractions of the character cell taken by 32 | // the descenders, ascenders, and x-height. 33 | static const double kDescenderFraction; // = 0.25; 34 | static const double kXHeightFraction; // = 0.5; 35 | static const double kAscenderFraction; // = 0.25; 36 | // Derived value giving the x-height as a fraction of cap-height. 37 | static const double kXHeightCapRatio; // = XHeight/(XHeight + Ascender). 38 | }; 39 | 40 | class Tesseract; 41 | } // namespace tesseract 42 | 43 | 44 | #endif // TESSERACT_CCSTRUCT_CCSTRUCT_H__ 45 | -------------------------------------------------------------------------------- /deps/tesseract/ccstruct/crakedge.h: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * File: crakedge.h (Formerly: crkedge.h) 3 | * Description: Sturctures for the Crack following edge detector. 4 | * Author: Ray Smith 5 | * Created: Fri Mar 22 16:06:38 GMT 1991 6 | * 7 | * (C) Copyright 1991, Hewlett-Packard Ltd. 8 | ** Licensed under the Apache License, Version 2.0 (the "License"); 9 | ** you may not use this file except in compliance with the License. 10 | ** You may obtain a copy of the License at 11 | ** http://www.apache.org/licenses/LICENSE-2.0 12 | ** Unless required by applicable law or agreed to in writing, software 13 | ** distributed under the License is distributed on an "AS IS" BASIS, 14 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | ** See the License for the specific language governing permissions and 16 | ** limitations under the License. 17 | * 18 | **********************************************************************/ 19 | 20 | #ifndef CRAKEDGE_H 21 | #define CRAKEDGE_H 22 | 23 | #include "points.h" 24 | #include "mod128.h" 25 | 26 | class CRACKEDGE { 27 | public: 28 | CRACKEDGE() {} 29 | 30 | ICOORD pos; /*position of crack */ 31 | inT8 stepx; //edge step 32 | inT8 stepy; 33 | inT8 stepdir; //chaincode 34 | CRACKEDGE *prev; /*previous point */ 35 | CRACKEDGE *next; /*next point */ 36 | }; 37 | #endif 38 | -------------------------------------------------------------------------------- /deps/tesseract/ccstruct/genblob.cpp: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * File: genblob.cpp (Formerly gblob.c) 3 | * Description: Generic Blob processing routines 4 | * Author: Phil Cheatle 5 | * Created: Mon Nov 25 10:53:26 GMT 1991 6 | * 7 | * (C) Copyright 1991, Hewlett-Packard Ltd. 8 | ** Licensed under the Apache License, Version 2.0 (the "License"); 9 | ** you may not use this file except in compliance with the License. 10 | ** You may obtain a copy of the License at 11 | ** http://www.apache.org/licenses/LICENSE-2.0 12 | ** Unless required by applicable law or agreed to in writing, software 13 | ** distributed under the License is distributed on an "AS IS" BASIS, 14 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | ** See the License for the specific language governing permissions and 16 | ** limitations under the License. 17 | * 18 | **********************************************************************/ 19 | 20 | #include "genblob.h" 21 | #include "stepblob.h" 22 | 23 | /********************************************************************** 24 | * c_blob_comparator() 25 | * 26 | * Blob comparator used to sort a blob list so that blobs are in increasing 27 | * order of left edge. 28 | **********************************************************************/ 29 | 30 | int c_blob_comparator( // sort blobs 31 | const void *blob1p, // ptr to ptr to blob1 32 | const void *blob2p // ptr to ptr to blob2 33 | ) { 34 | C_BLOB *blob1 = *(C_BLOB **) blob1p; 35 | C_BLOB *blob2 = *(C_BLOB **) blob2p; 36 | 37 | return blob1->bounding_box ().left () - blob2->bounding_box ().left (); 38 | } 39 | -------------------------------------------------------------------------------- /deps/tesseract/ccstruct/genblob.h: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * File: genblob.h (Formerly gblob.h) 3 | * Description: Generic Blob processing routines 4 | * Author: Phil Cheatle 5 | * Created: Mon Nov 25 10:53:26 GMT 1991 6 | * 7 | * (C) Copyright 1991, Hewlett-Packard Ltd. 8 | ** Licensed under the Apache License, Version 2.0 (the "License"); 9 | ** you may not use this file except in compliance with the License. 10 | ** You may obtain a copy of the License at 11 | ** http://www.apache.org/licenses/LICENSE-2.0 12 | ** Unless required by applicable law or agreed to in writing, software 13 | ** distributed under the License is distributed on an "AS IS" BASIS, 14 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | ** See the License for the specific language governing permissions and 16 | ** limitations under the License. 17 | * 18 | **********************************************************************/ 19 | 20 | #ifndef GENBLOB_H 21 | #define GENBLOB_H 22 | 23 | // Sort function to sort blobs by ascending left edge. 24 | int c_blob_comparator(const void *blob1p, // ptr to ptr to blob1 25 | const void *blob2p); 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /deps/tesseract/ccstruct/hpdsizes.h: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 (the "License"); 2 | // you may not use this file except in compliance with the License. 3 | // You may obtain a copy of the License at 4 | // http://www.apache.org/licenses/LICENSE-2.0 5 | // Unless required by applicable law or agreed to in writing, software 6 | // distributed under the License is distributed on an "AS IS" BASIS, 7 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 8 | // See the License for the specific language governing permissions and 9 | // limitations under the License. 10 | #ifndef HPDSIZES_H 11 | #define HPDSIZES_H 12 | 13 | #define NUM_TEXT_ATTR 10 14 | #define NUM_BLOCK_ATTR 7 15 | #define MAXLENGTH 128 16 | #define NUM_BACKGROUNDS 8 17 | #endif 18 | -------------------------------------------------------------------------------- /deps/tesseract/ccstruct/params_training_featdef.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////// 2 | // File: params_training_featdef.cpp 3 | // Description: Utility functions for params training features. 4 | // Author: David Eger 5 | // Created: Mon Jun 11 11:26:42 PDT 2012 6 | // 7 | // (C) Copyright 2012, Google Inc. 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | // 18 | /////////////////////////////////////////////////////////////////////// 19 | 20 | #include 21 | 22 | #include "params_training_featdef.h" 23 | 24 | namespace tesseract { 25 | 26 | int ParamsTrainingFeatureByName(const char *name) { 27 | if (name == NULL) 28 | return -1; 29 | int array_size = sizeof(kParamsTrainingFeatureTypeName) / 30 | sizeof(kParamsTrainingFeatureTypeName[0]); 31 | for (int i = 0; i < array_size; i++) { 32 | if (kParamsTrainingFeatureTypeName[i] == NULL) 33 | continue; 34 | if (strcmp(name, kParamsTrainingFeatureTypeName[i]) == 0) 35 | return i; 36 | } 37 | return -1; 38 | } 39 | 40 | } // namespace tesseract 41 | -------------------------------------------------------------------------------- /deps/tesseract/ccstruct/publictypes.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////// 2 | // File: publictypes.cpp 3 | // Description: Types used in both the API and internally 4 | // Author: Ray Smith 5 | // Created: Wed Mar 03 11:17:09 PST 2010 6 | // 7 | // (C) Copyright 2010, Google Inc. 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | // 18 | /////////////////////////////////////////////////////////////////////// 19 | 20 | #include "publictypes.h" 21 | 22 | /** String name for each block type. Keep in sync with PolyBlockType. */ 23 | const char* kPolyBlockNames[] = { 24 | "Unknown", 25 | "Flowing Text", 26 | "Heading Text", 27 | "Pullout Text", 28 | "Equation", 29 | "Inline Equation", 30 | "Table", 31 | "Vertical Text", 32 | "Caption Text", 33 | "Flowing Image", 34 | "Heading Image", 35 | "Pullout Image", 36 | "Horizontal Line", 37 | "Vertical Line", 38 | "Noise", 39 | "" // End marker for testing that sizes match. 40 | }; 41 | -------------------------------------------------------------------------------- /deps/tesseract/ccutil/basedir.h: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * File: basedir.h (Formerly getpath.h) 3 | * Description: Header file for getpath.c. Provides relocatability of data. 4 | * Author: Ray Smith 5 | * Created: Mon Jul 09 09:13:03 BST 1990 6 | * 7 | * (C) Copyright 1990, Hewlett-Packard Ltd. 8 | ** Licensed under the Apache License, Version 2.0 (the "License"); 9 | ** you may not use this file except in compliance with the License. 10 | ** You may obtain a copy of the License at 11 | ** http://www.apache.org/licenses/LICENSE-2.0 12 | ** Unless required by applicable law or agreed to in writing, software 13 | ** distributed under the License is distributed on an "AS IS" BASIS, 14 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | ** See the License for the specific language governing permissions and 16 | ** limitations under the License. 17 | * 18 | **********************************************************************/ 19 | 20 | #ifndef BASEDIR_H 21 | #define BASEDIR_H 22 | 23 | #include "platform.h" 24 | #include "strngs.h" 25 | 26 | // Returns the given code_path truncated to the last slash. 27 | // Useful for getting to the directory of argv[0], but does not search 28 | // any paths. 29 | TESS_API void truncate_path(const char *code_path, STRING* trunc_path); 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /deps/tesseract/ccutil/bits16.cpp: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * File: bits16.h (Formerly bits8.h) 3 | * Description: Code for 8 bit field class. 4 | * Author: Phil Cheatle 5 | * Created: Thu Oct 17 10:10:05 BST 1991 6 | * 7 | * (C) Copyright 1991, Hewlett-Packard Ltd. 8 | ** Licensed under the Apache License, Version 2.0 (the "License"); 9 | ** you may not use this file except in compliance with the License. 10 | ** You may obtain a copy of the License at 11 | ** http://www.apache.org/licenses/LICENSE-2.0 12 | ** Unless required by applicable law or agreed to in writing, software 13 | ** distributed under the License is distributed on an "AS IS" BASIS, 14 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | ** See the License for the specific language governing permissions and 16 | ** limitations under the License. 17 | * 18 | **********************************************************************/ 19 | 20 | #include "bits16.h" 21 | 22 | /********************************************************************** 23 | * Constructor. Something to get it past the compiler as almost all inlined. 24 | * 25 | **********************************************************************/ 26 | BITS16::BITS16( // constructor 27 | uinT16 init) { // initial val 28 | val = init; 29 | } 30 | -------------------------------------------------------------------------------- /deps/tesseract/ccutil/fileerr.h: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * File: fileerr.h (Formerly filerr.h) 3 | * Description: Errors for file utilities. 4 | * Author: Ray Smith 5 | * Created: Tue Aug 14 15:45:16 BST 1990 6 | * 7 | * (C) Copyright 1990, Hewlett-Packard Ltd. 8 | ** Licensed under the Apache License, Version 2.0 (the "License"); 9 | ** you may not use this file except in compliance with the License. 10 | ** You may obtain a copy of the License at 11 | ** http://www.apache.org/licenses/LICENSE-2.0 12 | ** Unless required by applicable law or agreed to in writing, software 13 | ** distributed under the License is distributed on an "AS IS" BASIS, 14 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | ** See the License for the specific language governing permissions and 16 | ** limitations under the License. 17 | * 18 | **********************************************************************/ 19 | 20 | #ifndef FILEERR_H 21 | #define FILEERR_H 22 | 23 | #include "errcode.h" 24 | 25 | const ERRCODE CANTOPENFILE = "Can't open file"; 26 | const ERRCODE CANTCREATEFILE = "Can't create file"; 27 | const ERRCODE CANTMAKEPIPE = "Can't create pipe"; 28 | const ERRCODE CANTCONNECTPIPE = "Can't reconnect pipes to stdin/stdout"; 29 | const ERRCODE READFAILED = "Read of file failed"; 30 | const ERRCODE WRITEFAILED = "Write of file failed"; 31 | const ERRCODE SELECTFAILED = "Select failed"; 32 | 33 | const ERRCODE EXECFAILED = "Could not exec new process"; 34 | #endif 35 | -------------------------------------------------------------------------------- /deps/tesseract/ccutil/globaloc.h: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * File: errcode.h (Formerly error.h) 3 | * Description: Header file for generic error handler class 4 | * Author: Ray Smith 5 | * Created: Tue May 1 16:23:36 BST 1990 6 | * 7 | * (C) Copyright 1990, Hewlett-Packard Ltd. 8 | ** Licensed under the Apache License, Version 2.0 (the "License"); 9 | ** you may not use this file except in compliance with the License. 10 | ** You may obtain a copy of the License at 11 | ** http://www.apache.org/licenses/LICENSE-2.0 12 | ** Unless required by applicable law or agreed to in writing, software 13 | ** distributed under the License is distributed on an "AS IS" BASIS, 14 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | ** See the License for the specific language governing permissions and 16 | ** limitations under the License. 17 | * 18 | **********************************************************************/ 19 | 20 | #ifndef GLOBALOC_H 21 | #define GLOBALOC_H 22 | 23 | #include "host.h" 24 | 25 | // Saves a clone of the given pix, and notes its resolution in thread-specific 26 | // data, so that the image can be written prior to a crash. 27 | struct Pix; 28 | void SavePixForCrash(int resolution, Pix* pix); 29 | 30 | void signal_exit(int signal_code); 31 | 32 | void TESS_API err_exit(); 33 | 34 | void set_global_loc_code(int loc_code); 35 | 36 | void set_global_subloc_code(int loc_code); 37 | 38 | void set_global_subsubloc_code(int loc_code); 39 | #endif 40 | -------------------------------------------------------------------------------- /deps/tesseract/ccutil/ndminx.h: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * File: ndminx.h (Formerly ndminmax.h) 3 | * Description: Extended ascii chars 4 | * Author: Phil Cheatle 5 | * Created: Mon Mar 29 14:46:01 BST 1993 6 | * 7 | * (C) Copyright 1991, Hewlett-Packard Ltd. 8 | ** Licensed under the Apache License, Version 2.0 (the "License"); 9 | ** you may not use this file except in compliance with the License. 10 | ** You may obtain a copy of the License at 11 | ** http://www.apache.org/licenses/LICENSE-2.0 12 | ** Unless required by applicable law or agreed to in writing, software 13 | ** distributed under the License is distributed on an "AS IS" BASIS, 14 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | ** See the License for the specific language governing permissions and 16 | ** limitations under the License. 17 | * 18 | **********************************************************************/ 19 | 20 | #ifndef NDMINX_H 21 | #define NDMINX_H 22 | 23 | #ifndef MAX 24 | #define MAX(x,y) (((x) >= (y))?(x):(y)) 25 | #endif 26 | 27 | #ifndef MIN 28 | #define MIN(x,y) (((x) <= (y))?(x):(y)) 29 | #endif 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /deps/tesseract/ccutil/stderr.h: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * File: stderr.h (Formerly stderrs.h) 3 | * Description: File defining error messages fundamental of commonly used. 4 | * Author: Ray Smith 5 | * Created: Fri Aug 10 15:23:14 BST 1990 6 | * 7 | * (C) Copyright 1990, Hewlett-Packard Ltd. 8 | ** Licensed under the Apache License, Version 2.0 (the "License"); 9 | ** you may not use this file except in compliance with the License. 10 | ** You may obtain a copy of the License at 11 | ** http://www.apache.org/licenses/LICENSE-2.0 12 | ** Unless required by applicable law or agreed to in writing, software 13 | ** distributed under the License is distributed on an "AS IS" BASIS, 14 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | ** See the License for the specific language governing permissions and 16 | ** limitations under the License. 17 | * 18 | **********************************************************************/ 19 | 20 | #ifndef STDERR_H 21 | #define STDERR_H 22 | 23 | #include "errcode.h" 24 | 25 | const ERRCODE MEMORY_OUT = "Out of memory"; 26 | #endif 27 | -------------------------------------------------------------------------------- /deps/tesseract/ccutil/tprintf.h: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * File: tprintf.h 3 | * Description: Trace version of printf - portable between UX and NT 4 | * Author: Phil Cheatle 5 | * Created: Wed Jun 28 15:01:15 BST 1995 6 | * 7 | * (C) Copyright 1995, Hewlett-Packard Ltd. 8 | ** Licensed under the Apache License, Version 2.0 (the "License"); 9 | ** you may not use this file except in compliance with the License. 10 | ** You may obtain a copy of the License at 11 | ** http://www.apache.org/licenses/LICENSE-2.0 12 | ** Unless required by applicable law or agreed to in writing, software 13 | ** distributed under the License is distributed on an "AS IS" BASIS, 14 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | ** See the License for the specific language governing permissions and 16 | ** limitations under the License. 17 | * 18 | **********************************************************************/ 19 | 20 | #ifndef TESSERACT_CCUTIL_TPRINTF_H 21 | #define TESSERACT_CCUTIL_TPRINTF_H 22 | 23 | #include "params.h" 24 | 25 | extern DLLSYM STRING_VAR_H(debug_file, "", 26 | "File to send tprintf output to"); 27 | extern DLLSYM BOOL_VAR_H(debug_window_on, TRUE, 28 | "Send tprintf to window unless file set"); 29 | 30 | // Main logging function. 31 | #define tprintf(...) tprintf_internal(__VA_ARGS__) 32 | 33 | extern TESS_API void tprintf_internal( // Trace printf 34 | const char *format, ...); // Message 35 | 36 | #endif // define TESSERACT_CCUTIL_TPRINTF_H 37 | -------------------------------------------------------------------------------- /deps/tesseract/ccutil/unicodes.h: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * File: unicodes.h 3 | * Description: Unicode related machinery 4 | * Author: David Eger 5 | * Created: Wed Jun 15 16:37:50 PST 2011 6 | * 7 | * (C) Copyright 2011, Google, Inc. 8 | ** Licensed under the Apache License, Version 2.0 (the "License"); 9 | ** you may not use this file except in compliance with the License. 10 | ** You may obtain a copy of the License at 11 | ** http://www.apache.org/licenses/LICENSE-2.0 12 | ** Unless required by applicable law or agreed to in writing, software 13 | ** distributed under the License is distributed on an "AS IS" BASIS, 14 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | ** See the License for the specific language governing permissions and 16 | ** limitations under the License. 17 | * 18 | **********************************************************************/ 19 | 20 | #ifndef TESSERACT_CCUTIL_UNICODES_H__ 21 | #define TESSERACT_CCUTIL_UNICODES_H__ 22 | 23 | namespace tesseract { 24 | 25 | extern const char *kUTF8LineSeparator; 26 | extern const char *kUTF8ParagraphSeparator; 27 | extern const char *kLRM; //< Left-to-Right Mark 28 | extern const char *kRLM; //< Right-to-Left Mark 29 | extern const char *kRLE; //< Right-to-Left Embedding 30 | extern const char *kPDF; //< Pop Directional Formatting 31 | 32 | /// The following are confusable internal word punctuation symbols 33 | /// which we normalize to the first variant when matching in dawgs. 34 | extern const char *kHyphenLikeUTF8[]; 35 | extern const char *kApostropheLikeUTF8[]; 36 | 37 | } // namespace 38 | 39 | #endif // TESSERACT_CCUTIL_UNICODES_H__ 40 | -------------------------------------------------------------------------------- /deps/tesseract/ccutil/universalambigs.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////// 2 | // File: universalambigs.h 3 | // Description: Data for a universal ambigs file that is useful for 4 | // any language. 5 | // Author: Ray Smith 6 | // Created: Mon Mar 18 11:26:00 PDT 2013 7 | // 8 | // (C) Copyright 2013, Google Inc. 9 | // Licensed under the Apache License, Version 2.0 (the "License"); 10 | // you may not use this file except in compliance with the License. 11 | // You may obtain a copy of the License at 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | /////////////////////////////////////////////////////////////////////// 20 | 21 | namespace tesseract { 22 | 23 | extern const char kUniversalAmbigsFile[]; 24 | extern const int ksizeofUniversalAmbigsFile; 25 | 26 | } // namespace tesseract 27 | -------------------------------------------------------------------------------- /deps/tesseract/classify/float2int.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | ** Filename: float2int.h 3 | ** Purpose: Routines for converting float features to int features 4 | ** Author: Dan Johnson 5 | ** History: Wed Mar 13 08:06:41 1991, DSJ, Created. 6 | ** 7 | ** (c) Copyright Hewlett-Packard Company, 1988. 8 | ** Licensed under the Apache License, Version 2.0 (the "License"); 9 | ** you may not use this file except in compliance with the License. 10 | ** You may obtain a copy of the License at 11 | ** http://www.apache.org/licenses/LICENSE-2.0 12 | ** Unless required by applicable law or agreed to in writing, software 13 | ** distributed under the License is distributed on an "AS IS" BASIS, 14 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | ** See the License for the specific language governing permissions and 16 | ** limitations under the License. 17 | ******************************************************************************/ 18 | #ifndef FLOAT2INT_H 19 | #define FLOAT2INT_H 20 | 21 | /*----------------------------------------------------------------------------- 22 | Include Files and Type Defines 23 | -----------------------------------------------------------------------------*/ 24 | #include "intmatcher.h" 25 | #include "ocrfeatures.h" 26 | 27 | #define INT_FEAT_RANGE 256 28 | #define BASELINE_Y_SHIFT (0.25) 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /deps/tesseract/cube/char_samp_enum.cpp: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * File: char_samp_enum.cpp 3 | * Description: Implementation of a Character Sample Enumerator Class 4 | * Author: Ahmad Abdulkader 5 | * Created: 2007 6 | * 7 | * (C) Copyright 2008, Google Inc. 8 | ** Licensed under the Apache License, Version 2.0 (the "License"); 9 | ** you may not use this file except in compliance with the License. 10 | ** You may obtain a copy of the License at 11 | ** http://www.apache.org/licenses/LICENSE-2.0 12 | ** Unless required by applicable law or agreed to in writing, software 13 | ** distributed under the License is distributed on an "AS IS" BASIS, 14 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | ** See the License for the specific language governing permissions and 16 | ** limitations under the License. 17 | * 18 | **********************************************************************/ 19 | 20 | #include "char_samp_enum.h" 21 | 22 | namespace tesseract { 23 | 24 | CharSampEnum::CharSampEnum() { 25 | } 26 | 27 | CharSampEnum::~CharSampEnum() { 28 | } 29 | 30 | } // namespace ocrlib 31 | -------------------------------------------------------------------------------- /deps/tesseract/cube/char_samp_enum.h: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * File: char_samp_enum.h 3 | * Description: Declaration of a Character Sample Enumerator Class 4 | * Author: Ahmad Abdulkader 5 | * Created: 2007 6 | * 7 | * (C) Copyright 2008, Google Inc. 8 | ** Licensed under the Apache License, Version 2.0 (the "License"); 9 | ** you may not use this file except in compliance with the License. 10 | ** You may obtain a copy of the License at 11 | ** http://www.apache.org/licenses/LICENSE-2.0 12 | ** Unless required by applicable law or agreed to in writing, software 13 | ** distributed under the License is distributed on an "AS IS" BASIS, 14 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | ** See the License for the specific language governing permissions and 16 | ** limitations under the License. 17 | * 18 | **********************************************************************/ 19 | 20 | // The CharSampEnum class provides the base class for CharSamp class 21 | // Enumerators. This is typically used to implement dump file readers 22 | 23 | #ifndef CHARSAMP_ENUM_H 24 | #define CHARSAMP_ENUM_H 25 | 26 | #include "char_samp.h" 27 | 28 | namespace tesseract { 29 | 30 | class CharSampEnum { 31 | public: 32 | CharSampEnum(); 33 | virtual ~CharSampEnum(); 34 | virtual bool EnumCharSamp(CharSamp *char_samp, float progress) = 0; 35 | }; 36 | } 37 | 38 | #endif // CHARSAMP_ENUM_H 39 | -------------------------------------------------------------------------------- /deps/tesseract/cube/cube_const.h: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * File: const.h 3 | * Description: Defintions of constants used by Cube 4 | * Author: Ahmad Abdulkader 5 | * Created: 2007 6 | * 7 | * (C) Copyright 2008, Google Inc. 8 | ** Licensed under the Apache License, Version 2.0 (the "License"); 9 | ** you may not use this file except in compliance with the License. 10 | ** You may obtain a copy of the License at 11 | ** http://www.apache.org/licenses/LICENSE-2.0 12 | ** Unless required by applicable law or agreed to in writing, software 13 | ** distributed under the License is distributed on an "AS IS" BASIS, 14 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | ** See the License for the specific language governing permissions and 16 | ** limitations under the License. 17 | * 18 | **********************************************************************/ 19 | 20 | #ifndef CUBE_CONST_H 21 | #define CUBE_CONST_H 22 | 23 | // Scale used to normalize a log-prob to a cost 24 | #define PROB2COST_SCALE 4096.0 25 | // Maximum possible cost (-log prob of MIN_PROB) 26 | #define MIN_PROB_COST 65536 27 | // Probability corresponding to the max cost MIN_PROB_COST 28 | #define MIN_PROB 0.000000113 29 | // Worst possible cost (returned on failure) 30 | #define WORST_COST 0x40000 31 | // Oversegmentation hysteresis thresholds 32 | #define HIST_WND_RATIO 0.1f 33 | #define SEG_PT_WND_RATIO 0.1f 34 | 35 | #ifdef _WIN32 36 | #ifdef __GNUC__ 37 | #include 38 | #endif 39 | #endif 40 | 41 | #endif // CUBE_CONST_H 42 | -------------------------------------------------------------------------------- /deps/tesseract/cube/string_32.h: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * File: string_32.h 3 | * Description: Declaration of a 32 Bit string class 4 | * Author: Ahmad Abdulkader 5 | * Created: 2007 6 | * 7 | * (C) Copyright 2008, Google Inc. 8 | ** Licensed under the Apache License, Version 2.0 (the "License"); 9 | ** you may not use this file except in compliance with the License. 10 | ** You may obtain a copy of the License at 11 | ** http://www.apache.org/licenses/LICENSE-2.0 12 | ** Unless required by applicable law or agreed to in writing, software 13 | ** distributed under the License is distributed on an "AS IS" BASIS, 14 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | ** See the License for the specific language governing permissions and 16 | ** limitations under the License. 17 | * 18 | **********************************************************************/ 19 | 20 | // the string_32 class provides the functionality needed 21 | // for a 32-bit string class 22 | 23 | #ifndef STRING_32_H 24 | #define STRING_32_H 25 | 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | #ifdef USE_STD_NAMESPACE 32 | using std::basic_string; 33 | using std::string; 34 | using std::vector; 35 | #endif 36 | 37 | namespace tesseract { 38 | 39 | // basic definitions 40 | typedef signed int char_32; 41 | typedef basic_string string_32; 42 | } 43 | 44 | #endif // STRING_32_H 45 | -------------------------------------------------------------------------------- /deps/tesseract/cutil/const.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | ** Licensed under the Apache License, Version 2.0 (the "License"); 3 | ** you may not use this file except in compliance with the License. 4 | ** You may obtain a copy of the License at 5 | ** http://www.apache.org/licenses/LICENSE-2.0 6 | ** Unless required by applicable law or agreed to in writing, software 7 | ** distributed under the License is distributed on an "AS IS" BASIS, 8 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 9 | ** See the License for the specific language governing permissions and 10 | ** limitations under the License. 11 | **************************************************************************/ 12 | 13 | #ifndef CONST_H 14 | #define CONST_H 15 | 16 | /*This file contains constants which are global to the entire system*/ 17 | #define SPLINESIZE 23 // max spline parts to a line 18 | 19 | #define PI 3.14159265359 // pi 20 | 21 | #define EDGEPTFLAGS 4 // concavity,length etc. 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /deps/tesseract/cutil/cutil_class.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////// 2 | // File: cutil.cpp 3 | // Description: cutil class. 4 | // Author: Samuel Charron 5 | // 6 | // (C) Copyright 2006, Google Inc. 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | /////////////////////////////////////////////////////////////////////// 18 | 19 | #include "cutil_class.h" 20 | 21 | namespace tesseract { 22 | 23 | CUtil::CUtil() { 24 | } 25 | 26 | CUtil::~CUtil() { 27 | } 28 | 29 | } // namespace tesseract 30 | -------------------------------------------------------------------------------- /deps/tesseract/cutil/cutil_class.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////// 2 | // File: cutil.h 3 | // Description: cutil class. 4 | // Author: Samuel Charron 5 | // 6 | // (C) Copyright 2006, Google Inc. 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | /////////////////////////////////////////////////////////////////////// 18 | 19 | #ifndef TESSERACT_CUTIL_CUTIL_CLASS_H__ 20 | #define TESSERACT_CUTIL_CUTIL_CLASS_H__ 21 | 22 | #include "ccutil.h" 23 | #include "const.h" 24 | #include "strngs.h" 25 | 26 | namespace tesseract { 27 | 28 | class CUtil : public CCUtil { 29 | public: 30 | CUtil(); 31 | ~CUtil(); 32 | void read_variables(const char *filename, bool global_only); 33 | }; 34 | 35 | } // namespace tesseract 36 | 37 | #endif // TESSERACT_CUTIL_CUTIL_CLASS_H__ 38 | -------------------------------------------------------------------------------- /deps/tesseract/cutil/danerror.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | ** Filename: danerror.h 3 | ** Purpose: Definition of error trapping routines. 4 | ** Author: Dan Johnson 5 | ** History: 4/3/89, DSJ, Created. 6 | ** 7 | ** (c) Copyright Hewlett-Packard Company, 1988. 8 | ** Licensed under the Apache License, Version 2.0 (the "License"); 9 | ** you may not use this file except in compliance with the License. 10 | ** You may obtain a copy of the License at 11 | ** http://www.apache.org/licenses/LICENSE-2.0 12 | ** Unless required by applicable law or agreed to in writing, software 13 | ** distributed under the License is distributed on an "AS IS" BASIS, 14 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | ** See the License for the specific language governing permissions and 16 | ** limitations under the License. 17 | ******************************************************************************/ 18 | #ifndef DANERROR_H 19 | #define DANERROR_H 20 | 21 | /**---------------------------------------------------------------------------- 22 | Include Files and Type Defines 23 | ----------------------------------------------------------------------------**/ 24 | #define NOERROR 0 25 | #define DO_NOTHING 0 26 | 27 | typedef int TRAPERROR; 28 | typedef void (*VOID_PROC) (); 29 | 30 | /**---------------------------------------------------------------------------- 31 | Public Function Prototypes 32 | ----------------------------------------------------------------------------**/ 33 | void DoError(int Error, const char *Message); 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /deps/tesseract/cutil/efio.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | ** Filename: efio.h 3 | ** Purpose: Definition of file I/O routines 4 | ** Author: Dan Johnson 5 | ** History: 5/21/89, DSJ, Created. 6 | ** 7 | ** (c) Copyright Hewlett-Packard Company, 1988. 8 | ** Licensed under the Apache License, Version 2.0 (the "License"); 9 | ** you may not use this file except in compliance with the License. 10 | ** You may obtain a copy of the License at 11 | ** http://www.apache.org/licenses/LICENSE-2.0 12 | ** Unless required by applicable law or agreed to in writing, software 13 | ** distributed under the License is distributed on an "AS IS" BASIS, 14 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | ** See the License for the specific language governing permissions and 16 | ** limitations under the License. 17 | ******************************************************************************/ 18 | #ifndef EFIO_H 19 | #define EFIO_H 20 | 21 | /**---------------------------------------------------------------------------- 22 | Include Files and Type Defines 23 | ----------------------------------------------------------------------------**/ 24 | #include 25 | 26 | #define FOPENERROR 3000 27 | 28 | /**---------------------------------------------------------------------------- 29 | Public Function Prototype 30 | ----------------------------------------------------------------------------**/ 31 | FILE *Efopen(const char *Name, const char *Mode); 32 | #endif 33 | -------------------------------------------------------------------------------- /deps/tesseract/cutil/freelist.cpp: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | ** Licensed under the Apache License, Version 2.0 (the "License"); 3 | ** you may not use this file except in compliance with the License. 4 | ** You may obtain a copy of the License at 5 | ** http://www.apache.org/licenses/LICENSE-2.0 6 | ** Unless required by applicable law or agreed to in writing, software 7 | ** distributed under the License is distributed on an "AS IS" BASIS, 8 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 9 | ** See the License for the specific language governing permissions and 10 | ** limitations under the License. 11 | **************************************************************************/ 12 | #include "freelist.h" 13 | 14 | #include 15 | 16 | 17 | // With improvements in OS memory allocators, internal memory management is 18 | // no longer required, so these functions all map to their malloc-family 19 | // equivalents. 20 | 21 | 22 | int *memalloc(int size) { 23 | return static_cast(malloc(static_cast(size))); 24 | } 25 | 26 | int *memrealloc(void *ptr, int size, int oldsize) { 27 | return static_cast(realloc(ptr, static_cast(size))); 28 | } 29 | 30 | void memfree(void *element) { 31 | free(element); 32 | } 33 | -------------------------------------------------------------------------------- /deps/tesseract/cutil/globals.h: -------------------------------------------------------------------------------- 1 | /* -*-C-*- 2 | ******************************************************************************** 3 | * 4 | * File: globals.h (Formerly globals.h) 5 | * Description: Global Variables for Wise Owl 6 | * Author: Mark Seaman, OCR Technology 7 | * Created: Thu Dec 21 11:38:36 1989 8 | * Modified: Thu Jan 4 17:13:00 1990 (Mark Seaman) marks@hpgrlt 9 | * Language: C 10 | * Package: N/A 11 | * Status: Experimental (Do Not Distribute) 12 | * 13 | * (c) Copyright 1989, Hewlett-Packard Company. 14 | ** Licensed under the Apache License, Version 2.0 (the "License"); 15 | ** you may not use this file except in compliance with the License. 16 | ** You may obtain a copy of the License at 17 | ** http://www.apache.org/licenses/LICENSE-2.0 18 | ** Unless required by applicable law or agreed to in writing, software 19 | ** distributed under the License is distributed on an "AS IS" BASIS, 20 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 21 | ** See the License for the specific language governing permissions and 22 | ** limitations under the License. 23 | * 24 | *********************************************************************************/ 25 | #ifndef GLOBALS_H 26 | #define GLOBALS_H 27 | 28 | #include "const.h" 29 | #include "unicharset.h" 30 | #include "strngs.h" 31 | 32 | #include 33 | 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /deps/tesseract/cutil/structures.cpp: -------------------------------------------------------------------------------- 1 | /* -*-C-*- 2 | ******************************************************************************** 3 | * 4 | * File: structures.c (Formerly structures.c) 5 | * Description: Allocate all the different types of structures. 6 | * Author: Mark Seaman, OCR Technology 7 | * Created: Wed May 30 10:27:26 1990 8 | * Modified: Mon Jul 15 10:39:18 1991 (Mark Seaman) marks@hpgrlt 9 | * Language: C 10 | * Package: N/A 11 | * Status: Experimental (Do Not Distribute) 12 | * 13 | * (c) Copyright 1990, Hewlett-Packard Company. 14 | ** Licensed under the Apache License, Version 2.0 (the "License"); 15 | ** you may not use this file except in compliance with the License. 16 | ** You may obtain a copy of the License at 17 | ** http://www.apache.org/licenses/LICENSE-2.0 18 | ** Unless required by applicable law or agreed to in writing, software 19 | ** distributed under the License is distributed on an "AS IS" BASIS, 20 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 21 | ** See the License for the specific language governing permissions and 22 | ** limitations under the License. 23 | * 24 | *********************************************************************************/ 25 | /*---------------------------------------------------------------------- 26 | I n c l u d e s 27 | ----------------------------------------------------------------------*/ 28 | #include "structures.h" 29 | 30 | #include 31 | 32 | 33 | /*---------------------------------------------------------------------- 34 | F u n c t i o n s 35 | ----------------------------------------------------------------------*/ 36 | makestructure(new_cell, free_cell, list_rec); 37 | -------------------------------------------------------------------------------- /deps/tesseract/neural_networks/runtime/input_file_buffer.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008 Google Inc. 2 | // All Rights Reserved. 3 | // Author: ahmadab@google.com (Ahmad Abdulkader) 4 | // 5 | // input_file_buffer.h: Declarations of a class for an object that 6 | // represents an input file buffer. 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | #include 18 | #include "input_file_buffer.h" 19 | 20 | namespace tesseract { 21 | // default and only constructor 22 | InputFileBuffer::InputFileBuffer(const string &file_name) 23 | : file_name_(file_name) { 24 | fp_ = NULL; 25 | } 26 | 27 | // virtual destructor 28 | InputFileBuffer::~InputFileBuffer() { 29 | if (fp_ != NULL) { 30 | fclose(fp_); 31 | } 32 | } 33 | 34 | // Read the specified number of bytes to the specified input buffer 35 | int InputFileBuffer::Read(void *buffer, int bytes_to_read) { 36 | // open the file if necessary 37 | if (fp_ == NULL) { 38 | fp_ = fopen(file_name_.c_str(), "rb"); 39 | if (fp_ == NULL) { 40 | return 0; 41 | } 42 | } 43 | return fread(buffer, 1, bytes_to_read, fp_); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /deps/tesseract/neural_networks/runtime/input_file_buffer.h: -------------------------------------------------------------------------------- 1 | // Copyright 2008 Google Inc. 2 | // All Rights Reserved. 3 | // Author: ahmadab@google.com (Ahmad Abdulkader) 4 | // 5 | // input_file_buffer.h: Declarations of a class for an object that 6 | // represents an input file buffer. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | 18 | #ifndef INPUT_FILE_BUFFER_H 19 | #define INPUT_FILE_BUFFER_H 20 | 21 | #include 22 | #include 23 | #ifdef USE_STD_NAMESPACE 24 | using std::string; 25 | #endif 26 | 27 | namespace tesseract { 28 | class InputFileBuffer { 29 | public: 30 | explicit InputFileBuffer(const string &file_name); 31 | virtual ~InputFileBuffer(); 32 | int Read(void *buffer, int bytes_to_read); 33 | 34 | protected: 35 | string file_name_; 36 | FILE *fp_; 37 | }; 38 | } 39 | 40 | #endif // INPUT_FILE_BUFFER_H__ 41 | -------------------------------------------------------------------------------- /deps/tesseract/opencl/opencl_device_selection.h: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 (the "License"); 2 | // you may not use this file except in compliance with the License. 3 | // You may obtain a copy of the License at 4 | // http://www.apache.org/licenses/LICENSE-2.0 5 | // Unless required by applicable law or agreed to in writing, software 6 | // distributed under the License is distributed on an "AS IS" BASIS, 7 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 8 | // See the License for the specific language governing permissions and 9 | // limitations under the License. 10 | 11 | #ifndef DEVICE_SELECTION_H 12 | #define DEVICE_SELECTION_H 13 | 14 | #ifdef USE_OPENCL 15 | 16 | #ifdef _MSC_VER 17 | #define _CRT_SECURE_NO_WARNINGS 18 | #endif 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | #ifdef __APPLE__ 25 | #include 26 | #else 27 | #include 28 | #endif 29 | 30 | // device type 31 | typedef enum { 32 | DS_DEVICE_NATIVE_CPU = 0, 33 | DS_DEVICE_OPENCL_DEVICE 34 | } ds_device_type; 35 | 36 | typedef struct { 37 | ds_device_type type; 38 | cl_device_id oclDeviceID; 39 | char* oclDeviceName; 40 | char* oclDriverVersion; 41 | // a pointer to the score data, the content/format is application defined. 42 | void* score; 43 | } ds_device; 44 | 45 | #endif // USE_OPENCL 46 | #endif // DEVICE_SELECTION_H 47 | -------------------------------------------------------------------------------- /deps/tesseract/port/gettimeofday.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////// 2 | // File: gettimeofday.cpp 3 | // Description: Implementation of gettimeofday based on leptonica 4 | // Author: tomp2010, zdenop 5 | // Created: Tue Feb 21 21:38:00 CET 2012 6 | // 7 | // (C) Copyright 2012, Google Inc. 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | // 18 | /////////////////////////////////////////////////////////////////////// 19 | 20 | #include 21 | #include "gettimeofday.h" 22 | 23 | int gettimeofday(struct timeval *tp, struct timezone *tzp) { 24 | l_int32 sec, usec; 25 | if (tp == NULL) 26 | return -1; 27 | 28 | l_getCurrentTime(&sec, &usec); 29 | tp->tv_sec = sec; 30 | tp->tv_usec = usec; 31 | return 0; 32 | } 33 | -------------------------------------------------------------------------------- /deps/tesseract/port/gettimeofday.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////// 2 | // File: gettimeofday.h 3 | // Description: Header file for gettimeofday.cpp 4 | // Author: tomp2010, zdenop 5 | // Created: Tue Feb 21 21:38:00 CET 2012 6 | // 7 | // (C) Copyright 2012, Google Inc. 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | // 18 | /////////////////////////////////////////////////////////////////////// 19 | 20 | #ifndef VS2008_PORT_GETTIMEOFDAY_H_ 21 | #define VS2008_PORT_GETTIMEOFDAY_H_ 22 | 23 | #ifdef _WIN32 24 | #include // timeval is defined in here. 25 | #endif 26 | 27 | typedef struct timezone tz; 28 | 29 | int gettimeofday(struct timeval * tp, struct timezone * tzp); 30 | 31 | #endif // VS2008_PORT_GETTIMEOFDAY_H_ 32 | -------------------------------------------------------------------------------- /deps/tesseract/port/mathfix.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////// 2 | // File: mathfix.h 3 | // Description: Implement missing math functions 4 | // Author: zdenop 5 | // Created: Fri Feb 03 06:45:06 CET 2012 6 | // 7 | // (C) Copyright 2012, Google Inc. 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | // 18 | /////////////////////////////////////////////////////////////////////// 19 | 20 | #ifndef VS2008_INCLUDE_MATHFIX_H_ 21 | #define VS2008_INCLUDE_MATHFIXT_H_ 22 | 23 | #ifndef _MSC_VER 24 | #error "Use this header only with Microsoft Visual C++ compilers!" 25 | #endif 26 | 27 | #include 28 | #include // for _isnan(), _finite() on VC++ 29 | 30 | #if _MSC_VER < 1800 31 | #define isnan(x) _isnan(x) 32 | #define isinf(x) (!_finite(x)) 33 | #define fmax max //VC++ does not implement all the provisions of C99 Standard 34 | #define round(x) roundf(x) 35 | inline float roundf(float num) { return num > 0 ? floorf(num + 0.5f) : ceilf(num - 0.5f); } 36 | #endif 37 | 38 | #endif // VS2008_INCLUDE_MATHFIXT_H_ 39 | -------------------------------------------------------------------------------- /deps/tesseract/port/strtok_r.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////// 2 | // File: strtok_r.h 3 | // Description: Header file for strtok_r.cpp 4 | // source: https://github.com/heimdal/heimdal/blob/master/lib/roken/ 5 | // strtok_r.c 6 | // Author: zdenop 7 | // Created: Fri Aug 12 23:55:06 CET 2011 8 | // 9 | // (C) Copyright 2011, Google Inc. 10 | // Licensed under the Apache License, Version 2.0 (the "License"); 11 | // you may not use this file except in compliance with the License. 12 | // You may obtain a copy of the License at 13 | // http://www.apache.org/licenses/LICENSE-2.0 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | // 20 | /////////////////////////////////////////////////////////////////////// 21 | 22 | #ifndef VS2010_PORT_STRTOK_R_H_ 23 | #define VS2010_PORT_STRTOK_R_H_ 24 | 25 | char *strtok_r(char *s1, const char *s2, char **lasts); 26 | 27 | #endif // VS2010_PORT_STRTOK_R_H_ 28 | -------------------------------------------------------------------------------- /deps/tesseract/port/vcsversion.h: -------------------------------------------------------------------------------- 1 | #define GIT_REV "3.05.00dev" 2 | 3 | -------------------------------------------------------------------------------- /deps/tesseract/textord/drawedg.h: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * File: drawedg.h (Formerly drawedge.h) 3 | * Description: Collection of functions to draw things to do with edge 4 | *detection. 5 | * Author: Ray Smith 6 | * Created: Thu Jun 06 13:29:20 BST 1991 7 | * 8 | * (C) Copyright 1991, Hewlett-Packard Ltd. 9 | ** Licensed under the Apache License, Version 2.0 (the "License"); 10 | ** you may not use this file except in compliance with the License. 11 | ** You may obtain a copy of the License at 12 | ** http://www.apache.org/licenses/LICENSE-2.0 13 | ** Unless required by applicable law or agreed to in writing, software 14 | ** distributed under the License is distributed on an "AS IS" BASIS, 15 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | ** See the License for the specific language governing permissions and 17 | ** limitations under the License. 18 | * 19 | **********************************************************************/ 20 | 21 | #ifndef DRAWEDG_H 22 | #define DRAWEDG_H 23 | #ifndef GRAPHICS_DISABLED 24 | 25 | #include "scrollview.h" 26 | #include "crakedge.h" 27 | 28 | ScrollView* create_edges_window( //make window 29 | ICOORD page_tr //size of image 30 | ); 31 | void draw_raw_edge( //draw the cracks 32 | ScrollView* fd, //window to draw in 33 | CRACKEDGE *start, //start of loop 34 | ScrollView::Color colour //colour to draw in 35 | ); 36 | #endif 37 | #endif 38 | -------------------------------------------------------------------------------- /deps/tesseract/textord/tordmain.h: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * File: tordmain.h (Formerly textordp.h) 3 | * Description: C++ top level textord code. 4 | * Author: Ray Smith 5 | * Created: Tue Jul 28 17:12:33 BST 1992 6 | * 7 | * (C) Copyright 1992, Hewlett-Packard Ltd. 8 | ** Licensed under the Apache License, Version 2.0 (the "License"); 9 | ** you may not use this file except in compliance with the License. 10 | ** You may obtain a copy of the License at 11 | ** http://www.apache.org/licenses/LICENSE-2.0 12 | ** Unless required by applicable law or agreed to in writing, software 13 | ** distributed under the License is distributed on an "AS IS" BASIS, 14 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | ** See the License for the specific language governing permissions and 16 | ** limitations under the License. 17 | * 18 | **********************************************************************/ 19 | 20 | #ifndef TORDMAIN_H 21 | #define TORDMAIN_H 22 | 23 | #include 24 | #include "params.h" 25 | #include "ocrblock.h" 26 | #include "blobs.h" 27 | #include "blobbox.h" 28 | 29 | struct Pix; 30 | namespace tesseract { 31 | class Tesseract; 32 | 33 | void SetBlobStrokeWidth(Pix* pix, BLOBNBOX* blob); 34 | void assign_blobs_to_blocks2(Pix* pix, BLOCK_LIST *blocks, 35 | TO_BLOCK_LIST *port_blocks); 36 | } // namespace tesseract 37 | 38 | void tweak_row_baseline(ROW *row, 39 | double blshift_maxshift, 40 | double blshift_xfraction); 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /deps/tesseract/wordrec/chopper.h: -------------------------------------------------------------------------------- 1 | /* -*-C-*- 2 | ******************************************************************************** 3 | * 4 | * File: chopper.h (Formerly chopper.h) 5 | * Description: 6 | * Author: Mark Seaman, SW Productivity 7 | * Created: Fri Oct 16 14:37:00 1987 8 | * Modified: Wed May 15 14:24:26 1991 (Mark Seaman) marks@hpgrlt 9 | * Language: C 10 | * Package: N/A 11 | * Status: Reusable Software Component 12 | * 13 | * (c) Copyright 1987, Hewlett-Packard Company. 14 | ** Licensed under the Apache License, Version 2.0 (the "License"); 15 | ** you may not use this file except in compliance with the License. 16 | ** You may obtain a copy of the License at 17 | ** http://www.apache.org/licenses/LICENSE-2.0 18 | ** Unless required by applicable law or agreed to in writing, software 19 | ** distributed under the License is distributed on an "AS IS" BASIS, 20 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 21 | ** See the License for the specific language governing permissions and 22 | ** limitations under the License. 23 | * 24 | *********************************************************************************/ 25 | 26 | #ifndef CHOPPER_H 27 | #define CHOPPER_H 28 | 29 | #include "cutil.h" 30 | #include "matrix.h" 31 | #include "seam.h" 32 | #include "stopper.h" 33 | 34 | 35 | void preserve_outline(EDGEPT *start); 36 | 37 | void preserve_outline_tree(TESSLINE *srcline); 38 | 39 | EDGEPT *restore_outline(EDGEPT *start); 40 | 41 | void restore_outline_tree(TESSLINE *srcline); 42 | 43 | int any_shared_split_points(const GenericVector& seams, SEAM *seam); 44 | 45 | int check_blob(TBLOB *blob); 46 | 47 | inT16 total_containment(TBLOB *blob1, TBLOB *blob2); 48 | #endif 49 | -------------------------------------------------------------------------------- /deps/tesseract/wordrec/drawfx.h: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * File: drawfx.h (Formerly drawfx.h) 3 | * Description: Draw things to do with feature extraction. 4 | * Author: Ray Smith 5 | * Created: Mon Jan 27 11:02:16 GMT 1992 6 | * 7 | * (C) Copyright 1992, Hewlett-Packard Ltd. 8 | ** Licensed under the Apache License, Version 2.0 (the "License"); 9 | ** you may not use this file except in compliance with the License. 10 | ** You may obtain a copy of the License at 11 | ** http://www.apache.org/licenses/LICENSE-2.0 12 | ** Unless required by applicable law or agreed to in writing, software 13 | ** distributed under the License is distributed on an "AS IS" BASIS, 14 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | ** See the License for the specific language governing permissions and 16 | ** limitations under the License. 17 | * 18 | **********************************************************************/ 19 | 20 | #ifndef DRAWFX_H 21 | #define DRAWFX_H 22 | 23 | #include "params.h" 24 | #include "scrollview.h" 25 | 26 | extern STRING_VAR_H (fx_debugfile, DEBUG_WIN_NAME, "Name of debugfile"); 27 | extern ScrollView* fx_win; 28 | extern FILE *fx_debug; 29 | void create_fx_win(); //make features win 30 | void clear_fx_win(); //make features win 31 | void create_fxdebug_win(); //make gradients win 32 | #endif 33 | -------------------------------------------------------------------------------- /deps/zxing/core/src/bigint/BigIntegerAlgorithms.hh: -------------------------------------------------------------------------------- 1 | #ifndef BIGINTEGERALGORITHMS_H 2 | #define BIGINTEGERALGORITHMS_H 3 | 4 | #include "BigInteger.hh" 5 | 6 | /* Some mathematical algorithms for big integers. 7 | * This code is new and, as such, experimental. */ 8 | 9 | // Returns the greatest common divisor of a and b. 10 | BigUnsigned gcd(BigUnsigned a, BigUnsigned b); 11 | 12 | /* Extended Euclidean algorithm. 13 | * Given m and n, finds gcd g and numbers r, s such that r*m + s*n == g. */ 14 | void extendedEuclidean(BigInteger m, BigInteger n, 15 | BigInteger &g, BigInteger &r, BigInteger &s); 16 | 17 | /* Returns the multiplicative inverse of x modulo n, or throws an exception if 18 | * they have a common factor. */ 19 | BigUnsigned modinv(const BigInteger &x, const BigUnsigned &n); 20 | 21 | // Returns (base ^ exponent) % modulus. 22 | BigUnsigned modexp(const BigInteger &base, const BigUnsigned &exponent, 23 | const BigUnsigned &modulus); 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /deps/zxing/core/src/bigint/BigIntegerLibrary.hh: -------------------------------------------------------------------------------- 1 | // This header file includes all of the library header files. 2 | 3 | #include "NumberlikeArray.hh" 4 | #include "BigUnsigned.hh" 5 | #include "BigInteger.hh" 6 | #include "BigIntegerAlgorithms.hh" 7 | #include "BigUnsignedInABase.hh" 8 | #include "BigIntegerUtils.hh" 9 | -------------------------------------------------------------------------------- /deps/zxing/core/src/bigint/BigIntegerUtils.cc: -------------------------------------------------------------------------------- 1 | #include "BigIntegerUtils.hh" 2 | #include "BigUnsignedInABase.hh" 3 | 4 | std::string bigUnsignedToString(const BigUnsigned &x) { 5 | return std::string(BigUnsignedInABase(x, 10)); 6 | } 7 | 8 | std::string bigIntegerToString(const BigInteger &x) { 9 | return (x.getSign() == BigInteger::negative) 10 | ? (std::string("-") + bigUnsignedToString(x.getMagnitude())) 11 | : (bigUnsignedToString(x.getMagnitude())); 12 | } 13 | 14 | BigUnsigned stringToBigUnsigned(const std::string &s) { 15 | return BigUnsigned(BigUnsignedInABase(s, 10)); 16 | } 17 | 18 | BigInteger stringToBigInteger(const std::string &s) { 19 | // Recognize a sign followed by a BigUnsigned. 20 | return (s[0] == '-') ? BigInteger(stringToBigUnsigned(s.substr(1, s.length() - 1)), BigInteger::negative) 21 | : (s[0] == '+') ? BigInteger(stringToBigUnsigned(s.substr(1, s.length() - 1))) 22 | : BigInteger(stringToBigUnsigned(s)); 23 | } 24 | 25 | std::ostream &operator <<(std::ostream &os, const BigUnsigned &x) { 26 | BigUnsignedInABase::Base base; 27 | long osFlags = os.flags(); 28 | if (osFlags & os.dec) 29 | base = 10; 30 | else if (osFlags & os.hex) { 31 | base = 16; 32 | if (osFlags & os.showbase) 33 | os << "0x"; 34 | } else if (osFlags & os.oct) { 35 | base = 8; 36 | if (osFlags & os.showbase) 37 | os << '0'; 38 | } else 39 | throw "std::ostream << BigUnsigned: Could not determine the desired base from output-stream flags"; 40 | std::string s = std::string(BigUnsignedInABase(x, base)); 41 | os << s; 42 | return os; 43 | } 44 | 45 | std::ostream &operator <<(std::ostream &os, const BigInteger &x) { 46 | if (x.getSign() == BigInteger::negative) 47 | os << '-'; 48 | os << x.getMagnitude(); 49 | return os; 50 | } 51 | -------------------------------------------------------------------------------- /deps/zxing/core/src/win32/zxing/iconv.h: -------------------------------------------------------------------------------- 1 | #ifndef _LIBICONV_H 2 | #define _LIBICONV_H 3 | #include 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | typedef void* iconv_t; 8 | iconv_t iconv_open(const char *tocode, const char *fromcode); 9 | int iconv_close(iconv_t cd); 10 | size_t iconv(iconv_t cd, char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft); 11 | #ifdef __cplusplus 12 | } 13 | #endif 14 | #endif//_LIBICONV_H -------------------------------------------------------------------------------- /deps/zxing/core/src/zxing/BarcodeFormat.cpp: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | /* 3 | * Created by Christian Brunschen on 13/05/2008. 4 | * Copyright 2008 ZXing authors All rights reserved. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | #include 20 | 21 | const char* zxing::BarcodeFormat::barcodeFormatNames[] = { 22 | 0, 23 | "AZTEC", 24 | "CODABAR", 25 | "CODE_39", 26 | "CODE_93", 27 | "CODE_128", 28 | "DATA_MATRIX", 29 | "EAN_8", 30 | "EAN_13", 31 | "ITF", 32 | "MAXICODE", 33 | "PDF_417", 34 | "QR_CODE", 35 | "RSS_14", 36 | "RSS_EXPANDED", 37 | "UPC_A", 38 | "UPC_E", 39 | "UPC_EAN_EXTENSION" 40 | }; 41 | -------------------------------------------------------------------------------- /deps/zxing/core/src/zxing/BarcodeFormat.h: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | #ifndef __BARCODE_FORMAT_H__ 3 | #define __BARCODE_FORMAT_H__ 4 | 5 | /* 6 | * BarcodeFormat.h 7 | * zxing 8 | * 9 | * Copyright 2010 ZXing authors All rights reserved. 10 | * 11 | * Licensed under the Apache License, Version 2.0 (the "License"); 12 | * you may not use this file except in compliance with the License. 13 | * You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, software 18 | * distributed under the License is distributed on an "AS IS" BASIS, 19 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | * See the License for the specific language governing permissions and 21 | * limitations under the License. 22 | */ 23 | 24 | namespace zxing { 25 | 26 | class BarcodeFormat { 27 | public: 28 | // if you update the enum, update BarcodeFormat.cpp 29 | 30 | enum Value { 31 | NONE, 32 | AZTEC, 33 | CODABAR, 34 | CODE_39, 35 | CODE_93, 36 | CODE_128, 37 | DATA_MATRIX, 38 | EAN_8, 39 | EAN_13, 40 | ITF, 41 | MAXICODE, 42 | PDF_417, 43 | QR_CODE, 44 | RSS_14, 45 | RSS_EXPANDED, 46 | UPC_A, 47 | UPC_E, 48 | UPC_EAN_EXTENSION 49 | }; 50 | 51 | BarcodeFormat(Value v) : value(v) {} 52 | const Value value; 53 | operator Value () const {return value;} 54 | 55 | static char const* barcodeFormatNames[]; 56 | }; 57 | 58 | } 59 | 60 | #endif // __BARCODE_FORMAT_H__ 61 | -------------------------------------------------------------------------------- /deps/zxing/core/src/zxing/Binarizer.cpp: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | /* 3 | * Binarizer.cpp 4 | * zxing 5 | * 6 | * Created by Ralf Kistner on 16/10/2009. 7 | * Copyright 2008 ZXing authors All rights reserved. 8 | * Modified by Lukasz Warchol on 02/02/2010. 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | #include 24 | 25 | namespace zxing { 26 | 27 | Binarizer::Binarizer(Ref source) : source_(source) { 28 | } 29 | 30 | Binarizer::~Binarizer() { 31 | } 32 | 33 | Ref Binarizer::getLuminanceSource() const { 34 | return source_; 35 | } 36 | 37 | int Binarizer::getWidth() const { 38 | return source_->getWidth(); 39 | } 40 | 41 | int Binarizer::getHeight() const { 42 | return source_->getHeight(); 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /deps/zxing/core/src/zxing/Binarizer.h: -------------------------------------------------------------------------------- 1 | #ifndef BINARIZER_H_ 2 | #define BINARIZER_H_ 3 | 4 | /* 5 | * Binarizer.h 6 | * zxing 7 | * 8 | * Copyright 2010 ZXing authors All rights reserved. 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | namespace zxing { 29 | 30 | class Binarizer : public Counted { 31 | private: 32 | Ref source_; 33 | 34 | public: 35 | Binarizer(Ref source); 36 | virtual ~Binarizer(); 37 | 38 | virtual Ref getBlackRow(int y, Ref row) = 0; 39 | virtual Ref getBlackMatrix() = 0; 40 | 41 | Ref getLuminanceSource() const ; 42 | virtual Ref createBinarizer(Ref source) = 0; 43 | 44 | int getWidth() const; 45 | int getHeight() const; 46 | 47 | }; 48 | 49 | } 50 | #endif /* BINARIZER_H_ */ 51 | -------------------------------------------------------------------------------- /deps/zxing/core/src/zxing/BinaryBitmap.h: -------------------------------------------------------------------------------- 1 | #ifndef __BINARYBITMAP_H__ 2 | #define __BINARYBITMAP_H__ 3 | 4 | /* 5 | * BinaryBitmap.h 6 | * zxing 7 | * 8 | * Copyright 2010 ZXing authors All rights reserved. 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | namespace zxing { 29 | 30 | class BinaryBitmap : public Counted { 31 | private: 32 | Ref binarizer_; 33 | 34 | public: 35 | BinaryBitmap(Ref binarizer); 36 | virtual ~BinaryBitmap(); 37 | 38 | Ref getBlackRow(int y, Ref row); 39 | Ref getBlackMatrix(); 40 | 41 | Ref getLuminanceSource() const; 42 | 43 | int getWidth() const; 44 | int getHeight() const; 45 | 46 | bool isRotateSupported() const; 47 | Ref rotateCounterClockwise(); 48 | 49 | bool isCropSupported() const; 50 | Ref crop(int left, int top, int width, int height); 51 | 52 | }; 53 | 54 | } 55 | 56 | #endif /* BINARYBITMAP_H_ */ 57 | -------------------------------------------------------------------------------- /deps/zxing/core/src/zxing/ChecksumException.cpp: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | /* 3 | * ChecksumException.cpp 4 | * zxing 5 | * 6 | * Created by Christian Brunschen on 13/05/2008. 7 | * Copyright 2008 ZXing authors All rights reserved. 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | */ 21 | 22 | #include 23 | 24 | using zxing::ChecksumException; 25 | 26 | ChecksumException::ChecksumException() throw() {} 27 | ChecksumException::ChecksumException(const char *msg) throw() : ReaderException(msg) {} 28 | ChecksumException::~ChecksumException() throw() {} 29 | -------------------------------------------------------------------------------- /deps/zxing/core/src/zxing/ChecksumException.h: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | 3 | #ifndef __CHECKSUM_EXCEPTION_H__ 4 | #define __NOT_FOUND_EXCEPTION_H__ 5 | 6 | /* 7 | * Copyright 20011 ZXing authors 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | */ 21 | 22 | #include 23 | 24 | namespace zxing { 25 | class ChecksumException : public ReaderException { 26 | typedef ReaderException Base; 27 | public: 28 | ChecksumException() throw(); 29 | ChecksumException(const char *msg) throw(); 30 | ~ChecksumException() throw(); 31 | }; 32 | } 33 | 34 | #endif // __CHECKSUM_EXCEPTION_H__ 35 | -------------------------------------------------------------------------------- /deps/zxing/core/src/zxing/Exception.cpp: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | /* 3 | * Exception.cpp 4 | * ZXing 5 | * 6 | * Created by Christian Brunschen on 03/06/2008. 7 | * Copyright 2008-2011 ZXing authors All rights reserved. 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | 21 | */ 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | using zxing::Exception; 28 | 29 | void Exception::deleteMessage() { 30 | delete [] message; 31 | } 32 | 33 | char const* Exception::copy(char const* msg) { 34 | char* message = 0; 35 | if (msg) { 36 | int l = strlen(msg)+1; 37 | if (l) { 38 | message = new char[l]; 39 | strcpy(message, msg); 40 | } 41 | } 42 | return message; 43 | } 44 | -------------------------------------------------------------------------------- /deps/zxing/core/src/zxing/Exception.h: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | #ifndef __EXCEPTION_H__ 3 | #define __EXCEPTION_H__ 4 | 5 | /* 6 | * Exception.h 7 | * ZXing 8 | * 9 | * Copyright 2010 ZXing authors All rights reserved. 10 | * 11 | * Licensed under the Apache License, Version 2.0 (the "License"); 12 | * you may not use this file except in compliance with the License. 13 | * You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, software 18 | * distributed under the License is distributed on an "AS IS" BASIS, 19 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | * See the License for the specific language governing permissions and 21 | * limitations under the License. 22 | */ 23 | 24 | #include 25 | #include 26 | 27 | namespace zxing { 28 | 29 | class Exception : public std::exception { 30 | private: 31 | char const* const message; 32 | 33 | public: 34 | Exception() throw() : message(0) {} 35 | Exception(const char* msg) throw() : message(copy(msg)) {} 36 | Exception(Exception const& that) throw() : std::exception(that), message(copy(that.message)) {} 37 | ~Exception() throw() { 38 | if(message) { 39 | deleteMessage(); 40 | } 41 | } 42 | char const* what() const throw() {return message ? message : "";} 43 | 44 | private: 45 | static char const* copy(char const*); 46 | void deleteMessage(); 47 | }; 48 | 49 | } 50 | 51 | #endif // __EXCEPTION_H__ 52 | -------------------------------------------------------------------------------- /deps/zxing/core/src/zxing/FormatException.cpp: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | /* 3 | * FormatException.cpp 4 | * zxing 5 | * 6 | * Created by Christian Brunschen on 13/05/2008. 7 | * Copyright 2008 ZXing authors All rights reserved. 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | */ 21 | 22 | #include 23 | 24 | namespace zxing { 25 | 26 | FormatException::FormatException() {} 27 | 28 | FormatException::FormatException(const char *msg) : 29 | ReaderException(msg) { 30 | } 31 | 32 | FormatException::~FormatException() throw() { 33 | } 34 | 35 | FormatException const& 36 | FormatException::getFormatInstance() { 37 | static FormatException instance; 38 | return instance; 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /deps/zxing/core/src/zxing/FormatException.h: -------------------------------------------------------------------------------- 1 | #ifndef __FORMAT_EXCEPTION_H__ 2 | #define __FORMAT_EXCEPTION_H__ 3 | 4 | /* 5 | * FormatException.h 6 | * zxing 7 | * 8 | * Copyright 2010 ZXing authors All rights reserved. 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | #include 24 | 25 | namespace zxing { 26 | 27 | class FormatException : public ReaderException { 28 | public: 29 | FormatException(); 30 | FormatException(const char *msg); 31 | ~FormatException() throw(); 32 | 33 | static FormatException const& getFormatInstance(); 34 | }; 35 | 36 | } 37 | #endif // __FORMAT_EXCEPTION_H__ 38 | -------------------------------------------------------------------------------- /deps/zxing/core/src/zxing/IllegalStateException.h: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | 3 | #ifndef __ILLEGAL_STATE_EXCEPTION_H__ 4 | #define __ILLEGAL_STATE_EXCEPTION_H__ 5 | 6 | /* 7 | * Copyright 20011 ZXing authors 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may illegal use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | */ 21 | 22 | #include 23 | 24 | namespace zxing { 25 | 26 | class IllegalStateException : public ReaderException { 27 | public: 28 | IllegalStateException() throw() {} 29 | IllegalStateException(const char *msg) throw() : ReaderException(msg) {} 30 | ~IllegalStateException() throw() {} 31 | }; 32 | 33 | } 34 | 35 | #endif // __ILLEGAL_STATE_EXCEPTION_H__ 36 | -------------------------------------------------------------------------------- /deps/zxing/core/src/zxing/InvertedLuminanceSource.h: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | #ifndef __INVERTEDLUMINANCESOURCE_H__ 3 | #define __INVERTEDLUMINANCESOURCE_H__ 4 | /* 5 | * Copyright 2013 ZXing authors All rights reserved. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #include 21 | #include 22 | 23 | namespace zxing { 24 | 25 | class InvertedLuminanceSource : public LuminanceSource { 26 | private: 27 | typedef LuminanceSource Super; 28 | const Ref delegate; 29 | 30 | public: 31 | InvertedLuminanceSource(Ref const&); 32 | 33 | ArrayRef getRow(int y, ArrayRef row) const; 34 | ArrayRef getMatrix() const; 35 | 36 | boolean isCropSupported() const; 37 | Ref crop(int left, int top, int width, int height) const; 38 | 39 | boolean isRotateSupported() const; 40 | 41 | virtual Ref invert() const; 42 | 43 | Ref rotateCounterClockwise() const; 44 | }; 45 | 46 | } 47 | 48 | #endif /* INVERTEDLUMINANCESOURCE_H_ */ 49 | -------------------------------------------------------------------------------- /deps/zxing/core/src/zxing/MultiFormatReader.h: -------------------------------------------------------------------------------- 1 | #ifndef __MULTI_FORMAT_READER_H__ 2 | #define __MULTI_FORMAT_READER_H__ 3 | 4 | /* 5 | * MultiFormatBarcodeReader.h 6 | * ZXing 7 | * 8 | * Copyright 2010 ZXing authors All rights reserved. 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | 24 | #include 25 | #include 26 | #include 27 | #include 28 | 29 | namespace zxing { 30 | class MultiFormatReader : public Reader { 31 | private: 32 | Ref decodeInternal(Ref image); 33 | 34 | std::vector > readers_; 35 | DecodeHints hints_; 36 | 37 | public: 38 | MultiFormatReader(); 39 | 40 | Ref decode(Ref image); 41 | Ref decode(Ref image, DecodeHints hints); 42 | Ref decodeWithState(Ref image); 43 | void setHints(DecodeHints hints); 44 | ~MultiFormatReader(); 45 | }; 46 | } 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /deps/zxing/core/src/zxing/NotFoundException.h: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | 3 | #ifndef __NOT_FOUND_EXCEPTION_H__ 4 | #define __NOT_FOUND_EXCEPTION_H__ 5 | 6 | /* 7 | * Copyright 20011 ZXing authors 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | */ 21 | 22 | #include 23 | 24 | namespace zxing { 25 | 26 | class NotFoundException : public ReaderException { 27 | public: 28 | NotFoundException() throw() {} 29 | NotFoundException(const char *msg) throw() : ReaderException(msg) {} 30 | ~NotFoundException() throw() {} 31 | }; 32 | 33 | } 34 | 35 | #endif // __NOT_FOUND_EXCEPTION_H__ 36 | -------------------------------------------------------------------------------- /deps/zxing/core/src/zxing/Reader.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Reader.cpp 3 | * zxing 4 | * 5 | * Created by Christian Brunschen on 13/05/2008. 6 | * Copyright 2008 ZXing authors All rights reserved. 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #include 22 | 23 | namespace zxing { 24 | 25 | Reader::~Reader() { } 26 | 27 | Ref Reader::decode(Ref image) { 28 | return decode(image, DecodeHints::DEFAULT_HINT); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /deps/zxing/core/src/zxing/Reader.h: -------------------------------------------------------------------------------- 1 | #ifndef __READER_H__ 2 | #define __READER_H__ 3 | 4 | /* 5 | * Reader.h 6 | * zxing 7 | * 8 | * Copyright 2010 ZXing authors All rights reserved. 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | namespace zxing { 28 | 29 | class Reader : public Counted { 30 | protected: 31 | Reader() {} 32 | public: 33 | virtual Ref decode(Ref image); 34 | virtual Ref decode(Ref image, DecodeHints hints) = 0; 35 | virtual ~Reader(); 36 | }; 37 | 38 | } 39 | 40 | #endif // __READER_H__ 41 | -------------------------------------------------------------------------------- /deps/zxing/core/src/zxing/ReaderException.h: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | #ifndef __READER_EXCEPTION_H__ 3 | #define __READER_EXCEPTION_H__ 4 | 5 | /* 6 | * ReaderException.h 7 | * zxing 8 | * 9 | * Copyright 2010 ZXing authors All rights reserved. 10 | * 11 | * Licensed under the Apache License, Version 2.0 (the "License"); 12 | * you may not use this file except in compliance with the License. 13 | * You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, software 18 | * distributed under the License is distributed on an "AS IS" BASIS, 19 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | * See the License for the specific language governing permissions and 21 | * limitations under the License. 22 | */ 23 | 24 | #include 25 | 26 | namespace zxing { 27 | 28 | class ReaderException : public Exception { 29 | public: 30 | ReaderException() throw() {} 31 | ReaderException(char const* msg) throw() : Exception(msg) {} 32 | ~ReaderException() throw() {} 33 | }; 34 | 35 | } 36 | 37 | #endif // __READER_EXCEPTION_H__ 38 | -------------------------------------------------------------------------------- /deps/zxing/core/src/zxing/Result.h: -------------------------------------------------------------------------------- 1 | #ifndef __RESULT_H__ 2 | #define __RESULT_H__ 3 | 4 | /* 5 | * Result.h 6 | * zxing 7 | * 8 | * Copyright 2010 ZXing authors All rights reserved. 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | namespace zxing { 31 | 32 | class Result : public Counted { 33 | private: 34 | Ref text_; 35 | ArrayRef rawBytes_; 36 | ArrayRef< Ref > resultPoints_; 37 | BarcodeFormat format_; 38 | 39 | public: 40 | Result(Ref text, 41 | ArrayRef rawBytes, 42 | ArrayRef< Ref > resultPoints, 43 | BarcodeFormat format); 44 | ~Result(); 45 | Ref getText(); 46 | ArrayRef getRawBytes(); 47 | ArrayRef< Ref > const& getResultPoints() const; 48 | ArrayRef< Ref >& getResultPoints(); 49 | BarcodeFormat getBarcodeFormat() const; 50 | 51 | friend std::ostream& operator<<(std::ostream &out, Result& result); 52 | }; 53 | 54 | } 55 | #endif // __RESULT_H__ 56 | -------------------------------------------------------------------------------- /deps/zxing/core/src/zxing/ResultIO.cpp: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | /* 3 | * ResultIO.cpp 4 | * zxing 5 | * 6 | * Created by Christian Brunschen on 13/05/2008. 7 | * Copyright 2008 ZXing authors All rights reserved. 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | */ 21 | 22 | #include 23 | 24 | using zxing::Result; 25 | using std::ostream; 26 | 27 | ostream& zxing::operator<<(ostream &out, Result& result) { 28 | if (result.text_ != 0) { 29 | out << result.text_->getText(); 30 | } else { 31 | out << "[" << result.rawBytes_->size() << " bytes]"; 32 | } 33 | return out; 34 | } 35 | -------------------------------------------------------------------------------- /deps/zxing/core/src/zxing/ResultPoint.h: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | #ifndef __RESULT_POINT_H__ 3 | #define __RESULT_POINT_H__ 4 | 5 | /* 6 | * ResultPoint.h 7 | * zxing 8 | * 9 | * Copyright 2010 ZXing authors All rights reserved. 10 | * 11 | * Licensed under the Apache License, Version 2.0 (the "License"); 12 | * you may not use this file except in compliance with the License. 13 | * You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, software 18 | * distributed under the License is distributed on an "AS IS" BASIS, 19 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | * See the License for the specific language governing permissions and 21 | * limitations under the License. 22 | */ 23 | 24 | #include 25 | #include 26 | 27 | namespace zxing { 28 | 29 | class ResultPoint : public Counted { 30 | protected: 31 | const float posX_; 32 | const float posY_; 33 | 34 | public: 35 | ResultPoint(); 36 | ResultPoint(float x, float y); 37 | ResultPoint(int x, int y); 38 | virtual ~ResultPoint(); 39 | 40 | virtual float getX() const; 41 | virtual float getY() const; 42 | 43 | bool equals(Ref other); 44 | 45 | static void orderBestPatterns(std::vector > &patterns); 46 | static float distance(Ref point1, Ref point2); 47 | static float distance(float x1, float x2, float y1, float y2); 48 | 49 | private: 50 | static float crossProductZ(Ref pointA, Ref pointB, Ref pointC); 51 | }; 52 | 53 | } 54 | 55 | #endif // __RESULT_POINT_H__ 56 | -------------------------------------------------------------------------------- /deps/zxing/core/src/zxing/ResultPointCallback.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * ResultPointCallback.cpp 3 | * zxing 4 | * 5 | * Copyright 2010 ZXing authors All rights reserved. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #include 21 | 22 | namespace zxing { 23 | 24 | ResultPointCallback::~ResultPointCallback() {} 25 | 26 | } 27 | -------------------------------------------------------------------------------- /deps/zxing/core/src/zxing/ResultPointCallback.h: -------------------------------------------------------------------------------- 1 | #ifndef __RESULT_POINT_CALLBACK_H__ 2 | #define __RESULT_POINT_CALLBACK_H__ 3 | 4 | /* 5 | * ResultPointCallback.h 6 | * zxing 7 | * 8 | * Copyright 2010 ZXing authors All rights reserved. 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | #include 24 | 25 | namespace zxing { 26 | 27 | class ResultPoint; 28 | 29 | class ResultPointCallback : public Counted { 30 | protected: 31 | ResultPointCallback() {} 32 | public: 33 | virtual void foundPossibleResultPoint(ResultPoint const& point) = 0; 34 | virtual ~ResultPointCallback(); 35 | }; 36 | 37 | } 38 | 39 | #endif // __RESULT_POINT_CALLBACK_H__ 40 | -------------------------------------------------------------------------------- /deps/zxing/core/src/zxing/aztec/AztecDetectorResult.h: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | /* 3 | * AtztecDetecorResult.h 4 | * zxing 5 | * 6 | * Created by Lukas Stabe on 08/02/2012. 7 | * Copyright 2012 ZXing authors All rights reserved. 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | */ 21 | 22 | #include 23 | 24 | #ifndef ZXingWidget_AtztecDetecorResult_h 25 | #define ZXingWidget_AtztecDetecorResult_h 26 | 27 | namespace zxing { 28 | namespace aztec { 29 | 30 | class AztecDetectorResult : public DetectorResult { 31 | private: 32 | bool compact_; 33 | int nbDatablocks_, nbLayers_; 34 | public: 35 | AztecDetectorResult(Ref bits, 36 | ArrayRef< Ref > points, 37 | bool compact, 38 | int nbDatablocks, 39 | int nbLayers); 40 | bool isCompact(); 41 | int getNBDatablocks(); 42 | int getNBLayers(); 43 | }; 44 | 45 | } 46 | } 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /deps/zxing/core/src/zxing/aztec/AztecReader.h: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | /* 3 | * AztecReader.h 4 | * zxing 5 | * 6 | * Created by Lukas Stabe on 08/02/2012. 7 | * Copyright 2012 ZXing authors All rights reserved. 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | */ 21 | 22 | #include 23 | #include 24 | #include 25 | 26 | #ifndef ZXingWidget_AztecReader_h 27 | #define ZXingWidget_AztecReader_h 28 | 29 | namespace zxing { 30 | namespace aztec { 31 | 32 | class AztecReader : public Reader { 33 | private: 34 | Decoder decoder_; 35 | 36 | protected: 37 | Decoder &getDecoder(); 38 | 39 | public: 40 | AztecReader(); 41 | virtual Ref decode(Ref image); 42 | virtual Ref decode(Ref image, DecodeHints hints); 43 | virtual ~AztecReader(); 44 | }; 45 | 46 | } 47 | } 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /deps/zxing/core/src/zxing/common/BitArrayIO.cpp: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | /* 3 | * Copyright 2010 ZXing authors. All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | #include 19 | 20 | using zxing::BitArray; 21 | using std::ostream; 22 | 23 | ostream& zxing::operator << (ostream& os, BitArray const& ba) { 24 | for (int i = 0, size = ba.getSize(); i < size; i++) { 25 | if ((i & 0x07) == 0) { 26 | os << ' '; 27 | } 28 | os << (ba.get(i) ? 'X' : '.'); 29 | } 30 | return os; 31 | } 32 | -------------------------------------------------------------------------------- /deps/zxing/core/src/zxing/common/CharacterSetECI.h: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | 3 | #ifndef __CHARACTERSET_ECI__ 4 | #define __CHARACTERSET_ECI__ 5 | 6 | /* 7 | * Copyright 2008-2011 ZXing authors 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | */ 21 | 22 | #include 23 | #include 24 | 25 | namespace zxing { 26 | namespace common { 27 | 28 | class CharacterSetECI { 29 | private: 30 | static std::map VALUE_TO_ECI; 31 | static std::map NAME_TO_ECI; 32 | static const bool inited; 33 | static bool init_tables(); 34 | 35 | int const* const values_; 36 | char const* const* const names_; 37 | 38 | CharacterSetECI(int const* values, char const* const* names); 39 | 40 | static void addCharacterSet(int const* value, char const* const* encodingNames); 41 | 42 | public: 43 | char const* name() const; 44 | int getValue() const; 45 | 46 | static CharacterSetECI* getCharacterSetECIByValue(int value); 47 | static CharacterSetECI* getCharacterSetECIByName(std::string const& name); 48 | }; 49 | 50 | } 51 | } 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /deps/zxing/core/src/zxing/common/DecoderResult.cpp: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | /* 3 | * DecoderResult.cpp 4 | * zxing 5 | * 6 | * Created by Christian Brunschen on 20/05/2008. 7 | * Copyright 2008-2011 ZXing authors All rights reserved. 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | */ 21 | 22 | #include 23 | 24 | using namespace std; 25 | using namespace zxing; 26 | 27 | DecoderResult::DecoderResult(ArrayRef rawBytes, 28 | Ref text, 29 | ArrayRef< ArrayRef >& byteSegments, 30 | string const& ecLevel) : 31 | rawBytes_(rawBytes), 32 | text_(text), 33 | byteSegments_(byteSegments), 34 | ecLevel_(ecLevel) {} 35 | 36 | DecoderResult::DecoderResult(ArrayRef rawBytes, 37 | Ref text) 38 | : rawBytes_(rawBytes), text_(text) {} 39 | 40 | ArrayRef DecoderResult::getRawBytes() { 41 | return rawBytes_; 42 | } 43 | 44 | Ref DecoderResult::getText() { 45 | return text_; 46 | } 47 | -------------------------------------------------------------------------------- /deps/zxing/core/src/zxing/common/DecoderResult.h: -------------------------------------------------------------------------------- 1 | #ifndef __DECODER_RESULT_H__ 2 | #define __DECODER_RESULT_H__ 3 | 4 | /* 5 | * DecoderResult.h 6 | * zxing 7 | * 8 | * Copyright 2010 ZXing authors All rights reserved. 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | namespace zxing { 29 | 30 | class DecoderResult : public Counted { 31 | private: 32 | ArrayRef rawBytes_; 33 | Ref text_; 34 | ArrayRef< ArrayRef > byteSegments_; 35 | std::string ecLevel_; 36 | 37 | public: 38 | DecoderResult(ArrayRef rawBytes, 39 | Ref text, 40 | ArrayRef< ArrayRef >& byteSegments, 41 | std::string const& ecLevel); 42 | 43 | DecoderResult(ArrayRef rawBytes, Ref text); 44 | 45 | ArrayRef getRawBytes(); 46 | Ref getText(); 47 | }; 48 | 49 | } 50 | 51 | #endif // __DECODER_RESULT_H__ 52 | -------------------------------------------------------------------------------- /deps/zxing/core/src/zxing/common/DetectorResult.cpp: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | /* 3 | * DetectorResult.cpp 4 | * zxing 5 | * 6 | * Created by Christian Brunschen on 14/05/2008. 7 | * Copyright 2008 ZXing authors All rights reserved. 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | */ 21 | 22 | #include 23 | 24 | namespace zxing { 25 | 26 | DetectorResult::DetectorResult(Ref bits, 27 | ArrayRef< Ref > points) 28 | : bits_(bits), points_(points) { 29 | } 30 | 31 | Ref DetectorResult::getBits() { 32 | return bits_; 33 | } 34 | 35 | ArrayRef< Ref > DetectorResult::getPoints() { 36 | return points_; 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /deps/zxing/core/src/zxing/common/DetectorResult.h: -------------------------------------------------------------------------------- 1 | #ifndef __DETECTOR_RESULT_H__ 2 | #define __DETECTOR_RESULT_H__ 3 | 4 | /* 5 | * DetectorResult.h 6 | * zxing 7 | * 8 | * Copyright 2010 ZXing authors All rights reserved. 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | namespace zxing { 29 | 30 | class DetectorResult : public Counted { 31 | private: 32 | Ref bits_; 33 | ArrayRef< Ref > points_; 34 | 35 | public: 36 | DetectorResult(Ref bits, ArrayRef< Ref > points); 37 | Ref getBits(); 38 | ArrayRef< Ref > getPoints(); 39 | }; 40 | 41 | } 42 | 43 | #endif // __DETECTOR_RESULT_H__ 44 | -------------------------------------------------------------------------------- /deps/zxing/core/src/zxing/common/GlobalHistogramBinarizer.h: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | #ifndef __GLOBALHISTOGRAMBINARIZER_H__ 3 | #define __GLOBALHISTOGRAMBINARIZER_H__ 4 | /* 5 | * GlobalHistogramBinarizer.h 6 | * zxing 7 | * 8 | * Copyright 2010 ZXing authors All rights reserved. 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | namespace zxing { 29 | 30 | class GlobalHistogramBinarizer : public Binarizer { 31 | private: 32 | ArrayRef luminances; 33 | ArrayRef buckets; 34 | public: 35 | GlobalHistogramBinarizer(Ref source); 36 | virtual ~GlobalHistogramBinarizer(); 37 | 38 | virtual Ref getBlackRow(int y, Ref row); 39 | virtual Ref getBlackMatrix(); 40 | static int estimateBlackPoint(ArrayRef const& buckets); 41 | Ref createBinarizer(Ref source); 42 | private: 43 | void initArrays(int luminanceSize); 44 | }; 45 | 46 | } 47 | 48 | #endif /* GLOBALHISTOGRAMBINARIZER_H_ */ 49 | -------------------------------------------------------------------------------- /deps/zxing/core/src/zxing/common/GreyscaleLuminanceSource.h: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | #ifndef __GREYSCALE_LUMINANCE_SOURCE__ 3 | #define __GREYSCALE_LUMINANCE_SOURCE__ 4 | /* 5 | * GreyscaleLuminanceSource.h 6 | * zxing 7 | * 8 | * Copyright 2010 ZXing authors All rights reserved. 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | #include 24 | 25 | namespace zxing { 26 | 27 | class GreyscaleLuminanceSource : public LuminanceSource { 28 | 29 | private: 30 | typedef LuminanceSource Super; 31 | ArrayRef greyData_; 32 | const int dataWidth_; 33 | const int dataHeight_; 34 | const int left_; 35 | const int top_; 36 | 37 | public: 38 | GreyscaleLuminanceSource(ArrayRef greyData, int dataWidth, int dataHeight, int left, 39 | int top, int width, int height); 40 | 41 | ArrayRef getRow(int y, ArrayRef row) const; 42 | ArrayRef getMatrix() const; 43 | 44 | bool isRotateSupported() const { 45 | return true; 46 | } 47 | 48 | Ref rotateCounterClockwise() const; 49 | }; 50 | 51 | } 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /deps/zxing/core/src/zxing/common/GreyscaleRotatedLuminanceSource.h: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | #ifndef __GREYSCALE_ROTATED_LUMINANCE_SOURCE__ 3 | #define __GREYSCALE_ROTATED_LUMINANCE_SOURCE__ 4 | /* 5 | * GreyscaleRotatedLuminanceSource.h 6 | * zxing 7 | * 8 | * Copyright 2010 ZXing authors All rights reserved. 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | 24 | #include 25 | 26 | namespace zxing { 27 | 28 | class GreyscaleRotatedLuminanceSource : public LuminanceSource { 29 | private: 30 | typedef LuminanceSource Super; 31 | ArrayRef greyData_; 32 | const int dataWidth_; 33 | const int left_; 34 | const int top_; 35 | 36 | public: 37 | GreyscaleRotatedLuminanceSource(ArrayRef greyData, int dataWidth, int dataHeight, 38 | int left, int top, int width, int height); 39 | 40 | ArrayRef getRow(int y, ArrayRef row) const; 41 | ArrayRef getMatrix() const; 42 | }; 43 | 44 | } 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /deps/zxing/core/src/zxing/common/IllegalArgumentException.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * IllegalArgumentException.cpp 3 | * zxing 4 | * 5 | * Created by Christian Brunschen on 06/05/2008. 6 | * Copyright 2008 Google UK. All rights reserved. 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #include 22 | 23 | using zxing::IllegalArgumentException; 24 | 25 | IllegalArgumentException::IllegalArgumentException() : Exception() {} 26 | IllegalArgumentException::IllegalArgumentException(const char *msg) : Exception(msg) {} 27 | IllegalArgumentException::~IllegalArgumentException() throw() {} 28 | -------------------------------------------------------------------------------- /deps/zxing/core/src/zxing/common/IllegalArgumentException.h: -------------------------------------------------------------------------------- 1 | #ifndef __ILLEGAL_ARGUMENT_EXCEPTION_H__ 2 | #define __ILLEGAL_ARGUMENT_EXCEPTION_H__ 3 | 4 | /* 5 | * IllegalArgumentException.h 6 | * zxing 7 | * 8 | * Copyright 2010 ZXing authors All rights reserved. 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | #include 24 | 25 | namespace zxing { 26 | 27 | class IllegalArgumentException : public Exception { 28 | public: 29 | IllegalArgumentException(); 30 | IllegalArgumentException(const char *msg); 31 | ~IllegalArgumentException() throw(); 32 | }; 33 | 34 | } 35 | 36 | #endif // __ILLEGAL_ARGUMENT_EXCEPTION_H__ 37 | -------------------------------------------------------------------------------- /deps/zxing/core/src/zxing/common/Point.h: -------------------------------------------------------------------------------- 1 | #ifndef __POINT_H__ 2 | #define __POINT_H__ 3 | 4 | /* 5 | * Point.h 6 | * zxing 7 | * 8 | * Copyright 2010 ZXing authors All rights reserved. 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | namespace zxing { 24 | class PointI { 25 | public: 26 | int x; 27 | int y; 28 | }; 29 | 30 | class Point { 31 | public: 32 | Point() : x(0.0f), y(0.0f) {}; 33 | Point(float x_, float y_) : x(x_), y(y_) {}; 34 | 35 | float x; 36 | float y; 37 | }; 38 | 39 | class Line { 40 | public: 41 | Line(Point start_, Point end_) : start(start_), end(end_) {}; 42 | 43 | Point start; 44 | Point end; 45 | }; 46 | } 47 | #endif // POINT_H_ 48 | -------------------------------------------------------------------------------- /deps/zxing/core/src/zxing/common/Str.h: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | #ifndef __STR_H__ 3 | #define __STR_H__ 4 | 5 | /* 6 | * Str.h 7 | * zxing 8 | * 9 | * Copyright 2010 ZXing authors All rights reserved. 10 | * 11 | * Licensed under the Apache License, Version 2.0 (the "License"); 12 | * you may not use this file except in compliance with the License. 13 | * You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, software 18 | * distributed under the License is distributed on an "AS IS" BASIS, 19 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | * See the License for the specific language governing permissions and 21 | * limitations under the License. 22 | */ 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | namespace zxing { 29 | 30 | class String; 31 | std::ostream& operator << (std::ostream& out, String const& s); 32 | 33 | class String : public Counted { 34 | private: 35 | std::string text_; 36 | public: 37 | explicit String(const std::string &text); 38 | explicit String(int); 39 | char charAt(int) const; 40 | Ref substring(int) const; 41 | const std::string& getText() const; 42 | int size() const; 43 | void append(std::string const& tail); 44 | void append(char c); 45 | int length() const; 46 | friend std::ostream& zxing::operator << (std::ostream& out, String const& s); 47 | }; 48 | 49 | } 50 | 51 | #endif // __COMMON__STRING_H__ 52 | -------------------------------------------------------------------------------- /deps/zxing/core/src/zxing/common/StringUtils.h: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | 3 | #ifndef __STRING_UTILS__ 4 | #define __STRING_UTILS__ 5 | 6 | /* 7 | * Copyright (C) 2010-2011 ZXing authors 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | */ 21 | 22 | #include 23 | #include 24 | #include 25 | 26 | namespace zxing { 27 | namespace common { 28 | 29 | class StringUtils { 30 | private: 31 | static char const* const PLATFORM_DEFAULT_ENCODING; 32 | 33 | StringUtils() {} 34 | 35 | public: 36 | static char const* const ASCII; 37 | static char const* const SHIFT_JIS; 38 | static char const* const GB2312; 39 | static char const* const EUC_JP; 40 | static char const* const UTF8; 41 | static char const* const ISO88591; 42 | static const bool ASSUME_SHIFT_JIS; 43 | 44 | typedef std::map Hashtable; 45 | 46 | static std::string guessEncoding(char* bytes, int length, Hashtable const& hints); 47 | }; 48 | 49 | } 50 | } 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /deps/zxing/core/src/zxing/common/detector/JavaMath.h: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | #ifndef __ZXING_COMMON_DETECTOR_MATH_H__ 3 | #define __ZXING_COMMON_DETECTOR_MATH_H__ 4 | /* 5 | * Copyright 2012 ZXing authors All rights reserved. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #include 21 | 22 | namespace zxing { 23 | namespace common { 24 | namespace detector { 25 | 26 | class Math { 27 | private: 28 | Math(); 29 | ~Math(); 30 | public: 31 | 32 | // Java standard Math.round 33 | static inline int round(float a) { 34 | return (int)std::floor(a +0.5f); 35 | } 36 | 37 | }; 38 | 39 | } 40 | } 41 | } 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /deps/zxing/core/src/zxing/common/reedsolomon/ReedSolomonDecoder.h: -------------------------------------------------------------------------------- 1 | #ifndef __REED_SOLOMON_DECODER_H__ 2 | #define __REED_SOLOMON_DECODER_H__ 3 | 4 | /* 5 | * ReedSolomonDecoder.h 6 | * zxing 7 | * 8 | * Copyright 2010 ZXing authors All rights reserved. 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | namespace zxing { 31 | class GenericGFPoly; 32 | class GenericGF; 33 | 34 | class ReedSolomonDecoder { 35 | private: 36 | Ref field; 37 | public: 38 | ReedSolomonDecoder(Ref fld); 39 | ~ReedSolomonDecoder(); 40 | void decode(ArrayRef received, int twoS); 41 | std::vector > runEuclideanAlgorithm(Ref a, Ref b, int R); 42 | 43 | private: 44 | ArrayRef findErrorLocations(Ref errorLocator); 45 | ArrayRef findErrorMagnitudes(Ref errorEvaluator, ArrayRef errorLocations); 46 | }; 47 | } 48 | 49 | #endif // __REED_SOLOMON_DECODER_H__ 50 | -------------------------------------------------------------------------------- /deps/zxing/core/src/zxing/common/reedsolomon/ReedSolomonException.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * ReedSolomonException.cpp 3 | * zxing 4 | * 5 | * Created by Christian Brunschen on 06/05/2008. 6 | * Copyright 2008 Google UK. All rights reserved. 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #include 22 | 23 | namespace zxing { 24 | ReedSolomonException::ReedSolomonException(const char *msg) throw() : 25 | Exception(msg) { 26 | } 27 | ReedSolomonException::~ReedSolomonException() throw() { 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /deps/zxing/core/src/zxing/common/reedsolomon/ReedSolomonException.h: -------------------------------------------------------------------------------- 1 | #ifndef __REED_SOLOMON_EXCEPTION_H__ 2 | #define __REED_SOLOMON_EXCEPTION_H__ 3 | 4 | /* 5 | * ReedSolomonException.h 6 | * zxing 7 | * 8 | * Copyright 2010 ZXing authors All rights reserved. 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | #include 24 | 25 | namespace zxing { 26 | class ReedSolomonException : public Exception { 27 | public: 28 | ReedSolomonException(const char *msg) throw(); 29 | ~ReedSolomonException() throw(); 30 | }; 31 | } 32 | 33 | #endif // __REED_SOLOMON_EXCEPTION_H__ 34 | -------------------------------------------------------------------------------- /deps/zxing/core/src/zxing/datamatrix/DataMatrixReader.h: -------------------------------------------------------------------------------- 1 | #ifndef __DATA_MATRIX_READER_H__ 2 | #define __DATA_MATRIX_READER_H__ 3 | 4 | /* 5 | * DataMatrixReader.h 6 | * zxing 7 | * 8 | * Created by Luiz Silva on 09/02/2010. 9 | * Copyright 2010 ZXing authors All rights reserved. 10 | * 11 | * Licensed under the Apache License, Version 2.0 (the "License"); 12 | * you may not use this file except in compliance with the License. 13 | * You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, software 18 | * distributed under the License is distributed on an "AS IS" BASIS, 19 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | * See the License for the specific language governing permissions and 21 | * limitations under the License. 22 | */ 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | namespace zxing { 29 | namespace datamatrix { 30 | 31 | class DataMatrixReader : public Reader { 32 | private: 33 | Decoder decoder_; 34 | 35 | public: 36 | DataMatrixReader(); 37 | virtual Ref decode(Ref image, DecodeHints hints); 38 | virtual ~DataMatrixReader(); 39 | 40 | }; 41 | 42 | } 43 | } 44 | 45 | #endif // __DATA_MATRIX_READER_H__ 46 | -------------------------------------------------------------------------------- /deps/zxing/core/src/zxing/datamatrix/decoder/DataBlock.h: -------------------------------------------------------------------------------- 1 | #ifndef __DATA_BLOCK_DM_H__ 2 | #define __DATA_BLOCK_DM_H__ 3 | 4 | /* 5 | * DataBlock.h 6 | * zxing 7 | * 8 | * Created by Luiz Silva on 09/02/2010. 9 | * Copyright 2010 ZXing authors All rights reserved. 10 | * 11 | * Licensed under the Apache License, Version 2.0 (the "License"); 12 | * you may not use this file except in compliance with the License. 13 | * You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, software 18 | * distributed under the License is distributed on an "AS IS" BASIS, 19 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | * See the License for the specific language governing permissions and 21 | * limitations under the License. 22 | */ 23 | 24 | #include 25 | #include 26 | #include 27 | #include 28 | 29 | namespace zxing { 30 | namespace datamatrix { 31 | 32 | class DataBlock : public Counted { 33 | private: 34 | int numDataCodewords_; 35 | ArrayRef codewords_; 36 | 37 | DataBlock(int numDataCodewords, ArrayRef codewords); 38 | 39 | public: 40 | static std::vector > getDataBlocks(ArrayRef rawCodewords, Version *version); 41 | 42 | int getNumDataCodewords(); 43 | ArrayRef getCodewords(); 44 | }; 45 | 46 | } 47 | } 48 | 49 | #endif // __DATA_BLOCK_DM_H__ 50 | -------------------------------------------------------------------------------- /deps/zxing/core/src/zxing/datamatrix/decoder/Decoder.h: -------------------------------------------------------------------------------- 1 | #ifndef __DECODER_DM_H__ 2 | #define __DECODER_DM_H__ 3 | 4 | /* 5 | * Decoder.h 6 | * zxing 7 | * 8 | * Created by Luiz Silva on 09/02/2010. 9 | * Copyright 2010 ZXing authors All rights reserved. 10 | * 11 | * Licensed under the Apache License, Version 2.0 (the "License"); 12 | * you may not use this file except in compliance with the License. 13 | * You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, software 18 | * distributed under the License is distributed on an "AS IS" BASIS, 19 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | * See the License for the specific language governing permissions and 21 | * limitations under the License. 22 | */ 23 | 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | 31 | namespace zxing { 32 | namespace datamatrix { 33 | 34 | class Decoder { 35 | private: 36 | ReedSolomonDecoder rsDecoder_; 37 | 38 | void correctErrors(ArrayRef bytes, int numDataCodewords); 39 | 40 | public: 41 | Decoder(); 42 | 43 | Ref decode(Ref bits); 44 | }; 45 | 46 | } 47 | } 48 | 49 | #endif // __DECODER_DM_H__ 50 | -------------------------------------------------------------------------------- /deps/zxing/core/src/zxing/datamatrix/detector/CornerPoint.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * CornerPoint.cpp 3 | * zxing 4 | * 5 | * Created by Luiz Silva on 09/02/2010. 6 | * Copyright 2010 ZXing authors All rights reserved. 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #include 22 | 23 | 24 | namespace zxing { 25 | namespace datamatrix { 26 | 27 | using namespace std; 28 | 29 | CornerPoint::CornerPoint(float posX, float posY) : 30 | ResultPoint(posX,posY), counter_(0) { 31 | } 32 | 33 | int CornerPoint::getCount() const { 34 | return counter_; 35 | } 36 | 37 | void CornerPoint::incrementCount() { 38 | counter_++; 39 | } 40 | 41 | bool CornerPoint::equals(Ref other) const { 42 | return posX_ == other->getX() && posY_ == other->getY(); 43 | } 44 | 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /deps/zxing/core/src/zxing/datamatrix/detector/CornerPoint.h: -------------------------------------------------------------------------------- 1 | #ifndef __CORNER_FINDER_H__ 2 | #define __CORNER_FINDER_H__ 3 | 4 | /* 5 | * CornerPoint.h 6 | * zxing 7 | * 8 | * Created by Luiz Silva on 09/02/2010. 9 | * Copyright 2010 ZXing authors All rights reserved. 10 | * 11 | * Licensed under the Apache License, Version 2.0 (the "License"); 12 | * you may not use this file except in compliance with the License. 13 | * You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, software 18 | * distributed under the License is distributed on an "AS IS" BASIS, 19 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | * See the License for the specific language governing permissions and 21 | * limitations under the License. 22 | */ 23 | 24 | #include 25 | #include 26 | 27 | namespace zxing { 28 | namespace datamatrix { 29 | 30 | class CornerPoint : public ResultPoint { 31 | private: 32 | int counter_; 33 | 34 | public: 35 | CornerPoint(float posX, float posY); 36 | int getCount() const; 37 | void incrementCount(); 38 | bool equals(Ref other) const; 39 | }; 40 | } 41 | } 42 | 43 | #endif // __CORNER_FINDER_H__ 44 | -------------------------------------------------------------------------------- /deps/zxing/core/src/zxing/datamatrix/detector/DetectorException.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * DetectorException.cpp 3 | * 4 | * Created on: Aug 26, 2011 5 | * Author: luiz 6 | */ 7 | 8 | #include "DetectorException.h" 9 | 10 | namespace zxing { 11 | namespace datamatrix { 12 | 13 | DetectorException::DetectorException(const char *msg) : 14 | Exception(msg) { 15 | 16 | } 17 | 18 | DetectorException::~DetectorException() throw () { 19 | // TODO Auto-generated destructor stub 20 | } 21 | 22 | } 23 | } /* namespace zxing */ 24 | -------------------------------------------------------------------------------- /deps/zxing/core/src/zxing/datamatrix/detector/DetectorException.h: -------------------------------------------------------------------------------- 1 | /* 2 | * DetectorException.h 3 | * 4 | * Created on: Aug 26, 2011 5 | * Author: luiz 6 | */ 7 | 8 | #ifndef DETECTOREXCEPTION_H_ 9 | #define DETECTOREXCEPTION_H_ 10 | 11 | #include 12 | 13 | namespace zxing { 14 | namespace datamatrix { 15 | 16 | class DetectorException : public Exception { 17 | public: 18 | DetectorException(const char *msg); 19 | virtual ~DetectorException() throw(); 20 | }; 21 | } /* namespace nexxera */ 22 | } /* namespace zxing */ 23 | #endif /* DETECTOREXCEPTION_H_ */ 24 | -------------------------------------------------------------------------------- /deps/zxing/core/src/zxing/multi/ByQuadrantReader.h: -------------------------------------------------------------------------------- 1 | #ifndef __BY_QUADRANT_READER_H__ 2 | #define __BY_QUADRANT_READER_H__ 3 | 4 | /* 5 | * Copyright 2011 ZXing authors All rights reserved. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | namespace zxing { 26 | namespace multi { 27 | 28 | class ByQuadrantReader : public Reader { 29 | private: 30 | Reader& delegate_; 31 | 32 | public: 33 | ByQuadrantReader(Reader& delegate); 34 | virtual ~ByQuadrantReader(); 35 | virtual Ref decode(Ref image); 36 | virtual Ref decode(Ref image, DecodeHints hints); 37 | }; 38 | 39 | } 40 | } 41 | 42 | #endif // __BY_QUADRANT_READER_H__ 43 | -------------------------------------------------------------------------------- /deps/zxing/core/src/zxing/multi/MultipleBarcodeReader.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 ZXing authors All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include 18 | 19 | namespace zxing { 20 | namespace multi { 21 | 22 | MultipleBarcodeReader::~MultipleBarcodeReader() { } 23 | 24 | std::vector > MultipleBarcodeReader::decodeMultiple(Ref image) { 25 | return decodeMultiple(image, DecodeHints::DEFAULT_HINT); 26 | } 27 | 28 | } // End zxing::multi namespace 29 | } // End zxing namespace 30 | -------------------------------------------------------------------------------- /deps/zxing/core/src/zxing/multi/MultipleBarcodeReader.h: -------------------------------------------------------------------------------- 1 | #ifndef __MULTIPLE_BARCODE_READER_H__ 2 | #define __MULTIPLE_BARCODE_READER_H__ 3 | 4 | /* 5 | * Copyright 2011 ZXing authors All rights reserved. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | namespace zxing { 27 | namespace multi { 28 | 29 | class MultipleBarcodeReader : public Counted { 30 | protected: 31 | MultipleBarcodeReader() {} 32 | public: 33 | virtual std::vector > decodeMultiple(Ref image); 34 | virtual std::vector > decodeMultiple(Ref image, DecodeHints hints) = 0; 35 | virtual ~MultipleBarcodeReader(); 36 | }; 37 | 38 | } 39 | } 40 | 41 | #endif // __MULTIPLE_BARCODE_READER_H__ 42 | -------------------------------------------------------------------------------- /deps/zxing/core/src/zxing/multi/qrcode/QRCodeMultiReader.h: -------------------------------------------------------------------------------- 1 | #ifndef __QRCODE_MULTI_READER_H__ 2 | #define __QRCODE_MULTI_READER_H__ 3 | 4 | /* 5 | * Copyright 2011 ZXing authors All rights reserved. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #include 21 | #include 22 | 23 | namespace zxing { 24 | namespace multi { 25 | 26 | class QRCodeMultiReader: public zxing::qrcode::QRCodeReader, public MultipleBarcodeReader { 27 | public: 28 | QRCodeMultiReader(); 29 | virtual ~QRCodeMultiReader(); 30 | virtual std::vector > decodeMultiple(Ref image, DecodeHints hints); 31 | }; 32 | 33 | } 34 | } 35 | 36 | #endif // __QRCODE_MULTI_READER_H__ 37 | -------------------------------------------------------------------------------- /deps/zxing/core/src/zxing/multi/qrcode/detector/MultiDetector.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 ZXing authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include 18 | #include 19 | #include 20 | 21 | namespace zxing { 22 | namespace multi { 23 | using namespace zxing::qrcode; 24 | 25 | MultiDetector::MultiDetector(Ref image) : Detector(image) {} 26 | 27 | MultiDetector::~MultiDetector(){} 28 | 29 | std::vector > MultiDetector::detectMulti(DecodeHints hints){ 30 | Ref image = getImage(); 31 | MultiFinderPatternFinder finder = MultiFinderPatternFinder(image, hints.getResultPointCallback()); 32 | std::vector > info = finder.findMulti(hints); 33 | std::vector > result; 34 | for(unsigned int i = 0; i < info.size(); i++){ 35 | try{ 36 | result.push_back(processFinderPatternInfo(info[i])); 37 | } catch (ReaderException const& e){ 38 | (void)e; 39 | // ignore 40 | } 41 | } 42 | 43 | return result; 44 | } 45 | 46 | } // End zxing::multi namespace 47 | } // End zxing namespace 48 | -------------------------------------------------------------------------------- /deps/zxing/core/src/zxing/multi/qrcode/detector/MultiDetector.h: -------------------------------------------------------------------------------- 1 | #ifndef __MULTI_DETECTOR_H__ 2 | #define __MULTI_DETECTOR_H__ 3 | 4 | /* 5 | * Copyright 2011 ZXing authors 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | namespace zxing { 25 | namespace multi { 26 | 27 | class MultiDetector : public zxing::qrcode::Detector { 28 | public: 29 | MultiDetector(Ref image); 30 | virtual ~MultiDetector(); 31 | virtual std::vector > detectMulti(DecodeHints hints); 32 | }; 33 | 34 | } 35 | } 36 | 37 | #endif // __MULTI_DETECTOR_H__ 38 | -------------------------------------------------------------------------------- /deps/zxing/core/src/zxing/multi/qrcode/detector/MultiFinderPatternFinder.h: -------------------------------------------------------------------------------- 1 | #ifndef __MULTI_FINDER_PATTERN_FINDER_H__ 2 | #define __MULTI_FINDER_PATTERN_FINDER_H__ 3 | 4 | /* 5 | * Copyright 2011 ZXing authors 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | namespace zxing { 25 | namespace multi { 26 | 27 | class MultiFinderPatternFinder : zxing::qrcode::FinderPatternFinder { 28 | private: 29 | std::vector > > selectBestPatterns(); 30 | 31 | static const float MAX_MODULE_COUNT_PER_EDGE; 32 | static const float MIN_MODULE_COUNT_PER_EDGE; 33 | static const float DIFF_MODSIZE_CUTOFF_PERCENT; 34 | static const float DIFF_MODSIZE_CUTOFF; 35 | 36 | public: 37 | MultiFinderPatternFinder(Ref image, Ref resultPointCallback); 38 | virtual ~MultiFinderPatternFinder(); 39 | virtual std::vector > findMulti(DecodeHints const& hints); 40 | 41 | 42 | }; 43 | 44 | } 45 | } 46 | 47 | #endif // __MULTI_FINDER_PATTERN_FINDER_H__ 48 | -------------------------------------------------------------------------------- /deps/zxing/core/src/zxing/oned/CodaBarReader.h: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | #ifndef __CODA_BAR_READER_H__ 3 | #define __CODA_BAR_READER_H__ 4 | /* 5 | * Copyright 2010 ZXing authors All rights reserved. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | namespace zxing { 25 | namespace oned { 26 | 27 | class CodaBarReader : public OneDReader { 28 | private: 29 | static const int MAX_ACCEPTABLE; 30 | static const int PADDING; 31 | 32 | // Keep some instance variables to avoid reallocations 33 | std::string decodeRowResult; 34 | std::vector counters; 35 | int counterLength; 36 | 37 | public: 38 | CodaBarReader(); 39 | 40 | Ref decodeRow(int rowNumber, Ref row); 41 | 42 | void validatePattern(int start); 43 | 44 | private: 45 | void setCounters(Ref row); 46 | void counterAppend(int e); 47 | int findStartPattern(); 48 | 49 | static bool arrayContains(char const array[], char key); 50 | 51 | int toNarrowWidePattern(int position); 52 | }; 53 | 54 | } 55 | } 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /deps/zxing/core/src/zxing/oned/Code128Reader.h: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | #ifndef __CODE_128_READER_H__ 3 | #define __CODE_128_READER_H__ 4 | /* 5 | * Copyright 2010 ZXing authors All rights reserved. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | namespace zxing { 25 | namespace oned { 26 | 27 | class Code128Reader : public OneDReader { 28 | private: 29 | static const int MAX_AVG_VARIANCE; 30 | static const int MAX_INDIVIDUAL_VARIANCE; 31 | 32 | static std::vector findStartPattern(Ref row); 33 | static int decodeCode(Ref row, 34 | std::vector& counters, 35 | int rowOffset); 36 | 37 | public: 38 | Ref decodeRow(int rowNumber, Ref row); 39 | Code128Reader(); 40 | ~Code128Reader(); 41 | 42 | BarcodeFormat getBarcodeFormat(); 43 | }; 44 | 45 | } 46 | } 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /deps/zxing/core/src/zxing/oned/EAN13Reader.h: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | #ifndef __EAN_13_READER_H__ 3 | #define __EAN_13_READER_H__ 4 | 5 | /* 6 | * EAN13Reader.h 7 | * ZXing 8 | * 9 | * Copyright 2010 ZXing authors All rights reserved. 10 | * 11 | * Licensed under the Apache License, Version 2.0 (the "License"); 12 | * you may not use this file except in compliance with the License. 13 | * You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, software 18 | * distributed under the License is distributed on an "AS IS" BASIS, 19 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | * See the License for the specific language governing permissions and 21 | * limitations under the License. 22 | */ 23 | 24 | #include 25 | #include 26 | 27 | namespace zxing { 28 | namespace oned { 29 | 30 | class EAN13Reader : public UPCEANReader { 31 | private: 32 | std::vector decodeMiddleCounters; 33 | static void determineFirstDigit(std::string& resultString, 34 | int lgPatternFound); 35 | 36 | public: 37 | EAN13Reader(); 38 | 39 | int decodeMiddle(Ref row, 40 | Range const& startRange, 41 | std::string& resultString); 42 | 43 | BarcodeFormat getBarcodeFormat(); 44 | }; 45 | 46 | } 47 | } 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /deps/zxing/core/src/zxing/oned/EAN8Reader.h: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | #ifndef __EAN_8_READER_H__ 3 | #define __EAN_8_READER_H__ 4 | 5 | /* 6 | * EAN8Reader.h 7 | * ZXing 8 | * 9 | * Copyright 2010 ZXing authors All rights reserved. 10 | * 11 | * Licensed under the Apache License, Version 2.0 (the "License"); 12 | * you may not use this file except in compliance with the License. 13 | * You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, software 18 | * distributed under the License is distributed on an "AS IS" BASIS, 19 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | * See the License for the specific language governing permissions and 21 | * limitations under the License. 22 | */ 23 | 24 | #include 25 | #include 26 | 27 | namespace zxing { 28 | namespace oned { 29 | 30 | class EAN8Reader : public UPCEANReader { 31 | private: 32 | std::vector decodeMiddleCounters; 33 | 34 | public: 35 | EAN8Reader(); 36 | 37 | int decodeMiddle(Ref row, 38 | Range const& startRange, 39 | std::string& resultString); 40 | 41 | BarcodeFormat getBarcodeFormat(); 42 | }; 43 | 44 | } 45 | } 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /deps/zxing/core/src/zxing/oned/MultiFormatOneDReader.h: -------------------------------------------------------------------------------- 1 | #ifndef __MULTI_FORMAT_ONED_READER_H__ 2 | #define __MULTI_FORMAT_ONED_READER_H__ 3 | /* 4 | * MultiFormatOneDReader.h 5 | * ZXing 6 | * 7 | * Copyright 2010 ZXing authors All rights reserved. 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | */ 21 | 22 | #include 23 | 24 | namespace zxing { 25 | namespace oned { 26 | class MultiFormatOneDReader : public OneDReader { 27 | 28 | private: 29 | std::vector > readers; 30 | public: 31 | MultiFormatOneDReader(DecodeHints hints); 32 | 33 | Ref decodeRow(int rowNumber, Ref row); 34 | }; 35 | } 36 | } 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /deps/zxing/core/src/zxing/oned/MultiFormatUPCEANReader.h: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | #ifndef __MULTI_FORMAT_UPC_EAN_READER_H__ 3 | #define __MULTI_FORMAT_UPC_EAN_READER_H__ 4 | /* 5 | * MultiFormatUPCEANReader.h 6 | * ZXing 7 | * 8 | * Copyright 2010 ZXing authors All rights reserved. 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | #include 24 | 25 | namespace zxing { 26 | namespace oned { 27 | 28 | class UPCEANReader; 29 | 30 | class MultiFormatUPCEANReader : public OneDReader { 31 | private: 32 | std::vector< Ref > readers; 33 | public: 34 | MultiFormatUPCEANReader(DecodeHints hints); 35 | Ref decodeRow(int rowNumber, Ref row); 36 | }; 37 | 38 | } 39 | } 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /deps/zxing/core/src/zxing/oned/OneDResultPoint.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * OneDResultPoint.cpp 3 | * ZXing 4 | * 5 | * Copyright 2010 ZXing authors All rights reserved. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #include "OneDResultPoint.h" 21 | 22 | namespace zxing { 23 | namespace oned { 24 | 25 | OneDResultPoint::OneDResultPoint(float posX, float posY) : ResultPoint(posX,posY) { 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /deps/zxing/core/src/zxing/oned/OneDResultPoint.h: -------------------------------------------------------------------------------- 1 | #ifndef __ONED_RESULT_POINT_H__ 2 | #define __ONED_RESULT_POINT_H__ 3 | /* 4 | * OneDResultPoint.h 5 | * ZXing 6 | * 7 | * Copyright 2010 ZXing authors All rights reserved. 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | */ 21 | #include 22 | #include 23 | 24 | namespace zxing { 25 | namespace oned { 26 | 27 | class OneDResultPoint : public ResultPoint { 28 | 29 | public: 30 | OneDResultPoint(float posX, float posY); 31 | }; 32 | } 33 | } 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /deps/zxing/core/src/zxing/oned/UPCAReader.h: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | #ifndef __UPCA_READER_H__ 3 | #define __UPCA_READER_H__ 4 | /* 5 | * UPCAReader.h 6 | * ZXing 7 | * 8 | * Copyright 2010 ZXing authors All rights reserved. 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | #include 24 | #include 25 | 26 | namespace zxing { 27 | namespace oned { 28 | 29 | class UPCAReader : public UPCEANReader { 30 | 31 | private: 32 | EAN13Reader ean13Reader; 33 | static Ref maybeReturnResult(Ref result); 34 | 35 | public: 36 | UPCAReader(); 37 | 38 | int decodeMiddle(Ref row, Range const& startRange, std::string& resultString); 39 | 40 | Ref decodeRow(int rowNumber, Ref row); 41 | Ref decodeRow(int rowNumber, Ref row, Range const& startGuardRange); 42 | Ref decode(Ref image, DecodeHints hints); 43 | 44 | BarcodeFormat getBarcodeFormat(); 45 | }; 46 | 47 | } 48 | } 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /deps/zxing/core/src/zxing/oned/UPCEReader.h: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | #ifndef __UPC_E_READER_H__ 3 | #define __UPC_E_READER_H__ 4 | 5 | /* 6 | * Copyright 2010 ZXing authors All rights reserved. 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #include 22 | #include 23 | 24 | namespace zxing { 25 | namespace oned { 26 | 27 | class UPCEReader : public UPCEANReader { 28 | private: 29 | std::vector decodeMiddleCounters; 30 | static bool determineNumSysAndCheckDigit(std::string& resultString, int lgPatternFound); 31 | 32 | protected: 33 | Range decodeEnd(Ref row, int endStart); 34 | bool checkChecksum(Ref const& s); 35 | public: 36 | UPCEReader(); 37 | 38 | int decodeMiddle(Ref row, Range const& startRange, std::string& resultString); 39 | static Ref convertUPCEtoUPCA(Ref const& upce); 40 | 41 | BarcodeFormat getBarcodeFormat(); 42 | }; 43 | 44 | } 45 | } 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /deps/zxing/core/src/zxing/pdf417/PDF417Reader.h: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | #ifndef __PDF417_READER_H__ 3 | #define __PDF417_READER_H__ 4 | 5 | /* 6 | * PDF417Reader.h 7 | * zxing 8 | * 9 | * Copyright 2010,2012 ZXing authors All rights reserved. 10 | * 11 | * Licensed under the Apache License, Version 2.0 (the "License"); 12 | * you may not use this file except in compliance with the License. 13 | * You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, software 18 | * distributed under the License is distributed on an "AS IS" BASIS, 19 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | * See the License for the specific language governing permissions and 21 | * limitations under the License. 22 | */ 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | namespace zxing { 29 | namespace pdf417 { 30 | 31 | 32 | class PDF417Reader : public Reader { 33 | private: 34 | decoder::Decoder decoder; 35 | 36 | static Ref extractPureBits(Ref image); 37 | static int moduleSize(ArrayRef leftTopBlack, Ref image); 38 | static int findPatternStart(int x, int y, Ref image); 39 | static int findPatternEnd(int x, int y, Ref image); 40 | 41 | public: 42 | Ref decode(Ref image, DecodeHints hints); 43 | void reset(); 44 | }; 45 | 46 | } 47 | } 48 | 49 | #endif // __PDF417_READER_H__ 50 | -------------------------------------------------------------------------------- /deps/zxing/core/src/zxing/qrcode/ErrorCorrectionLevel.h: -------------------------------------------------------------------------------- 1 | #ifndef __ERROR_CORRECTION_LEVEL_H__ 2 | #define __ERROR_CORRECTION_LEVEL_H__ 3 | 4 | /* 5 | * ErrorCorrectionLevel.h 6 | * zxing 7 | * 8 | * Copyright 2010 ZXing authors All rights reserved. 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | #include 24 | 25 | namespace zxing { 26 | namespace qrcode { 27 | 28 | class ErrorCorrectionLevel { 29 | private: 30 | int ordinal_; 31 | int bits_; 32 | std::string name_; 33 | ErrorCorrectionLevel(int inOrdinal, int bits, char const* name); 34 | static ErrorCorrectionLevel *FOR_BITS[]; 35 | static int N_LEVELS; 36 | public: 37 | static ErrorCorrectionLevel L; 38 | static ErrorCorrectionLevel M; 39 | static ErrorCorrectionLevel Q; 40 | static ErrorCorrectionLevel H; 41 | 42 | int ordinal() const; 43 | int bits() const; 44 | std::string const& name() const; 45 | operator std::string const& () const; 46 | 47 | static ErrorCorrectionLevel& forBits(int bits); 48 | }; 49 | } 50 | } 51 | 52 | #endif // __ERROR_CORRECTION_LEVEL_H__ 53 | -------------------------------------------------------------------------------- /deps/zxing/core/src/zxing/qrcode/QRCodeReader.h: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | #ifndef __QR_CODE_READER_H__ 3 | #define __QR_CODE_READER_H__ 4 | 5 | /* 6 | * QRCodeReader.h 7 | * zxing 8 | * 9 | * Copyright 2010 ZXing authors All rights reserved. 10 | * 11 | * Licensed under the Apache License, Version 2.0 (the "License"); 12 | * you may not use this file except in compliance with the License. 13 | * You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, software 18 | * distributed under the License is distributed on an "AS IS" BASIS, 19 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | * See the License for the specific language governing permissions and 21 | * limitations under the License. 22 | */ 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | namespace zxing { 29 | namespace qrcode { 30 | 31 | class QRCodeReader : public Reader { 32 | private: 33 | Decoder decoder_; 34 | 35 | protected: 36 | Decoder& getDecoder(); 37 | 38 | public: 39 | QRCodeReader(); 40 | virtual ~QRCodeReader(); 41 | 42 | Ref decode(Ref image, DecodeHints hints); 43 | }; 44 | 45 | } 46 | } 47 | 48 | #endif // __QR_CODE_READER_H__ 49 | -------------------------------------------------------------------------------- /deps/zxing/core/src/zxing/qrcode/decoder/BitMatrixParser.h: -------------------------------------------------------------------------------- 1 | #ifndef __BIT_MATRIX_PARSER_H__ 2 | #define __BIT_MATRIX_PARSER_H__ 3 | 4 | /* 5 | * BitMatrixParser.h 6 | * zxing 7 | * 8 | * Copyright 2010 ZXing authors All rights reserved. 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | namespace zxing { 31 | namespace qrcode { 32 | 33 | class BitMatrixParser : public Counted { 34 | private: 35 | Ref bitMatrix_; 36 | Version *parsedVersion_; 37 | Ref parsedFormatInfo_; 38 | 39 | int copyBit(size_t x, size_t y, int versionBits); 40 | 41 | public: 42 | BitMatrixParser(Ref bitMatrix); 43 | Ref readFormatInformation(); 44 | Version *readVersion(); 45 | ArrayRef readCodewords(); 46 | 47 | private: 48 | BitMatrixParser(const BitMatrixParser&); 49 | BitMatrixParser& operator =(const BitMatrixParser&); 50 | 51 | }; 52 | 53 | } 54 | } 55 | 56 | #endif // __BIT_MATRIX_PARSER_H__ 57 | -------------------------------------------------------------------------------- /deps/zxing/core/src/zxing/qrcode/decoder/DataBlock.h: -------------------------------------------------------------------------------- 1 | #ifndef __DATA_BLOCK_H__ 2 | #define __DATA_BLOCK_H__ 3 | 4 | /* 5 | * DataBlock.h 6 | * zxing 7 | * 8 | * Copyright 2010 ZXing authors All rights reserved. 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | 29 | namespace zxing { 30 | namespace qrcode { 31 | 32 | class DataBlock : public Counted { 33 | private: 34 | int numDataCodewords_; 35 | ArrayRef codewords_; 36 | 37 | DataBlock(int numDataCodewords, ArrayRef codewords); 38 | 39 | public: 40 | static std::vector > 41 | getDataBlocks(ArrayRef rawCodewords, Version *version, ErrorCorrectionLevel &ecLevel); 42 | 43 | int getNumDataCodewords(); 44 | ArrayRef getCodewords(); 45 | }; 46 | 47 | } 48 | } 49 | 50 | #endif // __DATA_BLOCK_H__ 51 | -------------------------------------------------------------------------------- /deps/zxing/core/src/zxing/qrcode/decoder/DataMask.h: -------------------------------------------------------------------------------- 1 | #ifndef __DATA_MASK_H__ 2 | #define __DATA_MASK_H__ 3 | 4 | /* 5 | * DataMask.h 6 | * zxing 7 | * 8 | * Copyright 2010 ZXing authors All rights reserved. 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | #include 28 | 29 | namespace zxing { 30 | namespace qrcode { 31 | 32 | class DataMask : public Counted { 33 | private: 34 | static std::vector > DATA_MASKS; 35 | 36 | protected: 37 | 38 | public: 39 | static int buildDataMasks(); 40 | DataMask(); 41 | virtual ~DataMask(); 42 | void unmaskBitMatrix(BitMatrix& matrix, size_t dimension); 43 | virtual bool isMasked(size_t x, size_t y) = 0; 44 | static DataMask& forReference(int reference); 45 | }; 46 | 47 | } 48 | } 49 | 50 | #endif // __DATA_MASK_H__ 51 | -------------------------------------------------------------------------------- /deps/zxing/core/src/zxing/qrcode/decoder/Decoder.h: -------------------------------------------------------------------------------- 1 | #ifndef __DECODER_H__ 2 | #define __DECODER_H__ 3 | 4 | /* 5 | * Decoder.h 6 | * zxing 7 | * 8 | * Copyright 2010 ZXing authors All rights reserved. 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | 29 | namespace zxing { 30 | namespace qrcode { 31 | 32 | class Decoder { 33 | private: 34 | ReedSolomonDecoder rsDecoder_; 35 | 36 | void correctErrors(ArrayRef bytes, int numDataCodewords); 37 | 38 | public: 39 | Decoder(); 40 | Ref decode(Ref bits); 41 | }; 42 | 43 | } 44 | } 45 | 46 | #endif // __DECODER_H__ 47 | -------------------------------------------------------------------------------- /deps/zxing/core/src/zxing/qrcode/decoder/Mode.h: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | #ifndef __MODE_H__ 3 | #define __MODE_H__ 4 | 5 | /* 6 | * Mode.h 7 | * zxing 8 | * 9 | * Copyright 2010 ZXing authors All rights reserved. 10 | * 11 | * Licensed under the Apache License, Version 2.0 (the "License"); 12 | * you may not use this file except in compliance with the License. 13 | * You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, software 18 | * distributed under the License is distributed on an "AS IS" BASIS, 19 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | * See the License for the specific language governing permissions and 21 | * limitations under the License. 22 | */ 23 | 24 | #include 25 | #include 26 | 27 | namespace zxing { 28 | namespace qrcode { 29 | 30 | class Mode { 31 | private: 32 | int characterCountBitsForVersions0To9_; 33 | int characterCountBitsForVersions10To26_; 34 | int characterCountBitsForVersions27AndHigher_; 35 | std::string name_; 36 | 37 | Mode(int cbv0_9, int cbv10_26, int cbv27, int bits, char const* name); 38 | 39 | public: 40 | static Mode TERMINATOR; 41 | static Mode NUMERIC; 42 | static Mode ALPHANUMERIC; 43 | static Mode STRUCTURED_APPEND; 44 | static Mode BYTE; 45 | static Mode ECI; 46 | static Mode KANJI; 47 | static Mode FNC1_FIRST_POSITION; 48 | static Mode FNC1_SECOND_POSITION; 49 | static Mode HANZI; 50 | 51 | static Mode& forBits(int bits); 52 | int getCharacterCountBits(Version *version); 53 | }; 54 | } 55 | } 56 | 57 | #endif // __MODE_H__ 58 | -------------------------------------------------------------------------------- /deps/zxing/core/src/zxing/qrcode/detector/AlignmentPattern.h: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | 3 | #ifndef __ALIGNMENT_PATTERN_H__ 4 | #define __ALIGNMENT_PATTERN_H__ 5 | 6 | /* 7 | * AlignmentPattern.h 8 | * zxing 9 | * 10 | * Copyright 2010 ZXing authors All rights reserved. 11 | * 12 | * Licensed under the Apache License, Version 2.0 (the "License"); 13 | * you may not use this file except in compliance with the License. 14 | * You may obtain a copy of the License at 15 | * 16 | * http://www.apache.org/licenses/LICENSE-2.0 17 | * 18 | * Unless required by applicable law or agreed to in writing, software 19 | * distributed under the License is distributed on an "AS IS" BASIS, 20 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 21 | * See the License for the specific language governing permissions and 22 | * limitations under the License. 23 | */ 24 | 25 | #include 26 | #include 27 | 28 | namespace zxing { 29 | namespace qrcode { 30 | 31 | class AlignmentPattern : public ResultPoint { 32 | private: 33 | float estimatedModuleSize_; 34 | 35 | public: 36 | AlignmentPattern(float posX, float posY, float estimatedModuleSize); 37 | bool aboutEquals(float moduleSize, float i, float j) const; 38 | Ref combineEstimate(float i, float j, 39 | float newModuleSize) const; 40 | }; 41 | 42 | } 43 | } 44 | 45 | #endif // __ALIGNMENT_PATTERN_H__ 46 | -------------------------------------------------------------------------------- /deps/zxing/core/src/zxing/qrcode/detector/FinderPattern.h: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | #ifndef __FINDER_PATTERN_H__ 3 | #define __FINDER_PATTERN_H__ 4 | 5 | /* 6 | * FinderPattern.h 7 | * zxing 8 | * 9 | * Copyright 2010 ZXing authors All rights reserved. 10 | * 11 | * Licensed under the Apache License, Version 2.0 (the "License"); 12 | * you may not use this file except in compliance with the License. 13 | * You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, software 18 | * distributed under the License is distributed on an "AS IS" BASIS, 19 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | * See the License for the specific language governing permissions and 21 | * limitations under the License. 22 | */ 23 | 24 | #include 25 | #include 26 | 27 | namespace zxing { 28 | namespace qrcode { 29 | 30 | class FinderPattern : public ResultPoint { 31 | private: 32 | float estimatedModuleSize_; 33 | int count_; 34 | 35 | FinderPattern(float posX, float posY, float estimatedModuleSize, int count); 36 | 37 | public: 38 | FinderPattern(float posX, float posY, float estimatedModuleSize); 39 | int getCount() const; 40 | float getEstimatedModuleSize() const; 41 | void incrementCount(); 42 | bool aboutEquals(float moduleSize, float i, float j) const; 43 | Ref combineEstimate(float i, float j, float newModuleSize) const; 44 | }; 45 | } 46 | } 47 | 48 | #endif // __FINDER_PATTERN_H__ 49 | -------------------------------------------------------------------------------- /deps/zxing/core/src/zxing/qrcode/detector/FinderPatternInfo.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * FinderPatternInfo.cpp 3 | * zxing 4 | * 5 | * Created by Christian Brunschen on 13/05/2008. 6 | * Copyright 2008 ZXing authors All rights reserved. 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #include 22 | 23 | namespace zxing { 24 | namespace qrcode { 25 | 26 | FinderPatternInfo::FinderPatternInfo(std::vector > patternCenters) : 27 | bottomLeft_(patternCenters[0]), topLeft_(patternCenters[1]), topRight_(patternCenters[2]) { 28 | } 29 | 30 | Ref FinderPatternInfo::getBottomLeft() { 31 | return bottomLeft_; 32 | } 33 | Ref FinderPatternInfo::getTopLeft() { 34 | return topLeft_; 35 | } 36 | Ref FinderPatternInfo::getTopRight() { 37 | return topRight_; 38 | } 39 | 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /deps/zxing/core/src/zxing/qrcode/detector/FinderPatternInfo.h: -------------------------------------------------------------------------------- 1 | #ifndef __FINDER_PATTERN_INFO_H__ 2 | #define __FINDER_PATTERN_INFO_H__ 3 | 4 | /* 5 | * FinderPatternInfo.h 6 | * zxing 7 | * 8 | * Copyright 2010 ZXing authors All rights reserved. 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | namespace zxing { 29 | namespace qrcode { 30 | 31 | class FinderPatternInfo : public Counted { 32 | private: 33 | Ref bottomLeft_; 34 | Ref topLeft_; 35 | Ref topRight_; 36 | 37 | public: 38 | FinderPatternInfo(std::vector > patternCenters); 39 | 40 | Ref getBottomLeft(); 41 | Ref getTopLeft(); 42 | Ref getTopRight(); 43 | }; 44 | } 45 | } 46 | 47 | #endif // __FINDER_PATTERN_INFO_H__ 48 | -------------------------------------------------------------------------------- /lib/dv.js: -------------------------------------------------------------------------------- 1 | /* 2 | * node-dv - Document Vision for node.js 3 | * 4 | * Copyright (c) 2012 Christoph Schulz 5 | * Copyright (c) 2013-2015 creatale GmbH, contributors listed under AUTHORS 6 | * 7 | * MIT License 8 | */ 9 | var fs = require('fs'); 10 | var path = require('path'); 11 | var binding = require(__dirname + '/dvBinding.node'); 12 | 13 | // Wrap and export Tesseract. 14 | var Tesseract = exports.Tesseract = function(lang, image, tessdata) { 15 | tessdata = tessdata || require('dv.data').tessdata; 16 | var tess; 17 | if (typeof lang !== 'undefined' && lang !== null 18 | && typeof image !== 'undefined' && image !== null) { 19 | tess = new binding.Tesseract(tessdata, lang, image); 20 | } else if (typeof lang !== 'undefined' && lang !== null) { 21 | tess = new binding.Tesseract(tessdata, lang); 22 | } else { 23 | tess = new binding.Tesseract(tessdata); 24 | } 25 | tess.__proto__ = Tesseract.prototype; 26 | return tess; 27 | }; 28 | Tesseract.prototype = { 29 | __proto__: binding.Tesseract.prototype, 30 | constructor: Tesseract, 31 | }; 32 | 33 | // Export others. 34 | exports.Image = binding.Image; 35 | exports.ZXing = binding.ZXing; 36 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "dv", 3 | "version": "2.2.0", 4 | "description": "DocumentVision is a node.js library for processing and understanding scanned documents", 5 | "keywords": [ 6 | "graphics", 7 | "vision", 8 | "image", 9 | "images", 10 | "barcode", 11 | "barcodes", 12 | "ocr", 13 | "omr", 14 | "leptonica", 15 | "tesseract", 16 | "zxing" 17 | ], 18 | "homepage": "https://github.com/creatale/node-dv", 19 | "bugs": { 20 | "url": "https://github.com/creatale/node-dv/issues" 21 | }, 22 | "author": "creatale GmbH ", 23 | "contributors": [ 24 | "Christoph Schulz ", 25 | "Wolfgang Fellger ", 26 | "routix ", 27 | "Christian Dittrich ", 28 | "chrox ", 29 | "rashfael " 30 | ], 31 | "main": "./lib/dv", 32 | "repository": { 33 | "type": "git", 34 | "url": "git://github.com/creatale/node-dv.git" 35 | }, 36 | "scripts": { 37 | "postinstall": "node-gyp clean", 38 | "test": "mocha test" 39 | }, 40 | "dependencies": { 41 | "dv.data": "^1.4.0", 42 | "nan": "^2.10.0" 43 | }, 44 | "devDependencies": { 45 | "chai": "^4.1.2", 46 | "mocha": "^5.2.0" 47 | }, 48 | "optionalDependencies": { 49 | "windows-build-tools": "^3.1.0" 50 | }, 51 | "engines": { 52 | "node": ">=6" 53 | }, 54 | "license": "MIT" 55 | } 56 | -------------------------------------------------------------------------------- /src/module.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * node-dv - Document Vision for node.js 3 | * 4 | * Copyright (c) 2012 Christoph Schulz 5 | * Copyright (c) 2013-2015 creatale GmbH, contributors listed under AUTHORS 6 | * 7 | * MIT License 8 | */ 9 | #include // Side-effects required for VS build! 10 | #include 11 | #include "image.h" 12 | #include "tesseract.h" 13 | #include "zxing.h" 14 | 15 | NAN_MODULE_INIT(InitAll) 16 | { 17 | binding::Image::Init(target); 18 | binding::Tesseract::Init(target); 19 | binding::ZXing::Init(target); 20 | } 21 | 22 | NODE_MODULE(dvBinding, InitAll) 23 | -------------------------------------------------------------------------------- /src/util.h: -------------------------------------------------------------------------------- 1 | /* 2 | * node-dv - Document Vision for node.js 3 | * 4 | * Copyright (c) 2012 Christoph Schulz 5 | * Copyright (c) 2013-2015 creatale GmbH, contributors listed under AUTHORS 6 | * 7 | * MIT License 8 | */ 9 | #ifndef UTIL_H 10 | #define UTIL_H 11 | 12 | #include 13 | #include 14 | #include 15 | #include 16 | 17 | v8::Local createBox(Box* box); 18 | Box* toBox(Nan::NAN_METHOD_ARGS_TYPE args, int start, int* end = 0); 19 | int toOp(v8::Local value); 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /src/zxing.h: -------------------------------------------------------------------------------- 1 | /* 2 | * node-dv - Document Vision for node.js 3 | * 4 | * Copyright (c) 2012 Christoph Schulz 5 | * Copyright (c) 2013-2015 creatale GmbH, contributors listed under AUTHORS 6 | * 7 | * MIT License 8 | */ 9 | #ifndef ZXING_H 10 | #define ZXING_H 11 | 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | 18 | namespace binding { 19 | 20 | class ZXing : public Nan::ObjectWrap 21 | { 22 | public: 23 | static NAN_MODULE_INIT(Init); 24 | 25 | private: 26 | static NAN_METHOD(New); 27 | 28 | // Accessors. 29 | static NAN_GETTER(GetImage); 30 | static NAN_SETTER(SetImage); 31 | static NAN_GETTER(GetFormats); 32 | static NAN_SETTER(SetFormats); 33 | static NAN_GETTER(GetTryHarder); 34 | static NAN_SETTER(SetTryHarder); 35 | 36 | // Methods. 37 | static NAN_METHOD(FindCode); 38 | 39 | ZXing(); 40 | ~ZXing(); 41 | 42 | static const zxing::BarcodeFormat::Value BARCODEFORMATS[]; 43 | static const size_t BARCODEFORMATS_LENGTH; 44 | 45 | Nan::Persistent image_; 46 | zxing::DecodeHints hints_; 47 | zxing::Ref reader_; 48 | }; 49 | 50 | } 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /test/fixtures/barcode1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creatale/node-dv/6150a6daec48b7d73e33f7cb846e8fd1cd19a7c8/test/fixtures/barcode1.png -------------------------------------------------------------------------------- /test/fixtures/barcode2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creatale/node-dv/6150a6daec48b7d73e33f7cb846e8fd1cd19a7c8/test/fixtures/barcode2.png -------------------------------------------------------------------------------- /test/fixtures/barcode3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creatale/node-dv/6150a6daec48b7d73e33f7cb846e8fd1cd19a7c8/test/fixtures/barcode3.png -------------------------------------------------------------------------------- /test/fixtures/dave.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creatale/node-dv/6150a6daec48b7d73e33f7cb846e8fd1cd19a7c8/test/fixtures/dave.png -------------------------------------------------------------------------------- /test/fixtures/rgb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creatale/node-dv/6150a6daec48b7d73e33f7cb846e8fd1cd19a7c8/test/fixtures/rgb.jpg -------------------------------------------------------------------------------- /test/fixtures/rgba.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creatale/node-dv/6150a6daec48b7d73e33f7cb846e8fd1cd19a7c8/test/fixtures/rgba.png -------------------------------------------------------------------------------- /test/fixtures/textpage300.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creatale/node-dv/6150a6daec48b7d73e33f7cb846e8fd1cd19a7c8/test/fixtures/textpage300.png -------------------------------------------------------------------------------- /test/fixtures_out/.empty: -------------------------------------------------------------------------------- 1 | "" 2 | -------------------------------------------------------------------------------- /tools/glob.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # Script to generate a list of source files. 4 | # 5 | import fnmatch 6 | import sys 7 | import os 8 | 9 | matches = [] 10 | for root, dirnames, filenames in os.walk(sys.argv[1]): 11 | for filename in fnmatch.filter(filenames, '*.c') \ 12 | + fnmatch.filter(filenames, '*.cpp') \ 13 | + fnmatch.filter(filenames, '*.cc'): 14 | matches.append(os.path.normpath(os.path.join(root, filename)).replace('\\','/')) 15 | 16 | for match in sorted(matches): 17 | print " '" + match + "'," 18 | -------------------------------------------------------------------------------- /tools/update-authors.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # borrowed from: https://github.com/iojs/io.js/blob/v1.x/tools/update-authors.sh 3 | 4 | git log --reverse --format='%aN <%aE>' | perl -we ' 5 | 6 | BEGIN { 7 | %seen = (), @authors = (); 8 | } 9 | 10 | while (<>) { 11 | next if $seen{$_}; 12 | $seen{$_} = push @authors, $_; 13 | } 14 | 15 | END { 16 | print "# Authors ordered by first contribution.\n"; 17 | print "\n", @authors, "\n"; 18 | print "# Generated by tools/update-authors.sh\n"; 19 | } 20 | 21 | ' > AUTHORS 22 | --------------------------------------------------------------------------------