Skip to content

Commit

Permalink
* Switch from IntPointer to BoolPointer for the BOOL* pointer …
Browse files Browse the repository at this point in the history
…type of Leptonica (issue #36)

 * Add `preload` for `gif`, `jpeg`, `png`, `tiff`, and `webp` libraries in presets for Leptonica (issue #36)
  • Loading branch information
saudet committed Feb 14, 2015
1 parent 727acaf commit 16bf4ee
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 15 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@

* Switch from `IntPointer` to `BoolPointer` for the `BOOL*` pointer type of Leptonica ([issue #36](https://github.com/bytedeco/javacpp-presets/issues/36))
* Add `preload` for `gif`, `jpeg`, `png`, `tiff`, and `webp` libraries in presets for Leptonica ([issue #36](https://github.com/bytedeco/javacpp-presets/issues/36))
* Include missing `ltrresultiterator.h` header file in the presets for Tesseract ([issue #36](https://github.com/bytedeco/javacpp-presets/issues/36))
* Append `@Documented` to annotation types to have them picked up by Javadoc

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,15 @@
@Platform(include={"leptonica/alltypes.h", "leptonica/environ.h", "leptonica/array.h", "leptonica/bbuffer.h", "leptonica/heap.h", "leptonica/list.h",
"leptonica/ptra.h", "leptonica/queue.h", "leptonica/stack.h", "leptonica/arrayaccess.h", "leptonica/bmf.h", "leptonica/ccbord.h",
"leptonica/dewarp.h", "leptonica/gplot.h", "leptonica/imageio.h", "leptonica/jbclass.h", "leptonica/morph.h", "leptonica/pix.h",
"leptonica/recog.h", "leptonica/regutils.h", "leptonica/sudoku.h", "leptonica/watershed.h", "leptonica/allheaders.h"}, link="lept@.4"),
"leptonica/recog.h", "leptonica/regutils.h", "leptonica/sudoku.h", "leptonica/watershed.h", "leptonica/allheaders.h"}, link="lept@.4",
preloadpath="/usr/lib/", preload={"gif@.4", "jpeg@.62", "png16@.16", "tiff@.5", "webp@.5"}),
@Platform(value="linux-x86", preloadpath={"/usr/lib32/", "/usr/lib/"}),
@Platform(value="linux-x86_64", preloadpath={"/usr/lib64/", "/usr/lib/"}),
@Platform(value="android", link="lept"),
@Platform(value="windows", link="liblept", preload={"libwinpthread-1", "libgcc_s_sjlj-1", "libgcc_s_seh-1", "libstdc++-6",
"zlib1", "libgif-6", "libjpeg-62", "libpng16-16", "libtiff-5", "libwebp-5", "liblept-4"}),
@Platform(value="windows-x86", preloadpath={"C:/Program Files (x86)/mingw-w64/i686-4.9.1-posix-sjlj-rt_v3-rev3/mingw32/bin/"}),
@Platform(value="windows-x86_64", preloadpath={"C:/Program Files/mingw-w64/x86_64-4.9.1-posix-seh-rt_v3-rev3/mingw64/bin/"}) })
@Platform(value="windows-x86", preloadpath="C:/Program Files (x86)/mingw-w64/i686-4.9.1-posix-sjlj-rt_v3-rev3/mingw32/bin/"),
@Platform(value="windows-x86_64", preloadpath="C:/Program Files/mingw-w64/x86_64-4.9.1-posix-seh-rt_v3-rev3/mingw64/bin/") })
public class lept implements InfoMapper {
public void map(InfoMap infoMap) {
infoMap.put(new Info("LEPT_DLL", "L_END_LIST").cppTypes().annotations())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public void map(InfoMap infoMap) {
infoMap.put(new Info("__NATIVE__", "ultoa", "snprintf", "vsnprintf", "SIGNED",
"TESS_API", "TESS_LOCAL", "_TESS_FILE_BASENAME_", "TESS_CALL").cppTypes().annotations().cppText(""))
.put(new Info("STRING_IS_PROTECTED").define(false))
.put(new Info("BOOL").cast().valueTypes("boolean").pointerTypes("IntPointer").define())
.put(new Info("BOOL").cast().valueTypes("boolean").pointerTypes("BoolPointer").define())
.put(new Info("TESS_CAPI_INCLUDE_BASEAPI").define())
.put(new Info("MIN_INT32").javaText("public static final int MIN_INT32 = 0x80000000;"))

Expand Down
22 changes: 11 additions & 11 deletions tesseract/src/main/java/org/bytedeco/javacpp/tesseract.java
Original file line number Diff line number Diff line change
Expand Up @@ -4181,8 +4181,8 @@ public native void GetBlockTextOrientations(@ByPtrPtr int[] block_orientation,
public static native @Cast("BOOL") boolean TessBaseAPIGetIntVariable( @Const TessBaseAPI handle, String name, IntPointer value);
public static native @Cast("BOOL") boolean TessBaseAPIGetIntVariable( @Const TessBaseAPI handle, @Cast("const char*") BytePointer name, IntBuffer value);
public static native @Cast("BOOL") boolean TessBaseAPIGetIntVariable( @Const TessBaseAPI handle, String name, int[] value);
public static native @Cast("BOOL") boolean TessBaseAPIGetBoolVariable( @Const TessBaseAPI handle, @Cast("const char*") BytePointer name, @Cast("BOOL*") IntPointer value);
public static native @Cast("BOOL") boolean TessBaseAPIGetBoolVariable( @Const TessBaseAPI handle, String name, @Cast("BOOL*") IntPointer value);
public static native @Cast("BOOL") boolean TessBaseAPIGetBoolVariable( @Const TessBaseAPI handle, @Cast("const char*") BytePointer name, @Cast("BOOL*") BoolPointer value);
public static native @Cast("BOOL") boolean TessBaseAPIGetBoolVariable( @Const TessBaseAPI handle, String name, @Cast("BOOL*") BoolPointer value);
public static native @Cast("BOOL") boolean TessBaseAPIGetDoubleVariable(@Const TessBaseAPI handle, @Cast("const char*") BytePointer name, DoublePointer value);
public static native @Cast("BOOL") boolean TessBaseAPIGetDoubleVariable(@Const TessBaseAPI handle, String name, DoubleBuffer value);
public static native @Cast("BOOL") boolean TessBaseAPIGetDoubleVariable(@Const TessBaseAPI handle, @Cast("const char*") BytePointer name, double[] value);
Expand Down Expand Up @@ -4492,15 +4492,15 @@ public static native void TessPageIteratorOrientation(@Cast("TessPageIterator*")
public static native @Cast("char*") BytePointer TessResultIteratorGetUTF8Text(@Cast("const TessResultIterator*") ResultIterator handle, @Cast("TessPageIteratorLevel") int level);
public static native float TessResultIteratorConfidence(@Cast("const TessResultIterator*") ResultIterator handle, @Cast("TessPageIteratorLevel") int level);

public static native @Cast("const char*") BytePointer TessResultIteratorWordFontAttributes(@Cast("const TessResultIterator*") ResultIterator handle, @Cast("BOOL*") IntPointer is_bold, @Cast("BOOL*") IntPointer is_italic,
@Cast("BOOL*") IntPointer is_underlined, @Cast("BOOL*") IntPointer is_monospace, @Cast("BOOL*") IntPointer is_serif,
@Cast("BOOL*") IntPointer is_smallcaps, IntPointer pointsize, IntPointer font_id);
public static native String TessResultIteratorWordFontAttributes(@Cast("const TessResultIterator*") ResultIterator handle, @Cast("BOOL*") IntPointer is_bold, @Cast("BOOL*") IntPointer is_italic,
@Cast("BOOL*") IntPointer is_underlined, @Cast("BOOL*") IntPointer is_monospace, @Cast("BOOL*") IntPointer is_serif,
@Cast("BOOL*") IntPointer is_smallcaps, IntBuffer pointsize, IntBuffer font_id);
public static native @Cast("const char*") BytePointer TessResultIteratorWordFontAttributes(@Cast("const TessResultIterator*") ResultIterator handle, @Cast("BOOL*") IntPointer is_bold, @Cast("BOOL*") IntPointer is_italic,
@Cast("BOOL*") IntPointer is_underlined, @Cast("BOOL*") IntPointer is_monospace, @Cast("BOOL*") IntPointer is_serif,
@Cast("BOOL*") IntPointer is_smallcaps, int[] pointsize, int[] font_id);
public static native @Cast("const char*") BytePointer TessResultIteratorWordFontAttributes(@Cast("const TessResultIterator*") ResultIterator handle, @Cast("BOOL*") BoolPointer is_bold, @Cast("BOOL*") BoolPointer is_italic,
@Cast("BOOL*") BoolPointer is_underlined, @Cast("BOOL*") BoolPointer is_monospace, @Cast("BOOL*") BoolPointer is_serif,
@Cast("BOOL*") BoolPointer is_smallcaps, IntPointer pointsize, IntPointer font_id);
public static native String TessResultIteratorWordFontAttributes(@Cast("const TessResultIterator*") ResultIterator handle, @Cast("BOOL*") BoolPointer is_bold, @Cast("BOOL*") BoolPointer is_italic,
@Cast("BOOL*") BoolPointer is_underlined, @Cast("BOOL*") BoolPointer is_monospace, @Cast("BOOL*") BoolPointer is_serif,
@Cast("BOOL*") BoolPointer is_smallcaps, IntBuffer pointsize, IntBuffer font_id);
public static native @Cast("const char*") BytePointer TessResultIteratorWordFontAttributes(@Cast("const TessResultIterator*") ResultIterator handle, @Cast("BOOL*") BoolPointer is_bold, @Cast("BOOL*") BoolPointer is_italic,
@Cast("BOOL*") BoolPointer is_underlined, @Cast("BOOL*") BoolPointer is_monospace, @Cast("BOOL*") BoolPointer is_serif,
@Cast("BOOL*") BoolPointer is_smallcaps, int[] pointsize, int[] font_id);

public static native @Cast("BOOL") boolean TessResultIteratorWordIsFromDictionary(@Cast("const TessResultIterator*") ResultIterator handle);
public static native @Cast("BOOL") boolean TessResultIteratorWordIsNumeric(@Cast("const TessResultIterator*") ResultIterator handle);
Expand Down

0 comments on commit 16bf4ee

Please sign in to comment.