diff --git a/build.xml b/build.xml index f31014cc..332c3b26 100644 --- a/build.xml +++ b/build.xml @@ -419,6 +419,7 @@ + diff --git a/platform_build/win32_ms_cmdline/build-devil.bat b/platform_build/win32_ms_cmdline/build-devil.bat index 0ac81d18..1be6ec6e 100644 --- a/platform_build/win32_ms_cmdline/build-devil.bat +++ b/platform_build/win32_ms_cmdline/build-devil.bat @@ -6,7 +6,7 @@ if "%CHOME%" == "" goto errorchome if "%DEVILHOME%" == "" goto errordevilhome set COPTIONS=/I"%DEVILHOME%\include" /I"%PLTSDKHOME%\include" /I"%CHOME%\include" /I"%JAVA_HOME%\include" /I"%JAVA_HOME%\include\win32" /I"..\..\src\native\common" /Ox /Ob2 /Oi /Ot /Oy /FD /EHsc /MT /Gy /W0 /nologo /c /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "LWJGL_EXPORTS" /D "_WINDLL" set LINKEROPTS=/link /LIBPATH:"%PLTSDKHOME%\Lib" /LIBPATH:"%CHOME%\Lib" /LIBPATH:"%DEVILHOME%\Lib" /SUBSYSTEM:WINDOWS /OPT:REF /OPT:ICF /MACHINE:X86 /NOLOGO /DLL -set LIBS=user32.lib Gdi32.lib Advapi32.lib DevIL.lib +set LIBS=user32.lib Gdi32.lib Advapi32.lib ILU.lib DevIL.lib for %%x in (..\..\src\native\common\devil\*.c) do cl %COPTIONS% %%x for %%x in (..\..\src\native\common\*common*.c) do cl %COPTIONS% %%x diff --git a/res/ILtest.bmp b/res/ILtest.bmp new file mode 100644 index 00000000..a0966d94 Binary files /dev/null and b/res/ILtest.bmp differ diff --git a/res/ILtest.gif b/res/ILtest.gif new file mode 100644 index 00000000..749c909e Binary files /dev/null and b/res/ILtest.gif differ diff --git a/res/ILtest.jpg b/res/ILtest.jpg new file mode 100644 index 00000000..08dd27ee Binary files /dev/null and b/res/ILtest.jpg differ diff --git a/res/ILtest.tga b/res/ILtest.tga new file mode 100644 index 00000000..ff73305f Binary files /dev/null and b/res/ILtest.tga differ diff --git a/src/java/org/lwjgl/devil/ILU.java b/src/java/org/lwjgl/devil/ILU.java new file mode 100644 index 00000000..7d4d158e --- /dev/null +++ b/src/java/org/lwjgl/devil/ILU.java @@ -0,0 +1,179 @@ +/* + * Copyright (c) 2002-2004 LWJGL Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of 'LWJGL' nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package org.lwjgl.devil; + +import java.nio.IntBuffer; + +import org.lwjgl.BufferChecks; +import org.lwjgl.LWJGLException; + +/** + * @author Mark Bernard + * date: 3-Jan-2005 + */ +public class ILU { + /** Have we been created? */ + protected static boolean created; + + public static final int ILU_VERSION_1_6_7 = 1; + public static final int ILU_VERSION = 167; + + public static final int ILU_FILTER = 0x2600; + public static final int ILU_NEAREST = 0x2601; + public static final int ILU_LINEAR = 0x2602; + public static final int ILU_BILINEAR = 0x2603; + public static final int ILU_SCALE_BOX = 0x2604; + public static final int ILU_SCALE_TRIANGLE = 0x2605; + public static final int ILU_SCALE_BELL = 0x2606; + public static final int ILU_SCALE_BSPLINE = 0x2607; + public static final int ILU_SCALE_LANCZOS3 = 0x2608; + public static final int ILU_SCALE_MITCHELL = 0x2609; + +// Error types + public static final int ILU_INVALID_ENUM = 0x0501; + public static final int ILU_OUT_OF_MEMORY = 0x0502; + public static final int ILU_INTERNAL_ERROR = 0x0504; + public static final int ILU_INVALID_VALUE = 0x0505; + public static final int ILU_ILLEGAL_OPERATION = 0x0506; + public static final int ILU_INVALID_PARAM = 0x0509; + +// Values + public static final int ILU_PLACEMENT = 0x0700; + public static final int ILU_LOWER_LEFT = 0x0701; + public static final int ILU_LOWER_RIGHT = 0x0702; + public static final int ILU_UPPER_LEFT = 0x0703; + public static final int ILU_UPPER_RIGHT = 0x0704; + public static final int ILU_CENTER = 0x0705; + public static final int ILU_CONVOLUTION_MATRIX = 0x0710; +// public static final int ILU_VERSION_NUM = IL_VERSION_NUM; +// public static final int ILU_VENDOR = IL_VENDOR; + + static { + System.loadLibrary("ILU"); + System.loadLibrary("lwjgl-devil"); + } + + /** + * @return true if DevIL has been created + */ + public static boolean isCreated() { + return created; + } + + public static native void initNativeStubs() throws LWJGLException; + + public static native boolean iluAlienify(); + public static native boolean iluBlurAvg(int iter); + public static native boolean iluBlurGaussian(int iter); + public static native boolean iluBuildMipmaps(); + public static native int iluColoursUsed(); + public static native boolean iluCompareImage(int comp); + public static native boolean iluContrast(float contrast); + public static native boolean iluCrop(int xOff, int yOff, int zOff, int width, int height, int depth); + public static native void iluDeleteImage(int id); + public static native boolean iluEdgeDetectE(); + public static native boolean iluEdgeDetectP(); + public static native boolean iluEdgeDetectS(); + public static native boolean iluEmboss(); + public static native boolean iluEnlargeCanvas(int width, int height, int depth); + public static native boolean iluEnlargeImage(float xDim, float yDim, float zDim); + public static native boolean iluEqualize(); + public static native String iluErrorString(int error); + public static native boolean iluFlipImage(); + public static native boolean iluGammaCorrect(float gamma); + public static native int iluGenImage(); + // TODO result placed in a pointer + // TODO implement +// public static native void iluGetImageInfo(ILinfo info[]); + public static native int iluGetInteger(int mode); + public static void iluGetIntegerv(int mode, IntBuffer param) { + BufferChecks.checkDirect(param); + niluGetIntegerv(mode, param, param.position()); + } + public static native void niluGetIntegerv(int mode, IntBuffer param, int param_offset); + public static native String iluGetString(int stringName); + public static native void iluImageParameter(int pName, int param); + public static native void iluInit(); + public static native boolean iluInvertAlpha(); + public static native int iluLoadImage(String fileName); + public static native boolean iluMirror(); + public static native boolean iluNegative(); + public static native boolean iluNoisify(float tolerance); + public static native boolean iluPixelize(int pixSize); + // TODO result placed in a pointer + // TODO implement +// public static native void iluRegionfv(ILpointf points[], int n); + // TODO result placed in a pointer + // TODO implement +// public static native void iluRegioniv(ILpointi points[], int n); + public static native boolean iluReplaceColour(byte red, byte green, byte blue, float tolerance); + public static native boolean iluRotate(float angle); + + // TODO Not implemented in the native lib +// public static native boolean iluRotate3D(float x, float y, float z, float Angle); + public static native boolean iluSaturate1f(float saturation); + public static native boolean iluSaturate4f(float r, float g, float b, float saturation); + public static native boolean iluScale(int width, int height, int depth); + public static native boolean iluScaleColours(float r, float g, float b); + public static native boolean iluSharpen(float factor, int iter); + public static native boolean iluSwapColours(); + public static native boolean iluWave(float angle); + /** + * + */ + public static void create() throws LWJGLException { + if (!created) { + nCreate(); + ILU.initNativeStubs(); + ILU.iluInit(); + created = true; + } + + } + + public static native void nCreate(); + + //DevIL lib allows both spellings of colour. + //Will do the same this way. + public static void iluColorsUsed() { + iluColoursUsed(); + } + public static void iluSwapColors() { + iluSwapColours(); + } + public static void iluReplaceColor(byte red, byte green, byte blue, float tolerance) { + iluReplaceColour(red, green, blue, tolerance); + } + public static void iluScaleColors(float r, float g, float b) { + iluScaleColours(r, g, b); + } +} diff --git a/src/java/org/lwjgl/devil/ILinfo.java b/src/java/org/lwjgl/devil/ILinfo.java new file mode 100644 index 00000000..31563321 --- /dev/null +++ b/src/java/org/lwjgl/devil/ILinfo.java @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2002-2004 LWJGL Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of 'LWJGL' nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package org.lwjgl.devil; + +/** + * @author Mark Bernard + * date: 3-Jan-2005 + */ +public class ILinfo { + public int Id; // the image's id + public byte Data[]; // the image's data + public int Width; // the image's width + public int Height; // the image's height + public int Depth; // the image's depth + public byte Bpp; // bytes per pixel (not bits) of the image + public int SizeOfData; // the total size of the data (in bytes) + public int Format; // image format (in IL enum style) + public int Type; // image type (in IL enum style) + public int Origin; // origin of the image + public byte Palette[]; // the image's palette + public int PalType; // palette type + public int PalSize; // palette size + public int CubeFlags; // flags for what cube map sides are present + public int NumNext; // number of images following + public int NumMips; // number of mipmaps + public int NumLayers; // number of layers +} diff --git a/src/java/org/lwjgl/devil/ILpointf.java b/src/java/org/lwjgl/devil/ILpointf.java new file mode 100644 index 00000000..c80f06d7 --- /dev/null +++ b/src/java/org/lwjgl/devil/ILpointf.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2002-2004 LWJGL Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of 'LWJGL' nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package org.lwjgl.devil; + +/** + * @author Mark Bernard + * date: 3-Jan-2005 + */ +public class ILpointf { + public float x; + public float y; +} diff --git a/src/java/org/lwjgl/devil/ILpointi.java b/src/java/org/lwjgl/devil/ILpointi.java new file mode 100644 index 00000000..de6a50d5 --- /dev/null +++ b/src/java/org/lwjgl/devil/ILpointi.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2002-2004 LWJGL Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of 'LWJGL' nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package org.lwjgl.devil; + +/** + * @author Mark Bernard + * date: 3-Jan-2005 + */ +public class ILpointi { + public int x; + public int y; +} diff --git a/src/java/org/lwjgl/test/devil/BasicTest.java b/src/java/org/lwjgl/test/devil/BasicTest.java index 29b9beef..6d569f65 100644 --- a/src/java/org/lwjgl/test/devil/BasicTest.java +++ b/src/java/org/lwjgl/test/devil/BasicTest.java @@ -33,6 +33,7 @@ package org.lwjgl.test.devil; import org.lwjgl.devil.*; +import java.net.URL; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.IntBuffer; @@ -47,31 +48,35 @@ public class BasicTest { public static void main(String args[]) { try { IL.create(); + ILU.create(); } catch(Exception e) { e.printStackTrace(); System.exit(0); } - int err = IL.ilGetError(); + String err = ILU.iluErrorString(IL.ilGetError()); System.out.println("err = " + err + " IL_NO_ERROR = " + IL.IL_NO_ERROR); System.out.println("ilGenImages"); IntBuffer im = ByteBuffer.allocateDirect(4).order(ByteOrder.nativeOrder()).asIntBuffer(); IL.ilGenImages(1, im); System.out.println("ilBindImage"); IL.ilBindImage(im.get(0)); - err = IL.ilGetError(); + IL.ilEnable(IL.IL_ORIGIN_SET); + IL.ilOriginFunc(IL.IL_ORIGIN_UPPER_LEFT); + err = ILU.iluErrorString(IL.ilGetError()); System.out.println("err = " + err + " IL_NO_ERROR = " + IL.IL_NO_ERROR); String imageFile = "F:/Apps/Java/eclipse/workspace/LWJGL/res/ILtest.tga"; - System.out.println("ilLoadImage " + imageFile); - System.out.println("load lump = " + IL.ilLoadFromURL(BasicTest.class.getResource("/res/ILtest.tga"))); - err = IL.ilGetError(); + URL imageURL = BasicTest.class.getResource("/res/ILtest.tga"); + System.out.println("ilLoadFromURL " + imageURL); + System.out.println("load lump = " + IL.ilLoadFromURL(imageURL)); + err = ILU.iluErrorString(IL.ilGetError()); System.out.println("err = " + err + " IL_NO_ERROR = " + IL.IL_NO_ERROR); int newIm = IL.ilCloneCurImage(); IL.ilCopyImage(im.get(0)); IL.ilBindImage(newIm); ByteBuffer buf = IL.ilGetData(); System.out.println("ilGetData"); - err = IL.ilGetError(); + err = ILU.iluErrorString(IL.ilGetError()); System.out.println("err = " + err + " IL_NO_ERROR = " + IL.IL_NO_ERROR); int limit = buf.limit(); System.out.println("limit = " + limit); @@ -81,7 +86,7 @@ public class BasicTest { System.out.println("current image = " + im.get(0) + " IL.ilGetInteger(IL.IL_ACTIVE_IMAGE) = " + IL.ilGetInteger(IL.IL_ACTIVE_IMAGE)); System.out.println("Version: " + IL.ilGetInteger(IL.IL_VERSION_NUM)); - err = IL.ilGetError(); + err = ILU.iluErrorString(IL.ilGetError()); System.out.println("err = " + err + " IL_NO_ERROR = " + IL.IL_NO_ERROR); } } diff --git a/src/native/common/devil/extil.h b/src/native/common/devil/extil.h index d08c790b..36a64ed3 100644 --- a/src/native/common/devil/extil.h +++ b/src/native/common/devil/extil.h @@ -5,7 +5,9 @@ #include #include #include +#include #include "org_lwjgl_devil_IL.h" +#include "org_lwjgl_devil_ILU.h" #include "common_tools.h" diff --git a/src/native/common/devil/org_lwjgl_devil_ILU.c b/src/native/common/devil/org_lwjgl_devil_ILU.c new file mode 100644 index 00000000..db3c3624 --- /dev/null +++ b/src/native/common/devil/org_lwjgl_devil_ILU.c @@ -0,0 +1,423 @@ +#include "extil.h" + +/* + * Class: org_lwjgl_devil_ILU + * Method: iluAlienify + * Signature: ()Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_devil_ILU_iluAlienify(JNIEnv *env, jclass clazz) { + return iluAlienify(); +} + +/* + * Class: org_lwjgl_devil_ILU + * Method: iluBlurAvg + * Signature: (I)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_devil_ILU_iluBlurAvg(JNIEnv *env, jclass clazz, jint iter) { + return iluBlurAvg((ILuint)iter); +} + +/* + * Class: org_lwjgl_devil_ILU + * Method: iluBlurGaussian + * Signature: (I)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_devil_ILU_iluBlurGaussian(JNIEnv *env, jclass clazz, jint iter) { + return iluBlurGaussian((ILuint)iter); +} + +/* + * Class: org_lwjgl_devil_ILU + * Method: iluBuildMipmaps + * Signature: ()Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_devil_ILU_iluBuildMipmaps(JNIEnv *env, jclass clazz) { + return iluBuildMipmaps(); +} + +/* + * Class: org_lwjgl_devil_ILU + * Method: iluColoursUsed + * Signature: ()I + */ +JNIEXPORT jint JNICALL Java_org_lwjgl_devil_ILU_iluColoursUsed(JNIEnv *env, jclass clazz) { + return iluColoursUsed(); +} + +/* + * Class: org_lwjgl_devil_ILU + * Method: iluCompareImage + * Signature: (I)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_devil_ILU_iluCompareImage(JNIEnv *env, jclass clazz, jint comp) { + return iluCompareImage((ILuint)comp); +} + +/* + * Class: org_lwjgl_devil_ILU + * Method: iluContrast + * Signature: (F)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_devil_ILU_iluContrast(JNIEnv *env, jclass clazz, jfloat contrast) { + return iluContrast((ILfloat)contrast); +} + +/* + * Class: org_lwjgl_devil_ILU + * Method: iluCrop + * Signature: (IIIIII)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_devil_ILU_iluCrop(JNIEnv *env, jclass clazz, jint xOff, jint yOff, jint zOff, jint width, jint height, jint depth) { + return iluCrop((ILuint)xOff, (ILuint)yOff, (ILuint)zOff, (ILuint)width, (ILuint)height, (ILuint)depth); +} + +/* + * Class: org_lwjgl_devil_ILU + * Method: iluDeleteImage + * Signature: (I)V + */ +JNIEXPORT void JNICALL Java_org_lwjgl_devil_ILU_iluDeleteImage(JNIEnv *env, jclass clazz, jint id) { + iluDeleteImage((ILuint)id); +} + +/* + * Class: org_lwjgl_devil_ILU + * Method: iluEdgeDetectE + * Signature: ()Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_devil_ILU_iluEdgeDetectE(JNIEnv *env, jclass clazz) { + return iluEdgeDetectE(); +} + +/* + * Class: org_lwjgl_devil_ILU + * Method: iluEdgeDetectP + * Signature: ()Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_devil_ILU_iluEdgeDetectP(JNIEnv *env, jclass clazz) { + return iluEdgeDetectP(); +} + +/* + * Class: org_lwjgl_devil_ILU + * Method: iluEdgeDetectS + * Signature: ()Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_devil_ILU_iluEdgeDetectS(JNIEnv *env, jclass clazz) { + return iluEdgeDetectS(); +} + +/* + * Class: org_lwjgl_devil_ILU + * Method: iluEmboss + * Signature: ()Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_devil_ILU_iluEmboss(JNIEnv *env, jclass clazz) { + return iluEmboss(); +} + +/* + * Class: org_lwjgl_devil_ILU + * Method: iluEnlargeCanvas + * Signature: (III)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_devil_ILU_iluEnlargeCanvas(JNIEnv *env, jclass clazz, jint width, jint height, jint depth) { + return iluEnlargeCanvas((ILuint)width, (ILuint)height, (ILuint)depth); +} + +/* + * Class: org_lwjgl_devil_ILU + * Method: iluEnlargeImage + * Signature: (FFF)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_devil_ILU_iluEnlargeImage(JNIEnv *env, jclass clazz, jfloat xDim, jfloat yDim, jfloat zDim) { + return iluEnlargeImage((ILfloat)xDim, (ILfloat)yDim, (ILfloat)zDim); +} + +/* + * Class: org_lwjgl_devil_ILU + * Method: iluEqualize + * Signature: ()Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_devil_ILU_iluEqualize(JNIEnv *env, jclass clazz) { + return iluEqualize(); +} + +/* + * Class: org_lwjgl_devil_ILU + * Method: iluErrorString + * Signature: (I)Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_org_lwjgl_devil_ILU_iluErrorString(JNIEnv *env, jclass clazz, jint error) { + return NewStringNative(env, iluErrorString((ILenum)error)); +} + +/* + * Class: org_lwjgl_devil_ILU + * Method: iluFlipImage + * Signature: ()Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_devil_ILU_iluFlipImage(JNIEnv *env, jclass clazz) { + return iluFlipImage(); +} + +/* + * Class: org_lwjgl_devil_ILU + * Method: iluGammaCorrect + * Signature: (F)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_devil_ILU_iluGammaCorrect(JNIEnv *env, jclass clazz, jfloat gamma) { + return iluGammaCorrect((ILfloat)gamma); +} + +/* + * Class: org_lwjgl_devil_ILU + * Method: iluGenImage + * Signature: ()I + */ +JNIEXPORT jint JNICALL Java_org_lwjgl_devil_ILU_iluGenImage(JNIEnv *env, jclass clazz) { + return iluGenImage(); +} + +/* + * Class: org_lwjgl_devil_ILU + * Method: iluGetImageInfo + * Signature: ([Lorg/lwjgl/devil/ILinfo;)V + */ +JNIEXPORT void JNICALL Java_org_lwjgl_devil_ILU_iluGetImageInfo(JNIEnv *env, jclass clazz, jobjectArray info) { +} + +/* + * Class: org_lwjgl_devil_ILU + * Method: iluGetInteger + * Signature: (I)I + */ +JNIEXPORT jint JNICALL Java_org_lwjgl_devil_ILU_iluGetInteger(JNIEnv *env, jclass clazz, jint mode) { + return iluGetInteger((ILenum)mode); +} + +/* + * Class: org_lwjgl_devil_ILU + * Method: iluGetIntegerv + * Signature: (ILjava/nio/IntBuffer;)V + */ +JNIEXPORT void JNICALL Java_org_lwjgl_devil_ILU_iluGetIntegerv(JNIEnv *env, jclass clazz, jint mode, jobject param_buffer, jint param_offset) { + ILbyte *lists = (ILbyte *) safeGetBufferAddress(env, param_buffer, param_offset); + ilGenImages((ILsizei)mode, (ILuint *)lists); +} + +/* + * Class: org_lwjgl_devil_ILU + * Method: iluGetString + * Signature: (I)Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_org_lwjgl_devil_ILU_iluGetString(JNIEnv *env, jclass clazz, jint stringName) { + return NewStringNative(env, iluGetString((ILenum)stringName)); +} + +/* + * Class: org_lwjgl_devil_ILU + * Method: iluImageParameter + * Signature: (II)V + */ +JNIEXPORT void JNICALL Java_org_lwjgl_devil_ILU_iluImageParameter(JNIEnv *env, jclass clazz, jint pName, jint param) { + iluImageParameter((ILenum)pName, (ILenum)param); +} + +/* + * Class: org_lwjgl_devil_ILU + * Method: iluInit + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_lwjgl_devil_ILU_iluInit(JNIEnv *env, jclass clazz) { + iluInit(); +} + +/* + * Class: org_lwjgl_devil_ILU + * Method: iluInvertAlpha + * Signature: ()Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_devil_ILU_iluInvertAlpha(JNIEnv *env, jclass clazz) { + return iluInvertAlpha(); +} + +/* + * Class: org_lwjgl_devil_ILU + * Method: iluLoadImage + * Signature: (Ljava/lang/String;)I + */ +JNIEXPORT jint JNICALL Java_org_lwjgl_devil_ILU_iluLoadImage(JNIEnv *env, jclass clazz, jstring fileName) { + char *strFileName = GetStringNativeChars(env, fileName); + jint result = iluLoadImage((const ILstring)strFileName); + free(strFileName); + + return result; +} + +/* + * Class: org_lwjgl_devil_ILU + * Method: iluMirror + * Signature: ()Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_devil_ILU_iluMirror(JNIEnv *env, jclass clazz) { + return iluMirror(); +} + +/* + * Class: org_lwjgl_devil_ILU + * Method: iluNegative + * Signature: ()Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_devil_ILU_iluNegative(JNIEnv *env, jclass clazz) { + return iluNegative(); +} + +/* + * Class: org_lwjgl_devil_ILU + * Method: iluNoisify + * Signature: (F)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_devil_ILU_iluNoisify(JNIEnv *env, jclass clazz, jfloat factor) { + return iluNoisify((ILclampf)factor); +} + +/* + * Class: org_lwjgl_devil_ILU + * Method: iluPixelize + * Signature: (I)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_devil_ILU_iluPixelize(JNIEnv *env, jclass clazz, jint pixSize) { + return iluPixelize((ILuint)pixSize); +} + +/* + * Class: org_lwjgl_devil_ILU + * Method: iluRegionfv + * Signature: ([Lorg/lwjgl/devil/ILpointf;I)V + */ +JNIEXPORT void JNICALL Java_org_lwjgl_devil_ILU_iluRegionfv(JNIEnv *env, jclass clazz, jobjectArray points, jint n) { +} + +/* + * Class: org_lwjgl_devil_ILU + * Method: iluRegioniv + * Signature: ([Lorg/lwjgl/devil/ILpointi;I)V + */ +JNIEXPORT void JNICALL Java_org_lwjgl_devil_ILU_iluRegioniv(JNIEnv *env, jclass clazz, jobjectArray points, jint n) { +} + +/* + * Class: org_lwjgl_devil_ILU + * Method: iluReplaceColour + * Signature: (BBBF)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_devil_ILU_iluReplaceColour(JNIEnv *env, jclass clazz, jbyte red, jbyte green, jbyte blue, jfloat tolerence) { +} + +/* + * Class: org_lwjgl_devil_ILU + * Method: iluRotate + * Signature: (F)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_devil_ILU_iluRotate(JNIEnv *env, jclass clazz, jfloat angle) { + return iluRotate((ILfloat)angle); +} + +/* + * Class: org_lwjgl_devil_ILU + * Method: iluSaturate1f + * Signature: (F)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_devil_ILU_iluSaturate1f(JNIEnv *env, jclass clazz, jfloat saturation) { + return iluSaturate1f((ILfloat)saturation); +} + +/* + * Class: org_lwjgl_devil_ILU + * Method: iluSaturate4f + * Signature: (FFFF)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_devil_ILU_iluSaturate4f(JNIEnv *env, jclass clazz, jfloat r, jfloat g, jfloat b, jfloat saturation) { + return iluSaturate4f((ILfloat)r, (ILfloat)g, (ILfloat)b, (ILfloat)saturation); +} + +/* + * Class: org_lwjgl_devil_ILU + * Method: iluScale + * Signature: (III)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_devil_ILU_iluScale(JNIEnv *env, jclass clazz, jint width, jint height, jint depth) { + return iluScale((ILuint)width, (ILuint)height, (ILuint)depth); +} + +/* + * Class: org_lwjgl_devil_ILU + * Method: iluScaleColours + * Signature: (FFF)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_devil_ILU_iluScaleColours(JNIEnv *env, jclass clazz, jfloat r, jfloat g, jfloat b) { + return iluScaleColours((ILfloat)r, (ILfloat)g, (ILfloat)b); +} + +/* + * Class: org_lwjgl_devil_ILU + * Method: iluSharpen + * Signature: (FI)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_devil_ILU_iluSharpen(JNIEnv *env, jclass clazz, jfloat factor, jint iter) { + return iluSharpen((ILfloat)factor, (ILuint)iter); +} + +/* + * Class: org_lwjgl_devil_ILU + * Method: iluSwapColours + * Signature: ()Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_devil_ILU_iluSwapColours(JNIEnv *env, jclass clazz) { + return iluSwapColours(); +} + +/* + * Class: org_lwjgl_devil_ILU + * Method: iluWave + * Signature: (F)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_devil_ILU_iluWave(JNIEnv *env, jclass clazz, jfloat wave) { + return iluWave((ILfloat)wave); +} + +/* + * Class: org_lwjgl_devil_ILU + * Method: nCreate + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_lwjgl_devil_ILU_nCreate(JNIEnv *env, jclass clazz) { + /*if (!extilu_Open(env)) { + throwException(env, "Failed to load DevIL library"); + return; + }*/ +} + +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_lwjgl_devil_ILU + * Method: initNativeStubs + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_lwjgl_devil_ILU_initNativeStubs(JNIEnv *env, jclass clazz) { +/* + JavaMethodAndExtFunction functions[] = { + {"iluAlienify", "()Z", (void*)&Java_org_lwjgl_devil_IL_iluAlienify, "iluAlienify", (void*)&iluAlienify}, + }; + int num_functions = NUMFUNCTIONS(functions); + extil_InitializeClass(env, clazz, num_functions, functions); +*/ +} + +#ifdef __cplusplus +} +#endif