2024-10-20 05:21:03 +00:00
|
|
|
#include <QColor>
|
|
|
|
#include <QColormap>
|
|
|
|
#include <QList>
|
|
|
|
#include <qcolormap.h>
|
|
|
|
#include "gen_qcolormap.h"
|
2024-12-11 06:55:47 +00:00
|
|
|
|
|
|
|
#ifndef _Bool
|
|
|
|
#define _Bool bool
|
|
|
|
#endif
|
2024-10-20 05:21:03 +00:00
|
|
|
#include "_cgo_export.h"
|
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
QColormap* QColormap_new(QColormap* colormap) {
|
|
|
|
return new QColormap(*colormap);
|
2024-10-20 05:21:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QColormap_Initialize() {
|
|
|
|
QColormap::initialize();
|
|
|
|
}
|
|
|
|
|
|
|
|
void QColormap_Cleanup() {
|
|
|
|
QColormap::cleanup();
|
|
|
|
}
|
|
|
|
|
|
|
|
QColormap* QColormap_Instance() {
|
|
|
|
return new QColormap(QColormap::instance());
|
|
|
|
}
|
|
|
|
|
|
|
|
void QColormap_OperatorAssign(QColormap* self, QColormap* colormap) {
|
|
|
|
self->operator=(*colormap);
|
|
|
|
}
|
|
|
|
|
|
|
|
int QColormap_Mode(const QColormap* self) {
|
|
|
|
QColormap::Mode _ret = self->mode();
|
|
|
|
return static_cast<int>(_ret);
|
|
|
|
}
|
|
|
|
|
|
|
|
int QColormap_Depth(const QColormap* self) {
|
|
|
|
return self->depth();
|
|
|
|
}
|
|
|
|
|
|
|
|
int QColormap_Size(const QColormap* self) {
|
|
|
|
return self->size();
|
|
|
|
}
|
|
|
|
|
|
|
|
unsigned int QColormap_Pixel(const QColormap* self, QColor* color) {
|
|
|
|
uint _ret = self->pixel(*color);
|
|
|
|
return static_cast<unsigned int>(_ret);
|
|
|
|
}
|
|
|
|
|
|
|
|
QColor* QColormap_ColorAt(const QColormap* self, unsigned int pixel) {
|
|
|
|
return new QColor(self->colorAt(static_cast<uint>(pixel)));
|
|
|
|
}
|
|
|
|
|
2024-11-17 06:21:37 +00:00
|
|
|
struct miqt_array /* of QColor* */ QColormap_Colormap(const QColormap* self) {
|
2024-10-20 05:21:03 +00:00
|
|
|
const QList<QColor> _ret = self->colormap();
|
|
|
|
// Convert QList<> from C++ memory to manually-managed C memory
|
|
|
|
QColor** _arr = static_cast<QColor**>(malloc(sizeof(QColor*) * _ret.length()));
|
|
|
|
for (size_t i = 0, e = _ret.length(); i < e; ++i) {
|
|
|
|
_arr[i] = new QColor(_ret[i]);
|
|
|
|
}
|
2024-11-04 07:18:27 +00:00
|
|
|
struct miqt_array _out;
|
|
|
|
_out.len = _ret.length();
|
|
|
|
_out.data = static_cast<void*>(_arr);
|
2024-10-20 05:21:03 +00:00
|
|
|
return _out;
|
|
|
|
}
|
|
|
|
|
|
|
|
QColormap* QColormap_Instance1(int screen) {
|
|
|
|
return new QColormap(QColormap::instance(static_cast<int>(screen)));
|
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QColormap_Delete(QColormap* self, bool isSubclass) {
|
|
|
|
if (isSubclass) {
|
|
|
|
delete dynamic_cast<QColormap*>( self );
|
|
|
|
} else {
|
|
|
|
delete self;
|
|
|
|
}
|
2024-10-20 05:21:03 +00:00
|
|
|
}
|
|
|
|
|