/***************************************************************************
                            QImage.cpp -  description
                             -------------------
    begin                : Wed Nov 21 17:05:56 2001
    copyright            : (C) 2000-2001 Lost Highway Ltd. All rights reserved.
    email                : Lost_Highway@tipitina.demon.co.uk
    generated by         : duke@tipitina on Wed Nov 21 17:05:56 2001, using kalyptus 0.9.
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
***************************************************************************/

#define _BOOL_H_
#include <qimage.h>
#include <qstring.h>
#include <qcstring.h>

#include <qtjava/QtSupport.h>
#include <qtjava/QImage.h>

class QImageJBridge : public QImage
{
public:
	QImageJBridge() : QImage() {}
	QImageJBridge(int width, int height, int depth, int numColors, Endian bitOrder) : QImage(width, height, depth, numColors, bitOrder) {}
	QImageJBridge(const QSize& arg1, int depth, int numColors, Endian bitOrder) : QImage(arg1, depth, numColors, bitOrder) {}
	QImageJBridge(const QString& fileName, const char* format) : QImage(fileName, format) {}
	QImageJBridge(const char* xpm[]) : QImage(xpm) {}
	QImageJBridge(const QByteArray& data) : QImage(data) {}
	QImageJBridge(uchar* data, int w, int h, int depth, QRgb* colortable, int numColors, Endian bitOrder) : QImage(data, w, h, depth, colortable, numColors, bitOrder) {}
//	QImageJBridge(uchar* data, int w, int h, int depth, int pbl, QRgb* colortable, int numColors, Endian bitOrder) : QImage(data, w, h, depth, pbl, colortable, numColors, bitOrder) {}
	QImageJBridge(const QImage& arg1) : QImage(arg1) {}
	~QImageJBridge() {QtSupport::qtKeyDeleted(this);}
};


JNIEXPORT void JNICALL
Java_org_kde_qt_QImage_newQImage__(JNIEnv *env, jobject obj)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QImageJBridge());
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QImage_newQImage__IIIII(JNIEnv *env, jobject obj, jint width, jint height, jint depth, jint numColors, jint bitOrder)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QImageJBridge((int) width, (int) height, (int) depth, (int) numColors, (QImage::Endian) bitOrder));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QImage_newQImage__III(JNIEnv *env, jobject obj, jint width, jint height, jint depth)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QImageJBridge((int) width, (int) height, (int) depth, 0, QImage::IgnoreEndian));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QImage_newQImage__Lorg_kde_qt_QSize_2III(JNIEnv *env, jobject obj, jobject arg1, jint depth, jint numColors, jint bitOrder)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QImageJBridge((QSize&) *(QSize *) QtSupport::getQt(env, arg1), (int) depth, (int) numColors, (QImage::Endian) bitOrder));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QImage_newQImage__Lorg_kde_qt_QSize_2I(JNIEnv *env, jobject obj, jobject arg1, jint depth)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QImageJBridge((QSize&) *(QSize *) QtSupport::getQt(env, arg1), (int) depth, 0, QImage::IgnoreEndian));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QImage_newQImage__Ljava_lang_String_2Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring fileName, jstring format)
{
static QCString * _qstring_format = 0;
static QString * _qstring_fileName = 0;
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QImageJBridge((QString&) * (QString *) QtSupport::toQString(env, fileName, &_qstring_fileName), (char*) QtSupport::toCharString(env, format, &_qstring_format)));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QImage_newQImage__Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring fileName)
{
static QString * _qstring_fileName = 0;
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QImageJBridge((QString&) * (QString *) QtSupport::toQString(env, fileName, &_qstring_fileName), 0));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QImage_newQImage___3Ljava_lang_String_2(JNIEnv *env, jobject obj, jobjectArray xpm)
{
static QCString * _qstring_xpm = 0;
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QImage((const char **) QtSupport::toStringArray(env, xpm)));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QImage_newQImage___3B(JNIEnv *env, jobject obj, jbyteArray data)
{
static QByteArray * _qbyteArray_data = 0;
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QImageJBridge((QByteArray&) * (QByteArray *) QtSupport::toQByteArray(env, data, &_qbyteArray_data)));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QImage_newQImage__Ljava_lang_String_2III_3III(JNIEnv *env, jobject obj, jstring data, jint w, jint h, jint depth, jintArray colortable, jint numColors, jint bitOrder)
{
static QCString * _qstring_data = 0;
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QImageJBridge((uchar*) QtSupport::toCharString(env, data, &_qstring_data), (int) w, (int) h, (int) depth,  (QRgb*) QtSupport::toIntPtr(env, colortable), (int) numColors, (QImage::Endian) bitOrder));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

