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