#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "qimage.h" #include "gen_qimage.h" #include "_cgo_export.h" QImage* QImage_new() { return new QImage(); } QImage* QImage_new2(QSize* size, uintptr_t format) { return new QImage(*size, static_cast(format)); } QImage* QImage_new3(int width, int height, uintptr_t format) { return new QImage(static_cast(width), static_cast(height), static_cast(format)); } QImage* QImage_new4(unsigned char* data, int width, int height, uintptr_t format) { return new QImage(static_cast(data), static_cast(width), static_cast(height), static_cast(format)); } QImage* QImage_new5(const unsigned char* data, int width, int height, uintptr_t format) { return new QImage(static_cast(data), static_cast(width), static_cast(height), static_cast(format)); } QImage* QImage_new6(unsigned char* data, int width, int height, int bytesPerLine, uintptr_t format) { return new QImage(static_cast(data), static_cast(width), static_cast(height), static_cast(bytesPerLine), static_cast(format)); } QImage* QImage_new7(const unsigned char* data, int width, int height, int bytesPerLine, uintptr_t format) { return new QImage(static_cast(data), static_cast(width), static_cast(height), static_cast(bytesPerLine), static_cast(format)); } QImage* QImage_new8(struct miqt_string* fileName) { QString fileName_QString = QString::fromUtf8(&fileName->data, fileName->len); return new QImage(fileName_QString); } QImage* QImage_new9(QImage* param1) { return new QImage(*param1); } QImage* QImage_new10(struct miqt_string* fileName, const char* format) { QString fileName_QString = QString::fromUtf8(&fileName->data, fileName->len); return new QImage(fileName_QString, format); } void QImage_OperatorAssign(QImage* self, QImage* param1) { self->operator=(*param1); } void QImage_Swap(QImage* self, QImage* other) { self->swap(*other); } bool QImage_IsNull(const QImage* self) { return self->isNull(); } int QImage_DevType(const QImage* self) { return self->devType(); } bool QImage_OperatorEqual(const QImage* self, QImage* param1) { return self->operator==(*param1); } bool QImage_OperatorNotEqual(const QImage* self, QImage* param1) { return self->operator!=(*param1); } void QImage_Detach(QImage* self) { self->detach(); } bool QImage_IsDetached(const QImage* self) { return self->isDetached(); } QImage* QImage_Copy(const QImage* self) { QImage _ret = self->copy(); // Copy-construct value returned type into heap-allocated copy return static_cast(new QImage(_ret)); } QImage* QImage_Copy2(const QImage* self, int x, int y, int w, int h) { QImage _ret = self->copy(static_cast(x), static_cast(y), static_cast(w), static_cast(h)); // Copy-construct value returned type into heap-allocated copy return static_cast(new QImage(_ret)); } uintptr_t QImage_Format(const QImage* self) { QImage::Format _ret = self->format(); return static_cast(_ret); } QImage* QImage_ConvertToFormat(const QImage* self, uintptr_t f) { QImage _ret = self->convertToFormat(static_cast(f)); // Copy-construct value returned type into heap-allocated copy return static_cast(new QImage(_ret)); } QImage* QImage_ConvertToFormat2(const QImage* self, uintptr_t f, struct miqt_array* /* of unsigned int */ colorTable) { QVector colorTable_QList; colorTable_QList.reserve(colorTable->len); unsigned int* colorTable_arr = static_cast(colorTable->data); for(size_t i = 0; i < colorTable->len; ++i) { colorTable_QList.push_back(colorTable_arr[i]); } QImage _ret = self->convertToFormat(static_cast(f), colorTable_QList); // Copy-construct value returned type into heap-allocated copy return static_cast(new QImage(_ret)); } bool QImage_ReinterpretAsFormat(QImage* self, uintptr_t f) { return self->reinterpretAsFormat(static_cast(f)); } void QImage_ConvertTo(QImage* self, uintptr_t f) { self->convertTo(static_cast(f)); } int QImage_Width(const QImage* self) { return self->width(); } int QImage_Height(const QImage* self) { return self->height(); } QSize* QImage_Size(const QImage* self) { QSize _ret = self->size(); // Copy-construct value returned type into heap-allocated copy return static_cast(new QSize(_ret)); } QRect* QImage_Rect(const QImage* self) { QRect _ret = self->rect(); // Copy-construct value returned type into heap-allocated copy return static_cast(new QRect(_ret)); } int QImage_Depth(const QImage* self) { return self->depth(); } int QImage_ColorCount(const QImage* self) { return self->colorCount(); } int QImage_BitPlaneCount(const QImage* self) { return self->bitPlaneCount(); } unsigned int QImage_Color(const QImage* self, int i) { return self->color(static_cast(i)); } void QImage_SetColor(QImage* self, int i, unsigned int c) { self->setColor(static_cast(i), static_cast(c)); } void QImage_SetColorCount(QImage* self, int colorCount) { self->setColorCount(static_cast(colorCount)); } bool QImage_AllGray(const QImage* self) { return self->allGray(); } bool QImage_IsGrayscale(const QImage* self) { return self->isGrayscale(); } unsigned char* QImage_Bits(QImage* self) { return self->bits(); } const unsigned char* QImage_Bits2(const QImage* self) { return (const unsigned char*) self->bits(); } const unsigned char* QImage_ConstBits(const QImage* self) { return (const unsigned char*) self->constBits(); } int QImage_ByteCount(const QImage* self) { return self->byteCount(); } size_t QImage_SizeInBytes(const QImage* self) { return self->sizeInBytes(); } unsigned char* QImage_ScanLine(QImage* self, int param1) { return self->scanLine(static_cast(param1)); } const unsigned char* QImage_ScanLineWithInt(const QImage* self, int param1) { return (const unsigned char*) self->scanLine(static_cast(param1)); } const unsigned char* QImage_ConstScanLine(const QImage* self, int param1) { return (const unsigned char*) self->constScanLine(static_cast(param1)); } int QImage_BytesPerLine(const QImage* self) { return self->bytesPerLine(); } bool QImage_Valid(const QImage* self, int x, int y) { return self->valid(static_cast(x), static_cast(y)); } bool QImage_ValidWithPt(const QImage* self, QPoint* pt) { return self->valid(*pt); } int QImage_PixelIndex(const QImage* self, int x, int y) { return self->pixelIndex(static_cast(x), static_cast(y)); } int QImage_PixelIndexWithPt(const QImage* self, QPoint* pt) { return self->pixelIndex(*pt); } unsigned int QImage_Pixel(const QImage* self, int x, int y) { return self->pixel(static_cast(x), static_cast(y)); } unsigned int QImage_PixelWithPt(const QImage* self, QPoint* pt) { return self->pixel(*pt); } void QImage_SetPixel(QImage* self, int x, int y, unsigned int index_or_rgb) { self->setPixel(static_cast(x), static_cast(y), static_cast(index_or_rgb)); } void QImage_SetPixel2(QImage* self, QPoint* pt, unsigned int index_or_rgb) { self->setPixel(*pt, static_cast(index_or_rgb)); } QColor* QImage_PixelColor(const QImage* self, int x, int y) { QColor _ret = self->pixelColor(static_cast(x), static_cast(y)); // Copy-construct value returned type into heap-allocated copy return static_cast(new QColor(_ret)); } QColor* QImage_PixelColorWithPt(const QImage* self, QPoint* pt) { QColor _ret = self->pixelColor(*pt); // Copy-construct value returned type into heap-allocated copy return static_cast(new QColor(_ret)); } void QImage_SetPixelColor(QImage* self, int x, int y, QColor* c) { self->setPixelColor(static_cast(x), static_cast(y), *c); } void QImage_SetPixelColor2(QImage* self, QPoint* pt, QColor* c) { self->setPixelColor(*pt, *c); } struct miqt_array* QImage_ColorTable(const QImage* self) { QVector _ret = self->colorTable(); // Convert QList<> from C++ memory to manually-managed C memory unsigned int* _arr = static_cast(malloc(sizeof(unsigned int) * _ret.length())); for (size_t i = 0, e = _ret.length(); i < e; ++i) { _arr[i] = _ret[i]; } struct miqt_array* _out = static_cast(malloc(sizeof(struct miqt_array))); _out->len = _ret.length(); _out->data = static_cast(_arr); return _out; } void QImage_SetColorTable(QImage* self, struct miqt_array* /* of unsigned int */ colors) { QVector colors_QList; colors_QList.reserve(colors->len); unsigned int* colors_arr = static_cast(colors->data); for(size_t i = 0; i < colors->len; ++i) { colors_QList.push_back(colors_arr[i]); } self->setColorTable(colors_QList); } double QImage_DevicePixelRatio(const QImage* self) { return self->devicePixelRatio(); } void QImage_SetDevicePixelRatio(QImage* self, double scaleFactor) { self->setDevicePixelRatio(static_cast(scaleFactor)); } void QImage_Fill(QImage* self, unsigned int pixel) { self->fill(static_cast(pixel)); } void QImage_FillWithColor(QImage* self, QColor* color) { self->fill(*color); } void QImage_Fill2(QImage* self, uintptr_t color) { self->fill(static_cast(color)); } bool QImage_HasAlphaChannel(const QImage* self) { return self->hasAlphaChannel(); } void QImage_SetAlphaChannel(QImage* self, QImage* alphaChannel) { self->setAlphaChannel(*alphaChannel); } QImage* QImage_AlphaChannel(const QImage* self) { QImage _ret = self->alphaChannel(); // Copy-construct value returned type into heap-allocated copy return static_cast(new QImage(_ret)); } QImage* QImage_CreateAlphaMask(const QImage* self) { QImage _ret = self->createAlphaMask(); // Copy-construct value returned type into heap-allocated copy return static_cast(new QImage(_ret)); } QImage* QImage_CreateHeuristicMask(const QImage* self) { QImage _ret = self->createHeuristicMask(); // Copy-construct value returned type into heap-allocated copy return static_cast(new QImage(_ret)); } QImage* QImage_CreateMaskFromColor(const QImage* self, unsigned int color) { QImage _ret = self->createMaskFromColor(static_cast(color)); // Copy-construct value returned type into heap-allocated copy return static_cast(new QImage(_ret)); } QImage* QImage_Scaled(const QImage* self, int w, int h) { QImage _ret = self->scaled(static_cast(w), static_cast(h)); // Copy-construct value returned type into heap-allocated copy return static_cast(new QImage(_ret)); } QImage* QImage_ScaledWithQSize(const QImage* self, QSize* s) { QImage _ret = self->scaled(*s); // Copy-construct value returned type into heap-allocated copy return static_cast(new QImage(_ret)); } QImage* QImage_ScaledToWidth(const QImage* self, int w) { QImage _ret = self->scaledToWidth(static_cast(w)); // Copy-construct value returned type into heap-allocated copy return static_cast(new QImage(_ret)); } QImage* QImage_ScaledToHeight(const QImage* self, int h) { QImage _ret = self->scaledToHeight(static_cast(h)); // Copy-construct value returned type into heap-allocated copy return static_cast(new QImage(_ret)); } QImage* QImage_Transformed(const QImage* self, QMatrix* matrix) { QImage _ret = self->transformed(*matrix); // Copy-construct value returned type into heap-allocated copy return static_cast(new QImage(_ret)); } QMatrix* QImage_TrueMatrix(QMatrix* param1, int w, int h) { QMatrix _ret = QImage::trueMatrix(*param1, static_cast(w), static_cast(h)); // Copy-construct value returned type into heap-allocated copy return static_cast(new QMatrix(_ret)); } QImage* QImage_TransformedWithMatrix(const QImage* self, QTransform* matrix) { QImage _ret = self->transformed(*matrix); // Copy-construct value returned type into heap-allocated copy return static_cast(new QImage(_ret)); } QTransform* QImage_TrueMatrix2(QTransform* param1, int w, int h) { QTransform _ret = QImage::trueMatrix(*param1, static_cast(w), static_cast(h)); // Copy-construct value returned type into heap-allocated copy return static_cast(new QTransform(_ret)); } QImage* QImage_Mirrored(const QImage* self) { QImage _ret = self->mirrored(); // Copy-construct value returned type into heap-allocated copy return static_cast(new QImage(_ret)); } QImage* QImage_RgbSwapped(const QImage* self) { QImage _ret = self->rgbSwapped(); // Copy-construct value returned type into heap-allocated copy return static_cast(new QImage(_ret)); } void QImage_InvertPixels(QImage* self) { self->invertPixels(); } QColorSpace* QImage_ColorSpace(const QImage* self) { QColorSpace _ret = self->colorSpace(); // Copy-construct value returned type into heap-allocated copy return static_cast(new QColorSpace(_ret)); } QImage* QImage_ConvertedToColorSpace(const QImage* self, QColorSpace* param1) { QImage _ret = self->convertedToColorSpace(*param1); // Copy-construct value returned type into heap-allocated copy return static_cast(new QImage(_ret)); } void QImage_ConvertToColorSpace(QImage* self, QColorSpace* param1) { self->convertToColorSpace(*param1); } void QImage_SetColorSpace(QImage* self, QColorSpace* colorSpace) { self->setColorSpace(*colorSpace); } void QImage_ApplyColorTransform(QImage* self, QColorTransform* transform) { self->applyColorTransform(*transform); } bool QImage_Load(QImage* self, QIODevice* device, const char* format) { return self->load(device, format); } bool QImage_LoadWithFileName(QImage* self, struct miqt_string* fileName) { QString fileName_QString = QString::fromUtf8(&fileName->data, fileName->len); return self->load(fileName_QString); } bool QImage_LoadFromData(QImage* self, const unsigned char* buf, int lenVal) { return self->loadFromData(static_cast(buf), static_cast(lenVal)); } bool QImage_LoadFromDataWithData(QImage* self, QByteArray* data) { return self->loadFromData(*data); } bool QImage_Save(const QImage* self, struct miqt_string* fileName) { QString fileName_QString = QString::fromUtf8(&fileName->data, fileName->len); return self->save(fileName_QString); } bool QImage_SaveWithDevice(const QImage* self, QIODevice* device) { return self->save(device); } QImage* QImage_FromData(const unsigned char* data, int size) { QImage _ret = QImage::fromData(static_cast(data), static_cast(size)); // Copy-construct value returned type into heap-allocated copy return static_cast(new QImage(_ret)); } QImage* QImage_FromDataWithData(QByteArray* data) { QImage _ret = QImage::fromData(*data); // Copy-construct value returned type into heap-allocated copy return static_cast(new QImage(_ret)); } long long QImage_CacheKey(const QImage* self) { return self->cacheKey(); } QPaintEngine* QImage_PaintEngine(const QImage* self) { return self->paintEngine(); } int QImage_DotsPerMeterX(const QImage* self) { return self->dotsPerMeterX(); } int QImage_DotsPerMeterY(const QImage* self) { return self->dotsPerMeterY(); } void QImage_SetDotsPerMeterX(QImage* self, int dotsPerMeterX) { self->setDotsPerMeterX(static_cast(dotsPerMeterX)); } void QImage_SetDotsPerMeterY(QImage* self, int dotsPerMeterY) { self->setDotsPerMeterY(static_cast(dotsPerMeterY)); } QPoint* QImage_Offset(const QImage* self) { QPoint _ret = self->offset(); // Copy-construct value returned type into heap-allocated copy return static_cast(new QPoint(_ret)); } void QImage_SetOffset(QImage* self, QPoint* offset) { self->setOffset(*offset); } struct miqt_array* QImage_TextKeys(const QImage* self) { QStringList _ret = self->textKeys(); // Convert QStringList from C++ memory to manually-managed C memory struct miqt_string** _arr = static_cast(malloc(sizeof(struct miqt_string*) * _ret.length())); for (size_t i = 0, e = _ret.length(); i < e; ++i) { QString _lv_ret = _ret[i]; // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory QByteArray _lv_b = _lv_ret.toUtf8(); _arr[i] = miqt_strdup(_lv_b.data(), _lv_b.length()); } struct miqt_array* _out = static_cast(malloc(sizeof(struct miqt_array))); _out->len = _ret.length(); _out->data = static_cast(_arr); return _out; } struct miqt_string* QImage_Text(const QImage* self) { QString _ret = self->text(); // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory QByteArray _b = _ret.toUtf8(); return miqt_strdup(_b.data(), _b.length()); } void QImage_SetText(QImage* self, struct miqt_string* key, struct miqt_string* value) { QString key_QString = QString::fromUtf8(&key->data, key->len); QString value_QString = QString::fromUtf8(&value->data, value->len); self->setText(key_QString, value_QString); } QPixelFormat* QImage_PixelFormat(const QImage* self) { QPixelFormat _ret = self->pixelFormat(); // Copy-construct value returned type into heap-allocated copy return static_cast(new QPixelFormat(_ret)); } QPixelFormat* QImage_ToPixelFormat(uintptr_t format) { QPixelFormat _ret = QImage::toPixelFormat(static_cast(format)); // Copy-construct value returned type into heap-allocated copy return static_cast(new QPixelFormat(_ret)); } uintptr_t QImage_ToImageFormat(QPixelFormat* format) { QImage::Format _ret = QImage::toImageFormat(*format); return static_cast(_ret); } QImage* QImage_Copy1(const QImage* self, QRect* rect) { QImage _ret = self->copy(*rect); // Copy-construct value returned type into heap-allocated copy return static_cast(new QImage(_ret)); } QImage* QImage_ConvertToFormat22(const QImage* self, uintptr_t f, int flags) { QImage _ret = self->convertToFormat(static_cast(f), static_cast(flags)); // Copy-construct value returned type into heap-allocated copy return static_cast(new QImage(_ret)); } QImage* QImage_ConvertToFormat3(const QImage* self, uintptr_t f, struct miqt_array* /* of unsigned int */ colorTable, int flags) { QVector colorTable_QList; colorTable_QList.reserve(colorTable->len); unsigned int* colorTable_arr = static_cast(colorTable->data); for(size_t i = 0; i < colorTable->len; ++i) { colorTable_QList.push_back(colorTable_arr[i]); } QImage _ret = self->convertToFormat(static_cast(f), colorTable_QList, static_cast(flags)); // Copy-construct value returned type into heap-allocated copy return static_cast(new QImage(_ret)); } void QImage_ConvertTo2(QImage* self, uintptr_t f, int flags) { self->convertTo(static_cast(f), static_cast(flags)); } QImage* QImage_CreateAlphaMask1(const QImage* self, int flags) { QImage _ret = self->createAlphaMask(static_cast(flags)); // Copy-construct value returned type into heap-allocated copy return static_cast(new QImage(_ret)); } QImage* QImage_CreateHeuristicMask1(const QImage* self, bool clipTight) { QImage _ret = self->createHeuristicMask(clipTight); // Copy-construct value returned type into heap-allocated copy return static_cast(new QImage(_ret)); } QImage* QImage_CreateMaskFromColor2(const QImage* self, unsigned int color, uintptr_t mode) { QImage _ret = self->createMaskFromColor(static_cast(color), static_cast(mode)); // Copy-construct value returned type into heap-allocated copy return static_cast(new QImage(_ret)); } QImage* QImage_Scaled3(const QImage* self, int w, int h, uintptr_t aspectMode) { QImage _ret = self->scaled(static_cast(w), static_cast(h), static_cast(aspectMode)); // Copy-construct value returned type into heap-allocated copy return static_cast(new QImage(_ret)); } QImage* QImage_Scaled4(const QImage* self, int w, int h, uintptr_t aspectMode, uintptr_t mode) { QImage _ret = self->scaled(static_cast(w), static_cast(h), static_cast(aspectMode), static_cast(mode)); // Copy-construct value returned type into heap-allocated copy return static_cast(new QImage(_ret)); } QImage* QImage_Scaled2(const QImage* self, QSize* s, uintptr_t aspectMode) { QImage _ret = self->scaled(*s, static_cast(aspectMode)); // Copy-construct value returned type into heap-allocated copy return static_cast(new QImage(_ret)); } QImage* QImage_Scaled32(const QImage* self, QSize* s, uintptr_t aspectMode, uintptr_t mode) { QImage _ret = self->scaled(*s, static_cast(aspectMode), static_cast(mode)); // Copy-construct value returned type into heap-allocated copy return static_cast(new QImage(_ret)); } QImage* QImage_ScaledToWidth2(const QImage* self, int w, uintptr_t mode) { QImage _ret = self->scaledToWidth(static_cast(w), static_cast(mode)); // Copy-construct value returned type into heap-allocated copy return static_cast(new QImage(_ret)); } QImage* QImage_ScaledToHeight2(const QImage* self, int h, uintptr_t mode) { QImage _ret = self->scaledToHeight(static_cast(h), static_cast(mode)); // Copy-construct value returned type into heap-allocated copy return static_cast(new QImage(_ret)); } QImage* QImage_Transformed2(const QImage* self, QMatrix* matrix, uintptr_t mode) { QImage _ret = self->transformed(*matrix, static_cast(mode)); // Copy-construct value returned type into heap-allocated copy return static_cast(new QImage(_ret)); } QImage* QImage_Transformed22(const QImage* self, QTransform* matrix, uintptr_t mode) { QImage _ret = self->transformed(*matrix, static_cast(mode)); // Copy-construct value returned type into heap-allocated copy return static_cast(new QImage(_ret)); } QImage* QImage_Mirrored1(const QImage* self, bool horizontally) { QImage _ret = self->mirrored(horizontally); // Copy-construct value returned type into heap-allocated copy return static_cast(new QImage(_ret)); } QImage* QImage_Mirrored2(const QImage* self, bool horizontally, bool vertically) { QImage _ret = self->mirrored(horizontally, vertically); // Copy-construct value returned type into heap-allocated copy return static_cast(new QImage(_ret)); } void QImage_InvertPixels1(QImage* self, uintptr_t param1) { self->invertPixels(static_cast(param1)); } bool QImage_Load2(QImage* self, struct miqt_string* fileName, const char* format) { QString fileName_QString = QString::fromUtf8(&fileName->data, fileName->len); return self->load(fileName_QString, format); } bool QImage_LoadFromData3(QImage* self, const unsigned char* buf, int lenVal, const char* format) { return self->loadFromData(static_cast(buf), static_cast(lenVal), format); } bool QImage_LoadFromData2(QImage* self, QByteArray* data, const char* aformat) { return self->loadFromData(*data, aformat); } bool QImage_Save2(const QImage* self, struct miqt_string* fileName, const char* format) { QString fileName_QString = QString::fromUtf8(&fileName->data, fileName->len); return self->save(fileName_QString, format); } bool QImage_Save3(const QImage* self, struct miqt_string* fileName, const char* format, int quality) { QString fileName_QString = QString::fromUtf8(&fileName->data, fileName->len); return self->save(fileName_QString, format, static_cast(quality)); } bool QImage_Save22(const QImage* self, QIODevice* device, const char* format) { return self->save(device, format); } bool QImage_Save32(const QImage* self, QIODevice* device, const char* format, int quality) { return self->save(device, format, static_cast(quality)); } QImage* QImage_FromData3(const unsigned char* data, int size, const char* format) { QImage _ret = QImage::fromData(static_cast(data), static_cast(size), format); // Copy-construct value returned type into heap-allocated copy return static_cast(new QImage(_ret)); } QImage* QImage_FromData2(QByteArray* data, const char* format) { QImage _ret = QImage::fromData(*data, format); // Copy-construct value returned type into heap-allocated copy return static_cast(new QImage(_ret)); } struct miqt_string* QImage_Text1(const QImage* self, struct miqt_string* key) { QString key_QString = QString::fromUtf8(&key->data, key->len); QString _ret = self->text(key_QString); // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory QByteArray _b = _ret.toUtf8(); return miqt_strdup(_b.data(), _b.length()); } void QImage_Delete(QImage* self) { delete self; }