//JNIEXPORT void JNICALL
//Java_org_kde_qt_QImage_newQImage__Ljava_lang_String_2IIII_3III(JNIEnv *env, jobject obj, jstring data, jint w, jint h, jint depth, jint pbl, jintArray colortable, jint numColors, jint bitOrder)
//{
//static QCString * _qstring_data = 0;
//	if (QtSupport::getQt(env, obj) == 0) {
//		QtSupport::setQt(env, obj, new QImageJBridge((uchar*) QtSupport::toCharString(env, data, &_qstring_data), (int) w, (int) h, (int) depth, (int) pbl,  (QRgb*) QtSupport::toIntPtr(env, colortable), (int) numColors, (QImage::Endian) bitOrder));
//		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
//	}
//	return;
//}

JNIEXPORT void JNICALL
Java_org_kde_qt_QImage_newQImage__Lorg_kde_qt_QImage_2(JNIEnv *env, jobject obj, jobject arg1)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QImageJBridge((QImage&) *(QImage *) QtSupport::getQt(env, arg1)));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QImage_finalize(JNIEnv *env, jobject obj)
{
	if (QtSupport::allocatedInJavaWorld(env, obj)) {
		delete (QImage*)QtSupport::getQt(env, obj);
		QtSupport::setQt(env, obj, 0);
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QImage_detach(JNIEnv *env, jobject obj)
{
	((QImageJBridge*) QtSupport::getQt(env, obj))->detach();
	return;
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QImage_copy__(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QImage (((QImageJBridge*) QtSupport::getQt(env, obj))->copy()), "org.kde.qt.QImage", TRUE);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QImage_copy__IIIII(JNIEnv *env, jobject obj, jint x, jint y, jint w, jint h, jint conversion_flags)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QImage (((QImageJBridge*) QtSupport::getQt(env, obj))->copy((int) x, (int) y, (int) w, (int) h, (int) conversion_flags)), "org.kde.qt.QImage", TRUE);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QImage_copy__IIII(JNIEnv *env, jobject obj, jint x, jint y, jint w, jint h)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QImage(((QImageJBridge*) QtSupport::getQt(env, obj))->copy((int) x, (int) y, (int) w, (int) h, 0)), "org.kde.qt.QImage", TRUE);
}

