// Package gdk was automatically generated by github.com/bnema/puregotk DO NOT EDIT package gdk import ( "structs" "unsafe" "github.com/ebitengine/purego" "github.com/bnema/puregotk/pkg/core" "github.com/bnema/puregotk/v4/glib" "github.com/bnema/puregotk/v4/gobject" "github.com/bnema/puregotk/v4/gobject/types" ) type CicpParamsClass struct { _ structs.HostLayout } func (x *CicpParamsClass) GoPointer() uintptr { return uintptr(unsafe.Pointer(x)) } // The values of this enumeration describe whether image data uses // the full range of 8-bit values. // // In digital broadcasting, it is common to reserve the lowest and // highest values. Typically the allowed values for the narrow range // are 16-235 for Y and 16-240 for u,v (when dealing with YUV data). type CicpRange int var xCicpRangeGLibType func() types.GType func CicpRangeGLibType() types.GType { return xCicpRangeGLibType() } const ( // The values use the range of 16-235 (for Y) and 16-240 for u and v. CicpRangeNarrowValue CicpRange = 0 // The values use the full range. CicpRangeFullValue CicpRange = 1 ) // Contains the parameters that define a colorstate with cicp parameters. // // Cicp parameters are specified in the ITU-T H.273 // [specification](https://www.itu.int/rec/T-REC-H.273/en). // // See the documentation of individual properties for supported values. // // The 'unspecified' value (2) is not treated in any special way, and // must be replaced by a different value before creating a color state. // // `GdkCicpParams` can be used as a builder object to construct a color // state from Cicp data with [method@Gdk.CicpParams.build_color_state]. // The function will return an error if the given parameters are not // supported. // // You can obtain a `GdkCicpParams` object from a color state with // [method@Gdk.ColorState.create_cicp_params]. This can be used to // create a variant of a color state, by changing just one of the cicp // parameters, or just to obtain information about the color state. type CicpParams struct { gobject.Object } var xCicpParamsGLibType func() types.GType func CicpParamsGLibType() types.GType { return xCicpParamsGLibType() } func CicpParamsNewFromInternalPtr(ptr uintptr) *CicpParams { cls := &CicpParams{} cls.Ptr = ptr return cls } var xNewCicpParams func() uintptr // Creates a new `GdkCicpParams` object. // // The initial values of the properties are the values for "undefined" // and need to be set before a color state object can be built. func NewCicpParams() *CicpParams { var cls *CicpParams cret := xNewCicpParams() if cret == 0 { return nil } cls = &CicpParams{} cls.Ptr = cret return cls } var xCicpParamsBuildColorState func(uintptr) *ColorState // Creates a new `GdkColorState` object for the cicp parameters in @self. // // Note that this may fail if the cicp parameters in @self are not // supported by GTK. In that case, `NULL` is returned, and @error is set // with an error message that can be presented to the user. func (x *CicpParams) BuildColorState() (*ColorState, error) { var cerr *glib.Error cret := xCicpParamsBuildColorState(x.GoPointer()) if cerr == nil { return cret, nil } return cret, cerr } var xCicpParamsGetColorPrimaries func(uintptr) uint // Returns the value of the color-primaries property // of @self. func (x *CicpParams) GetColorPrimaries() uint { cret := xCicpParamsGetColorPrimaries(x.GoPointer()) return cret } var xCicpParamsGetMatrixCoefficients func(uintptr) uint // Gets the matrix-coefficients property of @self. func (x *CicpParams) GetMatrixCoefficients() uint { cret := xCicpParamsGetMatrixCoefficients(x.GoPointer()) return cret } var xCicpParamsGetRange func(uintptr) CicpRange // Gets the range property of @self. func (x *CicpParams) GetRange() CicpRange { cret := xCicpParamsGetRange(x.GoPointer()) return cret } var xCicpParamsGetTransferFunction func(uintptr) uint // Gets the transfer-function property of @self. func (x *CicpParams) GetTransferFunction() uint { cret := xCicpParamsGetTransferFunction(x.GoPointer()) return cret } var xCicpParamsSetColorPrimaries func(uintptr, uint) // Sets the color-primaries property of @self. func (x *CicpParams) SetColorPrimaries(ColorPrimariesVar uint) { xCicpParamsSetColorPrimaries(x.GoPointer(), ColorPrimariesVar) } var xCicpParamsSetMatrixCoefficients func(uintptr, uint) // @self a `GdkCicpParams` // Sets the matrix-coefficients property of @self. func (x *CicpParams) SetMatrixCoefficients(MatrixCoefficientsVar uint) { xCicpParamsSetMatrixCoefficients(x.GoPointer(), MatrixCoefficientsVar) } var xCicpParamsSetRange func(uintptr, CicpRange) // Sets the range property of @self func (x *CicpParams) SetRange(RangeVar CicpRange) { xCicpParamsSetRange(x.GoPointer(), RangeVar) } var xCicpParamsSetTransferFunction func(uintptr, uint) // Sets the transfer-function property of @self. func (x *CicpParams) SetTransferFunction(TransferFunctionVar uint) { xCicpParamsSetTransferFunction(x.GoPointer(), TransferFunctionVar) } func (c *CicpParams) GoPointer() uintptr { if c == nil { return 0 } return c.Ptr } func (c *CicpParams) SetGoPointer(ptr uintptr) { c.Ptr = ptr } // SetPropertyColorPrimaries sets the "color-primaries" property. // The color primaries to use. // // Supported values: // // - 1: BT.709 / sRGB // - 2: unspecified // - 5: PAL // - 6,7: BT.601 / NTSC // - 9: BT.2020 // - 12: Display P3 func (x *CicpParams) SetPropertyColorPrimaries(value uint) { var v gobject.Value v.Init(gobject.TypeUintVal) v.SetUint(value) x.SetProperty("color-primaries", &v) } // GetPropertyColorPrimaries gets the "color-primaries" property. // The color primaries to use. // // Supported values: // // - 1: BT.709 / sRGB // - 2: unspecified // - 5: PAL // - 6,7: BT.601 / NTSC // - 9: BT.2020 // - 12: Display P3 func (x *CicpParams) GetPropertyColorPrimaries() uint { var v gobject.Value x.GetProperty("color-primaries", &v) return v.GetUint() } // SetPropertyMatrixCoefficients sets the "matrix-coefficients" property. // The matrix coefficients (for YUV to RGB conversion). // // Supported values: // // - 0: RGB // - 1: BT.709 // - 2: unspecified // - 5,6: BT.601 // - 9: BT.2020 func (x *CicpParams) SetPropertyMatrixCoefficients(value uint) { var v gobject.Value v.Init(gobject.TypeUintVal) v.SetUint(value) x.SetProperty("matrix-coefficients", &v) } // GetPropertyMatrixCoefficients gets the "matrix-coefficients" property. // The matrix coefficients (for YUV to RGB conversion). // // Supported values: // // - 0: RGB // - 1: BT.709 // - 2: unspecified // - 5,6: BT.601 // - 9: BT.2020 func (x *CicpParams) GetPropertyMatrixCoefficients() uint { var v gobject.Value x.GetProperty("matrix-coefficients", &v) return v.GetUint() } // SetPropertyTransferFunction sets the "transfer-function" property. // The transfer function to use. // // Supported values: // // - 1,6,14,15: BT.709, BT.601, BT.2020 // - 2: unspecified // - 4: gamma 2.2 // - 5: gamma 2.8 // - 8: linear // - 13: sRGB // - 16: BT.2100 PQ // - 18: BT.2100 HLG func (x *CicpParams) SetPropertyTransferFunction(value uint) { var v gobject.Value v.Init(gobject.TypeUintVal) v.SetUint(value) x.SetProperty("transfer-function", &v) } // GetPropertyTransferFunction gets the "transfer-function" property. // The transfer function to use. // // Supported values: // // - 1,6,14,15: BT.709, BT.601, BT.2020 // - 2: unspecified // - 4: gamma 2.2 // - 5: gamma 2.8 // - 8: linear // - 13: sRGB // - 16: BT.2100 PQ // - 18: BT.2100 HLG func (x *CicpParams) GetPropertyTransferFunction() uint { var v gobject.Value x.GetProperty("transfer-function", &v) return v.GetUint() } func init() { core.SetPackageName("GDK", "gtk4") core.SetSharedLibraries("GDK", []string{"libgtk-4.so.1"}) var libs []uintptr for _, libPath := range core.GetPaths("GDK") { lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL) if err != nil { panic(err) } libs = append(libs, lib) } core.PuregoSafeRegister(&xCicpRangeGLibType, libs, "gdk_cicp_range_get_type") core.PuregoSafeRegister(&xCicpParamsGLibType, libs, "gdk_cicp_params_get_type") core.PuregoSafeRegister(&xNewCicpParams, libs, "gdk_cicp_params_new") core.PuregoSafeRegister(&xCicpParamsBuildColorState, libs, "gdk_cicp_params_build_color_state") core.PuregoSafeRegister(&xCicpParamsGetColorPrimaries, libs, "gdk_cicp_params_get_color_primaries") core.PuregoSafeRegister(&xCicpParamsGetMatrixCoefficients, libs, "gdk_cicp_params_get_matrix_coefficients") core.PuregoSafeRegister(&xCicpParamsGetRange, libs, "gdk_cicp_params_get_range") core.PuregoSafeRegister(&xCicpParamsGetTransferFunction, libs, "gdk_cicp_params_get_transfer_function") core.PuregoSafeRegister(&xCicpParamsSetColorPrimaries, libs, "gdk_cicp_params_set_color_primaries") core.PuregoSafeRegister(&xCicpParamsSetMatrixCoefficients, libs, "gdk_cicp_params_set_matrix_coefficients") core.PuregoSafeRegister(&xCicpParamsSetRange, libs, "gdk_cicp_params_set_range") core.PuregoSafeRegister(&xCicpParamsSetTransferFunction, libs, "gdk_cicp_params_set_transfer_function") }