2024-08-25 04:08:24 +00:00
|
|
|
package qt
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
#include "gen_qcolortransform.h"
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
*/
|
|
|
|
import "C"
|
|
|
|
|
|
|
|
import (
|
|
|
|
"runtime"
|
|
|
|
"unsafe"
|
|
|
|
)
|
|
|
|
|
|
|
|
type QColorTransform struct {
|
2024-11-19 06:29:06 +00:00
|
|
|
h *C.QColorTransform
|
|
|
|
isSubclass bool
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QColorTransform) cPointer() *C.QColorTransform {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return this.h
|
|
|
|
}
|
|
|
|
|
2024-10-16 05:07:56 +00:00
|
|
|
func (this *QColorTransform) UnsafePointer() unsafe.Pointer {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return unsafe.Pointer(this.h)
|
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
// newQColorTransform constructs the type using only CGO pointers.
|
2024-08-25 04:08:24 +00:00
|
|
|
func newQColorTransform(h *C.QColorTransform) *QColorTransform {
|
2024-09-01 02:23:55 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
return &QColorTransform{h: h}
|
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
// UnsafeNewQColorTransform constructs the type using only unsafe pointers.
|
2024-10-16 05:07:56 +00:00
|
|
|
func UnsafeNewQColorTransform(h unsafe.Pointer) *QColorTransform {
|
2024-11-19 06:29:06 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
return &QColorTransform{h: (*C.QColorTransform)(h)}
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQColorTransform constructs a new QColorTransform object.
|
|
|
|
func NewQColorTransform() *QColorTransform {
|
2024-11-19 06:29:06 +00:00
|
|
|
var outptr_QColorTransform *C.QColorTransform = nil
|
|
|
|
|
|
|
|
C.QColorTransform_new(&outptr_QColorTransform)
|
|
|
|
ret := newQColorTransform(outptr_QColorTransform)
|
|
|
|
ret.isSubclass = true
|
|
|
|
return ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQColorTransform2 constructs a new QColorTransform object.
|
|
|
|
func NewQColorTransform2(colorTransform *QColorTransform) *QColorTransform {
|
2024-11-19 06:29:06 +00:00
|
|
|
var outptr_QColorTransform *C.QColorTransform = nil
|
|
|
|
|
|
|
|
C.QColorTransform_new2(colorTransform.cPointer(), &outptr_QColorTransform)
|
|
|
|
ret := newQColorTransform(outptr_QColorTransform)
|
|
|
|
ret.isSubclass = true
|
|
|
|
return ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QColorTransform) OperatorAssign(other *QColorTransform) {
|
|
|
|
C.QColorTransform_OperatorAssign(this.h, other.cPointer())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QColorTransform) Swap(other *QColorTransform) {
|
|
|
|
C.QColorTransform_Swap(this.h, other.cPointer())
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
func (this *QColorTransform) Map(argb uint) uint {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (uint)(C.QColorTransform_Map(this.h, (C.uint)(argb)))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QColorTransform) MapWithRgba64(rgba64 QRgba64) *QRgba64 {
|
2024-12-07 02:02:06 +00:00
|
|
|
_goptr := newQRgba64(C.QColorTransform_MapWithRgba64(this.h, rgba64.cPointer()))
|
2024-09-14 22:29:05 +00:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QColorTransform) MapWithColor(color *QColor) *QColor {
|
2024-12-07 02:02:06 +00:00
|
|
|
_goptr := newQColor(C.QColorTransform_MapWithColor(this.h, color.cPointer()))
|
2024-09-14 22:29:05 +00:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
// Delete this object from C++ memory.
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QColorTransform) Delete() {
|
2024-11-19 06:29:06 +00:00
|
|
|
C.QColorTransform_Delete(this.h, C.bool(this.isSubclass))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
|
|
|
|
// GoGC adds a Go Finalizer to this pointer, so that it will be deleted
|
|
|
|
// from C++ memory once it is unreachable from Go memory.
|
|
|
|
func (this *QColorTransform) GoGC() {
|
|
|
|
runtime.SetFinalizer(this, func(this *QColorTransform) {
|
|
|
|
this.Delete()
|
|
|
|
runtime.KeepAlive(this.h)
|
|
|
|
})
|
|
|
|
}
|