//JNIEXPORT jobject JNICALL
//Java_org_kde_qt_QImage_copy__Lorg_kde_qt_QRect_2(JNIEnv *env, jobject obj, jobject arg1)
//{
//	return (jobject) QtSupport::objectForQtKey(env, (void *)new QImage (((QImageJBridge*) QtSupport::getQt(env, obj))->copy((QRect&) *(QRect *) QtSupport::getQt(env, arg1))), "org.kde.qt.QImage", TRUE);
//}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QImage_isNull(JNIEnv *env, jobject obj)
{
	return (jboolean) ((QImageJBridge*) QtSupport::getQt(env, obj))->isNull();
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QImage_width(JNIEnv *env, jobject obj)
{
	return (jint) ((QImageJBridge*) QtSupport::getQt(env, obj))->width();
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QImage_height(JNIEnv *env, jobject obj)
{
	return (jint) ((QImageJBridge*) QtSupport::getQt(env, obj))->height();
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QImage_size(JNIEnv *env, jobject obj)
{
	QSize _s= ((QImageJBridge*) QtSupport::getQt(env, obj))->size();
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QSize(_s.width(),_s.height()), "org.kde.qt.QSize", TRUE);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QImage_rect(JNIEnv *env, jobject obj)
{
	QRect _r= ((QImageJBridge*) QtSupport::getQt(env, obj))->rect();
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QRect(_r.left(),_r.top(),_r.width(),_r.height()), "org.kde.qt.QRect", TRUE);
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QImage_depth(JNIEnv *env, jobject obj)
{
	return (jint) ((QImageJBridge*) QtSupport::getQt(env, obj))->depth();
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QImage_numColors(JNIEnv *env, jobject obj)
{
	return (jint) ((QImageJBridge*) QtSupport::getQt(env, obj))->numColors();
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QImage_bitOrder(JNIEnv *env, jobject obj)
{
	return (jint) ((QImageJBridge*) QtSupport::getQt(env, obj))->bitOrder();
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QImage_color(JNIEnv *env, jobject obj, jint i)
{
	return (jint) ((QImageJBridge*) QtSupport::getQt(env, obj))->color((int) i);
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QImage_setColor(JNIEnv *env, jobject obj, jint i, jint c)
{
	((QImageJBridge*) QtSupport::getQt(env, obj))->setColor((int) i, (QRgb) c);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QImage_setNumColors(JNIEnv *env, jobject obj, jint arg1)
{
	((QImageJBridge*) QtSupport::getQt(env, obj))->setNumColors((int) arg1);
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QImage_hasAlphaBuffer(JNIEnv *env, jobject obj)
{
	return (jboolean) ((QImageJBridge*) QtSupport::getQt(env, obj))->hasAlphaBuffer();
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QImage_setAlphaBuffer(JNIEnv *env, jobject obj, jboolean arg1)
{
	((QImageJBridge*) QtSupport::getQt(env, obj))->setAlphaBuffer((bool) arg1);
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QImage_allGray(JNIEnv *env, jobject obj)
{
	return (jboolean) ((QImageJBridge*) QtSupport::getQt(env, obj))->allGray();
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QImage_isGrayscale(JNIEnv *env, jobject obj)
{
	return (jboolean) ((QImageJBridge*) QtSupport::getQt(env, obj))->isGrayscale();
}

JNIEXPORT jbyteArray JNICALL
Java_org_kde_qt_QImage_bits(JNIEnv *env, jobject obj)
{
static uchar * ptr = 0;
	ptr = ((QImageJBridge*) QtSupport::getQt(env, obj))->bits();
	int len = ((QImageJBridge*) QtSupport::getQt(env, obj))->numBytes() / ((QImageJBridge*) QtSupport::getQt(env, obj))->height();
	jbyteArray result = env->NewByteArray(len);
	env->SetByteArrayRegion(result, 0, len, (jbyte *) ptr);
	return result;
}

JNIEXPORT jbyteArray JNICALL
Java_org_kde_qt_QImage_scanLine(JNIEnv *env, jobject obj, jint arg1)
{
static uchar * ptr = 0;
	ptr = ((QImageJBridge*) QtSupport::getQt(env, obj))->scanLine(arg1);
	int len = ((QImageJBridge*) QtSupport::getQt(env, obj))->numBytes() / ((QImageJBridge*) QtSupport::getQt(env, obj))->height();
	jbyteArray result = env->NewByteArray(len);
	env->SetByteArrayRegion(result, 0, len, (jbyte *) ptr);
	return result;
}

//JNIEXPORT jstring JNICALL
//Java_org_kde_qt_QImage_jumpTable(JNIEnv *env, jobject obj)
//{
//	uchar ** _qcstring;
//	_qcstring = (const char *)((QImageJBridge*) QtSupport::getQt(env, obj))->jumpTable();
//	return QtSupport::fromCharString(env, (char *) _qcstring);
//}

JNIEXPORT jintArray JNICALL
Java_org_kde_qt_QImage_colorTable(JNIEnv *env, jobject obj)
{
	return (jintArray) ((QImageJBridge*) QtSupport::getQt(env, obj))->colorTable();
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QImage_numBytes(JNIEnv *env, jobject obj)
{
	return (jint) ((QImageJBridge*) QtSupport::getQt(env, obj))->numBytes();
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QImage_bytesPerLine(JNIEnv *env, jobject obj)
{
	return (jint) ((QImageJBridge*) QtSupport::getQt(env, obj))->bytesPerLine();
}

//JNIEXPORT jobject JNICALL
//Java_org_kde_qt_QImage_graphicsContext(JNIEnv *env, jobject obj)
//{
//	return (jobject) QtSupport::objectForQtKey(env, (void *)((QImageJBridge*) QtSupport::getQt(env, obj))->graphicsContext(), "org.kde.qt.QGfx");
//}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QImage_create__IIIII(JNIEnv *env, jobject obj, jint width, jint height, jint depth, jint numColors, jint bitOrder)
{
	return (jboolean) ((QImageJBridge*) QtSupport::getQt(env, obj))->create((int) width, (int) height, (int) depth, (int) numColors, (QImage::Endian) bitOrder);
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QImage_create__III(JNIEnv *env, jobject obj, jint width, jint height, jint depth)
{
	return (jboolean) ((QImageJBridge*) QtSupport::getQt(env, obj))->create((int) width, (int) height, (int) depth, 0, QImage::IgnoreEndian);
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QImage_create__Lorg_kde_qt_QSize_2III(JNIEnv *env, jobject obj, jobject arg1, jint depth, jint numColors, jint bitOrder)
{
	return (jboolean) ((QImageJBridge*) QtSupport::getQt(env, obj))->create((QSize&) *(QSize *) QtSupport::getQt(env, arg1), (int) depth, (int) numColors, (QImage::Endian) bitOrder);
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QImage_create__Lorg_kde_qt_QSize_2I(JNIEnv *env, jobject obj, jobject arg1, jint depth)
{
	return (jboolean) ((QImageJBridge*) QtSupport::getQt(env, obj))->create((QSize&) *(QSize *) QtSupport::getQt(env, arg1), (int) depth, 0, QImage::IgnoreEndian);
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QImage_reset(JNIEnv *env, jobject obj)
{
	((QImageJBridge*) QtSupport::getQt(env, obj))->reset();
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QImage_fill(JNIEnv *env, jobject obj, jint pixel)
{
	((QImageJBridge*) QtSupport::getQt(env, obj))->fill((uint) pixel);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QImage_invertPixels__Z(JNIEnv *env, jobject obj, jboolean invertAlpha)
{
	((QImageJBridge*) QtSupport::getQt(env, obj))->invertPixels((bool) invertAlpha);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QImage_invertPixels__(JNIEnv *env, jobject obj)
{
	((QImageJBridge*) QtSupport::getQt(env, obj))->invertPixels(TRUE);
	return;
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QImage_convertDepth__I(JNIEnv *env, jobject obj, jint arg1)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QImage (((QImageJBridge*) QtSupport::getQt(env, obj))->convertDepth((int) arg1)), "org.kde.qt.QImage", TRUE);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QImage_convertDepthWithPalette__I_3III(JNIEnv *env, jobject obj, jint arg1, jintArray p, jint pc, jint cf)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QImage (((QImageJBridge*) QtSupport::getQt(env, obj))->convertDepthWithPalette((int) arg1,  (QRgb*) QtSupport::toIntPtr(env, p), (int) pc, (int) cf)), "org.kde.qt.QImage", TRUE);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QImage_convertDepthWithPalette__I_3II(JNIEnv *env, jobject obj, jint arg1, jintArray p, jint pc)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QImage(((QImageJBridge*) QtSupport::getQt(env, obj))->convertDepthWithPalette((int) arg1,  (QRgb*) QtSupport::toIntPtr(env, p), (int) pc, 0)), "org.kde.qt.QImage", TRUE);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QImage_convertDepth__II(JNIEnv *env, jobject obj, jint arg1, jint conversion_flags)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QImage (((QImageJBridge*) QtSupport::getQt(env, obj))->convertDepth((int) arg1, (int) conversion_flags)), "org.kde.qt.QImage", TRUE);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QImage_convertBitOrder(JNIEnv *env, jobject obj, jint arg1)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QImage (((QImageJBridge*) QtSupport::getQt(env, obj))->convertBitOrder((QImage::Endian) arg1)), "org.kde.qt.QImage", TRUE);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QImage_smoothScale__III(JNIEnv *env, jobject obj, jint w, jint h, jint mode)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QImage (((QImageJBridge*) QtSupport::getQt(env, obj))->smoothScale((int) w, (int) h, (QImage::ScaleMode) mode)), "org.kde.qt.QImage", TRUE);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QImage_smoothScale__II(JNIEnv *env, jobject obj, jint w, jint h)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QImage(((QImageJBridge*) QtSupport::getQt(env, obj))->smoothScale((int) w, (int) h, QImage::ScaleFree)), "org.kde.qt.QImage", TRUE);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QImage_smoothScale__Lorg_kde_qt_QSize_2I(JNIEnv *env, jobject obj, jobject s, jint mode)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QImage (((QImageJBridge*) QtSupport::getQt(env, obj))->smoothScale((QSize&) *(QSize *) QtSupport::getQt(env, s), (QImage::ScaleMode) mode)), "org.kde.qt.QImage", TRUE);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QImage_smoothScale__Lorg_kde_qt_QSize_2(JNIEnv *env, jobject obj, jobject s)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QImage(((QImageJBridge*) QtSupport::getQt(env, obj))->smoothScale((QSize&) *(QSize *) QtSupport::getQt(env, s), QImage::ScaleFree)), "org.kde.qt.QImage", TRUE);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QImage_scale__III(JNIEnv *env, jobject obj, jint w, jint h, jint mode)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QImage (((QImageJBridge*) QtSupport::getQt(env, obj))->scale((int) w, (int) h, (QImage::ScaleMode) mode)), "org.kde.qt.QImage", TRUE);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QImage_scale__II(JNIEnv *env, jobject obj, jint w, jint h)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QImage(((QImageJBridge*) QtSupport::getQt(env, obj))->scale((int) w, (int) h, QImage::ScaleFree)), "org.kde.qt.QImage", TRUE);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QImage_scale__Lorg_kde_qt_QSize_2I(JNIEnv *env, jobject obj, jobject s, jint mode)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QImage (((QImageJBridge*) QtSupport::getQt(env, obj))->scale((QSize&) *(QSize *) QtSupport::getQt(env, s), (QImage::ScaleMode) mode)), "org.kde.qt.QImage", TRUE);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QImage_scale__Lorg_kde_qt_QSize_2(JNIEnv *env, jobject obj, jobject s)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QImage(((QImageJBridge*) QtSupport::getQt(env, obj))->scale((QSize&) *(QSize *) QtSupport::getQt(env, s), QImage::ScaleFree)), "org.kde.qt.QImage", TRUE);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QImage_scaleWidth(JNIEnv *env, jobject obj, jint w)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QImage (((QImageJBridge*) QtSupport::getQt(env, obj))->scaleWidth((int) w)), "org.kde.qt.QImage", TRUE);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QImage_scaleHeight(JNIEnv *env, jobject obj, jint h)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QImage (((QImageJBridge*) QtSupport::getQt(env, obj))->scaleHeight((int) h)), "org.kde.qt.QImage", TRUE);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QImage_xForm(JNIEnv *env, jobject obj, jobject matrix)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QImage (((QImageJBridge*) QtSupport::getQt(env, obj))->xForm((QWMatrix&) *(QWMatrix *) QtSupport::getQt(env, matrix))), "org.kde.qt.QImage", TRUE);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QImage_createAlphaMask__I(JNIEnv *env, jobject obj, jint conversion_flags)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QImage (((QImageJBridge*) QtSupport::getQt(env, obj))->createAlphaMask((int) conversion_flags)), "org.kde.qt.QImage", TRUE);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QImage_createAlphaMask__(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QImage(((QImageJBridge*) QtSupport::getQt(env, obj))->createAlphaMask(0)), "org.kde.qt.QImage", TRUE);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QImage_createHeuristicMask__Z(JNIEnv *env, jobject obj, jboolean clipTight)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QImage (((QImageJBridge*) QtSupport::getQt(env, obj))->createHeuristicMask((bool) clipTight)), "org.kde.qt.QImage", TRUE);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QImage_createHeuristicMask__(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QImage(((QImageJBridge*) QtSupport::getQt(env, obj))->createHeuristicMask(TRUE)), "org.kde.qt.QImage", TRUE);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QImage_mirror__(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QImage (((QImageJBridge*) QtSupport::getQt(env, obj))->mirror()), "org.kde.qt.QImage", TRUE);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QImage_mirror__ZZ(JNIEnv *env, jobject obj, jboolean horizontally, jboolean vertically)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QImage (((QImageJBridge*) QtSupport::getQt(env, obj))->mirror((bool) horizontally, (bool) vertically)), "org.kde.qt.QImage", TRUE);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QImage_swapRGB(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QImage (((QImageJBridge*) QtSupport::getQt(env, obj))->swapRGB()), "org.kde.qt.QImage", TRUE);
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QImage_load__Ljava_lang_String_2Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring fileName, jstring format)
{
static QCString * _qstring_format = 0;
static QString * _qstring_fileName = 0;
	return (jboolean) ((QImageJBridge*) QtSupport::getQt(env, obj))->load((QString&) * (QString *) QtSupport::toQString(env, fileName, &_qstring_fileName), (char*) QtSupport::toCharString(env, format, &_qstring_format));
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QImage_load__Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring fileName)
{
static QString * _qstring_fileName = 0;
	return (jboolean) ((QImageJBridge*) QtSupport::getQt(env, obj))->load((QString&) * (QString *) QtSupport::toQString(env, fileName, &_qstring_fileName), 0);
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QImage_loadFromData___3BILjava_lang_String_2(JNIEnv *env, jobject obj, jbyteArray buf, jint len, jstring format)
{
static QCString * _qstring_format = 0;
static QByteArray * _qbyteArray_buf = 0;
	return (jboolean) ((QImageJBridge*) QtSupport::getQt(env, obj))->loadFromData((uchar*) (const char *) QtSupport::toQByteArray(env, buf, &_qbyteArray_buf), (uint) len, (char*) QtSupport::toCharString(env, format, &_qstring_format));
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QImage_loadFromData___3BI(JNIEnv *env, jobject obj, jbyteArray buf, jint len)
{
static QByteArray * _qbyteArray_buf = 0;
	return (jboolean) ((QImageJBridge*) QtSupport::getQt(env, obj))->loadFromData((uchar*) (const char *) QtSupport::toQByteArray(env, buf, &_qbyteArray_buf), (uint) len, 0);
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QImage_loadFromData___3CLjava_lang_String_2(JNIEnv *env, jobject obj, jcharArray data, jstring format)
{
static QCString * _qstring_format = 0;
static QByteArray * _qbyteArray_data = 0;
	return (jboolean) ((QImageJBridge*) QtSupport::getQt(env, obj))->loadFromData((uchar *) QtSupport::toUcharArray(env, data, &_qbyteArray_data), env->GetArrayLength(data), (char*) QtSupport::toCharString(env, format, &_qstring_format));
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QImage_loadFromData___3C(JNIEnv *env, jobject obj, jcharArray data)
{
static QByteArray * _qbyteArray_data = 0;
	return (jboolean) ((QImageJBridge*) QtSupport::getQt(env, obj))->loadFromData((uchar *) QtSupport::toUcharArray(env, data, &_qbyteArray_data), env->GetArrayLength(data), 0);
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QImage_save__Ljava_lang_String_2Ljava_lang_String_2I(JNIEnv *env, jobject obj, jstring fileName, jstring format, jint quality)
{
static QCString * _qstring_format = 0;
static QString * _qstring_fileName = 0;
	return (jboolean) ((QImageJBridge*) QtSupport::getQt(env, obj))->save((QString&) * (QString *) QtSupport::toQString(env, fileName, &_qstring_fileName), (char*) QtSupport::toCharString(env, format, &_qstring_format), (int) quality);
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QImage_save__Ljava_lang_String_2Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring fileName, jstring format)
{
static QCString * _qstring_format = 0;
static QString * _qstring_fileName = 0;
	return (jboolean) ((QImageJBridge*) QtSupport::getQt(env, obj))->save((QString&) * (QString *) QtSupport::toQString(env, fileName, &_qstring_fileName), (char*) QtSupport::toCharString(env, format, &_qstring_format), -1);
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QImage_valid(JNIEnv *env, jobject obj, jint x, jint y)
{
	return (jboolean) ((QImageJBridge*) QtSupport::getQt(env, obj))->valid((int) x, (int) y);
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QImage_pixelIndex(JNIEnv *env, jobject obj, jint x, jint y)
{
	return (jint) ((QImageJBridge*) QtSupport::getQt(env, obj))->pixelIndex((int) x, (int) y);
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QImage_pixel(JNIEnv *env, jobject obj, jint x, jint y)
{
	return (jint) ((QImageJBridge*) QtSupport::getQt(env, obj))->pixel((int) x, (int) y);
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QImage_setPixel(JNIEnv *env, jobject obj, jint x, jint y, jint index_or_rgb)
{
	((QImageJBridge*) QtSupport::getQt(env, obj))->setPixel((int) x, (int) y, (uint) index_or_rgb);
	return;
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QImage_dotsPerMeterX(JNIEnv *env, jobject obj)
{
	return (jint) ((QImageJBridge*) QtSupport::getQt(env, obj))->dotsPerMeterX();
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QImage_dotsPerMeterY(JNIEnv *env, jobject obj)
{
	return (jint) ((QImageJBridge*) QtSupport::getQt(env, obj))->dotsPerMeterY();
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QImage_setDotsPerMeterX(JNIEnv *env, jobject obj, jint arg1)
{
	((QImageJBridge*) QtSupport::getQt(env, obj))->setDotsPerMeterX((int) arg1);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QImage_setDotsPerMeterY(JNIEnv *env, jobject obj, jint arg1)
{
	((QImageJBridge*) QtSupport::getQt(env, obj))->setDotsPerMeterY((int) arg1);
	return;
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QImage_offset(JNIEnv *env, jobject obj)
{
	QPoint _p= ((QImageJBridge*) QtSupport::getQt(env, obj))->offset();
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QPoint(_p.x(),_p.y()), "org.kde.qt.QPoint", TRUE);
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QImage_setOffset(JNIEnv *env, jobject obj, jobject arg1)
{
	((QImageJBridge*) QtSupport::getQt(env, obj))->setOffset((QPoint&) *(QPoint *) QtSupport::getQt(env, arg1));
	return;
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QImage_textLanguages(JNIEnv *env, jobject obj)
{
	QStringList  _qlist;
	_qlist = ((QImageJBridge*) QtSupport::getQt(env, obj))->textLanguages();
	return (jobject) QtSupport::arrayWithQStringList(env, (QStringList *) &_qlist);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QImage_textKeys(JNIEnv *env, jobject obj)
{
	QStringList  _qlist;
	_qlist = ((QImageJBridge*) QtSupport::getQt(env, obj))->textKeys();
	return (jobject) QtSupport::arrayWithQStringList(env, (QStringList *) &_qlist);
}

JNIEXPORT jstring JNICALL
Java_org_kde_qt_QImage_text__Ljava_lang_String_2Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring key, jstring lang)
{
	QString  _qstring;
static QCString * _qstring_lang = 0;
static QCString * _qstring_key = 0;
	_qstring = ((QImageJBridge*) QtSupport::getQt(env, obj))->text((char*) QtSupport::toCharString(env, key, &_qstring_key), (char*) QtSupport::toCharString(env, lang, &_qstring_lang));
	return QtSupport::fromQString(env, &_qstring);
}

JNIEXPORT jstring JNICALL
Java_org_kde_qt_QImage_text__Lorg_kde_qt_QImageTextKeyLang_2(JNIEnv *env, jobject obj, jobject arg1)
{
	QString  _qstring;
	_qstring = ((QImageJBridge*) QtSupport::getQt(env, obj))->text((QImageTextKeyLang&) *(QImageTextKeyLang *) QtSupport::getQt(env, arg1));
	return QtSupport::fromQString(env, &_qstring);
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QImage_setText(JNIEnv *env, jobject obj, jstring key, jstring lang, jstring arg1)
{
static QString * _qstring_arg1 = 0;
static QCString * _qstring_lang = 0;
static QCString * _qstring_key = 0;
	((QImageJBridge*) QtSupport::getQt(env, obj))->setText((char*) QtSupport::toCharString(env, key, &_qstring_key), (char*) QtSupport::toCharString(env, lang, &_qstring_lang), (QString&) * (QString *) QtSupport::toQString(env, arg1, &_qstring_arg1));
	return;
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QImage_systemBitOrder(JNIEnv *env, jclass obj)
{
	return (jint) QImageJBridge::systemBitOrder();
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QImage_systemByteOrder(JNIEnv *env, jclass obj)
{
	return (jint) QImageJBridge::systemByteOrder();
}

JNIEXPORT jstring JNICALL
Java_org_kde_qt_QImage_imageFormat(JNIEnv *env, jclass obj, jstring fileName)
{
	 const char*  _qcstring;
static QString * _qstring_fileName = 0;
	_qcstring = (const char *)QImageJBridge::imageFormat((QString&) * (QString *) QtSupport::toQString(env, fileName, &_qstring_fileName));
	return QtSupport::fromCharString(env, (char *) _qcstring);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QImage_inputFormats(JNIEnv *env, jclass obj)
{
	QStrList  _qlist;
	_qlist = QImageJBridge::inputFormats();
	return (jobject) QtSupport::arrayWithQStrList(env, (QStrList *) &_qlist);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QImage_outputFormats(JNIEnv *env, jclass obj)
{
	QStrList  _qlist;
	_qlist = QImageJBridge::outputFormats();
	return (jobject) QtSupport::arrayWithQStrList(env, (QStrList *) &_qlist);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QImage_inputFormatList(JNIEnv *env, jclass obj)
{
	QStringList  _qlist;
	_qlist = QImageJBridge::inputFormatList();
	return (jobject) QtSupport::arrayWithQStringList(env, (QStringList *) &_qlist);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QImage_outputFormatList(JNIEnv *env, jclass obj)
{
	QStringList  _qlist;
	_qlist = QImageJBridge::outputFormatList();
	return (jobject) QtSupport::arrayWithQStringList(env, (QStringList *) &_qlist);
}

