miqt/qt6/multimedia/gen_qimagecapture.go

506 lines
16 KiB
Go
Raw Normal View History

2024-11-04 10:15:32 +00:00
package multimedia
/*
#include "gen_qimagecapture.h"
#include <stdlib.h>
*/
import "C"
import (
"github.com/mappu/miqt/qt6"
"runtime"
"runtime/cgo"
"unsafe"
)
type QImageCapture__Error int
const (
QImageCapture__NoError QImageCapture__Error = 0
QImageCapture__NotReadyError QImageCapture__Error = 1
QImageCapture__ResourceError QImageCapture__Error = 2
QImageCapture__OutOfSpaceError QImageCapture__Error = 3
QImageCapture__NotSupportedFeatureError QImageCapture__Error = 4
QImageCapture__FormatError QImageCapture__Error = 5
)
type QImageCapture__Quality int
const (
QImageCapture__VeryLowQuality QImageCapture__Quality = 0
QImageCapture__LowQuality QImageCapture__Quality = 1
QImageCapture__NormalQuality QImageCapture__Quality = 2
QImageCapture__HighQuality QImageCapture__Quality = 3
QImageCapture__VeryHighQuality QImageCapture__Quality = 4
)
type QImageCapture__FileFormat int
const (
QImageCapture__UnspecifiedFormat QImageCapture__FileFormat = 0
QImageCapture__JPEG QImageCapture__FileFormat = 1
QImageCapture__PNG QImageCapture__FileFormat = 2
QImageCapture__WebP QImageCapture__FileFormat = 3
QImageCapture__Tiff QImageCapture__FileFormat = 4
QImageCapture__LastFileFormat QImageCapture__FileFormat = 4
)
type QImageCapture struct {
h *C.QImageCapture
*qt6.QObject
}
func (this *QImageCapture) cPointer() *C.QImageCapture {
if this == nil {
return nil
}
return this.h
}
func (this *QImageCapture) UnsafePointer() unsafe.Pointer {
if this == nil {
return nil
}
return unsafe.Pointer(this.h)
}
func newQImageCapture(h *C.QImageCapture) *QImageCapture {
if h == nil {
return nil
}
return &QImageCapture{h: h, QObject: qt6.UnsafeNewQObject(unsafe.Pointer(h))}
}
func UnsafeNewQImageCapture(h unsafe.Pointer) *QImageCapture {
return newQImageCapture((*C.QImageCapture)(h))
}
// NewQImageCapture constructs a new QImageCapture object.
func NewQImageCapture() *QImageCapture {
ret := C.QImageCapture_new()
return newQImageCapture(ret)
}
// NewQImageCapture2 constructs a new QImageCapture object.
func NewQImageCapture2(parent *qt6.QObject) *QImageCapture {
ret := C.QImageCapture_new2((*C.QObject)(parent.UnsafePointer()))
return newQImageCapture(ret)
}
func (this *QImageCapture) MetaObject() *qt6.QMetaObject {
return qt6.UnsafeNewQMetaObject(unsafe.Pointer(C.QImageCapture_MetaObject(this.h)))
}
func (this *QImageCapture) Metacast(param1 string) unsafe.Pointer {
param1_Cstring := C.CString(param1)
defer C.free(unsafe.Pointer(param1_Cstring))
return (unsafe.Pointer)(C.QImageCapture_Metacast(this.h, param1_Cstring))
}
func QImageCapture_Tr(s string) string {
s_Cstring := C.CString(s)
defer C.free(unsafe.Pointer(s_Cstring))
var _ms C.struct_miqt_string = C.QImageCapture_Tr(s_Cstring)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func (this *QImageCapture) IsAvailable() bool {
return (bool)(C.QImageCapture_IsAvailable(this.h))
}
func (this *QImageCapture) CaptureSession() *QMediaCaptureSession {
return UnsafeNewQMediaCaptureSession(unsafe.Pointer(C.QImageCapture_CaptureSession(this.h)))
}
func (this *QImageCapture) Error() QImageCapture__Error {
return (QImageCapture__Error)(C.QImageCapture_Error(this.h))
}
func (this *QImageCapture) ErrorString() string {
var _ms C.struct_miqt_string = C.QImageCapture_ErrorString(this.h)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func (this *QImageCapture) IsReadyForCapture() bool {
return (bool)(C.QImageCapture_IsReadyForCapture(this.h))
}
func (this *QImageCapture) FileFormat() QImageCapture__FileFormat {
return (QImageCapture__FileFormat)(C.QImageCapture_FileFormat(this.h))
}
func (this *QImageCapture) SetFileFormat(format QImageCapture__FileFormat) {
C.QImageCapture_SetFileFormat(this.h, (C.int)(format))
}
func QImageCapture_SupportedFormats() []QImageCapture__FileFormat {
var _ma C.struct_miqt_array = C.QImageCapture_SupportedFormats()
_ret := make([]QImageCapture__FileFormat, int(_ma.len))
_outCast := (*[0xffff]C.int)(unsafe.Pointer(_ma.data)) // hey ya
for i := 0; i < int(_ma.len); i++ {
_ret[i] = (QImageCapture__FileFormat)(_outCast[i])
}
return _ret
}
func QImageCapture_FileFormatName(c QImageCapture__FileFormat) string {
var _ms C.struct_miqt_string = C.QImageCapture_FileFormatName((C.int)(c))
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func QImageCapture_FileFormatDescription(c QImageCapture__FileFormat) string {
var _ms C.struct_miqt_string = C.QImageCapture_FileFormatDescription((C.int)(c))
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func (this *QImageCapture) Resolution() *qt6.QSize {
_ret := C.QImageCapture_Resolution(this.h)
_goptr := qt6.UnsafeNewQSize(unsafe.Pointer(_ret))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QImageCapture) SetResolution(resolution *qt6.QSize) {
C.QImageCapture_SetResolution(this.h, (*C.QSize)(resolution.UnsafePointer()))
}
func (this *QImageCapture) SetResolution2(width int, height int) {
C.QImageCapture_SetResolution2(this.h, (C.int)(width), (C.int)(height))
}
func (this *QImageCapture) Quality() QImageCapture__Quality {
return (QImageCapture__Quality)(C.QImageCapture_Quality(this.h))
}
func (this *QImageCapture) SetQuality(quality QImageCapture__Quality) {
C.QImageCapture_SetQuality(this.h, (C.int)(quality))
}
func (this *QImageCapture) MetaData() *QMediaMetaData {
_ret := C.QImageCapture_MetaData(this.h)
_goptr := newQMediaMetaData(_ret)
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QImageCapture) SetMetaData(metaData *QMediaMetaData) {
C.QImageCapture_SetMetaData(this.h, metaData.cPointer())
}
func (this *QImageCapture) AddMetaData(metaData *QMediaMetaData) {
C.QImageCapture_AddMetaData(this.h, metaData.cPointer())
}
func (this *QImageCapture) CaptureToFile() int {
return (int)(C.QImageCapture_CaptureToFile(this.h))
}
func (this *QImageCapture) Capture() int {
return (int)(C.QImageCapture_Capture(this.h))
}
func (this *QImageCapture) ErrorChanged() {
C.QImageCapture_ErrorChanged(this.h)
}
func (this *QImageCapture) OnErrorChanged(slot func()) {
C.QImageCapture_connect_ErrorChanged(this.h, C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QImageCapture_ErrorChanged
func miqt_exec_callback_QImageCapture_ErrorChanged(cb C.intptr_t) {
gofunc, ok := cgo.Handle(cb).Value().(func())
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
gofunc()
}
func (this *QImageCapture) ErrorOccurred(id int, error QImageCapture__Error, errorString string) {
errorString_ms := C.struct_miqt_string{}
errorString_ms.data = C.CString(errorString)
errorString_ms.len = C.size_t(len(errorString))
defer C.free(unsafe.Pointer(errorString_ms.data))
C.QImageCapture_ErrorOccurred(this.h, (C.int)(id), (C.int)(error), errorString_ms)
}
func (this *QImageCapture) OnErrorOccurred(slot func(id int, error QImageCapture__Error, errorString string)) {
C.QImageCapture_connect_ErrorOccurred(this.h, C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QImageCapture_ErrorOccurred
func miqt_exec_callback_QImageCapture_ErrorOccurred(cb C.intptr_t, id C.int, error C.int, errorString C.struct_miqt_string) {
gofunc, ok := cgo.Handle(cb).Value().(func(id int, error QImageCapture__Error, errorString string))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := (int)(id)
slotval2 := (QImageCapture__Error)(error)
var errorString_ms C.struct_miqt_string = errorString
errorString_ret := C.GoStringN(errorString_ms.data, C.int(int64(errorString_ms.len)))
C.free(unsafe.Pointer(errorString_ms.data))
slotval3 := errorString_ret
gofunc(slotval1, slotval2, slotval3)
}
func (this *QImageCapture) ReadyForCaptureChanged(ready bool) {
C.QImageCapture_ReadyForCaptureChanged(this.h, (C.bool)(ready))
}
func (this *QImageCapture) OnReadyForCaptureChanged(slot func(ready bool)) {
C.QImageCapture_connect_ReadyForCaptureChanged(this.h, C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QImageCapture_ReadyForCaptureChanged
func miqt_exec_callback_QImageCapture_ReadyForCaptureChanged(cb C.intptr_t, ready C.bool) {
gofunc, ok := cgo.Handle(cb).Value().(func(ready bool))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := (bool)(ready)
gofunc(slotval1)
}
func (this *QImageCapture) MetaDataChanged() {
C.QImageCapture_MetaDataChanged(this.h)
}
func (this *QImageCapture) OnMetaDataChanged(slot func()) {
C.QImageCapture_connect_MetaDataChanged(this.h, C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QImageCapture_MetaDataChanged
func miqt_exec_callback_QImageCapture_MetaDataChanged(cb C.intptr_t) {
gofunc, ok := cgo.Handle(cb).Value().(func())
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
gofunc()
}
func (this *QImageCapture) FileFormatChanged() {
C.QImageCapture_FileFormatChanged(this.h)
}
func (this *QImageCapture) OnFileFormatChanged(slot func()) {
C.QImageCapture_connect_FileFormatChanged(this.h, C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QImageCapture_FileFormatChanged
func miqt_exec_callback_QImageCapture_FileFormatChanged(cb C.intptr_t) {
gofunc, ok := cgo.Handle(cb).Value().(func())
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
gofunc()
}
func (this *QImageCapture) QualityChanged() {
C.QImageCapture_QualityChanged(this.h)
}
func (this *QImageCapture) OnQualityChanged(slot func()) {
C.QImageCapture_connect_QualityChanged(this.h, C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QImageCapture_QualityChanged
func miqt_exec_callback_QImageCapture_QualityChanged(cb C.intptr_t) {
gofunc, ok := cgo.Handle(cb).Value().(func())
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
gofunc()
}
func (this *QImageCapture) ResolutionChanged() {
C.QImageCapture_ResolutionChanged(this.h)
}
func (this *QImageCapture) OnResolutionChanged(slot func()) {
C.QImageCapture_connect_ResolutionChanged(this.h, C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QImageCapture_ResolutionChanged
func miqt_exec_callback_QImageCapture_ResolutionChanged(cb C.intptr_t) {
gofunc, ok := cgo.Handle(cb).Value().(func())
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
gofunc()
}
func (this *QImageCapture) ImageExposed(id int) {
C.QImageCapture_ImageExposed(this.h, (C.int)(id))
}
func (this *QImageCapture) OnImageExposed(slot func(id int)) {
C.QImageCapture_connect_ImageExposed(this.h, C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QImageCapture_ImageExposed
func miqt_exec_callback_QImageCapture_ImageExposed(cb C.intptr_t, id C.int) {
gofunc, ok := cgo.Handle(cb).Value().(func(id int))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := (int)(id)
gofunc(slotval1)
}
func (this *QImageCapture) ImageCaptured(id int, preview *qt6.QImage) {
C.QImageCapture_ImageCaptured(this.h, (C.int)(id), (*C.QImage)(preview.UnsafePointer()))
}
func (this *QImageCapture) OnImageCaptured(slot func(id int, preview *qt6.QImage)) {
C.QImageCapture_connect_ImageCaptured(this.h, C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QImageCapture_ImageCaptured
func miqt_exec_callback_QImageCapture_ImageCaptured(cb C.intptr_t, id C.int, preview *C.QImage) {
gofunc, ok := cgo.Handle(cb).Value().(func(id int, preview *qt6.QImage))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := (int)(id)
slotval2 := qt6.UnsafeNewQImage(unsafe.Pointer(preview))
gofunc(slotval1, slotval2)
}
func (this *QImageCapture) ImageMetadataAvailable(id int, metaData *QMediaMetaData) {
C.QImageCapture_ImageMetadataAvailable(this.h, (C.int)(id), metaData.cPointer())
}
func (this *QImageCapture) OnImageMetadataAvailable(slot func(id int, metaData *QMediaMetaData)) {
C.QImageCapture_connect_ImageMetadataAvailable(this.h, C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QImageCapture_ImageMetadataAvailable
func miqt_exec_callback_QImageCapture_ImageMetadataAvailable(cb C.intptr_t, id C.int, metaData *C.QMediaMetaData) {
gofunc, ok := cgo.Handle(cb).Value().(func(id int, metaData *QMediaMetaData))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := (int)(id)
slotval2 := UnsafeNewQMediaMetaData(unsafe.Pointer(metaData))
gofunc(slotval1, slotval2)
}
func (this *QImageCapture) ImageAvailable(id int, frame *QVideoFrame) {
C.QImageCapture_ImageAvailable(this.h, (C.int)(id), frame.cPointer())
}
func (this *QImageCapture) OnImageAvailable(slot func(id int, frame *QVideoFrame)) {
C.QImageCapture_connect_ImageAvailable(this.h, C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QImageCapture_ImageAvailable
func miqt_exec_callback_QImageCapture_ImageAvailable(cb C.intptr_t, id C.int, frame *C.QVideoFrame) {
gofunc, ok := cgo.Handle(cb).Value().(func(id int, frame *QVideoFrame))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := (int)(id)
slotval2 := UnsafeNewQVideoFrame(unsafe.Pointer(frame))
gofunc(slotval1, slotval2)
}
func (this *QImageCapture) ImageSaved(id int, fileName string) {
fileName_ms := C.struct_miqt_string{}
fileName_ms.data = C.CString(fileName)
fileName_ms.len = C.size_t(len(fileName))
defer C.free(unsafe.Pointer(fileName_ms.data))
C.QImageCapture_ImageSaved(this.h, (C.int)(id), fileName_ms)
}
func (this *QImageCapture) OnImageSaved(slot func(id int, fileName string)) {
C.QImageCapture_connect_ImageSaved(this.h, C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QImageCapture_ImageSaved
func miqt_exec_callback_QImageCapture_ImageSaved(cb C.intptr_t, id C.int, fileName C.struct_miqt_string) {
gofunc, ok := cgo.Handle(cb).Value().(func(id int, fileName string))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := (int)(id)
var fileName_ms C.struct_miqt_string = fileName
fileName_ret := C.GoStringN(fileName_ms.data, C.int(int64(fileName_ms.len)))
C.free(unsafe.Pointer(fileName_ms.data))
slotval2 := fileName_ret
gofunc(slotval1, slotval2)
}
func QImageCapture_Tr2(s string, c string) string {
s_Cstring := C.CString(s)
defer C.free(unsafe.Pointer(s_Cstring))
c_Cstring := C.CString(c)
defer C.free(unsafe.Pointer(c_Cstring))
var _ms C.struct_miqt_string = C.QImageCapture_Tr2(s_Cstring, c_Cstring)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func QImageCapture_Tr3(s string, c string, n int) string {
s_Cstring := C.CString(s)
defer C.free(unsafe.Pointer(s_Cstring))
c_Cstring := C.CString(c)
defer C.free(unsafe.Pointer(c_Cstring))
var _ms C.struct_miqt_string = C.QImageCapture_Tr3(s_Cstring, c_Cstring, (C.int)(n))
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func (this *QImageCapture) CaptureToFile1(location string) int {
location_ms := C.struct_miqt_string{}
location_ms.data = C.CString(location)
location_ms.len = C.size_t(len(location))
defer C.free(unsafe.Pointer(location_ms.data))
return (int)(C.QImageCapture_CaptureToFile1(this.h, location_ms))
}
// Delete this object from C++ memory.
func (this *QImageCapture) Delete() {
C.QImageCapture_Delete(this.h)
}
// 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 *QImageCapture) GoGC() {
runtime.SetFinalizer(this, func(this *QImageCapture) {
this.Delete()
runtime.KeepAlive(this.h)
})
}