2024-08-25 04:08:24 +00:00
|
|
|
#include <QColor>
|
|
|
|
#include <QList>
|
|
|
|
#include <QRgba64>
|
|
|
|
#include <QString>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include <QByteArray>
|
|
|
|
#include <cstring>
|
2024-10-16 05:07:56 +00:00
|
|
|
#include <qcolor.h>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include "gen_qcolor.h"
|
2024-09-14 22:29:05 +00:00
|
|
|
#include "_cgo_export.h"
|
2024-08-25 04:08:24 +00:00
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QColor_new(QColor** outptr_QColor) {
|
|
|
|
QColor* ret = new QColor();
|
|
|
|
*outptr_QColor = ret;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QColor_new2(int color, QColor** outptr_QColor) {
|
|
|
|
QColor* ret = new QColor(static_cast<Qt::GlobalColor>(color));
|
|
|
|
*outptr_QColor = ret;
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QColor_new3(int r, int g, int b, QColor** outptr_QColor) {
|
|
|
|
QColor* ret = new QColor(static_cast<int>(r), static_cast<int>(g), static_cast<int>(b));
|
|
|
|
*outptr_QColor = ret;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QColor_new4(unsigned int rgb, QColor** outptr_QColor) {
|
|
|
|
QColor* ret = new QColor(static_cast<QRgb>(rgb));
|
|
|
|
*outptr_QColor = ret;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QColor_new5(QRgba64* rgba64, QColor** outptr_QColor) {
|
|
|
|
QColor* ret = new QColor(*rgba64);
|
|
|
|
*outptr_QColor = ret;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QColor_new6(struct miqt_string name, QColor** outptr_QColor) {
|
2024-10-18 23:53:33 +00:00
|
|
|
QString name_QString = QString::fromUtf8(name.data, name.len);
|
2024-11-19 06:29:06 +00:00
|
|
|
QColor* ret = new QColor(name_QString);
|
|
|
|
*outptr_QColor = ret;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QColor_new7(const char* aname, QColor** outptr_QColor) {
|
|
|
|
QColor* ret = new QColor(aname);
|
|
|
|
*outptr_QColor = ret;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QColor_new8(int spec, QColor** outptr_QColor) {
|
|
|
|
QColor* ret = new QColor(static_cast<QColor::Spec>(spec));
|
|
|
|
*outptr_QColor = ret;
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QColor_new9(QColor* color, QColor** outptr_QColor) {
|
|
|
|
QColor* ret = new QColor(*color);
|
|
|
|
*outptr_QColor = ret;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QColor_new10(int spec, uint16_t a1, uint16_t a2, uint16_t a3, uint16_t a4, QColor** outptr_QColor) {
|
|
|
|
QColor* ret = new QColor(static_cast<QColor::Spec>(spec), static_cast<ushort>(a1), static_cast<ushort>(a2), static_cast<ushort>(a3), static_cast<ushort>(a4));
|
|
|
|
*outptr_QColor = ret;
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QColor_new11(int r, int g, int b, int a, QColor** outptr_QColor) {
|
|
|
|
QColor* ret = new QColor(static_cast<int>(r), static_cast<int>(g), static_cast<int>(b), static_cast<int>(a));
|
|
|
|
*outptr_QColor = ret;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QColor_new12(int spec, uint16_t a1, uint16_t a2, uint16_t a3, uint16_t a4, uint16_t a5, QColor** outptr_QColor) {
|
|
|
|
QColor* ret = new QColor(static_cast<QColor::Spec>(spec), static_cast<ushort>(a1), static_cast<ushort>(a2), static_cast<ushort>(a3), static_cast<ushort>(a4), static_cast<ushort>(a5));
|
|
|
|
*outptr_QColor = ret;
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
void QColor_OperatorAssign(QColor* self, QColor* param1) {
|
|
|
|
self->operator=(*param1);
|
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
void QColor_OperatorAssignWithColor(QColor* self, int color) {
|
2024-08-29 07:01:51 +00:00
|
|
|
self->operator=(static_cast<Qt::GlobalColor>(color));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QColor_IsValid(const QColor* self) {
|
|
|
|
return self->isValid();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string QColor_Name(const QColor* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = self->name();
|
2024-08-29 07:01:51 +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();
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string _ms;
|
|
|
|
_ms.len = _b.length();
|
|
|
|
_ms.data = static_cast<char*>(malloc(_ms.len));
|
|
|
|
memcpy(_ms.data, _b.data(), _ms.len);
|
|
|
|
return _ms;
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string QColor_NameWithFormat(const QColor* self, int format) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = self->name(static_cast<QColor::NameFormat>(format));
|
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();
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string _ms;
|
|
|
|
_ms.len = _b.length();
|
|
|
|
_ms.data = static_cast<char*>(malloc(_ms.len));
|
|
|
|
memcpy(_ms.data, _b.data(), _ms.len);
|
|
|
|
return _ms;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
void QColor_SetNamedColor(QColor* self, struct miqt_string name) {
|
|
|
|
QString name_QString = QString::fromUtf8(name.data, name.len);
|
2024-08-25 04:08:24 +00:00
|
|
|
self->setNamedColor(name_QString);
|
|
|
|
}
|
|
|
|
|
2024-11-17 06:21:37 +00:00
|
|
|
struct miqt_array /* of struct miqt_string */ QColor_ColorNames() {
|
2024-09-14 22:29:05 +00:00
|
|
|
QStringList _ret = QColor::colorNames();
|
2024-09-17 06:29:11 +00:00
|
|
|
// Convert QList<> from C++ memory to manually-managed C memory
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string* _arr = static_cast<struct miqt_string*>(malloc(sizeof(struct miqt_string) * _ret.length()));
|
2024-09-14 22:29:05 +00:00
|
|
|
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();
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string _lv_ms;
|
|
|
|
_lv_ms.len = _lv_b.length();
|
|
|
|
_lv_ms.data = static_cast<char*>(malloc(_lv_ms.len));
|
|
|
|
memcpy(_lv_ms.data, _lv_b.data(), _lv_ms.len);
|
|
|
|
_arr[i] = _lv_ms;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
2024-11-04 07:18:27 +00:00
|
|
|
struct miqt_array _out;
|
|
|
|
_out.len = _ret.length();
|
|
|
|
_out.data = static_cast<void*>(_arr);
|
2024-09-14 22:29:05 +00:00
|
|
|
return _out;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
int QColor_Spec(const QColor* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QColor::Spec _ret = self->spec();
|
2024-09-18 00:12:02 +00:00
|
|
|
return static_cast<int>(_ret);
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QColor_Alpha(const QColor* self) {
|
|
|
|
return self->alpha();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QColor_SetAlpha(QColor* self, int alpha) {
|
|
|
|
self->setAlpha(static_cast<int>(alpha));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
double QColor_AlphaF(const QColor* self) {
|
2024-09-18 00:12:02 +00:00
|
|
|
qreal _ret = self->alphaF();
|
|
|
|
return static_cast<double>(_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QColor_SetAlphaF(QColor* self, double alpha) {
|
|
|
|
self->setAlphaF(static_cast<qreal>(alpha));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QColor_Red(const QColor* self) {
|
|
|
|
return self->red();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QColor_Green(const QColor* self) {
|
|
|
|
return self->green();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QColor_Blue(const QColor* self) {
|
|
|
|
return self->blue();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QColor_SetRed(QColor* self, int red) {
|
|
|
|
self->setRed(static_cast<int>(red));
|
|
|
|
}
|
|
|
|
|
|
|
|
void QColor_SetGreen(QColor* self, int green) {
|
|
|
|
self->setGreen(static_cast<int>(green));
|
|
|
|
}
|
|
|
|
|
|
|
|
void QColor_SetBlue(QColor* self, int blue) {
|
|
|
|
self->setBlue(static_cast<int>(blue));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
double QColor_RedF(const QColor* self) {
|
2024-09-18 00:12:02 +00:00
|
|
|
qreal _ret = self->redF();
|
|
|
|
return static_cast<double>(_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
double QColor_GreenF(const QColor* self) {
|
2024-09-18 00:12:02 +00:00
|
|
|
qreal _ret = self->greenF();
|
|
|
|
return static_cast<double>(_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
double QColor_BlueF(const QColor* self) {
|
2024-09-18 00:12:02 +00:00
|
|
|
qreal _ret = self->blueF();
|
|
|
|
return static_cast<double>(_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QColor_SetRedF(QColor* self, double red) {
|
|
|
|
self->setRedF(static_cast<qreal>(red));
|
|
|
|
}
|
|
|
|
|
|
|
|
void QColor_SetGreenF(QColor* self, double green) {
|
|
|
|
self->setGreenF(static_cast<qreal>(green));
|
|
|
|
}
|
|
|
|
|
|
|
|
void QColor_SetBlueF(QColor* self, double blue) {
|
|
|
|
self->setBlueF(static_cast<qreal>(blue));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
void QColor_GetRgb(const QColor* self, int* r, int* g, int* b) {
|
|
|
|
self->getRgb(static_cast<int*>(r), static_cast<int*>(g), static_cast<int*>(b));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QColor_SetRgb(QColor* self, int r, int g, int b) {
|
|
|
|
self->setRgb(static_cast<int>(r), static_cast<int>(g), static_cast<int>(b));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
void QColor_GetRgbF(const QColor* self, double* r, double* g, double* b) {
|
|
|
|
self->getRgbF(static_cast<qreal*>(r), static_cast<qreal*>(g), static_cast<qreal*>(b));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QColor_SetRgbF(QColor* self, double r, double g, double b) {
|
|
|
|
self->setRgbF(static_cast<qreal>(r), static_cast<qreal>(g), static_cast<qreal>(b));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QRgba64* QColor_Rgba64(const QColor* self) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QRgba64(self->rgba64());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QColor_SetRgba64(QColor* self, QRgba64* rgba) {
|
|
|
|
self->setRgba64(*rgba);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
unsigned int QColor_Rgba(const QColor* self) {
|
2024-09-18 00:12:02 +00:00
|
|
|
QRgb _ret = self->rgba();
|
|
|
|
return static_cast<unsigned int>(_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QColor_SetRgba(QColor* self, unsigned int rgba) {
|
|
|
|
self->setRgba(static_cast<QRgb>(rgba));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
unsigned int QColor_Rgb(const QColor* self) {
|
2024-09-18 00:12:02 +00:00
|
|
|
QRgb _ret = self->rgb();
|
|
|
|
return static_cast<unsigned int>(_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QColor_SetRgbWithRgb(QColor* self, unsigned int rgb) {
|
|
|
|
self->setRgb(static_cast<QRgb>(rgb));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QColor_Hue(const QColor* self) {
|
|
|
|
return self->hue();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QColor_Saturation(const QColor* self) {
|
|
|
|
return self->saturation();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QColor_HsvHue(const QColor* self) {
|
|
|
|
return self->hsvHue();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QColor_HsvSaturation(const QColor* self) {
|
|
|
|
return self->hsvSaturation();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QColor_Value(const QColor* self) {
|
|
|
|
return self->value();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
double QColor_HueF(const QColor* self) {
|
2024-09-18 00:12:02 +00:00
|
|
|
qreal _ret = self->hueF();
|
|
|
|
return static_cast<double>(_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
double QColor_SaturationF(const QColor* self) {
|
2024-09-18 00:12:02 +00:00
|
|
|
qreal _ret = self->saturationF();
|
|
|
|
return static_cast<double>(_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
double QColor_HsvHueF(const QColor* self) {
|
2024-09-18 00:12:02 +00:00
|
|
|
qreal _ret = self->hsvHueF();
|
|
|
|
return static_cast<double>(_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
double QColor_HsvSaturationF(const QColor* self) {
|
2024-09-18 00:12:02 +00:00
|
|
|
qreal _ret = self->hsvSaturationF();
|
|
|
|
return static_cast<double>(_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
double QColor_ValueF(const QColor* self) {
|
2024-09-18 00:12:02 +00:00
|
|
|
qreal _ret = self->valueF();
|
|
|
|
return static_cast<double>(_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
void QColor_GetHsv(const QColor* self, int* h, int* s, int* v) {
|
|
|
|
self->getHsv(static_cast<int*>(h), static_cast<int*>(s), static_cast<int*>(v));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QColor_SetHsv(QColor* self, int h, int s, int v) {
|
|
|
|
self->setHsv(static_cast<int>(h), static_cast<int>(s), static_cast<int>(v));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
void QColor_GetHsvF(const QColor* self, double* h, double* s, double* v) {
|
|
|
|
self->getHsvF(static_cast<qreal*>(h), static_cast<qreal*>(s), static_cast<qreal*>(v));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QColor_SetHsvF(QColor* self, double h, double s, double v) {
|
|
|
|
self->setHsvF(static_cast<qreal>(h), static_cast<qreal>(s), static_cast<qreal>(v));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QColor_Cyan(const QColor* self) {
|
|
|
|
return self->cyan();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QColor_Magenta(const QColor* self) {
|
|
|
|
return self->magenta();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QColor_Yellow(const QColor* self) {
|
|
|
|
return self->yellow();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QColor_Black(const QColor* self) {
|
|
|
|
return self->black();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
double QColor_CyanF(const QColor* self) {
|
2024-09-18 00:12:02 +00:00
|
|
|
qreal _ret = self->cyanF();
|
|
|
|
return static_cast<double>(_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
double QColor_MagentaF(const QColor* self) {
|
2024-09-18 00:12:02 +00:00
|
|
|
qreal _ret = self->magentaF();
|
|
|
|
return static_cast<double>(_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
double QColor_YellowF(const QColor* self) {
|
2024-09-18 00:12:02 +00:00
|
|
|
qreal _ret = self->yellowF();
|
|
|
|
return static_cast<double>(_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
double QColor_BlackF(const QColor* self) {
|
2024-09-18 00:12:02 +00:00
|
|
|
qreal _ret = self->blackF();
|
|
|
|
return static_cast<double>(_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QColor_GetCmyk(QColor* self, int* c, int* m, int* y, int* k) {
|
|
|
|
self->getCmyk(static_cast<int*>(c), static_cast<int*>(m), static_cast<int*>(y), static_cast<int*>(k));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
void QColor_GetCmyk2(const QColor* self, int* c, int* m, int* y, int* k) {
|
|
|
|
self->getCmyk(static_cast<int*>(c), static_cast<int*>(m), static_cast<int*>(y), static_cast<int*>(k));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QColor_SetCmyk(QColor* self, int c, int m, int y, int k) {
|
|
|
|
self->setCmyk(static_cast<int>(c), static_cast<int>(m), static_cast<int>(y), static_cast<int>(k));
|
|
|
|
}
|
|
|
|
|
|
|
|
void QColor_GetCmykF(QColor* self, double* c, double* m, double* y, double* k) {
|
|
|
|
self->getCmykF(static_cast<qreal*>(c), static_cast<qreal*>(m), static_cast<qreal*>(y), static_cast<qreal*>(k));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
void QColor_GetCmykF2(const QColor* self, double* c, double* m, double* y, double* k) {
|
|
|
|
self->getCmykF(static_cast<qreal*>(c), static_cast<qreal*>(m), static_cast<qreal*>(y), static_cast<qreal*>(k));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QColor_SetCmykF(QColor* self, double c, double m, double y, double k) {
|
|
|
|
self->setCmykF(static_cast<qreal>(c), static_cast<qreal>(m), static_cast<qreal>(y), static_cast<qreal>(k));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QColor_HslHue(const QColor* self) {
|
|
|
|
return self->hslHue();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QColor_HslSaturation(const QColor* self) {
|
|
|
|
return self->hslSaturation();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QColor_Lightness(const QColor* self) {
|
|
|
|
return self->lightness();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
double QColor_HslHueF(const QColor* self) {
|
2024-09-18 00:12:02 +00:00
|
|
|
qreal _ret = self->hslHueF();
|
|
|
|
return static_cast<double>(_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
double QColor_HslSaturationF(const QColor* self) {
|
2024-09-18 00:12:02 +00:00
|
|
|
qreal _ret = self->hslSaturationF();
|
|
|
|
return static_cast<double>(_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
double QColor_LightnessF(const QColor* self) {
|
2024-09-18 00:12:02 +00:00
|
|
|
qreal _ret = self->lightnessF();
|
|
|
|
return static_cast<double>(_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
void QColor_GetHsl(const QColor* self, int* h, int* s, int* l) {
|
|
|
|
self->getHsl(static_cast<int*>(h), static_cast<int*>(s), static_cast<int*>(l));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QColor_SetHsl(QColor* self, int h, int s, int l) {
|
|
|
|
self->setHsl(static_cast<int>(h), static_cast<int>(s), static_cast<int>(l));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
void QColor_GetHslF(const QColor* self, double* h, double* s, double* l) {
|
|
|
|
self->getHslF(static_cast<qreal*>(h), static_cast<qreal*>(s), static_cast<qreal*>(l));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QColor_SetHslF(QColor* self, double h, double s, double l) {
|
|
|
|
self->setHslF(static_cast<qreal>(h), static_cast<qreal>(s), static_cast<qreal>(l));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QColor* QColor_ToRgb(const QColor* self) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QColor(self->toRgb());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QColor* QColor_ToHsv(const QColor* self) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QColor(self->toHsv());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QColor* QColor_ToCmyk(const QColor* self) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QColor(self->toCmyk());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QColor* QColor_ToHsl(const QColor* self) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QColor(self->toHsl());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QColor* QColor_ToExtendedRgb(const QColor* self) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QColor(self->toExtendedRgb());
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
QColor* QColor_ConvertTo(const QColor* self, int colorSpec) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QColor(self->convertTo(static_cast<QColor::Spec>(colorSpec)));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QColor* QColor_FromRgb(unsigned int rgb) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QColor(QColor::fromRgb(static_cast<QRgb>(rgb)));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QColor* QColor_FromRgba(unsigned int rgba) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QColor(QColor::fromRgba(static_cast<QRgb>(rgba)));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QColor* QColor_FromRgb2(int r, int g, int b) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QColor(QColor::fromRgb(static_cast<int>(r), static_cast<int>(g), static_cast<int>(b)));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QColor* QColor_FromRgbF(double r, double g, double b) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QColor(QColor::fromRgbF(static_cast<qreal>(r), static_cast<qreal>(g), static_cast<qreal>(b)));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QColor* QColor_FromRgba64(uint16_t r, uint16_t g, uint16_t b) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QColor(QColor::fromRgba64(static_cast<ushort>(r), static_cast<ushort>(g), static_cast<ushort>(b)));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QColor* QColor_FromRgba64WithRgba(QRgba64* rgba) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QColor(QColor::fromRgba64(*rgba));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QColor* QColor_FromHsv(int h, int s, int v) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QColor(QColor::fromHsv(static_cast<int>(h), static_cast<int>(s), static_cast<int>(v)));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QColor* QColor_FromHsvF(double h, double s, double v) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QColor(QColor::fromHsvF(static_cast<qreal>(h), static_cast<qreal>(s), static_cast<qreal>(v)));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QColor* QColor_FromCmyk(int c, int m, int y, int k) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QColor(QColor::fromCmyk(static_cast<int>(c), static_cast<int>(m), static_cast<int>(y), static_cast<int>(k)));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QColor* QColor_FromCmykF(double c, double m, double y, double k) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QColor(QColor::fromCmykF(static_cast<qreal>(c), static_cast<qreal>(m), static_cast<qreal>(y), static_cast<qreal>(k)));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QColor* QColor_FromHsl(int h, int s, int l) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QColor(QColor::fromHsl(static_cast<int>(h), static_cast<int>(s), static_cast<int>(l)));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QColor* QColor_FromHslF(double h, double s, double l) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QColor(QColor::fromHslF(static_cast<qreal>(h), static_cast<qreal>(s), static_cast<qreal>(l)));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QColor* QColor_Light(const QColor* self) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QColor(self->light());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QColor* QColor_Dark(const QColor* self) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QColor(self->dark());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QColor* QColor_Lighter(const QColor* self) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QColor(self->lighter());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QColor* QColor_Darker(const QColor* self) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QColor(self->darker());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QColor_OperatorEqual(const QColor* self, QColor* c) {
|
|
|
|
return self->operator==(*c);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QColor_OperatorNotEqual(const QColor* self, QColor* c) {
|
|
|
|
return self->operator!=(*c);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
bool QColor_IsValidColor(struct miqt_string name) {
|
|
|
|
QString name_QString = QString::fromUtf8(name.data, name.len);
|
2024-08-25 04:08:24 +00:00
|
|
|
return QColor::isValidColor(name_QString);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
void QColor_GetRgb4(const QColor* self, int* r, int* g, int* b, int* a) {
|
|
|
|
self->getRgb(static_cast<int*>(r), static_cast<int*>(g), static_cast<int*>(b), static_cast<int*>(a));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QColor_SetRgb4(QColor* self, int r, int g, int b, int a) {
|
|
|
|
self->setRgb(static_cast<int>(r), static_cast<int>(g), static_cast<int>(b), static_cast<int>(a));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
void QColor_GetRgbF4(const QColor* self, double* r, double* g, double* b, double* a) {
|
|
|
|
self->getRgbF(static_cast<qreal*>(r), static_cast<qreal*>(g), static_cast<qreal*>(b), static_cast<qreal*>(a));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QColor_SetRgbF4(QColor* self, double r, double g, double b, double a) {
|
|
|
|
self->setRgbF(static_cast<qreal>(r), static_cast<qreal>(g), static_cast<qreal>(b), static_cast<qreal>(a));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
void QColor_GetHsv4(const QColor* self, int* h, int* s, int* v, int* a) {
|
|
|
|
self->getHsv(static_cast<int*>(h), static_cast<int*>(s), static_cast<int*>(v), static_cast<int*>(a));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QColor_SetHsv4(QColor* self, int h, int s, int v, int a) {
|
|
|
|
self->setHsv(static_cast<int>(h), static_cast<int>(s), static_cast<int>(v), static_cast<int>(a));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
void QColor_GetHsvF4(const QColor* self, double* h, double* s, double* v, double* a) {
|
|
|
|
self->getHsvF(static_cast<qreal*>(h), static_cast<qreal*>(s), static_cast<qreal*>(v), static_cast<qreal*>(a));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QColor_SetHsvF4(QColor* self, double h, double s, double v, double a) {
|
|
|
|
self->setHsvF(static_cast<qreal>(h), static_cast<qreal>(s), static_cast<qreal>(v), static_cast<qreal>(a));
|
|
|
|
}
|
|
|
|
|
|
|
|
void QColor_GetCmyk5(QColor* self, int* c, int* m, int* y, int* k, int* a) {
|
|
|
|
self->getCmyk(static_cast<int*>(c), static_cast<int*>(m), static_cast<int*>(y), static_cast<int*>(k), static_cast<int*>(a));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
void QColor_GetCmyk52(const QColor* self, int* c, int* m, int* y, int* k, int* a) {
|
|
|
|
self->getCmyk(static_cast<int*>(c), static_cast<int*>(m), static_cast<int*>(y), static_cast<int*>(k), static_cast<int*>(a));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QColor_SetCmyk5(QColor* self, int c, int m, int y, int k, int a) {
|
|
|
|
self->setCmyk(static_cast<int>(c), static_cast<int>(m), static_cast<int>(y), static_cast<int>(k), static_cast<int>(a));
|
|
|
|
}
|
|
|
|
|
|
|
|
void QColor_GetCmykF5(QColor* self, double* c, double* m, double* y, double* k, double* a) {
|
|
|
|
self->getCmykF(static_cast<qreal*>(c), static_cast<qreal*>(m), static_cast<qreal*>(y), static_cast<qreal*>(k), static_cast<qreal*>(a));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
void QColor_GetCmykF52(const QColor* self, double* c, double* m, double* y, double* k, double* a) {
|
|
|
|
self->getCmykF(static_cast<qreal*>(c), static_cast<qreal*>(m), static_cast<qreal*>(y), static_cast<qreal*>(k), static_cast<qreal*>(a));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QColor_SetCmykF5(QColor* self, double c, double m, double y, double k, double a) {
|
|
|
|
self->setCmykF(static_cast<qreal>(c), static_cast<qreal>(m), static_cast<qreal>(y), static_cast<qreal>(k), static_cast<qreal>(a));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
void QColor_GetHsl4(const QColor* self, int* h, int* s, int* l, int* a) {
|
|
|
|
self->getHsl(static_cast<int*>(h), static_cast<int*>(s), static_cast<int*>(l), static_cast<int*>(a));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QColor_SetHsl4(QColor* self, int h, int s, int l, int a) {
|
|
|
|
self->setHsl(static_cast<int>(h), static_cast<int>(s), static_cast<int>(l), static_cast<int>(a));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
void QColor_GetHslF4(const QColor* self, double* h, double* s, double* l, double* a) {
|
|
|
|
self->getHslF(static_cast<qreal*>(h), static_cast<qreal*>(s), static_cast<qreal*>(l), static_cast<qreal*>(a));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QColor_SetHslF4(QColor* self, double h, double s, double l, double a) {
|
|
|
|
self->setHslF(static_cast<qreal>(h), static_cast<qreal>(s), static_cast<qreal>(l), static_cast<qreal>(a));
|
|
|
|
}
|
|
|
|
|
|
|
|
QColor* QColor_FromRgb4(int r, int g, int b, int a) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QColor(QColor::fromRgb(static_cast<int>(r), static_cast<int>(g), static_cast<int>(b), static_cast<int>(a)));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QColor* QColor_FromRgbF4(double r, double g, double b, double a) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QColor(QColor::fromRgbF(static_cast<qreal>(r), static_cast<qreal>(g), static_cast<qreal>(b), static_cast<qreal>(a)));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QColor* QColor_FromRgba644(uint16_t r, uint16_t g, uint16_t b, uint16_t a) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QColor(QColor::fromRgba64(static_cast<ushort>(r), static_cast<ushort>(g), static_cast<ushort>(b), static_cast<ushort>(a)));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QColor* QColor_FromHsv4(int h, int s, int v, int a) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QColor(QColor::fromHsv(static_cast<int>(h), static_cast<int>(s), static_cast<int>(v), static_cast<int>(a)));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QColor* QColor_FromHsvF4(double h, double s, double v, double a) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QColor(QColor::fromHsvF(static_cast<qreal>(h), static_cast<qreal>(s), static_cast<qreal>(v), static_cast<qreal>(a)));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QColor* QColor_FromCmyk5(int c, int m, int y, int k, int a) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QColor(QColor::fromCmyk(static_cast<int>(c), static_cast<int>(m), static_cast<int>(y), static_cast<int>(k), static_cast<int>(a)));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QColor* QColor_FromCmykF5(double c, double m, double y, double k, double a) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QColor(QColor::fromCmykF(static_cast<qreal>(c), static_cast<qreal>(m), static_cast<qreal>(y), static_cast<qreal>(k), static_cast<qreal>(a)));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QColor* QColor_FromHsl4(int h, int s, int l, int a) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QColor(QColor::fromHsl(static_cast<int>(h), static_cast<int>(s), static_cast<int>(l), static_cast<int>(a)));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QColor* QColor_FromHslF4(double h, double s, double l, double a) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QColor(QColor::fromHslF(static_cast<qreal>(h), static_cast<qreal>(s), static_cast<qreal>(l), static_cast<qreal>(a)));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QColor* QColor_Light1(const QColor* self, int f) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QColor(self->light(static_cast<int>(f)));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QColor* QColor_Dark1(const QColor* self, int f) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QColor(self->dark(static_cast<int>(f)));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QColor* QColor_Lighter1(const QColor* self, int f) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QColor(self->lighter(static_cast<int>(f)));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QColor* QColor_Darker1(const QColor* self, int f) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QColor(self->darker(static_cast<int>(f)));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QColor_Delete(QColor* self, bool isSubclass) {
|
|
|
|
if (isSubclass) {
|
|
|
|
delete dynamic_cast<QColor*>( self );
|
|
|
|
} else {
|
|
|
|
delete self;
|
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|