miqt/qt/multimedia/gen_qcameraviewfindersettings.go

143 lines
4.5 KiB
Go
Raw Normal View History

2024-11-04 10:15:32 +00:00
package multimedia
/*
#include "gen_qcameraviewfindersettings.h"
#include <stdlib.h>
*/
import "C"
import (
"github.com/mappu/miqt/qt"
"runtime"
"unsafe"
)
type QCameraViewfinderSettings struct {
2024-11-19 06:29:06 +00:00
h *C.QCameraViewfinderSettings
isSubclass bool
2024-11-04 10:15:32 +00:00
}
func (this *QCameraViewfinderSettings) cPointer() *C.QCameraViewfinderSettings {
if this == nil {
return nil
}
return this.h
}
func (this *QCameraViewfinderSettings) UnsafePointer() unsafe.Pointer {
if this == nil {
return nil
}
return unsafe.Pointer(this.h)
}
2024-11-19 06:29:06 +00:00
// newQCameraViewfinderSettings constructs the type using only CGO pointers.
2024-11-04 10:15:32 +00:00
func newQCameraViewfinderSettings(h *C.QCameraViewfinderSettings) *QCameraViewfinderSettings {
if h == nil {
return nil
}
2024-12-07 04:15:57 +00:00
2024-11-04 10:15:32 +00:00
return &QCameraViewfinderSettings{h: h}
}
2024-11-19 06:29:06 +00:00
// UnsafeNewQCameraViewfinderSettings constructs the type using only unsafe pointers.
2024-11-04 10:15:32 +00:00
func UnsafeNewQCameraViewfinderSettings(h unsafe.Pointer) *QCameraViewfinderSettings {
2024-12-07 04:15:57 +00:00
return newQCameraViewfinderSettings((*C.QCameraViewfinderSettings)(h))
2024-11-04 10:15:32 +00:00
}
// NewQCameraViewfinderSettings constructs a new QCameraViewfinderSettings object.
func NewQCameraViewfinderSettings() *QCameraViewfinderSettings {
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQCameraViewfinderSettings(C.QCameraViewfinderSettings_new())
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
2024-11-04 10:15:32 +00:00
}
// NewQCameraViewfinderSettings2 constructs a new QCameraViewfinderSettings object.
func NewQCameraViewfinderSettings2(other *QCameraViewfinderSettings) *QCameraViewfinderSettings {
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQCameraViewfinderSettings(C.QCameraViewfinderSettings_new2(other.cPointer()))
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
2024-11-04 10:15:32 +00:00
}
func (this *QCameraViewfinderSettings) OperatorAssign(other *QCameraViewfinderSettings) {
C.QCameraViewfinderSettings_OperatorAssign(this.h, other.cPointer())
}
func (this *QCameraViewfinderSettings) Swap(other *QCameraViewfinderSettings) {
C.QCameraViewfinderSettings_Swap(this.h, other.cPointer())
}
func (this *QCameraViewfinderSettings) IsNull() bool {
return (bool)(C.QCameraViewfinderSettings_IsNull(this.h))
}
func (this *QCameraViewfinderSettings) Resolution() *qt.QSize {
_goptr := qt.UnsafeNewQSize(unsafe.Pointer(C.QCameraViewfinderSettings_Resolution(this.h)))
2024-11-04 10:15:32 +00:00
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QCameraViewfinderSettings) SetResolution(resolution *qt.QSize) {
C.QCameraViewfinderSettings_SetResolution(this.h, (*C.QSize)(resolution.UnsafePointer()))
}
func (this *QCameraViewfinderSettings) SetResolution2(width int, height int) {
C.QCameraViewfinderSettings_SetResolution2(this.h, (C.int)(width), (C.int)(height))
}
func (this *QCameraViewfinderSettings) MinimumFrameRate() float64 {
return (float64)(C.QCameraViewfinderSettings_MinimumFrameRate(this.h))
}
func (this *QCameraViewfinderSettings) SetMinimumFrameRate(rate float64) {
C.QCameraViewfinderSettings_SetMinimumFrameRate(this.h, (C.double)(rate))
}
func (this *QCameraViewfinderSettings) MaximumFrameRate() float64 {
return (float64)(C.QCameraViewfinderSettings_MaximumFrameRate(this.h))
}
func (this *QCameraViewfinderSettings) SetMaximumFrameRate(rate float64) {
C.QCameraViewfinderSettings_SetMaximumFrameRate(this.h, (C.double)(rate))
}
func (this *QCameraViewfinderSettings) PixelFormat() QVideoFrame__PixelFormat {
return (QVideoFrame__PixelFormat)(C.QCameraViewfinderSettings_PixelFormat(this.h))
}
func (this *QCameraViewfinderSettings) SetPixelFormat(format QVideoFrame__PixelFormat) {
C.QCameraViewfinderSettings_SetPixelFormat(this.h, (C.int)(format))
}
func (this *QCameraViewfinderSettings) PixelAspectRatio() *qt.QSize {
_goptr := qt.UnsafeNewQSize(unsafe.Pointer(C.QCameraViewfinderSettings_PixelAspectRatio(this.h)))
2024-11-04 10:15:32 +00:00
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QCameraViewfinderSettings) SetPixelAspectRatio(ratio *qt.QSize) {
C.QCameraViewfinderSettings_SetPixelAspectRatio(this.h, (*C.QSize)(ratio.UnsafePointer()))
}
func (this *QCameraViewfinderSettings) SetPixelAspectRatio2(horizontal int, vertical int) {
C.QCameraViewfinderSettings_SetPixelAspectRatio2(this.h, (C.int)(horizontal), (C.int)(vertical))
}
// Delete this object from C++ memory.
func (this *QCameraViewfinderSettings) Delete() {
2024-11-19 06:29:06 +00:00
C.QCameraViewfinderSettings_Delete(this.h, C.bool(this.isSubclass))
2024-11-04 10:15:32 +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 *QCameraViewfinderSettings) GoGC() {
runtime.SetFinalizer(this, func(this *QCameraViewfinderSettings) {
this.Delete()
runtime.KeepAlive(this.h)
})
}